February 25, 2011
On 2011-02-22 22:46:41 +0100, Paolo Invernizzi said:

> Hi Magnus,
> 
> This is sligthly OT, but... How I loved AnyGui!

Haha, cool :D Yeah, too bad the project died. Oh, well -- at least we tried :)

> It's nice to see you here, in the D bandwagon...

Yeah, I've been looking for a more "close to the metal" language to complement Python for a looong time (using C and C++ when I had to -- and sometimes Java or Cython and what-have-you). At the moment I'm hopeful that D might be what I've been looking for. Loving it so far :)

(Still using Python, though. Just came out with a new Python book, "Python Algorithms", last fall ;)

</OT>

-- 
Magnus Lie Hetland
http://hetland.org

February 25, 2011
On 2011-02-21 15:17:44 +0100, Jacob Carlborg said:

> On 2011-02-21 14:16, Lars T. Kyllingstad wrote:
>> 
>> Say you have a file "myscript", that starts with the line
>> 
>> #!/path/to/interpreter --foo --bar
>> 
>> If you run this as
>> 
>> ./myscript --hello --world
>> 
>> then the args[] received by the interpreter program looks like this:
>> 
>> args[0] = "/path/to/interpreter"
>> args[1] = "--foo --bar"
>> args[2] = "./myscript"
>> args[3] = "--hello"
>> args[4] = "--world"
>> 
>> This is the case on every shell I've tried on Linux, at least.

Let me first clarify: By "nothing happens", I really mean that. When I supply --shebang, the code isn't compiled, and nothing is run. Running the script becomes a no-op.

As for your example: The switches to rdmd *don't* appear in args for me. So for example, if I have

#!/path/to/rdmd -unittest

... as the shebang line, rdmd finds and passes the -unittest switch to dmd (my unit tests work). I get no problems when I add more switches either (i.e., rdmd doesn't complain). But, as far as I can see, none of these end up in args. (Or are we talking about different things here?)

Instead, args[0] contains the full path to the temporary executable built and run by rdmd, and args[1..$] contain any arguments I supplied when running the script.

The fact that --shebang borks the whole execution seems like it must be a bug. As for the rest of the behavior, it seems pretty useful to me, but perhaps OS X-specific? (That would be odd, but who knows...)

-- 
Magnus Lie Hetland
http://hetland.org

1 2
Next ›   Last »