On Nov 23, 2012, at 12:48, John Ehrman wrote:
>
> I'm not sure what "first-class" implies -- could you elaborate?
>
> As a tentative guess, I'd list (1) symbols, (2) control sections, (3)
> location counters. Perhaps anything that appears in the object module?

An admittedly incomplete Wikipedia article says:

    In programming language design, a first-class citizen (also
    object, entity, or value), in the context of a particular
    programming language, is an entity that can be constructed
    at run-time, passed as a parameter, returned from a subroutine,
    or assigned into a variable.

    The term was coined by Christopher Strachey in the context of
    “functions as first-class citizens” in the mid-1960s.

    -- http://en.wikipedia.org/wiki/First-class_citizen

In Rexx, it's easy: the only objects are strings.  Compound
variables and functions exist, but they can not be assigned
to variables.

LISP is even easier: LISP's only datatype is an S-expression.
Everything is an S-expression.  LISP programs themselves are
S-expressions.

Postscript is more complicated: It has numbers, strings,
functions, dictionaries, (others?), all of which can be
assigned to variables.  The ability to assign functions
to variables treads close to self-modifying code (as does
COBOL's (deprecated?) ALTER command).

The HLASM preprocessor has at least SETA, SETB, and SETC
expressions, which can be assigned to variables; and macros
which, AFAIK, can not be assigned to variables.

HLASM assembly has at least address expressions which can be
assigned (but only once) to variables by EQU, etc. and operation
codes, which can be assigned by OPSYN.

The predecessors of HLASM perhaps antedate Strachey's work.
Compatibility requires that nowadays HLASM continue to shun
more disciplined design.

Macros have many of the characteristics of functions, but
there's no way a macro invocation (or several) can be used
as (an) operand(s) in an expression.

-- gil

Reply via email to