From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Why is FUNC in cl-callf not allowed to be an expression? Date: Wed, 29 May 2019 13:02:59 -0400 Message-ID: References: <874l631ek1.fsf@web.de> <87pnoqtuhm.fsf@web.de> <87r2961gox.fsf@web.de> <87mujohasa.fsf@web.de> <87a7fn3c6c.fsf@web.de> <875zqabh3t.fsf@web.de> <87zhnma11c.fsf@web.de> <871s0y3weo.fsf@web.de> <87tvdshew9.fsf@web.de> <877eac3fzo.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="75785"; mail-complaints-to="usenet@blaine.gmane.org" 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 Wed May 29 19:04:06 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hW1zh-000Jae-Hm for ged-emacs-devel@m.gmane.org; Wed, 29 May 2019 19:04:05 +0200 Original-Received: from localhost ([127.0.0.1]:58173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hW1zg-0002us-IL for ged-emacs-devel@m.gmane.org; Wed, 29 May 2019 13:04:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hW1yn-0002tq-Jp for emacs-devel@gnu.org; Wed, 29 May 2019 13:03:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hW1ym-0007i2-Kx for emacs-devel@gnu.org; Wed, 29 May 2019 13:03:09 -0400 Original-Received: from [195.159.176.226] (port=33908 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hW1ym-0007hH-Dc for emacs-devel@gnu.org; Wed, 29 May 2019 13:03:08 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hW1yk-000IO9-2c for emacs-devel@gnu.org; Wed, 29 May 2019 19:03:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:brfrCGJ6a+NRT45hdp7gj9iffp4= 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:237158 Archived-At: >> Indeed, they're closely related but symbol-macrolet does not "evaluates" >> anything at the "binding" site. Also it can also be used for purposes >> different from "places", e.g. to keep a log of all the accessed to >> a "variable" (tho, we could just as well create a (journaled PLACE) >> pseudo place which would record accesses in the very same way). > > I also come to the conclusion that symbol-macrolet and place binding are > two different things. Right. I think you can always use one to implement the functionality of the other, but they're different. > OTOH, `symbol-macrolet' might be used for arbitrary calculations. It > would be surprising (wrong) if in > > (symbol-macrolet ((r (list (random)))) > (list r r)) > > the `random' function would be called only once. Indeed, with gv-place-bind you'd need to use something like (gv-place-bind ((r (gv-cbn (list (random))))) (list r r)) for some definition of `gv-cbn` such as (defun gv-cbn (x) (declare (gv-expander (lambda (do) (funcall do x (lambda (v) `(setf ,x ,v)))))) x) -- Stefan