RE: updated SCXML draft

My responses in-line marked off by '>>'

-----Original Message-----
From: David Junger [mailto:tffy@free.fr] 
Sent: Wednesday, April 10, 2013 4:59 PM
To: Voice Public List
Subject: Re: updated SCXML draft

Here is my review of the C.2 section.

C.2

What's this about E4X? is the E4X ghost haunting the Web still?
>> It was when someone submitted prose for this.  I think it's harmless to leave it in.

C.2.5
> The Processor may convert the expression result to a string in contexts where a string is expected


Please, no. What you suggest is just like PHP's infamous magic_quotes. That would lead to incompatible documents if someone were evil enough to do it. I know, nested quoting is annoying. But there is no other way. It's the ECMAScript data model, not the Plain Text data model.
BTW, please revert your change in the example in C.2.1.

>> This comment is inconsistent with your comment on C.2.8.1.  What is coercion to string if not a "platform-specific parser"?  If we insist on 100% portability, then nothing can be platform-specific.  Coercion to string is something that Johan has found quite useful. (Ask him about it if you see him.) On the other hand, in the example in C.2.1 I'll put single quotes back in since this isn't a context in which we can expect a string, so it blows up on Johan's system in its current form.  It will be <data id="CEO" expr='Mr Big'/>.  

C.2.8

> while data is either  an Object or a String  value.

I must remind you that <content expr/> or <content> with an atomic JSON value inside may result in something which is neither an object nor a string. Therefore, _event.data can have *any* type. You see that type frequently in ECMAScript-related documentation.

>> Makes sense.  I had forgotten about JSON

> For the _ioprocessors system variable the Processor must create an array


Why an array? it's much more elegant to use an object with named properties, as your own examples do. The language is confusing. Arrays in ECMAScript can have named properties but those don't count as items in the array and are not iterable. Just call _ioprocessors an object.

>> This also makes sense.  

C.2.8.1

I don't like that the spec forbids platform-specific parsers for incoming data, nor allows senders to override the heuristics (e.g. by providing a MIME type, as I suggested before).

An obvious example: I want to parse HTML markup as a DOM too.
Also, I want to be able to tell the platform NOT to fall back to plain text if there is an XML error, so that I can see the XML error document.

>> See above on C.2.5.  I don't see how you can maintain both comments.  If we allow platform-specific parsers here, why not coercion to strings?  Letting senders specify the Mime type makes sense in a lot of contexts.  We had an early attempt at it as 'language' (I think it was) as a field in events.  But it turned out to be hard to specify it in a completely general way, and to explain how it got transmitted.  I think this will have to remain as an issue for a future release.  
>> As for seeing the XML document, do you really need to examine the document inside the script while it's running?  If it's a debugging issue, you can handle it by platform-specific means. 

C.2.9
should say something about the platform being unable to serialize at all. Do we raise an error.execution or just give a warning?

>> I'm not sure.  We say that the platform can fall back to a platform-specific method, which may include loss of data.  So it can serialize anything as "" and be in technical compliance.  I don't think it makes sense to have a 'must' after a 'may' because it's then not clear what the 'must' really means and when it applies.  That's why I left it with just 'should provide a warning' though we could extend it to say "loss of data or unable to serialize at all" which would be clearer.

C.2.11
see my last message in the thread "IPR tests, part 1"
>> I think this text does incorporate your comments, though phrased somewhat differently. What do you think is missing? (the phrase "as if it had made a shallow copy" allows you not to copy a string, since it makes no difference whether you do or not.)

			David

Received on Wednesday, 10 April 2013 21:45:52 UTC