BT

InfoQ Homepage News Ruby Future Roundup: Ruby 1.9.0-5 Released, JRuby Skips 1.8.7, Procs#=== For Case Testing

Ruby Future Roundup: Ruby 1.9.0-5 Released, JRuby Skips 1.8.7, Procs#=== For Case Testing

Bookmarks

Ruby 1.9.0-5 Released

On Friday the 3rd, Ruby 1.9.0-5 was released by Yuki Sonoda, after the last delays, related to miniunit, were fixed by Ryan Davis. This release also marks the feature freeze for the upcoming version 1.9.1. (see the changelog for detailed information).

JRuby Not Going to Support 1.8.7

Marcin Mielżyński, one of the JRuby committers, proposed to drop support for Ruby 1.8.7 in JRuby:

Most 1.8.7 features that came from 1.9.1 are to make transition from 1.8 to 1.9 series easier. Majority of them is just a copy (with minor changes to match 1.8.x api), but there is a lot of tricky examples that behave differently under 1.9.x, 1.8.6 and 1.8.7 [...] it doesn't make sense to port all the behavior from 1.9.x to 1.8.7 since it would end up 1.9.x just without yarv and all the fancy syntax features (well, and encoding support of course).

Thomas Enebo and Charles Nutter agreed and added, that users should switch directly to 1.9 rather then writing code that only works in 1.8.7 (support for Ruby 1.9 in JRuby can be enabled with --1.9). Charles also posted their decision to the Ruby-core mailinglist., but no discussion has started yet.

Procs for Case Equality Testing

Ruby uses the ===-operator to compare the different cases in a case-statement. Ruby 1.9's Proc class just recently got a ===-method, basically just an alias for the call-method used to invoke the Proc. Now, this means that one can use a Proc object in a case-statement; it will get the case-argument as parameter. This trick was discovered by Aimred, who added the method themselves, before Matz integrated it into Ruby 1.9.

Dave Thomas shows an even more sophisticated application, using currying to create several Procs to check for the day of the week.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • feature freeze

    by Roger Pack /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I believe the feature freeze is still a little loose as they are still trying to finalize...basically miniunit :)

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.