[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what's wrong ?



In article <1994Oct25.152749.24245@sophia.inria.fr>, prieur@smart.irit.fr (Pascal PRIEUR) writes:

|> error is like this one :
|> Error: err-vtp-protocol: type error in _g2286 =.. [1, _g2272, _g2276, _g2280] 
|> Warning: ** MM-error : : Timeout occurred 
|> 
|> 
|> here they are my prolog functions :
|> plasmafunc$add1('$Plasma$litteralint'(A),'$Plasma$litteralint'(B)) :- 
|> 			$lispfun_atom(addition,[A],B).
|> 
|> plasmafunc$choisir_valeur('$Plasma$litteralint'(X),'$Plasma$litteralint'(Y)):- 
|> 				$lispfun_atom(tirerausort,[X],Y).


Arguments to $lispfun_atom (or $lispfun_tree) must be atoms or trees. Use
integer_atom(Int,Atom) to convert integers to atoms (works in both direction).

plasmafunc$add1('$Plasma$litteralint'(A),'$Plasma$litteralint'(B)) :- 
			integer_atom(A,A1),
			$lispfun_atom(addition,[A1],B).

Notice that the result is constructed un prolog using the "read" predicate.
So, if the result of your function is 12, it will be read as an integer.
If you want a prolog atom (i.e. a Typol string) you may need to put "'"
around it as in '12'.

Thierry

-- 
Send contributions and compliments to centaur@sophia.inria.fr. Registration
and administrative matters should be sent to centaur-request@sophia.inria.fr.
+---------------------------------------------------------------------------+
|     Thierry Despeyroux      | email: Thierry.Despeyroux@sophia.inria.fr   |
| I.N.R.I.A. Sophia-Antipolis | phone: +33 93 65 77 07 fax: +33 93 65 77 66 |
+---------------------------------------------------------------------------+