hello.scm 554 B

12345678910111213141516171819
  1. ;;; hello: an example Pre-Scheme program
  2. (define (main argc argv)
  3. (if (= argc 2)
  4. (let ((out (current-output-port)))
  5. (write-string "Hello, world, " out)
  6. (write-string (vector-ref argv 1) out)
  7. (write-char #\! out)
  8. (newline out)
  9. 0)
  10. (let ((out (current-error-port)))
  11. (write-string "Usage: " out)
  12. (write-string (vector-ref argv 0) out)
  13. (write-string " <user>" out)
  14. (newline out)
  15. (write-string " Greets the world & <user>." out)
  16. (newline out)
  17. 1)))