3 ms·
What language features does Ruby have that Objective-C lacks? It's a bit more succinct, perhaps, but when you're calling out to Cocoa all the time, that succinc
by 286c8cb04bda 14y ago
What language features does Ruby have that Objective-C lacks? It's a bit more succinct, perhaps, but when you're calling out to Cocoa all the time, that succinctness is going to get thrown out the window.
- jballanc 14y agoRuby has "yield" which, while possible to replicate in Obj-C, it's not nearly as nice. Also, Ruby can yield arguments, and the block being yielded to is free to ignore those arguments. That's the sort of flexibility that can make Ruby so much more enjoyable to work with in high-level code.
- 286c8cb04bda 14y agoThat's a great example, thanks! I did some looking, and I found a few[1] examples[2] of coroutines in Objective-C, though none of them seemed fully fleshed-out. Even if they were, none were, as you say, nearly as nice as "yield". [1]: http://cocoadev.com/wiki/CSCoroutineTest http://cocoadev.com/wiki/CSCoroutineTest [2]: https://gist.github.com/1033477 https://gist.github.com/1033477
- deleted 14y ago[deleted]