From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Why is there no `until' in elisp? Date: Wed, 17 Oct 2018 11:06:28 -0400 Message-ID: References: <87murdu6to.fsf@portable.galex-713.eu> <87y3axjusi.fsf@portable.galex-713.eu> <87pnw9gcjl.fsf@portable.galex-713.eu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1539788686 786 195.159.176.226 (17 Oct 2018 15:04:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 17 Oct 2018 15:04:46 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: "Garreau\, Alexandre" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 17 17:04:42 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gCnNJ-000063-VB for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2018 17:04:42 +0200 Original-Received: from localhost ([::1]:37222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCnPQ-0008OD-F3 for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2018 11:06:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCnPH-0008NL-LP for emacs-devel@gnu.org; Wed, 17 Oct 2018 11:06:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCnPC-0001TN-Nq for emacs-devel@gnu.org; Wed, 17 Oct 2018 11:06:43 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:32873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCnPA-0001KM-RI for emacs-devel@gnu.org; Wed, 17 Oct 2018 11:06:38 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w9HF6SBT006487; Wed, 17 Oct 2018 11:06:29 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 7EB89AE145; Wed, 17 Oct 2018 11:06:28 -0400 (EDT) In-Reply-To: <87pnw9gcjl.fsf@portable.galex-713.eu> (Alexandre Garreau's message of "Wed, 17 Oct 2018 11:14:38 +0200") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6397=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6397> : inlines <6935> : streams <1801579> : uri <2732423> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230450 Archived-At: > 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