diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api.texi | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/api.texi b/doc/api.texi index 9cfa26a..446460e 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -3985,6 +3985,15 @@ Schedule @var{body} to be evaluated every @var{interval} amount of time. Repeat this @var{n} times, or indefinitely if not specified. @end deffn +It is also possible to schedule things that are not dependent on how +much time passes. The agenda will periodically poll to see if any +registered conditions are met. + +@deffn {Procedure} call-when pred thunk +Call @var{thunk} sometime in the future when @var{pred} is satisfied +(returns a value other than @code{#f}.) +@end deffn + @node Scripts @subsection Scripts @@ -4070,6 +4079,17 @@ procedure @var{handler}. Wait @var{duration} before resuming the current script. @end deffn +@deffn {Syntax} wait-until condition +Wait until @var{condition} is met before resuming the current script. + +@example +(script + (wait-until (key-pressed? 'z)) + (display "you pressed the Z key!\n")) +@end example + +@end deffn + @deffn {Syntax} forever body @dots{} Evaluate @var{body} in an endless loop. @end deffn |