質問

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);

}
役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top