[plt-scheme] let vs parameterize?

From: Yin-So Chen (yinso.chen at gmail.com)
Date: Mon Apr 16 17:01:25 EDT 2007

Thanks Robby - I will dig into these papers to learn more about custodians.


Thanks,
yinso

On 4/16/07, Robby Findler <robby at cs.uchicago.edu> wrote:
>
> Oh! Custodians are the mechanism we use to identify "principal"s for
> the purpose of reclaiming resources. Threads are one such resource.
>
> I suggest that you read these two papers to get an idea of the
> pragmatics of custodians:
>
>   http://www.ccs.neu.edu/scheme/pubs/icfp99-ffkf.pdf
>   http://www.cs.utah.edu/plt/publications/pldi04-ff.pdf
>
> They are really quite different than the other things (let, fluid-let,
> parameterize) you are asking about.
>
> Robby
>
> On 4/16/07, Yin-So Chen <yinso.chen at gmail.com> wrote:
> > They are both mentioned under the thread chapter in mzscheme doc hence I
> > thought they were related ;)  Under what situation do I need to think
> about
> > custodians?
> >
> > Thanks,
> > yinso
> >
> >
> >  On 4/16/07, Robby Findler <robby at cs.uchicago.edu> wrote:
> > > No, parameterize doesn't use custodians. They're independent of each
> > other.
> > >
> > > Robby
> > >
> > > On 4/16/07, Yin-So Chen <yinso.chen at gmail.com> wrote:
> > > > Thanks Robby/Carl (and Eric for answering privately) -
> > > >
> > > > here's a related question:  Does parameterize automatically uses a
> > custodian
> > > > (e.g. current-custodian) to manage resources or custodians have to
> be
> > used
> > > > explicitly?
> > > >
> > > >
> > > > On 4/16/07, Robby Findler < robby at cs.uchicago.edu> wrote:
> > > > > Another difference between parameters and fluid-let: in a
> fluid-let
> > > > > the values are not thread local, but in a parameter they are.
> > > > >
> > > > > Robby
> > > > >
> > > > > On 4/16/07, Carl Eastlund <cce at ccs.neu.edu > wrote:
> > > > > > On 4/16/07, Yin-So Chen < yinso.chen at gmail.com> wrote:
> > > > > > > What is the difference between using let vs parameterize?
> > > > > >
> > > > > > Let operates on bindings.  It creates a new name and binds it to
> a
> > > > > > value.  This affects code directly within the let-body that
> refers
> > to
> > > > > > the same name, providing it is not bound again ("shadowed")
> inside
> > the
> > > > > > let.
> > > > > >
> > > > > > Parameterize operates on parameters, which are values.  It takes
> an
> > > > > > existing parameter and makes it return a different value during
> the
> > > > > > execution of the body of the parameterize.  This affects any
> code
> > > > > > called during that execution, even if it's in a different
> function,
> > > > > > module, whatever, so long as it uses the same parameter value.
> > > > > >
> > > > > > > It seems that one can use let to manipulate parameter objects
> (at
> > > > least
> > > > > > > scheme doesn't forbid it) - any issues with using it?
> > > > > >
> > > > > > Let does not manipulate values at all.  It just binds names to
> > > > > > existing values.  It never changes values or their contents.
> > > > > >
> > > > > > >  How do I know whether or not something is a parameter versus
> a
> > > > variable?
> > > > > >
> > > > > > You could ask the same thing about numbers vs variables, or
> strings
> > vs
> > > > > > variables.  A variable is a name for a value.  That value might
> be
> > > > > > anything: number, string, list, parameter, etc.  But you should
> be
> > > > > > careful never to confuse the name with what it refers to.
> > > > > >
> > > > > > And in response to the followup email: fluid-let, like let,
> operates
> > > > > > on variables (names), not values.  Hence it would not be an
> > > > > > "extension" to make it work on parameters.  If you give the name
> of
> > a
> > > > > > parameter to fluid-let, it will change which parameter that name
> > > > > > refers to, not the contents of the current parameter.
> > > > > >
> > > > > > --
> > > > > > Carl Eastlund
> > > > > > _________________________________________________
> > > > > >   For list-related administrative tasks:
> > > > > >
> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > http://www.yinsochen.com
> > > > ...continuous learning...
> > >
> >
> >
> >
> >  --
> >
> > http://www.yinsochen.com
> > ...continuous learning...
>



-- 
http://www.yinsochen.com
...continuous learning...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070416/bd7e8444/attachment.html>

Posted on the users mailing list.