Issue #14043 has been updated by shevegen (Robert A. Heiler).


I don't want to write too much, but I would suggest more patience from
you, Ana. In particular towards any path forward to the x-mas release,
I assume that bug fixes may have a higher priority than feature 
changes/additions. Also note that it is even less likely that anything
can be too easily "removed" in the ruby 2.x branch due to backwards
compatibility.

To the $ variables, while I also said that I have a difficulty 
memorizing them, it is not true that they have no use case. For 
example, they are short, which is not a bad thing per se necessarily
in ALL situations. To give another example ...

For example:

    var =~ /(ab.+)de.+/
    $1.to_s.dup

is easy to use for me compared to the variant with MatchData[1]. I always
start like typing =~ and sometimes I write the regex to use in a constant,
and then refer to it such as:

    var =~ REGEX_FOR_DISCOVERING_REMOTE_PROGRAMS

Like via open-uri and then finding some matches to remote URLs from a 
webpage.

The proposal here and the suggestion is to use a method called
Process.last_status which I think is a perfectly fine proposal. Nowhere
does the issue request speak about removing $ variables so I am
confused about comments such as "Let's remove them".

The scope here is simply to add a method as alternative means to 
access $?, which I think is a perfectly fine proposal in itself.

The rest is up to the ruby core team and matz.

----------------------------------------
Feature #14043: Introduce Process.last_status as an alias for $?
https://bugs.ruby-lang.org/issues/14043#change-67849

* Author: mrkn (Kenta Murata)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 2.5
----------------------------------------
I found that we don't have any methods for an alias to `$?`, like `MatchData.last_match` for `$~`.

I propose to introduce `Process.last_status` method for that purpose.




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