From: Phil Tomson Date: 2005-10-14T02:57:04+09:00 Subject: Re: Default argument values for blocks Austin Ziegler wrote: > On 10/13/05, Christophe Grandsire wrote: > > Yacc does. Even the simple { |a,b=1| a*b } fails because Yacc treats it as { | > > a,b=(1| a*b) }. And that *cannot* be solved in the current state of Yacc. The > > problem is that there doesn't seem to be *any* solution that solves both this > > problem and the problem of allowing bitwise or's in default arguments, short of > > renaming the bitwise or, which would be such a compatibility break that it isn't > > worth contemplating. > > > > This is at least my understanding of the problem. > > Is there any particular reason that we can't use a different parser, > e.g., Coco or something else? Surely there's got to be something > better than Yacc by now. > While I tend to agree that there are probably much better parser generators available now like ANTLR or even using a Ruby-based one like Rockit, I can understand the hesitation to change from yacc. It's a huge amount of work for one, and there would need to be a lot of testing to ensure that nothing has broke. I suspect that a change from yacc to another parser generator would delay Ruby2.0 by at least several months. Maybe that would be OK. Perhaps there would be other advantages gained by moving away from yacc that would help justify doing so? I'm still in the "It might be a nice feature to have, but it's not really needed enough to justify the kinds of changes being suggested" category. Phil