[plt-scheme] Creating Executable

From: Paulo J. Matos (pocm at mega.ist.utl.pt)
Date: Sat Sep 7 11:39:24 EDT 2002

Oh, thanks alot.
=)
I imagine that if I create a stand-alone executable is just about
the same thing. :) right?

Best regards,
Paulo

> Paulo J. Matos wrote:
> > I've been checking and it's not just my program. Here it is what
> > I've done in PLT-Scheme 202 running in Linux Slack Kernel 2.4.17
> > (running binaries, not compiled in my system) with current
> > language 'Pretty Big':
> > I started Drscheme.
> > I entered the following in the definitions window:
> > (define double
> >   (lambda (x) (* 2 x)))
> > I've executed and checked in the interactions window:
> >
> >>(double 2)
> > 4
> > Ok, it's running fine.
> > I've saved it in home dir as double.scm.
> > Then I've clicked Scheme->Create Executable and it created a
> > file named double which is executable.
> > In bash:
> > pdestroy at localhost:~$ ./double
> > pdestroy at localhost:~$
> > It was as if nothing happened.
> > Any ideas?
> 
> The executable that gets created doesn't mimic a Read-Eval-Print
> loop, so you need to explicity print results to standard out for
> them to be displayed. You asked "How will it know which function
> to call when we run it?": all of the expressions get evaluated in
> the order that they appear, so if your double.scm looked like
> this:
> 
> (define double
>    (lambda (x) (* 2 x))
> 
> (printf "~a~n" (double 2))
> 
> double would be bound to the lambda expression, then
> it would be applied to 2 which results in 4 being handed to
> printf for displaying.
> 
> --
> Jamie Raymond
> 
> 
> 

-- 
Paulo J. Matos : pocm(_at_)mega.ist.utl.pt
Instituto Superior Tecnico - Lisbon    
Software & Computer Engineering - A.I.
 - > http://mega.ist.utl.pt/~pocm 
 ---	
	Yes, God had a deadline...
		So, He wrote it all in Lisp!




Posted on the users mailing list.