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

From: Rüdiger Asche (rac at ruediger-asche.de)
Date: Mon Aug 20 01:50:00 EDT 2012

Do you need to run echo.rkt under control of racket? If you compile it as a 
standalone, you can use

(current-command-line-arguments)

within echo.rkt to access the vector or command line arguments.

----- Original Message ----- 
From: "Rouben Rostamian" <rostamian at umbc.edu>
To: <users at racket-lang.org>
Sent: Monday, August 20, 2012 12:42 AM
Subject: [racket] Need help with running racket from the command-line


>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
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users
> 


Posted on the users mailing list.