Converting nil

November 2, 2008

Check C,C++,Java, JavaScript or any other langugage which treats “nil” as something different–probably a meaning equivalent to “a person having 5 hands”. But in Ruby you may use

nil.to_s —>> “0″

nil.to_i —->> 0

Is this really breaking the original stream of programming languages?

Entry Filed under: Ruby. Tags: , .

Leave a Comment

hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Categories

posts[:recent]

episodes[:recycled]

@@name = PRAYAS

Step down at my blog with your ideas,comments,suggestions on Ruby,RoR,Ajax or Web2.0.You may reach me at
infostall@gmail.com

find_by_tags

1st April 37signals 360 2008 aamir aamir new look abdul abhinay access active active record aishwarya AJAX AMC amul and bollywood class facebook ghajini google hosting India instance local mozilla myspace nil NY object objects olympic plugin prayas programming Rails RoR Ruby security talent variables web web2.0 windows yahoo

Blogroll

visitors[:since_Mar'08]

free web counter

Spam Blocked

Feeds

Meta

RSS Prayas here