Re: deJSONKit - serialization as JSON from E

Tyler Close <[email protected]>
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
On Fri, May 22, 2009 at 4:02 AM, Kevin Reid <[email protected]> wrote:
>
> On May 22, 2009, at 0:40, Tyler Close wrote:
>
>> On Mon, May 18, 2009 at 7:40 AM, Kevin Reid <[email protected]> wrote:
>>> (Hm, though you don't AFAIK have any syntax for cycles?
>>
>> I avoid representing cycles directly in JSON by snipping the JSON tree
>> at the promises. Where a promise appears, I output an "@" element in
>> its place. Client code can then  reconstruct the cycle. For example,
>>
>> resource at: <./#s=1234>:
>>
>> {
>>    "name" : "I am recursive",
>>    "self": { "@" : "./#s=1234" }
>> }
>
> Right, but there's no syntax to bind (define) #s=1234 within the JSON.

The fragment is not making a deep reference into the JSON text; it's
referring to the resource as a whole. Perhaps the following example
will be clearer:

resource at: <http://example.com/foo.json>:

{
   "name" : "I am recursive",
   "self": { "@" : "http://example.com/foo.json" }
}

Which a client can reconstruct into a JSON container having 2 members:
one with a text string value and another with a reference to the JSON
container.

--Tyler

-- 
"Waterken News: Capability security on the Web"
http://waterken.sourceforge.net/recent.html
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.