From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: `thunk-let'? Date: Mon, 09 Oct 2017 13:40:27 +0200 Message-ID: <87zi90eehg.fsf@web.de> References: <87infp9z6j.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1507549255 27903 195.159.176.226 (9 Oct 2017 11:40:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 9 Oct 2017 11:40:55 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: Nicolas Petton , Emacs Development To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 09 13:40:50 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 1e1WQS-0006J4-IS for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2017 13:40:48 +0200 Original-Received: from localhost ([::1]:57273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1WQY-0002zp-7x for ged-emacs-devel@m.gmane.org; Mon, 09 Oct 2017 07:40:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1WQK-0002zi-QW for emacs-devel@gnu.org; Mon, 09 Oct 2017 07:40:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1WQG-0006oG-2S for emacs-devel@gnu.org; Mon, 09 Oct 2017 07:40:40 -0400 Original-Received: from mout.web.de ([212.227.15.4]:50575) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1WQF-0006mP-OT for emacs-devel@gnu.org; Mon, 09 Oct 2017 07:40:35 -0400 Original-Received: from drachen.dragon ([92.74.174.244]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MBY4U-1eAqLK0mpC-00AZpB; Mon, 09 Oct 2017 13:40:28 +0200 In-Reply-To: (Stefan Monnier's message of "Sun, 08 Oct 2017 23:10:56 -0400") X-Provags-ID: V03:K0:xJpw8Kfda/ZBwW3j87M08By8zxA45i4x5/DzlMwi/m27q+pULbt xPAVcSdWFydibs0Pl5zKZO8bQpxapf2ts6VmON2ZRWa/jRXm/dNGGLQmmdX0TOUb8E54Kyq F+Sg8AbZ5Zfoigz4ww0CFWc0cX1VQAQSnYMCG5uJzcNmGqiuovWZprWpTJWxE+XTkjk8yIa w2hm54frp/dJJUlHQG2XQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:M2M0hCabMGY=:CE5BiaF9jSAhh6pI6CqzGs kTK+YE2zn5xi9QKixcDSwW11Ua57LAIAMZ8PMqrXs0kQjahPR/qBjAXBeAG3tkQ8JYP1uy1R2 EXJeTyxm0KuZwPWCQUoS/c7kkyg/Wm+T6vNQRWvE7sI5hWFgq5f5q2rFiVCroLLhwU6gpZcm0 VuCD5q7duis4fTX/dB5ujFRuotrNWJueKpSB1BuCawxAm+WdegkrSVMxIQHxjjGLriWLRj8hA VazSCQx+KgEt5H8HGZ0GnDmDKjmLnel+ez0jBDKE/DTQBv9BsCqQtn+c9cfKeUbr65qvrYZOG jBYMoUhKekyWspe3Vlg5ZPh/s5wQvVmc/LPnQsVfiZOz7pC15zbxn6WsZuYGCDXOcJcOdJCYo IGmexclzopvjTmsAZ0ZE8WcjtMHKqXqN5KQsiUf210It4wVwdiEssTqZ86tHv2whNQiJeFv40 m5lSePTvg1NwwJy91MfD8SwB/37K0WMhNjm3nvOiQHhIA1gujNFWymHl/ZlB6J3X+Rn9YIyyw E/dCczEOmoMHwIDrgU2CovdY/u1fRYG91mY2laeUFzbV9Y8N0VBxu7k0wuIxWBi1Y2zcqWxX1 nuetB2KcU70olfE8gxK+TY95aB1768tqGBvfQDZGY2umnN4Sht4Il6b3yVN6nQFGWz+986NAq Y1iYI/ysLV6EkXBYXEGFzZLmimbkMd4lNAmwwYZiFPWHiEr3qcfJ4BXmr8RResPMeMFttB1x2 RBjANcg80CwYJi0TcmQVz5D29iB4YKAVSHWBTbL4TYKUudGHXsFBRZ/GsfRcdZ5dv3yXTH7o X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.4 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:219298 Archived-At: Stefan Monnier writes: > Another name could be `lazy-let`. But if you add it to thunk.el, then > thunk-let sounds like the better name. Ok, so let's be brave and aim to add it as `lazy-let' to subr-x. There is a question I want us to think about: what should the semantics of a `lazy-let' bound variable be if it is bound or set inside the BODY? I guess we can't inhibit that further references to the variable are also translated into calls of `thunk-force'. Which would mean we would have to make `thunk-force' setf'able (or introduce a new atrifical place form for that purpose). If I do this, the second question is whether any rebinds or sets of these variables should implicitly create lazy values again or not. In the first case, I would have to use a modified version of `cl-symbol-macrolet' to make that work, but I think it should be doable. The second case should be trivial, that's what we get with `cl-symbol-macrolet' out of the box. I wonder which behavior people would prefer. Michael.