Commit | Line | Data |
---|---|---|
5aa10005 RD |
1 | Programming languages were at one point a flourishing research area. In some areanas, they still are. |
2 | It is difficult to get a programming language "right." Parenscript is fortunate in that it is | |
3 | modelled after a language to which many people have contributed a great deal over many decades. | |
4 | ||
5 | Most of the links and notes below refer to ideas about Common Lisp. Some are about Javascript, | |
6 | the target programming language and environment for Parenscript. | |
7 | ||
8 | ||
9 | Strange Javascript Semantics | |
10 | =========================================================================== | |
11 | var x = 1; | |
12 | function foo() { | |
13 | if (x == ONE_OR_NOT_ONE) { var x = 3; } | |
14 | return "bleck: " + x; | |
15 | }; | |
16 | foo(); | |
17 | ||
18 | This code returns "bleck: undefined" when ONE_OR_NOT_ONE is 1 or 2. See | |
19 | http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf | |
20 | page 37 for an explanation of the semantics of variable scope. | |
21 | ||
22 | ||
23 | var x = 1; function foo(a) { return foo; var foo=5; } foo(3); | |
24 | ||
25 | => 'undefined' | |
26 | ||
27 | var x = 1; function foo(a) { return foo; } foo(3); | |
28 | ||
29 | => thee function foo | |
30 | ||
31 | ||
32 | ||
33 | ||
34 | Reference material | |
35 | =========================================================================== | |
36 | Macro Expansion in Lisp: | |
37 | Common Lisp the Language, 2nd Edition. | |
38 | http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node99.html | |
39 | ||
40 | File Compilation: | |
41 | http://www.lispworks.com/documentation/HyperSpec/Body/03_bca.htm | |
42 | ||
43 | Special forms in Lisp: | |
44 | CLHS | |
45 | http://www.lisp.org/HyperSpec/Body/sec_3-1-2-1-2-1.html | |
46 | ||
47 | block let* return-from | |
48 | catch load-time-value setq | |
49 | eval-when locally symbol-macrolet | |
50 | flet macrolet tagbody | |
51 | function multiple-value-call the | |
52 | go multiple-value-prog1 throw | |
53 | if progn unwind-protect | |
54 | labels progv | |
55 | let quote |