[#82706] [Ruby trunk Bug#13851] getting "can't modify string; temporarily locked" on non-frozen instances — cardoso_tiago@...
Issue #13851 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/07
[#82853] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork — russell.davis@...
Issue #13916 has been reported by russelldavis (Russell Davis).
3 messages
2017/09/19
[#82892] [Ruby trunk Bug#13921] buffered read_nonblock doesn't work as expected using SSLSocket — cardoso_tiago@...
Issue #13921 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/20
[ruby-core:82700] [Ruby trunk Bug#13879] [Not sure if a bug or not] case/when menus and trailing ', ' commas in when clauses
From:
shevegen@...
Date:
2017-09-07 10:51:42 UTC
List:
ruby-core #82700
Issue #13879 has been updated by shevegen (Robert A. Heiler).
I forgot to add - I assume that the puts invocation may lead to
trigger the above behaviour. My main confusion is why the ','
placed matters, depending whether one does an assignment, or
invokes a method. I would have assumed that the first would
also lead to a syntax error or similar, but instead ruby works
just fine with it, so I am not sure if this is a bug or intended
behaviour.
----------------------------------------
Bug #13879: [Not sure if a bug or not] case/when menus and trailing ',' commas in when clauses
https://bugs.ruby-lang.org/issues/13879#change-66534
* Author: shevegen (Robert A. Heiler)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Hello,
I am not sure if the following is a bug or a feature.
x = 'foobar'
case x
when 'a','b','c',
x = 5
end
puts x
Works fine.
But this here:
x = 'foobar'
case x
when 'a','b','c',
puts 5
end
Leads to this error:
syntax error, unexpected tINTEGER, expecting keyword_do or '{' or '('
Is this deliberately so? My confusion is that case/when works fine
in one case, but leads to an error in another case. I am not
sure if it is a bug or not, but I believe in the first case,
the user may have not wanted to put a trailing ',' there and
simply forgot to remove it. That is actually how I found out about
this behaviour, since I have a huge case/when menu and sometimes
make typos when re-arranging entries, including such trailing ','
via copy/paste jobs. :)
If it is a bug then perhaps it can be fixed; if it is not a
bug, perhaps the official documentation could explain this
feature? Or perhaps if trailing ',' are not useful, there
may be a warning issued or something in the first case.
Anyway, I am just reporting this in case nobody knows about
this - feel free to close this issue at any moment in time.
Thanks.
--
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>