arrayencode

Richard Gaskin ambassador at fourthworld.com
Wed Jun 22 10:09:09 EDT 2022


Martin Koob wrote:

 > Hi Richard
 >
 > Thanks for the explanation. I think it is a helpful term or
 > distinction to have.  I think it would be good to actually have
 > that term with a formal  definition published by LiveCode or
 > the community with references to BSON so it will show up in
 > web  searches for either term to lead people to LiveCode.  Maybe
 > a start would be to introduce it in the forums.

I've been using the term for years whenever I discuss LC encoded arrays. 
A few others have as well, tho not many. If LC Ltd finds it useful for 
orienting newcomers to LC they could include it in the Dictionary's 
glossary, and perhaps sprinkle use of it in places where "LSON" can 
serve as a shorthand for "encoded associative array".


 > Just a question though how is what you define as LSON different
 > from JSON.  Is it a different way of serializing LiveCode native
 > arrays?

LSON is the LC-engine-native way to serialize LC arrays.

JSON is the JavaScript-engine-native way to serialize JS objects.

BSON is the MongoDB-engine-native way to serialize document objects.

They're similar only in that each is purpose-built for its respective 
scripting engine. LSON is to LC what JSON is to JavaScript.

But they're structurally very different, as different as LC associative 
arrays are from JavaScript's objects.


 > Is there a way that LiveCode developers can have access to it directly
 > through LCB or is it accessible in the realm of the engine only.

I haven't yet had occasion to use LC Builder in production, so I'm not 
sure if that language also offers some form of LC Script's 
arrayEncode/arrayDecode. Given how central arrays are to working in LC 
I'd be surprised if LCB doesn't include support for array serialization.

-- 
  Richard Gaskin
  Fourth World Systems



More information about the use-livecode mailing list