Did you know ... | Search Documentation: |
Pack logtalk -- logtalk-3.86.0/manuals/_sources/libraries/meta_compiler.rst.txt |
.. _library_meta_compiler:
meta_compiler
This library supports implementations optimized compilation of
meta-calls for the predicates defined in the meta
library.
Open the `../../docs/library_index.html#meta-compiler <../../docs/library_index.html#meta-compiler>`__ link in a web browser.
To load the main entities in this library, load the loader.lgt
file:
::
| ?- logtalk_load(meta_compiler(loader))
.
To test this library predicates, load the tester.lgt
file:
::
| ?- logtalk_load(meta_compiler(tester))
.
If meta_compiler
is the only hook object you are using, you can set
it as the default hook object (but note that the optimizations are only
applied to entities compiled with the optimize
flag turned on):
::
| ?- set_logtalk_flag(hook, meta_compiler)
.
...
Otherwise, use the hook(meta_compiler)
and optimize(on)
complier
options when compiling and loading the code that you want to optimize.
For example:
::
| ?- logtalk_load(my_source_file, [hook(meta_compiler), optimize(on)])
.
...
See also the metapredicates_compiled
example and unit tests.
Goals in clauses containing parameter variables are currently not expanded by this library and thus not optimized.