| 1 |
;; SRFI-145 r6rs implemntation |
| 2 |
;; |
| 3 |
;; Copyright (C) Marc Nieper-Wißkirchen (2016). All Rights Reserved. |
| 4 |
;; |
| 5 |
;; Slight modifications by Andy Keep. This uses the SRFI-0 cond-expand and |
| 6 |
;; SRFI-23 error in place of the R7RS versions from the SRFI sample |
| 7 |
;; implementation. |
| 8 |
|
| 9 |
(library (srfi :145 assumptions) |
| 10 |
(export assume) |
| 11 |
(import (except (rnrs) error) (srfi :0) (srfi :23)) |
| 12 |
|
| 13 |
(define-syntax assume |
| 14 |
(syntax-rules () |
| 15 |
[(_ expression message ...) |
| 16 |
(cond-expand |
| 17 |
[debug |
| 18 |
(unless expression |
| 19 |
(error "invalid assumption" 'expression message ...))] |
| 20 |
[else (if #f #f)])]))) |
| 21 |
|