[#97086] [Ruby master Bug#16612] Enumerator::ArithmeticSequence#last with float range produces incorrect value — muraken@...
Issue #16612 has been updated by mrkn (Kenta Murata).
4 messages
2020/02/07
[#97307] [Ruby master Feature#16663] Add block or filtered forms of Kernel#caller to allow early bail-out — headius@...
Issue #16663 has been reported by headius (Charles Nutter).
29 messages
2020/02/28
[ruby-core:97129] [Ruby master Feature#15236] add support for hash shorthand
From:
jonathan@...
Date:
2020-02-12 01:14:51 UTC
List:
ruby-core #97129
Issue #15236 has been updated by joallard (Jonathan Allard).
I support this proposal in its simplest form. I do not think changing method argument syntax is a good idea.
@osyo above makes a good point, if your variables are well named:
```
User.new(id: id, age: age, name: name, registered_at: registered_at)
```
It is rewarding to have a shorter, clear syntax:
```
User.new({id, age, name, registered_at})
```
I do not see a reason to reject this. I would strongly encourage re-opening.
----------------------------------------
Feature #15236: add support for hash shorthand
https://bugs.ruby-lang.org/issues/15236#change-84233
* Author: ignatiusreza (Ignatius Reza Lesmana)
* Status: Rejected
* Priority: Normal
----------------------------------------
PR in github: https://github.com/ruby/ruby/pull/1990
inspired by javascript support for object literal shorthand notation `{ a }`, which will be expanded into `{ a: a }`..
to avoid ambiguity, this shorthand is only supported when hash is defined with `{ }` notation.. in other situation where the brackets is optional, e.g. function call, we still need to write it in full (`m(a : a)` instead of `m(a)`, or `m(a, b, c: c)` instead of `m(a, b, c)`..
--
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>