guile-devel
[Top][All Lists]
Advanced

[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 21:48:44 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Rob Browning <address@hidden> writes:

> I guess the only thing we have to do is to make sure and handle \\ and
> \" properly, but doesn't that require some ugly escaping in even
> common cases?  Say you wanted to tell guile to print
> 
>   "hello all"
> 
> followed by the newline, including printing the quotes.  How would you
> do that?  I guess you would have to say:
> 
>   #!/usr/bin/guile \
>   -x "(display \"\\\"hello all\\\"\n\")"
>   !#
> 
> That seems kinda awkward.  Though I guess it is more consistent with
> what they'd have to do from a shell.

You could also say

  #! /usr/bin/guile \
  -x '(display "\"hello all\"\n")'
  !#

> I don't know, really.  I'm happy with changing my code to do whichever
> people prefer.

I'm no really sure, as well.  Just using `read' has a certain kind of
appeal, but `read' is quite a big hammer.  Additionally, I would
expect that people want to have more complicated on the command line,
as opposed to in the meta-args line of a script.  If you are in a
script, you could probably just as well do the complicated stuff in
the script itself.  On the other hand, using `-x' or `-c' should be
more usefule for a pure command line invocation, for example from a
shell script.  Like (silly example)

    #! /bin/sh
    ...
    # Use Guile to do the bignum calculation
    power=54
    ans=`guile -c "(display (expt 2 $power))"`
    ...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]