Skip to content

Commit

Permalink
Represent atom [] as empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
bakaq committed Aug 16, 2024
1 parent 12aaae5 commit 7afc08a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/machine/parsed_results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..)
Expand Down

0 comments on commit 7afc08a

Please sign in to comment.