JSON Envy: Serialization Dialect in Rebol?

When I wrote this "how would you do JSON in Rebol", it was a kind of devil's advocacy...pointing out how to go about it with just blocks and quoted blocks... and, uh, maybe groups?

Looking back at it a couple of years later, it reads like an advertisement for FENCE!. Those ideas suck, and Rebol shouldn't fail this hard in comparison with the notation it inspired.

We need to introduce the {...} array type. Under evaluation it would create an object, but in dialects (such as a JSON analogue like the above) it would often be used for key/value representations. However, as a fully general array type, it's up to you what to use {...} for in your own dialects.

This gives JSON's inspiration a chance to actually be better than JSON.

{glossary: {
    title: "example glossary"
    GlossDiv: {
        title: "S"
        GlossList: {
            GlossEntry: {
                ID: "SGML"
                SortAs: "SGML"
                GlossTerm: "Standard Generalized Markup Language"
                Acronym: "SGML"
                Abbrev: "ISO 8879:1986"
                GlossDef: {
                    para: "A meta-markup language..."
                    GlossSeeAlso: ["GML" "XML"]
                }
                GlossSee: "markup"
            }
        }
    }
}}
1 Like