emacs-devel
[Top][All Lists]
Advanced

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

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


From: Garreau\, Alexandre
Subject: Re: Why is there no `until' in elisp?
Date: Wed, 17 Oct 2018 23:49:36 +0200
User-agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu)

Le 17/10/2018 à 14h35, Paul Eggert a écrit :
> On 10/17/18 2:15 PM, Garreau, Alexandre wrote:
>> “while” as used in natural language does *not* mean the same thing
>
> […] And the same is true for "until".

How’s that?

> But I'm not objecting to the keyword's spelling: I'm objecting to a
> syntax where a condition C is placed immediately before a place where
> C is false. This is confusing! When I read "C" I should be mentally
> thinking "OK, now C is true". This is elementary notation design.

I’m not.  If it works in english such as “until you have money you will
not be able to buy it” I don’t see the problem.

>> It is still more natural and meaningful to say “until I’m not hungry
>> anymore I eat” instead of “while I’m hungry I eat”,
>
> Not at all. Most English-speakers would say that the latter is far
> more readable.

Certainly more readable, because it is simpler.  But how about *more
natural*?  I find “until” be a lot more used in all the languages I
know, including english.

>>> the Elisp syntax for the proposed loop construct should *not* be
>>> (until C S).
>>
>> And what should it be then?
>
> Why not use cl-loop? Although it's not perfect it's good enough, and
> it's better than introducing a seemingly-simple but deeply confusing
> syntax.

The most obvious and only implementation of `unless', I ever seen *until
now* is (while (not cond) body) (see how this sentence breaked your rule
while being the more natural formulation).  It’s only subjectively, thus
seemingly, deeply confusing, thus “not perfect” as well, yet “good
enough” in my mind, so to make programs easier to read and write, while
cl-loop is deeply, not only seemingly, complex, especially about its
syntax: so it’s the other way around I’d say (though cl-loop too accepts
both post- and pre-cond afaik).



reply via email to

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