Currently in Scroll the way the groups keyword is implemented is that the last instance of it overwrites any earlier instances. Right now I have a situation where I have a file with 2 groups lines and I want to join the values of those lines into one. But I could imagine I might have situations where I want the last one to win.
This general situation seems to come up in Tree Languages a lot. Is there a semantic convention that would work everywhere, for explicitly declaring what behavior is desired? The choices seem to be:
First wins: the first declaration is used
Last wins: the last declaration is used
Join: the items are joined (in this case, what join character is used?)
Subtract: the item is subtracted
Final: this line is used no matter where it appears (and the last final would win). Similar to !important in CSS.
I'm not sure if this should be done at the Grammar level or just in the implementations of various languages. Just posting it here now to think out loud.
Currently in Scroll the way the
groups
keyword is implemented is that the last instance of it overwrites any earlier instances. Right now I have a situation where I have a file with 2groups
lines and I want to join the values of those lines into one. But I could imagine I might have situations where I want the last one to win.This general situation seems to come up in Tree Languages a lot. Is there a semantic convention that would work everywhere, for explicitly declaring what behavior is desired? The choices seem to be:
!important
in CSS.I'm not sure if this should be done at the Grammar level or just in the implementations of various languages. Just posting it here now to think out loud.