hierarchy-builder icon indicating copy to clipboard operation
hierarchy-builder copied to clipboard

Feature request: adding target to HB.instance

Open CohenCyril opened this issue 1 year ago • 4 comments

If we add a directive to HB.instance in order to specify exacly which structures (and super-structures) are meant to be instanciated, we gain in stability, and error messages become more accurate (e.g. when one wants to instanciate a structure and nothing happens, they get an error message). The only problem, @Tragicus mentionned, is the case of mixins which are not enough to instanciate a full structure: we should come up with a way to deal with that.

CohenCyril avatar Oct 02 '24 08:10 CohenCyril

@Tragicus do you have examples in mind for such mixins?

CohenCyril avatar Oct 02 '24 08:10 CohenCyril

Not off the top of my head, but there is a trivial solution, which is giving an empty list of structures to the directive.

Tragicus avatar Oct 02 '24 09:10 Tragicus

Like this?

#[ensures(eqType,foobarType)]
HB.instance Definition _ : fooMixin subject := ...

gares avatar Oct 02 '24 10:10 gares

  • ensures(A) means A and super-structures have been instantiated, but maybe more, errors if A is not instantiated
  • exactly(A) means A and super-structures have been instantiated, but nothing more, errors if A is not instantiated.

CohenCyril avatar Dec 11 '24 12:12 CohenCyril