From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Can't M-x compile-defun `edebug' because dynamic variables are falsely taken as lexical. Date: Fri, 14 Feb 2020 14:19:13 -0500 Message-ID: References: <20170103141444.GA4649@acm.fritz.box> <20170103213228.GB2085@acm.fritz.box> <20170104133948.GA7373@acm.fritz.box> <20170104200458.GA2052@acm.fritz.box> <29855ded-8607-4132-a80f-3204c06d74d9@default> <256f068f-5a0a-4127-aa7c-633eae24f15f@default> <837a062d-8fb0-4b41-bc53-d96a166263a4@default> <9a1d6af0-7561-4679-930c-3bcda6169764@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="42414"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Alan Mackenzie , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 14 20:19:54 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 1j2gVG-000Awk-3U for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Feb 2020 20:19:54 +0100 Original-Received: from localhost ([::1]:44498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2gVF-0004ph-6P for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Feb 2020 14:19:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44782) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2gUh-0003yp-PN for emacs-devel@gnu.org; Fri, 14 Feb 2020 14:19:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2gUg-0000e9-AQ for emacs-devel@gnu.org; Fri, 14 Feb 2020 14:19:19 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31251) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2gUg-0000dY-3s for emacs-devel@gnu.org; Fri, 14 Feb 2020 14:19:18 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EB38A44E7BF; Fri, 14 Feb 2020 14:19:16 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 42FD944E7BD; Fri, 14 Feb 2020 14:19:15 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1581707955; bh=RMWAblnrNlb2nHUeKqh6V4iU2H6jWrxUwK99C6PZ+Q8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=NbAFZp9GNZrOixsDmAvpHIGJsiJD5GiIQyhjOQAFMJdkGHgjC1PRZSlEJ1/89ouBA 6eOBRAezUSAglSnH5iKr7jP9EeEpZSLX58NLQx8Celo8N5dWtvawv7/8ETyK6CwFVI 81M+u2T8akbzhmVGcWOseG9DLvwXIbtoMA92azjSTaFpkttDiLn9Ri3eCJ3BbSTpfK mbi6KRYHdAQz6MHVP+SjGQxnmO2vN1vGUTG77u9mSdlcZ/jYJNYEEgCr/+Mkk1n5l3 Q2jItXHzVLZ6jvuXne4Ws4tzJ/f2CbnqBq5oGSgyu9CVCM5GKiSL4pqezkZSVYkN3W 226v+kQJzzyVQ== Original-Received: from pastel (unknown [157.52.14.222]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id F3DE41202FC; Fri, 14 Feb 2020 14:19:14 -0500 (EST) In-Reply-To: <9a1d6af0-7561-4679-930c-3bcda6169764@default> (Drew Adams's message of "Fri, 14 Feb 2020 09:25:00 -0800 (PST)") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:244944 Archived-At: > The real point was about `defvar'. CL's `defvar' is > not Emacs's, AFAIU. That's a given. But I thought the point was about Emacs's doc. >> In Common Lisp >> >> (list >> (lambda (x) >> (let ((y x)) >> (declare (special y)) >> (lambda (z) (+ y z)))) >> (lambda (x) >> (let ((y x)) >> (lambda (z) (+ y z))))) >> >> gives you two functions that don't behave the same because the `y` >> binding in the first is dynamically scoped whereas that same `y` >> binding is statically scoped in the second. > > In CL parlance, those are not only not the same binding, > they are not the same variable `y'. That's the point. Not really, no: what the user wants to know is "when I write (let ((y ...)) ...), when will binding be dynamic or lexical". Whether or not it's "the same variable" as some other is irrelevant, or more specifically, it just shifts the problem. > The first variable named `y' is special, which means > that it's special everywhere (indefinite scope), and > it's duration is the duration of the executing code > that uses it (dynamic extent). E.g. here it just shifts the problem from "which y will be lexical and which will be dynamic" to "which y corresponds to this one-and-only special var and which doesn't". Stefan