[Laszlo-dev] look familiar? Unknown type for PUSH: false
Don Hopkins
dhopkins at DonHopkins.com
Fri Jan 19 19:46:36 PST 2007
JavaScript is truly (or falsely, depending on your view) a post-modern
language, where truth is relative, and each object decides for itself
what's true and what's not.
In JavaScript, all objects are equal, but some objects are more equal
than others.
That's why it has "==="!
Rumor has it that the next version of JavaScript will actually support
"====" and "=====", so it will be even more equal than all other Turing
complete languages!
Except of course for Lisp, which has an "=^n" macro that supports
arbitrary bignums.
-Don
Benjamin Shine wrote:
> I figured a lot of this out.
> In java, 1 is different from "1" is different from true is different
> from "true" is different from Boolean.TRUE.
> In python, some of those are equal-ish.
> In javascript, some of those are equal-ish.
> Thus, exquisite care must be taken when trying to emit code that says
> var $debug=1
> to not get code that says
> var $debug="true"
> or
> var $debug=true
> etc.
>
> Also, it is not recommended to ever use Properties.put(Object, Object)
> because that introduces potential type mismatches which are not
> detectable until runtime. Anything that can put into a properties
> object can be gotten out with Properties.getProperty(String), which
> returns a String. So if you put something in with
> properties.put("somekey", anObj) where anObj is anything but a String,
> you get kablooey when doing properties.get("somekey").
>
More information about the Laszlo-dev
mailing list