[ruby-core:76060] [Ruby trunk Bug#12499] case statement requires keyword "then" in windows

From: nobu@...
Date: 2016-06-17 00:59:25 UTC
List: ruby-core #76060
Issue #12499 has been updated by Nobuyoshi Nakada.

Description updated

`:` after `when` had never been an official spec.

----------------------------------------
Bug #12499: case statement requires keyword "then" in windows
https://bugs.ruby-lang.org/issues/12499#change-59259

* Author: Ken Abramson
* Status: Rejected
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
the following example code does not compile on Windows
if you replace "`:`" with "then" it does compile
if you leave out "`then`" it does not compile

The Book of Ruby - http://www.sapphiresteel.com

```ruby
def showDay( i )
	case( i )
		when 1 : puts("It's Monday" )
		when 2 : puts("It's Tuesday" )
		when 3 : puts("It's Wednesday" )
		when 4 : puts("It's Thursday" )
		when 5 : puts("It's Friday" )
		when (6..7) : puts( "Yippee! It's the weekend! " )
		else puts( "That's not a real day!" )
	end
end


for i in 1..8 do
	showDay( i )
end
```




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next