From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gemini Lasswell Newsgroups: gmane.emacs.devel Subject: Re: scratch/accurate-warning-pos: Solid progress: the branch now bootstraps. Date: Sun, 02 Dec 2018 10:39:31 -0800 Message-ID: <87d0qjhixo.fsf@runbox.com> References: <20181129220552.GI12576@ACM> <9dde4ed7-8401-6022-a668-258d48bb7726@cs.ucla.edu> <20181130185503.GA16256@ACM> <20181130220218.GB16256@ACM> <138d56b7-53df-1ea5-377c-8502245f1b6b@cs.ucla.edu> <5C0239DA.4030907@gmx.at> <20181201124727.GC5102@ACM> <5C02962C.5040505@gmx.at> <20181201172127.GA29324@ACM> <7faee658-7ad0-4339-00e3-fef198a84121@gmail.com> <37f5c7fb-c1ce-e5b6-d242-5d9c2f3b3576@cs.ucla.edu> 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 1543775909 4447 195.159.176.226 (2 Dec 2018 18:38:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2018 18:38:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.90 (gnu/linux) Cc: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel , martin rudalics , Michael Heerdegen , Emacs developers , Yuri Khan , Stefan Monnier , Alan Mackenzie , Eli Zaretskii To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 02 19:38:24 2018 Return-path: Envelope-to: ged-emacs-devel@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 1gTWdM-00012u-6b for ged-emacs-devel@m.gmane.org; Sun, 02 Dec 2018 19:38:24 +0100 Original-Received: from localhost ([::1]:45482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTWfS-0005IB-Lc for ged-emacs-devel@m.gmane.org; Sun, 02 Dec 2018 13:40:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTWeq-0005I5-Es for emacs-devel@gnu.org; Sun, 02 Dec 2018 13:39:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTWep-0000eK-IE for emacs-devel@gnu.org; Sun, 02 Dec 2018 13:39:56 -0500 Original-Received: from aibo.runbox.com ([91.220.196.211]:45588) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gTWel-0000aj-Sh; Sun, 02 Dec 2018 13:39:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=UgoYCvt4HSZrfzh/Ge75UeSKnCMY+QYBObrpX4fj6j4=; b=CPBgkiusArxW/SvpP4EoxyA3Iy h6FW75a91k7hko/chil30e/IZf6RJTbCTWJFzturkYNPiZ1I2DGQgj2fLcixyiWw1uM4fTwiREri1 CvltfnHc/iWWK0K+Ziv8GpzLLgcXTAR/Bl8HRTaLLYV6zujU+AQNgmOVRPK3zMl8uwBw9YXMH5sAt uugBgE9IDnMPq80Bgh8d+zGhm9hnukaI/+4tdWVMbphH3juhMMiWWqyv6mhEkPHy63Is0f6WnvjoL tW3Yd0s4I0pRxB57JO1TXSxI04lIzh8rf68vZRjyZO3IcOva0cTJxyS/BQvHFWPURbQRgcWA7AbHI spio+5HA==; Original-Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1gTWeg-0004X2-4B; Sun, 02 Dec 2018 19:39:46 +0100 Original-Received: by mailfront11.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1gTWeV-0002tU-68; Sun, 02 Dec 2018 19:39:35 +0100 In-Reply-To: <37f5c7fb-c1ce-e5b6-d242-5d9c2f3b3576@cs.ucla.edu> (Paul Eggert's message of "Sat, 1 Dec 2018 13:26:48 -0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 91.220.196.211 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:231590 Archived-At: Paul Eggert writes: > Yuri Khan wrote: >> A macro that has a 'position-aware property on >> it can be called directly on the position-annotated AST and expected >> to use =E2=80=98eq-with-position-information=E2=80=99; while a legacy ma= cro will be >> called on a de-annotated AST, may use plain =E2=80=98eq=E2=80=99, and wi= ll return a >> similarly position-oblivious AST. > > Thanks, this is a good suggestion, perhaps the best idea I've heard so > far in this thread. Here are a few more suggestions on top of it. We don't need to invent a new property or rewrite every macro to make macros work on position-annotated ASTs, because we already have this feature. It's (declare (debug ...)), aka Edebug specifications, and it is how Edebug gets exact source positions when stepping through code which contains macros. Paul, you said earlier in this thread that you weren't familiar with Edebug, so I will attempt to explain how its position annotation works. In an Edebug specification, a macro author can specify which of the arguments to a macro (and which structures inside those arguments) are forms which will be evaluated, and therefore should be position-annotated, and which are not. For example in the form (dolist (VAR FORM) BODY) FORM and BODY will be evaluated, but VAR will not be, instead it is expected to be a symbol which will be bound in the code generated by 'dolist'. So the Edebug spec for 'dolist' instructs Edebug to annotate FORM and BODY and leave VAR alone. If the macro author doesn't provide an Edebug spec, then Edebug doesn't add position annotations to any of its arguments, and then when debugging, Edebug will skip over those arguments to the next point of execution which has a position annotation. When an Edebug spec instructs it to, Edebug wraps macro arguments with position annotations, which look just like normal function calls (because they are) and can be treated by the macro just like any other Lisp form destined for evaluation. Edebug's annotated forms look like: (edebug-after (edebug-before POS1) POS2 FORM) where POS1 and POS2 are source code positions for the beginning and end of FORM (to be precise, they are indices into a vector of source positions built by the Edebug reader). FORM could be recursively annotated if it contains other forms. For those of you who may have missed it earlier, here are Stefan's thoughts on how Edebug specs could be used by the byte compiler: http://lists.gnu.org/archive/html/emacs-devel/2018-11/msg00526.html.