From: Richard Cornford on
On Aug 9, 3:03 pm, williamc wrote:
> On 8/9/2010 9:34 AM, Ry Nohryb wrote:
<snip>
>> It's perfect, that's the way it is, but only if the graph
>> is showing function declarations and not function calls
>> (only if it's not a call chain):
<snip>
> thx, yeah that makes sense. I wonder if the following code
> from Mozilla Dev Center kind of illustrates the tendency
> to conflate scope with the this object?
>
> I know 'scope' in this function is only a local variable

As we a re quibbling about terminology today; in ECMA 262 terminology,
in a function definition (the code that makes up a function
declaration or a function expression) the parenthesised list of
Identifiers that precedes the function body's surrounding braces is
called a FormalParameterList, which makes 'formal parameter', or
something like 'function parameter', or just 'parameter' appropriate
labels for any single item in that list (with 'argument' being applied
to the value passed into a call to a function, and so (possibly)
eventually assigned to a property of the Variable object with a name
that corresponds with the formal parameter's name ).

> *name*, but it struck me as kind of a misleading in the
> 'way to think about it' department...
>
> if (!Array.prototype.forEach) {
> Array.prototype.forEach = function(fn, scope) {
> scope = scope || this;
> for(var i = 0; i < this.length; i++) {
> fn.call(scope, this[i], i, this);
> }
> };
>
> }

Yes, in a language where the scope is (potentially) complex and should
be understood it is misleading to attach the label "scope" to
something that has noting to do with scoping. Frequently people
(particularly coming from other programming languages with
expectations about how things 'should work') find it difficult to come
to terms with the way that javascript determines the value of the -
this - keyword at runtime and in response to how a function is called.
They (often) expect the - this -value to be determined by the context
of its use in the source code, but because scope (the resolution of
Identifiers) is determined by the structure of the source code any
conflation of scope and the - this - value plays into that unfounded
expectation and promotes a misconception.

Richard.
From: Dr J R Stockton on
In comp.lang.javascript message <i3o41e$pi3$1(a)news.eternal-
september.org>, Sun, 8 Aug 2010 22:34:36, Garrett Smith
<dhtmlkitchen(a)gmail.com> posted:

>There's a big difference between that and obnoxious noise, massive
>overquoting, and lazy and sloppy formatting that makes up the majority
>of your postings.


Those who write carelessly and in haste, without checking what they have
written, are unlikely to be good programmers; this newsgroup is haunted
by three prime examples. David Mark posts more articles than Thomas
Lahn and Garrett Smith put together.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (RFCs 5536/7)
Do not Mail News to me. Before a reply, quote with ">" or "> " (RFCs 5536/7)
From: David Mark on
On Aug 9, 10:55 am, John G Harris <j...(a)nospam.demon.co.uk> wrote:
> On Sun, 8 Aug 2010 at 12:45:43, in comp.lang.javascript, David Mark
> wrote:
>
>   <snip>
>
> >You seem to have missed the point that it is not a matter of knowledge
> >but communication.  The specs are written for *implementors*, not
> >programmers.  That's why JS programmers don't refer to the language as
> >"ECMAScript" and rarely talk of syntax in terms of "productions".  ;)
>
> So you feel that it's wrong to say anything in this news group that
> would not be understood by the people who write JQuery ?

No, as mentioned, discussions have context, so generalizations about
"anything in this news group" miss the point.

>
> An amazing number of programmers don't know what a statement is,
> including some with PhDs. That's no reason for not using the word as
> defined in the language specification.

I didn't say anything about that word.

>
>   <snip>
>
> >There is no need for a term for such a general case (except perhaps
> >for implementors).  Trying to use such a term in programming
> >discussions will only serve to confuse.
>
> C++ manages to find a use for such a general case, but then it's a
> language for real programmers.

I don't care what C++ does.

>
> Your definition can be thoroughly confusing at times :
>
> 1. Back in the days of ECMA 262 v2 you could have a program where
> undefined was a variable in one browser and not a variable in another
> (because it was pre-defined). This is confusing.

And irrelevant today. Not to mention that calling every global a
"variable" does nothing to make it less confusing.

>
> 2. Even now in v3 you can write to undefined, so it now suddenly becomes
> a variable (because it has now been implicitly declared). This is
> confusing.

That's just a case of doing something silly.

>
> 3. When someone uses My Library they access a thing called API.

A global variable.

> It's not
> a variable according to you (because they didn't declare it). This is
> also confusing.

You misunderstood. I didn't mean you had to be the one to type the
declaration. If it is declared anywhere in your scrips(s) then it is
a variable. As soon as you include My Library, it becomes your
library. ;)
From: David Mark on
On Aug 9, 1:34 am, Garrett Smith <dhtmlkitc...(a)gmail.com> wrote:
> On 2010-08-08 09:54 PM, David Mark wrote:
>
> > On Aug 8, 8:01 pm, Garrett Smith
>
> [...]
>
> > I cite the specification when the context calls for it.  For example,
> > three years ago you asked me to explain to you why 0 is not less than
> > null (presumably to avoid RTFM yourself).
>
> >http://groups.google.com/group/comp.lang.javascript/msg/55dd0547c67e99a1
>
> That's a good example of an on-topic post, so you're capable of posting
> on-topic.

As you well know, I've been posting on-topic for years. You often
disagree with my points for months on end, only to find out that you
were wrong all along. I know that upsets you, but it is hardly my
fault.

>
> There's a big difference between that and obnoxious noise, massive
> overquoting, and lazy and sloppy formatting that makes up the majority
> of your postings.

I picture this red-faced, foaming at the mouth, obsessive twit who
can't stand that they are virtually always wrong with regard to
browser scripting problems. Get some help.
From: David Mark on
On Aug 9, 1:49 am, Garrett Smith <dhtmlkitc...(a)gmail.com> wrote:
> On 2010-08-08 09:34 PM, David Mark wrote:
>
> > On Aug 8, 4:55 pm, Ry Nohryb<jo...(a)jorgechamorro.com>  wrote:
> >> On Aug 8, 9:40 pm, David Mark<dmark.cins...(a)gmail.com>  wrote:
>
> >>> On Aug 8, 10:17 am, Ry Nohryb<jo...(a)jorgechamorro.com>  wrote:
>
> >>>> NFEs ? Avoided ? Why ? NFEs are *not* the problem, the problem is
> >>>> Microsoft.
>
> >>> *Named* NFE's. (...)
>
> >> Yes, the truly, really wellnamedones:named-named-function-
> >> expressions :-)
>
> > Nice catch, jackass.
>
> Try repeating that looking in the mirror.

LOL. Stop trying to be me. You can't carry it off.

>
> Commenting on obvious typos is about what I'd
>
> > expect from you.
>
> Is there a contradiction here?

Nope.

>
> Either you're concerned about using correct terminology or you're not.

That's your typical generalized pigeonholing. About what I'd expect
from you.

> Frankly I don't care about what you call it;

Call what?

> you've shown repeated
> unwillingness to hold civil technical discussion, trying to discuss
> anything with you is pretty much a waste of time anyway, so call it
> whatever you want and I'll happily ignore you.

You are doing a great job of ignoring me. :) If you are planning to
start this week, realize that you'll never learn anything if you don't
pay attention. For example, you'd still be using the - in - operator
on host objects and confused about re-flows if you had been previously
ignoring me.

>
> if you tried to correct Jorge and then posted wrong information again
> (that's about the fourth post in a row from you I've read today that
> follows that pattern).

I did not post wrong information. As you well know, Jorge and I have
had this same discussion about fifty times. As I stressed once again,
*named* function expressions are to be avoided because of a problem in
IE. Jorge's ridiculous idea of "avoiding" IE is to be ignored.