[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Method wrapping

Christoph R.

11/27/2003 11:26:00 PM

Peter wrote:
...
> My point was about something like this:
>
> def foo(a,b,c=3)
> blah
> end
>
> def foo:wrap(a,b)
> blah blah
> super
> end
>
> Is foo:wrap invalid or not? If it is, I assume the following
> foo:wrap is valid, right?
>
> def foo:wrap(a,b,c)
> blah blah
> super
> end
>
> Either way, we loose the parameter with the default value,
> either because it's always 5 or because we always have to
> specify a value. Only way is to repeat the default value in
> foo:wrap. Unless there's special behavior for wrapping
> methods somewhere.

I sort of suggested the latter possibility but judging from
past record in this thread I'll bet that Matz is going to
opt for wrapper with changing default values:-)

/Christoph