[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why is there no `until' in elisp?
From: |
Stefan Monnier |
Subject: |
Re: Why is there no `until' in elisp? |
Date: |
Tue, 16 Oct 2018 17:28:28 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> [0] such as: (defmacro until (test &rest body) (declare (indent 1))
> `(while (not ,test) ,@body))
I like `until`. As a matter of fact, I think `until` is more important
than `while` for the following reason: it should not behave like the one
you have above but rather like:
(defmacro until (test &rest body)
(let (res)
(while (not (setq res ,test)) ,@body)
res))
While `while` doesn't have much else to return than nil, `until` does
have a useful value to return, which is the non-nil value that caused it
to exit.
Stefan
- Why is there no `until' in elisp?, Garreau\, Alexandre, 2018/10/16
- Re: Why is there no `until' in elisp?,
Stefan Monnier <=
- Re: Why is there no `until' in elisp?, Garreau\, Alexandre, 2018/10/16
- Re: Why is there no `until' in elisp?, Stefan Monnier, 2018/10/16
- Re: Why is there no `until' in elisp?, Garreau\, Alexandre, 2018/10/17
- Re: Why is there no `until' in elisp?, Stefan Monnier, 2018/10/17
- Re: Why is there no `until' in elisp?, Garreau\, Alexandre, 2018/10/17
- Re: Why is there no `until' in elisp?, Stefan Monnier, 2018/10/19
- Re: Why is there no `until' in elisp?, Garreau\, Alexandre, 2018/10/19
Re: Why is there no `until' in elisp?, Yuri Khan, 2018/10/17