First time here? Check out the FAQ!
x

Can SSC shed some light on the doNotTrigger CapyTalk message?

0 votes
178 views
I noticed in the Global Controllers prototypes, 3D random walk.

((!TimeConstant s tick randomWalkStartingFrom: !Position.x doNotTrigger stepSize: !StepSize reset: !ctrlByHand) smooth: !TimeConstant s) abs

 

How does doNoTrigger message behave?

Thanks
asked Nov 8, 2016 in Capytalk & Smalltalk by cristian-vogel (Master) (8,410 points)

1 Answer

0 votes

A Capytalk expression is evaluated each time any of its EventValues changes.  In this expression, there's a circularity, because the expression is generating one of its own EventValue arguments, !Position.x.

randomWalkStartingFrom: !Position.x doNotTrigger

Having the doNotTrigger after !Position.x prevents the expression from being re-evaluated each time it changes !Position.x. 

answered Nov 8, 2016 by ssc (Savant) (126,620 points)
...