-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Explanation] This node #21
Comments
Little follow up after looking into the topic of making In order to have
These changes are now available in VL >= Note that the fields will be written directly and only after
So currently we can't use the Two ideas to solve this issue
|
@azeno and I have discussed this internally in detail and I thought it would make sense to also write down the ideas as this was a rather long discussion. Ok so here is what we touched:
My intuition here was that introducing Not sure. And not sure about the order how to tackle the issue. Still, let's see which questions would need to be solved first, before being able to decide which one is the better solution: So let's assume the user calls
How is the answer to these questions connected to other quests, like the one regarding execution order #15 and the other one regarding through-pads #19? Is it possible and clever to try to get a better understanding of those issues first, before tackling these special cases? A possible way we could go:
By this, we'd have quite some issues out of the way already. The user could express manually when to write fields, so before or after a recursive call. It feels nice to have a working manual idea, that already can be used if the to be invented magic doesn't work as expected. The magic sauce could be:
|
The magic sauce is now implemented in |
There has been a discussion in the vvvv.org forums: https://discourse.vvvv.org/t/this-pin/18127
We were embracing the idea of having
This
modelled as an input pin calledInput
orState Input
with the idea that later onOutput
orState Output
might get added.We finally didn't go for that idea but implemented a
This
process node.Here is why:
Input
orState Input
would be nice, but which one is it?Input
doesn't work out of the box. You'd need to flag it somehow to make sure that the system understands that you actually want to access the incoming state.State Input
might be confusing since on application side it is just calledInput
State Output
/Output
(seen on application side)We never need to feed the State Output
Let's start with a
Record
You define an operation on your record and want to output a new snapshot. Here is what you'd do:
MyOtherOp
explicitly to an output pin. You can name that output as you like. Let's say you call the outputOutput
: you already would get exactly what was asked for. Your own definition returns a new snapshot on a pin calledOutput
. (There is no implicit state output pin, since you don't write into pads yourself)We compared this approach to other ideas where we tried to merge the changes instructed via pads and instructed via calls on yourself. But that got pretty messy resulting in a snapshot that got frozen after leaving the outer patch, but being mutable up to that point. It didn't feel like a reasonable idea to follow.
So we felt like there is no need to add some new idea to get a new snapshot outof a record instance operation. No matter whether you write the pads on your own or delegate that task to another operation...
Class
When changing fields inside a mutable data type you need to reason about what to do in what order. #19. But one way or the other: You are just mutating yourself. This is reflected on application side: the state Input and Output pins are connected.
This visually says: The output is always the same instance as the ingoing one. It would be plain weird if you'd be abe to overrule that within the operation and just write something else into the state output. Add another output pin if you want to create a new instance manually and hand that over via an explicit new pin.
So all in all. We don't need a way to write into the State Output.
What does that mean for the Input
So we had issues with the right name for that input. We could have called it
This
, but there is no pin on application side with that name...Decision
We went for a process node
This
that always outputs the incoming instance. It helps explaining how to translate C# code into a patch and feels lightweight. It is modeled as a process node as it only makes sense in stateful contextThe text was updated successfully, but these errors were encountered: