[ruby-dev:50821] [Ruby master Bug#14240] warn four special variables: $; $, $/ $\
From:
nobu@...
Date:
2019-07-27 01:54:21 UTC
List:
ruby-dev #50821
Issue #14240 has been updated by nobu (Nobuyoshi Nakada).
It does not match to test `rb_warn` with `assert_warning`.
Should be `rb_warn`+`assert_warn` or `rb_warning`+`assert_warning`.
And non-default `$;` and `$,` are warned now.
Do you think these **names** should be warned too?
----------------------------------------
Bug #14240: warn four special variables: $; $, $/ $\
https://bugs.ruby-lang.org/issues/14240#change-80127
* Author: akr (Akira Tanaka)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v:
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
I think the four special variables for separators should be deprecated.
```
$/ input record separator (default argument for "gets")
$\ output record separator ("print" prints it at last)
$, default separator for Array#join and print
$; default separator for String#split
```
I feel many program doesn't work if they are set to non-default value.
Since they are global, not thread local,
we can not change these variables safely in a multi threaded program.
So, I think we should warn them (and delete them in future).
---Files--------------------------------
warn-5-gvars.patch (2.31 KB)
--
https://bugs.ruby-lang.org/