General

Profile

candlerb (Brian Candler)

  • Login: candlerb
  • Email: b.candler@pobox.com
  • Registered on: 07/02/2008
  • Last sign in: 11/23/2011

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 16 16

Activity

05/04/2011

06:11 PM Ruby Feature #4645 (Feedback): Pass existing buffer to getsockopt
There are cases when you need to pass a pre-initialized buffer to
getsockopt, but ruby currently doesn't support this.
For an example, see the API used by iptables to manipulate the firewall
rulesets (below). You have to set the tab...
candlerb (Brian Candler)

08/19/2010

06:07 PM Ruby Bug #3718 (Closed): [doc] ri doesn't document Object#<=>
=begin
1.9.2 apparently implements Object#<=> (or Kernel#<=> ?)

$ irb192 --simple-prompt
>> Object.new <=> Object.new
=> nil

But ri doesn't seem to know about it:

$ ri192 '<=>'
Nothing known about <=>
$ ri192 'Obj...
candlerb (Brian Candler)

01/02/2010

05:54 AM Ruby Bug #2545 (Closed): Array#delete_if is borked if user calls 'break'
=begin
Array is corrupted if you break out of a delete_if { ... } loop. I would expect that the elements already marked as deleted would be deleted, and the remainder of the array would be unchanged.

>> a = [5,6,7,8,9,10]
=> [5,...
candlerb (Brian Candler)

11/14/2009

05:01 AM Ruby Feature #707: Documentation for Enumerator chaining
=begin
> Is this also possible in 1.8?

Sure. Block-form Enumerator is surprisingly straightforward to implement, see
http://github.com/trans/facets/blob/master/lib/more/facets/enumerator.rb

But since 1.9 has it already, I th...
candlerb (Brian Candler)

08/11/2009

11:00 PM Ruby Bug #1926 (Rejected): Different eval/binding behaviour in 1.9
=begin
In 1.8.6, you can set a local variable in a binding using eval. This doesn't seem to work in 1.9.2-preview1.

def define_a(b)
eval "a=1", b
end

define_a(binding)
puts local_variables.inspect
# 1.8: ...
candlerb (Brian Candler)

08/06/2009

11:23 PM Ruby Feature #1900 (Closed): Suggestion: Encoding#ascii_compatible?
=begin
An important property of an Encoding is whether it is ASCII-compatible. However as far as I can see, you can only test for this indirectly, e.g.

Encoding.compatible?("a".force_encoding("ISO-8859-1"), "a".force_encoding("US...
candlerb (Brian Candler)

08/01/2009

05:50 PM Ruby Bug #1853: Cannot make constants using upper-case extended characters?
=begin
Thank you for the link. (I'm in the process of documenting some of this).

We may be at cross-purposes over terminology, but when you say "to change this behaviour would be to make the semantics of the program locale dependent"...
candlerb (Brian Candler)
05:00 PM Ruby Bug #1853 (Rejected): Cannot make constants using upper-case extended characters?
=begin
>> SCHÖN = 1 # constant
=> 1
>> ÜBER = 2 # local variable!
=> 2
>> self.class.constants.grep(/SCH|BER/)
=> [:SCHÖN]
>> local_variables.grep(/SCH|BER/)
=> [:ÜBER]

I am not sure from the source code whether ...
candlerb (Brian Candler)

07/31/2009

02:22 AM Ruby Bug #1843 (Closed): Symbol#inspect raises exception
=begin
If you can create an object, I think you should always be able to inspect it.

However Symbol#inspect raises an exception if it was made from a string with an invalid encoding.

>> "hello\xff".to_sym.inspect
ArgumentErr...
candlerb (Brian Candler)

07/30/2009

07:59 PM Ruby Bug #1836: Can change encoding on frozen String
=begin
Well, force_encoding raises an exception even if you specify the same one it already has:

>> s = "abcd"
=> "abcd"
>> s.freeze.force_encoding(s.encoding)
RuntimeError: can't modify frozen string

So your new behavio...
candlerb (Brian Candler)

Also available in: Atom