× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The base support for serialization, binary/BASE64 and text, will use native
formats to represent an RpgMap exactly with its nuances.
Serializing a map and then reading it back again effectively makes a deep
copy.

An external format such as JSON should be a separate project. There could
also be support for other formats such as XML and CSV.

Support for JSON or XML also means dependencies on libraries yajl and expat.
The implementation should therefore be modular so one can choose which
formats should be supported.

Each external format would have a set of rules associated with it that
determine how an RpgMap is serialized and deserialized for that particular
format.

An RpgMap can have "attributes" which are just a set of names/values.
This is specifically meant to be used by (external) software to store
settings/metadata related to a map.
For example to support JSON one attribute would denote "pretty print", etc.


On Tue, Jul 25, 2017 at 5:23 PM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

On Tue, Jul 25, 2017 at 8:47 AM, jacobus erps <jacobus.erps@xxxxxxxxx>
wrote:
The textual representation will look a lot like JSON.

You say "a lot like JSON". In what ways will it not be *exactly* JSON?

The reason I ask is that there is a lot of value to being able to
generate standard JSON, and import directly from standard JSON.

Granted, there may be some information loss in terms of specific data
types. But I strongly recommend that a subset of valid RpgMap
instances be EXACTLY serializable as JSON, such that they can make a
round trip to JSON and back to RpgMap with 100% fidelity.

Then a broader subset of RpgMap instances should still be serializable
into standard JSON but with type loss (for example, your RpgMap may
contain declared 20-digit integers, but as long as their values fit in
10 digits, it should be acceptable that in the round trip, they come
back as 10-digit integers).

Hopefully, you can import *any* valid JSON into an RpgMap. Obviously
you'll have to have rules for type conversions, but this would be a
killer feature. It would go a long way toward popularizing your
library as well as making RPG a friendlier language for JSON
processing.

I understand you'll want to be able to serialize any RpgMap perfectly.
This could either be with custom extensions to JSON (which would only
be readable by your library, but would handle the RpgMap instances
that don't serialize into standard JSON), or a completely separate
format. (You could perhaps draw inspiration from Python's pickle
format, for example, as well as the way Python handles JSON.)

Forgive me if you've already thought of all those things. If so, then
just consider it advance positive feedback. :)

John Y.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.