123456789101112131415161718192021222324252627 |
- ;;; append: an example Pre-Scheme program
- (define (main argc argv)
- (if (= argc 3)
- (let ((out (current-output-port))
- (a (vector-ref argv 1))
- (b (vector-ref argv 2)))
- (demo-string-append a a out)
- (demo-string-append a b out)
- (demo-string-append b b out)
- 0)
- (let ((out (current-error-port)))
- (write-string "Usage: " out)
- (write-string (vector-ref argv 0) out)
- (write-string " <string-a> <string-b>" out)
- (newline out)
- (write-string " Prints permutations of <string-a> and <string-b>." out)
- (newline out)
- 1)))
- (define (demo-string-append a b out)
- (let ((str (string-append a b)))
- (write-string str out)
- (newline out)
- (deallocate str)
- #t))
|