Frank,

I did read your blog, I'm not that stubborn ;-)

I think you're addressing an edge case (passing 'undefined') to make
your point, but that is fine as it helps focus me on getting the
optimal solution. I say optimal, not perfect, for a reason, which is:

As long as we're talking edge cases, I noticed your blog also invokes
one to make it's point, namely using an untyped parameter. Your
function signature is "insult(s = 'fool')". Only when the parameter
you're setting a default for is untyped will it's value be
'undefined', which you are testing for in your blog. In all cases=
where you declare a type for the parameter ("insult(s:String =
'fool')"), the value assigned to it when you pass 'undefined' is the
initial for that type, i.e 'null' for String and Object, NaN for
Number, 0 for int, false for Boolean, etc..

I'm not sure how your solution provides for this? Mine doesn't either,
mind you, but I gave up perfection for simplicity very early in this
thread ;-)

EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Reply via email to