Sujet : Re: Undefined in LISP
De : no.email (at) *nospam* nospam.invalid (Paul Rubin)
Groupes : comp.lang.lispDate : 22. Mar 2025, 20:55:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87jz8glu1o.fsf@nightsong.com>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
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