Hi Alaric, On Thu 12 May 2011 11:27, Alaric Snell-Pym <[email protected]> writes:
> I think Andy's opined in the past that using weak maps to [map source > information to code] is insufficient, requiring explicit syntax > objects rather than just sexprs. > > Andy, is that a correct interpretation, and if so, can you explain that? Yes, I've said that, though it does seem a minor point. (A herring-tail wagging a dog?) Basically the deal is that in an expression like: 0: (+ 37 1: foo 2: bar 3: baz) where `bar' is unbound, you want to say "line 2 column 4: `bar' is unbound", rather than attributing the error to (say) line 0. I keep using Racket as the example here, because I think they do it very well, even highlighting the expression precisely in their editor. But this sort of information is difficult to propagate through an expander if you don't wrap your s-expressions in some other data structure, like a syntax object. What Guile does, and AFAIK what Chicken does as well, is to have `read' build up a weak map of heap-thing to source-information. But you can't get source info for bare symbols with such an interface. I get bugs about that sometimes: https://savannah.gnu.org/bugs/?30903 Now, to actually get such source information in the first place, you need a `read-syntax': http://docs.racket-lang.org/reference/Reading.html?q=read-stx#(def._((quote._~23~25kernel)._read-syntax)) But that need not be specified. Regards, Andy -- http://wingolog.org/ _______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
