]> Repositorios git - scryer-prolog.git/commitdiff
unify empty list to '' in atom_chars/2 (#1334, #1336)
authorMark Thom <[email protected]>
Wed, 9 Mar 2022 01:25:40 +0000 (18:25 -0700)
committerMark Thom <[email protected]>
Wed, 9 Mar 2022 01:25:40 +0000 (18:25 -0700)
src/machine/system_calls.rs

index 8dc8d4e8998aed63e6b901917397abe3d99eaca2..c435503dd1009655ee3d5cd8a7ac6f0a2f9c8dfe 100644 (file)
@@ -1288,7 +1288,11 @@ impl Machine {
                 if let Some(str_like) = self.machine_st.value_to_str_like(a2) {
                     let atom = match str_like {
                         AtomOrString::Atom(atom) => {
-                            atom
+                            if atom == atom!("[]") {
+                                self.machine_st.atom_tbl.build_with("")
+                            } else {
+                                atom
+                            }
                         }
                         AtomOrString::String(string) => {
                             self.machine_st.atom_tbl.build_with(&string)