(define-module (mudsync command)
#:use-module (mudsync parser)
#:use-module (8sync actors)
+ #:use-module (8sync rmeta-slot)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:use-module (ice-9 control)
command-action
command-priority
+ build-commands
+
direct-command
prep-indir-command
prep-direct-command
(action command-action)
(priority command-priority))
+(define-syntax %build-command
+ (syntax-rules ()
+ ((_ (verb ...) ((cmd-proc action-sym args ...) ...))
+ (list (cons verb
+ (list (cmd-proc (list verb ...)
+ (quote action-sym)
+ args ...)
+ ...))
+ ...))
+ ((_ verb ((cmd-proc action-sym args ...) ...))
+ (list (cons verb
+ (list (cmd-proc (list verb)
+ (quote action-sym)
+ args ...)
+ ...))))))
+
+(define-syntax-rule (build-commands (verb-or-verbs cmd-defs ...) ...)
+ (wrap-rmeta-slot
+ (append (%build-command verb-or-verbs cmd-defs ...) ...)))
+
(define (direct-command verbs action)
(make-command verbs