Issue #14043 has been updated by duerst (Martin Drst).


normalperson (Eric Wong) wrote:

>  It's actually easier for me coming from Bourne shell and Perl to use
>  short names.

For some people, yes. But my guess is that these days, most people coming to Ruby have no Perl and little if any shell experience.
 
>  We already have English.rb for the $CHILD_STATUS alias, and I'd
>  rather not force redundant bloat onto all users.

It's true that $? may be easier to write for some people, but `last_status` should be easy for everybody to read, even for people who see it for the first time.

The general direction in Ruby is to get rid, or at least provide replacements, for cryptic notations. I don't have a reference ready, but I seem to remember that getting rid of some Perl leftovers was one of the things being discussed for Ruby 3.0. Of course input on that direction is welcome. 

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

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