Issue #16647 has been updated by mehagar (Michael Hagar).


Eregon (Benoit Daloze) wrote in #note-1:
> Out of curiosity, why do you overwrite $/?
> 
> My personal opinion is we should deprecate all these variables affecting default separators,
> they tend to break any non-trivial program, not just IRB, and explicit seems always clearer.

I was following along an example from the book "The Well Grounded Rubyist, 3rd edition", that was illustrating how IO objects iterate.

----------------------------------------
Bug #16647: Redefining $/ causes irb to misbehave
https://bugs.ruby-lang.org/issues/16647#change-84387

* Author: mehagar (Michael Hagar)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
If I start irb and then do:

``` ruby
$/ = "asdf"
```


then every character I type shows a newline on the irb console. Previous versions of ruby do not have this behavior, and it is annoying.



-- 
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>