View/Edit #3059:range

Switch to edit mode.

Name(s): range
1:  " :range(function, min, max) => sequence"
2:  "Returns a sequence consisting of the return value of a given function for all integers [min..max].  For example:"
3:  " $func_utils:range(\"{x} = args; return x * 5;\", 1, 5);"
4:  " => {5, 10, 15, 20, 25}"
5:  {func, min, max} = args
6:  set_task_perms(caller_perms())
7:  retval = {}
8:  try
9:    vname = this:generate_lambda(func)
10:   for i in [min..max]
11:     retval = {@retval, $lambda_holder:(vname)(i)}
12:   endfor
13: finally
14:   `this:degenerate_lambda(vname) ! E_VARNF'
15: endtry
16: return retval
17: "Last modified by Lao-Tzu (#8084) on Sat Sep 28 18:39:07 2002 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]