From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: Why is there no `until' in elisp? Date: Tue, 16 Oct 2018 12:16:57 -0700 Message-ID: <877eihbt1y.fsf@ericabrahamsen.net> References: <87murdu6to.fsf@portable.galex-713.eu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1539717319 22977 195.159.176.226 (16 Oct 2018 19:15:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2018 19:15:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 16 21:15:15 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 1gCUoE-0005tw-VU for ged-emacs-devel@m.gmane.org; Tue, 16 Oct 2018 21:15:15 +0200 Original-Received: from localhost ([::1]:59898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCUqL-0000ex-FE for ged-emacs-devel@m.gmane.org; Tue, 16 Oct 2018 15:17:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCUq9-0000eg-CA for emacs-devel@gnu.org; Tue, 16 Oct 2018 15:17:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCUq4-0006ib-Em for emacs-devel@gnu.org; Tue, 16 Oct 2018 15:17:13 -0400 Original-Received: from [195.159.176.226] (port=42681 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCUq4-0006ft-6V for emacs-devel@gnu.org; Tue, 16 Oct 2018 15:17:08 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gCUnu-0005SR-Ae for emacs-devel@gnu.org; Tue, 16 Oct 2018 21:14:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:7qeLSsKIvuBuPFVhLJpKz0il0jY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 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:230420 Archived-At: "Garreau, Alexandre" 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 :)