source: project/misc-extn/trunk/misc-extn-symbol.scm @ 5702

Last change on this file since 5702 was 5702, checked in by Kon Lovett, 14 years ago

unbound reverted to 3.0 behavior.

File size: 667 bytes
Line 
1;;;; misc-extn-symbol.scm
2;;;; Kon Lovett, Jul '07
3
4;;; Special Values
5
6;; Unbound
7
8(define-macro (unbound-value)
9  `(##sys#slot '##sys#arbitrary-unbound-symbol 0) )
10
11(define-macro (unbound-value? VAL)
12  `(eq? (unbound-value) ,VAL) )
13
14(define-macro (unbound? SYM)
15  `(unbound-value? (##sys#slot ,SYM 0)) )
16
17(define-macro (symbol-value SYM . ARGS)
18  (let ([VAL (gensym)])
19    `(let ([,VAL (##sys#slot ,SYM 0)])
20       (if (unbound-value? ,VAL) ,(optional ARGS #f) ,VAL) ) ) )
21
22;; Undefined
23
24(define-macro (undefined-value)
25  `(void) )
26
27(define-macro (undefined-value? VAL)
28  `(eq? (undefined-value) ,VAL) )
29
30(define-macro (undefined? OBJ)
31  `(undefined-value? ,OBJ) )
Note: See TracBrowser for help on using the repository browser.