Logical Operators


We didn’t define any local operators such as and and or in our language. This might be a good thing to add in later. For now we can use arithmetic operators to emulate them. Think about how these functions work when encountering 0 or 1 for their various inputs.

  1. ; Logical Functions
  2. (fun {not x} {- 1 x})
  3. (fun {or x y} {+ x y})
  4. (fun {and x y} {* x y})