From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Why is Elisp's defvar weird? And is eval_sub broken? Date: Sun, 15 Feb 2015 06:17:45 -0800 Message-ID: <54E0AA89.4030802@dancol.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kmwsWsFoWtqvbvnAiQDOU7BQFnEpTlWHF" X-Trace: ger.gmane.org 1424009904 26757 80.91.229.3 (15 Feb 2015 14:18:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Feb 2015 14:18:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier , Kelly Dean Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 15 15:18:16 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YN01V-0000Rb-T2 for ged-emacs-devel@m.gmane.org; Sun, 15 Feb 2015 15:18:14 +0100 Original-Received: from localhost ([::1]:35563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YN01U-0000C8-V2 for ged-emacs-devel@m.gmane.org; Sun, 15 Feb 2015 09:18:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YN01J-0008TU-Og for emacs-devel@gnu.org; Sun, 15 Feb 2015 09:18:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YN01C-0006dI-UC for emacs-devel@gnu.org; Sun, 15 Feb 2015 09:18:01 -0500 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:35145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YN01C-0006Zq-JD for emacs-devel@gnu.org; Sun, 15 Feb 2015 09:17:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=ILAep0GPSJT+GrtqpDrm5pyPZn52qUsfPgW0SH75mH0=; b=C9hDeRipD26UIt1SlozuXBSp4HVA6UMMjWzpvg1Djczysrw1Zwk+lYy/b9H3pZ+CVkq8RjB/oWaNgHQNdyZKyWrPaMLhZ0CVD4+JxPX/NdriBb2zizuCEVxB16anDm5XqwMrXBgWx5LIMs99F3TkMFLcLqTYdrJrRz8K0rcADI+yqTivo2YaTDuc5DFJ1JjnGp/Jw5R4Tp9clerqblTzCMutp7Zdi+wOSVKHhQbGi+0yOd1zJ2+iSlmbSsG9uE4mfeLmwGrZfChCJOQo4k53MdqX270w30c9lpGTOR5DdIe+PpE2XZITj6210MEOjw69dcV+QsyIMUdNzrbfRfcnsA==; Original-Received: from c-73-221-38-18.hsd1.wa.comcast.net ([73.221.38.18] helo=[192.168.1.210]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YN018-0000Tq-EU; Sun, 15 Feb 2015 06:17:50 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183089 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kmwsWsFoWtqvbvnAiQDOU7BQFnEpTlWHF Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 02/14/2015 06:36 AM, Stefan Monnier wrote: >> A declaration of free dynamic variables for a function could tell the >> byte compiler that those free variables aren't typos, since >> otherwise the byte compiler would expect either the symbol to be >> declared special or a lexical variable by that name to be in scope. >=20 > There is such a declaration already. It's called (defvar ). Tada= ! >=20 >>> Normally, such conflicts should never happen >>> because all special vars should be named with a "package prefix", but= >>> sadly, reality is different, so it was indispensable to make this >>> effect local, to allow lexical-binding code to work reliably. >> By using llet, the byte compiler will catch such conflicts, and your c= ode >> (interpreted or compiled) that uses it will work reliably despite the >> conflicts. This means defvar's weird behavior is no longer needed. >=20 > It's not weird once you understand that it's a compiler directive which= > is absent from the .elc file. How are users supposed to understand that when it's completely absent from the documentation? --kmwsWsFoWtqvbvnAiQDOU7BQFnEpTlWHF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJU4KqJAAoJEN4WImmbpWBlqbQQAI87ADi4qW04212VkCC358DR UpP4joiMRNSO7jAo5wSHKgk/YjziPMdGHAVSe3dvapi59InCIj9IWbTvak628wqI UcjhtP+w4DVwRguBiHN9C+JnIcPxZrSMiXlwdJ1RA7QPqChFGKG2fdysfHlRl5Wd QIvi5OjwWvWHo+yfS1jstIaf5EyEI1zaHRBVutHknSwNh6aaRB7oFKIqX9IUq7tC V8PrZGWBDwMzousNAhb97yZDpRi3uy0310zvko8AOA/OMHYc81b//nKZqMf0pYUJ +e0Q2L/2ufg9VjeLOwLJPxvRNVg9KVlgjMRtiBeS5fmg3xwsK/hHbyQQAxfKuBhw ZtijBImW2scNF/c1VKyEeWCLqVHfnGU5P1+Xs+wILQlx5v58v2/VcJyUX47eHPzZ BOgS55tPVaZVwGH1EXXWLcjNSpP2+5/EiU1mMwmtTv+8QRIIsM3e9c1pYPzY43TL yn4GsbXgFk+oCNEpV8/ioRYSLboerhIiTcfr95+rFKKPk7WwlytnrIjexDiFJ+fM UoxJGr+XLT/dSf9koYOx3y9+XDU3jn1dEM1uNtFqfKibt2sbq2kudneklczKtfjZ iOpHc39WttU2MGORVfe6RKdGKETmxBLO2fAxt9qOtko4snVA7lXK5niUisLw5DWs aMEZ6YWqFvrtSUjRCF/a =StMM -----END PGP SIGNATURE----- --kmwsWsFoWtqvbvnAiQDOU7BQFnEpTlWHF--