guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to record source properties for all symbols?


From: Mark H Weaver
Subject: Re: How to record source properties for all symbols?
Date: Mon, 04 Jun 2018 06:07:19 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi,

Fis Trivial <address@hidden> 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 ยง 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]