-
Notifications
You must be signed in to change notification settings - Fork 37
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
Special key <<
not being honoured
#86
Comments
Yes, this Meanwhile, if it's possible for you to use a module with a not yet stable API, you could try out YAML::PP::LibYAML which is a subclass of YAML::PP, and use the merge key feature like that: YAML::PP::Schema::Merge |
Thanks, I didn't know about this alternative module :) I'm sure it will be fine to use for those cases when I particularly need that behaviour 👍 |
I see that this has been sitting around for a few years; is there any chance that an effort to do this will get revived? |
I wouldn't expect anyone to work on this in the near future. I have many other tasks, and there is the mentioned YAML::PP::LibYAML alternative. |
The
<<
key in a YAML hash means merge.http://yaml.org/refcard.html
This does not happen.
Reproducible example
Expected output
Observe that the only way to faithfully reproduce this is to copy the keys from the first mapping (but referencing the original values would be fine). I have only referenced the one that was already a ref since this seems like the most likely behaviour.
(I believe the
fix
syntax is justData::Dump
's way of preparing a structure to be self-referent. I borrowed it from the actual output below.)Actual output
Observe that what actually happens is
<<
is just a ref to the original thing. This strategy works for all keys except<<
, which needs to be handled specially.The text was updated successfully, but these errors were encountered: