From: Mark Thom Date: Tue, 14 May 2019 03:37:03 +0000 (-0400) Subject: correct #68 in variable_names conformity tests X-Git-Tag: v0.8.110~59 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=e66d5c7b31c7a00a70a924297fc79d296701e216;p=scryer-prolog.git correct #68 in variable_names conformity tests --- diff --git a/Cargo.toml b/Cargo.toml index 72ea5275..cd90aa10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "scryer-prolog" -version = "0.8.83" +version = "0.8.84" authors = ["Mark Thom "] repository = "https://github.com/mthom/scryer-prolog" description = "A modern Prolog implementation written mostly in Rust." diff --git a/src/prolog/lib/builtins.pl b/src/prolog/lib/builtins.pl index 32af6703..d145deac 100644 --- a/src/prolog/lib/builtins.pl +++ b/src/prolog/lib/builtins.pl @@ -247,12 +247,15 @@ must_be_var_names_list(VarNames) :- must_be_var_names_list_([], List). must_be_var_names_list_([VarName | VarNames], List) :- - ( nonvar(VarName), VarName = (Atom = _) -> - ( atom(Atom) -> must_be_var_names_list_(VarNames, List) - ; var(Atom) -> throw(error(instantiation_error, write_term/2)) + ( nonvar(VarName) -> + ( VarName = (Atom = _) -> + ( atom(Atom) -> must_be_var_names_list_(VarNames, List) + ; var(Atom) -> throw(error(instantiation_error, write_term/2)) + ; throw(error(domain_error(write_options, variable_names(List)), write_term/2)) + ) ; throw(error(domain_error(write_options, variable_names(List)), write_term/2)) ) - ; throw(error(domain_error(write_options, variable_names(List)), write_term/2)) + ; throw(error(instantiation_error, write_term/2)) % throw(error(domain_error(write_options, variable_names(List)), write_term/2)) ). write_term(_, Options) :-