You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's an interesting inconsistency with how 'else' is indented in 'switch' and 'if' statements:
# Here's the syntax for 'if'. The 'else' is flush with the headword.
if day is "Tue"
go relax
else
go work
# Here's the syntax for 'switch'. The 'when' and 'else' must be indented.
switch day
when "Tue"
go relax
else
go work
If I try to keep 'when' flush with 'switch', I get:
Error: In stdio, Parse error on line 122: Unexpected 'TERMINATOR'
Here are the equivalent constructs in Ruby:
if day == "Tue"
go relax
else
go work
end
case day
when "Tue"
go relax
else
go work
end
jashkenas suggested changing CoffeeScript to use the Ruby indentation by default. He asked whether it would be desirable to support the existing CoffeeScript indentation rules as well.
The text was updated successfully, but these errors were encountered:
We talked about this a little in #coffeescript, and I think we're going to stick to the indentation that we've currently got -- the reason being that it mirrors JavaScript's use of curly braces to delimit the statements...
There's an interesting inconsistency with how 'else' is indented in 'switch' and 'if' statements:
If I try to keep 'when' flush with 'switch', I get:
Here are the equivalent constructs in Ruby:
jashkenas suggested changing CoffeeScript to use the Ruby indentation by default. He asked whether it would be desirable to support the existing CoffeeScript indentation rules as well.
The text was updated successfully, but these errors were encountered: