Advanced patchers nowadays do it already. The This node in 2020.2 will make it even easier: Building object graphs that allows an object to call an instance operation on itself. To be clear: This is not an issue that stems from the This node only.
The issue
When calling an operation on yourself, you might want to
Write a field before you do so
Read it back inside that operation that you call on yourself
In there write another field
Read it after the call returns to your calling "patch".
VL currently doesn't support writing a field setter before calling another node: #18
Apparently the field setter will always be executed right before leaving the patch (after everything else).
The story that we need to tell the user
If you want to make sure that a field gets written before calling the operation, you'd do the following:
Create a Setter operation (like SetMyField (Internal))
Call that setter
You now can pipe the state returned by This to the SetMyField node and then further to the operation call and by that order the calls properly. It even looks like a nice way of expression, as this suddenly looks totally standard (Compare that to weird execution order constructs between setters and node calls)
Still: we have two issues here:
We force the user to add new nodes (which might be acceptable, since we have Internal)
And a bigger one:
Readability
We allow to write into a named pad (field setter) and then link out of this pad on the same moment in order to call other nodes.
This looks like the field got written before doing the +. It doesn't surface the problem yet, but it already doesn't reflect what the compiler does. We offer a way of expression that can be misleading.
Advanced patchers nowadays do it already. The
This
node in 2020.2 will make it even easier: Building object graphs that allows an object to call an instance operation on itself. To be clear: This is not an issue that stems from theThis
node only.The issue
When calling an operation on yourself, you might want to
VL currently doesn't support writing a field setter before calling another node: #18 Apparently the field setter will always be executed right before leaving the patch (after everything else).
The story that we need to tell the user
If you want to make sure that a field gets written before calling the operation, you'd do the following:
SetMyField (Internal)
)This
to theSetMyField
node and then further to the operation call and by that order the calls properly. It even looks like a nice way of expression, as this suddenly looks totally standard (Compare that to weird execution order constructs between setters and node calls)Still: we have two issues here:
Internal
)Readability
We allow to write into a named pad (field setter) and then link out of this pad on the same moment in order to call other nodes.
This looks like the field got written before doing the
+
. It doesn't surface the problem yet, but it already doesn't reflect what the compiler does. We offer a way of expression that can be misleading.This patch surfaces the problem:
operating on This.zip related: https://discourse.vvvv.org/t/this-pin/18127