From: Christian Neukirchen Date: 2005-08-02T22:22:23+09:00 Subject: Re: different order of parameters... Yukihiro Matsumoto writes: > 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. To what extend will these be checked? I.e., if I have a method def foo(argone: 3, argtwo: 42); end What will happen when I call foo(bleh: nil) ? (and btw, can one write foo bleh: nil?) > matz. -- Christian Neukirchen http://chneukirchen.org