users-prolog
[Top][All Lists]
Advanced

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

Settings etc. (Re: consult/1 overrides dynamic predicate declarations?)


From: Timo Karjalainen
Subject: Settings etc. (Re: consult/1 overrides dynamic predicate declarations?)
Date: Sat, 26 Oct 2002 18:29:22 +0300 (EEST)

On Sat, 26 Oct 2002, Erick Alphonse wrote:

> 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).

> 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). Anyway, shouldn't be too complex to
implement "manually".


-- 
Timo Karjalainen             "I don't have a life.
                              I have a program."
                                   - Star Trek: Voyager






reply via email to

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