>> "Tsuna" == Tsuna
<tsuna(a)warszawa.lrde.epita.fr> writes:
On 2006-06-07, Akim Demaille
<akim(a)lrde.epita.fr> wrote:
>>>> "SIGOURE" == SIGOURE Benoit
<sigoure.benoit(a)lrde.epita.fr> writes:
>
> > DesugarUnaryOps:
> > - Plus(Int(i)) -> Int(i)
> > + Plus(Int(i){a*}) -> Int(i){a*}
>
> If you don't write this, you loose the annotations?
Yes because you're building something new.
Remember, this is only sugar and
is desugared to: ?Plus(Int(i)); !Int(i)
How can the compiler guess whether or not the newly built term has some
relevant link with the formerly matched term and thus carry the annotations
around? In many cases the new term will have a different meaning and thus it
doesn't make sense to copy the annotations.
Even worse, what about the annotations of the subterms?
For instance, in the case you quoted, how can the
compiler guess that the
Int() located withing the Plus() has some link with the newly built Int?
Well, I agree with all this, but some sugar could be added, say -->
means preserve the top-level annotation. Or whatever. 0.02 cents
(that's not much :).