Thanks Joe, that helps a lot. Do you know if Factor has an equivalent this
Python's idiom?

if __name__=="__main__":
   main()

More examples at Rosetta Code <http://rosettacode.org/wiki/ScriptedMain>.

Cheers,

Andrew Pennebaker
www.yellosoft.us

On Wed, Aug 17, 2011 at 10:20 PM, Joe Groff <arc...@gmail.com> wrote:

>
> On Aug 17, 2011, at 7:03 PM, Andrew Pennebaker wrote:
>
> Ignore the shebangs. For some reason, my simple Hello World program
> produces no output.
>
> $ cat hello.factor
> USE: io
> IN: hello
>
> : hello ( -- ) "Hello World!" print ;
>
> MAIN: hello
>
> $ factor hello.factor
>
>
> "factor foo.factor" only loads the file, and MAIN: by itself doesn't
> execute any code. To run the MAIN: entry point for a module, you need to use
> the -run option from the commandline:
>
> ./factor -run=hello
>
> Or use the run word from the listener:
>
> "hello" run
>
> Put hello/hello.factor under the work/ directory so it will be found as a
> module.
>
> "standard-cli-args" help gives a rundown of the standard commandline
> arguments.
>
> You can also use the deploy tool to build a stripped-down, standalone image
> that will run a MAIN: entry point directly. See "tools.deploy" help for
> more info.
>
> -Joe
>
>
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to