trueagi-io / hyperon-experimental

MeTTa programming language implementation
https://metta-lang.dev
MIT License
147 stars 49 forks source link

Tweaking test in stdlib2, so it passes with new module import behavior #582

Closed luketpeterson closed 8 months ago

luketpeterson commented 8 months ago

The test stdlib2::test_variable_defined_via_variabe contains this code:

            (= (myif T $y) $y)
            (= (not F) T)
            (= (a $z) (not (b $z)))
            (= (b d) F)

            !(eval (interpret (myif (a $x) $x) %Undefined% &self))

The problem is that the not operation is imported from stdlib/corelib in the modules branch. So we get this error: (Error (not F) not expects one boolean arguments)

Would you be ok to change the test to be:

            (= (myif T $y) $y)
            (= (mynot F) T)
            (= (a $z) (mynot (b $z)))
            (= (b d) F)

            !(eval (interpret (myif (a $x) $x) %Undefined% &self))

Or do you think the not operation shouldn't be imported?

Feel free to reject this PR if I've misunderstood the purpose of the test.