-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGOTCHAS.txt
18 lines (15 loc) · 937 Bytes
/
GOTCHAS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
== [ foo bar ] [ implementation ] def
It's possible to define a function using multiple-word quote and quote that aren't consisted of words:
```
[ foo bar ] [ dup * ] def
[ 1 ] [ dup * ] def
```
but there's no way to call such a function.
For the rest of the language, I see no reason yet to distinct between single- and multi-expression quotes, so it might be a good idea to perform a check in `def`.
In Lisp, one of the seven primitive operators is `atom` that would return `t` only for single-word quotes.
== sequence index
It's a long-time discussion if 0 or 1 should be used to pick the first item from a list.
Even though that prevailingly languages went with 0 (except Lua to my knowledge), "first" is used to refer to it, and "second" is used to refer to the second one, despite 0 and 1 used to pick them.
This affects how items are picked from sequences:
odds 1 nth puts = outputs 0
[ 0 [ 1 [ 2 'false ] ] ] 2 nth puts = 1