|
function apply(integer f, sequence s)
|
|
-- apply function f to all elements of sequence s
|
|
for i = 1 to length(s) do
|
|
s[i] = call_func(f, {s[i]})
|
|
end for
|
|
return s
|
|
end function
|
|
|
|
function add1(integer x)
|
|
return x + 1
|
|
end function
|
|
|
|
? apply(routine_id("add1"),{1,2,3})
|