# alternative hook implementation. a hook is a word containing a list of xts # much like polywords : link-hook # create a new hook ( symbol -- ) link-buffer ['] leave 1 pack , does> head >r ; : hook read link-hook ; # ( xt hook.xt -- ) : add-hook xt>body push ; : remove-hook xt>body remove ; : bye 0 bye-exitcode ; # main callback for callback oriented code. note that this should # never block: synchronisation is solved elsewhere. defer tick : idle { } is tick ; idle defer ms-sync ' sleep is ms-sync 33.0 variable! renderperiod : tick-loop begin tick renderperiod @ ms-sync again ; # tick should never block: 1-shot only # console handlers defer console-interpret-string ' interpret-string is console-interpret-string