Script Only Stack Properties
ambassador at fourthworld.com
Sat Apr 4 14:38:15 EDT 2020
Bob Sneidar wrote:
> True, but with properties, I can envision a use case for persistent
> values between sessions.
Persistence is essential in many contexts. But is it necessary that
data be bound to code?
Sometimes it is. When it is, is it necessary that the file format be text?
> This is quite separate from GUI objects.
What are objects but a type declaration followed by a set of properties?
> By saving and reloading properties of a script only stack, everything
> is still text file only based.
Encoding the array would be the simplest, fastest, and most robust
option. LSON is to LC what JSON is to JS, the most with-the-grain
serialization method for the scripting engine it was designed for.
But in one respect LSON is more akin to MondgoDB's BSON: it's more
efficient than JSON because the format is binary, requiring fewer steps
So if your circumstance requires you to be working exclusively with text
files, LSON is a non-starter.
Then you can choose among JSON, YAML, XML, ISHI, or any number of other
plain-text serialization formats.
When I need to combine code with data, I usually use stack files.
If I need data alone, I often use LSON.
If the project requires that the storage format be interoperable, then I
look at other options.
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode