bpt/guile.git
13 years agoEdit define-class doc
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.

13 years agoRemove unwarranted para
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.

13 years agoEdit text about the MOP
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.

13 years agoStart separating doc of the metaobject protocol from that of basic GOOPS usage
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'.

13 years agoPromote subsections inside the GOOPS "Reference Manual" section
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.

13 years agoIncorrect parsing of NaN complex numbers
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

13 years agoremove vm-version, vm options
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.

13 years agofix up options.test
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.

13 years agostatprof test traps fix; re-enable accurate call counting test
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 :)

13 years agofix eval.test for procnames eval option
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.

13 years agoremove a number of debug options
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.

13 years agoremove evaluator-traps-interface
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.

13 years agoremove GDS
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.

13 years agoremove (ice-9 debugger) and (ice-9 debugging)
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.

13 years agoremove eval-options
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.

13 years agoapi-debug.texi updates
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.

13 years agofix ,traps REPL command
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.

13 years agoremove srcprop.[ch] things that have to do with breakpoints
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.

13 years agoMake `procedure-execution-count' fail gracefully when no source info is available.
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)).

13 years agoFix coverage analysis of procedures called from C.
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.

13 years agoRemove unused declarations.
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.

13 years agoAdd `thread-vm' and `set-thread-vm!'.
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!'.

13 years agoprocedure traps can fire on nested procedures
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.

13 years agosystem xref maintains source mapping for nested procedures too
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.

13 years agoFix typo in `weaks.test'.
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'.

13 years agoFix bug #31081 (`lookahead-u8' returns an s8.)
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.

13 years agoFixlet in `coverage.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.

13 years agoStrengthen the weak hash table tests.
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.

13 years agoFix weak-value hash tables.
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.

13 years agoDefine `equal?' for pointer objects.
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.

13 years agoadd ,break-at-source
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.

13 years agoanother trap printing tweak
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.

13 years agolist-traps just returns trap identifiers, not names
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.

13 years agotrace printing tweak
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.

13 years agomore uniform break / tracepoint printing in repl
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.

13 years agoadd trap-name procedure
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.

13 years agotracepoints print their trap number
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.

13 years agoadd repl ,tracepoint command
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.

13 years agoavoid traps in repl except when evaluating the expression
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.

13 years agoadd trap-calls-to-procedure
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.

13 years agoadd scm_frame_address / frame-address
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.

13 years agotracing in terms of traps
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.

13 years agoExplain examples of user-defined classes
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.

13 years agoExplain built-in classes like <string>
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.

13 years agoImprove GOOPS `Quick Start' doc
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!

13 years agoMove GOOPS chapter's Stk copyright notice upfront
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.

13 years agoGOOPS doc simplification
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.

13 years ago(system repl command) cleanups
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.

13 years agobreakpoints from recursive prompts work
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.

13 years agoSRFI-1: Rewrite `alist-copy' in Scheme.
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.

13 years agoRemove the SRFI-1 C proxies.
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.

13 years agodefault-trap-handler bugfix
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.

13 years agoFix make-variable-transformer export
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.

13 years agoadd ,traps ,delete ,disable ,enable
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.

13 years agoimplement breakpoints in the repl
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.

13 years agoadd (system vm traps)
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.

13 years agovm hooks run without hooks
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.

13 years agofix bad Makefile.am addition
Andy Wingo [Thu, 16 Sep 2010 16:28:29 +0000 (18:28 +0200)]
fix bad Makefile.am addition

13 years agoinstruction tracing tweak
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.

13 years agoonly trace instructions inside the thunk
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.

13 years agoupdate vm hooks doc
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.

13 years agoadd vm-abort-continuation-hook, vm-restore-continuation-hook
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.

13 years agotrim our set of vm hooks
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.

13 years agoremove unused (system vm profile)
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.

13 years agoFix write-beyond-end-of-string error in the conversion to R6RS string escapes.
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.

13 years agoOptimize `peek-char'.
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.

13 years agoFix copyright year and module name of `write.bm'.
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.

13 years agoRe-introduce pretty-printing of combining characters.
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.

13 years agoRemove commented out code from `print.c'.
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.

13 years agoFactorize and optimize `write' for strings and characters.
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'.

13 years agoInternally expose `scm_i_unistring_escapes_to_{guile,r6rs}_escapes'.
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.

13 years agodoc/ref lib-version.texi removal
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.

13 years agolibguile gitignore
Andy Wingo [Sun, 12 Sep 2010 21:39:52 +0000 (23:39 +0200)]
libguile gitignore

* libguile/.gitignore: Fix for recent cpp-{E,SIG} change.

13 years agobuild tweak to remove SRFI version definitions
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.

13 years agomove srfi-1 and srfi-60 C impl to libguile, without public C api
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.

13 years agoremove empty srfi-4, srfi-13, and srfi-14 shlibs
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.

13 years agoCreate tags for Scheme source
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.

13 years agoProvide non-locale C/Scheme string conversion functions
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

13 years agoDocument scm_wrong_type_arg_msg
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.

13 years agoRemove non-existent *environment* APIs from api-undocumented.texi
Neil Jerram [Sat, 11 Sep 2010 15:34:19 +0000 (16:34 +0100)]
Remove non-existent *environment* APIs from api-undocumented.texi

* doc/ref/api-undocumented.texi: Remove entries for the never used,
  and now removed, environment API.

13 years agoRemove unnecessary blank "Indices" page.
Neil Jerram [Sat, 11 Sep 2010 14:45:05 +0000 (15:45 +0100)]
Remove unnecessary blank "Indices" page.

* doc/ref/guile.texi: Remove `Indices' heading.

13 years agonew procedure: source-procedures
Andy Wingo [Fri, 10 Sep 2010 11:29:56 +0000 (13:29 +0200)]
new procedure: source-procedures

* module/system/xref.scm (source-procedures): New public procedure,
  gives the procedures defined at a given source location.

13 years ago(system xref) uses module-submodules
Andy Wingo [Fri, 10 Sep 2010 10:55:09 +0000 (12:55 +0200)]
(system xref) uses module-submodules

* module/system/xref.scm (ensure-callers-db): Fix up to use
  module-submodules.

13 years agoregenerate psyntax-pp.scm
Andy Wingo [Fri, 10 Sep 2010 09:03:59 +0000 (11:03 +0200)]
regenerate psyntax-pp.scm

* module/ice-9/psyntax-pp.scm: Regenerate.

13 years agosimplify module/Makefile.am rules to not require touch
Andy Wingo [Fri, 10 Sep 2010 09:01:23 +0000 (11:01 +0200)]
simplify module/Makefile.am rules to not require touch

* module/Makefile.am (ice-9/psyntax-pp.go, ice-9/psyntax-pp.scm.gen)
  (ice-9/eval.go): Simplify rules to not require `touch', now that .go
  files are checked for freshness, not for synchronicity.

13 years agoClarify feature macro conditionals.
Ludovic Courtès [Tue, 7 Sep 2010 22:38:49 +0000 (00:38 +0200)]
Clarify feature macro conditionals.

* libguile/numbers.c (scm_log10): Check whether `HAVE_COMPLEX_DOUBLE'
  and `HAVE_CLOG10' are defined instead of checking whether they are
  non-zero.
  (scm_sqrt): Likewise for `HAVE_COMPLEX_DOUBLE' and
  `HAVE_USABLE_CSQRT'.

13 years agoUse Gnulib's `isnan' and `isinf' modules.
Ludovic Courtès [Tue, 7 Sep 2010 22:34:27 +0000 (00:34 +0200)]
Use Gnulib's `isnan' and `isinf' modules.

This updates Gnulib to v0.0-4219-g84cdd8b.

* m4/gnulib-cache.m4: Add `isinf' and `isnan'.

* configure.ac: Remove checks for `floatingpoint.h', `ieeefp.h', and
  `nan.h'.

* libguile/gen-scmconfig.c (main): Remove definitions of
  `SCM_HAVE_FLOATINGPOINT_H', `SCM_HAVE_IEEEFP_H', and
  `SCM_HAVE_NAN_H'.

* libguile/numbers.c (isnan)[SCO && !HAVE_ISNAN]: Remove.
  (isinf)[SCO && !HAVE_ISINF]: Remove.
  (xisinf, xisnan): Remove.  Change callers to use `isinf' and `isnan'.
  (guile_ieee_init): Remove the `defined HAVE_ISINF' and `define
  HAVE_ISNAN' conditions.

* libguile/numbers.h: Remove code conditional on
  `SCM_HAVE_FLOATINGPOINT_H', `SCM_HAVE_IEEEFP_H', or `SCM_HAVE_NAN_H'.

13 years agoUse `have-lib' when checking for libltdl.
Ludovic Courtès [Mon, 6 Sep 2010 20:49:24 +0000 (22:49 +0200)]
Use `have-lib' when checking for libltdl.

Suggested by primus <rprimus@gmail.com>.

* configure.ac: Use `AC_LIB_HAVE_LINKFLAGS' when checking for libltdl.

* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD):
  Add $(LTLIBLTDL).

* README: Update to make it clear that libgc and libffi don't have a
  `--with-XXX-prefix' option.

13 years agoRename `make-foreign-function' to `pointer->procedure'.
Ludovic Courtès [Mon, 6 Sep 2010 20:24:44 +0000 (22:24 +0200)]
Rename `make-foreign-function' to `pointer->procedure'.

* libguile/foreign.c (scm_make_foreign_function): Rename to...
  (scm_pointer_to_procedure): ... this.
* libguile/foreign.h: Adjust accordingly.
* module/system/foreign.scm: Likewise.
* test-suite/standalone/test-ffi: Likewise.
* test-suite/tests/foreign.test: Likewise.
* doc/ref/api-foreign.texi: Likewise.

13 years agofix to program-module
Andy Wingo [Mon, 6 Sep 2010 11:58:13 +0000 (13:58 +0200)]
fix to program-module

* libguile/programs.c (scm_program_module): Fix an edge case in which
  this function returned non-modules. Thanks to José Antonio Ortega
  Ruiz, Caballero del Cálculo Lambda for the report.

13 years agoAdd `.version' to the distribution.
Ludovic Courtès [Sat, 4 Sep 2010 18:37:34 +0000 (20:37 +0200)]
Add `.version' to the distribution.

* Makefile.am (EXTRA_DIST): Add `.version'.  Remove `m4/autobuild.m4'.

13 years agoBump version number for 1.9.12.
Ludovic Courtès [Sat, 4 Sep 2010 18:20:14 +0000 (20:20 +0200)]
Bump version number for 1.9.12.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

13 years agofix guile-tools --help and --version
Andy Wingo [Sat, 4 Sep 2010 18:00:33 +0000 (11:00 -0700)]
fix guile-tools --help and --version

* meta/guile-tools.in: Fix --help and --version.

13 years agoboot-9 refactor
Andy Wingo [Sat, 4 Sep 2010 17:24:52 +0000 (10:24 -0700)]
boot-9 refactor

* module/ice-9/boot-9.scm (make-root-module, make-scm-module): Remove
  these functions; they are only called once, so we inline them at their
  call sites.
  (the-root-module, the-scm-module): The aforementioned call sites.

13 years agoUpdate `NEWS' for 1.9.12.
Ludovic Courtès [Sat, 4 Sep 2010 14:56:15 +0000 (16:56 +0200)]
Update `NEWS' for 1.9.12.

* NEWS: Update.

13 years agoDon't say "source file is newer" when either file is inaccessible.
Ludovic Courtès [Sat, 4 Sep 2010 14:13:42 +0000 (16:13 +0200)]
Don't say "source file is newer" when either file is inaccessible.

* libguile/load.c (compiled_is_fresh): Don't emit "source file is newer"
  warning when either FULL_FILENAME or COMPILED_FILENAME could not be
  stat'd.  This is consistent with what load/compiled-file-name do.

13 years agoCompare source/compiled file timestamps with nano-second resolution.
Ludovic Courtès [Sat, 4 Sep 2010 14:07:58 +0000 (16:07 +0200)]
Compare source/compiled file timestamps with nano-second resolution.

* libguile/load.c (compiled_is_fresh): Rename `res' to
  `compiled_is_newer'.  Use `get_stat_mtime' to compare with nano-second
  resolution when available.

* module/ice-9/boot-9.scm (load)[fresh-compiled-file-name]: Likewise,
  using `stat:mtimensec'.

13 years agoUse Gnulib's `stat-time' module; update Gnulib.
Ludovic Courtès [Sat, 4 Sep 2010 13:16:35 +0000 (15:16 +0200)]
Use Gnulib's `stat-time' module; update Gnulib.

This updates Gnulib files to v0.0-4207-gc82b481.

* m4/gnulib-cache.m4: Add `stat-time'.

13 years agoAdd an entertaining `procedure->pointer' test.
Ludovic Courtès [Sat, 4 Sep 2010 12:38:20 +0000 (14:38 +0200)]
Add an entertaining `procedure->pointer' test.

* test-suite/tests/foreign.test ("procedure->pointer")["bijection"]: New
  test.

13 years agoFix the `put-bytevector' tests.
Ludovic Courtès [Fri, 3 Sep 2010 14:23:02 +0000 (16:23 +0200)]
Fix the `put-bytevector' tests.

* libguile/vports.c (sf_write): Add comment about what happens when DATA
  contains binary data.

* test-suite/tests/r6rs-ports.test ("7.2.11 Binary
  Output")["put-bytevector [2 args]", "put-bytevector [3 args]",
  "put-bytevector [4 args]"]: Require a Latin-1 locale.