Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
// In Lasso associative arrays are called maps
|
||||
|
||||
// Define an empty map
|
||||
local(mymap = map)
|
||||
|
||||
// Define a map with content
|
||||
local(mymap = map(
|
||||
'one' = 'Monday',
|
||||
'2' = 'Tuesday',
|
||||
3 = 'Wednesday'
|
||||
))
|
||||
|
||||
// add elements to an existing map
|
||||
#mymap -> insert('fourth' = 'Thursday')
|
||||
|
||||
// retrieve a value from a map
|
||||
#mymap -> find('2') // Tuesday
|
||||
'<br />'
|
||||
#mymap -> find(3) // Wednesday, found by the key not the position
|
||||
'<br />'
|
||||
|
||||
// Get all keys from a map
|
||||
#mymap -> keys // staticarray(2, fourth, one, 3)
|
||||
'<br />'
|
||||
|
||||
// Iterate thru a map and get values
|
||||
with v in #mymap do {^
|
||||
#v
|
||||
'<br />'
|
||||
^}
|
||||
// Tuesday<br />Thursday<br />Monday<br />Wednesday<br />
|
||||
|
||||
// Perform actions on each value of a map
|
||||
#mymap -> foreach => {
|
||||
#1 -> uppercase
|
||||
#1 -> reverse
|
||||
}
|
||||
#mymap // map(2 = YADSEUT, fourth = YADSRUHT, one = YADNOM, 3 = YADSENDEW)
|
||||
Loading…
Add table
Add a link
Reference in a new issue