Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
|
|
@ -7,15 +7,15 @@
|
|||
(define empty-map #empty)
|
||||
|
||||
;;; creating associative array with values
|
||||
(define my-map (list->ff '(
|
||||
(define my-map (pairs->ff '(
|
||||
(1 . 100)
|
||||
(2 . 200)
|
||||
(7 . 777))))
|
||||
;;; or in short form (available from Ol version 2.1)
|
||||
(define my-map '{
|
||||
(1 . 100)
|
||||
(2 . 200)
|
||||
(7 . 777)})
|
||||
(define my-map {
|
||||
1 100
|
||||
2 200
|
||||
7 777})
|
||||
|
||||
;;; add new key-value pair to the existing associative array
|
||||
(define my-new-map (put my-map 'the-key 'the-value))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
mapping m = ([ "apple": "fruit", 17: "seventeen" ]);
|
||||
write("indices: %O\nvalues: %O\n17: %O\n",
|
||||
indices(m),
|
||||
values(m),
|
||||
m[17]);
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
mapping m2 = ([ "car": ([ "ford":17, "volvo":42 ]) ]);
|
||||
write("#ford: %O, #volvo: %O\n",
|
||||
m2->car->ford,
|
||||
m2["car"]["volvo"]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue