Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
start = .array~of("Rick", "Mike", "David", "Mark")
|
||||
new = map(start, .routines~reversit)
|
||||
call map new, .routines~sayit
|
||||
|
||||
|
||||
-- a function to perform an iterated callback over an array
|
||||
-- using the provided function. Returns an array containing
|
||||
-- each function result
|
||||
::routine map
|
||||
use strict arg array, function
|
||||
resultArray = .array~new(array~items)
|
||||
do item over array
|
||||
resultArray~append(function~call(item))
|
||||
end
|
||||
return resultArray
|
||||
|
||||
::routine reversit
|
||||
use arg string
|
||||
return string~reverse
|
||||
|
||||
::routine sayit
|
||||
use arg string
|
||||
say string
|
||||
return .true -- called as a function, so a result is required
|
||||
Loading…
Add table
Add a link
Reference in a new issue