Re: Variables and closures (Was: Objects and Relations)

From: Marshall <marshall.spight_at_gmail.com>
Date: 9 Feb 2007 16:24:13 -0800
Message-ID: <1171067053.031921.123080_at_j27g2000cwj.googlegroups.com>


On Feb 9, 3:38 pm, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
> Marshall wrote:
>
> >http://en.wikipedia.org/wiki/First-class_object
>
> > (The word "object" in the title above is the generic
> > sense of the word, not the OOPL sense.)
>
> I respectfully suggest that variables are first-class in C++ (if not
> Java.) They certainly are in C--at least by the description given in the
> wikipedia article you cite.

Thinking about it, I agree: the thing you get back from malloc() is certainly first class and certainly anonymous. I dunno. C is so unprincipled in its approach to everything that it makes my brain hurt to think about it anymore.

> (Aside: Clicking through to the part wikipedia claims is about databases
> shows plenty of horseshit ends up in wikipedia. I don't see how an
> employment contract is any less "first class" than a company or an
> employee.)

The quality of articles in wikipedia exhibits a high dynamic range ...

> > In SML, the notion of a name and the notion of a
> > variable are completely decoupled. Names
> > are always bound to constants, however that
> > constant might be the identity of a variable.
>
> > Relational language discussions generally omit the
> > notion of first class variables, because they aren't
> > a great fit with relational semantics.
>
> I disagree. TTM is quite explicit that the only first class variables
> are relvars, is it not?

I don't claim to be an expert in TTM, despite having read it several times. But as I recall, TTM doesn't have first class rel*vars* though it certainly has first class relations. However I could simply be misremembering.

Note that "first class" in PLT doesn't necessarily mean "good"; it has more to do with how amenable to certain kinds of manipulation they are. I have argued elsewhere that variables should be kept second class to better enable integrity enforcement, for example. Although not everyone agrees.

Marshall Received on Sat Feb 10 2007 - 01:24:13 CET

Original text of this message