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

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Sat, 10 Feb 2007 01:17:53 GMT
Message-ID: <539zh.4615$R71.68885_at_ursa-nb00s0.nbnet.nb.ca>


Marshall wrote:

> 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.

One can also cast an arbitrary int to a pointer to any kind of variable in C.

>>(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.

Hmmmm... I really have to find the time to go spelunking thru the SML world. Received on Sat Feb 10 2007 - 02:17:53 CET

Original text of this message