Difference between revisions of "NR.c"

From Organic Design wiki
(tidy up)
(fix HL)
 
Line 1: Line 1:
<c>// Moves "this" to node's focus if exists then rotates loop and executes/reduces the focus item
+
<source lang="c">
 +
// Moves "this" to node's focus if exists then rotates loop and executes/reduces the focus item
 
void nodeReduce() {
 
void nodeReduce() {
 
     if(this = nodeLoopRotate(parent = this)) {        // Move "this" to the focus in the node's loop and rotate
 
     if(this = nodeLoopRotate(parent = this)) {        // Move "this" to the focus in the node's loop and rotate
Line 5: Line 6:
 
         if(code = *nodeState(this, nodeCODE)) code(); // nodeCODE value is a pointer-index, execute as function-reference if non-zero
 
         if(code = *nodeState(this, nodeCODE)) code(); // nodeCODE value is a pointer-index, execute as function-reference if non-zero
 
     }
 
     }
}</c>
+
}</source>

Latest revision as of 00:32, 26 May 2016

// Moves "this" to node's focus if exists then rotates loop and executes/reduces the focus item
void nodeReduce() {
    if(this = nodeLoopRotate(parent = this)) {        // Move "this" to the focus in the node's loop and rotate
        nodeSetValue(this, nodePARENT, parent);       // Update the parent association
        if(code = *nodeState(this, nodeCODE)) code(); // nodeCODE value is a pointer-index, execute as function-reference if non-zero
    }
}