Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Weird behavior of case/when
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Nicolas Desprès, post: 4515795"] I'm getting a very weird result using case/when. $ cat test.rb def test(a) case a.class when Class puts "class" when String puts "string" else puts "else" end end test(Float) test("hello") test(42) $ ruby test.rb class class class $ ruby --version ruby 1.8.4 (2005-12-24) [i686-linux] I would have exepected the following output: class string else Does anyone have an explanation about this issue? Cheers, --=20 Nicolas Despr=E8s [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Weird behavior of case/when
Top