Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -1,11 +1,11 @@
|
|||
Map empty = Map(int, text) # creates an empty map
|
||||
Map empty ← Map(int, text) # creates an empty map
|
||||
writeLine(empty)
|
||||
var longFruit = Map(int, text).of(1, "banana") # creates a map with the pair 1 => "banana"
|
||||
longFruit[2] = "melon" # associates a key of 2 with "melon"
|
||||
var longFruit ← Map(int, text).of(1, "banana") # creates a map with the pair 1 ⇒ "banana"
|
||||
longFruit[2] ← "melon" # associates a key of 2 with "melon"
|
||||
longFruit.insert(3, "avocado")
|
||||
writeLine(longFruit) # prints the map
|
||||
var shortFruit = int%text[4 => "kiwi", 5 => "apple"] # map creation using arrow notation
|
||||
var shortFruit ← int%text[4 ⇒ "kiwi", 5 ⇒ "apple"] # map creation using arrow notation
|
||||
writeLine(shortFruit[5]) # retrieves the value with a key of 5 and prints it out
|
||||
writeLine(shortFruit.length) # prints the number of entries
|
||||
writeLine(shortFruit) # prints the map
|
||||
writeLine(text%text["Italy" => "Rome", "France" => "Paris", "Germany" => "Berlin", "Spain" => "Madrid"])
|
||||
writeLine(text%text["Italy" ⇒ "Rome", "France" ⇒ "Paris", "Germany" ⇒ "Berlin", "Spain" ⇒ "Madrid"])
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ proc hashSet ind$ val$ . ar$[][] .
|
|||
return
|
||||
.
|
||||
.
|
||||
ar$[][] &= [ ind$ val$ ]
|
||||
.
|
||||
clothing$[][] = [ [ "type" "t-shirt" ] [ "color" "red" ] ]
|
||||
clothing$[][] &= [ "size" "xl" ]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
void local fn DoIt
|
||||
CFDictionaryRef dict1 = fn DictionaryWithObjects( @"Alpha", @"A", @"Bravo", @"B", @"Charlie", @"C", @"Delta", @"D", NULL )
|
||||
CFDictionaryRef dict1 = fn DictionaryWithObjects( @"Alpha", @"A", @"Bravo", @"B", @"Charlie", @"C", @"Delta", @"D", NULL ) // must be NULL-terminated
|
||||
|
||||
CFDictionaryRef dict2 = @{@"A":@"Alpha", @"B":@"Bravo", @"C":@"Charlie", @"D":@"Delta"}
|
||||
CFDictionaryRef dict2 = @{@"A":@"Alpha", @"B":@"Bravo", @"C":@"Charlie", @"D":@"Delta"} // shorthand syntax
|
||||
|
||||
CFMutableDictionaryRef dict3 = fn MutableDictionaryWithCapacity(0)
|
||||
CFMutableDictionaryRef dict3 = fn MutableDictionaryNew
|
||||
MutableDictionarySetObjectForKey( dict3, @"Alpha", @"A" )
|
||||
MutableDictionarySetObjectForKey( dict3, @"Bravo", @"B" )
|
||||
MutableDictionarySetObjectForKey( dict3, @"Charlie", @"C" )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue