From: Daniel Berger Date: 2005-10-21T20:16:59+09:00 Subject: Re: A comparison by example of keyword argument styles Trans wrote: > Why not a Parameters class. This would allow cool things like: > > a = [ :a, :b, :c ] > > def foo(a.to_parm) #as def foo(a,b,c) > #... > end > > And it would be more useful in the def too (Although maybe this would > be a different class): > > def foo(**parm) > p parm.arguments > p parm.named_arguments > p parm.block.call > end > > foo(1,2,:a=>3){ "block" } > > => [1,2] > {:a=>3} > "block" Sydney will accomplish this via behaviors: # This is *not* finalized def foo(*parm) p KeywordBehavior.arguments p KeywordBehavior.keyword_arguments end Abstracting it out to a generic "Parameter" behavior is something I hadn't thought of, but knowing Evan, it just might be possible. :) Regards, Dan