From: bakaq Date: Fri, 16 Aug 2024 03:01:25 +0000 (-0300) Subject: Represent atom [] as empty list X-Git-Tag: v0.10.0~117^2~3 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=7afc08af473294fa9be4c49e345131a02c22994d;p=scryer-prolog.git Represent atom [] as empty list --- diff --git a/src/machine/parsed_results.rs b/src/machine/parsed_results.rs index 06a8873b..305e6a4d 100644 --- a/src/machine/parsed_results.rs +++ b/src/machine/parsed_results.rs @@ -302,7 +302,12 @@ impl Value { */ if arity == 0 { - term_stack.push(Value::Atom(name.as_str().to_string())); + let atom_name = name.as_str().to_string(); + if atom_name == "[]" { + term_stack.push(Value::List(vec![])); + } else { + term_stack.push(Value::Atom(atom_name)); + } } else { let subterms = term_stack .drain(term_stack.len() - arity ..)