[#82311] [Ruby trunk Bug#13794] Infinite loop of sched_yield — charlie@...
Issue #13794 has been reported by catphish (Charlie Smurthwaite).
4 messages
2017/08/09
[#82518] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — mame@...
Issue #13618 has been updated by mame (Yusuke Endoh).
5 messages
2017/08/30
[#82552] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2017/08/31
mame@ruby-lang.org wrote:
[#82756] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wrong <normalperson@...>
2017/09/12
Eric Wrong <normalperson@yhbt.net> wrote:
[ruby-core:82382] [Ruby trunk Bug#13815][Rejected] p changes scope of *vars
From:
merch-redmine@...
Date:
2017-08-14 19:11:49 UTC
List:
ruby-core #82382
Issue #13815 has been updated by jeremyevans0 (Jeremy Evans).
Status changed from Open to Rejected
opti (Andreas Opti) wrote:
> x=y=0 # outside defined vars!
> 3.times { x,y = x+1,y+1 } # as expected: x==3
> 3.times { p(x,y = x+1,y+1) } # NOT as expected: x not changed!
> # x,y are the same vars as above. p shoudn't have any effect on scope
This makes sense once you understand how ruby parses the p method call:
~~~ ruby
3.times { p((x),(y = x+1),(y+1)) }
~~~
If you want the same behavior, you need to use parentheses:
~~~ ruby
3.times { p((x,y = x+1,y+1)) }
~~~
----------------------------------------
Bug #13815: p changes scope of *vars
https://bugs.ruby-lang.org/issues/13815#change-66178
* Author: opti (Andreas Opti)
* Status: Rejected
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.4 and 2.5
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
x=y=0 # outside defined vars!
3.times {|i| x,y=x+1,y+1 } # as expected: x==3
3.times {|i| p(x,y=x+1,y+1) } # NOT as expected: x not changed!
# x,y are the same vars as above. p shoudn't have any effect on scope
--
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>