--- nobu.nokada / softhome.net wrote:

> Hi,
> 
> At Sun, 23 Oct 2005 21:32:30 +0900,
> Yukihiro Matsumoto wrote in [ruby-talk:162119]:
> > |Something along the lines of:
> > |
> > |   def function( a, b, c : d, e = 1, f )
> > |   end
> > |
> > |where parameters to the left of the colon (or whatever
> symbol/keyword
> > |you choose) are positional parameters and those to the
> right are named
> > |ones.
> > 
> > |If your model is CLISP, this is also
> > |how CLISP deals with this (using &key), like:
> > |
> > |    (defun foo ( &key a b c )  (list a b c))
> > 
> > I considered that idea too, but I chose similarity to
> calling
> > syntax.
> 
> What about semicolon like as block parameters.
> 
>   def function(a, b, c = ""; d, e = 1, *f)
>   end

At first glance I like this, but ...

- with only keyword args, it looks a little ugly:
  def function(; d, e = 1, *f)

- in 1.9, ";" is already used as a delimiter (in the argument
list) for block local variables.  I assume keyword args will be
allowed with blocks/lambdas.

Just for reference, another language that takes "keyword"
arguments is verilog (hardware language).  It is ugly, but it
looks like this:

foo ( .a(1), .b(2), .c(3) ) # order doesn't matter
foo ( 1, 2, 3 ) # a=1, b=2, c=3




	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com