From: Thomas Wieczorek Date: 2008-03-04T09:52:17+09:00 Subject: Re: Why is this not implemented in Ruby On Mon, Mar 3, 2008 at 11:25 PM, F. Senault wrote: > Le 3 mars 2008 à 22:46, John Pritchard-Williams a écrit : > > > > As an aside: I think it was VB that used to let you do that missing > > parameter thing...but its been a while since I saw that.... > > Yes, definitely VB6. > VB.Net still supports it in Late Binding, not sure about Early Binding, I have seen that in an PowerPoint automation example just a few days ago, when I worked on an recent project. I think it gets than the optional value. I like the hashed solution more, than leaving an empty space, between two commatas. IMO it's more beautiful. Named parameters in Ruby 1.9 look also nice. On Mon, Mar 3, 2008 at 10:36 PM, Jason Roelofs wrote: > > def aProc(options = {}) > a = options[:a] || 5 > b = options[:b] || 6 > c = options[:c] || 7 > print a, b, c > end > You could also do like that: def aProc(options = {}) options = {:a => 5, :b => 6, :c => 7}.merge(options) print options[:a], options[:b], options[:c] end