[#107008] [Ruby master Bug#18465] Make `IO#write` atomic. — "ioquatix (Samuel Williams)" <noreply@...>
Issue #18465 has been reported by ioquatix (Samuel Williams).
16 messages
2022/01/09
[#107150] [Ruby master Feature#18494] [RFC] ENV["RUBY_GC_..."]= changes GC parameters dynamically — "ko1 (Koichi Sasada)" <noreply@...>
Issue #18494 has been updated by ko1 (Koichi Sasada).
4 messages
2022/01/17
[#107170] Re: [Ruby master Feature#18494] [RFC] ENV["RUBY_GC_..."]= changes GC parameters dynamically
— Eric Wong <normalperson@...>
2022/01/17
> https://bugs.ruby-lang.org/issues/18494
[#107302] [Ruby master Bug#18553] Memory leak on compiling method call with kwargs — "ibylich (Ilya Bylich)" <noreply@...>
Issue #18553 has been reported by ibylich (Ilya Bylich).
4 messages
2022/01/27
[#107346] [Ruby master Misc#18557] DevMeeting-2022-02-17 — "mame (Yusuke Endoh)" <noreply@...>
Issue #18557 has been reported by mame (Yusuke Endoh).
18 messages
2022/01/29
[ruby-core:107294] [Ruby master Feature#18408] Allow pattern match to set instance variables
From:
"Dan0042 (Daniel DeLorme)" <noreply@...>
Date:
2022-01-26 19:07:45 UTC
List:
ruby-core #107294
Issue #18408 has been updated by Dan0042 (Daniel DeLorme).
Eregon (Benoit Daloze) wrote in #note-17:
> In practice it should rarely matter because if a clause isn't matched the code should obviously not look at variables not set by that clause.
I'm not sure I agree with that. When I have `if condition; x=42; end` I expect `x` to be nil if the branch was not taken. Not some undefined semi-random value. And sometimes I depend on that behavior in my code. I understand pattern matching doesn't work that way, and I understand why and how pattern matching works the way it does, but only because I read this thread. Otherwise I would assume the variable is only set when the pattern matches successfully.
So I had expected this to work and was fairly surprised that it doesn't:
```ruby
case [1,2,3,4]
in [*,a,1,*]
puts "before one: #{a}"
in [*,b,2,*]
puts "before two: #{b}"
in [*,c,3,*]
puts "before three: #{c}"
else
puts "no match"
end
#I expected a==nil since the first pattern didn't match, but instead it's a==3
if !a
puts "nothing before one"
end
```
I don't know if the current behavior fits Matz' POLS, but it doesn't fit mine. (Not saying it necessarily should, but it's at least a data point for one person who finds this behavior surprising).
----------------------------------------
Feature #18408: Allow pattern match to set instance variables
https://bugs.ruby-lang.org/issues/18408#change-96191
* Author: Dan0042 (Daniel DeLorme)
* Status: Assigned
* Priority: Normal
* Assignee: ktsj (Kazuki Tsujimoto)
----------------------------------------
I expected this to work:
```ruby
42 => @v
```
But instead it raises "syntax error, unexpected instance variable"
Is this intentional?
--
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>