* libguile/backtrace.c (scm_print_exception): Add C binding for
print-exception, which dispatches to whatever is defined in Scheme.
(boot_print_exception): Add initial binding, replaced later in
Scheme.
* module/ice-9/boot-9.scm: Expect there to already be a print-exception
binding.
* module/ice-9/boot-9.scm (set-exception-printer!, print-exception):
Define an extensible exception-printing mechanism.
Also register printers for all keys thrown by Guile.
Inspired by a patch by Andreas Rottmann.
* libguile.h:
* libguile/Makefile.am:
* libguile/deprecated.h:
* libguile/deprecated.c:
* libguile/init.c:
* libguile/properties.c:
* libguile/properties.h: Deprecate the "primitive properties"
interface. It was only used to implement object properties, and that
is no longer the case.
* module/ice-9/boot-9.scm (make-object-property): Reimplement just in
terms of weak hash tables, and make threadsafe.
* NEWS:
* doc/ref/api-utility.texi: Update.
* 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/format.scm (format): When DESTINATION is #f, use a
Unicode-capable output string port.
* test-suite/tests/format.test ("format basic output")["default to
Unicode-capable port"]: New test.
* module/ice-9/psyntax.scm (quasiquote): Import new definition from
upstream psyntax, to allow unquote and unquote-splicing to take
multiple arguments.
(unquote, unquote-splicing): Adapt to not require a particular syntax
form.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/ice-9/psyntax.scm (chi-top): When adding to the toplevel
environment at compile-time, default to undefined variables, not
variables defined to #f.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/boot-9.scm (module-add!): Add a new pre-modules version
of this function, so we can add variables the environment, not just
values.
(module-define!): Use module-add!.
* module/ice-9/format.scm (format): Test to make sure an argument is a
number before applying `inf?' and `nan?' to it. Formerly, format
would call `inf?' and `nan?' on arguments that might be either a
number or a string, although those predicates should ideally throw an
exception when applied to non-number objects.
* libguile/hashtab.c: Fix remaining vector hash table support.
* module/ice-9/session.scm (apropos-fold): Use a hash table instead of a
vector for the completions.
* module/ice-9/format.scm (format): Move the port and output-col to let*
vars, again removing a set!. We will probably move more state vars to
the let*, to let the procedures exist in a more fixed-point style.
* module/ice-9/format.scm (format): Remove the need to save a copy of
the incoming arguments, because they are available as local
variables. Do the check early for the format-string actually being a
string.
* module/ice-9/format.scm (format): Add port and format-string as formal
arguments. Seems also to have triggered a reindent. Formally
deprecate omitting the port, as it's usually an error.
* test-suite/tests/format.test ("format basic output")
("format basic output", "~{ iteration"): Fix up tests that omitted the
destination port.
* module/ice-9/format.scm (format:symbol-case-conv)
(format:iobj-case-conv): Remove these exports, they were not used.
(format:expch): Remove this one, though it was used.
(format:floats, format:complex-numbers, format:radix-pref): Inline
these "configuration variables" into the format body.
* module/ice-9/futures.scm (%futures): Change from a list to a queue.
(register-future!, process-futures, touch): Adjust accordingly.
(unregister-future!): Remove.
* module/ice-9/threads.scm (parallel, par-mapper): Rewrite in terms of
`future' and `touch'.
* test-suite/tests/threads.test ("par-map", "par-for-each"): New test
prefixes.
* doc/ref/api-scheduling.texi (Parallel Forms): Add cross-ref to
futures. Recommend against the `n-' variants.
* module/ice-9/futures.scm (process-future!): Use `call-with-values'
when invoking `(future-thunk future)'.
* test-suite/tests/future.test ("futures")["multiple values"]: New test.
* libguile/poll.c (scm_primitive_poll): Account for buffered I/O.
* module/ice-9/poll.scm (poll): Adapt to call primitive-poll with the
port vector too.