[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: first-class names



On Friday, August 15, 2003 10:58 AM, Michael Vanier
[SMTP:mvanier@cs.caltech.edu] wrote:

> So why not have first-class names?

We do.  They're called "reference cells", or in Scheme, "boxes".

Think about what you want to do with these "first-class" names.  Think
of an optimized implementation.  They're just boxes, no?

> I'm thinking of situations where you might have a list of symbols
> representing names (or first-class names) and you might want to set
> their values to a given value, like mapping set! over the list of
> names.  Not having names as first-class entities makes that unduly
> hard.

I think you're thinking of situations where you might have a list of
boxes, and you might want to set their values to a given value, like
mapping set-box! over the boxes.

On Friday, August 15, 2003 10:22 AM, Michael Sperber
[SMTP:sperber@informatik.uni-tuebingen.de] wrote:

> I guess the explanation for Lisp hackers would be: in Scheme, symbols
> aren't names.

Or, better, "in Scheme, symbols aren't reference cells".

[Note, I think the following is due to Michael Sperber, as well, but the
attribution got lost in quotation limbo]:

> > Sure, that's exactly what LAMBDA does.  Just do
> >
> > (let ((foo 23))
> >   (let ((set-foo (lambda (x) (set! foo x))))
> >     ...))

Ta da!  We can implement boxes with lambda.  Easy stuff, right?

On Sunday, August 17, 2003 11:23 AM, mike@newhall.net
[SMTP:mike@newhall.net] wrote:

>     I guess the real question is can this be turned into something
> that provides some [more] of the benefits of the canonical
> implementation of first-class names without all the costs...

You mean boxes?

On Saturday, August 16, 2003 12:37 PM, Stephane Payrard
[SMTP:stef@payrard.net] wrote:

> Hum, can someone provide me with a definition of "first-class
> names" or give a pointer to such a definition? Google
> did let me down on that one.

I think they're just boxes or reference cells.

----
Kevin S. Millikin           Architecture Technology Corporation
Research Scientist          Specialists in Computer Architecture
(952)829-5864 x162          http://www.atcorp.com