[plt-scheme] cost of closure?

From: YC (yinso.chen at gmail.com)
Date: Thu May 31 18:44:28 EDT 2007

Am I inferring correctly that you are saying closure consumes a constant
factor of memory over struct, but otherwise doesn't necessarily hold onto
unnecessarily references from the stack?

Any other way besides closure & struct to create opaque compound value
objects?

Thanks,
yinso

On 5/31/07, Robby Findler <robby at cs.uchicago.edu> wrote:
>
> The size of a closure is proportional to the number of free variables
> in the function. A struct with an equivalent number of slots uses less
> memory, however.
>
> Robby
>
> On 5/31/07, YC <yinso.chen at gmail.com> wrote:
> >
> > On 5/31/07, Carl Eastlund <cce at ccs.neu.edu> wrote:
> > > > In principle, a closure is essentially a struct.  All that needs to
> be
> > > > stored is a code pointer and references to any free variables.  How
> > > > efficient this is in practice depends a lot on the particular
> > > > implementation.  Are you asking in general, or about PLT Scheme
> > > > specifically?
> >
> > I am specifically interested in PLT Scheme (general info is also of
> interest
> > but secondary).
> >
> >  Does closure hold references to the stack?  I've heard that Scheme
> doesn't
> > keep variables on the stack, but want to verify.
> >
> >  If closure is as efficient as a struct that's great - I am finding
> myself
> > leaning toward closure because it can be created anonymously and ad hoc,
> but
> > doing so with struct is a lot harder.
> >
> >  Thanks,
> >  yinso
> >
> >
> > _________________________________________________
> >   For list-related administrative tasks:
> >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070531/eb4f8fc0/attachment.html>

Posted on the users mailing list.