vvvv / VL-Language

The official repo for the design of the VL programming language
31 stars 0 forks source link

[Quest] Field Setters and Getters, object graphs, This node, Readability #19

Closed gregsn closed 1 year ago

gregsn commented 4 years ago

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

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:

Still: we have two issues here:

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: image

operating on This.zip related: https://discourse.vvvv.org/t/this-pin/18127