Chunk operations such as get and put update the module's buffer status. The status is one of pending, okay, nomatch, failed, or forbidden. An example is where @do get is used to request a matching chunk, and no such match is found. In this case, the buffer is set to undefined, and the status to nomatch.
Should the buffer be cleared on such errors?
On the one hand, clearing the buffer makes sense given the failure to complete the operation. On the other hand, perhaps rules could be designed to use the previous value of the buffer before the operation was initiated.
Note that the JavaScript implementation of chunks currently doesn't implement failed or forbidden, but these would make sense for access controlled chunk graphs and for application specific actions. Rule conditions can (in principle) test the status with @status.
Chunk operations such as get and put update the module's buffer status. The status is one of pending, okay, nomatch, failed, or forbidden. An example is where
@do get
is used to request a matching chunk, and no such match is found. In this case, the buffer is set to undefined, and the status tonomatch
.On the one hand, clearing the buffer makes sense given the failure to complete the operation. On the other hand, perhaps rules could be designed to use the previous value of the buffer before the operation was initiated.
Note that the JavaScript implementation of chunks currently doesn't implement failed or forbidden, but these would make sense for access controlled chunk graphs and for application specific actions. Rule conditions can (in principle) test the status with
@status
.