Read_yaml incorrectly reads values startring with "E"?

I have a yaml file with some of values that start with “E”.
Simple example:

key: "E5410"'

reading it produces following result:

?- yaml_read("test.yaml", T).
T = yaml{key:_}.

Replacing “E” with any other letter fixes it.

Tried online yaml parser, it reads correctly.

Should I report a bug?

It doesn’t reproduce for me (MacOS installation from relocatable application bundle):

$ cat test.yaml 
key: "E5410"
$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.1.17)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- yaml_read("test.yaml", T).
T = yaml{key:"E5410"}.

You should at least include the SWI-Prolog version and OS if you report a bug. You should also report if you have a non-default configuration.

The R solution to this (since there are endless ways to configure and botch your R environment) is the command-line option --vanilla:

--vanilla
      Combine --no-save, --no-restore, --no-site-file, --no-init-file and --no-environ

I couldn’t find one single flag to do this in SWI-Prolog.

1 Like

This is (AFAIK) an old bug. Get the 9.1.17 series. Not sure whether it is patched in 9.0.4.

The version 9.1.17 indicates a hash if it is not compiled from a tagged git version and DIRTY if some file is different from the git repo. To disable extensions, use

swipl -f none --no-packs ...

The first disables your ~/.config/swi-prolog/init.pl (or the OS alternative) and the second does not attach your extension packs. This stuff was first of all added to prevent user extensions messing up building from source :slight_smile:

2 Likes