Larry Evans
On 06/06/14 21:18, Louis Dionne wrote:
[...]
IIRC, list uses an evaluator and "tagged" lists where the 1st element in the list is a tag for the operation to be performed and the evaluator dispatches on this tag to do the operation with the operands being the remaining args in the list.
I don't understand which list you are talking about. Are you talking about MPL11 lists, Hana lists or something else? MPL11 lists and Hana lists use type class based dispatching, so that would be incorrect if you were talking about those.
The attached is my first attempt at doing something similar with the idea you propose.
I'm wondering if spirit might use something similar where the tags, instead of being op_or or op_and, would be op_alt and op_seq where op_alt would correspond to the alternative parser:
http://www.boost.org/doc/libs/1_55_0/libs/spirit/doc/html/spirit/qi/referenc.... html
and op_seq would correspond to the sequence parser:
http://www.boost.org/doc/libs/1_55_0/libs/spirit/doc/html/spirit/qi/referenc... tml
Does this look useful? Any suggested improvements would be appreciated.
IIUC, tagged tuples are a kind of dispatching system, right? If so, I don't see the gain over a traditional tag (or type class) based dispatching. I might be missing something; could you please explain? Regards, Louis