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:

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

Kind of working


with hand-crafted ref unwinding :wink:


More generic ref unwinding (flattening)


used as

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...

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).