The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
YaySON

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
YaySON Posted: Apr 14, 2006 2:44 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: YaySON
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Wow, the YAML-Core list is aflame with a conquest to get JSON to become a subset of YAML. The differences have historically been very, very minor. But tough to solve, given the aims of both languages. Oren Ben-Kiki suddenly piped up this week with some ideas and the TrinitY have been bouncing ideas around since.

Basically, the differences have been:

  1. Colon cramping:
    • In YAML hashes, the colon must be followed by a space:
      • {key: value}
    • In JSON hashes, you can butt the key and value right up to the colon:
      • {"key":"value"}
    • This seems minor until you witness how it conflicts with YAML’s timestamp format. (What is {10:20}?)
  2. C-style comments: /* */
    • Were removed from JSON.
  3. Single-quoted strings had different escaping rules between the two.
    • Such strings were removed from JSON.
  4. The final answer is still being primed, but YAML’s definitely going to budge on this colon affair, folks! I’m sure you’ll be hearing once we’ve got it all ready for you.


    Oh, and while scouting around in the JSON draft proposal, this little bit of regexp security caught my eye. Can’t hurt I guess.

     var my_JSON_object = !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
     text.replace(/"(\\.|[^"\\])*"/g, ''))) &&
     eval('(' + text + ')');
    

Read: YaySON

Topic: Rails and HTML and XHTML Previous Topic   Next Topic Topic: The Best Ruby on Rails Information Available

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use