diff options
author | David Thompson <dthompson@vistahigherlearning.com> | 2019-06-12 17:01:08 -0400 |
---|---|---|
committer | David Thompson <dthompson@vistahigherlearning.com> | 2019-06-12 17:01:08 -0400 |
commit | 9379c6520bf3c16e971eb6d8b33769854259da4e (patch) | |
tree | 9b0525606d3dc1ccbfd9c23672015f41ca08a409 | |
parent | d909f353075aa4c9ee661d356ef2f3c249449c5c (diff) |
node: Add run-script and stop-scripts methods.
-rw-r--r-- | starling/node.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/starling/node.scm b/starling/node.scm index d3dc129..b21d5c6 100644 --- a/starling/node.scm +++ b/starling/node.scm @@ -48,6 +48,8 @@ & attach-to detach + run-script + stop-scripts blink)) (define-class <node> () @@ -220,9 +222,15 @@ represented as a ratio in the range [0, 1]." ;;; -;;; Simple Script Actions +;;; Scripting ;;; +(define-syntax-rule (run-script node body ...) + (with-agenda (agenda node) (script body ...))) + +(define-method (stop-scripts node) + (with-agenda (agenda node) (clear-agenda))) + (define-method (blink (node <node>) times interval) (let ((orig (visible? node))) (let loop ((i 0)) |