(For use by guile-tools)
* module/ice-9/getopt-long.scm: Use (ice-9 optargs) so we can use
define*.
(process-options): Add stop-at-first-non-option parameter. When
this is true, stop processing when we hit a non-option (so long as
that non-option isn't something that resulted from the unclumping of
a short option group).
(getopt-long): Add #:stop-at-first-non-option keyword; pass it on to
process-options.
* test-suite/tests/getopt-long.test ("stop-at-first-non-option"): New
test (for the above).
This is needed as a prerequisite for the following change that
introduces the stop-at-first-non-option option, because when that
option is used we don't know upfront how far through the command
line we should proceed with unclumping.
* module/ice-9/getopt-long.scm (expand-clumped-singles): Delete.
(process-options): Add a loop variable to indicate how many elements
at the start of `argument-ls' are known not to be clumped. When we
see a short option and this variable is <= 0, perform unclumping
(using code that used to be in expand-clumped-singles) and loop with
the variable > 0.
(getopt-long): Don't call expand-clumped-singles upfront here.
Basically, accumulate values in the `process-options' loop variables,
instead of using set-option-spec-value!
* module/ice-9/getopt-long.scm (option-spec): Delete the `value' slot.
(process-options): Delete `val!loop' and just use `loop' everywhere
instead. When adding an option spec to `found', add the
corresponding value too; hence `found' becomes an alist, where it
was previously a list of specs.
(getopt-long): Use assq-ref to get values out of `found'. Remove
unhittable error condition for detecting an option that requires an
explicit value, where a value wasn't supplied. This condition is
actually caught and handled in `process-options'. Rewrite the end
of the procedure much more simply.
* module/ice-9/getopt-long.scm (fatal-error): New helper. For errors
that come from the user -- i.e., not the grammar -- we will handle our
own error printing and call `exit' rather than relying on the root
catch handler. This is more friendly to the user than a Scheme
backtrace.
(parse-option-spec, process-options, getopt-long): Call `fatal-error'
as appropriate.
* test-suite/tests/getopt-long.test (pass-if-fatal-exception): New
helper, checks that a certain key was thrown to, and that suitable
output has been printed on an error port.
(deferr): Change to expect a 'quit key instead of 'misc-error. Update
exceptions to not match the beginning of the string, as that will be
the program name. Update tests to use pass-if-fatal-exception.
* module/ice-9/getopt-long.scm: #:keywords in the define-module block.
(option-spec): Define as a srfi-9 record instead of playing macro
games with boot-9 records.
* module/ice-9/boot-9.scm (eval-when): Replace eval-case with eval-when.
Eval-when is *much* simpler, and more expressive to boot. Perhaps in
the future we'll get 'visit and 'revisit too.
* module/ice-9/deprecated.scm (eval-case): Provide mostly-working
deprecated version of eval-case.
* module/ice-9/boot-9.scm (defmacro, define-macro): Relax condition: we
can make defmacros that are not at the toplevel now. But in the future
we should replace this implementation of defmacros with one written in
syntax-case.
(define-module, use-modules, use-syntax): Allow at non-toplevel.
(define-public, defmacro-public, export, re-export): Don't evaluate at
compile-time, I can't see how that helps things. Allow `export' and
`re-export' at non-toplevel.
* module/ice-9/getopt-long.scm:
* module/ice-9/i18n.scm:
* module/oop/goops.scm:
* module/oop/goops/compile.scm:
* module/oop/goops/dispatch.scm: Switch to use eval-when, not
eval-case.
* module/language/scheme/compile-ghil.scm (eval-when): Replace eval-case
transformer with eval-when transformer. Sooooo much simpler, and it
will get better once we separate expansion from compilation.
* module/language/scheme/expand.scm (quasiquote): Hm, expand quasiquote
properly. Not hygienic. Syncase needed.
(lambda): Handle internal defines with docstrings propertly.
* module/ice-9/getopt-long.scm (define-one-option-spec-field-accessor,
define-one-option-spec-field-modifier): Eval-case for `load-toplevel'
as well so that the interpreter can load this module.
* module/ice-9/getopt-long.scm (option-spec-fields): Enclose in a
`(load-toplevel compile-toplevel)' `eval-case'.
(define-one-option-spec-field-accessor,
define-one-option-spec-field-modifier): Enclose in a
`compile-toplevel'-only `eval-case'.
Moved ice-9/ and oop/ under module/, with the idea being that we have
only scheme under module/. Adjusted configure.in and Makefile.am
appropriately. Put oop/ at the end of the compilation order.