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: João Távora
Subject: Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?
Date: Sun, 3 Sep 2023 13:27:31 +0100

On Sun, Sep 3, 2023, 00:15 Stefan Monnier via Emacs development discussions. <emacs-devel@gnu.org> wrote:
>
> 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.  

I didn't say they are "needed" to solve it. I merely said they would. And they do, quite effectively in Common Lisp, precisely for the C-like use cases presented here as paradigmatic.

But as always there are multiple ways to skin a cat. 

CL's is particularly good IMO, and much more versatile than what is being proposed here. It skins this and more cats. For example it doesn't require changing the indentation of the form being ifdef'ed out. And the property of making some code invisible to the reader is great for adding/removing arguments conditionally in calls based on read-time knowledge. 

Anyway, I'm taking about a particular type of reader macro called "feature expressions" and that's what I linked to.

João

reply via email to

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