Using Settings

Anne Ogborn <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
I never seem to get this right

What's the idiomatic way to use settings?

For example, I'm just starting a new project (called 'crane'). Like usual, I have a debug.pl that
starts the system up in debug mode. 

:- module(debug, []).

I then define a setting

:- setting(crane_debug_port, positive_integer, 14000, 'Port to run the Crane Game on in debug mode.').

In debug mode I want pldoc available, so I let the doc server be the server.

:- setting(crane_debug_port, Port), doc_server(Port).

Oops - 

>ERROR: c:/docs/jondorbolo/quickygame/crane/crane/prolog/debug.pl:62:
        setting `debug:crane_debug_port' does not exist
Warning: c:/docs/jondorbolo/quickygame/crane/crane/prolog/debug.pl:62:
        Goal (directive) failed: debug: (setting(crane_debug_port,_G130),doc_server(_G130))

changing all occurrences of crane_debug_port to crane:crane_debug_port   fixes it.

OK, but I'm still not clear what the canonical way to do this is.

First, if I was using, rather than writing, this code, and wanted debug to run on 16000,
instead of 14000, I'd add a setting to program files\swipl\customize\pl.ini  ?

But no, apparently it's to 



Installation:

Unix/MacOS:~/.plrc
Windows:<appdata>/pl.ini (see win_folder(appdata, AppData))



which would be set_setting?

I'm baffled.
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.