Accessing supported constants and domains
Posted: 5 May 2019 14:39
Hello Thomas,
VIP's object system is sound and powerful. Its latest add-on "bounded polymorphism" is working already fine in my code.
The only issue about the object system which I think is questionable, is the difference interfaces impose on their type and scope. You have explained it in Interface synonyms.
Actually VIP is already able to do the trick of not making that difference. However it does not do the trick in all places:
In locations (a) we can refer directly to constants and domains from supported interfaces, while in (b) we cannot.
Are there reasons for the current behavior in (b), which I have not realized/understood yet?
If there is no reason which makes the current behavior necessary, please consider (again) to make code (b) work. I.e. making supported constants and domains accessible through the interface. You have announced addressing the problem in Supports Qualification for Domains. Maybe the change could nicely suit version 10?
VIP's object system is sound and powerful. Its latest add-on "bounded polymorphism" is working already fine in my code.
The only issue about the object system which I think is questionable, is the difference interfaces impose on their type and scope. You have explained it in Interface synonyms.
Actually VIP is already able to do the trick of not making that difference. However it does not do the trick in all places:
Code: Select all
interface objA
constants
const1 : unsigned = 1.
domains
dom1 = dom1(unsigned).
end interface objA
%---
interface objB supports objA
end interface objB
%---
interface objC supports objB
constants
const2 : unsigned = 2 * const1. % (a)
domains
dom2 = dom2(dom1, dom1). % (a)
end interface objC
%---
implement main
class predicates
p : (objC::dom1) [used]. % (b) -does not compile-
clauses
p(X) :-
stdIO::write(X).
clauses
run() :-
Y = objC::const1, % (b) -does not compile-
stdIO::write(Y).
end implement main
Are there reasons for the current behavior in (b), which I have not realized/understood yet?
If there is no reason which makes the current behavior necessary, please consider (again) to make code (b) work. I.e. making supported constants and domains accessible through the interface. You have announced addressing the problem in Supports Qualification for Domains. Maybe the change could nicely suit version 10?