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,17 @@
|
|||
-- in some movie script
|
||||
----------------------------------------
|
||||
-- Runs provided function on all elements of the provided list, returns results as new list
|
||||
-- @param {list} tList
|
||||
-- @param {symbol} cbFunc
|
||||
-- @param {object} [cbObj=_movie]
|
||||
-- @return {list}
|
||||
----------------------------------------
|
||||
on map (tList, cbFunc, cbObj)
|
||||
if voidP(cbObj) then cbObj = _movie
|
||||
res = []
|
||||
cnt = tList.count
|
||||
repeat with i = 1 to cnt
|
||||
res[i] = call(cbFunc, cbObj, tList[i])
|
||||
end repeat
|
||||
return res
|
||||
end
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
l = [1, 2, 3]
|
||||
|
||||
-- passes the built-in function 'sin' (which is a method of the _movie object) as argument to map
|
||||
res = map(l, #sin)
|
||||
|
||||
put res
|
||||
-- [0.8415, 0.9093, 0.1411]
|
||||
Loading…
Add table
Add a link
Reference in a new issue