-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
24 lines (16 loc) · 1.1 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Expressions consist of lists and atoms.
Atoms can be:
1. Symbols: any sequence of characters not containing any spaces and not starting with a number.
2. String: "..."
3. Number
Atoms by default evaluate to themselves. Ie: symbols, strings & numbers, evaluate to themselves.
However, a symbol is unique in that it can be 'bound'. The language does *not* distinguish between a symbol bound to a "value" (like a number) and a function. (Not true anymore: a function is now defined as any symbol having non-zero precedence.)
Not true (what was I thinking?): A symbol is practically anything -- a single number/string; a list of atoms representing some set of operations (function), etc.
Lists are demarcated in two ways: (1) using traditional parentheses. (2) curly braces. Parentheses result in _immediate evaluation_, whereas curly braces are literal (unevaluated) lists.
Function application:
All symbols by default have precedence zero.
Some symbols have lower precedence than zero (+, -, /, *).
The symbol with the lowest precedence
Optionally enabled deferred/lazy evaluation.
Ref:
http://norvig.com/lispy.html