-
-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: add an option to deserialize ndJson array to set (or another collection) #806
Comments
I just made an implementation of a method
It's possible to imagine another way to do it by using some annotations in Json, for example: {"__set":[1,2,3]} Maybe my request doesn't match with the guidelines of this module. I need some advice. |
If you need to differentiate between sets and sequences (functions), JSON may not be the best option. Instead, consider using other formats like EDN. Preliminary support for EDN can be found at https://github.com/pfeodrippe/tla-edn by @pfeodrippe. |
Thanks, Markus o/ @lbinria If you need anything, we can talk, try also https://github.com/pfeodrippe/tladeps (check the Usage section), it shows you exactly how to use the TLA+ @lemmy I guess I will think about something that allows using tladeps in VSCode (as a separate plugin or by opening a PR against the VSCode TLA+ extension (not necessarily only for tladeps, but maybe something more generic as tladeps has the option of returning just the necessary classpath, letting the TLC CLI untouched)), wdyt? |
@pfeodrippe, does your EDN module have any unique features that require dependency on tladeps? It would be ideal if you could contribute your EDN module to the CommunityModules, where it can live alongside other modules like the Json one. |
@lemmy One of the reasons for tladeps existence is not having to add things to the CommunityModules at all (a module just needs to be on maven or clojars to be used like a normal Java library, so things get more decentralized), also the Edn module relies on Clojure being available, which I wouldn’t find reasonable to add to CommuntyModules. tladeps can be used with the classpath option so it can be integrated with the TLC CLI without wrapping TLC. Does it make sense? |
The TLA+ CommunityModules serve not only as a distribution channel, but also as a review platform by the community. When a module is considered ready, it may graduate to be included in TLC, TLAPS, and Apalache (?). For example, the JSON module has already graduated from the CommunityModules to TLC (tlaplus/CommunityModules#84). |
Got it, but l I guess we don’t need to follow this pattern for every module, people should be able to lazily download (and distribute) any modules they want (it doesn’t need to be built-in), this is what tladeps minimally provides (without having to reinvent a new package manager as we are able to leverage deps.edn tooling). Do you think we could also have a more decentralized version of the modules? Or it’s not desired by the community? And tladeps is only one tool, it’s not the way of doing it, just one way. WDYT? |
@lemmy Thanks for your answer, it make sense. |
Is it possible to add an option to
ndDeserialize
function to choose if we want to deserialize json array as sequence, set, or another type of collection ?The text was updated successfully, but these errors were encountered: