guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JACAL, scm


From: Tom Lord
Subject: Re: JACAL, scm
Date: Mon, 24 Sep 2001 21:01:41 -0700 (PDT)

        > Why can Guile load multiple files from the command line, but not 
execute
        > more than one expression?  Why can't Guile execute a command-line
        > expression before entering interactive session?

       I asked myself the same thing after banging my head against the
       wall a few times on that front, and accordingly I've rewritten
       much of guile's command line processing (in Scheme rather than
       C) to fix these problems,

What's included when you say "guile's command line processing"?

In Systas, the command line options handled by the default repl have
been kept simple, and sound close to what I'm guessing you've written
for Guile.

For the interface to process start-up (again in Systas) you just bind
the variable `main' to a procedure of one argument (a list of command
line arguments).  That function is called instead of a repl, and the
process exits when it returns.  This works, is simple, and quite
flexible, but I'm not sure yet if I really like it.

Systas comes with a decent version of getopt driven by data structures
such as:

  (define sample
    '((input-file         :char "i file"
                          :long-name "input=file"
                          :requires-argument
                          :documentation "Read input from FILE.")

      (output-file        :char "o file"
                          :long-name "output=file"
                          :requires-argument
                          :documentation "Write output to FILE.")

      (quiet              :char #\q
                          :long-name "quiet"
                          :documentation "Avoid unecessary output.")
      (quiet              :documentation "Truncate error messages.")

      (blank-line)

      (x                  :char #\x
                          :documentation "Peform mysterious operation.")))


It does nice things like format help messages and the implementation
is about 320 lines long.  (the module is '(unix options) in the
directory "scheme-library").


-t



reply via email to

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