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: A generalization of `thunk-let' Date: Sat, 09 Dec 2017 11:33:58 +0100 Message-ID: <87374kfaw9.fsf@web.de> References: <87infp9z6j.fsf@web.de> <87r2s5ez0t.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1512815676 12362 195.159.176.226 (9 Dec 2017 10:34:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2017 10:34:36 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 09 11:34:31 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 1eNcSk-0002w1-H5 for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2017 11:34:30 +0100 Original-Received: from localhost ([::1]:40760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNcSp-0003r0-SJ for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2017 05:34:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNcSj-0003qp-EY for emacs-devel@gnu.org; Sat, 09 Dec 2017 05:34:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNcSg-0003oZ-Bq for emacs-devel@gnu.org; Sat, 09 Dec 2017 05:34:29 -0500 Original-Received: from mout.web.de ([212.227.17.12]:61273) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eNcSg-0003o6-2j for emacs-devel@gnu.org; Sat, 09 Dec 2017 05:34:26 -0500 Original-Received: from drachen.dragon ([188.106.175.242]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M6V1T-1fFhUF2rCl-00yN86; Sat, 09 Dec 2017 11:34:20 +0100 In-Reply-To: (Stefan Monnier's message of "Fri, 08 Dec 2017 16:16:48 -0500") X-Provags-ID: V03:K0:Js1eXXECrtnwMBHrZobsjsnxM8MY0VIclLmueLZMEkqIlpOGsGp 4NUrz290prZq5nWV5/v1GTH3G263T6RE3EVY5B52M327uvzxS/vCa/czAo5Pgj07fP+fPcr iqhgQrdT5j7Ncz7P9Jb8Z674U1viAsWJoBfidnZTfzjJvMdcc9wQJkPgwnH7V2ffaJSjiUN tm/8zX+Sv3HfhD52WFJIg== X-UI-Out-Filterresults: notjunk:1;V01:K0:ljotc6eDwi8=:OG0d34xzHjWQ+Yc4kzFBGV 25IiuFf4SDA6XFiIX2CMshddEQQipfacrvwiB/qZAxhBXtLsVg9/i+xqUO582F9vQS1QjvhRq bDYo0dviDIEg7GHrj/F5mgfsa/Aa3rE5do1OtAhSdtJxt7MM797fIICIQu5NLpUbYoXlBfd4Y WxefmbmUA4RWIppAsbDV6aHh5L24jcAI+UoMoyRXpL3HGPED0EwK4UfgNT9xT9bHGlHkeECU5 32gsSEGGlqFEYjD0DVJJ2kFgECJ9zwR7/V3bQ4pe46/su/bDkIsRC5dbPmfXmZivlmCapiySI ycnwjg1rUFToLiBXFinK8UHwf0FCzldJNfe5L+dQssZixyIwBPW4Ft4DkSETIvh1j+NOn6X3z IJO8yCqNWd9KFhy4gwadgJaazabHzyddMMvtbBUGkRZJXg5jJNhYCBIHZ2fqSYsyuuF2EUaJo Z9WId/tT3n3FQVPnmYg56Ga7yVc9+z6hibYGBYIN5UtDFVgCUI7hrCMWMhv0Af3/OBAJXr6/u nOEzag4VYPtkAbQVgLffLxjhUH/EaXFey+JCPnl7ifLIXQ2E5rYL6AloA/byOda92V7IIBHvU NbWSBj51XFHH+ZTTBH/dY3ZqDCA213BsBx6SPn6A1/GqS0iMDQX+3QDYRNIUCeNKZJHqh5vnC c6mbCvtKjryXp22WFpU2NEE0sx0x8Gq7YMNRt82WnjkWc6TWoQSyb0vGBKOJjccSjMp26sIIq dXPwINQoioZaWpVE/pDv3/j5LaLBJ0TzH0UYqrOAUjO6Hn4tccZDgT+1MHHDB3HEuOCDRYyu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.12 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:220812 Archived-At: Stefan Monnier writes: > Another way to do that is to create a new kind of object which is like > a spreadsheet-cell: it comes with an expression to compute it, and > remembers its current value. Internally it also keeps track of the > other spreadsheet-cells used during the computation of the current > value (i.e. the dependencies are automatically tracked for you). That's a nice in-between layer (and it also offers the most important part - a package prefix!). Do you already have an implementation? > Here you'd need to something like > > (let* ((a (make-sscell 1)) > (b (make-sscell 2)) > (sum-of-a-and-b > (make-sscell > (progn (message "Calculating %d + %d" a b) > (+ (sscell-get a) (sscell-get b)))))) > ...) An advantage is that you don't have to make dependencies explicit (though, they are still a bit explicit due to the necessary usage of `sscell-get'). A disadvantage seems to be that the input variables (`a', `b') need to be declared as sscells, though they don't have dependencies themselves. > > ;; Dependencies can be recursive: > > > (let ((a 1) > > (b 2) > > (c 3)) > > (dep-let ((a+b (a b) (+ a b)) > > (a+b+c (a+b c) (+ a+b c))) > > (list a+b > > a+b+c > > (progn (setq a 10) a+b+c)))) > > I'm not sure I see the recursion, here. Are you talking about the fact > that a+b+c depends on a but only mentions a+b in its dependencies? Yes, exactly: I should have said "dependencies are resolved recursively". Regards, Michael.