[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Command line processing opens up can of worms :>
From: |
Marius Vollmer |
Subject: |
Re: Command line processing opens up can of worms :> |
Date: |
29 May 2001 07:04:00 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102 |
Rob Browning <address@hidden> writes:
> At this point, I'm thinking that the simplest semantics that make both
> the implementation and the understanding straightforward are to just
> specify that "read" is used to parse all of the arguments after the
> second line of the script and before the !#, and any non-string
> arguments are immediately reverted to strings via a "write to string".
>
> This is easy to understand, and easy to do, but does anyone see any
> big problems? I'll go ahead and fix my implementation to work this
> way, and see how I like it.
The alternative that I can see is to specify a simple form of quoting.
For example, we can say that in the meta-args lines, arguments are
separated by whitespace, and that you can use double `"' and single
`'' quotes to form arguments that include whitespace. This seems
simpler and easier to understand than the read-then-write
specification and doesn't drag in the (longish) definition of Scheme
read syntax. It is also more symmetric with the arguments on the
command-line.
People wouldn't be able to write
-x (let ((a 1) (b 2)) ...)
and get away with it, they would have to use explicit quotes
-x "(let ((a 1) (b 2)) ...)"
This does not look like a serious disadvantage to me.
> > In any case, I like the simplicity and well-definedness (strange
> > word :-) of the approach to read #! ... !# contents with (read),
> > and I think this is something we should stick to.
>
> I agree - no fancy by-hand parsing required. I like that.
Using quotes requires by-hand-parsing, but I don't think it would be
overly fancy.
Re: Command line processing opens up can of worms :>, Martin Grabmueller, 2001/05/28