Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-05-25 09:37:56


On Friday 25 May 2001 01:16 am, you wrote:
> From: "Douglas Gregor" :
[snip]
> The opposite extreme is:
>
> rule = alt(a, (seq(b, c)); // rule = a | b c
>
> ... Reminds me of lisp/scheme
>
> I'd like to be consistent. If we are to reuse | to mean alternative,
> what's wrong with reusing prefix + and *? Still I'd go for the
> iterator since it addresses something that the * and + couldn't do:
>
> repeat<8, 8>(a); // repeat 'a' exactly 8 times
>
> Cheers,
> Joel de Guzman

I'm not overly adamant about prefix * and prefix +, it just worries me how
far away from the original definitions we've gone. In any case, I like the
iterator syntax. I don't recall it being suggested, but if we're into the
operator overloading the above could use regular expression-style repeating:

a(8)
a(3, 5)
a(0, inf)

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk