• Undefined in LISP

    From Daniel Cerqueira@21:1/5 to All on Fri Mar 21 22:47:38 2025
    In reading McCarthy's papers, there are things that struck me:

    0. The only purpose of NIL is to mark the end of a list. When
    representing falsity, McCarthy uses the symbol F .

    1. There are some references to an expression being undefined.

    I would like to know your thoughts, about what being undefined actually
    is. Should an undefined expression be represented by a symbol, or should
    an undefined expression be silent (without returning a symbol)?

    --
    The pioneers of a warless world are the youth that
    refuse military service. ~ Albert Einstein

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff Barnett@21:1/5 to Daniel Cerqueira on Fri Mar 21 18:28:55 2025
    On 3/21/2"025 4:47 PM, Daniel Cerqueira wrote:
    In reading McCarthy's papers, there are things that struck me:

    0. The only purpose of NIL is to mark the end of a list. When
    representing falsity, McCarthy uses the symbol F .

    NIL has always been a symbol that represented the empty list. A wee bit
    of experimental programing with early (middle or late) Lisps shows that
    it saves a lot of typing to 1) also have NIL be false and 2) let CAR and
    CDR applied to NIL be NIL. Point 1 was recognized and accepted by almost everyone early on. Point 2 was not adopted by some until around the
    early 1970s! In fact, CAR or CDR of NIL fired off a runtime error in dissenters' systems; this was the MAJOR source of error messages in
    those systems and it mostly caught mind farts, not cases where a value
    of NIL would have solved the problem.

    1. There are some references to an expression being undefined.

    I believe that undefined in that context has the same meaning you would
    find in the C spec or the Common Lisp spec: the behavior of the
    "undefined instance" is not defined and will be implementation dependent.

    I would like to know your thoughts, about what being undefined actually
    is. Should an undefined expression be represented by a symbol, or should
    an undefined expression be silent (without returning a symbol)?

    Virtually all modern Lisps use the IEEE floating point specs which
    define objects that represent plus and minus infinities of all available precision (single, double, etc.) and not-a-number; thus, it is possible
    to capture the results of an evaluation and validate that "it worked" or
    not. I've seen very very few cases of Lisp code that have used this
    capability - perhaps that is because very very few Lisp codes do
    extensive arithmetic or implement numeric analyses. There is also the
    fact that modern (and not so modern Lisps) provide extensive facilities
    to generate, catch, and handle typed errors. Those facilities provide
    much sharper methods to deal with evaluations that go awry.
    --
    Jeff Barnett

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alan Bawden@21:1/5 to All on Fri Mar 21 21:09:37 2025
    Daniel Cerqueira <dan.list@lispclub.com> writes:

    In reading McCarthy's papers, there are things that struck me:

    0. The only purpose of NIL is to mark the end of a list. When
    representing falsity, McCarthy uses the symbol F .

    Well, if we're talking about Lisp 1.5, the value of the variable F is the symbol NIL, which is the actual representation of falsity. McCarthy
    intended you to write "F" in M-expressions, which would become "F" (rather
    than "(QUOTE F)") as an S-expression, which would then return the value
    NIL (representing false) when evaluated.

    So NIL really is both the empty list and the representation of false.

    This is all explained in section 3.3 of the Lisp 1.5 manual (page 22),
    which includes the amusing statement: "The programmer may either accept
    this rule blindly or understand the following Humpty-Dumpty semantics."

    It goes on to explain that the value of the variable T is in fact the
    symbol *T*, and that the value of the variable *T* is also the symbol *T*,
    and the value of the variable NIL is again the symbol NIL.

    Subsequent Lisp dialects simplified a lot of this by eliminating
    M-expressions from the story, by setting the value of the variable T
    directly to the symbol T, and by eliminating the predefined variable F entirely.

    1. There are some references to an expression being undefined.

    I would like to know your thoughts, about what being undefined actually
    is. Should an undefined expression be represented by a symbol, or should
    an undefined expression be silent (without returning a symbol)?

    Various forms of this question have been asked for many programming
    language definitions, not just for Lisp. In the C community they will
    answer this question by telling you about "nasal demons". See <https://en.wikipedia.org/wiki/Undefined_behavior>.

    - Alan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Daniel Cerqueira on Sat Mar 22 01:54:03 2025
    On 2025-03-21, Daniel Cerqueira <dan.list@lispclub.com> wrote:
    In reading McCarthy's papers, there are things that struck me:

    0. The only purpose of NIL is to mark the end of a list. When
    representing falsity, McCarthy uses the symbol F .

    This is not explain properly until the Lisp 1.5 Programmer's Manual
    (1962), section 3.3 "Predicates and Truth in Lisp", where it gives the "Humpty-Dumpty semantics" (suggesting that the author thought the system
    being presented is hack, and viewing this aspect of it with some
    derision).

    It is there explained that the real Boolean values are the
    symbol *T* (including the asterisks) and NIL.

    The symbols T and F are variables.

    The manual quite literally contradicts itself because in
    an section 1.2 it still repeats the misleading information:

    In LISP, the values true and false are represented by the atomic
    symbols T and F, respec,tively.

    But then:

    3.3 Predicates and Truth in LISP

    Although the rule for translating M-expressions into S-expressions
    states that T is (QUOTE T), it was stated that in the system one must
    always write T instead. Similarly, one must write F rather than (QUOTE
    F). The programmer may either accept this rule blindly or understand
    the following Humpty-Dumpty semantics.

    In the LISP programming system there are two atomic symbols that
    represent truth and falsity respectively. These two atomic symbols are
    *T* and NIL. It is these symbols rather than T and F that are the
    actual value of all predicates in the system. This is mainly a coding
    convenience.

    The atomic symbols T and F have APVAL's whose values are *T* and NIL,
    respectively.

    More explanation follows; I invite you to find the document and look at
    that.

    1. There are some references to an expression being undefined.

    I strongly suspect that all those undefined situations corresponded
    to errors. Again in the Lisp 1.5 manual:

    6.3 Error Diagnostics

    When an error occurs in a LISP program, a diagnostic giving the
    nature of the error is printed out. The diagnostic gives the type of
    error, and the contents of certain registers at that time. In some
    cases a back-trace is also printed. This is a list of functions
    that were entered recursively but not completed at the time of the
    error. In most casee, the program continues with the next doublet.
    However, certain errors are fatal; in this case control is given to
    the monitor Overlord. Errors during Overlord also continue with
    Overlord. A complete list of error diagnostics is given below, with
    comments.

    The manual doesn't use the word undefined for many things.

    One curious example of "undefined" is that if none of the conditions
    in a COND are true, then the value of the expression is undefined.

    CAR and CDR of a non-cons are also undefined.

    No explicit documentation is given which states that these undefined
    situations correspond to the errors of section 6.3 above.

    However, the following text occurs which makes one such a connection.

    One of the errors that are diagnosed listed in 6.3 is under the
    category of Lap Errors:

    L 3 UNDEFINED SYMBOL

    So LISP 1.5 had an error for undefined symbols. And earlier, the
    section 1.4 (The LISP Meta-Language) has this text about free
    variables:
    n n
    For example, in the function of two variables /\[[x;y];x ;y ] the
    variable n is not bound. This is called a free variable. It may be
    regarded a s a parameter. Unless n has been given a value before
    trying to compute with this function, the value of the
    function must be undefined.

    OK, so in some abstract sense the value of the function is
    undefined; but LISP also has an UNDEFINED SYMBOL LAP error.

    What I don't know is whether this error would allow the computation to
    continue and what would the actual value then be.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Daniel Cerqueira on Sat Mar 22 03:25:42 2025
    On Fri, 21 Mar 2025 22:47:38 +0000, Daniel Cerqueira wrote:

    I would like to know your thoughts, about what being undefined actually
    is. Should an undefined expression be represented by a symbol, or should
    an undefined expression be silent (without returning a symbol)?

    Should an attempt to evaluate such an expression even terminate?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Cerqueira@21:1/5 to Lawrence D'Oliveiro on Sat Mar 22 12:07:14 2025
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 21 Mar 2025 22:47:38 +0000, Daniel Cerqueira wrote:

    I would like to know your thoughts, about what being undefined actually
    is. Should an undefined expression be represented by a symbol, or should
    an undefined expression be silent (without returning a symbol)?

    Should an attempt to evaluate such an expression even terminate?

    My opinion is that it should...

    --
    The pioneers of a warless world are the youth that
    refuse military service. ~ Albert Einstein

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Daniel Cerqueira on Sat Mar 22 12:55:15 2025
    Daniel Cerqueira <dan.list@lispclub.com> writes:
    Should an undefined expression be represented by a symbol, or should
    an undefined expression be silent (without returning a symbol)?

    Symbols are values in Lisp, so if an "undefined expression" returns a
    symbol, then it's not undefined. That symbol is the definition.

    Can you give an example of an undefined expression? In denotational
    semantics, a divergent expression is represented by the symbol ⊥ ("bottom", _|_ if the unicode glyph didn't show up for you). That's what happens
    if you try to evaluate something like 1/0. Bottom is not a value that
    is returned, but rather, it means the program fails. The runtime could
    handle it as a crash, an exception being raised, an infinite loop, etc.
    Those are all examples of divergence.

    I don't know if that is helpful for what you were asking. See also:

    https://en.wikibooks.org/wiki/Haskell/Denotational_semantics

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Daniel Cerqueira on Sat Mar 22 21:58:16 2025
    On Sat, 22 Mar 2025 12:07:14 +0000, Daniel Cerqueira wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 21 Mar 2025 22:47:38 +0000, Daniel Cerqueira wrote:

    I would like to know your thoughts, about what being undefined
    actually is. Should an undefined expression be represented by a
    symbol, or should an undefined expression be silent (without
    returning a symbol)?

    Should an attempt to evaluate such an expression even terminate?

    My opinion is that it should...

    So undefined behaviour cannot be really undefined, it must return some
    kind of value we are going to arbitrarily name as “undefined”?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Cerqueira@21:1/5 to Lawrence D'Oliveiro on Sun Mar 23 16:56:35 2025
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 22 Mar 2025 12:07:14 +0000, Daniel Cerqueira wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 21 Mar 2025 22:47:38 +0000, Daniel Cerqueira wrote:

    I would like to know your thoughts, about what being undefined
    actually is. Should an undefined expression be represented by a
    symbol, or should an undefined expression be silent (without
    returning a symbol)?

    Should an attempt to evaluate such an expression even terminate?

    My opinion is that it should...

    So undefined behaviour cannot be really undefined, it must return some
    kind of value we are going to arbitrarily name as “undefined”?

    Does every LISP S-expression need to have a value (need to be
    evaluated)? Is atributing a symbol to undefined behaviour needed?

    --
    The pioneers of a warless world are the youth that
    refuse military service. ~ Albert Einstein

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jeff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W9ucyBpbnRvIHNpZ25hbHMg YnV0IHlvdSBkbyBoYXZlIHRoZSANCmFiaWxpdHkgdG8gZXhhbWluZSByZXR1cm4gdmFsdWVz IHRvIHNlZSBpZiB0aGF0IHNwZWNpYWwgdG9rZW4gaXMgDQpyZXR1cm5lZC4gVHlwaWNhbGx5 LCB5b3UgYXJlIGFibGUgdG8gY2hvb3NlIHRoZSBiZWhhdmlvciB5b3UgZGVzaXJlIA0Kd2l0 aGluIGNlcnRhaW4gc2FmZXR5IHNldHRpbmdzLg0KLS0gDQpKZWZmIEJhcm5ldHQNCg0K

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Paul Rubin on Sun Mar 23 18:54:45 2025
    Paul Rubin <no.email@nospam.invalid> wrote or quoted:
    Can you give an example of an undefined expression? In denotational >semantics, a divergent expression is represented by the symbol ⊥ ("bottom", >_|_ if the unicode glyph didn't show up for you).

    "Undefined expression" may be short for "an expression the ... of
    which is not defined", and "..." could be "meaning" or "value". So,
    if no value is defined, it could indeed be represented by "bottom".

    However, a kind of one-to-one implementation of domain theory domains
    may not always be most appropriate in practical programming . . .

    |/Primitive/ domains may be formed by adjoining to finite or
    |denumerable sets such as { true, false }, or { ... , 2, -1, 0,
    |1, 2, ...} two special objects "_" (termed /bottom/, representing
    |information which is completely undetermined) and "¯" (termed
    |/top/, representing information which is inconsistent or
    |overdetermined).
    |
    |The following may then be considered as primitive domains:
    |N = { . . . , -2 , -1 , 0 , 1 , 2 , . . . }° integers
    |T = { true, false}° truth values
    |H = {"a", " b " , . . . }° characters
    |
    |where {...}° denotes the augmentation of the set by _ and ¯.
    |
    |In such domains the notion of approximation is very
    |elementary: _ approximates all elements, all elements
    |approximate ¯, and all other pairs are incomparable; hence
    |there are no nontrivial limits or recursive definitions of
    |elements in primitive domains, and the added structure is
    |needed merely to satisfy the general requirements of the
    |axioms and provide a basis for construction of more complex
    |domains.
    |
    "The Denotational Semantics of Programming Languages" (1976),
    R. D. Tennent.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Daniel Cerqueira on Sun Mar 23 23:32:16 2025
    On Sun, 23 Mar 2025 16:56:35 +0000, Daniel Cerqueira wrote:

    Does every LISP S-expression need to have a value (need to be
    evaluated)? Is atributing a symbol to undefined behaviour needed?

    Which is why I said, the natural way to have an “undefined” value is for the computation not to terminate at all.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Stefan Ram on Sun Mar 23 23:33:56 2025
    On 23 Mar 2025 18:54:45 GMT, Stefan Ram wrote:

    ... two special objects "_" (termed /bottom/, representing |information
    which is completely undetermined) and "¯" (termed |/top/, representing information which is inconsistent or |overdetermined).

    In denotational semantics class, I was taught to write them as “⊥” and “⊤”.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Mon Mar 24 06:50:16 2025
    On 2025-03-23, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Sun, 23 Mar 2025 16:56:35 +0000, Daniel Cerqueira wrote:

    Does every LISP S-expression need to have a value (need to be
    evaluated)? Is atributing a symbol to undefined behaviour needed?

    Which is why I said, the natural way to have an “undefined” value is for the computation not to terminate at all.

    Not to terminate at all means to go into an infinite loop or some
    hardware suspend state.

    This is fine for an interactive system, or a system being debugged.

    It's okay if your pocket calculator locks up with an E on the display,
    upon which it responds only to the AC button, or being power cycled. It
    is strictly interactive; nothing happens in it without button events,
    and it has no other purpose but to serve the interactive user.

    An application being run under a debugger can drop into the debugger
    when something goes wrong, and the debugger will wait indefinitely for
    the operator to do something.

    In complex operating systems that support being put into unattended
    production uses, we don't want anything to stop.

    At most, only the lowest level kernel may have a "panic" function that
    locks up in a loop. But even that is a behavior we typically don't want
    unless we are debugging. If the system is to remain available in spite
    of the crash, it has to reboot on panic.

    The software locking up is so bad that have hardware defenses against
    it: hardware watchdogs.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Kaz Kylheku on Mon Mar 24 00:58:47 2025
    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    Not to terminate at all means to go into an infinite loop or some
    hardware suspend state.

    More realistically it's enough to say that the caller never receives a
    return value or sees the called function return. Instead, the program
    crashes, or blasts out to an exception handler, or maybe the hardware
    locks up. An infinite loop is another possibility.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Cerqueira@21:1/5 to Lawrence D'Oliveiro on Mon Mar 24 15:24:03 2025
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sun, 23 Mar 2025 16:56:35 +0000, Daniel Cerqueira wrote:

    Does every LISP S-expression need to have a value (need to be
    evaluated)? Is atributing a symbol to undefined behaviour needed?

    Which is why I said, the natural way to have an “undefined” value is for the computation not to terminate at all.

    To not terminate is not natural at all, it is also not a natural way.
    --
    The pioneers of a warless world are the youth that
    refuse military service. ~ Albert Einstein

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Madhu@21:1/5 to All on Mon Mar 24 22:08:57 2025
    [OT]

    * Kaz Kylheku <20250323233948.580@kylheku.com> :
    Wrote on Mon, 24 Mar 2025 06:50:16 -0000 (UTC):
    |
    |In complex operating systems that support being put into unattended |production uses, we don't want anything to stop.
    |
    |At most, only the lowest level kernel may have a "panic" function that
    |locks up in a loop. But even that is a behavior we typically don't want |unless we are debugging. If the system is to remain available in spite
    |of the crash, it has to reboot on panic.
    |
    |The software locking up is so bad that have hardware defenses against
    |it: hardware watchdogs.
    |
    |--
    |TXR Programming Language: http://nongnu.org/txr
    |Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal |Mastodon: @Kazinator@mstdn.ca

    git clone on txr's cgit host seems to work now. For a while I thought
    if you tried to git-clone it the machine firewalled you and dropped
    network packets after a few bytes were sent

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Daniel Cerqueira on Mon Mar 24 22:57:32 2025
    On Mon, 24 Mar 2025 15:24:03 +0000, Daniel Cerqueira wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sun, 23 Mar 2025 16:56:35 +0000, Daniel Cerqueira wrote:

    Does every LISP S-expression need to have a value (need to be
    evaluated)? Is atributing a symbol to undefined behaviour needed?

    Which is why I said, the natural way to have an “undefined” value is
    for the computation not to terminate at all.

    To not terminate is not natural at all, it is also not a natural way.

    That’s a very unnatural thing to say.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Daniel Cerqueira on Sat Mar 29 22:06:02 2025
    On Sat, 29 Mar 2025 13:44:39 +0000, Daniel Cerqueira wrote:

    Also, programs being stuck in a idle forever loop, is also not natural,
    and it is the opposite at what programs are meant to do.

    Is there such a thing as a “natural” program? Is that something created by “nature”, rather than by humans? What does “nature” intend programs to do?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Cerqueira@21:1/5 to Robert Girault on Sat Mar 29 13:44:39 2025
    Robert Girault <rgirault@gmail.com> writes:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Mon, 24 Mar 2025 15:24:03 +0000, Daniel Cerqueira wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sun, 23 Mar 2025 16:56:35 +0000, Daniel Cerqueira wrote:

    Does every LISP S-expression need to have a value (need to be
    evaluated)? Is atributing a symbol to undefined behaviour needed?

    Which is why I said, the natural way to have an “undefined” value is >>>> for the computation not to terminate at all.

    To not terminate is not natural at all, it is also not a natural way.

    That’s a very unnatural thing to say.

    Unnatural and ungrammatical.

    Unfortunately, there are some people that think that they live forever
    (being being alive a natural thing), and prefer to spend their limited
    amount of time bashing at people who acknowledge natural things, such as
    life having death.

    Also, programs being stuck in a idle forever loop, is also not natural,
    and it is the opposite at what programs are meant to do.

    But stupid people may disagree, until, one day, their disagreement
    stops, as everything in life.

    --
    The pioneers of a warless world are the youth that
    refuse military service. ~ Albert Einstein

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kevin J Witczak@21:1/5 to Daniel Cerqueira on Mon Apr 21 22:48:59 2025
    Daniel Cerqueira <dan.list@lispclub.com> writes:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Sat, 22 Mar 2025 12:07:14 +0000, Daniel Cerqueira wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Fri, 21 Mar 2025 22:47:38 +0000, Daniel Cerqueira wrote:

    I would like to know your thoughts, about what being undefined
    actually is. Should an undefined expression be represented by a
    symbol, or should an undefined expression be silent (without
    returning a symbol)?
    Should an attempt to evaluate such an expression even terminate?
    My opinion is that it should...
    So undefined behaviour cannot be really undefined, it must return some
    kind of value we are going to arbitrarily name as “undefined”?

    Does every LISP S-expression need to have a value (need to be
    evaluated)? Is atributing a symbol to undefined behaviour needed?

    In the context of the LISP 1.5 Programmer's Manual, "undefined" seems to
    simply mean "has no value with respect to the semantics of the language
    defined in the LISP 1.5 Programmer's Manual". As Kaz pointed out,
    "undefined" occurs infrequently in the manual, but many of its usages
    are strictly prescriptive or proscriptive: they state when function
    calls and symbols are specified to have a return value or not, and many
    of those usages appear in the language specification in Section I.

    Things like `startread' which requires CURCHAR and CHARCOUNT to be
    undefined under various conditions. `eq' yields always either *T* or
    NIL, and must never be undefined, even if its arguments are bad. `cond'
    must have an undefined value if no branch's predicate evaluates to *T*.

    In Section I, 1.6, we get:

    |1. In the pure theory of LISP. all functions other than the five basic
    |ones need to be defined each time they are to be used. This is |unworkable in a practical sense. The LISP programming system has a |larger stock of built-in functions known to the interpreter, and |provision for adding as many more as the programmer cares to define.

    |2. The basic functions. and cdr were said to be undefined for atomic |arguments. In the system, they always have a value, although it may
    |not always be meaningful. Similarly, the basic predicate eq always has
    |a value. The effects of these functions in unusual cases will be |understood after reading the chapter on list structures in the |computer.

    Taken together with the above, what the relevant Section VII has to
    indicate is that LISP expressions are semantically disjoint from the
    computed internal structures the LISP programming system uses, and
    that's the source of the ambiguity. LISP, the language, is not the same
    as its machine implementation. LISP has some cases where its relevant
    functions semantically mean nothing, in the same way that mathematical functions can be locally undefined within their domain, like a function
    f(x) := 1/x, for x = 0. `eq', in LISP 1.5, has the domain of atoms, and
    so is undefined for non-atomic arguments, but is later explicitly
    confirmed to actually just be one of *T* or NIL no matter if it is
    passed bad arguments per se, presumably because this smooths over a
    common source of programs halting and catching fire.

    What this all means of course is that undefined basically stands in for "implementation dependent". When the language formally has nothing to
    say, the machine just keeps going. Programming languages don't extend
    "all the way down". LISP (or Lisp (or Scheme (&c.))) the language is
    made up partly of function definitions: like `car' and `cdr', whose
    semantics define them for the domain of non-atomic arguments, but we're explicitly told by the 1.5 PM that in the actual implementation they
    always have a return value (even if it's not a value that means anything
    where you'd be calling them), presumably also out of brute practicality.

    Worth noting in the 1.5 PM is the "UNDEFINED SYMBOL" error emitted by
    LAP that Kaz also pointed out. This error, we're told on page 75,
    specifically indicates "assembly incomplete". LISP, the programming
    language, has no formal notion of assembly (or machine instructions) -
    it's just a system for recursive function computation via a List
    processing mechanism. But an actually machine-computable LISP must sit
    upon such an implementation level. Alongside "UNDEFINED SYMBOL" we also
    see LAP errors like "OUT OF BINARY PROGRAM SPACE". LISP also doesn't
    have a semantics for memory; garbage collection is how we deal with the emergence of this practicality on real hardware. "Undefined" funcall
    values mean as much as return values on a call that blows up its stack.

    LISP 1.5 is very old, there's sections in here about how the Overlord
    manages tape ingestion. These are kept out of the language spec section
    for good reason: they're implementational, and disjoint from the
    language semantics too. We are responsible for ensuring Lisp code does
    the right thing when exceptions occur, even when the language itself specifically doesn't. More contemporary versions of Lisp have grown
    condition handling systems specifically for this - to provide a place
    within the language semantics to enable users to discretionally handle
    various conditions, for when such behaviour properly resides within the program's domain.

    I'd say it's probably fruitless to try too hard to shoehorn "undefined"
    into the semantics of the language, asking questions like when and where
    it would be correct for Lisp to have a representation for states of
    affairs which violate its semantics. Lisp also doesn't try to shoehorn
    in a semantics of memory management (no malloc et al.) either. We just
    want garbage collection so our code doesn't hang up and go out to lunch
    when the unexpected happens.

    Languages may introduce things like the Bottom type ⊥ because they
    perform non-optional, non-trivial Type and Kind analysis as part of the implementation of their type system. Rust does have a semantics of
    memory management because one of its key design goals was to be like C
    but not in the bad ways. Maybe Lisp, in the large sense, should or could
    have use for these things (turnstile in Typed Racket comes to mind: a metalanguage for Scheme-based type system computation at macroexpansion
    time). But LISP, as specified by McCarthy et al. in the early days,
    doesn't incorporate such things. Implementation dependent behaviour was
    what you got.

    --
    ;; Basically just a Boltzmann brain with extra steps.
    ;; -*- (rfc1924 "YiVsRYGrgTcVTuwaB^>SZ*Fa2X>2ZIXa") -*-

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)