General

Profile

citizen428 (Michael Kohl)

Issues

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

Activity

07/18/2020

12:59 AM Ruby Bug #17034: Unexpected behavior in #max for beginless range
jeremyevans0 (Jeremy Evans) wrote in #note-2:
> I think a `RangeError` is more correct. Without having a beginning, you cannot know the increment value, and therefore cannot know the maximum value. People that want the end of the rang...
citizen428 (Michael Kohl)

07/17/2020

04:26 PM Ruby Bug #17034: Unexpected behavior in #max for beginless range
citizen428 (Michael Kohl) wrote:
> I think this is not ideal. Possible solutions:
> ...
I had some time and looked into this. For inclusive integer ranges `r.end` will now be returned, no other behavior changes. Patch attached, but sin...
citizen428 (Michael Kohl)
04:00 AM Ruby Bug #17034 (Closed): Unexpected behavior in #max for beginless range
When calling `max` on a beginless range, a non-intuitive error gets raised:
``` ruby
r = ..9
r.max
# ArgumentError: comparison of NilClass with 9 failed
```
There's a check for `NIL_P(RANGE_BEG(range))` but it's inside another ...
citizen428 (Michael Kohl)

08/02/2014

08:59 AM Ruby Feature #6817: Partial application
Koichi Sasada wrote:
> Basically, I like this proposal.
> ...
In that case, how about making `Symbol#to_proc` accept additional arguments?
~~~ruby
(1..3).map(:+, 2)
~~~
The syntax would be very straightforward, but it doesn't...
citizen428 (Michael Kohl)

05/06/2014

11:22 AM Ruby Feature #9807 (Open): String.new with block
After a discussion in our team chat today, I wondered if it would be a good idea to have a version of String.new that accepts a block and works as a string builder. Something like
string = String.new("foo") do |s|
s << "bar...
citizen428 (Michael Kohl)

08/13/2012

06:52 AM Ruby Feature #6847: Hash#extract
claytrump (Clay Trump) wrote:
> There is no "extract!" in ActiveSupport, its "slice!" you mean.
http://apidock.com/rails/Hash/extract%21
# File activesupport/lib/active_support/core_ext/hash/slice.rb, line 35
def extract!(*key...
citizen428 (Michael Kohl)

08/11/2012

06:42 PM Ruby Feature #6847: Hash#extract
claytrump (Clay Trump) wrote:
> Isn't that like the method slice in ActiveSupport?
It's definitely like extract! in ActiveSupport, just non-destructive. I still think this is useful enough to be in core though. I needed it repeatedly...
citizen428 (Michael Kohl)

08/10/2012

02:01 AM Ruby Feature #6847 (Rejected): Hash#extract
I often need a method to extract "subhashes" from hashes. I often monkey-patched this into hash and found "extract" to be a good name for the method. Afterwards I found out that there actually is a mutating method called "extract!" in Ac... citizen428 (Michael Kohl)

08/07/2012

02:47 AM Ruby Feature #6373: public #self
i also found a previous issue where this behavior would come in handy: http://bugs.ruby-lang.org/issues/2172 citizen428 (Michael Kohl)

07/31/2012

03:38 PM Ruby Feature #6817 (Assigned): Partial application
I know that what I propose here is a significant change to Ruby, but it's part of my ongoing quest to get some more functional programming features into Ruby (see also #4539 and #6373).
I was wondering if it would make sense to maybe...
citizen428 (Michael Kohl)

Also available in: Atom