[Top][All Lists]

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

Re: Why is there no `until' in elisp?

From: Eric Abrahamsen
Subject: Re: Why is there no `until' in elisp?
Date: Tue, 16 Oct 2018 12:16:57 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

"Garreau, Alexandre" <address@hidden> writes:

> Sometimes I have the strong feeling that the symetric of “while”,
> “until” [0], unlike in many languages such as C, exists in elisp.  That
> happened to me several times, and usually I bug for about an hour before
> to realize I do this confusion because it has the symetric of “when”:
> “unless”, but not the same for “while”.
> However, “until” exists, for instance in bash (which has no “unless”…
> maybe because it has no “when” because it has guarded “if”s?), and I
> find it pretty handy for making stuff more readable and avoiding making
> stuff more complex…
> Is there a particular rational or style reason for not using a such
> trivial and obvious (both in terms of implementation and
> understandement) construct?
> If not so, why isn’t it in elisp, aside of `when' and `unless' in
> subr.el (if that ought to be the correct file?)?
> [0] such as: (defmacro until (test &rest body) (declare (indent 1))
> `(while (not ,test) ,@body))

I have nothing to do with this, but my feeling is that Lisp developers
in general drag their feet about adding trivial/obvious constructs to
the standard library. As your footnote makes clear, it's a two-line code
addition to make `until' work. There are different schools of thought
about this: one that says "why?", and one that says "why not"? The "why
not"s contribute to subr.el and subr-x.el :)

reply via email to

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