[#927] UnboundMethod#to_proc — Dave Thomas <dave@...>
I'm wondering what I can do with a Proc generated by
17 messages
2003/04/06
[#929] Re: UnboundMethod#to_proc
— "Chris Pine" <nemo@...>
2003/04/06
----- Original Message -----
[#934] Re: UnboundMethod#to_proc
— Mathieu Bouchard <matju@...>
2003/04/06
[#940] Re: UnboundMethod#to_proc
— chr_news@...
2003/04/07
>
[#941] Re: UnboundMethod#to_proc
— Dave Thomas <dave@...>
2003/04/07
>> If they have diverging interfaces such that the contracts conflict
[#936] docs on implementation of ruby and/or ruby-gc ? — Ruben Vandeginste <Ruben.Vandeginste@...>
4 messages
2003/04/07
[#964] Range in logical context — Dave Thomas <dave@...>
If I run
7 messages
2003/04/16
[#965] Re: Range in logical context
— Mauricio Fern疣dez <batsman.geo@...>
2003/04/16
On Thu, Apr 17, 2003 at 06:10:40AM +0900, Dave Thomas wrote:
[#973] problem with rb_rescue2() ? — Mathieu Bouchard <matju@...>
5 messages
2003/04/19
Possible big in ipaddr.rb
From:
Dave Thomas <dave@...>
Date:
2003-04-23 05:58:00 UTC
List:
ruby-core #980
The method #include? in IPAddr looks like:
def include?(other)
if ipv4_mapped?
...
end
if other.kind_of?(IPAddr)
if other.ipv4_mapped?
other_addr = (other.to_i & IN4MASK)
other_family = Socket::AF_INET
else
other_addr = other.to_i
other_family = other.family
end
if family != other_family
return false
end
end
return ((addr & mask_addr) == (other_addr & mask_addr))
end
This seems wrong - shouldn't the second half of the method be something
like:
if other.kind_of?(IPAddr)
if other.ipv4_mapped?
other_addr = (other.to_i & IN4MASK)
other_family = Socket::AF_INET
else
other_addr = other.to_i
other_family = other.family
end
else # not an IP - assume integer IP address, same family as us
other_addr = other.to_i
other_family = family
end
if family != other_family
return false
end
return ((addr & mask_addr) == (other_addr & mask_addr))
Otherwise if you pass in an integer IP address it can never match (as
other_addr and other_family never get set). I'd submit a patch, but I'm
not that sure of myself when it comes to IP.
Cheers
Dave