P2Block

Acts as a closure encompassing PonderTalk statements. Any variables used by the statements within the block are untouched once the block is created. Blocks may have arguments that are handed in when they are executed. When a block is executed it returns returns the value of the last statement executed within the block. c.f. function calls.

Factory Messages

Operational Messages

values: anArray

Executes the block with anArray of arguments. Answers with the result of the last statement executed by the block.

hasArgs: aHash

Returns true if aHash contains entries that match all the names of the arguments that the block requires. Otherwise returns false.

value

executes the block with no arguments. Answers with the result of the last statement executed by the block.

value: arg0

Executes the block with one argument: arg0. Answers with the result of the last statement executed by the block.

value: arg0 value: arg1

Executes the block with two arguments: arg0 and arg1. Answers with the result of the last statement executed by the block.

value: arg0 value: arg1 value: arg2

Executes the block with three arguments: arg0, arg1 and arg2. Answers with the result of the last statement executed by the block.

valueHash: hash

The block is executed with the values of its arguments being taken by name from aHash. Answers the value of the last statement executed by the block. Throws an error if aHash does not satisfy the block's arguments.