[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: consult/1 overrides dynamic predicate declarations?
From: |
Lindsey Spratt |
Subject: |
Re: consult/1 overrides dynamic predicate declarations? |
Date: |
Sun, 20 Oct 2002 10:47:06 -0500 |
On Sunday, October 20, 2002, at 08:21 AM, Erick Alphonse wrote:
Hello,
I need to read a user-supplied file, where he defines all the settings
needed to run some experiments. These settings are provided as facts
and I would like the user to be able to modify them later. So I define
them as dynamic before loading the user's file. But consult declares
them as static, overriding the dynamic declaration. Is it the intended
behaviour? Eclipse and swi-prolog don't do that.
According to the standard:
"If P is defined to be a dynamic procedure in one Prolog test, then a
directive dynamic(PI) indicating P will occur in every Prolog text
which contains clauses for P."
("Prolog: The Standard", 1996, p. 218)
So, I think gprolog is just following the standard. You need to put ':-
dynamic(P).' in each of the files that defines P.
Cheers,
Lindsey Spratt
http://homepage.mac.com/lspratt