[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gforth] Using Gforth with #! "shebang"
From: |
David Kuehling |
Subject: |
Re: [gforth] Using Gforth with #! "shebang" |
Date: |
Wed, 21 Nov 2012 15:40:15 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
>>>>> "Anton" == Anton Ertl <address@hidden> writes:
> Looks to me like it passes two arguments: "-m" and "256M -d 4M -r 4M
> -l 256k". Given that, we could add another command-line option -#!
> that parses the next argument and treats it as a sequence of
> command-line arguments. Then you could write the line as follows:
> #! /usr/local/bin/gforth-fast -#! -m 256M -d 4M -r 4M -l 256k
> However, I think that there are Unixes that ignore everything after
> the first argument, so this approach would not work there.
According to stack overflow
http://stackoverflow.com/questions/4303128/spam-urls-suck#tab-top
there's no way to do multi-argument shebang. As Andrew pointed out,
multi-line shebangs that do an intermediate invocation of /bin/sh on the
same source file are the way to go. There are even a few languages that
have support for multi-line shebang in that they have keywords that can
be used to escape a few lines of header to be only parsed by the shell
without interfering with shell invocation. I like the way it's handled
in Common Lisp:
http://rosettacode.org/wiki/Multiline_shebang#Common_Lisp
I guess we could easily add the same syntax to Gforth.
I'd also be happy if Gforth allwed to resize the dictionary and stacks
at runtime :)
cheers,
David
--
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205 D016 7DEF 5323 C174 7D40
pgp9y3rpFbiUb.pgp
Description: PGP signature
- [gforth] Using Gforth with #! "shebang", David Kuehling, 2012/11/20
- Re: [gforth] Using Gforth with #! "shebang", Andrew Pennebaker, 2012/11/20
- Re: [gforth] Using Gforth with #! "shebang", Anton Ertl, 2012/11/21
- Re: [gforth] Using Gforth with #! "shebang",
David Kuehling <=
- Re: [gforth] Using Gforth with #! "shebang", Bernd Paysan, 2012/11/21
- Re: [gforth] Using Gforth with #! "shebang", Anton Ertl, 2012/11/21
- Re: [gforth] Using Gforth with #! "shebang", Bernd Paysan, 2012/11/21
- Re: [gforth] Using Gforth with #! "shebang", David Kuehling, 2012/11/21
- Re: [gforth] Using Gforth with #! "shebang", Bernd Paysan, 2012/11/22
- Re: [gforth] Using Gforth with #! "shebang", Anton Ertl, 2012/11/22
- Re: [gforth] Using Gforth with #! "shebang", Bernd Paysan, 2012/11/22
Re: [gforth] Using Gforth with #! "shebang", Bernd Paysan, 2012/11/21