-Last updated on: December 30, 2001
+Last updated on: February 9, 2002
diff --git a/Logtalk/manuals/userman/installing.html b/Logtalk/manuals/userman/installing.html
index 10f6e968a..75f7cce00 100644
--- a/Logtalk/manuals/userman/installing.html
+++ b/Logtalk/manuals/userman/installing.html
@@ -201,10 +201,10 @@ Both predicates expect a list of entity names (atoms) as an argument. The Logtal
If you have more than a few source files then you may want to use a loader utility file containing the calls to the logtalk_load/1 predicate (see the description above). Consulting or compiling the loader file will then compile and load all your Logtalk entities into memory.
-
-The logtalk_load/1 and logtalk_compile/1 always use the set of default compiler options specified in the Logtalk configuration files. Although the default options cover the usual cases, you may want to use a different set of options while compiling or loading some of your Logtalk source files. This can be accomplished by using the logtalk_load/2 or the logtalk_compile/2 built-in predicates. These two predicates accept a list of options affecting how a Logtalk source file is compiled and loaded:
+The logtalk_load/1 and logtalk_compile/1 always use the set of default compiler option flags specified in the Logtalk configuration files. Although the default options cover the usual cases, you may want to use a different set of options while compiling or loading some of your Logtalk source files. This can be accomplished by using the logtalk_load/2 or the logtalk_compile/2 built-in predicates. These two predicates accept a list of options affecting how a Logtalk source file is compiled and loaded:
| ?- logtalk_compile(Files, Options).
@@ -262,12 +262,28 @@ You can use the following options:
Controls the use of the initialization/1 directive in the Logtalk generated Prolog code. Possible option values are true (if the Prolog compiler supports the ISO definition of the directive) and false (if the Prolog compiler either does not implement the directive or if the implementation does not conform to the ISO standard).
+
+We may also change the default options values from the ones loaded from the config file by using the set_logtalk_flag/2 built-in predicate. For example:
+
+ | ?- set_logtalk_flag(xml, off).
+
+
+
+The current values of the default flags can be enumerated using the current_logtalk_flag/2 built-in predicate:
+
+
+ | ?- current_logtalk_flag(xml, Value).
+
+ Value = off
+ yes
+
-Last updated on: December 30, 2001
+Last updated on: February 9, 2002
diff --git a/Logtalk/xml/NOTES b/Logtalk/xml/NOTES
index fc242216b..1d7634b2e 100644
--- a/Logtalk/xml/NOTES
+++ b/Logtalk/xml/NOTES
@@ -1,25 +1,29 @@
=================================================================
Logtalk - Object oriented extension to Prolog
-Release 2.9.2
+Release 2.9.3
Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved.
=================================================================
This folder contains several files that enables .xml documentation files
-created when compiling objects, categories, or protocols, to be viewed
-in a web browser that supports the W3C standards XML, XSLT, CSS and HTML 4
-or to be converted to LateX for printing.
+created when compiling objects, categories, or protocols, to be converted
+to PDF files, to be viewed in a web browser that supports the W3C standards
+XML, XSLT, CSS and HTML 4, or to be converted to LateX for printing.
You will need to either copy your .xml files to this directory or copy
-these files to the directory where the .xml files reside. The links to
-the .xsl files on the .xml files and the links to the .css files in the
-generated .html files assume that all files reside in the same directory.
+these files to the directory where the .xml files reside.
+
+Regarding conversion to HTML, the links to the .xsl files on the .xml
+files and the links to the .css files in the generated .html files assume
+that all files reside in the same directory.
The choice of the default .xsl file to use is made in the config files by
the lgt_default_compiler_option/2 predicate. You can also choose a different
.xsl file by using the xsl/1 compiler option in the logtalk_compile/2 or
logtalk_load/2 calls. The default file is lgtxml.xsl (described below).
+Brief description of each file in this folder:
+
lgthtml.xsl
@@ -37,6 +41,13 @@ lgtxml.xsl
HTML files point to related XML files.
+lgtpdfa4.xsl lgtpdfus.xsl
+
+ XSLT files to generate PDF files from the .xml files (formatted either
+ for A4 paper or US Letter paper) using XSL Formatting Objects. Tested
+ with Apache Fop processor (http://xml.apache.org/fop).
+
+
texml.xsl
XSLT file to output TeXML files that can be further processed by
@@ -47,9 +58,10 @@ texml.xsl
ie5.xsl
XSLT file for viewing .xml files in Microsoft Internet Explorer 5.x
- (works with both Macintosh and Windows versions). The links in the
- (internally generated) HTML files point to related XML files. It can
- be used to browse and view the XML files directly.
+ (using the outdated Microsoft XML Parser; works with both Macintosh
+ and Windows versions). The links in the (internally generated) HTML
+ files point to related XML files. It can be used to browse and view
+ the XML files directly.
logtalk.dtd
@@ -70,18 +82,36 @@ logtalk.css
in a web browser.
-script.sh
+html.sh
- Sample unix shell script to batch convert .xml files to .html files.
- Edit the file to match your environment.
+ Sample Unix shell script to batch convert .xml files to .html files.
+ Edit the script to match your environment before running it.
+ Requires James Clarck XT processor (http://www.jclark.com/xml/xt.html).
-script.bat
+html.bat
- Sample dos batch script to convert .xml files to .html files.
- Edit the file to match your environment.
+ Sample DOS batch script to convert .xml files to .html files.
+ Edit the script to match your environment before running it.
+ Requires James Clarck XT processor (http://www.jclark.com/xml/xt.html).
+
+
+pdf.sh
+
+ Sample Unix shell script to batch convert .xml files to .pdf files.
+ Edit the script to match your environment and paper format preference
+ before running it.
+ Requires Apache FOP processor (http://xml.apache.org/fop).
+
+
+pdf.bat
+
+ Sample DOS batch script to convert .xml files to .pdf files.
+ Edit the script to match your environment and paper format preference
+ before running it.
+ Requires Apache FOP processor (http://xml.apache.org/fop).
Note that you can write other XSLT files for converting the XML files to
-other formats besides HTML or LaTeX. You can also write alternative CSS
-and XSLT files to change the appearance of the HTML and LaTeX files.
+other formats besides PDF, HTML, or LaTeX. You can also write alternative
+CSS and XSLT files to change the appearance of the HTML and LaTeX files.
diff --git a/Logtalk/xml/ie50.xsl b/Logtalk/xml/ie50.xsl
index d76f26a6f..a9c569aa1 100644
--- a/Logtalk/xml/ie50.xsl
+++ b/Logtalk/xml/ie50.xsl
@@ -8,7 +8,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Logtalk - Object oriented extension to Prolog
-% Release 2.9.2
+% Release 2.9.3
%
% Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved.
%
diff --git a/Logtalk/xml/lgthtml.xsl b/Logtalk/xml/lgthtml.xsl
index f15878cf1..834b021b2 100644
--- a/Logtalk/xml/lgthtml.xsl
+++ b/Logtalk/xml/lgthtml.xsl
@@ -14,7 +14,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Logtalk - Object oriented extension to Prolog
-% Release 2.9.2
+% Release 2.9.3
%
% Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved.
%
diff --git a/Logtalk/xml/lgtxml.xsl b/Logtalk/xml/lgtxml.xsl
index 12a584b37..0c1179704 100644
--- a/Logtalk/xml/lgtxml.xsl
+++ b/Logtalk/xml/lgtxml.xsl
@@ -14,7 +14,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Logtalk - Object oriented extension to Prolog
-% Release 2.9.2
+% Release 2.9.3
%
% Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved.
%
diff --git a/Logtalk/xml/logtalk.dtd b/Logtalk/xml/logtalk.dtd
index edb05e50f..ca48a795e 100644
--- a/Logtalk/xml/logtalk.dtd
+++ b/Logtalk/xml/logtalk.dtd
@@ -3,7 +3,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Logtalk - Object oriented extension to Prolog
-% Release 2.9.2
+% Release 2.9.3
%
% Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved.
%
diff --git a/Logtalk/xml/logtalk.xsd b/Logtalk/xml/logtalk.xsd
index d8fc980ff..21a44c077 100644
--- a/Logtalk/xml/logtalk.xsd
+++ b/Logtalk/xml/logtalk.xsd
@@ -15,7 +15,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Logtalk - Object oriented extension to Prolog
-% Release 2.9.2
+% Release 2.9.3
%
% Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved.
%
diff --git a/Logtalk/xml/texml.xsl b/Logtalk/xml/texml.xsl
index b603365a5..3c775d65f 100644
--- a/Logtalk/xml/texml.xsl
+++ b/Logtalk/xml/texml.xsl
@@ -12,7 +12,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Logtalk - Object oriented extension to Prolog
-% Release 2.9.2
+% Release 2.9.3
%
% Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved.
%
diff --git a/library/logtalk/logtalk.pl b/library/logtalk/logtalk.pl
index 4b61d0880..8d770aa42 100644
--- a/library/logtalk/logtalk.pl
+++ b/library/logtalk/logtalk.pl
@@ -2,7 +2,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Logtalk - Object oriented extension to Prolog
-% Release 2.9.2
+% Release 2.9.3
%
% Copyright (c) 1998-2002 Paulo Moura. All Rights Reserved.
%
@@ -121,6 +121,7 @@
:- dynamic(lgt_calls_pred_/1). % lgt_calls_pred_(Functor/Arity)
:- dynamic(lgt_current_compiler_option_/2). % lgt_current_compiler_option_(Option, Value)
+:- dynamic(lgt_flag_/2). % lgt_flag_(Option, Value)
:- dynamic(lgt_referenced_object_/1). % lgt_referenced_object_(Object)
:- dynamic(lgt_referenced_protocol_/1). % lgt_referenced_protocol_(Protocol)
@@ -839,10 +840,17 @@ abolish_events(after, Obj, Msg, Sender, Monitor) :-
% gets/check the current value of a compiler option
lgt_compiler_option(Option, Value) :-
- lgt_current_compiler_option_(Option, Value2) ->
- Value = Value2
- ;
- lgt_default_compiler_option(Option, Value).
+ lgt_current_compiler_option_(Option, Value2),
+ !,
+ Value = Value2.
+
+lgt_compiler_option(Option, Value) :-
+ lgt_flag_(Option, Value2),
+ !,
+ Value = Value2.
+
+lgt_compiler_option(Option, Value) :-
+ lgt_default_flag(Option, Value).
@@ -1009,7 +1017,66 @@ logtalk_version(Major, Minor, Patch) :-
\+ integer(Patch),
throw(error(type_error(integer, Patch), logtalk_version(Major, Minor, Patch))).
-logtalk_version(2, 9, 2).
+logtalk_version(2, 9, 3).
+
+
+
+% set_logtalk_flag(+atom, +nonvar)
+%
+% sets a Logtalk flag
+
+set_logtalk_flag(Flag, Value) :-
+ var(Flag),
+ throw(error(instantiation_error, set_logtalk_flag(Flag, Value))).
+
+set_logtalk_flag(Flag, Value) :-
+ var(Value),
+ throw(error(instantiation_error, set_logtalk_flag(Flag, Value))).
+
+set_logtalk_flag(Flag, Value) :-
+ nonvar(Flag),
+ \+ atom(Flag),
+ throw(error(type_error(atom, Flag), set_logtalk_flag(Flag, Value))).
+
+set_logtalk_flag(Flag, Value) :-
+ atom(Flag),
+ \+ lgt_valid_flag(Flag),
+ throw(error(domain_error(valid_flag, Flag), set_logtalk_flag(Flag, Value))).
+
+set_logtalk_flag(Flag, Value) :-
+ \+ lgt_valid_flag(Flag, Value),
+ throw(error(domain_error(valid_flag_value, Value), set_logtalk_flag(Flag, Value))).
+
+set_logtalk_flag(Flag, Value) :-
+ lgt_read_only_flag(Flag),
+ throw(error(domain_error(read_only_flag, Flag), set_logtalk_flag(Flag, Value))).
+
+set_logtalk_flag(Flag, Value) :-
+ retractall(lgt_flag_(Flag, _)),
+ assertz(lgt_flag_(Flag, Value)).
+
+
+
+% current_logtalk_flag(?atom, ?nonvar)
+%
+% tests/gets Logtalk flags
+
+current_logtalk_flag(Flag, Value) :-
+ nonvar(Flag),
+ \+ atom(Flag),
+ throw(error(type_error(atom, Flag), current_logtalk_flag(Flag, Value))).
+
+current_logtalk_flag(Flag, Value) :-
+ atom(Flag),
+ \+ lgt_valid_flag(Flag),
+ throw(error(domain_error(valid_flag, Flag), current_logtalk_flag(Flag, Value))).
+
+current_logtalk_flag(Flag, Value) :-
+ lgt_flag_(Flag, Value).
+
+current_logtalk_flag(Flag, Value) :-
+ \+ lgt_flag_(Flag, _),
+ lgt_default_flag(Flag, Value).
@@ -2065,6 +2132,7 @@ lgt_dump_all :-
listing(lgt_defs_pred_/1),
listing(lgt_calls_pred_/1),
listing(lgt_current_compiler_option_/2),
+ listing(lgt_flag_/2),
listing(lgt_referenced_object_/1),
listing(lgt_referenced_protocol_/1),
listing(lgt_referenced_category_/1).
@@ -5049,6 +5117,43 @@ lgt_valid_compiler_option(report(Option)) :-
+% lgt_valid_flag(@nonvar)
+%
+% true if the argument is a valid Logtalk flag
+
+lgt_valid_flag(iso_initialization_dir).
+lgt_valid_flag(xml).
+lgt_valid_flag(xsl).
+lgt_valid_flag(unknown).
+lgt_valid_flag(singletons).
+lgt_valid_flag(misspelt).
+lgt_valid_flag(lgtredef).
+lgt_valid_flag(plredef).
+lgt_valid_flag(portability).
+lgt_valid_flag(report).
+
+
+
+% lgt_valid_flag(@term, @term)
+%
+% true if the argument is a valid Logtalk flag-value pair
+
+lgt_valid_flag(Flag, Value) :-
+ atom(Flag),
+ Option =.. [Flag, Value],
+ lgt_valid_compiler_option(Option).
+
+
+
+% lgt_read_only_flag(@nonvar)
+%
+% true if the argument is a read only Logtalk flag
+
+lgt_read_only_flag(_) :-
+ fail.
+
+
+
% Logtalk built-in predicates
%
% lgt_lgt_built_in(?callable)
@@ -5486,6 +5591,8 @@ lgt_write_xml_close_tag(Stream, Tag) :-
%
% table of ISO defined predicates
%
+% used in portability checking
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/library/logtalk/yap430.config b/library/logtalk/yap430.config
index 162fac0e2..a4f70adda 100644
--- a/library/logtalk/yap430.config
+++ b/library/logtalk/yap430.config
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Logtalk - Object oriented extension to Prolog
-% Release 2.9.2
+% Release 2.9.3
%
% configuration file for YAP Prolog 4.3.x
%
@@ -164,28 +164,28 @@ lgt_file_extension(xml, '.xml').
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% default compiler options
+% default flag values
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% lgt_default_compiler_option(?atom, ?atom)
+% lgt_default_flag(?atom, ?atom)
%
-% default values for all compiler options
+% default values for all flags
-lgt_default_compiler_option(iso_initialization_dir, true).
+lgt_default_flag(iso_initialization_dir, true).
-lgt_default_compiler_option(xml, on).
-lgt_default_compiler_option(xsl, 'lgtxml.xsl').
+lgt_default_flag(xml, on).
+lgt_default_flag(xsl, 'lgtxml.xsl').
-lgt_default_compiler_option(unknown, warning).
-lgt_default_compiler_option(misspelt, warning).
-lgt_default_compiler_option(singletons, warning).
-lgt_default_compiler_option(lgtredef, warning).
-lgt_default_compiler_option(plredef, silent).
-lgt_default_compiler_option(portability, silent).
+lgt_default_flag(unknown, warning).
+lgt_default_flag(misspelt, warning).
+lgt_default_flag(singletons, warning).
+lgt_default_flag(lgtredef, warning).
+lgt_default_flag(plredef, silent).
+lgt_default_flag(portability, silent).
-lgt_default_compiler_option(report, on).
+lgt_default_flag(report, on).