Re: Yayson (proposal for a YAML presentation embedded within JSON for browser clients)

Ingy dot Net <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
On Tue, Jun 15, 2010 at 9:48 AM, William Spitzak <[email protected]> wrote:

> Ingy dot Net wrote:
>
>  Right. The serialization needs to be 100% JSON.
>>
>
> This means that any unquoted value in YAML, if the lack of quotes is used
> to determine the default tag, must be tagged in the conversion. What I am
> unclear on is when this is allowed, the YAML spec seems to skim over this
> but it certainly is using unquoted to distinguish the 'null' from the
> 4-letter string "null".


Right, this is called "implicit typing" in YAML. Implicitly typing on quoted
strings may be forced in YAML by using a single !.

---
number: ! "42"

I think we can do the same for JSYNC.

 because space sorts before '!'. The first printable chars are:
>
>     <space> ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
>
> I was thinking it would be nice if the JSYNCisms key sorted above the
> normal keys.
>

I think I see but that would require all bytes < '.' to be dot-prefixed and
> none above to require this. This would require all control characters and
>  double-quote to be dot-prefixed, despite the fact that they also need
> backslash escape for JSON. And '+' and '-' despite the fact that they are
> allowed in unquoted JSON. Also '(' would require it. And YAML has reserved
> '@' for future use so it seems that should require a dot.
>
> So my feeling is that the short, but unfortunately non-contiguous set of
> "!%&*@" are the only special prefix characters.
>

You are probably right. Let's start with that set.

Cheers, Ingy

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo

_______________________________________________
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.