The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
(String

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.
(String Posted: Sep 29, 2006 10:26 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: (String
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

So, it sounds like the 1.9 series will remove Enumerable from String’s ancestry, in favor of String#lines. All string iteration casts to an Array. Maybe I’m getting my hopes up, but all these string changes seem like portents of Unicode Times.

 >> str = "pony\nwagon\nstungun\n" 
 => "pony\nwagon\nstungun\n" 
 >> str.max
 NoMethodError: undefined method `max' for "pony\nwagon\nstungun\n":String
 from (irb):2:in `Kernel#binding'
 >> str.lines.max
 => "wagon\n" 

Makes sense. Anyone else mourning the impotent string splat?

 >> utilities = *str
 => ["pony\nwagon\nstungun\n"]

Like a little rotary saw whose tooth got stuck. (from matz and patch.)

Read: (String

Topic: Try ruby! (in your browser) Previous Topic   Next Topic Topic: Specifying which code to profile (profiling and Ruby part 3)

Sponsored Links



Google
  Web Artima.com   

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