On Aug 20, 2011, at 9:42 AM, Andrew Pennebaker wrote:

> Okay, factor -help ios7crypt.factor works. It seems Factor ignores arguments 
> after the first script name.

It looks like arguments after the script name aren't ignored, but put into a 
command-line variable unprocessed, and the script name is put in a script 
variable:

$ cat foo.factor
#! /Applications/factor/factor
USING: command-line prettyprint ;

script get .
command-line get .
$ ./foo.factor -a -b -c
"foo.factor"
{ "-a" "-b" "-c" }

I guess the intent is that you process the contents of command-line yourself 
separately from the VM's own argument processing.

> For example, in Common Lisp a multilineshebang rearranges arguments so that 
> the script name is forcibly passed twice:
> 
> #!/bin/bash
> #|
> exec clisp -q -q $0 $0 ${1+"$@"}
> exit
> |#
> 
> If there's a way to do multiline shebangs in Factor, then ./ios7crypt.factor 
> -help can be run correctly.

You could implement #| |# as comment syntax in Factor:

USING: kernel multiline ;
SYNTAX: #| "|#" parse-multiline-string drop ;

Then you could do the embedded-shellscript trick.

-Joe

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to