--- Michael Lazzaro <[EMAIL PROTECTED]> wrote: > > On Wednesday, January 29, 2003, at 11:02 AM, Jonathan Scott Duff > wrote: > >> So you can't set something to its type's own empty value, because > it > >> will, by definition, thereafter return it's "overloaded" empty > value, > >> <def>. > > > > Looks like a maintenance nightmare to me. > > Agreed, it's not pretty. The fundamental problem is that a primitive > > like an C<int> simply cannot be undefined... there's no flag for that > > (which is they're primitive.) So it having a 'default value' at > all > is perhaps a bit of a misnomer. > > A simple solution is perhaps to say that C<is default> can only be > applied to types that can be undef (scalar,ref,Int,Str...) and can't > be > used on things that have no undefined state (bit,int,str...). >
Wait a minute. Leaving out the whole "is default()" bit, what happens when I: my int @a; @a[4] = 100; @a[2]; What does @a[2] return? It must return something, and that something can't be undef, because ... <above> .... So, what is it? Whatever it is, that's the default. =Austin