/usr/lib/s9fes/when.scm is in scheme9 2010.11.13-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2010
; See the LICENSE file of the S9fES package for terms of use
;
; (unless <test-expression> <body>) ==> object
; (when <test-expression> <body>) ==> object
;
; (load-from-library "when.scm")
;
; The WHEN syntax first evaluates <test-expression>. When it evaluates
; to a true value, it also evaluates <body>, which is a sequence of
; expressions. The expressions will be evaluated in order and the value
; of the last expression will be returned. When <test-expression>
; evaluates to #f, WHEN does not evaluate its <body> and returns an
; unspecific value.
;
; UNLESS is evaluates its body only if <test-expression> eveluates to #F.
; It evaluates its <body> exactly if WHEN would not evaluate it and vice
; versa.
;
; Example: (when (= 1 1) 'foo 'bar 'baz) ==> baz
; (unless (= 1 2) 'foo 'bar 'baz) ==> baz
(define-syntax (when p . body)
`(if ,p (begin ,@body)))
(define-syntax (unless p . body)
`(if (not ,p) (begin ,@body)))
|