Andy Wingo [Fri, 1 Oct 2010 10:49:16 +0000 (12:49 +0200)]
api-debug.texi refactors
* doc/ref/api-debug.texi (Programmatic Error Handling): Rename from
"Debug on Error". Reorganize subsections according to when the error
is handled.
* doc/ref/api-options.texi: Adapt xref.
Andy Wingo [Fri, 1 Oct 2010 09:54:38 +0000 (11:54 +0200)]
update tour.texi
* doc/ref/tour.texi (Using the Guile Module System): Remove "in flux"
language. Update examples to use #:export instead of (export ...).
Andy Wingo [Fri, 1 Oct 2010 09:47:53 +0000 (11:47 +0200)]
finish cleaning out api-options.texi
* doc/ref/api-debug.texi (Debug on Error): Move debug options here (for
now). Leave debug-options-interface undocumented.
* doc/ref/api-options.texi (Runtime Options): Remove debug options. Link
to the sections where the options documentation is now. Update the
options example transcript.
Andy Wingo [Fri, 1 Oct 2010 09:15:12 +0000 (11:15 +0200)]
debug and readline options doc tweak
* doc/ref/api-options.texi (Debugger options):
* doc/ref/repl-modules.texi (Readline Options): Use 'help instead of
'full (they are entirely equivalent right now). Update output to show
options in the right order.
Andy Wingo [Fri, 1 Oct 2010 09:09:28 +0000 (11:09 +0200)]
move read and print options docs to the procedures they parameterize
* doc/ref/api-evaluation.texi (Scheme Read): Fold all reader options
docs into this section. Undocument read-options-interface.
(Scheme Write): New section for `write' and `display', and the print
options. print-enable/print-disable are not documented, as there are
no boolean print options. print-options-interface is likewise
undocumented.
* doc/ref/api-options.texi: Remove discussion of options in
general. Move read options to Scheme Read, and print options to Scheme
Write.
* doc/ref/api-io.texi (Reading): Link to Scheme Read.
(Writing): Move write and display to Scheme Write, and link there.
* doc/ref/srfi-modules.texi:
* doc/ref/api-debug.texi:
* doc/ref/api-data.texi: Update xrefs.
Andy Wingo [Fri, 1 Oct 2010 08:20:54 +0000 (10:20 +0200)]
remove elisp-strings and elisp-vectors read options
* libguile/private-options.h (SCM_ELISP_VECTORS_P, SCM_ESCAPED_PARENS_P):
* libguile/read.c (scm_read_opts): Remove unused elisp-vectors option,
and the elisp-strings option (which allowed \( and \) escapes in
strings).
(scm_read_string): Remove the elisp-strings case.
* doc/ref/api-options.texi (Reader options): Update, and update wording
of the case-insensitive bit.
Andy Wingo [Fri, 1 Oct 2010 08:07:47 +0000 (10:07 +0200)]
(foo-options 'full) displays options doc in correct order
* libguile/options.c (get_documented_option_setting): Reverse options
interface list before returning, so that they are in the original
order.
Andy Wingo [Fri, 1 Oct 2010 07:56:15 +0000 (09:56 +0200)]
remove unused print-options
* libguile/private-options.h (SCM_PRINT_CLOSURE, SCM_PRINT_SOURCE_P):
* libguile/print.c (scm_print_opts):
* doc/ref/api-options.texi (Printing options): Remove source and
closure-hook print options.
Andy Wingo [Thu, 30 Sep 2010 19:29:20 +0000 (21:29 +0200)]
add ,registers
* libguile/frames.h:
* libguile/frames.c (scm_frame_stack_pointer): New function.
* module/system/repl/debug.scm (print-registers): New function, prints
out registers.
* module/system/repl/command.scm (registers): New debugging
meta-command.
(inspect): Not a stack-command, a normal meta-command.
Andy Wingo [Tue, 28 Sep 2010 08:03:55 +0000 (10:03 +0200)]
fix check-guile.in for default vm change
* check-guile.in: Make the --debug fix in the source file, not the
generated file. Grr.
Andy Wingo [Tue, 28 Sep 2010 07:22:38 +0000 (09:22 +0200)]
default to regular vm for noninteractive use
* libguile/script.c (scm_compile_shell_switches): Select the debugging
VM in the cases that we previously would select deval -- when running
interactively without --no-debug, or otherwise with --debug.
* libguile/vm.c: Default to the regular engine.
(scm_c_set_vm_engine_x): Remove requirement for the VM to have no
pending computations.
Ludovic Courtès [Mon, 27 Sep 2010 21:52:10 +0000 (23:52 +0200)]
Fix pattern variable extraction in `match' with `..1'.
* module/ice-9/match.upstream.scm (match-extract-vars): Support `..1'.
Ludovic Courtès [Mon, 27 Sep 2010 20:50:36 +0000 (22:50 +0200)]
Add support for `..1' to `match'.
Patch accepted upstream:
<http://lists.gnu.org/archive/html/guile-devel/2010-09/threads.html#00114>.
* module/ice-9/match.upstream.scm (match-two): Add support for `..1'.
* test-suite/tests/match.test ("matches")["list ..1", "list ..1, with
predicate"]: New tests.
("doesn't match")["list ..1", "list ..1, with predicate"]: New tests.
Andreas Rottmann [Mon, 27 Sep 2010 20:15:51 +0000 (22:15 +0200)]
Add implementation of SRFI 27
* module/srfi/srfi-27.scm: New file; implementation of SRFI 27 in terms
of the existing random number generator.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-27.scm.
* test-suite/tests/srfi-27.test: New file; minimal test suite for SRFI 27.
* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-27.test.
* doc/ref/srfi-modules.texi: Add subsection on SRFI-27 based
on the specification.
Andy Wingo [Mon, 27 Sep 2010 19:06:24 +0000 (21:06 +0200)]
add call-with-vm; remove thread-vm bits; remove vm-apply; engines settable.
* libguile/vm.h (scm_c_vm_run): Make internal.
* libguile/vm.c (vm_default_engine): New static global variable.
(make_vm): Set vp->engine based on
(scm_vm_apply): Remove in favor of call-with-vm.
(scm_thread_vm, scm_set_thread_vm_x): Remove these, as they did not
have a well-defined meaning, and were dangerous to call on other
threads.
(scm_the_vm): Reinstate previous definition.
(symbol_to_vm_engine, vm_engine_to_symbol)
(vm_has_pending_computation): New helpers.
(scm_vm_engine, scm_set_vm_engine_x, scm_c_set_vm_engine_x): New
accessors for VM engines.
(scm_c_set_default_vm_engine_x, scm_set_default_vm_engine_x): New
setters for the default VM engine.
(scm_call_with_vm): New function, applies a procedure to arguments in
a context in which a given VM is current.
* libguile/eval.c (eval, scm_apply): VM dispatch goes through
scm_call_with_vm.
* test-suite/tests/control.test ("the-vm"):
* module/system/vm/coverage.scm (with-code-coverage): Use call-with-vm.
* module/system/vm/vm.scm: Update exports.
* test-suite/vm/run-vm-tests.scm (run-vm-program):
* test-suite/tests/compiler.test ("current-reader"): Just rely on the
result of make-program being an applicable.
* test-suite/tests/eval.test ("stack overflow"): Add a note that this
test does not test what it should.
Ludovic Courtès [Mon, 27 Sep 2010 09:20:14 +0000 (11:20 +0200)]
Fix bignum memory leak.
The `mpz_t' associated with a bignum would never be freed, so an
expression like `(while #t (expt 2 5000))' would quickly lead to memory
exhaustion.
* libguile/numbers.c (finalize_bignum): New function.
(make_bignum): Register it as a finalizer for P.
Ludovic Courtès [Mon, 27 Sep 2010 09:10:01 +0000 (11:10 +0200)]
Allocate bignums in pointer-less memory.
* libguile/numbers.c (make_bignum): New function.
(scm_i_mkbig, scm_i_long2big, scm_i_ulong2big, scm_i_clonebig,
scm_i_dbl2big, scm_i_mpz2num): Use it.
Ludovic Courtès [Sun, 26 Sep 2010 23:28:49 +0000 (01:28 +0200)]
Remove `scm_t_aligned_cell'.
* libguile/_scm.h (scm_aligned_cell, scm_t_aligned_cell): Remove. The
whole approach was misguided as the compiler can't guarantee absolute
alignment on the stack.
Ludovic Courtès [Sun, 26 Sep 2010 14:24:35 +0000 (16:24 +0200)]
Fix argument passing in VM hooks.
* libguile/vm.c (vm_dispatch_hook): Take care of FRAME's alignment
explicitly so that it's correct even if the current stack frame isn't
8-byte aligned (as can be the case on i686--the SysV i386 ABI just
says that the stack is word-aligned.)
Ludovic Courtès [Sun, 26 Sep 2010 14:23:53 +0000 (16:23 +0200)]
Have `@abort' honor VM changes by winds.
* libguile/control.c (scm_c_abort): Update VM after the `scm_dowinds'
call.
* test-suite/tests/control.test ("the-vm"): New test prefix.
Michael Gran [Sun, 26 Sep 2010 19:25:18 +0000 (12:25 -0700)]
Favor non-hex string escapes over hex escapes when writing strings
The characters U+0007 to U+000D have non-hex forms for their
escapes when in written strings.
* libguile/print.c (write_character): use non-hex escapes
* test-suite/tests/reader.test (write R6RS string escapes): adjust test
Neil Jerram [Sun, 26 Sep 2010 18:42:01 +0000 (19:42 +0100)]
Edit define-class doc
* doc/ref/goops.texi (Defining New Classes): Remove "fixme" text
(saying we should have something that we in fact already have). A
few minor edits throughout.
(Basic Class Definition): Move content up into `Defining New
Classes'.
(Class Options): Move after `Slot Options' (because slot options are
more important). Remove doc of the #:environment option, since I
believe it's now fictitious.
(Slot Options): Reorder the options so that the most commonly used
ones come first.
Neil Jerram [Sat, 25 Sep 2010 16:29:18 +0000 (17:29 +0100)]
Remove unwarranted para
* doc/ref/goops.texi (Metaobjects and the Metaobject Protocol): Remove
para about GOOPS classes belonging to the usual Scheme namespace.
Interest doesn't justify the space that it takes.
Neil Jerram [Sat, 25 Sep 2010 16:27:14 +0000 (17:27 +0100)]
Edit text about the MOP
* doc/ref/goops.texi (The Metaobject Protocol, Metaobjects and the
Metaobject Protocol): Minor edits.
Neil Jerram [Sat, 25 Sep 2010 14:42:08 +0000 (15:42 +0100)]
Start separating doc of the metaobject protocol from that of basic GOOPS usage
* doc/ref/goops.texi (Introductory Remarks): Node deleted, with
material moved to...
(The Metaobject Protocol): ...here.
(MOP Specification): Moved to become a subnode of `The Metaobject
Protocol'.
Neil Jerram [Sat, 25 Sep 2010 14:19:30 +0000 (15:19 +0100)]
Promote subsections inside the GOOPS "Reference Manual" section
* doc/ref/goops.texi (Reference Manual): Node deleted, with content
promoted up to...
* doc/ref/goops.texi (GOOPS): ...here.
Michael Gran [Sat, 25 Sep 2010 16:07:21 +0000 (09:07 -0700)]
Incorrect parsing of NaN complex numbers
* libguile/numbers.c (mem2complex): modified
* test-suite/tests/reader.test: new complex NaN reader test
Andy Wingo [Sat, 25 Sep 2010 10:16:05 +0000 (12:16 +0200)]
remove vm-version, vm options
* libguile/vm.h (struct scm_vm): Remove "options" member.
* libguile/vm.c (scm_vm_version, scm_vm_option, scm_set_vm_option_x):
Remove.
* module/system/vm/vm.scm (vm-version, vm-option, set-vm-option!):
Remove.
(vms:time, vms:clock): Remove these unused definitions.
(vm-load): Remove. "Load" should be reserved for things that exist on
disk, methinks.
Andy Wingo [Sat, 25 Sep 2010 10:12:45 +0000 (12:12 +0200)]
fix up options.test
* test-suite/tests/options.test (test-suite): Fix up for removal of
maxdepth debug option.
Andy Wingo [Sat, 25 Sep 2010 10:09:13 +0000 (12:09 +0200)]
statprof test traps fix; re-enable accurate call counting test
* test-suite/tests/statprof.test: Remove needless debug-enable /
trap-enable calls.
("accurate call counting"): Fix this test. Whee :)
Andy Wingo [Sat, 25 Sep 2010 10:02:33 +0000 (12:02 +0200)]
fix eval.test for procnames eval option
* test-suite/tests/eval.test ("define set procedure-name"): Fix needless
use of removed 'procnames eval option.
Andy Wingo [Fri, 24 Sep 2010 18:49:46 +0000 (20:49 +0200)]
remove a number of debug options
* libguile/private-options.h (SCM_BREAKPOINTS_P, SCM_TRACE_P)
(SCM_REC_PROCNAMES_P, SCM_BACKTRACE_INDENT, SCM_N_FRAMES)
(SCM_BACKTRACE_MAXDEPTH, SCM_DEVAL_P): Remove these internal names.
* libguile/eval.c (scm_debug_opts): Remove the corresponding debug
options -- breakpoints, trace, procnames, indent, frames, maxdepth,
and debug.
* libguile/debug.c (scm_debug_options): Remove SCM_N_FRAMES check.
* test-suite/lib.scm (with-debugging-evaluator*):
* module/scripts/summarize-guile-TODO.scm:
* module/statprof.scm (statprof-reset):
* module/ice-9/boot-9.scm (turn-on-debugging): Remove useless
debug-enable 'debug calls.
* module/ice-9/deprecated.scm (debug-enable): As it seems that 'debug is
a particulatly common option that we just removed, add a deprecation
shim.
* doc/ref/api-options.texi (Debugger options): Update the set of debug
options.
Andy Wingo [Fri, 24 Sep 2010 16:44:21 +0000 (18:44 +0200)]
remove evaluator-traps-interface
* libguile/debug.h:
* libguile/debug.c (scm_with_traps):
* libguile/eval.c (scm_evaluator_traps, scm_evaluator_trap_table):
Remove these procedures. Note that scm_evaluator_traps was known in
Scheme as `evaluator-traps-interface'.
* libguile/private-options.h (SCM_TRAPS_P, SCM_ENTER_FRAME_P)
(SCM_APPLY_FRAME_P, SCM_EXIT_FRAME_P, SCM_ENTER_FRAME_HDLR)
(SCM_APPLY_FRAME_HDLR, SCM_EXIT_FRAME_HDLR, SCM_MEMOIZE_P)
(SCM_MEMOIZE_HDLR): Remove these private interfaces.
* module/ice-9/boot-9.scm (traps, trap-enable, trap-disable, trap-set!):
Remove.
* module/ice-9/scm-style-repl.scm (error-catching-loop): Remove
with-traps wrap.
* doc/ref/api-options.texi (Low level options interfaces):
(User level options interfaces, Evaluator trap options)
* doc/ref/api-evaluation.texi (Evaluator Behavior): Remove references to
the evaluator traps interface.
Andy Wingo [Fri, 24 Sep 2010 16:34:02 +0000 (18:34 +0200)]
remove GDS
It is with a sigh that I do this. Farewell, old friend GDS; your bits
will live on, reclaimed and reused in the new debugger.
* module/Makefile.am:
* module/ice-9/gds-client.scm:
* module/ice-9/gds-server.scm: Remove these; we favor Geiser now.
* emacs/Makefile.am:
* emacs/gds-faq.txt:
* emacs/gds-scheme.el:
* emacs/gds-server.el:
* emacs/gds-test.el:
* emacs/gds-test.sh:
* emacs/gds-test.stdin:
* emacs/gds-tutorial.txt:
* emacs/gds.el: Remove GDS files. The docs are still around, as they
need to be folded into the docmentation of the new debugger.
Andy Wingo [Fri, 24 Sep 2010 16:24:41 +0000 (18:24 +0200)]
remove (ice-9 debugger) and (ice-9 debugging)
* module/ice-9/debugger.scm:
* module/ice-9/debugger/command-loop.scm:
* module/ice-9/debugger/commands.scm:
* module/ice-9/debugger/state.scm:
* module/ice-9/debugger/trc.scm:
* module/ice-9/debugger/utils.scm:
* module/ice-9/debugging/breakpoints.scm:
* module/ice-9/debugging/example-fns.scm:
* module/ice-9/debugging/ice-9-debugger-extensions.scm:
* module/ice-9/debugging/load-hooks.scm:
* module/ice-9/debugging/steps.scm:
* module/ice-9/debugging/trace.scm:
* module/ice-9/debugging/traps.scm:
* module/ice-9/debugging/trc.scm: Remove these files, as we will favor
the REPL's implementation of a debugger, and (system vm traps) and
(system vm trap-state). But these old files will continue to inspire
the rest of the new debugger interface.
Andy Wingo [Fri, 24 Sep 2010 16:09:47 +0000 (18:09 +0200)]
remove eval-options
* libguile/eval.c:
* libguile/private-options.h (scm_eval_opts, scm_eval_options_interface)
(SCM_EVAL_STACK): Remove these private interfaces.
* module/ice-9/boot-9.scm (eval-options, eval-enable, eval-disable)
(eval-set!): Remove these procedures.
* doc/ref/api-evaluation.texi:
* doc/ref/api-options.texi: Remove references to eval options.
Andy Wingo [Fri, 24 Sep 2010 16:04:05 +0000 (18:04 +0200)]
api-debug.texi updates
* doc/ref/api-debug.texi (Debugging, Evaluation Model)
(Source Properties): Fixes.
Andy Wingo [Fri, 24 Sep 2010 15:32:12 +0000 (17:32 +0200)]
fix ,traps REPL command
* module/system/repl/command.scm (traps): Fix this REPL meta-command.
Andy Wingo [Fri, 24 Sep 2010 14:28:33 +0000 (16:28 +0200)]
remove srcprop.[ch] things that have to do with breakpoints
* libguile/eval.c: Mark "breakpoints", "trace", and "procnames" debug
options as obsolete. There is lots of work left to do here, though.
* libguile/srcprop.h (scm_sym_breakpoint)
(scm_c_source_property_breakpoint_p, SRCBRKP): Remove these
definitions, without replacements.
* libguile/srcprop.c: Remove all code that has to do with breakpoints.
Ludovic Courtès [Fri, 24 Sep 2010 13:39:10 +0000 (15:39 +0200)]
Make `procedure-execution-count' fail gracefully when no source info is available.
* module/system/vm/coverage.scm (procedure-execution-count): Handle the
case where (null? (program-sources PROC)).
Ludovic Courtès [Fri, 24 Sep 2010 13:19:49 +0000 (15:19 +0200)]
Fix coverage analysis of procedures called from C.
* module/system/vm/coverage.scm (with-code-coverage): Switch current
thread to VM, using `set-thread-vm!'.
* test-suite/tests/coverage.test ("procedure-execution-count")["called
from C"]: New test.
Ludovic Courtès [Fri, 24 Sep 2010 13:15:43 +0000 (15:15 +0200)]
Remove unused declarations.
* libguile/vm.h (scm_vm_option_ref, scm_vm_option_set_x): Remove.
Ludovic Courtès [Fri, 24 Sep 2010 13:14:11 +0000 (15:14 +0200)]
Add `thread-vm' and `set-thread-vm!'.
* libguile/vm.c (thread_vm, scm_thread_vm, scm_set_thread_vm_x): New
functions.
(scm_the_vm): Add docstring. Use `thread_vm'.
* libguile/vm.h (scm_thread_vm, scm_set_thread_vm_x): New declarations.
* module/system/vm/vm.scm: Export `thread-vm' and `set-thread-vm!'.
Andy Wingo [Thu, 23 Sep 2010 16:09:50 +0000 (18:09 +0200)]
procedure traps can fire on nested procedures
* module/system/vm/traps.scm (frame-matcher): New helper.
(trap-at-procedure-call, trap-in-procedure, trap-in-dynamic-extent)
(trap-calls-in-dynamic-extent, trap-instructions-in-dynamic-extent)
(trap-instructions-in-procedure, trap-at-procedure-ip-in-range): Add
ability to trap on procedures that are closures.
(trap-at-source-location): Check source-closures first, to catch
source locations that are in nested procedures.
Andy Wingo [Thu, 23 Sep 2010 16:00:41 +0000 (18:00 +0200)]
system xref maintains source mapping for nested procedures too
* module/system/xref.scm (*closure-sources-db*): New global, like
*sources-db* but for nested procedures. It's a separate map because
these procs need to be treated differently in trap handlers -- you
match on the bytecode, not on the program object.
(add-source, forget-source): Take the db as an argument (the normal db
or the closures db).
(add-sources, forget-sources): Record sources for nested procedures to
in *closures-db*.
(untaint-sources, ensure-sources-db): Adapt for new closures db.
(lookup-source-procedures): Factored out.
(source-closures): New exported procedure, returns closures at the
given source location.
Ludovic Courtès [Fri, 24 Sep 2010 07:24:35 +0000 (09:24 +0200)]
Fix typo in `weaks.test'.
* test-suite/tests/weaks.test (valid?): Check for `value', not `val'.
Ludovic Courtès [Thu, 23 Sep 2010 20:34:31 +0000 (22:34 +0200)]
Fix bug #31081 (`lookahead-u8' returns an s8.)
Reported by Göran Weinholt <goran@weinholt.se>.
* libguile/r6rs-ports.c (scm_lookahead_u8): Return an unsigned byte.
* test-suite/tests/r6rs-ports.test ("7.2.8 Binary Input")["lookahead-u8:
result is unsigned"]: New test.
Ludovic Courtès [Thu, 23 Sep 2010 10:16:28 +0000 (12:16 +0200)]
Fixlet in `coverage.test'.
* test-suite/tests/coverage.test ("line-execution-counts")["several
times"]: Add missing `else' clause.
Ludovic Courtès [Thu, 23 Sep 2010 10:14:32 +0000 (12:14 +0200)]
Strengthen the weak hash table tests.
* test-suite/tests/weaks.test: Enclose in a module.
(valid?): New procedure.
("weak-hash")["weak-key dies, "weak-value dies", "double-weak dies"]:
Check that all the values are `valid?', in addition to checking that
at least one of them is #f.
Ludovic Courtès [Thu, 23 Sep 2010 09:51:28 +0000 (11:51 +0200)]
Fix weak-value hash tables.
* libguile/hashtab.c (scm_hash_fn_set_x): Register a disappearing link
to VAL when TABLE is weak-value.
* test-suite/tests/weaks.test ("weak-hash")["weak-key dies", "weak-value
dies", "doubly-weak dies"]: Use `hash-set!' and `hash-ref', not
`hashq-set!' and `hashq-ref', otherwise these tests would always
succeed because (eq? "this" "this") => #f.
["lives"]: Use `hash-ref' and `hash-set!' too for consistency.
Ludovic Courtès [Thu, 23 Sep 2010 08:55:24 +0000 (10:55 +0200)]
Define `equal?' for pointer objects.
* libguile/eq.c (scm_equal_p): Handle pointer objects.
* test-suite/tests/foreign.test ("make-pointer")["equal?", "equal?
modulo finalizer", "not equal?"]: New tests.
Andy Wingo [Thu, 23 Sep 2010 15:49:55 +0000 (17:49 +0200)]
add ,break-at-source
* module/system/vm/trap-state.scm (add-trap-at-source-location!): New
proc.
* module/system/repl/command.scm (break-at-source): New repl
meta-command. Doesn't work as well as it could now because it doesn't
know about nested functions, but that's coming.
Andy Wingo [Thu, 23 Sep 2010 15:28:15 +0000 (17:28 +0200)]
another trap printing tweak
* module/system/vm/trap-state.scm (add-trap-at-procedure-call!):
(add-trace-at-procedure-call!): Breakpoint / tracepoint name tweaks.
Andy Wingo [Thu, 23 Sep 2010 15:26:12 +0000 (17:26 +0200)]
list-traps just returns trap identifiers, not names
* module/system/vm/trap-state.scm (list-traps): Just return the integers
identifying the traps; people can use trap-name to get the names.
* module/system/repl/command.scm (traps): Adapt.
Andy Wingo [Thu, 23 Sep 2010 15:25:30 +0000 (17:25 +0200)]
trace printing tweak
* module/system/vm/trap-state.scm (add-trace-at-procedure-call!): Tweak
to the #:prefix string.
Andy Wingo [Thu, 23 Sep 2010 15:20:57 +0000 (17:20 +0200)]
more uniform break / tracepoint printing in repl
* module/system/repl/command.scm (break, tracepoint): In the message,
use the trap-name.
Andy Wingo [Thu, 23 Sep 2010 15:18:50 +0000 (17:18 +0200)]
add trap-name procedure
* module/system/vm/trap-state.scm (trap-name): New proc.
Andy Wingo [Thu, 23 Sep 2010 15:17:16 +0000 (17:17 +0200)]
tracepoints print their trap number
* module/system/vm/trace.scm (print-application, print-return): Add a
prefix before the printout.
(trace-calls-to-procedure, trace-calls-in-procedure): Add prefix
keyword args.
* module/system/vm/trap-state.scm (add-trace-at-procedure-call!): Give a
useful prefix for tracepoint printouts.
Andy Wingo [Thu, 23 Sep 2010 11:47:03 +0000 (13:47 +0200)]
add repl ,tracepoint command
* module/system/vm/trace.scm (print-return, print-application)
(frame-return-values): Factored out of other things.
(trace-calls-to-procedure): New proc, installs a trap tracing only
calls to the given proc.
(trace-calls-in-procedure): Refactor a bit.
* module/system/vm/trap-state.scm (add-trace-at-procedure-call!): New
proc.
* module/system/repl/command.scm (tracepoint): New command, installs a
tracepoint on a procedure.
Andy Wingo [Thu, 23 Sep 2010 11:45:15 +0000 (13:45 +0200)]
avoid traps in repl except when evaluating the expression
* module/system/vm/trap-state.scm (with-default-trap-handler): Don't
enable traps if we are setting a handler of #f.
* module/system/repl/error-handling.scm (call-with-error-handling): Add
#:trap-handler arg.
* module/system/repl/repl.scm (run-repl): Only have traps enabled while
running the thunk. Otherwise we trace on procedures called as part of
the repl.
Andy Wingo [Thu, 23 Sep 2010 11:42:12 +0000 (13:42 +0200)]
add trap-calls-to-procedure
* module/system/vm/traps.scm (trap-frame-finish): Use frame-address
instead of frame-dynamic-link.
(trap-calls-to-procedure): New proc, traps on procedure calls and
their corresponding returns.
Andy Wingo [Thu, 23 Sep 2010 11:19:49 +0000 (13:19 +0200)]
add scm_frame_address / frame-address
* libguile/frames.h:
* libguile/frames.c (scm_frame_address): New accessor, returns a frame's
fp.
Andy Wingo [Thu, 23 Sep 2010 09:56:21 +0000 (11:56 +0200)]
tracing in terms of traps
* module/system/vm/traps.scm (trap-frame-finish)
(trap-in-dynamic-extent, trap-calls-in-dynamic-extent)
(trap-instructions-in-dynamic-extent): New traps, for implementing
tracing, and the `finish' command.
* module/system/vm/trace.scm (trace-calls-in-procedure)
(trace-instructions-in-procedure): New tracing traps.
(vm-trace): Reimplement in terms of the new traps.
* module/system/vm/trap-state.scm (add-trap!): New helper; not used in
this commit, though.
Neil Jerram [Wed, 22 Sep 2010 00:27:31 +0000 (01:27 +0100)]
Explain examples of user-defined classes
* doc/ref/goops.texi (User-defined classes): New text added to explain
the example code.
Neil Jerram [Tue, 21 Sep 2010 23:52:30 +0000 (00:52 +0100)]
Explain built-in classes like <string>
* doc/ref/goops.texi (Built-in classes): New node.
(User-defined classes): Show is-a? v and class-of v here, instead of
in next node.
(Asking for the class of an object): Deleted, no longer needed.
Neil Jerram [Tue, 21 Sep 2010 23:20:38 +0000 (00:20 +0100)]
Improve GOOPS `Quick Start' doc
* doc/ref/goops.texi (Quick Start): Remove words that only reiterate
"quick start".
* doc/ref/goops.texi (Methods, User-defined classes, Asking for the
class of an object): Say "class" instead of "type". They
are called classes elsewhere, and in an object-oriented system, people
expect classes!
Neil Jerram [Tue, 21 Sep 2010 23:15:25 +0000 (00:15 +0100)]
Move GOOPS chapter's Stk copyright notice upfront
So as to enable more free refactoring of the rest of the chapter
* doc/ref/goops.texi (Copyright Notice): New section containing the
Stk copyright.
* doc/ref/goops-tutorial.texi (Copyright): Equivalent section here
deleted.
Neil Jerram [Sun, 12 Sep 2010 20:07:55 +0000 (21:07 +0100)]
GOOPS doc simplification
* doc/ref/goops.texi (GOOPS): Simplify the introductory blurb.
Andy Wingo [Tue, 21 Sep 2010 19:48:09 +0000 (21:48 +0200)]
(system repl command) cleanups
* module/system/repl/command.scm (profile, trace, inspect)
(pretty-print): Use repl-prepare-eval-thunk instead of the lower-level
compile and make-program.
Andy Wingo [Tue, 21 Sep 2010 19:37:11 +0000 (21:37 +0200)]
breakpoints from recursive prompts work
* module/system/vm/traps.scm (new-disabled-trap): Don't manipulate the
VM trace level in the enable and disable handlers. Unfortunately, this
makes traps not work unless you enable hooks, but given that
vm_dispatch_hook has to set trace-level to 0, there needs to be an
object with a broader view of what traps are enabled. That object is
the hook state.
* module/system/vm/trap-state.scm (trap-state->trace-level): New
procedure.
(with-default-trap-handler): Add an optional trap-state argument. Now
makes sure that the vm-trace-level is set appropriately during the
execution of the thunk, allowing for breakpoints from recursive
prompts.
Ludovic Courtès [Sun, 19 Sep 2010 22:00:44 +0000 (00:00 +0200)]
SRFI-1: Rewrite `alist-copy' in Scheme.
This partially reverts commit
b1fff4e793619b20342cba0015b9367680d3a0bd
(Sat Apr 2 2005).
* libguile/srfi-1.c (scm_srfi1_alist_copy): Remove.
* libguile/srfi-1.h (scm_srfi1_alist_copy): Remove declaration.
* module/srfi/srfi-1.scm (alist-copy): New procedure.
Ludovic Courtès [Sun, 19 Sep 2010 21:41:17 +0000 (23:41 +0200)]
Remove the SRFI-1 C proxies.
* libguile/srfi-1.c (srfi1_module, CACHE_VAR): Remove.
(scm_srfi1_break, scm_srfi1_break_x, scm_srfi1_car_plus_cdr,
scm_srfi1_drop_right_x, scm_srfi1_drop_while, scm_srfi1_eighth,
scm_srfi1_fifth, scm_srfi1_fold, scm_srfi1_last, scm_srfi1_list_index,
scm_srfi1_list_tabulate, scm_srfi1_lset_adjoin, scm_srfi1_ninth,
scm_srfi1_not_pair_p, scm_srfi1_reduce, scm_srfi1_reduce_right,
scm_srfi1_seventh, scm_srfi1_sixth, scm_srfi1_span, scm_srfi1_span_x,
scm_srfi1_take_x, scm_srfi1_take_while, scm_srfi1_take_while_x,
scm_srfi1_tenth, scm_srfi1_xcons): Remove.
* libguile/srfi-1.h: Remove the corresponding declarations.
Andy Wingo [Sun, 19 Sep 2010 10:20:58 +0000 (12:20 +0200)]
default-trap-handler bugfix
* module/system/vm/trap-state.scm (default-trap-handler): Fix thinko.
Göran Weinholt [Sat, 18 Sep 2010 16:35:30 +0000 (18:35 +0200)]
Fix make-variable-transformer export
* module/rnrs/syntax-case.scm: Add make-variable-transformer to the
imports. This was causing an unbound variable error even though
(rnrs) had been imported.
Andy Wingo [Sun, 19 Sep 2010 09:32:47 +0000 (11:32 +0200)]
add ,traps ,delete ,disable ,enable
* module/system/repl/command.scm (traps, delete, disable, enable): New
meta-commands.
Andy Wingo [Sun, 19 Sep 2010 09:16:32 +0000 (11:16 +0200)]
implement breakpoints in the repl
* module/system/vm/trap-state.scm: New file, tracks a VM-specific set of
traps.
* module/Makefile.am: Add trap-state.scm.
* module/system/repl/error-handling.scm: While in a with-error-handling
block, bind a default trap handler that invokes a recursive prompt.
* module/system/repl/command.scm: Add a `break' repl meta-command.
Andy Wingo [Fri, 17 Sep 2010 11:33:47 +0000 (13:33 +0200)]
add (system vm traps)
* module/system/vm/traps.scm: New module, implements higher-level traps
based on the VM hooks. Inspired by (ice-9 debugging traps). Instead of
the ice-9's variety, these traps have a procedural interface instead
of a GOOPS interface.
* module/Makefile.am: Add the new module.
Andy Wingo [Fri, 17 Sep 2010 08:59:36 +0000 (10:59 +0200)]
vm hooks run without hooks
* libguile/vm.c (vm_dispatch_hook): Run hooks with the trace-level set
to 0. We really don't want hooks running while hooks are running.
Andy Wingo [Thu, 16 Sep 2010 16:28:29 +0000 (18:28 +0200)]
fix bad Makefile.am addition
Andy Wingo [Thu, 16 Sep 2010 11:04:57 +0000 (13:04 +0200)]
instruction tracing tweak
* module/system/vm/trace.scm (vm-trace): No need to output the opcode
number, and display the ip as a decimal, not a hexidecimal.
Andy Wingo [Thu, 16 Sep 2010 10:58:59 +0000 (12:58 +0200)]
only trace instructions inside the thunk
* module/system/vm/trace.scm (vm-trace): Only trace instructions when
we're in the dynamic extent of the thunk.
Andy Wingo [Thu, 16 Sep 2010 10:52:17 +0000 (12:52 +0200)]
update vm hooks doc
* doc/ref/api-evaluation.texi (VM Behaviour): Half-hearted doc update.
Andy Wingo [Thu, 16 Sep 2010 10:48:41 +0000 (12:48 +0200)]
add vm-abort-continuation-hook, vm-restore-continuation-hook
* libguile/vm-i-system.c (call_cc, tail_call_cc): Call the new
RESTORE_CONTINUATION_HOOK when a continuation is restored.
(prompt): Call the new ABORT_CONTINUATION_HOOK when entering the abort
handler's continuation.
* libguile/vm-engine.h (ABORT_CONTINUATION_HOOK)
(RESTORE_CONTINUATION_HOOK):
* libguile/vm.h (SCM_VM_ABORT_CONTINUATION_HOOK)
(SCM_VM_RESTORE_CONTINUATION_HOOK):
* libguile/vm.c: (scm_vm_abort_continuation_hook): New hook, called when
entering an abort handler.
(scm_vm_restore_continuation_hook): New hook, called after returning
to a continuation.
* module/system/vm/vm.scm: Add hooks to export list.
Andy Wingo [Thu, 16 Sep 2010 10:14:55 +0000 (12:14 +0200)]
trim our set of vm hooks
* libguile/vm.h (SCM_VM_PUSH_CONTINUATION_HOOK)
(SCM_VM_POP_CONTINUATION_HOOK): New hooks, to replace
enter/exit/return.
(SCM_VM_BOOT_HOOK, SCM_VM_HALT_HOOK, SCM_VM_BREAK_HOOK): Remove these
useless hooks.
* libguile/vm.c (scm_vm_push_continuation_hook)
(scm_vm_pop_continuation_hook): New accessors.
* libguile/vm-i-system.c: Remove boot, halt, break, enter, exit, and
return hooks. Also remove the break instruction. Instead now when we
push a new continuation onto the stack we call PUSH_CONTINUATION_HOOK,
and when we pop via a return we call POP_CONTINUATION_HOOK. APPLY_HOOK
is now decoupled from continuation pushes and pops.
* libguile/vm-engine.h:
* libguile/vm-engine.c: Adapt for hooks.
* module/system/vm/trace.scm (vm-trace): Adapt for hooks. Also revive
the #:instructions? #t mode.
* module/system/vm/vm.scm: Adapt exports for new set of hooks.
Andy Wingo [Thu, 16 Sep 2010 10:03:10 +0000 (12:03 +0200)]
remove unused (system vm profile)
* module/Makefile.am:
* module/system/vm/profile.scm: Remove (system vm profile). We use
statprof.
Ludovic Courtès [Wed, 15 Sep 2010 21:32:28 +0000 (23:32 +0200)]
Fix write-beyond-end-of-string error in the conversion to R6RS string escapes.
Reported by Mike Gran <spk121@yahoo.com>.
* libguile/strings.c (scm_i_unistring_escapes_to_guile_escapes,
scm_i_unistring_escapes_to_r6rs_escapes): Augment comments.
(scm_to_stringn): When `handler ==
SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE && SCM_R6RS_ESCAPES_P', realloc
BUF so that it's large enough for the worst case.
* libguile/print.c (display_character): When `result != NULL && strategy
== SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE && SCM_R6RS_ESCAPES_P', make
LOCALE_ENCODED large enough to hold an R6RS escape.
Ludovic Courtès [Wed, 15 Sep 2010 16:38:57 +0000 (18:38 +0200)]
Optimize `peek-char'.
This makes `peek-char' 40x faster on a port whose encoding is
faster on a UTF-8 port containing multi-byte codepoints.
The `xml->sxml' procedure is 4x faster on a 2.7 MiB XML file.
* libguile/ports.c (get_codepoint): New procedure, moved here from
`scm_getc', with the additional BUF and LEN parameters.
(scm_getc): Use it.
(scm_peek_char): Use it instead of the `scm_getc'/`scm_ungetc'
sequence.
* test-suite/tests/ports.test ("string ports")["peek-char [latin-1]",
"peek-char [utf-8]"]: New tests.
* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
`benchmarks/ports.bm'.
* benchmark-suite/benchmarks/ports.bm: New file.
Ludovic Courtès [Wed, 15 Sep 2010 16:27:47 +0000 (18:27 +0200)]
Fix copyright year and module name of `write.bm'.
* benchmark-suite/benchmarks/write.bm: Fix copyright year and module
name.
Ludovic Courtès [Tue, 14 Sep 2010 22:52:40 +0000 (00:52 +0200)]
Re-introduce pretty-printing of combining characters.
This had been removed by commit
07f49ac786e0f1c007eb336e2fb7a572e8405316
("Factorize and optimize `write' for strings and characters.").
Thanks Mike!
* libguile/print.c (write_combining_character): New procedure.
(write_character): Use it.
* test-suite/tests/chars.test ("basic char handling")["combining accent
is pretty-printed", "combining X is pretty-printed"]: New tests.
* test-suite/tests/encoding-iso88591.test ("characters")["write A
followed by combining accent"]: New test.
* test-suite/tests/encoding-utf8.test ("characters")["write A followed
by combining accent"]: New test.
Ludovic Courtès [Tue, 14 Sep 2010 14:09:11 +0000 (16:09 +0200)]
Remove commented out code from `print.c'.
* libguile/print.c (scm_write, scm_display, scm_write_char): Remove
`#if 0'-d code.
Ludovic Courtès [Tue, 14 Sep 2010 14:10:52 +0000 (16:10 +0200)]
Factorize and optimize `write' for strings and characters.
According to `write.bm', this makes `write' 2.6 times faster for strings.
* libguile/print.c (iprin1): Use `write_character' when
`SCM_WRITINGP (pstate)' and `SCM_CHARP (exp)' or `scm_is_string (exp)'.
(scm_i_charprint): Remove.
(display_character, write_character): New functions.
(scm_write_char): Use `display_character' instead of
`scm_i_charprint'.
* libguile/print.h (scm_i_charprint): Remove declaration.
* benchmark-suite/benchmarks/write.bm: New file.
* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
`benchmarks/write.bm'.
Ludovic Courtès [Tue, 14 Sep 2010 14:04:26 +0000 (16:04 +0200)]
Internally expose `scm_i_unistring_escapes_to_{guile,r6rs}_escapes'.
* libguile/strings.c (unistring_escapes_to_guile_escapes): Rename to...
(scm_i_unistring_escapes_to_guile_escapes): ... this. Change `char **bufp'
to `char *buf'; leave realloc responsibility to the caller. Update caller.
(unistring_escapes_to_r6rs_escapes): Rename to...
(scm_i_unistring_escapes_to_r6rs_escapes): ... this. Likewise.
Andy Wingo [Sun, 12 Sep 2010 21:44:16 +0000 (23:44 +0200)]
doc/ref lib-version.texi removal
* doc/ref/.gitignore:
* doc/ref/Makefile.am:
* doc/ref/guile.texi: Remove rules for generating an unused
lib-version.texi.
Andy Wingo [Sun, 12 Sep 2010 21:39:52 +0000 (23:39 +0200)]
libguile gitignore
* libguile/.gitignore: Fix for recent cpp-{E,SIG} change.
Andy Wingo [Sun, 12 Sep 2010 21:30:43 +0000 (23:30 +0200)]
build tweak to remove SRFI version definitions
* GUILE-VERSION: Remove SRFI version definitions, as they are no longer
needed.
Andy Wingo [Sun, 12 Sep 2010 21:18:54 +0000 (23:18 +0200)]
move srfi-1 and srfi-60 C impl to libguile, without public C api
* libguile/srfi-1.c:
* libguile/srfi-1.h:
* libguile/srfi-60.c:
* libguile/srfi-60.h:
* libguile/ChangeLog-srfi: Move here, from the srfi/ dir. The C API is
internal. Add API to register the extensions, called by init.c.
* libguile/init.c: Verily, register srfi extensions.
* libguile/Makefile.am: Add srfi files.
* module/srfi/srfi-1.scm:
* module/srfi/srfi-60.scm: Update load-extension invocation.
* Makefile.am:
* configure.ac: Remove srfi/ dir.
* test-suite/standalone/Makefile.am:
* test-suite/standalone/test-srfi-1.c: Remove srfi-1 C test, we don't
support this API any more.
Andy Wingo [Sun, 12 Sep 2010 20:41:15 +0000 (22:41 +0200)]
remove empty srfi-4, srfi-13, and srfi-14 shlibs
* srfi/srfi-13.c:
* srfi/srfi-13.h:
* srfi/srfi-14.c:
* srfi/srfi-14.h:
* srfi/srfi-4.c:
* srfi/srfi-4.h:
* srfi/Makefile.am:
* configure.ac: Remove empty shlibs and headers for srfis 4, 13, and
14. The "version" was never programmatically exported, so there's no
possible way people could have used these.
Neil Jerram [Sat, 11 Sep 2010 17:39:00 +0000 (18:39 +0100)]
Create tags for Scheme source
* am/guilec: Set ETAGS_ARGS.
* module/Makefile.am: When adding sources to EXTRA_DIST, add them to
ETAGS_ARGS too.
Michael Gran [Sun, 12 Sep 2010 15:29:31 +0000 (08:29 -0700)]
Provide non-locale C/Scheme string conversion functions
* doc/ref/api-data.texi: document scm_to_stringn, scm_from_stringn,
scm_to_latin1_stringn, and scm_from_latin1_stringn
* libguile/strings.h (scm_to_stringn): make public
(scm_to_latin1_stringn): new declaration
(scm_from_latin1_stringn): new declaration
* libguile/strings.c (scm_to_latin1_stringn): new function
(scm_from_latin1_stringn): new function
Neil Jerram [Sat, 11 Sep 2010 17:37:02 +0000 (18:37 +0100)]
Document scm_wrong_type_arg_msg
* doc/ref/api-control.texi: New def for scm_wrong_type_arg_msg.