Author(s): Angel Fernandez Pineda.
Version: 1.3#120 (1999/11/26, 12:5:17 MET)
Version of last change: 1.3#21 (1999/7/7, 10:27:51 MEST)
The CIAO toplevel shell will be a usefull tool in order to compile and test O'CIAO classes. Those classes may be dynamically loaded, so some instances of them may be created to perform any needed test.
dynclasses
)?- use_package(objects).It may be usefull for you to put a
:- use_package(objects)
declaration on your .cshrc initialization file. In such case, absolutely nothing is needed to load this library.
The Emacs ciao-mode will also automatically load this library when a Load buffer command is issued (C-c l
).
dynclasses
)
This predicate is something very similar to
use_module/1
.
It will (re)compile and/or (re)load a class source file from the CIAO shell so instances of that class can be now created.
There is an implicit usage relationship between the CIAO shell and any and all loaded classes. This seems that user is allowed to create (
new/1
) and call any public predicate even when the involved class was not specifically loaded using the use_class/1 predicate.For example:
:- module(test,[example/1],[objects]). :- use_class(test_class). example(Obj) :- Obj new test_class, Obj:do_something.
Whenever this code is loaded:
?- use_module(test).
user is allowed to handle instances of test_class (and ascendants):
?- test:example(SomeObj), SomeObj:test_something.
Note that test_class was not loaded using use_class/1 predicate, but public predicate test_something/0 may be called.
Some other usefull notes:
Usage: use_class(Source)
Source
class
dynclasses
)use_module/1
), those instances may be not correctly created, and predicates will fail whenever they are not supposed to do. This may be avoided by reloading again the involved module, but make sure it is modified and saved to disk before doing so.
Go to the first, previous, next, last section, table of contents.