General

Profile

garysweaver (Gary Weaver)

Issues

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

Activity

01/25/2015

04:24 PM Ruby Feature #10782 (Assigned): Patch: Add constants for BigDecimal for ZERO, ONE, TEN
We found with use of BigDecimal that we were often needing to compare BigDecimal with zero or initialize BigDecimal as 0 for a default value. This introduces a bit move overhead than is typically needed, since a simple BigDecimal.new('0'... garysweaver (Gary Weaver)

11/18/2014

03:49 PM Ruby Feature #10523: Suggestion for new Array.delete_to method
Oops, in that last code example, I meant: a.delete_to(b). garysweaver (Gary Weaver)
03:44 PM Ruby Feature #10523 (Rejected): Suggestion for new Array.delete_to method
Array's delete and delete_at return the deleted item from an array, so it would seem as though Array should allow some sort of delete method that could take a block and would return the deleted items that matched as an array.
Currentl...
garysweaver (Gary Weaver)

11/28/2013

07:43 AM Ruby Bug #9114: InstructionSequence.compile w/tailcall_optimization: true, trace_instruction: false not working as expected
Eric,
My apologizes as I probably wasted your time with that. The problem with the code you posted is that for TCO you still have to specify trace_instruction: false. If you execute the following, it is fine in Ruby 2.0.0p247 at least, ...
garysweaver (Gary Weaver)

11/16/2013

02:55 AM Ruby Bug #9114: InstructionSequence.compile w/tailcall_optimization: true, trace_instruction: false not working as expected
btw- that method is incorrect, and when I wrote a better/working method, now it doesn't have that error in 2.0.0p247 but still fails with 1.9.3-p448. Not sure why:
method_string = <<RUBY
def recursively_sort(obj)
case obj
when Array...
garysweaver (Gary Weaver)
02:38 AM Ruby Bug #9114 (Rejected): InstructionSequence.compile w/tailcall_optimization: true, trace_instruction: false not working as expected
Code to reproduce is a recursive sort I wrote; I was trying to compile RubyVM::InstructionSequence with tailcall_optimization: true, trace_instruction: false, which has worked before, but not for this case.
method_string = <<RUBY
de...
garysweaver (Gary Weaver)

04/12/2013

04:11 AM Ruby Feature #8168: Feature request: support for (single) statement lambda syntax/definition
Oops except then they are symbols. Darn, too much to worry about... garysweaver (Gary Weaver)
04:11 AM Ruby Feature #8168: Feature request: support for (single) statement lambda syntax/definition
Thinking about it a bit more, I guess it would have to be context sensitive. Just some character that is parsed when the block is being parsed that indicates that the following statement is a block. So maybe the best that could be done w... garysweaver (Gary Weaver)
03:47 AM Ruby Feature #8168: Feature request: support for (single) statement lambda syntax/definition
@matz, You know best. :) !! I know that this request varies a bit when you consider that stab is a function call, but the goal is to de-uglify code that we are starting to have like:
some_method :some, :args, :here, -> {the block make...
garysweaver (Gary Weaver)

03/27/2013

03:34 AM Ruby Feature #8168: Feature request: support for (single) statement lambda syntax/definition
So, redefining the proposal somewhat, '-> an_expression' or '->> an_expression' would be a shortcut for '-> {an_expression}'. garysweaver (Gary Weaver)

Also available in: Atom