The loop body can be written like this: while {$x > 1} { set product [expr $product * $x] incr x -1 } Example 1–14 shows factorial again, this time using a recursive definition. A recursive function is one that calls itself to complete its work. Each recursive call decrements x...
sprite pos$id$sdata($id.px)$sdata($id.py) # if there is any movement, save the direction for possible shooting if{$horiz||$vert}{ setsdata($id.gx)$vx setsdata($id.gy)$vy } # and if a shot is fired .. if{[lindex$io20]}{ # and the trigger hasn't been held down if{!
However, although Tcl's event loop can replace the need for threads in many circumstances, there are still some instances where threads can be a better solution: • Long-running calculations or other processing, which can "starve" the event loop • Interaction with external libraries or ...
*/ Tcl_Obj *user_data; /* Application-specific data reference; Tk * will decrement the reference count *once* * when it has finished processing the * event. */ } XVirtualEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server. */ Bool send...