MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: Scattering assignment



>In simple assignment, 
>
>     <var> = <expr> AS <type>;

Would it be preferable to raise an E_TYPE error if the expression isn't 
of the specified type, or to convert the type? I can see reasons for both.
    If this is a type conversion, should an error be thrown if the type 
can not be converted? I would think so. If you had:

e= {1,2,3} as NUM;

The server ought to throw E_TYPE. But if you have:

e= "123" as NUM;

The server might to the tonum() conversion for you.


--
Jeff Watkins
http://www.FuturePress.com/People/jwatkins/
mailto:jwatkins@FuturePress.com




Home | Subject Index | Thread Index