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: [SUSPECTED SPAM] Re: `thunk-let'? Date: Wed, 08 Nov 2017 13:02:59 -0500 Message-ID: References: <87infp9z6j.fsf@web.de> <87zi90eehg.fsf@web.de> <87o9ocd6s4.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1510164128 26635 195.159.176.226 (8 Nov 2017 18:02:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 8 Nov 2017 18:02:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Nicolas Petton , Emacs Development To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 08 19:01:54 2017 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 1eCUfh-0006LY-Ju for ged-emacs-devel@m.gmane.org; Wed, 08 Nov 2017 19:01:53 +0100 Original-Received: from localhost ([::1]:33026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCUfp-0000Zd-1V for ged-emacs-devel@m.gmane.org; Wed, 08 Nov 2017 13:02:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCUfe-0000ZN-5k for emacs-devel@gnu.org; Wed, 08 Nov 2017 13:01:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCUfb-0004i2-4J for emacs-devel@gnu.org; Wed, 08 Nov 2017 13:01:50 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:58989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCUfb-0004d1-0M for emacs-devel@gnu.org; Wed, 08 Nov 2017 13:01:47 -0500 Original-Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id vA8I1gHE026396; Wed, 8 Nov 2017 13:01:44 -0500 Original-Received: by lechazo.home (Postfix, from userid 20848) id BA625605C1; Wed, 8 Nov 2017 13:02:59 -0500 (EST) In-Reply-To: <87o9ocd6s4.fsf@web.de> (Michael Heerdegen's message of "Wed, 08 Nov 2017 18:22:51 +0100") 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, RV6154=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6154> : inlines <6165> : streams <1769716> : uri <2530441> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 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:219984 Archived-At: > + (cl-callf2 mapcar > + (lambda (binding) > + (pcase binding > + ((or (and (pred symbolp) s) > + `(,(and (pred symbolp) s))) > + `(,s nil)) > + (`(,(pred symbolp) ,_) binding) > + (_ (signal 'error (cons "Bad binding in lazy-let" > + (list binding)))))) > + bindings) I think lazily binding a variable to nil is useless, so I'd drop the first pcase branch above. > + :initial-value `(progn ,@body))) You can use `macroexp-progn` to avoid constructing a `progn` in the common case where body is already a single expression. > +;;;###autoload > (defmacro thunk-delay (&rest body) Maybe a better option is to add a `require` in the expansion of lazy-let? Stefan