[#97678] [Ruby master Feature#16752] :private param for const_set — bughitgithub@...
Issue #16752 has been reported by bughit (bug hit).
5 messages
2020/04/02
[ruby-core:97973] [Ruby master Feature#16791] Shortcut for Process::Status.exitstatus
Issue #16791 has been updated by Dan0042 (Daniel DeLorme).
Those short aliases are definitely a bad idea but I understand the OP's frustration with `$?` because it's different from the shell's `$?`. Process::Status has several methods that I'm sure can be useful in various circumstances, but the only one I've ever needed was `exitstatus`. It's a bit irritating when you have to write the verbose `$?.exitstatus` (get the exit status of the exit status?) instead of the shorter and more natural `$?`, especially for the common case of `exit $?`
----------------------------------------
Feature #16791: Shortcut for Process::Status.exitstatus
https://bugs.ruby-lang.org/issues/16791#change-85203
* Author: 0x81000000 (/ /)
* Status: Open
* Priority: Normal
----------------------------------------
[Updated]
```
s = `csc x.cs`.sub(/.*?\n\n/m, '')
puts s if s != ''; exit $?.exitstatus if $?.exitstatus > 0
system 'mono x.exe'; exit $?.exitstatus
```
```
class Process::Status
alias :es :exitstatus
end
```
```
s = `csc x.cs`.sub(/.*?\n\n/m, '')
puts s if s != ''; exit $?.es if $?.es > 0
system 'mono x.exe'; exit $?.es
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>