emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Test your ELisp knowledge


From: Yuri Khan
Subject: Re: Test your ELisp knowledge
Date: Fri, 9 Feb 2024 11:29:39 +0700

On Fri, 9 Feb 2024 at 09:53, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> Here's a test for you: without trying to run it

Does putting myself in the shoes of a Lisp interpreter count as running?

> guess what error will
> be signaled when you do:
>
>     M-: (their-fun (/ my-x 0)) RET

Something about their-fun not having been defined first. Because if it
is, my next step depends on whether it’s a function or a macro.

If it’s a function then the next is that my-x is not defined as a
variable. If it’s a macro, it might fail on its own, or decide not to
evaluate its argument as a form, but if it does, then same behavior as
with a function.

Otherwise I guess it comes to the division by zero, and that’s the
real question? I guess the result would depend on the type of the
value of my-x, possibly not failing but yielding a positive infinity,
negative infinity or NaN for floats? Otherwise, for integers, I’d
expect a division by zero error; for non-numeric types, a type error.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]