diff --git a/syndicate/examples/ircd/channel.rkt b/syndicate/examples/ircd/channel.rkt index 54c05d6..5471a15 100644 --- a/syndicate/examples/ircd/channel.rkt +++ b/syndicate/examples/ircd/channel.rkt @@ -7,8 +7,12 @@ (spawn #:name 'channel-factory (stop-when-reloaded) - (during/spawn (ircd-channel-member $Ch _) - #:name `(ircd-channel ,Ch) + + (during (ircd-channel-member $Ch _) + (assert (ircd-channel Ch))) + + (during/spawn (ircd-channel $Ch) + #:name (ircd-channel Ch) (field [topic #f]) (assert (ircd-channel-topic Ch (topic))) diff --git a/syndicate/examples/ircd/config.rkt b/syndicate/examples/ircd/config.rkt index fe8ef19..5bd09b7 100644 --- a/syndicate/examples/ircd/config.rkt +++ b/syndicate/examples/ircd/config.rkt @@ -18,6 +18,9 @@ (during (config 'ircd `(port ,$port)) (assert (ircd-listener port))) + (during (config 'ircd `(channel ,$Ch)) + (assert (ircd-channel Ch))) + (define/query-set motds (config 'ircd `(motd ,$text)) text) (assert (ircd-motd (append* (map (lambda (t) (string-split t "\n")) diff --git a/syndicate/examples/ircd/ircd-config.rktd b/syndicate/examples/ircd/ircd-config.rktd index c506483..239a759 100644 --- a/syndicate/examples/ircd/ircd-config.rktd +++ b/syndicate/examples/ircd/ircd-config.rktd @@ -1,2 +1,3 @@ (port 6667) (motd "Hello, world!") +(channel "#syndicate") diff --git a/syndicate/examples/ircd/protocol.rkt b/syndicate/examples/ircd/protocol.rkt index 81498d7..4ce19f4 100644 --- a/syndicate/examples/ircd/protocol.rkt +++ b/syndicate/examples/ircd/protocol.rkt @@ -4,6 +4,7 @@ (struct-out ircd-motd) (struct-out ircd-connection-info) + (struct-out ircd-channel) (struct-out ircd-channel-member) (struct-out ircd-channel-topic) @@ -14,15 +15,16 @@ ;; A Connection is a TcpAddress -(struct ircd-listener (port) #:prefab) ;; assertion -(struct ircd-motd (lines) #:prefab) ;; assertion +(assertion-struct ircd-listener (port)) +(assertion-struct ircd-motd (lines)) -(struct ircd-connection-info (conn nick user) #:prefab) ;;assertion -(struct ircd-channel-member (channel conn) #:prefab) ;; assertion -(struct ircd-channel-topic (channel topic) #:prefab) ;; assertion +(assertion-struct ircd-connection-info (conn nick user)) +(assertion-struct ircd-channel (channel)) +(assertion-struct ircd-channel-member (channel conn)) +(assertion-struct ircd-channel-topic (channel topic)) -(struct ircd-action (conn message) #:prefab) ;; message -(struct ircd-event (conn message) #:prefab) ;; message +(message-struct ircd-action (conn message)) +(message-struct ircd-event (conn message)) ;;---------------------------------------------------------------------------