Re: JSYNC

Ingy dot Net <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
On Sat, May 1, 2010 at 12:21 AM, William Spitzak <[email protected]> wrote:

>
>
> Brad Baxter wrote:
>
>> I, for one, would welcome this.
>>
>> Forgive me for spotting trivia, but the lines
>> below don't seem to match.  Is that just a typo,
>> or is there something significant I'm missing.
>>
>> "notes": ".!!! Awesome !!!",
>> "notes": ".... add note here ...",
>>
>> notes: '!!! Awesome !!!'
>> notes: ... add note here ...
>>
>
> He is using a leading dot to quote the next character. Otherwise it would
> be impossible to make a tag that starts with '!' or '&'.
>
>
Correct. I chose a leading period as the escape character. The first '.' of
any string is removed. '\' doesn't work for obvious reasons. I chose '.'
because it is small and not unsightly, but readability isn't a major design
goal.

I also chose '.' because it sorts after '!', '&' and '*'. It will be
recommended that JSYNC emitters emit mapping keys in sort order. Types will
always sort to the top, unless the key begins with a space. In that case the
emitter is recommended to put a '.' in front of the space, to make it sort
lower.

The first ascii printables are: ! " # $ % & ' ( ) * + , - . / 0 1

I'd like all special chars to be before '0'. I'd like the escape char to
sort last, or at least after the '&'. That leaves us with ' + , - . or /. I
still like . the best.

Note that the escape char is the leading char, *after* extra syntax is
removed.

[ "!type .&content" ]

is:

--- !type '&content'

I'm not sure this is the best choice, as numbers can start with a dot. This
> is not in official JSON syntax, however, because they must start with a zero
> and are never quoted while strings always are, but there are plenty of
> semi-JSON syntaxes that do not follow these rules and this would be a
> serious incompatibility with them.
>

Can you elucidate with an example? I don't follow the logic.


> I think another punctuation mark should be used. '!' can't work as YAML
> tags can start with '!!'. But I think '&' works because a YAML address
> cannot start with '&&', right?
>
> Other change I would make is unify the syntax between lists and maps.
> Instead of "!":"record" in the map, I would use "!record":null. If there is
> both a tag and address I would use "!record":"&address".


I was thinking of:

"!": "!record"

as a possibility. The "!record":"&address" is pretty clever. I'll sleep on
it.


>
>     Greetings from Taiwan,
>>
>>    I just wrote this up: http://www.jsync.org/
>>
>>    I'm interested to know what y'all think.
>>
>>    Cheers, Ingy
>>
>

------------------------------------------------------------------------------

_______________________________________________
Yaml-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/yaml-core
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.