4 ms·
First-order functions maybe? The following function has an obvious visual representation as a processing block: int add(int a, int b); But how do you rep
by Ace17 6y ago
First-order functions maybe?
The following function has an obvious visual representation as a processing block:
int add(int a, int b);
But how do you represent a function allowing other functions in its signature, e.g:
void transformInPlace(int* input, int (*func)(int));
- adrianN 6y agoThe same way the processor does. The function argument becomes a pointer you jump to when you want to call the function.
- negentropicdev 6y agoIn LabVIEW I wire in a reference to a VI that provides the functionality or I use a design similar to the command pattern where there's an override method and I specify the class instance as the argument. Depends on the granularity of the design needed and how many different classes I want to define (usually not that many).