+(define (gm-init-rooms gm rooms-spec)
+ "Initialize the prebuilt rooms"
+ ;; @@: Would it be nicer to just allow passing in
+ ;; #:exits to the room spec itself?
+ (define (exit-from-spec exit-spec)
+ "Take room exits syntax from the spec, turn it into exits"
+ (match exit-spec
+ ((name to-symbol description)
+ (make <exit>
+ #:name name
+ #:to-symbol to-symbol
+ #:description description))))
+
+ (define rooms
+ (map
+ (match-lambda
+ ((room-symbol room-class
+ room-args ...
+ (room-exits ...))
+
+ ;; initialize the room
+ (apply create-actor* gm room-class "room"
+ #:gm (actor-id gm)
+ #:exits (map exit-from-spec room-exits)
+ room-args)))
+ rooms-spec))
+
+ ;; now wire up all the exits
+ (for-each
+ (lambda (room)
+ (format #t "Wiring up ~s...\n" (address->string room))
+ (<-wait gm room 'wire-exits!))
+ rooms))
+
+