Discussions related to Visual Prolog
dominique f pannier
Active Member
Posts: 40
Joined: 23 Sep 2002 23:01

bad result of The list::remove predicate in a dll

Unread post by dominique f pannier »

Hi,
I got a problem with the list::remove predicate in a dll.
it's easy to reproduce : modify the code of dll.pro in the Visual prolog Examples as described below :

Code: Select all

implement myDll     open core, string, list clauses     touch(String) = string::concat(String, Added):-         L = checkABC(),         L1 =checkABC1(),         Added = string::format(" - % , %", toString(L), toString(L1)).     class predicates       checkABC : () -> string_list NList.     checkABC1 : () -> string_list NList. clauses     checkABC() = Liste :-         L = remove(["a", "b", "c"], "c"),         Liste = L.       checkABC1() = Liste :-         Liste = remove(["a", "b", "c"], "c").   end implement myDll  
The result is :
Hello World - ["a","b"] , ["a","b","c"]

If we run the two predicates checkABC and checkABC1 in a console or a GUI project, the result is right :
["a","b"] in the two cases.

:?:
Regards
Dominique Pannier
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

I cannot reproduce the problem (with Vip 7.5), which version do you use?
Regards Thomas Linder Puls
PDC
dominique f pannier
Active Member
Posts: 40
Joined: 23 Sep 2002 23:01

Unread post by dominique f pannier »

I'm using VIP 7.5 on Windows 8.1
I get the same result on my two computers, desktop and laptop.
Regards
Dominique Pannier
dominique f pannier
Active Member
Posts: 40
Joined: 23 Sep 2002 23:01

Unread post by dominique f pannier »

Hi,
instead of using the list::remove predicate, I built it in the class.
If I use the predicate declared with the generic term Elem*, I get the bad result : ["a","b"], (["a","b","c"]
If I use the predicate declared with the defined term string*, I get the right result : ["a","b"], ["a","b"],
:roll:
Regards
Dominique Pannier
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Thank you. We have now reproduced the problem. It will be corrected in the next build.
Regards Thomas Linder Puls
PDC
Post Reply