059-stringq.scm (667B)
1 ; (string? x) -- #t iff x is a bytevector. scheme1 uses bytevectors as 2 ; the underlying string representation, so string? and bytevector? are 3 ; the same predicate (LISP.md:strings; we'll split if/when characters 4 ; gain a distinct repr). 5 6 (if (string? "abc") 0 (sys-exit 1)) 7 (if (string? "") 0 (sys-exit 2)) 8 (if (string? (make-bytevector 4 0)) 0 (sys-exit 3)) 9 10 (if (not (string? 42)) 0 (sys-exit 4)) 11 (if (not (string? 'foo)) 0 (sys-exit 5)) 12 (if (not (string? '())) 0 (sys-exit 6)) 13 (if (not (string? '(1 2))) 0 (sys-exit 7)) 14 (if (not (string? #t)) 0 (sys-exit 8)) 15 (if (not (string? #f)) 0 (sys-exit 9)) 16 (if (not (string? car)) 0 (sys-exit 10)) 17 18 (sys-exit 0)