-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
In #35 a syntax to merge sequences was proposed, but the syntax isn't going to happen, while I can understand that it would be useful to have a standard way of doing this.
There are plans to add programmatic features in YAML 1.3, as @ingydotnet mentioned, but they simply don't exist yet.
The question is, can we come up with something simple, that doesn't introduce new syntax?
Here are some suggestions:
- @ingydotnet 's suggestion was:
array1: &my_array_alias
- foo
- bar
array2:
- <: *my_array_alias
- baz
- My alternative suggestion would be:
array1: &my_array_alias
- foo
- bar
array2:
- <<
- *my_array_alias
- baz
This approach would be very close to the merge key feature; also when thinking about the implementation (because I have just implemented this in my YAML processor).
- Another variant would be almost equal to @ingydotnet's suggestion:
array1: &my_array_alias
- foo
- bar
array2:
- <<: *my_array_alias
- baz
I can't think of a reason not to use the same << as for merge keys.
creatorKoo, ext, kimyvgy, adamnoll, stormmore and 121 moreyvele
Metadata
Metadata
Assignees
Labels
No labels