pegjs/examples
David Majda e510ecc3d0 Switch from first/rest to head/tail in example grammars
In the past year I worked on various grammars where first/rest or
head/tail were used as labels for parts of lists. I found I associate
head/tail with a list immediately, while in case of first/rest I have to
"parse" grammar rules for a while before understanding their structure.

Moreover, I tend to assume that rest is a list of the same thigs as
first, but I don't have such assumption in case of head/tail. This
assumption was in conflict with the grammar structure.

I'm not sure how much these observations are applicable to others, but I
decided to act on them and switch from first/rest to head/tail.
2015-10-09 17:09:33 +02:00
..
arithmetics.pegjs Switch from first/rest to head/tail in example grammars 2015-10-09 17:09:33 +02:00
css.pegjs Switch from first/rest to head/tail in example grammars 2015-10-09 17:09:33 +02:00
javascript.pegjs Switch from first/rest to head/tail in example grammars 2015-10-09 17:09:33 +02:00
json.pegjs Switch from first/rest to head/tail in example grammars 2015-10-09 17:09:33 +02:00