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: Stefan Monnier
Subject: Re: Why is there no `until' in elisp?
Date: Wed, 17 Oct 2018 11:06:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> No, `while' currently returns its last body, I just checked:
> (let ((x 0)) (while (< x 5) (setq x (+ 1 x))) 8))

The 8 in your test case is outside of `while`, so it just shows what
`let` returns, not what `while` returns.  Try

    (let ((x 0)) (while (< x 5) (setq x (+ 1 x))))
or
    (let ((x 0)) (while (< x 5) (setq x (+ 1 x)) 8))


-- Stefan



reply via email to

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