Page 1 of 1

[explicitTag] attribute in vpiDomains

Posted: 20 Jul 2015 8:38
by Peter Muraya
Hi,
I encounter this attribute explicitTag quite often in class vpiDomains and I don't see any documentation referring to it. Here is an example of where it is used.

Code: Select all

domains     menu =         resMenu(resid Resid);         dynMenu(menuItem* SubMenu);         noMenu [explicitTag].
What is it telling the compiler?

Posted: 23 Jul 2015 18:58
by Thomas Linder Puls
The representation of compound domains (with more than one alternative) have changed binary representation to a more optimal representation.

However certain domains are also used in external C/C++ based library code and to avoid rewriting this code these particular domains continue to use the old representation. The explicitTag attribute instructs the compiler to use the old representation.

We have not documented this externally, because we do not externally support/guarantee a certain represen of such domains. We continue to preserve the possibility to change the binary representation of the mentioned kind of domains.

Binary serialization to files/streams have not changed. So all external behavior should be unchanged.

Posted: 24 Jul 2015 6:26
by Peter Muraya
Thanks Thomas.
I read that "this is for internal use by the the Visual Prolog compiler developers". Would it make sense to provide a means of adding new local attributes for other developers? At one time, I don't remember why I really wanted to, I wished that Prolog would allow me to add my own attribute for my local need -- and one which the compiler would ignore.