From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations Date: Mon, 26 Feb 2018 12:15:25 -0500 Message-ID: <9100fb65-a95a-0678-68fa-7d615d481284@gmail.com> References: <08190786-14de-a899-f591-a7043c87bebb@gmail.com> <87po4rpv02.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1519665684 904 195.159.176.226 (26 Feb 2018 17:21:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Feb 2018 17:21:24 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: Stefan Monnier , emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 26 18:21:20 2018 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 1eqMSi-00081Q-VT for ged-emacs-devel@m.gmane.org; Mon, 26 Feb 2018 18:21:17 +0100 Original-Received: from localhost ([::1]:60504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqMUl-0005EE-0L for ged-emacs-devel@m.gmane.org; Mon, 26 Feb 2018 12:23:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqMNA-0008RE-2M for emacs-devel@gnu.org; Mon, 26 Feb 2018 12:15:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqMN5-0005HS-WD for emacs-devel@gnu.org; Mon, 26 Feb 2018 12:15:32 -0500 Original-Received: from mail-io0-x22b.google.com ([2607:f8b0:4001:c06::22b]:36402) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqMN5-0005Gz-KA for emacs-devel@gnu.org; Mon, 26 Feb 2018 12:15:27 -0500 Original-Received: by mail-io0-x22b.google.com with SMTP id e30so7501782ioc.3 for ; Mon, 26 Feb 2018 09:15:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Qs/IN5PsTCMx8d+UuAAEhiCpyxL9o34Bp2eX7q7j/Dg=; b=ZfT/ZcTNLqhVJv5AkwyioQ4vyY8OE8e9DAw3NpX+7tXehnR2M9x5zy88SYL18r0v7T 8hXnKZpHsjmIKau6zP7ousBGeNqiGnlYxOTGrquqMmcAk95bOgdBzbh9G7XAONub7aVY f+gP2KkSQUy5h31AeXYtoVd48XcJBN5quauFe6G4mkZG/W//w9r2Ip2cwZsQx96+h2n0 zwk7q7+DFHmhJTDf2IVbRHcjRw/mim5j1UADg+3wrxs8O48cp8vZb+yoqcRhsN1afY81 FZEU9EG10+6SWyuiRzcEG6ZzUiePTtaHPj5icLeiGORANcRFapu3Ck0Cg4HzLcZ3nea1 wZKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Qs/IN5PsTCMx8d+UuAAEhiCpyxL9o34Bp2eX7q7j/Dg=; b=ln7kJ+NTDEAdx15BvvWhh2kDT/mCZxhPQdUPj6u+RRO0DDnAkalAo0yUfzvRp5nIWE 51Pu2SNd5wUXHfm4vn51TCUvSuWe8rAEq1tpJHySs1firkDa5H+HC/upqCkrMUWhhh4O /8xmq1g6PFvvmoOy3rtFOpRugziN8TnBuQyptfqFXEXM3rFO8m36PUUOhsK6bxsOKdll Nb+x16ck/ES1Xk/fpDoAvIEYEBvmRjpAvMatVn8YB7TjlQVn8sRW8cM0xE2mW/jJ6uZr DTnBnSzNz4oFWHAQga7Llv/Gv2oGOmXgerso2uWlCnoxKVLlF6q841dDhPsgdvf+588j 4Utw== X-Gm-Message-State: APf1xPDh7Hhm9mA4vgiSkYpF6BYPDcnDH8mi98erh4uc901YL3WRTOp+ cMEi6ABzo8cbjTRV02A3EDhvrogF X-Google-Smtp-Source: AG47ELs3xZk2nUCp/4xa77moNkTJnSC3jbHQiIRSh54O6acwXnjdLulTvdCRt/ZgPQXsux2duMDb4Q== X-Received: by 10.107.152.144 with SMTP id a138mr12625806ioe.264.1519665326911; Mon, 26 Feb 2018 09:15:26 -0800 (PST) Original-Received: from [18.26.2.123] (26-2-123.dynamic.csail.mit.edu. [18.26.2.123]) by smtp.gmail.com with ESMTPSA id i197sm5953802ioe.54.2018.02.26.09.15.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2018 09:15:26 -0800 (PST) In-Reply-To: <87po4rpv02.fsf@web.de> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::22b 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:223073 Archived-At: On 2018-02-26 11:37, Michael Heerdegen wrote: > Hello Clément, Hey Michael, > Are we sure `mmm' always does what you expect? Hard to say. I'm trying to gauge how much of what I observe is a bug, and how much is expected :) > Note that it gets called > with different arguments in these two cases. I think that's a problem, yes. But is it the expected behavior for it to be called with different arguments? > You have > > (mmm (lambda () nil)) ==> (lambda nil nil) > > With the `with-eval-after-load' called before `mmm' is defined, I get an > entry like this in `after-load-alist': > > | (test-macro > | #[0 #1="byte code..." > | [(lambda nil > | (let > | ((out > | (mmm > | #'(lambda nil nil)))) > | (message "with-eval-after-load: %S" out))) > | ...] > | 11]) Right, I think that's broken. > Maybe you can change `mmm' so that it handles both of these cases as you > want? We're considering this for Flycheck, yup :) I suggested a similar solution in https://github.com/flycheck/flycheck/issues/1398#issuecomment-365660601 Or use a function like (defun mmm2 (f) `#',f)? I don't think that works for our particular use case, because we need to handle unquoted functions. Mostly though, I'd like to understand where the issue comes from (my current understanding is that it's a miscompilation), and whether it can be fixed. (The original problem popped up a few years ago from a user of use-package, but back then we didn't track it down; this time I'd like to fix it once and for all) Thanks for your help! Clément.