DebugPbind : Pbind


DebugPbind works just like Pbind, but outputs a wealth of debugging information for each .next call:


- The input event

- For each key/value pair:

- The key (name)

- The event as it has been modified thus far

- The stream value to be placed into the event

- The resulting event


Very useful for identifying Pbind execution problems, especially early termination due to a child stream returning nil unexpectedly.


(

p = DebugPbind(

\key1, Pwhite(0.0, 1.0, 2),

\key2, Pseries(15, 1, inf)

).asStream;


while { p.next(()).notNil };

)


Source event: (  )

stream ID: key1

Event going in: (  )

key1: 0.65337550640106

streamout: 0.65337550640106

stream ID: key2

Event going in: ( 'key1': 0.65337550640106 )

key2: 15

streamout: 15

Result event: ( 'key1': 0.65337550640106, 'key2': 15 )


Source event: (  )

stream ID: key1

Event going in: (  )

key1: 0.3543187379837

streamout: 0.3543187379837

stream ID: key2

Event going in: ( 'key1': 0.3543187379837 )

key2: 16

streamout: 16

Result event: ( 'key1': 0.3543187379837, 'key2': 16 )


Source event: (  )

stream ID: key1

Event going in: (  )

streamout: nil