GNU bug report logs - #59786
Allowing arbitrary expressions in cl-labels

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Fri, 2 Dec 2022 19:45:01 UTC

Severity: wishlist

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 59786 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 59786 <at> debbugs.gnu.org
Subject: Re: bug#59786: Allowing arbitrary expressions in cl-labels
Date: Fri, 13 Jan 2023 14:47:52 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> The patch below uses this "new new" syntax (and adjusts `cl-flet` to
> also support this new new syntax).  It still lacks a NEWS entry (as
> well as updating the CL manual), but before I do that, I'd like to hear
> what other people think,

I like the idea to implement this kind of feature for `cl-labels'.  It's
a good change IMO.

I don't like the syntax I think (ugly).  The rest of this answer is
discussing this detail:

I don't recall all details about the ambiguity of the empty body case,
so forgive me if I'm missing something.

A binding like (my-fun (var1 var2)) with an empty body would give you
compiler warnings anyway.  Would this be an alternative to your "="
style syntax:

To specify a local function with an empty body one would have to use
local variable names starting with "_":

   (my-fun (_var1 _var2))

If not all variables start with an underscore or not all list members
are symbols, the binding is interpreted as specifying an expression
evaluating to the function to bind.  This assumes that "_var" never
specifies a named function.

Michael.





This bug report was last modified 246 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.