From: Brent Roman Date: 2009-02-11T18:10:12+09:00 Subject: [ruby-core:21983] Re: New hash : syntax for the 1.8 series? Urabe, This patch almost works. However, it fails on this: ruby -ve "p false ? nil: 'food'" ruby 1.8.7 (2009-2-10 MBARI 7/0x8770 on patchlevel 72) [i686-linux] -e:1: syntax error, unexpected tLABEL p false ? nil: 'food' ^ I've attached a (much bigger :-) patch to 1.8.7-p72 that also backports the new lexer states from 1.9 necessary to handle the above syntax. Thank you *very much* for your quick response. Without it, I would not have known where to begin. I've also backported this to the heavily patched version of Ruby 1.6.8 that MBARI uses for embedded systems and robotics. See photos and videos at: http://www.mbari.org/ESP In this application, molecular biologists write high-level Ruby scripts to perform chemical assays. A slightly modified version of irb serves as the user interface. In this environment, Ruby syntax changes necessarily impact end users. I choose Ruby over Python six years ago largely because of its free form syntax. The fact that newer versions require more parentheses and leading zeros for all floating point literals may make Ruby a more rigorous programming language, but they also make it less comfortable for use on an interactive command line. I've gradually come to view my patched 1.6.8 Ruby as part of our application. At some point, after I've bent it to my needs, I expect to switch to a version based on the 1.8 series. I think that the feature set of 1.8.7 was a good tradeoff. The fact is that internationalization in 1.9 and YARV add considerable complexity, resulting in a ruby core binary twice as large as 1.8.7 and three times the size of 1.6.8. I hope the MRI team will continue to incrementally improve the 1.8 series. I'll continue to help in any small way I can. - brent Urabe Shyouhei-4 wrote: > > Brent Roman wrote: >> Is anyone working working on porting this back to 1.8? > > Not sure if it should go to 1.8, but porting itself is as easy as this: > ...snip... > http://www.nabble.com/file/p21950857/parse.y parse.y -- View this message in context: http://www.nabble.com/New-hash-%3A-syntax-for-the-1.8-series--tp21928963p21950857.html Sent from the ruby-core mailing list archive at Nabble.com.