<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/pp.rb, branch v2_7_8</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Fix pp when passed a empty ruby2_keywords-flagged hash as array element (#2966)</title>
<updated>2020-03-31T07:10:57+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2020-03-31T07:10:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=bb93659fefd7f4557129043742771a33bd30c255'/>
<id>bb93659fefd7f4557129043742771a33bd30c255</id>
<content type='text'>
This causes problems because the hash is passed to a block not
accepting keywords.  Because the hash is empty and keyword flagged,
it is removed before calling the block.  This doesn't cause an
ArgumentError because it is a block and not a lambda.  Just like
any other block not passed required arguments, arguments not
passed are set to nil.

Issues like this are a strong reason not to have ruby2_keywords
by default.

Fixes [Bug #16519]

This backports 28d31ead34baff1c4abc0d7d902ef4bc1d576fb2 and
0ea759eac9234afc47e8fb1bcacfe9ee12c8ffb6, but needed to be modified
for 2.7 as 2.7 will perform empty keyword to positional hash
conversion for required arguments, which will happen if "v" in the
seplist method is empty when yielded.

Co-authored-by: NARUSE, Yui &lt;nurse@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This causes problems because the hash is passed to a block not
accepting keywords.  Because the hash is empty and keyword flagged,
it is removed before calling the block.  This doesn't cause an
ArgumentError because it is a block and not a lambda.  Just like
any other block not passed required arguments, arguments not
passed are set to nil.

Issues like this are a strong reason not to have ruby2_keywords
by default.

Fixes [Bug #16519]

This backports 28d31ead34baff1c4abc0d7d902ef4bc1d576fb2 and
0ea759eac9234afc47e8fb1bcacfe9ee12c8ffb6, but needed to be modified
for 2.7 as 2.7 will perform empty keyword to positional hash
conversion for required arguments, which will happen if "v" in the
seplist method is empty when yielded.

Co-authored-by: NARUSE, Yui &lt;nurse@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Make prettyprint’s cycle detection aware of Delegator instances</title>
<updated>2019-12-16T14:43:49+00:00</updated>
<author>
<name>Richard Viney</name>
<email>richard.viney@gmail.com</email>
</author>
<published>2017-01-22T01:50:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6a75a460536a32fb62184dc5d8d66ddd737a9bad'/>
<id>6a75a460536a32fb62184dc5d8d66ddd737a9bad</id>
<content type='text'>
Fixes [Bug #13144]

Co-Authored-By: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes [Bug #13144]

Co-Authored-By: Nobuyoshi Nakada &lt;nobu@ruby-lang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Deprecate taint/trust and related methods, and make the methods no-ops</title>
<updated>2019-11-17T23:00:25+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-09-25T03:59:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ffd0820ab317542f8780aac475da590a4bdbc7a8'/>
<id>ffd0820ab317542f8780aac475da590a4bdbc7a8</id>
<content type='text'>
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
</pre>
</div>
</content>
</entry>
<entry>
<title>Use ident hash for top-level recursion check</title>
<updated>2019-11-04T23:27:15+00:00</updated>
<author>
<name>John Hawthorn</name>
<email>john@hawthorn.email</email>
</author>
<published>2019-11-04T04:51:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ebbe396d3c89345a1c36c0b5154e314cc33e19b7'/>
<id>ebbe396d3c89345a1c36c0b5154e314cc33e19b7</id>
<content type='text'>
We track recursion in order to not infinite loop in ==, inspect, and
similar methods by keeping a thread-local 1 or 2 level hash. This allows
us to track when we have seen the same object (ex. using inspect) or
same pair of objects (ex. using ==) in this stack before and to treat
that differently.

Previously both levels of this Hash used the object's memory_id as a key
(using object_id would be slow and wasteful). Unfortunately, prettyprint
(pp.rb) uses this thread local variable to "pretend" to be inspect and
inherit its same recursion behaviour.

This commit changes the top-level hash to be an identity hash and to use
objects as keys instead of their object_ids.

I'd like to have also converted the 2nd level hash to an ident hash, but
it would have prevented an optimization which avoids allocating a 2nd
level hash for only a single element, which we want to keep because it's
by far the most common case.

So the new format of this hash is:

{ object =&gt; true } (not paired)
{ lhs_object =&gt; rhs_object_memory_id } (paired, single object)
{ lhs_object =&gt; { rhs_object_memory_id =&gt; true, ... } } (paired, many objects)

We must also update pp.rb to match this (using identity hashes).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We track recursion in order to not infinite loop in ==, inspect, and
similar methods by keeping a thread-local 1 or 2 level hash. This allows
us to track when we have seen the same object (ex. using inspect) or
same pair of objects (ex. using ==) in this stack before and to treat
that differently.

Previously both levels of this Hash used the object's memory_id as a key
(using object_id would be slow and wasteful). Unfortunately, prettyprint
(pp.rb) uses this thread local variable to "pretend" to be inspect and
inherit its same recursion behaviour.

This commit changes the top-level hash to be an identity hash and to use
objects as keys instead of their object_ids.

I'd like to have also converted the 2nd level hash to an ident hash, but
it would have prevented an optimization which avoids allocating a 2nd
level hash for only a single element, which we want to keep because it's
by far the most common case.

So the new format of this hash is:

{ object =&gt; true } (not paired)
{ lhs_object =&gt; rhs_object_memory_id } (paired, single object)
{ lhs_object =&gt; { rhs_object_memory_id =&gt; true, ... } } (paired, many objects)

We must also update pp.rb to match this (using identity hashes).
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/pp.rb: Use UnboundMethod#bind_call instead of .bind(obj).call(...)</title>
<updated>2019-08-30T02:13:00+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2019-08-30T02:11:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c9fc82983ccf624ccec88ffafe6f4e3eb8e7abc4'/>
<id>c9fc82983ccf624ccec88ffafe6f4e3eb8e7abc4</id>
<content type='text'>
Related to [Feature #15955].
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Related to [Feature #15955].
</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce pattern matching [EXPERIMENTAL]</title>
<updated>2019-04-17T06:48:03+00:00</updated>
<author>
<name>ktsj</name>
<email>ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2019-04-17T06:48:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9738f96fcfe50b2a605e350bdd40bd7a85665f54'/>
<id>9738f96fcfe50b2a605e350bdd40bd7a85665f54</id>
<content type='text'>
[ruby-core:87945] [Feature #14912]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ruby-core:87945] [Feature #14912]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/pp.rb (Range#pretty_print): support endless range</title>
<updated>2018-12-03T01:39:45+00:00</updated>
<author>
<name>mame</name>
<email>mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-12-03T01:39:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2c840bbfef2d6a06282f3698548f95ef85819ca7'/>
<id>2c840bbfef2d6a06282f3698548f95ef85819ca7</id>
<content type='text'>
`pp(1..)` should print `"(1..)"` instead of `"(1..nil)"`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`pp(1..)` should print `"(1..)"` instead of `"(1..nil)"`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>Refine RubyVM::AbstractSyntaxTree::Node#type</title>
<updated>2018-12-03T01:06:34+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-12-03T01:06:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=afa685398e6c098a55bb2d0565e8f1bd380e4ab9'/>
<id>afa685398e6c098a55bb2d0565e8f1bd380e4ab9</id>
<content type='text'>
* ast.c (rb_ast_node_type): simplified to return a Symbol without
  "NODE_" prefix.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ast.c (rb_ast_node_type): simplified to return a Symbol without
  "NODE_" prefix.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>Add RubyVM::AST#pretty_print</title>
<updated>2018-12-03T00:24:38+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-12-03T00:24:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=87e1dd2982dd472de557f62468d77211c8a71bff'/>
<id>87e1dd2982dd472de557f62468d77211c8a71bff</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>Requiring pp is not required now [ci skip]</title>
<updated>2017-12-18T01:51:53+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-12-18T01:51:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a531c579f85d06868432c02495ec23098fe4da5b'/>
<id>a531c579f85d06868432c02495ec23098fe4da5b</id>
<content type='text'>
- Followup of https://bugs.ruby-lang.org/issues/14123

From: Prathamesh Sonpatki &lt;csonpatki@gmail.com&gt;

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Followup of https://bugs.ruby-lang.org/issues/14123

From: Prathamesh Sonpatki &lt;csonpatki@gmail.com&gt;

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
