ponyc
ponyc copied to clipboard
WIP Introduce apply() getters for JSON data.
This introduces a viewpoint for accessing the internal data for a JSON element: document, object, array.
This simplifies the process for modifying iso instances of JsonDoc
after prior creation.
ponylang/ponyc#3922
One general comment, regardless of whether we agree to put this in, I don't believe the ! is necesary on any of these signatures. They're already aliasable types
(and generally speaking it's rare to need ! at all even for iso because it implies creating a new stable alias to something, returning an existing alias doesn't actually do that)
@sgebbie this seems like a reasonable addition that doesn't need to go through the RFC process (@ponylang/committer's can you weigh in)?
I would also be open to an RFC detailing what the impact would be of making data private and running everything through methods that might improve the ergonomics.
However, I would like to see examples of how apply() is making some standard API actions easier to do vs what currently exists.
@sgebbie are you still interested in this change?
@sgebbie this seems like a reasonable addition that doesn't need to go through the RFC process (@ponylang/committer's can you weigh in)?
I would also be open to an RFC detailing what the impact would be of making
dataprivate and running everything through methods that might improve the ergonomics.However, I would like to see examples of how apply() is making some standard API actions easier to do vs what currently exists.
@sgebbie are you still interested in this change?
Hi @SeanTAllen, thanks for taking a look. Yes, I am still interested. I will make a note to read your comments in more detail during the upcoming week.
Previous notes that motivated this change on Zulip: https://ponylang.zulipchat.com/#narrow/stream/189985-beginner-help/topic/json.20iso
We've moved the json library out of stdlib, closing this.