push_element/2 - efficient sliding window

Vlad Dumitrescu XX (LN/EAB) vlad.xx.dumitrescu@REDACTED
Fri Aug 12 11:23:10 CEST 2005


Mmm, yes, it is an interesting idea. But I'm not sure if it would qualify under the rule of "least astonishment" if {H|T} behaves differently than [H|T]. Perhaps it would be better to  introduce Richard O'Keefe's abstract patterns instead (I might be wrong that they could solve this issue).

<aside>
Regarding the rewriting of the parse tree, I have to confess that I am forced to go that silly way because I need more information [*]. So I would be very happy if it was possible to attach own annotations to the lexical tokens and to the parse trees, without having to hack the lexer and parser. 

[*] like for example position in file, not line number; I also need the token text, not only the value - for example 16#cafe is returned as {integer, _, 51966} which is useless for source code analysis and transformation.

</aside>

regards,
Vlad



More information about the erlang-questions mailing list