2012-05-24 39 views
0

我对Prolog和XPCE循环菜单有问题。prolog xpce动态列表

这里是我的代码:

list:- 
new(D,dialog('List')), 
send_list(D,append, 
[ 
new(Von,menu(von,cycle)), 
new(Zu,menu(zu,cycle)), 
new(Ok,button('OK')) 
]), 
send_list(Von, append, findall(X,city(X),Y)), 
send_list(Zu, append, findall(X,city(X),Y)), 
send(D,open). 

city(berlin). 
city(london). 
city(paris). 
city(rom). 

我的问题是,他能使用的findAll项。

ERROR: findall: Unknown class 

但是,如果你单独使用它,findall会顺利的。

回答

0

序言不是一种功能语言。

findall(X,city(X),Y), 
send_list(Von, append, Y), 

应该工作

+0

THX帮了我这么多。保存了我的一天 –