Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Markus Mottl <mottl@miss.wu-wien.ac.at>, OCAML <caml-list@inria.fr>
Subject: Re: Sys.argv with interpreter and compiler
Date: Thu, 1 Jul 1999 19:32:22 +0200	[thread overview]
Message-ID: <19990701193222.56286@pauillac.inria.fr> (raw)
In-Reply-To: <199906271102.NAA22537@miss.wu-wien.ac.at>; from Markus Mottl on Sun, Jun 27, 1999 at 01:02:45PM +0100

> E.g. I want to emit an error message that includes the name of the
> executable or, if the interpreter is used, the name of the script.
> 
> Wouldn't it be logically more consistent to pass the truncated array
> of arguments to the script under the interpreter so that the program
> always gets its name on index 0 - no matter whether it is compiled
> or interpreted?

Yes, it would be more consistent, but that's exactly what it does
currently.  At least, that's what a quick test under Linux shows.

> - With the current version it gets the name of the
> interpreter on this position.

That's surprising.  On which operating system do you see this
behavior?  The treatment of argv[0] in C w.r.t. #! scripts differs
between various versions of Unix, but we tried to compensate for this
in the OCaml bytecode interpreter.

- Xavier Leroy




  reply	other threads:[~1999-07-02  0:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-27 12:02 Markus Mottl
1999-07-01 17:32 ` Xavier Leroy [this message]
1999-07-01 23:35   ` Markus Mottl
1999-07-02  0:39     ` Pierre Weis
1999-07-02  0:53       ` Fabrice Le Fessant
1999-07-05  8:09       ` Sven LUTHER
1999-07-05 10:37         ` Markus Mottl
1999-07-08 23:23           ` Gerd Stolpmann
1999-07-02  1:30     ` Jacques GARRIGUE
1999-07-02  8:56       ` Markus Mottl
1999-06-29 17:01 Damien Doligez
1999-07-08 11:39 Damien Doligez
1999-07-09  2:25 ` Jacques GARRIGUE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990701193222.56286@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=mottl@miss.wu-wien.ac.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox