[plt-scheme] Question about closures

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Sat Jan 26 13:29:10 EST 2008

Grant, do you mean closures or continuations?  A closure is the
representation of a procedure value, just like a 32-bit word is often
the representation of a fixed-size integer.  It has the arity of
whatever function it represents.  A continuation is a specific
function representing the remainder of a computation.  It has the
arity of whatever context it represents.  At the top-level, an
expression can return any number of values, so the continuation should
accept any arity.

On Jan 26, 2008 1:07 PM, Grant Rettke <grettke at acm.org> wrote:
> I read a post in comp.lang.lisp where a fellow asked about the arity
> of closures.
> I looked at the result of procedure arity in DrScheme for a closure
> and a function:
> (procedure-arity (lambda () null))
> > 0
> {let/cc k
>     (procedure-arity k)}
> > #(struct:arity-at-least 0)
> Does this mean that closures can take more than one argument?
> Is this something that I should dig into the documentation to explain?
> If so, where?

Carl Eastlund

Posted on the users mailing list.