Skip to content
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

read_term/3 option variable_names/1 doesn't returns pairs in left-to-right traversal order #23

Open
pmoura opened this issue May 27, 2020 · 0 comments
Labels

Comments

@pmoura
Copy link

pmoura commented May 27, 2020

The read_term/3 option variable_names/1 doesn't returns pairs in left-to-right traversal order as required by the ISO standard. For details, see e.g.

http://www.complang.tuwien.ac.at/ulrich/iso-prolog/WDCor3

Example to reproduce the compliance bug:

?- current_input(S), read_term(S, T, [variables(L), variable_names(Variables)]).
|: circle(_Id_, _Radius_, _Color_).

L = [_B,_A,_C],
S = user_input,
T = circle(_B,_A,_C),
Variables = ['_Color_'=_C,'_Id_'=_B,'_Radius_'=_A] ? 

yes

It should be:

Variables = [_Id_'=_B,'_Radius_'=_A,'_Color_'=_C,] ? 

This notably breaks Logtalk's parametric object examples.

@pmoura pmoura changed the title read_:ter read_term/3 option variable_names/1 doesn't returns pairs in left-to-right traversal order May 27, 2020
@jfmc jfmc added the iso label May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants