This commit is contained in:
Ingy döt Net 2013-10-27 22:24:23 +00:00
parent 6f050a029e
commit 776bba907c
3887 changed files with 59894 additions and 7280 deletions

View file

@ -1,26 +1,19 @@
#define std'dictionary'*.
#define std'routines'*.
#define std'collections'*.
#define std'patterns'*.
#define system.
#define system'collections.
// --- Program ---
#symbol Program =
#symbol program =
[
// 1. Create
#var aMap := Dictionary.
aMap
append &dictionary_key:"key" &content:"foox"
append &dictionary_key:"key" &content:"foo"
append &dictionary_key:"key2" &content:"foo2"
append &dictionary_key:"key3" &content:"foo3"
append &dictionary_key:"key4" &content:"foo4".
#var aMap := Dictionary new.
aMap @ "key" << "foox".
aMap @ "key" << "foo".
aMap @ "key2" << "foo2".
aMap @ "key3" << "foo3".
aMap @ "key4" << "foo4".
(aMap enumerator)~foreach run: anItem =
[
'program'Output << anItem dictionary_key << " : " << anItem content << "%n".
].
// only values
Scan::aMap run: aValue = ('program'Output << avalue << "%n").
// Enumerate
control foreach:aMap &do: &&:aKeyValue
[ console write:(aKeyValue Key) write:" : " writeLine:(aKeyValue Value) ].
].