From: Christophe Grandsire Date: 2005-10-13T22:57:04+09:00 Subject: Re: Default argument values for blocks Selon Eric Mahurin : > > Anybody ever just consider making a new expression (or maybe > RHS?) rule just for these default values such that "|" was not > in this expression? (...) in this or-less expression would > still use the normal expression. Wouldn't this solve the > problem? You'd just be forced to use (...) whenever you wanted > to "|". That doesn't seem so bad. > > ... { |a,b=1|2|a*b } # b default: 1, code: 2|a*b > ... { |a,b=(1|2)|a*b } # b default: (1|2), code: a*b > ... { |a,b=1+2|a*b } # b default: 1+2, code: a*b > > I don't see any ambiguity doing it this way. > 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. -- Christophe Grandsire. http://rainbow.conlang.free.fr It takes a straight mind to create a twisted conlang.