You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with objects in a C++ function, it turns out that its quite hard to avoid boilerplate code.
I would like to make a few suggestions:
Offer wrapper types to access values in objects/arrays. Example: OS::Object obj = os->toObj(...); std::string str = obj["foo"];
Offer convenience methods to convert arrays into lists: OS::List ls = os->toList(...); std::string str = ls[0];
I am mainly asking, since I am trying to write a converter between (VarObject)[https://github.com/eJimLee/VarObject] and an OS Object.
I just can't seem to find a "good" way of doing it. So having a method provided by the internals would be very nice. Do you think this could be implemented?
Kind regards, Ingwie.
The text was updated successfully, but these errors were encountered:
Programmer have to write own utility functions to convert data between ObjectScript and C++. Note that ObjectScript supports any ObjectScript's value type as key of object property.
Any ObjectScript object has id (see getValueId, pushValuebyId, retainValueById, releaseValueById). Numbers, booleans and null have no id because they are not controlled by garbage collector.
Hey.
When working with objects in a C++ function, it turns out that its quite hard to avoid boilerplate code.
I would like to make a few suggestions:
OS::Object obj = os->toObj(...); std::string str = obj["foo"];
OS::List ls = os->toList(...); std::string str = ls[0];
I am mainly asking, since I am trying to write a converter between (VarObject)[https://github.com/eJimLee/VarObject] and an OS Object.
I just can't seem to find a "good" way of doing it. So having a method provided by the internals would be very nice. Do you think this could be implemented?
Kind regards, Ingwie.
The text was updated successfully, but these errors were encountered: