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 20:21:39 -0400 Message-ID: <87r2xldw4s.fsf@users.sourceforge.net> References: <87lgntfhky.fsf@drachen> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1499905277 24464 195.159.176.226 (13 Jul 2017 00:21:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Jul 2017 00:21:17 +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 02:21:07 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 1dVRsQ-0005oF-GM for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Jul 2017 02:21:06 +0200 Original-Received: from localhost ([::1]:56478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVRsW-0006kf-3E for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Jul 2017 20:21:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVRsQ-0006kM-6f for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 20:21:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVRsM-0004tb-7k for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 20:21:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVRsM-0004tX-0r for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 20:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dVRsL-0002wr-RJ for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2017 20:21:01 -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 00:21:01 +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.149990521411266 (code B ref 27674); Thu, 13 Jul 2017 00:21:01 +0000 Original-Received: (at 27674) by debbugs.gnu.org; 13 Jul 2017 00:20:14 +0000 Original-Received: from localhost ([127.0.0.1]:35949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVRra-0002ve-Gx for submit@debbugs.gnu.org; Wed, 12 Jul 2017 20:20:14 -0400 Original-Received: from mail-it0-f52.google.com ([209.85.214.52]:36870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dVRrY-0002vS-EX for 27674@debbugs.gnu.org; Wed, 12 Jul 2017 20:20:12 -0400 Original-Received: by mail-it0-f52.google.com with SMTP id m84so28669643ita.0 for <27674@debbugs.gnu.org>; Wed, 12 Jul 2017 17:20:12 -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:content-transfer-encoding; bh=WU9NXVT+Zx7x5kZ70vuiEfp2yEG8QHfVyfYQHFrjLWw=; b=iY9hw48d7heXRywe74+W/yuWpSlxwZQGjiDoWESogmfkwYaUdrWwWi7jrjJDYnYA8I R8zhOATyu/9RPAoKg/hw2VdOYzS3mExhOPqo4m5qfg6A3StAxbHA4DaPCGh4V5watdxG KsZKbodc96WqpiFW256BUiW4Y7hfpmN7KV5oT5Z9ni85A0Xvme5NKyHyZC4pkGLKWkle CwCsCWTURhpLCCTOgrl4KVw9GczLMfUSsy5ESfqZuqYet8+lLjibTNaI9+UyLwzJGQSF oQbm9/4NbknS9UeqDkfrtWNOSZbYYdXfrb9q7tY7Y7YzUXB0Snj7N9yditLnBWxXOrlw y4DQ== 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 :content-transfer-encoding; bh=WU9NXVT+Zx7x5kZ70vuiEfp2yEG8QHfVyfYQHFrjLWw=; b=fw3Ypt5IzLUIN4Yv6cOvlvdGIsMmnqJIH0U7Dba4XK92Y7yU8oGPIXOWS7J/PbeZP5 Vhx4Djek3vLoUp5rK2xrIcg6vKoFjGR+2TUNffUySfvwR82q/NnRlTepOqeNaVkGyWlI CqpYfuYjd7h1RdUssInrUq4/w0ZLw3SpCzbYrOMxGz1Gdk5Jy1aZ3P6p24PLVCjafePD 1vDlM9cDNh4Q2TUbB/vNTlGqyZ3vMpejbHbeSJhEx/SvdQ17tpTRbjOTu+jCKKSnbToC BcfXsP2LN8akxsf+oh6f4RztxanyA6JZptiYJlL8KQ+TtzyBrQdP39kiIvUE2uKX9DBn g1FQ== X-Gm-Message-State: AIVw113EbquACTXkgh/nhuF9vAEx081Vn6xL7rZj2483JqyTbsQkDyIV /Lg99LfX93NIr1Ly X-Received: by 10.107.182.132 with SMTP id g126mr1307715iof.216.1499905206478; Wed, 12 Jul 2017 17:20:06 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 126sm2283256ioy.15.2017.07.12.17.20.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jul 2017 17:20:05 -0700 (PDT) In-Reply-To: <87lgntfhky.fsf@drachen> (Michael Heerdegen's message of "Wed, 12 Jul 2017 23:53:01 +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:134484 Archived-At: Michael Heerdegen writes: > The way `cl-progv' is implemented, we have some strange effects > happening to closures in the body. For example, with lexical-binding > on, > > (let ((x 0)) > (cl-progv (list 'x) (list 1) > (funcall (lambda () x)))) > > yields 0, and > > (cl-progv (list 'x) (list 1) > (funcall (lambda () x))) > > yields 1. That isn't consistent (FWIW I would expect `1' in both > cases). IMO, this is a bug in your program, this yields 1: (progn (defvar x) (let ((x 0)) (cl-progv (list 'x) (list 1) (funcall (lambda () x))))) Note that your second expression gives a compile warning (it's also missing a defvar, though it happens to give the result you expect even without that): 27674.el:10:25:Warning: reference to free variable =E2=80=98x=E2=80=99