From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14650 invoked from network); 21 Sep 2021 21:56:46 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 21 Sep 2021 21:56:46 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mSnkq-008GhC-4h for ml@inbox.vuxu.org; Tue, 21 Sep 2021 16:56:44 -0500 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1mSnkp-005TM6-Jg for ml@inbox.vuxu.org; Tue, 21 Sep 2021 16:56:43 -0500 Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1mSnkn-005TLy-3e for ding@lists.math.uh.edu; Tue, 21 Sep 2021 16:56:41 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mSnkk-008Ggr-Jz for ding@lists.math.uh.edu; Tue, 21 Sep 2021 16:56:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:Mime-Version:References:Message-ID:Date:Subject: From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=49CuwfFjCodTjc1f6+RZa3o4M2X7mbdOE0JDEErh8bk=; b=Zlxd5roum2lazAip0Cy6oC+nc8 E+pI4gtEysG9ruoF4zkm0lkF2/2qDgBfRwoFL14JdgKSgV43yM6dwnkIQ9yEyqI7TrFNFvI0u6M7l rd4YBh4bo3dTmZFI+CwK8AoHZ8Qdiu+aPAy0hrKd6HB79iwTR00wDDyKwfEZhkKs47XY=; Received: from ciao.gmane.io ([116.202.254.214]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSnkc-0002Zt-6v for ding@gnus.org; Tue, 21 Sep 2021 23:56:33 +0200 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mSnkZ-00012K-QO for ding@gnus.org; Tue, 21 Sep 2021 23:56:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org To: ding@gnus.org From: Emanuel Berg Subject: Re: for a given emacs session: insert a subject with an increasing counter Date: Tue, 21 Sep 2021 23:56:16 +0200 Message-ID: <87czp1mw3j.fsf@zoho.eu> References: <87v93maplq.fsf@mat.ucm.es> <87h7f629rj.fsf@ucl.ac.uk> <87o89e85vg.fsf@mat.ucm.es> <87k0k2aynw.fsf@tullinup.koldfront.dk> <8735qpd3jj.fsf@mat.ucm.es> <87tuj5j6f9.fsf@gmail.com> <87wnnw747v.fsf@mat.ucm.es> <87ilzcnwc3.fsf@zoho.eu> <87fsuggqes.fsf@ericabrahamsen.net> <87zgsour1m.fsf@zoho.eu> <87fsuguozt.fsf@zoho.eu> <87bl54glpc.fsf@ericabrahamsen.net> <878rzqa9j5.fsf@zoho.eu> <8735px7nfe.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:r8ekJXqm/oEhKEkpEdD2zV7n64A= Mail-Copies-To: never List-ID: Precedence: bulk Bodertz wrote: >> or can one have several functions in a/one closure `let'? > > You can. A simple example: > > (let ((counter 0)) > (defun decrement-counter () > (cl-decf counter)) > > (defun increment-counter () > (cl-incf counter)) > > (defun reset-counter () > (setq counter 0))) Sweet! That example may be simple but it is exemplary nonetheless! Did you ever consider writing a book on computing? :) >> (Unbelievable that I never read this in a single computer >> book of all the tons I've read. Unbelievable people who >> write them. Or?) > > There is a book called 'Let Over Lambda' which is named > after this concept: the 'let' is over the 'lambda' (or > 'defun', in this case). I haven't read it, but it's how > I heard of this idea. Interesting title, I'd love to read it ... I did Lisp at the university ("Advanced Functional Programming", 5 ECTS in 2013-02-01) - that course also included Erlang and Haskell - Erlang because of modularity/concurrency I guess, and Haskell because of rigidity/modernity - again I guess. I don't consider Lisp functional, or rather, it is functional and everything else - or it can be, at least. It is multi-paradigm but even that doesn't feel right because when Lisp came (1958, USA; CL 1984, Elisp 1985) at that time there were no programming paradigms. Which BTW IMO are, at the best, thought models to enhance our understanding, not a bunch of rules to follow. Anyway, at that course there were some material, but I lost it somewhere between the Second and Third Impact. Other than that, I've read the Emacs 18 manual and three books on Lisp, namely @book{land-of-lisp, author = {Conrad Barski}, isbn = 1593272812, publisher = {No Starch}, title = {Land of Lisp}, year = {2010} } @book{lispcraft, author = {Robert Wilensky}, isbn = 0393954420, publisher = {Norton}, title = {LISPcraft}, year = {1984} } (the third one doesn't seem to be in the register, anyway it was in Swedish so of less use even to "us" these days) Conrad Barski's book is very good! (Searched, but didn't find his e-mail; feel free to CC this to him.) https://dataswamp.org/~incal/books/books.bib -- underground experts united https://dataswamp.org/~incal