From 223b668fe1cb2eecbe9f7a18e2070c4ea0ab8d65 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 25 Sep 2021 13:21:07 -0400 Subject: cli: play: Extract default modules to %default-modules variable. --- chickadee/cli/play.scm | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/chickadee/cli/play.scm b/chickadee/cli/play.scm index 2b61e90..7bbdb35 100644 --- a/chickadee/cli/play.scm +++ b/chickadee/cli/play.scm @@ -30,7 +30,8 @@ #:use-module (system repl debug) #:use-module (system repl coop-server) #:use-module (system repl server) - #:export (chickadee-play)) + #:export (chickadee-play + %default-modules)) (define (display-help-and-exit) (format #t "Usage: chickadee play [OPTIONS] FILE~% @@ -98,24 +99,27 @@ Play the game defined in FILE.~%") (update-hz . 60) (repl . #f))) +(define %default-modules + '((chickadee) + (chickadee audio) + (chickadee graphics color) + (chickadee graphics engine) + (chickadee graphics font) + (chickadee graphics texture) + (chickadee math) + (chickadee math matrix) + (chickadee math rect) + (chickadee math vector) + (chickadee scripting))) + (define (make-user-module) (let ((module (resolve-module '(chickadee-user) #f))) (beautify-user-module! module) + ;; Automatically load commonly used modules for + ;; maximum convenience. (for-each (lambda (name) (module-use! module (resolve-interface name))) - ;; Automatically load commonly used modules for - ;; maximum convenience. - '((chickadee) - (chickadee audio) - (chickadee graphics color) - (chickadee graphics engine) - (chickadee graphics font) - (chickadee graphics texture) - (chickadee math) - (chickadee math matrix) - (chickadee math rect) - (chickadee math vector) - (chickadee scripting))) + %default-modules) (module-define! module 'quit-game (lambda () (abort-game))) module)) -- cgit v1.2.3