1

I'm a begginer in Mozart-Oz, and I seek help because this language is not very intuitive, and lacks documentation.

I'm trying to apply this code (which works on eclipse when i write it in java) and doesn't work in oz, here are the details:

This is the code in Oz, it displays True (which is not logical since if A is true and B is false, A And B should be false)

declare
A=true
B=false
C=A And B
{Browse C}

This the code in Java, which displays False (It is the logical answer)

public static void main(String[] args) {
    boolean A=true;
    boolean B=false;
    boolean C=A && B;
    System.out.println(C);

}
Kyle Spencer
  • 323
  • 1
  • 8
user3078046
  • 31
  • 1
  • 7

1 Answers1

1

Solved it, apparently you have to treat And as a function not an operator. By using this syntax

{And true false} it will return false.

user3078046
  • 31
  • 1
  • 7
  • 1
    There is also an Operator: `andthen`. The semantics are slightly different. `andthen` does not evaluate its second argument if the first is False. – wmeyer Mar 31 '14 at 14:46