I have tested the unadwisable project structure. In below the class domain
someObj::classDomain is not visible when the code of interface and class is placed in different packages:
Code: Select all
%%%%%%
% This code is in package someInterface
interface someObj
domains
objDomain = unsigned.
end interface someObj
% End of code in package someInterface
%%%%%%
%---
%%%%%%
% That code is in package someClass
class someObj : someObj
domains
classDomain = unsigned.
end class someObj
implement someObj
end implement someObj
% End of code in package someClass
%%%%%%
%===
implement main
class predicates
takeObjDomain : (someObj::objDomain).
clauses
takeObjDomain(_).
class predicates
takeClassDomain : (someObj::classDomain). %gives unknown domain/interface 'someObj::classDomain'
clauses
takeClassDomain(_).
clauses
run() :-
takeObjDomain(1),
takeClassDomain(2).
end implement main
But the above compiles when doing it the adwisable way, placing the code of
someObj in a single package.
An alternative idea, to deal with the problem, would be, to let the compiler always see the class level domains, but to prevent creating the unadwisable project structure in the IDE. Of course that is a naive suggestion, because I do not know about all the complex internal details of compiler and IDE.