Difference between revisions of "NR.c"
From Organic Design wiki
m |
m |
||
| Line 1: | Line 1: | ||
| + | // nodeReduce function from [[[[peerd.c]]]] / [[[[nodeSpace.c]]]] | ||
// Moves "this" to current loop item if exists then rotates loop and executes or reduces the item | // Moves "this" to current loop item if exists then rotates loop and executes or reduces the item | ||
void nodeReduce() { | void nodeReduce() { | ||
| − | if (this = nodeGetValue(loop = nodeTraverse(this,nodeLOOP),0)) { // this | + | if (this = nodeGetValue(loop = nodeTraverse(this,nodeLOOP),0)) { // Move "this" to current loop item |
nodeSetValue(loop,0,nodeGetValue(this,nodeNEXT)); // Rotate loop | nodeSetValue(loop,0,nodeGetValue(this,nodeNEXT)); // Rotate loop | ||
| − | nodeGetValue(this,nodeCODE)?((code*)*nodeState(this,0))():nodeReduce(); // | + | nodeGetValue(this,nodeCODE)?((code*)*nodeState(this,0))():nodeReduce(); // Execute or reduce item |
} | } | ||
} | } | ||
Revision as of 02:05, 4 November 2006
// nodeReduce function from [[peerd.c]] / [[nodeSpace.c]] // Moves "this" to current loop item if exists then rotates loop and executes or reduces the item void nodeReduce() { if (this = nodeGetValue(loop = nodeTraverse(this,nodeLOOP),0)) { // Move "this" to current loop item nodeSetValue(loop,0,nodeGetValue(this,nodeNEXT)); // Rotate loop nodeGetValue(this,nodeCODE)?((code*)*nodeState(this,0))():nodeReduce(); // Execute or reduce item } }



