From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#18059: 24.3.92; defvar and special variables Date: Tue, 13 Feb 2018 19:27:43 -0500 Message-ID: <87efloa000.fsf@users.sourceforge.net> References: <87ha2c7lxy.fsf@web.de> <87mv0gbq33.fsf@users.sourceforge.net> <87y3k0bdm9.fsf@web.de> <87inb4bbse.fsf@users.sourceforge.net> <873727bkud.fsf@users.sourceforge.net> 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 1518568003 5409 195.159.176.226 (14 Feb 2018 00:26:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Feb 2018 00:26:43 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: Michael Heerdegen , 18059@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 14 01:26:38 2018 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 1elktn-0007Z2-S7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Feb 2018 01:26:11 +0100 Original-Received: from localhost ([::1]:39104 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elkvk-0008Qi-9w for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Feb 2018 19:28:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elkvd-0008Q1-7L for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2018 19:28:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elkva-0007DF-3T for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2018 19:28:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34056) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1elkvZ-0007Cs-V1 for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2018 19:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1elkvZ-0008Oi-OD for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2018 19:28:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Feb 2018 00:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18059 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 18059-submit@debbugs.gnu.org id=B18059.151856807432268 (code B ref 18059); Wed, 14 Feb 2018 00:28:01 +0000 Original-Received: (at 18059) by debbugs.gnu.org; 14 Feb 2018 00:27:54 +0000 Original-Received: from localhost ([127.0.0.1]:41953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elkvR-0008ON-Sj for submit@debbugs.gnu.org; Tue, 13 Feb 2018 19:27:54 -0500 Original-Received: from mail-io0-f181.google.com ([209.85.223.181]:43786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elkvQ-0008OB-Cj for 18059@debbugs.gnu.org; Tue, 13 Feb 2018 19:27:52 -0500 Original-Received: by mail-io0-f181.google.com with SMTP id 72so23304435iom.10 for <18059@debbugs.gnu.org>; Tue, 13 Feb 2018 16:27:52 -0800 (PST) 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=ptxMXfxxK3HaU7zfvKyWRgvn+cjG1XvTeiZiOrOx4X8=; b=f5/1LfL9gcYZJe2Wh54SyoxNT+on28uSVqRrpBWrFC9voUBkhYWLEhbcKMUg91HEf1 wOkOiETG75cwhA3tuVkkz3C8vXBnn+KdSMGoJk4QCqbjh9gpUeHATlXcWsryU0iiFj3U b7iYMyiOGo/V1P1Dw897hph9CP8b4X83s6cjr4t4qynyxc2I9cy+NteM75gX7A/g0bAJ mtg+3rQLaAjYOJa+8JoSH1Igyk3ao2radpBibusqztDaCwepM1mtjq8IxsY5uWeN1HgM JemYcPDqQhvFscHfLxyv/hdIpCOQnt/Tv9d36kLg+YOdSseL+EayiwR9uvXam7zqNk+X ZSZg== 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=ptxMXfxxK3HaU7zfvKyWRgvn+cjG1XvTeiZiOrOx4X8=; b=I/RZfQMYx/4x1RZsOuPtapAj2qvrQ+1TyOXdkdZ0IFJT8tg7tTy8G9TIn1b7RBVGOP 8CBgTQdB15m5emYqFjgtpy6GrI6YvFMHLBh+Gu5pjUFkAnoPBz4z8l0q60uN1tmtnazt 9dUpBphmtRqQ6GA/GgfOkkcQrT0ecYg1QiWAk/YLLGycc22NjHmyLhrW177MyMLFfqwY R2dHIiW0oqbXjrVQLzI44HknQOAGlrYHQkCG6NDEfEv6+n/bgG/bHErBnvGaPPzBUJQU tdGUsjcqTJoQ3WvbdpuY1hwV9jBlCMA3gw+2ByroME8qNN84eqwbUlEsvmXxe2bh/sRo o1dA== X-Gm-Message-State: APf1xPBVxHeWcdyB3lFMiE6I6dLzc3h2Y6i3XUYYYYSC8ItXvX1OicbK sudfxjZoC39W+qQxdBHATXC6ag== X-Google-Smtp-Source: AH8x225a/mcSB9FH3wlGWEo7jGaqpAoPjEqv0n48nodGZP4/+cFtnitjMy9zZHIy6qPdWpOAyki9dQ== X-Received: by 10.107.19.77 with SMTP id b74mr3586034ioj.251.1518568066359; Tue, 13 Feb 2018 16:27:46 -0800 (PST) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id x28sm15230426ioi.83.2018.02.13.16.27.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2018 16:27:45 -0800 (PST) In-Reply-To: <873727bkud.fsf@users.sourceforge.net> (Noam Postavsky's message of "Sun, 11 Feb 2018 10:35:22 -0500") 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:143260 Archived-At: Noam Postavsky writes: > Stefan Monnier writes: > >>> I noticed doing (let () (defvar x)) seems to be the same as (progn >>> (defvar x)), which may be a bug. >> >> Both interpretations would make sense, so given the lack of >> documentation about the intention, we could consider it as a feature as >> much as a bug. >> >> Have you checked whether the behavior is the same with the >> byte-compiler? > > Yes, it's the same. It's the same when let-binding a lexical variable, but not when binding a dynamic one. ;; -*- lexical-binding: t -*- (defvar foo-dynamic 'foo) (let ((foo-dynamic 99)) (defvar x)) (let ((x 1)) (setq testfun (lambda () x))) (message "%S" (funcall testfun)) gives Symbol=E2=80=99s value as variable is void: x when running the interpreted version, and 1 when running the compiled version.