emacs-devel
[Top][All Lists]
Advanced

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

Re: Why shouldn't we have a #if .... #else .... #endif construct in Emac


From: Stefan Monnier
Subject: Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?
Date: Sat, 02 Sep 2023 19:12:19 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

>> > In C, we have the very useful conditional compilation
>> > directives introduced by #if or #ifdef, etc., which end at
>> > #end.
>>
>> Those are directives to the C preprocessor and some people say
>> it is a sign of weakness such a thing is even necessary to
>> begin with.
>>
>> Let's see if they are right!
>>
>> What problem do you have? If we can solve it in Elisp, we
>> cannot say those people saying that are wrong.
>>
>
> FWIW, Common Lisp has reader macros to solve the problem:
> http://clhs.lisp.se/Body/24_aba.htm

I don't see why reader macros would be needed here.  Reader macros are
useful to introduce funny new shorthands or to avoid *reading* a chunk
of code (e.g. because it uses some unsupported funny syntax) but in the
present case we can read both branches of the `if` just fine, we just
want to throw away one of the two before we macro-expand it.


        Stefan




reply via email to

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