General

Profile

americodls (Americo Duarte)

  • Login: americodls
  • Registered on: 02/18/2017
  • Last sign in: 07/20/2020

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 3 3

Activity

07/10/2020

02:37 AM Ruby Feature #17022 (Third Party's Issue): Addition of method Kernel#Date
What if we have a method `Kernel#Date` that delegates to `Date.parse`? Dates could be written in a more natural way, right?
```ruby
Date("2020-01-13") - Date("2019-01-13")
```
Capitalized methods are defined on the `Kernel` modul...
americodls (Americo Duarte)

04/05/2018

05:12 PM Ruby Feature #14594: Rethink yield_self's name
My two cents:
This method acts like a **pipe operator**, it passes itself **through** the block and returns whatever the block returns.
The block execution maybe will change the value itself, maybe not. But `yield_self` proposes **ch...
americodls (Americo Duarte)

10/19/2017

01:46 AM Ruby Feature #13581: Syntax sugar for method reference
matz (Yukihiro Matsumoto) wrote:
> I am for adding syntax sugar for method reference. But I don't like proposed syntax (e.g. `->`).
> ...
What do you think about: `Kernel:puts`, `Kernel~>puts`, `Kernel:>puts` ?
americodls (Americo Duarte)

05/24/2017

01:06 AM Ruby Bug #13592: Enumerable#reduce with symbol does not respect method visibility
This is exactly what I am saying.
This behavior of `reduce` is unpredictable and different of the another `Enumerable` methods.
Users will expect that symbol argument is converted in proc and then applied to object.
`reduce` (si...
americodls (Americo Duarte)

05/23/2017

04:08 PM Ruby Bug #13592 (Open): Enumerable#reduce with symbol does not respect method visibility
americodls (Americo Duarte)
03:53 PM Ruby Bug #13592 (Feedback): Enumerable#reduce with symbol does not respect method visibility
Please, reconsider. Look this example:
~~~
irb(main):092:0> :puts.to_proc.call("")
NoMethodError: private method `puts' called for "":String
~~~
nobu (Nobuyoshi Nakada) wrote:
> The proc returned by `Symbol#to_proc` is equiva...
americodls (Americo Duarte)
02:43 PM Ruby Bug #13592: Enumerable#reduce with symbol does not respect method visibility
Sorry, ignore the IRB thing. But my question about the reduce still valid.
americodls (Americo Duarte)
02:37 PM Ruby Bug #13592 (Closed): Enumerable#reduce with symbol does not respect method visibility
When use reduce with symbol, I expect the symbol is called in object but respecting the method visibility.
Example with source code written in a file.
~~~ruby
Fixnum.instance_eval do
private :+
end
p [1,2,3].reduce(:+)
~~~...
americodls (Americo Duarte)

05/20/2017

12:27 AM Ruby Feature #13581: Syntax sugar for method reference
Why the version with symbol (`Math->:sqrt`) needs to be supported?
americodls (Americo Duarte)

05/19/2017

02:16 PM Ruby Feature #13581: Syntax sugar for method reference
The **`->`** was just a suggestion... Could be another symbol or combination of symbols like **`Math->>sqrt`**, **`Math=>>sqrt`**, **`Math+>sqrt`**, **`Math$>sqrt`**, **`Math:>sqrt`**, etc
I just think could have another way to write it...
americodls (Americo Duarte)

Also available in: Atom