Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Cancelling instantiation

Reply
Thread Tools

Cancelling instantiation

 
 
Michael Winter
Guest
Posts: n/a
 
      03-02-2004
On Tue, 02 Mar 2004 18:40:55 +0100, Lasse Reichstein Nielsen
<(E-Mail Removed)> wrote:

> "Richard Cornford" <(E-Mail Removed)> writes:
>
>> Richard Cornford wrote:
>> <snip>
>>> ... (I have got a copy of the 3nd edition of ECMA 262

>> ^
>> That should have been 2nd edition.

>
> I was about to say "me too", but found that it can be downloaded
> at <URL:http://www.mozilla.org/js/language/> (along with version 1).


Thank you, both of you.

It's strange that the earlier editions aren't available from the ECMA
website, or that changes between versions aren't marked.

I do have the 3rd edition, but I can rarely make heads or tails of it. It
must be the worst written, yet grammatically-correct document I've ever
read. I find it odd that that level of incomprehensibility is acceptable
to the authors. I would have thought that the aim of the document would be
to explain the language to anyone who wishes to use it, as other language
specifications attempt to do. I'm not too sure who that document is geared
towards. It certainly isn't at a level that the casual script author can
use. Compare it to the Java Language Specification, for example.

Richard: Thank you for your explanation of protected members in
JavaScript, and for the comments on my proposed approach. I guessed that
there would be problems, but I didn't think that it would be with the
availability of instanceof (it was introduced in v1.4 with exceptions). I
won't be able to review the code you presented tonight, but I will
tomorrow.

Mike

--
Michael Winter
http://www.velocityreviews.com/forums/(E-Mail Removed)d (replace ".invalid" with ".uk" to reply)
 
Reply With Quote
 
 
 
 
Michael Winter
Guest
Posts: n/a
 
      03-02-2004
On Tue, 02 Mar 2004 12:55:33 -0500, Randy Webb <(E-Mail Removed)>
wrote:

> Richard Cornford wrote:
>
>> (I have got a copy of the 3nd edition of ECMA 262
>> which I could e-mail you if you are interested)

>
> I am please.


You can obtain the 3rd Ed. directly from ECMA for free as a PDF:

http://www.ecma-international.org/pu...s/Ecma-262.htm

Mike

--
Michael Winter
(E-Mail Removed)d (replace ".invalid" with ".uk" to reply)
 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      03-02-2004
Michael Winter wrote:

> On Tue, 02 Mar 2004 12:55:33 -0500, Randy Webb <(E-Mail Removed)>
> wrote:
>
>> Richard Cornford wrote:
>>
>>> (I have got a copy of the 3nd edition of ECMA 262
>>> which I could e-mail you if you are interested)

>>
>>
>> I am please.

>
>
> You can obtain the 3rd Ed. directly from ECMA for free as a PDF:
>
> http://www.ecma-international.org/pu...s/Ecma-262.htm
>


Thanks Mike. I saw Lasse's post after I replied and have them both book
marked now

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
 
Reply With Quote
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      03-02-2004
Michael Winter <(E-Mail Removed)> writes:

> I do have the 3rd edition, but I can rarely make heads or tails of
> it. It must be the worst written, yet grammatically-correct document
> I've ever read.


I have seen worse

> I find it odd that that level of incomprehensibility
> is acceptable to the authors. I would have thought that the aim of the
> document would be to explain the language to anyone who wishes to use
> it, as other language specifications attempt to do.


I disagree. The purpose of a language specification is to define the
language unambiguously and exactly. It is not a tutorial, it is a
reference document. Adding too much explanation text risks adding
ambiguiuity either in the text or between the text and the formal
specification.

Ofcourse, there should also be a tutorial, but I guess ECMA left that
to the Netscape and Microsoft Corporations or other implementors of
the language.

> I'm not too sure who that document is geared towards. It certainly
> isn't at a level that the casual script author can use.


> Compare it to the Java Language Specification, for example.


Ok, ECMAScript is not exactly easy to read I admit that the JLS
is easier to read, although it too can get pretty hard too.
Is it also as complete, including the behavior of all build-in
functions?

Now compare it to the R5RS
<URL:http://www.swiss.ai.mit.edu/~jaffer/r5rs_toc.html>

/L
--
Lasse Reichstein Nielsen - (E-Mail Removed)
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
 
Reply With Quote
 
Michael Winter
Guest
Posts: n/a
 
      03-03-2004
On Tue, 02 Mar 2004 19:29:48 +0100, Lasse Reichstein Nielsen
<(E-Mail Removed)> wrote:

> Michael Winter <(E-Mail Removed)> writes:
>
>> I do have the 3rd edition, but I can rarely make heads or tails of
>> it. It must be the worst written, yet grammatically-correct document
>> I've ever read.

>
> I have seen worse


I don't doubt that.

>> I find it odd that that level of incomprehensibility
>> is acceptable to the authors. I would have thought that the aim of the
>> document would be to explain the language to anyone who wishes to use
>> it, as other language specifications attempt to do.

>
> I disagree. The purpose of a language specification is to define the
> language unambiguously and exactly. It is not a tutorial, it is a
> reference document. Adding too much explanation text risks adding
> ambiguiuity either in the text or between the text and the formal
> specification.


It would depend on who is the target audience. The Standard doesn't say,
but it does seem that, due to the detail in how methods are implemented,
writers of a JavaScript interpreter are the most likely.

> Ofcourse, there should also be a tutorial, but I guess ECMA left that
> to the Netscape and Microsoft Corporations or other implementors of
> the language.


I don't find that the Netscape and Microsoft references are always
sufficient. For the most part, they are fine, but I would like something
between them and ECMA-262.

>> I'm not too sure who that document is geared towards. It certainly
>> isn't at a level that the casual script author can use.

>
>> Compare it to the Java Language Specification, for example.

>
> Ok, ECMAScript is not exactly easy to read I admit that the JLS
> is easier to read, although it too can get pretty hard too.
> Is it also as complete, including the behavior of all build-in
> functions?


I can't say for certain. It has been a year since I read it properly (I
went front-to-back then). However, if memory serves, the grammar of the
language is fully specified. Multi-threading issues are covered to a level
where a conforming implementation could be built. I think even the loading
of class files is covered.

Perhaps the difference between them is that Sun provide the run-time
engine for virtually every operating system, so no implementations need to
be made. That allows the specification to concentrate on language itself,
and not its internal behaviour. If ECMA-262 contained some additional
comments that summarise the processes described, it would be a good step
forward. This would allow both precision and comprehension.

> Now compare it to the R5RS
> <URL:http://www.swiss.ai.mit.edu/~jaffer/r5rs_toc.html>


In what regard: specificity or ease of reading?

With the former, it appears to be about equal to JLS. Somewhat more
verbose, perhaps, but not radically different.

With the latter, I can't honestly say without reading and understanding a
good proportion of the text which I haven't had the time to do, and have
no inclination to do at this time of night Superficially, it is easier
to comprehend than ECMA-262.

The two major stumbling blocks I have are the indirect method of
description, and the choice of language. The specification seems to be
written with an incremental approach, where parts of an explanation rely
heavily on previous topics (the definition of some basic functions, for
example). This gives the impression that one must virtually memorise the
first few sections before even considering the use of the remaining
document, which makes it useless (for me) for a reference. The language is
a minor problem in comparison. To illustrate that, the only example I
could find after a quick search is the use of "Disjunction" instead of
"Separator" in the grammar for regular expression patterns.

Perhaps, at some point, I should read the whole thing slowly, rather than
to try and use it to understand certain elements of the language.

Mike

--
Michael Winter
(E-Mail Removed)d (replace ".invalid" with ".uk" to reply)
 
Reply With Quote
 
Nathan Sweet
Guest
Posts: n/a
 
      03-03-2004
This is incorrect, JS does not support protected members.

George Jempty <(E-Mail Removed)> wrote in message news:<mO_0c.1485$(E-Mail Removed)>. ..
> <snip>
>
> > By the way, it's not possible to have protected[1] members in
> > JavaScript, is it? Shame...

>
> No, this is one of the great fallacies about Javascript. Javascript
> supports closures and therefore supports protected/private members. See:
>
> http://www.crockford.com/javascript/private.html

 
Reply With Quote
 
Douglas Crockford
Guest
Posts: n/a
 
      03-03-2004
> This is incorrect, JS does not support protected members.

Java needs protected members to compensate for the brittleness of the
classical object model. JavaScript is class-free, and so does not need
them. See http://www.crockford.com/javascript/inheritance.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Explicit instantiation of STL vector demands explicit instantiation of all the templates it using internally. krunalbauskar@gmail.com C++ 1 12-25-2006 03:51 PM
"Cancelling" more that one message at a time Perk Firefox 1 01-01-2005 05:38 AM
Cancelling the events Vik ASP .Net 1 04-06-2004 08:43 PM
Cancelling a HTTP data post del ASP .Net 1 11-09-2003 07:56 PM
Re: cancelling a postback on a button with javascript Bob ASP .Net 4 07-22-2003 07:10 PM



Advertisments