From: Neville Burnell Date: 2005-08-02T18:24:34+09:00 Subject: Re: different order of parameters... Ruby 1.8 "supports" this coding style however using hashes, for example: def fun(params) return "#{params[:a]} #params[:b]" end Print fun(:a => 1, :b => 2) -----Original Message----- From: Yukihiro Matsumoto [mailto:matz@ruby-lang.org] Sent: Tuesday, 2 August 2005 7:20 PM To: ruby-talk ML Subject: Re: different order of parameters... Hi, In message "Re: different order of parameters..." on Tue, 2 Aug 2005 18:11:05 +0900, JZ writes: | |I'm trying to understand how to call methods in Ruby. Is it possible to |call parameters in different order? E.g. in Python it is very clear and |simple to use. | |def fun(a=1,b=2): | return 'a:%s, b:%s' % (a,b) | |print fun(b=10, a=20) # a:20, b:10 |print fun(b=111) # a:1, b:111 |Is it possible that such basic and usefull feature is not implemented |in Ruby?? No. Keyword arguments like fun(b:20, a:10) is planned, but named keyword arguments will be separated from positional arguments still. matz.