From lains@caramail.com  Thu May 11 16:56:25 2000
Received: from mail.caramail.com (mail.caramail.com [195.68.99.70])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id QAA01389
	for <prolog@swi.psy.uva.nl>; Thu, 11 May 2000 16:56:25 +0200 (MET DST)
Received: from caramail.com (www19.caramail.com [195.68.99.39])
	by mail.caramail.com (8.8.8/8.8.8) with SMTP id RAA17300
	for prolog@swi.psy.uva.nl; Thu, 11 May 2000 17:00:35 +0100 (WET DST)
Posted-Date: Thu, 11 May 2000 17:00:35 +0100 (WET DST)
From: Lionel Ains <lains@caramail.com>
To: prolog@swi.psy.uva.nl
Message-ID: <958055757020723@caramail.com>
X-Mailer: Caramail - www.caramail.com
X-Originating-IP: [194.202.131.4]
Mime-Version: 1.0
Subject: Using current_functor/2 and functor/3 together
Date: Thu, 11 May 2000 16:56:36 GMT+1
Content-Type: multipart/mixed; boundary="=_NextPart_Caramail_020723958055757_ID"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--=_NextPart_Caramail_020723958055757_ID
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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=eete aux lettres - Caramail - http://www.caramail.com


--=_NextPart_Caramail_020723958055757_ID--

