On Mon, Mar 24, 2008 at 9:43 PM, Darryl [EMAIL PROTECTED] wrote:
typeof(1) == number
typeof(new Number(1)) == object
[...]
Will these be made uniform in JS2?
No, it would be a pretty big breaking change from ES3. ES4 is
considering several small breaking changes, but nothing this major.
I
On Mon, 2008-03-24 at 19:43 -0700, Darryl wrote:
It'd also be nice to have non-mandatory function call parens like in
Ruby
No it wouldn't. Functions get passed around a hell of a lot more in
Javascript than they do in Ruby, which means that you'd need to rely on
something akin to Ruby's
In current versions of JS there's some weird stuff
where some primitives are equal to their object
equivalents:
1 == new Number(1)
But in other cases they're not equivalents at all:
typeof(1) == number
typeof(new Number(1)) == object
And sometimes theres weird syntax errors:
5.prototype
But the all important problem with your argument,
Brendan, is that Ruby manages to allow 5.0 to be a
float, and 5.times to be a method call, without any
ambiguity. If Ruby can do it, why can't JavaScript?
---
o///
Be seeing you...
I'll grant you one thing tho: Ruby requires 99.0
where JS allows 99.. To be honest, saving that one
character when making whole-number valued floats
(which are indistinguishable form NON floats, i.e. 99
== 99. == 99.0), at the expense of being able to do
99.abs or something like that, is
I'd also point out that 5..prototype doesn't work,
even tho 5. is a float, and therefore this should be
valid syntax. That hanging dot pointless, AND
inconsistent. This could just be implementation wise, ofcourse.
---
o///
Be seeing you...
On Mar 24, 2008, at 8:16 PM, Darryl wrote:
But the all important problem with your argument,
Brendan, is that Ruby manages to allow 5.0 to be a
float, and 5.times to be a method call, without any
ambiguity. If Ruby can do it, why can't JavaScript?
Please don't ask dumb rhetorical questions.