Re: [racket] syntax/parse ~or patterns

2011-06-09 Thread Carl Eastlund
Nadeem, You're mixing "..." repetition with mapping some kind of operation over each element, and that doesn't work, at least not directly. Also, the way you've used ~or does not preserve the ordering of elements. Instead, the attributes a and b just get all the a/b pairs, and c gets all the c el

[racket] syntax/parse ~or patterns

2011-06-09 Thread Nadeem Abdul Hamid
I'm struggling with figuring out how to work with ~or patterns and syntax/parse. Suppose, for example, I want to write a macro that takes any number of either single numbers or pairs of numbers. It should expand into a list of results where each single number is negated and each pair is summed toge