Sujet : Re: Undefined in LISP
De : jbb (at) *nospam* notatt.com (Jeff Barnett)
Groupes : comp.lang.lispDate : 23. Mar 2025, 19:00:30
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vrpi7u$2sc27$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 3/23/2025 10:56 AM, Daniel Cerqueira wrote:
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?
No would be my answer: The Lisp mechanisms that allows definitions of
error types and other out of band conditions includes primitives that
allows signaling those conditions to alter control flow. This is the
scheme used by Lisp interpreters and run-times to enforce correct
executions and allow user or "remote" code intervention when proper.
In a previous message in this thread I mentioned the IEEE Floating Point
Standard as an example that provides a special token to return when
certain anomalous numerical situations occur. I believe that most Lisps
are willing to turn those situations into signals but you do have the
ability to examine return values to see if that special token is
returned. Typically, you are able to choose the behavior you desire
within certain safety settings.
-- Jeff Barnett