Properties don't work in combination with multiple define statements
It seems like the binding rule
SomeCons(a, b, c): defines Var a of prop1 b defines Param a of prop2 c
translates to
SomeCons(a, b, c): defines Var a defines Param a of prop1 b of prop2 c
In other words, the last definition gets all the properties.
Submitted by Oskar van Rest on 30 March 2014 at 00:47
Therefore, retrieving aprop1
given the name/URI of aVar
is impossible.
Issue Log
Can you please check if this also happens with the
core-syntax
branch of NaBL?
Yes also with the
core-syntax
.Also, this is probably related:
Module(a, b, c): defines Module a scopes Class defines Module2 b
translates to
Module(a, b, c): defines Module a defines Module2 b scopes Class
Here again, the last definition gets all ‘scopes’. A workaround if only one of the definition sites provides scoping is to put the corresponding
defines
at the end:Module(a, b): defines Module2 b defines Module a scopes Class
Multiple
defines
where never correctly supported together withscopes
. This was one of the reasons why we introducedimplicitly defines
.The original issue is different from this. There the same
a
defines two names in different namespaces. But the property storage simply fetches a URI froma
, not taking care of any namespace. If we want to support these kinds of multiple namespace definitions, we need to have namespace-aware versions ofnabl-uri
.
You can retrieve all URIs of an annotated name using
nabl-uris
, and then filter by namespace.
ok I can probably use that as a workaround, but it would require me to do things in Stratego that I actually want to do in TS: the property is a type
Sorry, I wasn’t suggesting you to use that. It was the conclusion of a small discussion with Guido.
This needs to be fixed in the runtime libraries and in the NaBL generator. In the libraries, the callback strategy for property sites needs to take an additional namespace parameter and take this into account when retrieving the URI for the property. In the generator, the namespace needs to be passed to the new callback strategy.
Log in to post comments