On Apr 25, 2006, at 5:02 PM, Asher Dunn wrote:


On Apr 25, 2006, at 4:56 PM, Theodore H. Smith wrote:

RB also has default parameters, something ObjC lacks. They are soooo handy. RB's also got namespaced constants (via modules/ classes).

[init] isn't equivalent to new.

[alloc] is equivalent to new.

Obviously you cannot pass parameters to alloc, but you said "Constructor arguments," and -init is equivalent to a constructor function.

I've never found setters confusing, maybe you have.

I don't, but some probably do. As I said, I am just playing devil's advocate. I don't necessarily believe the things I said.

"for each" is pretty cool also. ObjC has no "for each".



Yes, but "for each" is functionally equivalent to an ordinary for loop.

Not quite; this is approximately true for arrays. The "for each" construction is better viewed as an attempt to provide language support for iteration through the contents of an array. You could think of it as support for the Iterator pattern (for Rb arrays) just as events are the expression of the Template pattern in the language. Unless things have changed, 'for each' does not guarantee iteration using the array order; I consider this a shortcoming, as it is reasonable to expect that iteration over an ordered structure respect that order.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to