-
Notifications
You must be signed in to change notification settings - Fork 19
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
Disable anchor/alias completely #3
Comments
As I guess you've found, it's possible to disable anchors for scalers (in fact it's the default - the "YACYAMLKeyedArchiverOptionAllowScalarAnchors" flag turns on anchor emission for scalars). With arbitrary objects, the problem is that the emitter would infinite-loop if there were any cycles in the object graph, emitting an infinite amount of increasingly nested data as it keeps following the cycle infinitely. If your concern is the cost of all the hashing and potential comparisons (to find out if every emitted object is equal to an already emitted one), you can turn on "YACYAMLKeyedArchiverOptionDontUseObjectEquality" and then the emitter will only emit anchors for objects that are the /same/ object as one seen before (i.e. at the same address in memory), rather than if they're 'isEqual:'-equal to an object that's been seen before. Having said all that, if you have a real need for this, I would not be opposed to a "YACYAMLKeyedArchiverOptionDontEmitAnchors" option (with the caveat that it might infinite loop and produce endless output if used incorrectly, as mentioned above). |
Thanks a lot for your rapidly and nicely written feedback. My concern is applications: Applying anchor/alias on these data will sacrifice the overall readability On Thursday, February 7, 2013, James Montgomerie wrote:
No, I will not fix your computer! |
YACYAML is amazing YAML parser/omitter for Objective-C! The only concern I have now is the automatic Anchor/Alias mechanism. In some of my cases I want to completely disable this feature, any chance?
The text was updated successfully, but these errors were encountered: