4 ms·
I sometimes wish rubymotion and macruby had named parameter with default value, something like def functions(with, this: syntax="default value") end but over
by DarwinOS 14y ago
I sometimes wish rubymotion and macruby had named parameter with default value, something like
def functions(with, this: syntax="default value")
end
but over all, I think rubmyotion rocks and I hope and brings some great Objective-c/Cocoa world into ruby-world and vice-versa.
- learc83 14y agoYou can setup your method to accept a hash, and then do something like this... syntax = options[:syntax] || "default value" ...in the method body. Still, it would be nice to have it built in.
- Argorak 14y agoRuby 2.0 will introduce this: http://rosettacode.org/wiki/Named_parameters#Ruby.27s_future http://rosettacode.org/wiki/Named_parameters#Ruby.27s_future I would expect MacRuby and RubyMotion to follow.