我的学习材料中这个非常简单的Prolog示例给出了“操作员预期”错误:
greet(alice):-
write(‘How are you doin, pal?’).
greet(bob):-
write(‘Awfully nice to see you!’).
我错过了什么?
答案 0 :(得分:3)
与评论中提到的@larsman一样,将’
和‘
替换为'
:
greet(alice):-
write('How are you doin, pal?').
greet(bob):-
write('Awfully nice to see you!').