ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

WIP Introduce apply() getters for JSON data.

Open sgebbie opened this issue 4 years ago • 4 comments

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

sgebbie avatar Nov 17 '21 13:11 sgebbie

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)

jasoncarr0 avatar Nov 21 '21 17:11 jasoncarr0

@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?

SeanTAllen avatar Jan 30 '22 18:01 SeanTAllen

@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?

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.

sgebbie avatar Jan 30 '22 18:01 sgebbie

Previous notes that motivated this change on Zulip: https://ponylang.zulipchat.com/#narrow/stream/189985-beginner-help/topic/json.20iso

ergl avatar Feb 01 '22 19:02 ergl

We've moved the json library out of stdlib, closing this.

SeanTAllen avatar Jan 29 '24 02:01 SeanTAllen