Re: loss of abstraction Michael Sperber 24 Aug 2005 17:41 UTC

Andre van Tonder <xxxxxx@now.het.brown.edu> writes:

> On Tue, 23 Aug 2005, Michael Sperber wrote:
>
>> I want to change the representation ot carry location
>> information, possibly to record if parens or brackets were used,
>> possibly whether dots appeared in the source code, possibly comments,
>> and probably all kinds of other stuff in the future.
>
> Bear with me while I play devil's advocate.
>
> Syntax as lists (or isomorphic to) represents the highest level of abstraction
> (on the input) that preserves the meaning of Scheme code.  It is pretty much
> the unique interface satisfying this theoretically nice criterion, which IMO
> makes it a very valid minimal API for a Scheme macro system.

I think we differ on what "high" and "low" mean in this context, but
that's a minor point.

I can't really fault your argument here for a purely
compilation-oriented notion of "meaning."  But I disagree that
"meaning" is restricted to that---I think source-code location
information is part of the meaning, and I can think of contexts where
I would even use it in a compilation setting, say, for spotting errors
in restricted environments

> A minimal level of support for user-access to location would attach location to
> identifiers only.  Are there sufficiently many compelling use cases that are
> not covered by this?  I'm not sure comments or square brackets qualify ;-)

As someone pointed out, how do you point to the location of

(

   3
       4
)

for an error message?

(Or anything where the opening paren is removed from the operator,
say.)

You can always put more intelligence in your IDE, but at the cost of
replicating functionality that the compiler already has.

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla