RFR: 8367531: Template Framework: use scopes and tokens instead of misbehaving immediate-return-queries [v29]
Emanuel Peter
epeter at openjdk.org
Tue Nov 18 08:16:55 UTC 2025
On Mon, 17 Nov 2025 13:53:30 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
>>> So I suppose it is a choice, yes. But I don't think the alternatives would be better.
>>>
>>> * You could just throw an exception at the second definition. But then you would need a way to check for existence of hashtag names ... not great.
>>> * You could just hide outer definitions... basically they would work like scoped values: you can bind and re-bind them. But that brings its own complexity that I don't want to push on the users if it's not absolutely necessary.
>>>
>>> If you really do need access to something from an outer template, you should just pass it via template argument. That makes the flow explicit. That's my opinion.
>>
>> Sounds OK to me, I think it would be worth capturing this rationale and advisory somewhere in the documentation.
>
>> @robcasloz Alright, I added some extra documentation of hashtag locality with [bba7152](https://github.com/openjdk/jdk/pull/27255/commits/bba71529ac081b0f53cd5106f57fb541bd3e0ead)
>
> Thanks, the new documentation looks good!
@robcasloz Thanks for all the suggestions! I applied them all :)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27255#issuecomment-3546097188
More information about the hotspot-compiler-dev
mailing list