-
-
Notifications
You must be signed in to change notification settings - Fork 4
indexing
pannous edited this page Nov 5, 2020
·
11 revisions
Angle offers
- zero based indexing (a b c)[1] == b
- one based indexing {a b c}#2 == b
- map field object accessors: *> {a:1 b:1}[a] == 1 *> {a:1 b:1}.a == 1 *> a in {a:1 b:1} *> a of {a:1 b:1}
The bracket version allows complex expressions, whereas '#' 'in' and 'of' bind tightly, so
1 + 1 in {1:2} == 1 + {1:2}['1'] == 1+1