[racket] Need help with running racket from the command-line

From: Rouben Rostamian (rostamian at umbc.edu)
Date: Sun Aug 19 18:42:24 EDT 2012

I am having difficulty in interpreting Racket's command-line
options described in the User Guide.  Please help if you can.

I want to do something like this:

   racket -t echo.rkt -e '(echo "hi")'

The file echo.rkt (which is given at the end of this message)
is a module that provides a function "echo" which simply prints
its argument to the terminal.

I expect the Unix command

   racket -t echo.rkt -e '(echo "hi")'

to print "hi" to the terminal and exit.  But it doesn't; it complains
about an unbound identifier.  This is Racket v5.1.3, if it matters.

Here is the content of the file echo.rkt:

;; echo.rkt ------------

#lang racket

(provide echo)

(define (echo x)
  (display x)
  (newline))

;; end of echo.rkt -----


-- 
Rouben Rostamian

Posted on the users mailing list.