On Jan 20, 2010, at 7:04 AM, Ernest N. Prabhakar, Ph.D. wrote:

> I actually thought about adding a "file" method on Dispatch::Source that (in 
> cases where you passed in an IO object instead of an file descriptor), would 
> return that object.  Of course it would return nothing in other cases, but 
> maybe that's OK.  Still not sure what to call it -- any suggestions?

Well, frankly, I expected the handle method to return the original handle - 
that's sort of what the principle of least astonishment would suggest, no?  I 
could see file as a method which returns the underlying fd, assuming you needed 
that for some reason, though you should also be able to extract that from 
handle if it's an IO Object, no?  I'm trying to figure out why you would want 
anything but the original handle...

> Alternatively, we could only add that method to a subclass of Source, so it 
> only existed when valid.  If we did that, we should probably do the same for 
> the "merge" method on custom sources - but having a subclass with only a 
> single method seems lame.  Maybe implement it in the superclass, but raise an 
> exception if called for an invalid type?

See above - do we really need to go through all that indirection?

- Jordan

_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to