I don't know if it has the best name (suggestions?), but it's kind of interesting...
>> x: 304
== 304
>> steal x: 1000 + 20
== 304
>> x
== 1020
I wrote it as a variadic function for some reason (as a test, maybe?) but you could write it in Redbol. You could even use their lame ALSO.
steal: func [
{Red version}
'var [set-word! set-path!]
value [any-type!]
][
also get var set var value
]
The Ren-C version of that reads a lot better:
steal: lambda [
{Ren-C version}
'var [set-word! set-path!]
value [any-value!]
][
get var
elide set var value
]
It naturally has the benefit of letting you break things across lines. I feel like it's better to point out "this is the thing being erased". And of course the mechanic is far more general.
I definitely like ANY-VALUE! better than ANY-TYPE!.
Anyway, I'm sure I've seen places I could have used it if I thought of it. I'll keep my eyes open.