Page 1 of 1

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

Posted: 24 Sep 2014 13:10
by dominique f pannier
I got a problem with the list::remove predicate in a dll.
it's easy to reproduce : modify the code of 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.


Posted: 24 Sep 2014 18:56
by Thomas Linder Puls
I cannot reproduce the problem (with Vip 7.5), which version do you use?

Posted: 24 Sep 2014 19:08
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.

Posted: 25 Sep 2014 8:46
by dominique f pannier
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"],

Posted: 25 Sep 2014 10:16
by Thomas Linder Puls
Thank you. We have now reproduced the problem. It will be corrected in the next build.