Discussions related to Visual Prolog
dominique f pannier
Active Member
Posts: 40 Joined: 23 Sep 2002 23:01
Post
by dominique f pannier » 24 Sep 2014 13:10
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
Thomas Linder Puls
VIP Member
Posts: 1467 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 24 Sep 2014 18:56
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
Post
by dominique f pannier » 24 Sep 2014 19:08
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
Post
by dominique f pannier » 25 Sep 2014 8:46
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"],
Regards
Dominique Pannier
Thomas Linder Puls
VIP Member
Posts: 1467 Joined: 28 Feb 2000 0:01
Post
by Thomas Linder Puls » 25 Sep 2014 10:16
Thank you. We have now reproduced the problem. It will be corrected in the next build.
Regards Thomas Linder Puls
PDC