help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: [External] : Set the default-directory dynamically according to the


From: Emanuel Berg
Subject: Re: [External] : Set the default-directory dynamically according to the buffer-file-name.
Date: Fri, 01 Oct 2021 09:09:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hongyi Zhao wrote:

>> (if (not WHATEVER)
>>     (message "PROBLEM NOTIFICATION")
>>   (DO-STUFF))
>>
>> If you want to stop everything and be sure the
>> message is seen, you might want to raise an error:
>>
>> (unless WHATEVER (error "PROBLEM")) ; End it all
>> (DO-STUFF)
>
> Do you mean this is a good practice for usage scenarios in
> production environments?

Well, yes, but also in every other environment where your
aspiration is to write good, idiomatic Lisp.

He is showing the syntax and how it is put together for
two scenarios.

But the more tricky question is another, namely when should
one use the first one (i.e., `message' the situation, then
branch out) and when is the situation in fact an `error', much
like division by zero?

(/ 1337 0) ; Arithmetic error

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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