From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#27674: 26.0.50; cl-progv: strange scoping due to implementation Date: Wed, 12 Jul 2017 21:54:26 -0400 Message-ID: <87inixdru5.fsf@users.sourceforge.net> References: <87lgntfhky.fsf@drachen> <87r2xldw4s.fsf@users.sourceforge.net> <874luhf9zw.fsf@drachen> <87o9spdusk.fsf@users.sourceforge.net> <87zic9dtti.fsf@drachen> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1499910799 15439 195.159.176.226 (13 Jul 2017 01:53:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Jul 2017 01:53:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 27674@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 13 03:53:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dVTJa-0003OB-DN for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jul 2017 03:53:14 +0200 Original-Received: from localhost ([::1]:56820 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVTJZ-0002ph-HV for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Jul 2017 21:53:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVTJT-0002pa-Rt for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 21:53:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVTJO-0007Va-TB for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 21:53:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVTJO-0007VC-PI for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 21:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dVTJO-00057c-AN for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 21:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jul 2017 01:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27674 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27674-submit@debbugs.gnu.org id=B27674.149991078119682 (code B ref 27674); Thu, 13 Jul 2017 01:53:02 +0000 Original-Received: (at 27674) by debbugs.gnu.org; 13 Jul 2017 01:53:01 +0000 Original-Received: from localhost ([127.0.0.1]:36012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVTJN-00057N-4w for submit@debbugs.gnu.org; Wed, 12 Jul 2017 21:53:01 -0400 Original-Received: from mail-it0-f41.google.com ([209.85.214.41]:37320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVTJL-00057B-TP for 27674@debbugs.gnu.org; Wed, 12 Jul 2017 21:53:00 -0400 Original-Received: by mail-it0-f41.google.com with SMTP id m84so30198116ita.0 for <27674@debbugs.gnu.org>; Wed, 12 Jul 2017 18:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=i92O26eIf8LC06jff7in2sHavnZyS0P4DLK2xxogBqg=; b=fnhLuV4OKLQUX/8VOoyLfESQoMSFhmeLOWCfM2FnPagT55RaSzRayV8PuwC7PeGwGT sSkTbsqtq/Evr5Q0Eg2vyKiefzq7MJJlbQw6vKTqEERRwVZhEL6z9VeExDnNMih5W6SF 6/QQFLoG7cMfzhdGjI9IiPx7EIQqCqWIQHyWDIu0DMMjAKfYuLa7yWoRt/XEKTwOSnbr vsn68XVFzeFaoLGvPulkTKnJx80GnhZDHoDTh4UG8bz4XPKHFsgAa/JyAvXoTkKIX4fi cQwyF0GmrOTrBePpWtnDApMn4mToVuzdxI6WutDxW3y5QWnoo+7bKuby/2oeTzcJWRuk 1uHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=i92O26eIf8LC06jff7in2sHavnZyS0P4DLK2xxogBqg=; b=aqoxU6PZpB6C38XcM1e4qpgGPGilFu33YgfwqD1LhrkSJs2lACXr1akFlgL5F99Hga lMHK6xfzf5GSLXLxG77yQf4enEnb9hNdowWOoe8PI4ZFRzoYHOzaOqVvrycQ0O2MVXOq UxKh4pmkVzHl42ZOeQqsg362j5qnYjDlS6h4joPB4p5JtXq3QDU36J8PHrS5ptfuO3wl 3dN4jUQ06U43oZ2CYoT6cpNDkJQ2u3V5p9rpM3nSjlF3x6bhTm3yNuWI4GtjR42aLJgP UKGOHRoclZ3FvJs6tN64E54KNe984TOUzbgDmHIOma5M+LfrC5nlUtI6EbY6yG2p73p7 uuvQ== X-Gm-Message-State: AIVw1113KL7JA4kY/5EfYK2bCLLjSQKx0r0MrghKAVhIP7rNZ9DkAmKN N7p/y3OWQfTGvE6J X-Received: by 10.36.4.4 with SMTP id 4mr24435825itb.73.1499910774099; Wed, 12 Jul 2017 18:52:54 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id b18sm2176061itd.25.2017.07.12.18.52.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jul 2017 18:52:53 -0700 (PDT) In-Reply-To: <87zic9dtti.fsf@drachen> (Michael Heerdegen's message of "Thu, 13 Jul 2017 03:11:37 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134490 Archived-At: Michael Heerdegen writes: > Eh - no. Maybe I have a wrong mental model. I thought that the free > variable `x' in the lambda is (also) in the scope of the dynamical > binding created by `progv', and because that binding is established > inside the `let' establishing the lexical binding of `x', it would > shadow the lexical binding. Oh, you want lexical and dynamic binding on the same variable? I think the answer is "don't do that". > Why does the lambda still refer to the lexical binding? Maybe it would be more obvious if we wrote it like this: (let ((x 0)) (cl-progv (list (intern (read-string "Enter var: "))) (list 1) (funcall (lambda () x)))) Clearly the inner x must refer to the lexical let-binding, right? Even if the user happens to enter `x' at the prompt this remains true. > Does a lexical binding always beat a dynamical one? Yes, lexical analysis is performed first and then the names are thrown away, so you can't even tell when the "same" variable has been dynamically bound as well.