From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Lambdas for beginners broken - help, please Date: Wed, 24 Jul 2024 19:06:37 -0300 Message-ID: References: <87sevz0w8q.fsf@web.de> <87ttgezhej.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18612"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 25 00:11:05 2024 Return-path: Envelope-to: geh-help-gnu-emacs@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 1sWkCP-0004ga-IK for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 25 Jul 2024 00:11:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWk8N-0002MG-S0; Wed, 24 Jul 2024 18:06:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWk8K-000219-6W for help-gnu-emacs@gnu.org; Wed, 24 Jul 2024 18:06:53 -0400 Original-Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWk8I-0006gE-Gi for help-gnu-emacs@gnu.org; Wed, 24 Jul 2024 18:06:51 -0400 Original-Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-66a1842b452so2655677b3.3 for ; Wed, 24 Jul 2024 15:06:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721858809; x=1722463609; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=i6p947WygKvKEd8VDHLvKDN2Ql/SvqzjBFvC9YiM7Bw=; b=EQLFf0dXNV9RpYo0201tIPWNXhr5k9YauDmhUuJpfhIONFkMzQcaXoNjTYFTLHx9f8 s4a3Rq4OBLIilX6enuShiUhMrFXKEUWYDRj1mEz+8dLMw2cx0J34TBRs9RiVZJMuCHmF SSorQPNR1J0+PkfG1sXIAG4YymIXNyRRpGFHOdYxBVG+UcEQ+6FhiUe8OQEkuo4RBRpp MtcrlxP+E9dDOeLRrmVDWIhv4cRyXnZ7knRmrXA/RLk/rek+EFn51r87hSTCpDIbaL1k H3ejTfSSQZds+ntXOe7bD3GOzz332lKV2r3oZr59DGyTfNsO3gVPnZMYTJCHBPA/m9p3 ZwDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721858809; x=1722463609; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i6p947WygKvKEd8VDHLvKDN2Ql/SvqzjBFvC9YiM7Bw=; b=BY4VPI+TC8yMzJnW5N13kAlc6yHjlcIIbxKMAcZS0OifWsdn+wk5K5mEyu27bqluHU ISevOq714fcczd7Aq+kj2KP+7A34DIJZudmvmmYd52pB32qkn2Sh/FyRhjw0abuLWIgk k4kl19snBxhuJ8Cbt0q+FCi2Gs6dGM7W7WCYmOPWWZqXJBsMSXDVU5YW0HKPjtOQxesg 3TSk9bnSd9eyThCjdZoAHMUsTEVIq0U4P2ZJsTJMEjGXMuzoEYJvszd9yIx8OxEerc5b /B0K5c7SEViC4YDUfn5qYoTJ26JuVhKoIoNDzV6+CUp+R5hbUIsfYkJIck4pRUZ4adXv eaTQ== X-Gm-Message-State: AOJu0Yxas8gS4VI4A4As7/4lE3NfWvtSpB5ZY4cp+9GIUkfvfY30+hdh 5xQ3hdFLjzbKk4UyUbDorYsFxl76dAk/dv1iH8xYVs1djZJoiBVPGD6AR3ntF+78a51IffBMPkp 0IhNGj+kbTwa4Up3vxR8eDyr7YxXfieQ5 X-Google-Smtp-Source: AGHT+IEW4j03k3+hT5ShbILQCks2nBelQHjVw2A42rci9olF9joiTMJSu66BObaF/RqNfprAqjm1taMa/aS5Xa+iyb8= X-Received: by 2002:a0d:c1c5:0:b0:64a:5443:7cbd with SMTP id 00721157ae682-675128c7f7bmr9717817b3.25.1721858809295; Wed, 24 Jul 2024 15:06:49 -0700 (PDT) In-Reply-To: <87ttgezhej.fsf@web.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::1130; envelope-from=eduardoochs@gmail.com; helo=mail-yw1-x1130.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147355 Archived-At: On Wed, 24 Jul 2024 at 17:03, Michael Heerdegen via Users list for the GNU Emacs text editor wrote: > Eduardo Ochs writes: > > > So, question: is there a recommended way to convert the result of > > > > (eval '(lambda (n) (+ n 2)) nil) > > > > back to the > > > > (lambda (n) (+ n 2)) > > > > ? > > If you really think you want to do this - have a look at "cl-print.el" and > the implementation of `cl-print-object' for interpreted-function > arguments, starting around line number 240. This shows how to dissect > those objects. I fixed the problems in eev by defining these two functions (defun ee-closure-to-lambda (c) "Experimental!!! See the comments in the source!" `(lambda ,(aref c 0) ,@(aref c 1))) (defun ee-symbol-function (sym) "Experimental!!! See the comments in the source!" (let ((o (symbol-function sym))) (if (closurep o) (ee-closure-to-lambda o) o))) and replacing some of my calls to symbol-function to calls to ee-symbol-function. So the situation is far less scary than I thought... and I will replace the two hacks above by calls to standard functions when a standard way to do that appears. Thanks! Eduardo