Subject: Using current_functor/2 and functor/3 together

From: Lionel Ains <[email-masked]>
Date: Thu, 11 May 2000 16:56:36 GMT+1

Hi all,

I'm trying to verify if a term can be called before 
giving it as the parameter of call/1.
Thus I use the following code:

ignore(
  ( functor(Action, Name, Arity),
    current_functor(Name, Arity),
    call(Action)
  )
)

When I try this code with Functor bound with an 
unexisting functor, the Prolog engine still calls it and I 
got an "Undefined procedure: " error.
If I run this code with Functor bound to abcdef,
then the Prolog engine succeeds when calling 
current_functor(abcdef) although it was failing before 
running the code. functor/3 seems to create the functor 
passed as first argument.
However, of course, listing/1 prints an error.

Could someone help me with that?

Thanks

Lionel

______________________________________________________
Boîte aux lettres - Caramail - http://www.caramail.com