using haskell as a shell language

Juan Carlos Arevalo-Baeza
Mon, 5 Nov 2001 19:16:26 -0800

On Tue, 6 Nov 2001 02:46:54 +0000 (GMT), D. Tweed wrote:

>On Mon, 5 Nov 2001, Juan Carlos Arevalo-Baeza wrote:
>>correct executable path. The only problem I'm aware of is that=
 the first
>>line (the #! line) might be included in the input piped into=
>>=A0program, which means that you'll have to run it through a=
>according to
>the input isn't piped but rather the name of the file is=

   Ouch! :) My bad, then.

>addition to ensuring the run program doesn't misinterpret the #!=
 line the
>current directory is also kept where it is even if the script is=
>invoked by ../../script.hs (for example) so you either need to=
>pass include path arguments or have all your imports being=
 absolute paths.

   Now, this sounds very wrong to me. The interpreter/compiler=
 should first look for imported modules in the directory where=
 the current source file was found, not in whatever directory is=
 current in the OS. It's much more consistent and reliable that=
 way, eliminating dependencies on arbitrary OS-related values.

   IMHO, of course. I'd suggest compiler/interpreter vendors to=
 make sure they, at least, allow this kind of behavior by using=
 command-line switches or something. If they haven't done it yet,=
 that is.

   Is this behavior specified in the Report? And what's the=
 rationale for using it? I mean, not even GCC uses this kind of=
 thing (in fact the C/C++ standards specify the proper search=
 order for #includes).

ICQ: 101728263
The Rumblings are back: