run a command line script

copy the sample script from user manual

#! /usr/bin/scheme-script 
(import (rnrs))
(let ([args (cdr (command-line))])
  (unless (null? args)
    (let-values ([(newline? args)
                  (if (equal? (car args) "-n")
                      (values #f (cdr args))
                      (values #t args))])
      (do ([args args (cdr args)] [sep "" " "])
          ((null? args))
        (display sep)
        (display (car args)))
      (when newline? (newline)))))

run it

  chez git:(master)  ./ test_echo

compile version.

chez git:(master) echo '(compile-program "")' | scheme
Chez Scheme Version 9.4.1
Copyright 1984-2016 Cisco Systems, Inc.

> compiling with output to
chez git:(master) ./ echo

have to say it is damn hard to use.

why do not anyone come up with a solution to make comple the simple program easy.

Even the compile is done within scheme.

also, the speeed is not good.(both the interpreted and compiled version)