[#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:97953] [Ruby master Feature#16799] Add more functional features, make ruby more friendly.
From:
fyjzyyx@...
Date:
2020-04-18 17:36:15 UTC
List:
ruby-core #97953
Issue #16799 has been reported by jackmaple (maple jack).
----------------------------------------
Feature #16799: Add more functional features,make ruby more friendly.
https://bugs.ruby-lang.org/issues/16799
* Author: jackmaple (maple jack)
* Status: Open
* Priority: Normal
----------------------------------------
Classes are currently first-class citizens in Ruby, but functions are not.
This leads to a situation where the function calls are not uniform, for example:
``` ruby
def boo(x)
return x
end
boo2 = -> x { x }
a = boo 10
b = boo2.call(10)
or
b = boo2.(10)
or
b = boo2[10]
```
This is very confusing to people from other languages (JavaScript, Python, etc.), or people who are just starting to learn ruby.
If the method calling format can be unified, and the method is also a first-class citizen, then a higher-order function can be realized, and the method name is just a variable,so maybe more things can be done,and it might be better if the lambda is changed to the following form,for example(suppose):
``` ruby
method1 = (f,n) -> f(n)
or
method1 = (f,n) -> {
return f(n)
}
or
method1 = (f,n) -> do
return f(n)
end
#call method
method1(x -> {x * 2},2)
```
Although the syntax change is not good, it makes ruby easier to use.
These are just some of my thoughts, thanks.
--
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>