Re: empty fields in SCXML events.

It would be a problem if we had a number, as 0 will evaluate to false yet is not empty. If we can assume that we never speak about numbers in this context, the boolean value sounds like a fit to me. If we ever need a number we will have to add a datamodel specific sentence and require those to be explicitly undefined.
  Stefan

On Apr 5, 2013, at 7:38 PM, Jim Barnett <Jim.Barnett@genesyslab.com<mailto:Jim.Barnett@genesyslab.com>>
 wrote:

So we say that the values of empty event fields is ‘Undefined’?  I don’t care personally, I just want something that ECMAScript programmers will find intuitive and consistent.  I would like to use the same value for the string-valued fields and _event.data  (Looking at the ECMA spec, it seems that ‘Undefined’, Null, 0, NaN, and “” all evaluate to Boolean ‘false’.)


-          Jim

From: David Junger [mailto:tffy@free.fr<http://free.fr>]
Sent: Friday, April 05, 2013 1:33 PM
To: Voice Public List
Subject: Re: empty fields in SCXML events.

Le 5 apr 2013 à 19:18, Jim Barnett a écrit :


So your proposal is that we say that it can be a string or an Object, and if it is “empty”, its value can be anything that evaluates to ‘false’?  Can we say the same thing for the string-valued slots?  It would be nice to have a consistent way of representing the absence of a value.

In the ECMAScript datamodel, type is not important. It's ECMAScript, after all! things have mixed types all the time here.

The absence of a value of any type is consistently represented by the special value (and type) 'undefined'. Which does convert to boolean false.

                                    David

Received on Friday, 5 April 2013 17:51:39 UTC