summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-08-15 23:12:02 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-08-15 23:12:02 -0400
commit069797dc88e3b19e8656d3f7326ef57243ea2977 (patch)
tree5b35c0b05e86286bd30b6a068fb48f4f21cfd022
parentdcec8df20ea99c07953f2a0c43cabba2580b6d70 (diff)
ui: Add leave-if-false.
* shroud/ui.scm (leave-if-false): New procedure.
-rw-r--r--shroud/ui.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/shroud/ui.scm b/shroud/ui.scm
index bbe0f2a..2fb3708 100644
--- a/shroud/ui.scm
+++ b/shroud/ui.scm
@@ -25,6 +25,7 @@
program-name
show-version-and-exit
leave
+ leave-if-false
make-user-module
load*
shroud-main))
@@ -67,6 +68,11 @@ There is NO WARRANTY, to the extent permitted by law.~%"
(newline)
(exit 1))
+(define (leave-if-false obj error . args)
+ "Display error message defined by the ERROR string and ARGS if OBJ
+is #f."
+ (or obj (apply leave error args)))
+
(define (make-user-module modules)
"Return a new user module with the additional MODULES loaded."
;; Module in which the machine description file is loaded.