The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Everyone Thinks Numeric Suffixes Are Neat Right Now

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Everyone Thinks Numeric Suffixes Are Neat Right Now Posted: Jan 17, 2005 3:08 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Everyone Thinks Numeric Suffixes Are Neat Right Now
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

And they are neat. It’s just one of those really simple changes to Ruby that walks the tightrope between being a very elegant addition and being not worth anyone’s time ever.

Supposedly unleashed at last RubyConf by the sublime and blemish-free Rich Kilmer, numeric suffixes took the form of methods to Fixnum. Stuff like 12.hours, which returns the number of seconds in a twelve hour period, availing you of having to use the unseemly 12 * 60 * 60. You can find this syntax in the new Rails 0.9.4.

If you like this idea, then you’ll probably dig flgr’s patch to Ruby, supplied a few weeks ago on Ruby-Core, which adds numeric literal suffixes to Ruby. His patch adds f and b suffixes to Ruby’s number parser.

 >> 5.1b
 => #
 >> 1f
 => 1.0

The ensuing thread isn’t acknowledged by Matz, but a few ideas are kicked around for adding 45min or "10:00"pm or similiar suffixes which could make for a very friendly flavor of Ruby.

Read: Everyone Thinks Numeric Suffixes Are Neat Right Now

Topic: test Previous Topic   Next Topic Topic: Rails runs through XP Cincinnati

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use