RE: ACTION 614-12: Smart Quotes

My previous modification to Liam's proposal had some characters messed up.  Here it is again, this time I didn't try to compose it in Outlook ....

Suppose we did this:

ExtStringConstructor ::= "~~|" ExtStringText "|~~"
ExtStringText := ((Char* - "~~{") | "~~{" Expr "}~~")*

That makes our earlier example look like this:

~~| ~~{ "${" }~~ |~~

Here is a longer example, modified from Liam's proposal:

    declare variable $json := ~~| {"menu": {
      "id": "file",
      "value": "File",
      "popup": {
        "menuitem": [
          {"value": "New", "onclick": "CreateNewDoc()"},
          {"value": "Open", "onclick": "OpenDoc()"},
          {"value": "Close", "onclick": "CloseDoc()"},
          {"callback": null },
          {"session-id":  ~~{ get-session-id() }~~ }
        ]
      }
    }} |~~ ;

Since you can embed any arbitrary expression, you can effectively do an escape by assigning a sequence to a string variable.

declare variable $double-squiggle := "~~";
declare variable $pipe := "|";

~~| ~~{ $double-squiggle, $pipe }~~ |~~

Do we need an escape mechanism beyond that?

Jonathan

Received on Thursday, 10 September 2015 20:53:34 UTC