Re: Reference to "First-Class Data Type" (Paul Stachour)
Thu, 20 Feb 1992 11:50:03 GMT

          From comp.compilers

Related articles
Reference to "First-Class Data Type" (1992-02-18)
Re: Reference to "First-Class Data Type" (1992-02-19)
Re: Reference to "First-Class Data Type" (1992-02-20)
Re: Reference to "First-Class Data Type" (1992-02-20)
Re: Reference to "First-Class Data Type" (1992-02-20)
Re: Reference to "First-Class Data Type" eric@tfs.COM (1992-02-22)
Re: Reference to "First-Class Data Type" spot@CS.CMU.EDU (1992-02-24)
Re: Reference to "First-Class Data Type" (1992-02-24)
Re: Reference to "First-Class Data Type" (1992-02-25)
[4 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Paul Stachour)
Keywords: types
Organization: SCTC
References: 92-02-085 92-02-090
Date: Thu, 20 Feb 1992 11:50:03 GMT writes:

>On 18 Feb 92 14:39:56 GMT, (Thomas F. Reid) said:
>> .. "First class datatype" ... Can someone give me the real definition and
>> possibly a reference to its origin?

>A first class type is one that can be manipulated in all ways permitted to
>any type in the language. For example, for procedures to be first class
>you must be able to store them in heap variables, pass them as arguments,

I have also used the term "first class datatype" in my classes for over 10
years. I also have used it in the same sense as above, that is: "For a
datatype 'd' to be 'first-class', then all operations allowed on any
object of any type in the language must be allowed on all objects 'o' of
datatype 'd'."

I use this when teaching Ada, in pointing out that procedures are not
first-class in Ada, or C, but they are in PL/I. Indeed in PL/I, one can
declare an item of type "entry" (the PL/I term that encompasses both
procedures and functions), and then one can assign to it, pass it to a
subroutine, call it, etc. And in most implementations of PL/I, everything
works fine. [The exception is one well-known implementation of PL/I that
though an entry could be implemented by passing just the addesss of the
code-body of the procedure, they forgot that when you pass an internal
procedure that can be called recusively, and that has access to
semi-globals on the stack of its static parent, then you need to pass the
environment also, in order that said local procedure can access the
correct generation of the semi-globals.]

However, I can't tell you either where I first heard the term. Sorry.

Paul Stachour SCTC, 1210 West County Rd E, Suite 100 Arden Hills, MN 55112-3739
                                                          [1]-(612) 482-7467
[I'd say that procedure pointers rather than procedures are first class
PL/I objects, just like they are in C. In other languages with 1st class
procedures, you can create procedures, not just pointers to them, at run
time. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.