users-prolog
[Top][All Lists]
Advanced

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

consult/1 overrides dynamic predicate declarations?


From: Erick Alphonse
Subject: consult/1 overrides dynamic predicate declarations?
Date: Sun, 20 Oct 2002 15:21:18 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

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.

Here an example:

GNU Prolog 1.2.14
By Daniel Diaz
Copyright (C) 1999-2002 Daniel Diaz
| ?- [user].
compiling user for byte code...
:- dynamic(a/0).

user compiled, 2 lines read - 166 bytes written, 10276 ms

yes
| ?- predicate_property(a/0,P).

P = dynamic ?

yes
| ?- consult(bk). % contains just the fact a.
compiling /home/alphonse/tmp/bk.pl for byte code...
/home/alphonse/tmp/bk.pl compiled, 1 lines read - 236 bytes written, 26 ms
warning: /home/alphonse/tmp/bk.pl:1: redefining procedure a/0
         user:1: previous definition

yes
| ?- a.

yes
| ?- predicate_property(a/0,P).

P = static ?

yes
| ?-

Thanks for claryfing that to me,
Regards,
Erick.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]