First time here? Check out the FAQ!

Can SSC shed some light on the doNotTrigger CapyTalk message?

0 votes
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?

asked Nov 8, 2016 in Capytalk & Smalltalk by cristian-vogel (Master) (8,370 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) (121,880 points)