W3C home > Mailing lists > Public > www-voice@w3.org > October to December 2014

Re: [SCXML] Question regarding the meaning and purpose of type 'location expression in namelist and param location attributes

From: David Junger <tffy@free.fr>
Date: Wed, 29 Oct 2014 10:15:10 +0100
Message-Id: <AD658772-1385-49B4-B0DC-80B508D60EA7@free.fr>
To: "www-voice@w3.org (www-voice@w3.org)" <www-voice@w3.org>
Le 29 okt 2014 à 01:32, Ate Douma <ate@douma.nu> a écrit :
> I'm curious: does anyone actually have a working SCXML implementation where using an ECMA "foo.bar" namelist (or even better: the XPath "foo/bar" namelist) works for passing the attribute to the invoked session?

Thing is, it'd be ambiguous in ECMAScript, as we can have datamodel["foo.bar"] which would be different from datamodel.foo.bar. In a namelist, JSSC simply splits around whitespace, and uses the resulting strings as "names", and evals them to get the value, so they can be any expression at all (as long as they don't contain whitespace).

Interpreting "foo.bar" as a qualified name would be feasible, but many other things are valid left-hand-side expressions in ECMAScript and there's no way I'm going to write a parser for "foo(bar){…}.baz[7*i+2]". Not to mention that context (scope chain and "this") would not be passed along with the expression, so while "this.bar" is a good-looking name, it may behave in a strange way.

Anyway, while JSSC will set the "foo.bar" property of an invoked session from the namelist, it is not a particularly intuitive behavior and I wouldn't mind if nobody ever thought that it was a good idea to try it.

Received on Wednesday, 29 October 2014 09:15:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:07:45 UTC