From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: thunk.el: Document that thunk-force == funcall? Date: Thu, 17 Dec 2020 20:58:09 -0600 Message-ID: <873603n7lq.fsf@alphapapa.net> References: <871rgs3tdx.fsf@web.de> <87v9dtttbr.fsf@web.de> <87im9qhfz5.fsf@web.de> <878s9xyrn2.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11271"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 18 03:59:43 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kq5zb-0002pw-EM for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Dec 2020 03:59:43 +0100 Original-Received: from localhost ([::1]:35704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kq5za-00046f-GG for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Dec 2020 21:59:42 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kq5yF-0002zk-KV for emacs-devel@gnu.org; Thu, 17 Dec 2020 21:58:19 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:53778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kq5yD-0008GW-3d for emacs-devel@gnu.org; Thu, 17 Dec 2020 21:58:19 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kq5yB-00015r-9n for emacs-devel@gnu.org; Fri, 18 Dec 2020 03:58:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261147 Archived-At: Michael Heerdegen writes: > Michael Heerdegen writes: > >> Actually I have one real-life example: > > An example involving side effects: being able to create a function > that one can add to a hook that performs some kind of (expensive) setup > but only when called for the first time. FYI, someone recently showed me that the letrec macro can be used to do this. There's an example of it in the Elisp manual, section 12.3 Local Variables (added about a year ago, so I think most Emacs users don't know of it yet).