Re: First-class data types

norman@a.cs.okstate.edu (Norman Graham)
Thu, 5 Mar 1992 19:31:24 GMT

          From comp.compilers

Related articles
Reference to "First-Class Data Type" reid@vtopus.cs.vt.edu (1992-02-18)
re: First-class data types lotus!wildbill@uunet.uu.net (1992-03-05)
Re: First-class data types norman@a.cs.okstate.edu (1992-03-05)
Re: First-class data types rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell) (1992-03-06)
Re: First-class data types pk@cs.tut.fi (1992-03-06)
Re: First-class data types kend@data.rain.com (1992-03-05)
Re: First-class data types tmb@ai.mit.edu (1992-03-09)
Re: First-class data types norman@a.cs.okstate.edu (Norman P. Graham) (1992-03-11)
| List of all articles for this month |

Newsgroups: comp.compilers
From: norman@a.cs.okstate.edu (Norman Graham)
Keywords: types
Organization: Oklahoma State University
References: 92-02-085 92-03-024
Date: Thu, 5 Mar 1992 19:31:24 GMT

In article 92-03-024 Bill Torcaso writes:
>[Since many operators don't apply in any sensible way to functions]
>any language that admits arithmetic types and arithmetic operations will
>have a hard time supporting first-class types. And of course, once you
>subset the domain of datatypes and the operators that apply in each
>sub-domain, the definition loses all generality.


You've missed the point (or perhaps I missed the context of your
statement). 'First class datatypes' do not require the ability to pass
function values to the boolean XOR function; nor does it require the
ability to use function application with a numeric constant. These are
nonsensical operations that will be rejected by any reasonable
typechecker.


'First class datatypes' do require that the language allow values of these
types to appear in any syntactic construct in which other values may
occur. This occurs within the framework of a type system that catches
mistyped constructs.


So, you see, the important thing is not that functions can be passed to
XOR, but that functions can be bound as parameters (i.e. passed to
functions in general). Likewise, if you look at function application as an
operation that takes a function value and a parameter list, you'll see
that supplying an integer instead of a function value is mistyped.


--
Norman Graham


<norman@a.cs.okstate.edu> {cbosgd,rutgers}!okstate!norman
--


Post a followup to this message

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