* libguile/random.c (scm_c_random): On platforms where `unsigned long' has 64
bit, generate up to 64 bit of randomness. This is expected by
scm_c_random_bignum(), and hence was a serious distortion of the random value
distribution for values exceeding 2^32. This change also fixes a crash when
the `m' argument is a value above 2^32.
R6RS character hex escapes do not conflict with legacy Guile octal
character escapes, so they can be enabled by default.
* libguile/read.c (scm_read_character): modified
* test-suite/tests/reader.test: modify character escape tests
* doc/ref/api-data.texi: modified
* doc/ref/api-options.texi: modified
The open-file port should use the 8-bit ISO-8859-1 encoding when
a file is opened using mode "b". Also, it should honor a "coding:"
declaration at the top of a file when reading files where it is present.
* libguile/fports.c (scm_open_file): modified
* test-suite/tests/ports.test: more tests for open-file
* doc/ref/api-io.texi (File Ports): more documentation for open-file
* module/ice-9/debug.scm: Gut, though we keep the module around for code
Out There that uses it.
* module/ice-9/top-repl.scm (top-repl): Don't import (ice-9 debug)
* module/ice-9/debugger/commands.scm:
* module/ice-9/debugging/trace.scm:
* module/ice-9/emacs.scm: Remove ice-9 debug includes.
* doc/ref/tour.texi: Update Guile prompts for
scheme@(guile-user)>. Update output to assume value-history is on. Lop
and crop the bug reporting section -- it was too long.
* doc/ref/api-debug.texi (Debug on Error): Update xref.
* doc/ref/scheme-using.texi (REPL Commands): New subsection.
(Interactive Debugging): Rename from Interactive Debugger, to indicate
that debugging is just part of the REPL. Update docs.
Note especially that the variable 'i' has two different uses in this
function, and they get confused.
* libguile/read.c (scm_i_scan_for_encoding): cleanup
* libguile/ports.c (scm_getc): Provide `u32_conv_from_encoding' with the
RESULT_BUF stack-allocated buffer to avoid heap allocation.
(find_valid_encoding): Likewise.
(scm_ungetc): Ditto with `u32_conv_to_encoding'.
* module/system/repl/error-handling.scm (call-with-error-handling):
Previous post-error changed to "report"; now "catch", the default,
doesn't re-print the error.
* libguile/vm-engine.c: Add func_name local, for error reporting.
(vm_error_apply_to_non_list): New error case.
(vm_error_wrong_type_arg): Remove this generic error case.
(vm_error_wrong_type_apply): Remove FUNC_NAME -- no sense in seeing
"vm-debug-engine" in the error report.
(vm_error_not_a_pair, vm_error_not_a_bytevector)
(vm_error_not_a_struct, vm_error_not_a_thunk): Use func_name instead
of FUNC_NAME, so we can indicate what caused the error.
* libguile/vm-i-scheme.c (VM_VALIDATE_CONS, car, cdr, set-car!)
(set-cdr!): Indicate provenance of errors.
(VM_VALIDATE_STRUCT, struct-vtable):
(VM_VALIDATE_BYTEVECTOR, BV_FIXABLE_INT_REF, BV_INT_REF)
(BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET): Same.
* libguile/vm-i-system.c (apply, tail-apply): Use
vm_error_apply_to_non_list.
* libguile/backtrace.h:
* libguile/backtrace.c (scm_display_error): Change "stack" arg to
"frame". Still accept stacks for backward compatibility.
(display_header, display_error_body): Show the source of the error, if
possible.
Guile implements this library in terms of SRFI-69, which is a bit vague on
the arity of hash functions, whereas `(rnrs hashtables)' explicitly
specifies unary ones.
* module/rnrs/hashtables.scm (wrap-hash-function): Assume SRFI-69 will pass
the table capacity as the second argument; return the result of proc
modulo the capacity.
* test-suite/tests/r6rs-hashtables.test (make-hashtable): New test case for
hash functions that return large values.
* module/ice-9/buffered-input.scm (make-buffered-input-port): Instead of
always returning EOF once EOF is seen once, call the producer again.
Allows Ctrl-D to cause one EOF at the REPL, returning once from a
recursive edit, but input continues normally. Thanks to Andrew
Bagdanov for a clue that led to the fix.
* module/Makefile.am (ice-9/psyntax-pp.scm.gen): No longer automatically
regenerate psyntax-pp.scm, as the gensym dance is getting too
complicated. Instead when you change psyntax.scm now you should make
ice-9/psyntax-pp.scm.gen.
* module/system/repl/repl.scm (run-repl): Run the thunk in a stack in a
prompt, similar to the default prompt. Gives proper backtraces.
* module/system/repl/error-handling.scm (call-with-error-handling):
Narrow one more outer frame, for the %start-stack thunk invocation.
* module/ice-9/boot-9.scm (%start-stack): Reindent.
* doc/ref/compiler.texi: Update for new ,pp meta-command.
* doc/ref/scheme-using.texi (Using Guile Interactively): Show value
history in examples.
(Value Historyx): Update docs to mention the repl option and the
programmatic interface.
* module/system/repl/common.scm: Use (ice-9 history). Turns on value
history by default.
(repl-default-options): Expand the format of options to include an
optional value transformer, run when setting a value. Add prompt and
value-history options.
(repl-prepare-eval-thunk): Use repl-option-ref.
(repl-option-ref): Error if the option is unknown.
(repl-option-set!, repl-default-option-set!): Error if the option is
unknown. Pass the val through the transformer procedure.
(repl-default-prompt-set!): Just use repl-default-option-set!.
* module/system/repl/command.scm (option): Update for the new options
format.
* module/system/repl/common.scm (repl-default-options): Heap-allocate
the repl-default-options, to avoid mutating a literal.
(make-repl): Copy repl-default-options.