Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
A little geek entertainment...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John J Barton  
View profile  
 More options Oct 8 2009, 6:52 pm
From: John J Barton <johnjbar...@johnjbarton.com>
Date: Thu, 8 Oct 2009 15:52:27 -0700 (PDT)
Local: Thurs, Oct 8 2009 6:52 pm
Subject: A little geek entertainment...
 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wilson Lee  
View profile  
 More options Oct 8 2009, 10:21 pm
From: Wilson Lee <kou...@gmail.com>
Date: Thu, 8 Oct 2009 19:21:27 -0700 (PDT)
Local: Thurs, Oct 8 2009 10:21 pm
Subject: Re: A little geek entertainment...
Ah hah. A Spidermonkey- and Rhino-specific little nugget.

- kourge

On Oct 8, 3:52 pm, John J Barton <johnjbar...@johnjbarton.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wladimir Palant  
View profile  
 More options Oct 9 2009, 5:20 am
From: Wladimir Palant <trev....@adblockplus.org>
Date: Fri, 9 Oct 2009 02:20:41 -0700 (PDT)
Local: Fri, Oct 9 2009 5:20 am
Subject: Re: A little geek entertainment...
You are trying to use E4X syntax on something that isn't an XML object
- http://en.wikipedia.org/wiki/ECMAScript_for_XML

Correct use of that syntax:

var data = <root><value a="1">foo</value><value a="1">bar</
value><value a="2">bas</value></root>;
alert(data.value.(@a == 1));

"bar" is also a valid filter but it is a useless one - it is the
equivalent of true.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
johnjbarton  
View profile  
 More options Oct 9 2009, 11:01 am
From: johnjbarton <johnjbar...@johnjbarton.com>
Date: Fri, 9 Oct 2009 08:01:32 -0700 (PDT)
Local: Fri, Oct 9 2009 11:01 am
Subject: Re: A little geek entertainment...

On Oct 9, 2:20 am, Wladimir Palant <trev....@adblockplus.org> wrote:

> You are trying to use E4X syntax on something that isn't an XML object
> -http://en.wikipedia.org/wiki/ECMAScript_for_XML

> Correct use of that syntax:

> var data = <root><value a="1">foo</value><value a="1">bar</
> value><value a="2">bas</value></root>;
> alert(data.value.(@a == 1));

> "bar" is also a valid filter but it is a useless one - it is the
> equivalent of true.

Yes, more evidence that E4X is a bug. Embedding non-core features in
to Javascript by cute syntax degrades the language.

Here is the back story.  I got the error message, which included by
the way, a complete copy of the web page (yes, in the error message
text!). I had no idea why or where this came from, in part because the
line number for the error message was at the end of the error message,
many hundreds of characters off screen.

When I did find the line number I saw what had happened. Some time ago
I had been searching through the source for "getScriptAnalyzer". I
must have ended the search on a line like
    var f = sourceBox.getScriptAnalyzer(script);
with the method name selected. I that point I got distracted and
sometime later hit the keyboard, deleting the method name:
    var f = sourceBox.(script);
Before cutesy E4X syntax corruption, this line would have been a
simple syntax error. Now this line becomes a bizarre error message
(but could also have been a valid line that did something). For
reasons like this E4X is not an architectural building block, layering
on the foundation of the JS language to enhance it for a subcategory
of users. Instead it is a corruption, infiltration of the language
forcing everyone to deal with the XML mistake.

Or I need to be more careful typing, ;-)

jjb

jjb


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »