« Return to Thread: List and Yap Read Buffer in C code

List and Yap Read Buffer in C code

by Ingo Thon-2 :: Rate this Message:

Reply to Author | View in Thread

Hi,

I have a samll problem with YAP_ReadBuffer in cases where the string
to parse contains a list.
Take the follwing code
chrs = ":(dpose(cons(*(pose(a),0.15),cons(*(pose(b),0.15),[]))),:(nil,
3))";


  YAP_Term err;//=new YAP_Term;
   YAP_Term parsed = YAP_ReadBuffer(chrs,&err);
   //  __IDENT__;
   if( YAP_Unify(parsed,YAP_ARG2)){
  ....


In c++ the corresponding argument is afterwards unified with
dpose(cons(pose(a)*0.15,cons(pose(b)*0.15,[])):nil:3

if I now do something like
dpose(cons(pose(a)*0.15,cons(pose(b)*0.15,[])):nil:3 = dpose(L):_:_ ,


I get  TYPE ERROR-  .... : expected list, got cons(....


Do I really have to reconstruct the list manually?

Cheers Ingo


---------------------------------------------------
Ingo Thon <ingo.thon@...>
Dept. of Computer Science
Katholieke Universiteit Leuven
Phone: +32 16 32 7823
skype: ingo_thon
---------------------------------------------------



------------------------------------------------------------------------------
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users

 « Return to Thread: List and Yap Read Buffer in C code