News for hackers. Stuff that matters.
Re:Space: A whitespace alternative to JSON by kissmd on Wednesday April 17, 2013 @04:44AM (#5563405)
what about arrays? what if i paste this in a html and you want to copy it? all your spaces will be stripped.

nice thought anyway.

Re:Space: A whitespace alternative to JSON by breck on Wednesday April 17, 2013 @12:41PM (#5565442)
The underlying data structure of Space is an associate array, like in PHP.

So Space objects are both hash tables and arrays. For example say you had a variable named account with the space value:

    charges
     coffee $2.12
     soda $1.21
     cupcake $2.50
You could access the individual elements of this object like you would a hash table:

     account.get('charges soda')
     // Returns $1.21
 
Or like an array:

     account.get('charges').get(1)
     // Returns $1.21