Re: First-class data types (Kellom{ki Pertti)
Fri, 6 Mar 1992 10:27:01 GMT

          From comp.compilers

Related articles
Reference to "First-Class Data Type" (1992-02-18)
re: First-class data types lotus! (1992-03-05)
Re: First-class data types (1992-03-05)
Re: First-class data types (Raul Deluth Miller-Rockwell) (1992-03-06)
Re: First-class data types (1992-03-06)
Re: First-class data types (1992-03-05)
Re: First-class data types (1992-03-09)
Re: First-class data types (Norman P. Graham) (1992-03-11)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Kellom{ki Pertti)
Keywords: types
Organization: Tampere Univ. of Technology, Finland.
References: 92-02-085 92-03-024
Date: Fri, 6 Mar 1992 10:27:01 GMT

In article 92-03-024 lotus! (Bill Torcaso) writes:
          There is a nit to pick with the definition of 'first class datatype'
      that asserts any operation can be applied to any object of any first class
      datatype. Consider a language in which functions are first-class:

          What is the XOR of two functions? What is the AND of two functions?

The term `first class' is used in conjunction with Scheme to mean
that you can
    - store a first class value in a data structure
    - pass it as a parameter
    - perform to it any operations *that are defined for it*
    - some other things I may have missed

I would say that prohibiting passing a function as an argument
definitely makes it second class, whereas not defining some
operations, such as XOR, for it does not affect its fundamental
status. I do not view passing a value as a parameter as applying an
operation to the value, but as a entirely different thing.

There is a difference in a value being first class and a type
being first class. A first class datatype would mean by the
above definition that you can, for instance, pass a type as a
parameter. I tend to think that a `first class datatype' means a
type whose instances have a first class status, though.
Pertti Kellom\"aki (TeX format)
    Tampere Univ. of TeXnology
            Software Systems Lab
[Similar comments received from Geoffrey Clem and Markus Freericks. -John]

Post a followup to this message

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