Skip to content
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

Dealing with BlockClosure with JSON or STON encoding #300

Open
vitormcruz opened this issue Mar 20, 2020 · 3 comments
Open

Dealing with BlockClosure with JSON or STON encoding #300

vitormcruz opened this issue Mar 20, 2020 · 3 comments

Comments

@vitormcruz
Copy link

STON cannot convert block closure, so what must I do to deal with a object that have N instance variables where one of them is a block closure instance? How to make STON encode those kind of objects?

@jecisc
Copy link
Member

jecisc commented Mar 25, 2020

Ston import/export can be customized for an object by implementing #fromSton: and #stonOn: methods on an object. Then you can print your object the way you want. You then need a may serialize your block but that will depend on the context of your object to know how to resolve this issue.

@vitormcruz
Copy link
Author

Ok, but that is missing from the documentation.

@vitormcruz
Copy link
Author

I mean, the title of the bug is misleading, the problem I wanted to show is that the wiki page that describe JSON and STON does not describe how to customize encoding/serialization. Well, I may close this one and and open another one that states it more clearly if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants