[MacRuby] #254: Let void-returning ObjC calls return the receiver.
#254: Let void-returning ObjC calls return the receiver. --------------------------------+------------------------------------------- Reporter: mikael@… | Owner: lsansonetti@… Type: enhancement | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- A lot of Objective-C methods return void, especially within Cocoa. This makes a lot of sense for a language like ObjC, but not nearly as much for Ruby, since all methods have a return value. Since method chaining is one of the things that make Ruby so elegant, I propose that all ObjC methods that are declared to return void actually return the receiver instead. This will allow for method chaining such as {{{ if someNSTask.launch.waitUntilExit.terminationStatus == 0 # … end }}} which would otherwise have to be written as {{{ someNSTask.waitUntilExit someNSTask.launch if someNSTask.terminationStatus == 0 # … end }}} . -- Ticket URL: <http://www.macruby.org/trac/ticket/254> MacRuby <http://macruby.org/>
#254: Let void-returning ObjC calls return the receiver. --------------------------------+------------------------------------------- Reporter: mikael@… | Owner: lsansonetti@… Type: enhancement | Status: closed Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | --------------------------------+------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.5 Comment: Fixed in r2949. -- Ticket URL: <http://www.macruby.org/trac/ticket/254#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby