[#94657] [Ruby master Feature#16131] Remove $SAFE, taint and trust — naruse@...
Issue #16131 has been reported by naruse (Yui NARUSE).
3 messages
2019/08/29
[ruby-core:94269] [Ruby master Feature#16095] 2 Features: remove (simplify) 'new' keyword and Property Shorthand
From:
FreeKMan@...
Date:
2019-08-11 07:32:00 UTC
List:
ruby-core #94269
Issue #16095 has been updated by D1mon (Dim F).
I correctly understood that this function will be added in version 2.7? https://github.com/ruby/ruby/pull/2231/commits/7da3cdc9aa132307eff0e4376ad6a3819940fc2d
----------------------------------------
Feature #16095: 2 Features: remove (simplify) 'new' keyword and Property Shorthand
https://bugs.ruby-lang.org/issues/16095#change-80592
* Author: D1mon (Dim F)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
**common use:**
``` ruby
class A
def initialize(arg1, arg2)
@arg1 = arg1
@arg2 = arg2
end
end
A.new(1,2)
```
1) feature: remove 'new' keyword:
``` ruby
A(1,2) # shorter and more comfortable
```
2) feature: Property Shorthand (like ES6)
``` ruby
class A
def initialize(arg1, arg2)
# shorter and more comfortable
@arg1, @arg2
# or this:
@arg1
@arg2
end
end
```
So as not to duplicate the code (words). May need to do some other syntax or character (:arg1, \^arg1, %arg1, ...)
can also be applied to other types.
Hash example:
``` ruby
a = 1
b = 2
h = {a:a,b:b} # common use
h = {a,b} # new syntax or {%a,%b} - any syntax of your choice
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>