Abstract and utility

Hi XODers,
i stumbled across the patch-nodes abstract and utility. I cannot see the code behind them and they are not attached to any in- or outputs.

What are these node-patches for? Where can i find documentation?

Best
Tobias

I’m not sure about “utility” but as I understand it the way “abstract” works is say you have a simple patch node called Foo with one input and one output that you want to handle a variety of types automatically. You make your Foo implementation for say a number and make the input and outputs of type Number. Then you save it with name “Foo(number)”. Then you want to be able to handle say a byte and you make an implementation for that and save it as “Foo(byte).” Then you make a patch node just called “Foo” with one abstract input and output and put the “abstract” box in there too.

Then when you use just regular “Foo” and connect something outputting a number or byte to the abstract input it will automatically select the appropriate specialization from Foo(number) or Foo(byte). Looks like you have to make your own specialization for each abstract type you want to handle which seems reasonable as the transpiler can’t intuit how exactly you want to handle each case on its own.

Yeah, @bitrex is right. The abstract marker node is a component of the generic type system.

What’s for utility it is another marker node. When you making a library that will be used by others you may want to hide some internal implementation details. Place a utility marker on the patch you want to hide by default in the project browser and search and it becomes internal for your library.

1 Like

Got it.
Thanks guys.

can you put this explanation into the help of both nodes? As it makes it easier for people to understand the nodes.

Best Tobias

Yeah, that’s a good idea. I’ve added an issue to the backlog.

1 Like