'call'ing a variable 
Author Message
 'call'ing a variable

Hi there,

If I receive a prolog goal as a string, how can I call this goal, and
obtain a truth value ? For example :

X = "largemonkey(ape)."

I've tried using call/1, which fails saying incompatable type, and
converting this to an atom e.g.
-----------------------------------------


ECRC Common Logic Programming System [sepia {*filter*} megalog parallel]
Version 3.5.2, Copyright ECRC GmbH, Wed Jan  3 12:54 1996
[eclipse 1]: [user].
 largemonkey(ape).
 user       compiled traceable 40 bytes in 0.00 seconds
yes.
[eclipse 2]: Y = 'largemonkey(ape).', call(Y).

lists.pl   compiled traceable 7056 bytes in 0.01 seconds
calling an undefined procedure 'largemonkey(ape).' in module eclipse
[eclipse 3]: largemonkey(ape).
yes.
[eclipse 4]:

-----------------------------------------

Is there a way of finding the truth value of this goal, or should I parse
the string in a different way ?

TIA

Simon D

--
The solution to a problem changes the nature of the problem.
                -- Peer
________________________________________________________________________________
Simon Delicata          __   _

                      / /__/ / _ \/ // /\ \/ /    
                     /____/_/_//_/\_,_/ /_/\_\ .. The choice of a GNU Generation
________________________________________________________________________________



Tue, 16 Oct 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. un-'upvar'ing/un-'global'ing variables

2. 'with'ing and 'use'ing

3. FTP'ing and FAX'ing from within C4b

4. source'ing .cshrc and keeping the env variables

5. 'make'ing ghc on darwin

6. Expect: Trouble 'expect'ing linefeeds

7. Ping'ing w/o plugins

8. C5EE GOLD - GPF'ing should read C55EE Gold

9. C5EE GOLD -W2K- GPF'ing with Large Dict - MSQL

10. Why GPF'ing in CW20?

11. Changing property of Control USE'ing Array Element

12. My opinion about ' ing constants

 

 
Powered by phpBB® Forum Software