On 5/17/05, Rob Kinyon <[EMAIL PROTECTED]> wrote:
> > Maybe s/Num/NumLike/ or something?  Anyway, that's how I think of it
> > at least: not that a Str is converted into a Num, but rather that
> > certain Strs are Nums.
> 
> If that's the case, then if I change a variable that isa Str (that isa
> Num), does it change what it inherits from?

Er, Str is not a Num.  Num is a subtype of Str, so Num is a Str.  If
you change a Str, it could cease to be a Num.

    $x = "123";    # $x does Str & Num & Int
    $x .= ".45";   # $x does Str & Num
    $x .= "xyz";   # $x does Str

But again, don't take this as gospel.  This is just a tidbit from the
object model which I will probably not end up proposing.  I find it
quite elegant when used with pure (as in, non-manhattan) MMD.  It
doesn't really make sense with manhattan-style, since we can't
determine what a "level of inheritance" is with subtypes.

Luke

Reply via email to