GNU bug report logs -
#78719
30.1; [PATCH] Add functions `string-common-prefix' and `string-try-completion'
Previous Next
Full log
Message #41 received at 78719 <at> debbugs.gnu.org (full text, mbox):
> From: Phil Sainty <psainty <at> orcon.net.nz>
>> Is it ok to (eval-when-compile (require 'cl-lib)) in subr.el
>> in order to use cl-defun ?
Eli Zaretskii wrote:
> Can we please avoid that at all costs?
and Stefan Monnier wrote:
> No, it's not. I mean, maybe there's a way to make it work, but if you
> "just do it", bootstrap will break because `cl-lib` needs `subr.el`.
Righto. I figured the answers might well be along these lines.
> Much better to refrain from using `cl-defun`, or else move the
> definition to a later file, like `simple.el` or `subr-x.el`.
All good.
On 2025-06-11 00:15, Eli Zaretskii wrote:
> Why do we need cl-defun here, anyway? How many arguments should these
> functions have?
There's one mandatory argument and four optional ones which
can be mixed and matched without any obvious priority sequence.
Daniel had used cl-defun when he suggested merging my original
two functions into one, and I thought that the use of keyword
args did seem like a nicer API than a regular function.
It could be a regular function, though; I don't think there
was anything *precluding* that. I'd probably go with this
argument order if we do that:
(string-common-prefix COLLECTION &optional IGNORE-CASE STRING
REGEXP-LIST PREDICATE)
-Phil
This bug report was last modified 5 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.