Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!ukc!edcastle!cs.ed.ac.uk!db From: db@cs.ed.ac.uk (Dave Berry) Newsgroups: comp.lang.misc Subject: Re: What ``first-class'' means in comp.lang.misc Message-ID: <4232@skye.cs.ed.ac.uk> Date: 9 Jan 91 13:35:37 GMT References: <25449:Jan823:00:2991@kramden.acf.nyu.edu> Sender: nnews@cs.ed.ac.uk Reply-To: db@lfcs.ed.ac.uk (Dave Berry) Organization: Laboratory for the Foundations of Computer Science, Edinburgh U Lines: 50 I don't believe it makes sense to define the attributes required for an entity to be first-class without parameterising the definition on a particular language. I would say that entities of a language L are first-class if all generic operations (i.e. not domain-specific operations) that can be applied to other entities of L can also be applied to the entities in question. In functional languages, this is often (erroneously) summarised as being able to pass entities to functions and return them from functions. Lennart pointed out that this definition is inadequate; for entities to be first-class it must be possible to write them anonymously. IMO, the previous discussion clearly shows that for entities in C to be first-class, it must be possible to allocate them dynamically. This makes sense - if there were "first-class" entities in C that couldn't be so allocated, while all/most other entities could be so allocated, then to what class would the allocatable entities belong? Super executive club class with a champagne breakfast? :-) The list of attributes given for first-class entities in Scheme may well be an accurate definition of what "first-class" means in Scheme. It doesn't mean (IMO) that entities in another language should have to satisfy those requirements to be first-class with respect to that language. Since most languages include procedures, functions, or similar constructs that involve passing arguments and returning values, it follows that this is a pretty common requirement for entities to be firt-class. I can't think of any language in which it is sufficient (though there may be such languages). >He also quotes Kent Dybvig: ``Procedures are first-class data objects >similar to strings or numbers; identifiers are bound to procedures in >the same way they are bound to other objects.'' If we take this as a >definition, then ``first-class'' means only the identity properties >listed by Clinger, and does not include argument passing. In most languages, entities are bound to identifiers when passed as arguments. In some languages, argument passing can be defined as a particular way of binding values to identifiers (Tennent's Principle of Correspondence). Possibly this applies to the language in question here. -- Dave Berry, LFCS, Edinburgh Uni. db%lfcs.ed.ac.uk@nsfnet-relay.ac.uk "The Berlin Wall; the border between East and West Germany. It's very narrow." "*Was* very narrow. Get your tenses right." -- Douglas Adams, THHGTTG.