is there a way to mimic nullable types like in c#. let’s say i have a hittest and save to result into a pad, but in case there isn’t any hit result, the pad has still content and isn’t null. but it would be helpful to know if there isn’t anything hence the pad is null.
You can use Nullable in VL. Nullable.HasValue() tells you if there’s a value or if it’s Null.
Cool thing is, that Nullable is recognized by the HDE, so that you can for example connect an iobox directly to a Nullable Input without having to use some boilerplate Nodes like create Nullable, etc.
Is that what you need?
If you need to specifically mimic behaviour, this is a well-done concept that is widely used internally.
If for some reason you need Nullable, it is a little harder to use in Gamma.
Nullable only allows value types. Optional allows any type. So yes, optional would be the preferred way. Nullable we support as well because it’s often used in libraries.