In yaml, keys appear on the left of a colon and values on the right. Values are generally strings or numbers. However the value of the letter e is supposed to be of type string, but its reproducibly an atom. I would like to determine if the issue is with the way swi-pl is built or whether this is peculiar to yaml’s handling of “e”? Have others experienced this anomoly?
Test cases:
Two separate test files containing yaml to demonstrate the issue with “e”
a.yaml
storage:
- name: a
- name: e
b.yaml
storage:
device1: a
device2: e
device3: f
Issue
?- yaml_read("a.yaml",D).
D = yaml{storage:[yaml{name:"a"}, yaml{name:e}]}.
?- yaml_read("b.yaml",D).
D = yaml{storage:yaml{device1:"a", device2:e, device3:"f"}}.
This is produced on FreeBSD 12.4Stable with swi-pl 8.4.3 and 9.0.4 (built with clang 13); HardenedBSD 13.2S swi-pl 8.4.3 (clang 14).
Workaround
Within the actual project for devices using the MBR scheme, I’m using
( atom(Slice.name) -> atom_string(Slice.name,SliceName) ; SliceName=Slice.name )
I’m hoping that I don’t have to apply the atom test to all input, and that “e” is, for some reason, an anomoly. Unfortunately changing the locale to either default LANG=‘’ or LANG=en_AU.UTF-8, the result is unchanged.