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: Sat, 18 May 2019 10:09:41 -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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="155427"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 18 16:10:25 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 1hS02b-000eIb-8w for ged-emacs-devel@m.gmane.org; Sat, 18 May 2019 16:10:25 +0200 Original-Received: from localhost ([127.0.0.1]:34668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hS02Z-0006nP-Up for ged-emacs-devel@m.gmane.org; Sat, 18 May 2019 10:10:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hS01x-0006nC-TV for emacs-devel@gnu.org; Sat, 18 May 2019 10:09:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hS01w-0001hy-Vo for emacs-devel@gnu.org; Sat, 18 May 2019 10:09:45 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50046) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hS01w-0001hD-P2 for emacs-devel@gnu.org; Sat, 18 May 2019 10:09:44 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 07B5480BB0; Sat, 18 May 2019 10:09:44 -0400 (EDT) Original-Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D3C4C80B93; Sat, 18 May 2019 10:09:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558188582; bh=61yBdgYgjLx3CuDeAlpZ/QXw+GR/Dj+qDQtMR3N6eio=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=AfYnGtjgkC5/Qt8pYm11EgqqiYB9BKk+QpFhYWpd5lxGdCSDXK3dortyFlKQBvHS6 TSkKHI7w9+vlbveYiOrgMrYa9Z+TFKdU9EptAOkHFLw4uBawc81eCP2n5/8SxUkbge EGsC+TbLm6hMaUNIl5QVqAKeOxZNjE9vnDC2aqc8vu3b44TfCg+Qx11WZReQwufaLq uoCYSJpeCiPwZnBF1Ux6N+MpFMZQCU4rf1JHyyMyX1UTmMGq886hnyrLHxzdlaBIuO +LoZw2J4bTsJhu4V+cLiojO0V/rY8MHpa9584IQXjtcdQo8UnEDQAO/rsunyR/+U/t O/3v+XVtFdX8g== Original-Received: from ceviche (184-175-13-248.dsl.teksavvy.com [184.175.13.248]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id A450712082F; Sat, 18 May 2019 10:09:42 -0400 (EDT) In-Reply-To: <87tvdshew9.fsf@web.de> (Michael Heerdegen's message of "Sat, 18 May 2019 00:53:10 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:236724 Archived-At: > (defmacro gv-place-bind (bindings &rest body) Hmm... "bind", eh? I don't think that's different enough. How 'bout something more like a "gv-alias"? > Writing the docstring made me thoughtful though - how is this different > from symbol-macrolet? 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). Yeah, maybe a "place alias" is a generalization of symbol-macro. Actually, no: symbol-macro can also expand to other macro-calls which are supposed to be re-expanded at each use-site, AFAIK, so it can macro-expand to something different every time the "variable" is referenced, which is not the case of places, I think. Maybe people over on comp.lang.lisp (or other Lisp discussion area) would have some insight about this. > My second point in this message: thinking once more about callf, we > could also support a syntax like (callf (with EXPR) PLACE ARG) or > something like that to support expressions as first arg. You can already do that, except that `with` is spelled `lambda (it)`: (cl-callf (lambda (it) EXPR) PLACE) Notice that the gv-callf we discussed are equivalent to the above rather than to something where the EXPR is evaluated to decide which function to call. To me, the benefit of (gv-modify it PLACE EXPR) [with or without the `it`] is that expressions appear in the order in which they're evaluated, and also that it looks more like `setf`, which is right since this is about doing a `setf` just with the added twist that it can refer to the old value of the variable to compute the new one. Stefan