users-prolog
[Top][All Lists]
Advanced

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

Re: Settings etc. (Re: consult/1 overrides dynamic predicate declaration


From: Erick Alphonse
Subject: Re: Settings etc. (Re: consult/1 overrides dynamic predicate declarations?)
Date: Mon, 28 Oct 2002 22:20:46 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

Hi,

Anyway, my user-supplied file is less and less readable and declarative.
I thought about asking the user to set things this way:
:- set(beamsize,5).


I would go for just a simple
set(beamsize,5).

OK. but I would like the user to be able to enter/modify the settings from the top-level too, hence the call in the setting file.

Does someone have a solution for using a nice setting file (the user can
do whatever he wants in this file, in addition of providing some setting
values)?


Why not write a simple loop in your program, reading terms from the file?
That's how I implement data files. For simple facts, you just assertz()
the term you get from the file.

If you want to allow user-defined predicates or something, you may have to
inspect the term more closely before acting on it (if read() understands
the :- at all, I don't know).

yes, it does. but I don't know how to handle directive predicates. The best would be to just do consult/1.

Timo, you should better do like me, like that we'd be two to be bothered :-).

Cheers,
Erick.





reply via email to

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