[MacRuby-devel] super_foo style RubyCocoa messages.

Pierce T. Wetter III pierce at twinforces.com
Tue May 6 10:10:24 PDT 2008


>> It is, but I have to say that I always found the super_foo syntax  
>> confusing in RubyCocoa. That's probably because I came to Ruby from  
>> ObjC, not ObjC from Ruby... I kept wishing that:
>>
>> super.foo() would work. Is that possible?
>
> Hi Pierce,
>
> That syntax wouldn't work because calling "super" will call the  
> method you're in from the superclass.
> AND it may/will return an object. In your example you are calling  
> #foo on the result object of the super call.
>
> But that would be the functionality I suggest yes.
>
> About the weird syntax in RubyCocoa, I agree.
> But this wouldn't be a compatibility layer without supporting it's  
> intricacies now would it :)

   Hmmm... Given that this is something where Ruby/ObjC (or for that  
matter Java) butt heads, I wonder if there should be a better syntax?  
Like:

def bar()

   superclass.foo()  # call the superclasses implementation of foo()

end

   I could probably learn to remember to type superclass instead of  
super.

Pierce

>
>
> Eloy
>
> PS: Is it me or is the return-path for the emails coming from the ML  
> incorrect? I guess it should point to macruby-devel at lists.macosforge.org 
>  instead of Pierce...

  That happens to me as well.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1590 bytes
Desc: not available
Url : http://lists.macosforge.org/pipermail/macruby-devel/attachments/20080506/77db5fe8/smime.bin


More information about the MacRuby-devel mailing list