Yukihiro Matsumoto ha scritto: > Hi, > > In message "Re: ruby-dev summary 26468-26661" > on Fri, 5 Aug 2005 01:14:46 +0900, Christian Neukirchen <chneukirchen / gmail.com> writes: > > |I have no clue about the Bison grammar underlying Ruby, but can't you > |"simply" say that if the first token after { is a |, you need to parse > |until the next | to get the block parameters? > > It would be great if it's possible. But unfortunately I don't have > enough skills to accomplish this using yacc/bison. jus to notice: there is a language named SuperCollider[1] which by some strange case - has a rubyish syntax - seem to be able to handle all this things: { stuff() } #block with no arguments {|i| stuff_with(i))} #block with argument { |a="", b=""| stuff_with(defaulted_args) } # block with default args - has a "|" pairwise operator My only experience with yacc/bison has been a (mini)pascal->c compiler so I'm definitely not intelligent enough to check this out, but maybe some wiser people can take a look. [1] see http://c2.com/cgi/wiki?SuperCollider and http://sourceforge.net/projects/supercollider