What's the meaning of Prolog operator '->'

前端 未结 2 1654
借酒劲吻你
借酒劲吻你 2020-12-22 07:42

I have noticed the use of the operator -> in some Prolog programs, but its meaning is unknown to me. This is an example of its use:

swish_add_user(User, Pass         


        
2条回答
  •  粉色の甜心
    2020-12-22 08:13

    It is the if/then/else in Prolog, for example

    ( X mod 2 =:= 0
    -> writeln(even)
    ;  writeln(odd)).
    

提交回复
热议问题