[#7872] Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...>

All, I needed a nonblocking socket connect for my asynchronous-event

18 messages 2006/05/14
[#7873] Re: Nonblocking socket-connect — Tanaka Akira <akr@...17n.org> 2006/05/14

In article <3a94cf510605140559l7baa0205le341dac4f47d424b@mail.gmail.com>,

[#7874] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

How about introducing the method Socket#set_nonblocking, or alternatively

[#7875] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

[#7876] Re: Nonblocking socket-connect — "Francis Cianfrocca" <garbagecat10@...> 2006/05/15

Well, it's ok then. I'm comfortable adding in the nonblocking

[#7877] Re: Nonblocking socket-connect — Yukihiro Matsumoto <matz@...> 2006/05/15

Hi,

Re: [ ruby-Bugs-4457 ] Strange interactions between Struct and 'pp'

From: Florian Gro<florgro@...>
Date: 2006-05-13 19:51:09 UTC
List: ruby-core #7871
Eric Hodel wrote:

>> The reason is that the pp-library uses the members method of the 
>> created structure to enumerate the members. The problem is easy to fix 
>> by using the members method on the class instead. The documentation 
>> for Struct suggest that you should use members in the said way 
>> however, and it's not clear (to me) that Struct.new(:members) 
>> overrides this.
> class Struct
>    def pretty_print(q)
>      q.group(1, '#<struct ' + self.class.name, '>') {
> -      q.seplist(self.members, lambda { q.text "," }) {|member|
> +      q.seplist(self.class.members, lambda { q.text "," }) {|member|

irb(main):001:0> Struct.new(:class).new.class
=> nil

The right way to fix it is by using 
Object.instance_method(:class).bind(self).call.members IMHO.

But it's probably quite a rare case anyway... :)

-- 
http://flgr.0x42.net/


In This Thread