Closed leonerd closed 7 months ago
Since Perl 5.36, we've been able to distinguish actual boolean values. It'd be great if YAML::XS emitted these distinctly.
Currently this gives disappointing results:
$ eachperl modversion YAML::XS perl5.36.0: 0.88 perl5.38.0: 0.88 bleadperl: 0.88 $ eachperl -MYAML::XS -E 'say YAML::XS::Dump([1, "1", builtin::true])' --- perl5.36.0 --- Built-in function 'builtin::true' is experimental at -e line 1. --- - 1 - '1' - 1 --- perl5.38.0 --- Built-in function 'builtin::true' is experimental at -e line 1. --- - 1 - '1' - 1 --- bleadperl --- --- - 1 - '1' - 1
I would love to have seen the output be:
--- - 1 - '1' - true
I couldn't work out how to run the tests from this repo, but find attached a patch against the actual YAML::XS module from CPAN, that implements core booleans. Tested on 5.36+ and also a 5.20 to demonstrate it doesn't break on older perls.
YAML::XS
gh113.txt
Since Perl 5.36, we've been able to distinguish actual boolean values. It'd be great if YAML::XS emitted these distinctly.
Currently this gives disappointing results:
I would love to have seen the output be: