Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -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

View file

@ -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]