Skip to content
Discussion options

You must be logged in to vote

Unfortunately, no.

Persistent's set method takes a key and a value. The key can be any string, and there are no syntactic constraints. Using a dot-notated key like "parent.child.sub" introduces implicit structure that breaks the flat key-value intuition of Persistent.

Furthermore, if this behavior were implemented in a certain way, the game would need to handle more complex behavior when returning and assigning values ​​to child items. For example, what happens when parent.child is null and parent.child.sub is set to a value? Should null be discarded dangerously, or should an error be thrown when it shouldn't exist?

Alternatively, Callback-based set expects a valid previous value. If the …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@fsharpn00b
Comment options

Answer selected by fsharpn00b
Comment options

You must be logged in to vote
1 reply
@fsharpn00b
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants