[prev in list] [next in list] [prev in thread] [next in thread] 

List:       racket-users
Subject:    [plt-scheme] PLT MzScheme - How to use "--main"?
From:       mflatt () cs ! utah ! edu (Matthew Flatt)
Date:       2007-12-21 12:16:39
Message-ID: 20071221121641.844FD6500B7 () mail-svr1 ! cs ! utah ! edu
[Download RAW message or body]

At Fri, 21 Dec 2007 09:30:52 -0000, M?rcio Faustino wrote:
> Can someone please explain me how to use MzScheme to run a Scheme program  
> with the "--main" option?
> For example, I have this program:
> (define (main)
>    (format "test"))
> 
> When I run it like this "mzscheme test.scm --main", I was expecting it to  
> print "test", but it doesn't.
> Am I missing something?

`main' is called only for its side-effects, so you'd need something
like

  (define (main)
    (display "test")
    (newline))


But `--main' in v3.99 really should print the result of the call (via
`current-print'), in the same way that `-e' results are now printed in
v3.99. I'll make that change.

Matthew



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic