- From: Richard Newman <r.newman@reading.ac.uk>
- Date: Fri, 6 Oct 2006 18:34:46 -0700
- To: "Obrst, Leo J." <lobrst@mitre.org>
- Cc: "Hans Teijgeler" <hans.teijgeler@quicknet.nl>, "SW-forum" <semantic-web@w3.org>, "Paap, Onno" <onno.paap@gmail.com>
- Message-Id: <A3571AB7-5DC7-4467-83B2-E302B6DBAEB4@reading.ac.uk>
That one line puts a Javascript object into the variable 'mine' that
corresponds to the JSON you serialised. You can walk it with normal
Javascript . accessors, rather than attempting to parse the XML or
somesuch. The 'eval' line takes the input as text, and the Javascript
parser turns it into actual objects -- JavaScript Object Notation =
JSON.
If you're working with Javascript, Ruby, or a host of other languages
(json.org), JSON is vastly easier and less verbose than XML. If it
fits the problem domain, use it.
-R
On 6 Oct 2006, at 5:45 PM, Obrst, Leo J. wrote:
> Ok, Hans, assume I am an idiot about Javascript. What does that mean?
>
> var mine = eval ("(" + input + ")");
>
> Does it mean: evaluate the quoted string of the input value '+
> input +'? When are the '+' operators evaluated, or are they
> operators or delimiters? Let's assume they are operators. Are they
> evaluated at 'eval' time?
>
> What's the semantics here? I know quotation in Lisp and even meta-
> quotation, and evaluation at both of those, but I don't know what
> you mean here.
>
> Mucho gracias!
> Leo
Received on Saturday, 7 October 2006 01:34:58 UTC