Go to the first, previous, next, last section, table of contents.


Using classes from the CIAO toplevel shell

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.

Usage and interface (dynclasses)

Documentation on exports (dynclasses)

PREDICATE: use_class/1:

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)

Known bugs and planned improvements (dynclasses)


Go to the first, previous, next, last section, table of contents.