Difference between revisions of "NR.c"
From Organic Design wiki
m |
m |
||
| Line 1: | Line 1: | ||
| − | // Moves "this" to | + | // Moves "this" to node's [[[[focus]]]] if exists then rotates [[[[loop]]]] and executes/reduces the focus item |
void nodeReduce() { | void nodeReduce() { | ||
| − | if (this = | + | if (this = listGetValue(loop = this)) { // Move "this" to the [[[[focus]]]] in the node's [[[[current loop]]]] |
| − | + | listSetValue(loop,nodeGetValue(this,nodeNEXT)); // Rotate the loop | |
| − | + | code *ptr = *nodeState(this,nodeCODE); // [[[[nodeCODE]]]] value is a pointer-index | |
| + | ptr ? ptr() : nodeReduce(); // Execute ptr if non-NULL, else [[[[reduce]]]] item | ||
} | } | ||
} | } | ||
Revision as of 23:28, 8 November 2006
// Moves "this" to node's [[focus]] if exists then rotates [[loop]] and executes/reduces the focus item void nodeReduce() { if (this = listGetValue(loop = this)) { // Move "this" to the [[focus]] in the node's [[current loop]] listSetValue(loop,nodeGetValue(this,nodeNEXT)); // Rotate the loop code *ptr = *nodeState(this,nodeCODE); // [[nodeCODE]] value is a pointer-index ptr ? ptr() : nodeReduce(); // Execute ptr if non-NULL, else [[reduce]] item } }



