Can blocks using unevaluated variables be nested?

Further to a forum topic on passing a variable by reference I'm wondering if blocks using unevaluated variables can be nested. Let me present an example showing what I mean.

First, a custom block using an unevaluated variable ("Any (unevaluated)", to be precise):
Programming tools DEVLAB script pic (11)

It works like you would expect, the variable itself is updated:
Programming tools DEVLAB script pic (12)

Now suppose a similar custom block (I'm calling it a wrapper) is going to outsource the actual work to another custom block that also takes an unevaluated variable as input:
Programming tools DEVLAB script pic (13)

This however does not work as (at least I) expected (or hoped for :smirk:):
Programming tools DEVLAB script pic (15)

I must be doing something wrong.

I tried several variations, involving RUN, CALL, grey rings, e.g.:
Programming tools DEVLAB script pic (16)

... but nothing worked:
Programming tools DEVLAB script pic (17)

Does anyone know how (or if) a wrapper like this can at all be implemented in Snap! ?

Kind of working
untitled script pic - 2023-09-07T021547.493


with hand-crafted ref unwinding :wink:
untitled script pic - 2023-09-07T021543.449


More generic ref unwinding (flattening)
untitled script pic - 2023-09-07T023307.955
used as

untitled script pic - 2023-09-07T023508.603

Nice approach. FLATTEN REF should be considered a serious candidate for a library, I think (I’m not sure which library though).

There is a serious issue. Unwinding goes too far...
untitled script pic (19)

There is no hidden magic in the treatment of the unevaluated params.
So the simplest form is explicitly passing the actual variable reference untitled script pic (20) by value (applicative order).
untitled script pic (21)