From 0738b6b6e70c8046827fabdb22c0460dd5e464b2 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Mon, 31 Jul 2017 11:58:13 -0500 Subject: [PATCH] Ircbot WIP. * demos/ircbot.scm (run-bot): Updated to use new 8sync-fibers semantics. --- demos/ircbot.scm | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/demos/ircbot.scm b/demos/ircbot.scm index 00c48ff..c857156 100755 --- a/demos/ircbot.scm +++ b/demos/ircbot.scm @@ -26,7 +26,8 @@ (oop goops) (srfi srfi-37) (ice-9 format) - (ice-9 match)) + (ice-9 match) + (fibers conditions)) (define-class ()) @@ -102,22 +103,22 @@ (server "irc.freenode.net") (channels '("##botchat")) (repl #f)) - (define hive (make-hive)) - (define irc-bot - (bootstrap-actor* hive "irc-bot" - #:username username - #:server server - #:channels channels)) - (define repl-manager - (cond - ((string? repl) - (bootstrap-actor* hive "repl" - #:path repl)) - (repl - (bootstrap-actor* hive "repl")))) + (run-hive + (lambda (hive) + (define irc-bot + (bootstrap-actor* hive "irc-bot" + #:username username + #:server server + #:channels channels)) + (define repl-manager + (cond + ((string? repl) + (bootstrap-actor* hive "repl" + #:path repl)) + (repl + (bootstrap-actor* hive "repl")))) - ;; TODO: load REPL - (run-hive hive '())) + (wait (make-condition))))) (define (main args) (define parsed-args (parse-args "ircbot.scm" args)) -- 2.31.1