Re: Can't coerce to string
Brian Alliet <[email protected]> Thu, 18 Mar 2004 09:25:24 -0500
| Newsgroups | gmane.comp.java.xwt.core |
|---|---|
| Message-ID | <[email protected]> |
On Mar 18, 2004, at 4:12 AM, David Crawshaw wrote:
> - In a typeless language, it's very important that simply moving a
> variable from one state to another doesn't affect its value. Why
> EMCAScript allows this violation, I don't know.
Good point. However, there are still plenty of other ways for a
variable to lose its value when moving from one state to another. For
example, string to number and boolean conversions affect the string's
value.
> I usually just result to null or equality test debugging these days.
>
> ibex.log.debug("myBox null?"+(myBox==null));
But if myBox happens to be a string or number your test will return
true even though it isn't a box. With ibex.log.debug("mybox: " + myBox)
you know for sure that myBox is non-null and is a box.
> ibex.log.debug("myBox=", myBox, " myOther=", myOther);
We should've done this a long time ago. It was a good idea when Charlie
first brought it up too :)
-Brian