->6.0

[ [args] -> commands ] [ [args] -> reporter ]

Creates and reports an anonymous procedure - a command or reporter - depending on the input. Within commands or reporter the listed args may be used just as you would use let or procedure variables. The variable names in args have the same restrictions as variable names of commands and reporters. In addition, they must not match the name of any let or procedure variable in their procedure.

Anonymous procedures are commonly used with the primitives foreach, map, reduce, filter, sort-by, and n-values. See those entries for example usage.

See the Anonymous Procedures section of the Programming Guide for details.

Take me to the full NetLogo Dictionary