6Functionsπ i
( functionmaybe-id(param-id...)maybe-varsbody...+)
maybe-id =
| id
maybe-vars =
| #:vars(var-id...)
Produces an ECMAScript function. Each parameter param-id
is bound as a parameter in the ECMAScript environment, but is not
bound as a Racket variable.
If id is provided, it is the name of the function.
If maybe-vars is provided, each var-id is
initialized as an ECMAScript variable binding.
Return early from the enclosing function. If expr
is provided it will be the return value. This form is illegal outside
of a function body.
Binds to the ECMAScript this value for the current
execution context.
( callrefarg...)→(or/cvalue?void?)
arg:value?
Invokes the function from
ref. Each
arg is bound
to a formal parameter of the function in order. Surplus arguments
are ignored, and if insufficient arguments are passed the remaining
parameters will be
undefined .
The this value will be bound to the base of ref
if it is a reference, or to the function itself otherwise.
Invokes
ref as a constructor, with each
arg
bound to a formal parameter. Surplus arguments are ignored, and
any remaining parameters are bound to
undefined .
6.1Function Predicatesπ i
Returns #t if v is an ECMAScript function,
#f otherwise.
Returns #t if v is an ECMAScript function which
can be used in a new expression, #f otherwise.