这个非常简单的Prolog示例来自我的学习材料,给了我一个"Operator Expected"错误:
greet(alice):-
write(‘How are you doin, pal?’).
greet(bob):-
write(‘Awfully nice to see you!’).
我错过了什么
就像评论中提到的@larsman一样,用'
代替’
和‘
:
greet(alice):-
write('How are you doin, pal?').
greet(bob):-
write('Awfully nice to see you!').