GNU bug report logs - #76413
[PATCH] New macro 'compf' for composing functions

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Wed, 19 Feb 2025 13:53:02 UTC

Severity: wishlist

Tags: patch

Full log


View this message in rfc822 format

From: Rudolf Schlatte <rudi <at> constantly.at>
To: 76413 <at> debbugs.gnu.org
Subject: bug#76413: [PATCH] New macro 'compf' for composing functions
Date: Mon, 24 Feb 2025 09:57:01 +0100
Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> Hi,
>
> Stefan Kangas <stefankangas <at> gmail.com> writes:
>
>> Eshel Yaron <me <at> eshelyaron.com> writes:
>>
>>>> Why not name it `compose` as in CL and ELisp?
>>>
>>> It's a slightly different construct then Common Lisp's compose, so I
>>> feel like calling it by that name could lead to wrong expectations.
>>> Another option is fcomp instead of compf, BTW, if that seems better.

FWIW, compose is not in the CL standard, but is contained in the
alexandria library which supplies things that "should be" in CL.  Guile
Scheme does seem to name the function compose:
https://www.gnu.org/software/guile/manual/html_node/Higher_002dOrder-Functions.html

>>
>> It's slightly less typing, but also risks being more unclear, as it has
>> different evaluation rules.  The name `compf` is similarly fine, but to
>> me comes off as a little bit cryptic.
>
> I think it strikes a good balance between being concise and being
> cryptic, like "incf" does.  But naming things is hard...

In CL, the "f" suffix is usually used for macros that modify a place: incf,
rotatef, setf, ... so compf doesn't really fit that scheme.






This bug report was last modified 168 days ago.

Previous Next


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