Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
139 stars 2 forks source link

Compound Operators #2995

Open BaxterOttoman opened 1 month ago

BaxterOttoman commented 1 month ago

Is your feature request related to a problem? Please describe.

Compound operators are useful for readability and compactness. The addition of compound operators (+=, -=, *=, etc) to Protoflux would allow for cleaner flux by reducing a group of several nodes down to a single operation that sits in an impulse chain.

Describe the solution you'd like

I would like to see several protoflux nodes for standard compound operations that are given a value store, a value to perform the operation with, and an impulse input. When pulsed, the node would perform the operation and write the result to the value store. It would more or less take the form of a write node, but with the argument being used to perform an operation on the value already in the store.

Describe alternatives you've considered

Taking the store, performing the operation, then writing it back.

Additional Context

No response

Requesters

No response

shiftyscales commented 1 month ago

reducing a group of several nodes down to a single operation

I might be misunderstanding your request- but this sounds like something that would be implicitly covered by #564, no?

Dusty-Sprinkles commented 1 month ago

I think nested nodes would fix it in a sense, but having purpose-built nodes like that would still be somewhat useful, I kinda see it like additional forms of the ValueIncrement (or inc? I always forget which one is which) node

PointerOffset commented 1 month ago

These are fairly common operators in other programming languages. It'd be a sensible addition.

JackTheFoxOtter commented 1 month ago

This would actually simplify a bunch of things. We already have Increment and Decrement nodes, so those would fit in pretty neatly as extensions of those.