General

Profile

RichOrElse (Ritchie Buitre)

  • Login: RichOrElse
  • Registered on: 04/28/2017
  • Last sign in: 06/10/2024

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 2 0 2

Activity

03/02/2021

05:48 PM Ruby Feature #17663: Enumerator#with, an alternative to Enumerator#with_object
Hanmac (Hans Mackowiak) wrote in #note-4:
> i had a similar problem when i wanted to make Symbol to_proc use parameters, i would have done something like `:to_s.(16)`
Thanks, the implementation of format proc could be anything other tha...
RichOrElse (Ritchie Buitre)
02:00 PM Ruby Feature #16113: Partial application
I like the idea. I made a [similar proposal](https://bugs.ruby-lang.org/issues/15302), but admittedly it wasn't as intuitive as I have hoped.
So with my [new proposal](https://bugs.ruby-lang.org/issues/17663), the code looks like this.
...
RichOrElse (Ritchie Buitre)

02/27/2021

05:23 PM Ruby Feature #17663 (Open): Enumerator#with, an alternative to Enumerator#with_object
**Enumerator#with** yields each element along with the arguments
``` ruby
class Enumerator
def with(*options)
return to_enum(:with, *options) unless defined? yield
each do |entry|
yield entry, *options
end
...
RichOrElse (Ritchie Buitre)

11/23/2018

10:16 AM Ruby Feature #15302: Proc#with and Proc#by, for partial function application and currying
matz (Yukihiro Matsumoto) wrote:
> I wonder those words do not cause confusion which works which way? At least I was confused.
I agree with your assessment Matz. Both 'with' and 'by' are such flexible words, they're the first words t...
RichOrElse (Ritchie Buitre)

11/18/2018

05:12 AM Ruby Misc #15229: DevelopersMeeting20181122Japan
* [Feature #15302] Proc#with and Proc#by, for partial function application and currying (Ritchie Buitre)
* Convenient methods for functional programming.
RichOrElse (Ritchie Buitre)

11/17/2018

04:54 PM Ruby Feature #15302: Proc#with and Proc#by, for partial function application and currying
shevegen (Robert A. Heiler) wrote:
> I am not sure if the API seems ok. I am also not sure if matz
> ...
Thank you for taking the time to review my proposal and for the suggestions.
To illustrate more clearly how **`Symbol#with`** wor...
RichOrElse (Ritchie Buitre)

11/16/2018

09:49 AM Ruby Feature #12115: Add Symbol#call to allow to_proc shorthand with arguments
I have a related proposal #15302 with a different implementation and interface. RichOrElse (Ritchie Buitre)

11/14/2018

06:56 AM Ruby Feature #15302 (Open): Proc#with and Proc#by, for partial function application and currying
**Proc#by** allows currying implicitly
~~~ ruby
class Proc
def by(*head)
return self if head.none?
curry(head.size.next).(*head)
end
end
class Method
def by(*head)
to_proc.by(*head)
end
end
class Sym...
RichOrElse (Ritchie Buitre)

09/02/2018

02:35 PM Ruby Feature #14594: Rethink yield_self's name
I suggest aliasing `#yield_self` with **#to_be**. The `to_` prefix suggest returning a value while [the word "be"](https://gist.github.com/RichOrElse/452e5f9f35f16c3fb6ef6d3ab41a173c) connotes both identity (`#itself`) and it's new condi... RichOrElse (Ritchie Buitre)

04/28/2017

07:47 PM Ruby Feature #6284: Add composition for procs
matz (Yukihiro Matsumoto) wrote:
> I want to make sure if everyone agrees with "*" instead of OP's "<<".
> ...
+1 for #*
Initially I thought of the F# convention #<< and it's counter part #>> as intuitive. But after giving it some t...
RichOrElse (Ritchie Buitre)

Also available in: Atom