From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: How to record source properties for all symbols? Date: Mon, 04 Jun 2018 06:07:19 -0400 Message-ID: <87y3fuamqw.fsf@netris.org> References: 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 1528106902 11354 195.159.176.226 (4 Jun 2018 10:08:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 4 Jun 2018 10:08:22 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: guile-devel To: Fis Trivial Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jun 04 12:08:18 2018 Return-path: Envelope-to: guile-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 1fPmPR-0002tA-Ma for guile-devel@m.gmane.org; Mon, 04 Jun 2018 12:08:17 +0200 Original-Received: from localhost ([::1]:38691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPmRY-0002Xa-TX for guile-devel@m.gmane.org; Mon, 04 Jun 2018 06:10:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPmPq-00013J-91 for guile-devel@gnu.org; Mon, 04 Jun 2018 06:08:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPmPm-0007et-9t for guile-devel@gnu.org; Mon, 04 Jun 2018 06:08:42 -0400 Original-Received: from world.peace.net ([64.112.178.59]:56140) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fPmPm-0007eh-5E for guile-devel@gnu.org; Mon, 04 Jun 2018 06:08:38 -0400 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fPmPk-0001s3-VR; Mon, 04 Jun 2018 06:08:37 -0400 In-Reply-To: (Fis Trivial's message of "Sun, 3 Jun 2018 19:48:05 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.112.178.59 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19541 Archived-At: Hi, Fis Trivial writes: > Can you give me some guidance for how to achieve the goal(record all > source information for every symbol). If it's theoretically impossible > or hard to achieve, can you give me some inside why and advises for > making best effort? I intend to help, so pointers to internal structures > are also welcomed. The problem is that there's no place to store the source information for symbols in the standard S-expression representation. The principal defining characteristic of symbols -- that "two symbols are identical (in the sense of 'eqv?') if and only if their names are spelled the same way" (R5RS =C2=A7 6.3.3) -- combined with the fact that 'eq?' is specified to be the same as 'eqv?' for symbols, leaves us no way to distinguish two instances of the same symbol, and therefore no way to store per-instance annotations such as source information. Fixing this would require abandoning the plain S-expression representation in favor of one in which symbols are represented by a different data structure. Our reader would need to be extended to support the option of returning this new data representation instead of plain S-expressions, and our macro expander would need to be modified to accept this new representation as input. Mark