bpt/guile.git
13 years agobugfixes and simplifications to ice-9 buffered-input.
Andy Wingo [Tue, 5 Oct 2010 17:55:37 +0000 (19:55 +0200)]
bugfixes and simplifications to ice-9 buffered-input.

* module/ice-9/buffered-input.scm (make-buffered-input-port): Simplify,
  and fix one case in which we would buffer the EOF object.

13 years agoguile-readline slight modernization
Andy Wingo [Tue, 5 Oct 2010 17:38:21 +0000 (19:38 +0200)]
guile-readline slight modernization

* guile-readline/Makefile.am: Update to use am/guilec.

* guile-readline/ice-9/readline.scm (activate-readline): Update to use a
  lambda*.

13 years agoRevert "repl.scm next-char needed to read EOF from port"
Andy Wingo [Mon, 4 Oct 2010 20:54:41 +0000 (22:54 +0200)]
Revert "repl.scm next-char needed to read EOF from port"

Actually peek-char => EOF does not guarantee that read-char => EOF. I
don't know what to do about this.

This reverts commit 6e1dccc42f9ec81e04524ccc0956c692ee423576.

13 years agoEdit section on generic functions
Neil Jerram [Sun, 3 Oct 2010 22:22:03 +0000 (23:22 +0100)]
Edit section on generic functions

* doc/ref/goops.texi (Generic Functions and Accessors): Renamed from
  `Creating Generic Functions'.  Explain what an accessor is.
  (Basic Generic Function Creation): Clarify the point of the text
  about generics having short names.

13 years agoEdit section on slot access
Neil Jerram [Sun, 3 Oct 2010 22:20:17 +0000 (23:20 +0100)]
Edit section on slot access

* doc/ref/goops.texi (Instance Slots): Remove a little verbosity.
  (Class Slots): Correct one `slot-missing' to `slot-unbound'.

13 years agoTypeset Ludo's name correctly
Neil Jerram [Sun, 3 Oct 2010 22:17:54 +0000 (23:17 +0100)]
Typeset Ludo's name correctly

* doc/ref/history.texi (A Scheme of Many Maintainers): Add
  TeX-specific version of `Courtès'.

13 years agoavoid some double-breaks in trap-at-procedure-ip-in-range
Andy Wingo [Sun, 3 Oct 2010 21:09:32 +0000 (23:09 +0200)]
avoid some double-breaks in trap-at-procedure-ip-in-range

* module/system/vm/traps.scm (trap-at-procedure-ip-in-range): Rework not
  to call the handler when returning to a frame that was already
  entered. So now breaking at foo.scm:1234 doesn't break when returning
  to that line.

13 years agorepl.scm next-char needed to read EOF from port
Andy Wingo [Sun, 3 Oct 2010 21:08:27 +0000 (23:08 +0200)]
repl.scm next-char needed to read EOF from port

* module/system/repl/repl.scm (next-char): Actually read off the EOF if
  we got one. Interesting, this.

13 years agoAdd implementation of SRFI 45
Andreas Rottmann [Sun, 3 Oct 2010 19:54:22 +0000 (21:54 +0200)]
Add implementation of SRFI 45

* module/srfi/srfi-45.scm: New file, containing the reference implementation of
  SRFI 45, slightly adapted to use SRFI-9.
* module/Makefile.am (SRFI_SOURCES): Added srfi/srfi-45.scm.

* test-suite/tests/srfi-45.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-45.test.

* doc/ref/srfi-modules.texi (SRFI-45): New node and subsection;
  essentially a shortended transcript of the SRFI-45 specification.

13 years agoAdd v1.8.x backward compatiblity to GUILE_SITE_DIR
Michael Gran [Sat, 2 Oct 2010 21:29:14 +0000 (14:29 -0700)]
Add v1.8.x backward compatiblity to GUILE_SITE_DIR

* meta/guile.m4 (GUILE_SITE_DIR): use pkgdatadir if no sitedir

13 years agosrfi-67 #:replace work
Andy Wingo [Sun, 3 Oct 2010 10:18:14 +0000 (12:18 +0200)]
srfi-67 #:replace work

* module/srfi/srfi-67.scm (string-compare, string-compare-ci): #:replace
  these bindings.

13 years agoAdd implementation of SRFI-67
Andreas Rottmann [Sun, 3 Oct 2010 10:14:21 +0000 (12:14 +0200)]
Add implementation of SRFI-67

* module/srfi/srfi-67/compare.scm: New file; reference implementation of
  SRFI 67.
* module/srfi/srfi-67.scm: New module; includes the refernce
  implementation.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-67.scm.
  (NOCOMP_SOURCES): Add srfi/srfi-67/compare.scm.

* test-suite/tests/srfi-67.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-67.test.

13 years agoAdd implementation of SRFI 42
Andreas Rottmann [Sun, 3 Oct 2010 10:06:38 +0000 (12:06 +0200)]
Add implementation of SRFI 42

* module/srfi/srfi-42/ec.scm: New file; reference implementation of
  SRFI 42.
* module/srfi/srfi-42.scm: New file; module for SRFI 42.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-42.scm.
  (NOCOMP_SOURCES): Add srfi/srfi-42/ec.scm.

* test-suite/tests/srfi-42.test: New file; test suite for SRFI 42.
* test-suite/Makefile.am: SCM_TESTS: Add tests/srfi-42.test.

13 years agoReference original specification in SRFI 27 documentation
Andreas Rottmann [Sun, 3 Oct 2010 09:55:24 +0000 (11:55 +0200)]
Reference original specification in SRFI 27 documentation

* doc/ref/srfi-modules.texi (SRFI-27): Link to the original
  specification of SRFI-27.

13 years agobugfixen in source breakpoints and in-procedure traps
Andy Wingo [Sun, 3 Oct 2010 09:12:36 +0000 (11:12 +0200)]
bugfixen in source breakpoints and in-procedure traps

* module/system/vm/traps.scm (trap-in-procedure): If we are
  (re-)entering the procedure from a return, call the enter-proc with
  the returnee, not the returner.
  (in-range?): Tighten up a bit.
  (program-sources-before-retire): New helper, like program-sources but
  indexed before instructions are retired instead of after.
  (program-sources-by-line): Use program-sources-before-retire so that
  we can break on instructions by source line *before* those
  instructions are executed.

13 years agoFlatten `Miscellaneous Functions'
Neil Jerram [Sat, 2 Oct 2010 15:24:14 +0000 (16:24 +0100)]
Flatten `Miscellaneous Functions'

* doc/ref/goops.texi (Miscellaneous Functions): Delete this container
  section, and promote its subsections.

13 years agoCustomizing Instance Creation to metaobject protocol section
Neil Jerram [Sat, 2 Oct 2010 15:12:32 +0000 (16:12 +0100)]
Customizing Instance Creation to metaobject protocol section

* doc/ref/goops.texi (Customizing Instance Creation): Moved from
  `Creating Instances' to `The Metaobject Protocol'.

* doc/ref/goops.texi (Basic Instance Creation): Flattened into parent
  `Creating Instances', refs updated accordingly.

13 years agoRemove goops-version, which is no longer defined
Neil Jerram [Sat, 2 Oct 2010 15:10:56 +0000 (16:10 +0100)]
Remove goops-version, which is no longer defined

* doc/ref/goops.texi (Administrative Functions): Removed.

* module/oop/goops.scm (oop): Don't export `goops-version'.

13 years agoRemove doc of STKlos compatibility
Neil Jerram [Sat, 2 Oct 2010 14:39:14 +0000 (15:39 +0100)]
Remove doc of STKlos compatibility

As module/oop/goops/stklos.scm, the available compatibility is
superficial only, so it isn't worth documenting.

* doc/ref/goops.texi (STKlos Compatibility): Removed.

13 years agoContinue separating simple and more complex GOOPS doc
Neil Jerram [Sat, 2 Oct 2010 14:36:46 +0000 (15:36 +0100)]
Continue separating simple and more complex GOOPS doc

* doc/ref/goops.texi (Defining New Classes): Move `Class Definition
  Internals' and `Customizing Class Definition' notes to the
  metaobject protocol section.

13 years agosource breakpoints accept user line numbers
Andy Wingo [Fri, 1 Oct 2010 16:25:44 +0000 (18:25 +0200)]
source breakpoints accept user line numbers

* module/system/vm/trap-state.scm (add-trap-at-source-location!):
* module/system/vm/traps.scm (trap-at-source-location): Rename "line"
  argument to "user-line", indicating that the line is one-based instead
  of zero-based. Decrement the line before handing off to
  source-closures-or-procedures and source->ip-range.

13 years agoadd source:line-for-user, returning a 1-indexed line number
Andy Wingo [Fri, 1 Oct 2010 16:15:23 +0000 (18:15 +0200)]
add source:line-for-user, returning a 1-indexed line number

* module/system/vm/program.scm (source:line-for-user): New exported
  procedure, returns a 1-indexed line, suitable for presentation to a
  user.
  (write-program): Use source:line-for-user when making fallback names.

* module/system/vm/coverage.scm (coverage-data->lcov):
* module/language/assembly/disassemble.scm (source->string):
* module/system/repl/debug.scm (print-frame): Use source:line-for-user.

13 years agoapi-debug tweak
Andy Wingo [Fri, 1 Oct 2010 15:26:41 +0000 (17:26 +0200)]
api-debug tweak

* doc/ref/api-debug.texi (Debug Options): Fix wording.

13 years agoupdate api-debug.texi discussion of stack overflow
Andy Wingo [Fri, 1 Oct 2010 15:11:25 +0000 (17:11 +0200)]
update api-debug.texi discussion of stack overflow

* doc/ref/api-debug.texi (Debug Options): Update stack overflow
  discussion.

13 years agoc stack overflow checked for, once more
Andy Wingo [Fri, 1 Oct 2010 14:47:39 +0000 (16:47 +0200)]
c stack overflow checked for, once more

* libguile/stackchk.h: Include private-options.h if we are building
  guile.

* libguile/vm.c (scm_c_vm_run): Check for C stack overflow before
  entering the engine.

13 years agoscm_report_stack_overflow eventually resets scm_stack_checking_enabled_p
Andy Wingo [Fri, 1 Oct 2010 14:36:34 +0000 (16:36 +0200)]
scm_report_stack_overflow eventually resets scm_stack_checking_enabled_p

* libguile/stackchk.c (scm_report_stack_overflow): Surround in a
  dynwind, so that scm_stack_checking_enabled_p is reset when the error
  throws.

13 years agoFix typo in configure.ac
Neil Jerram [Thu, 30 Sep 2010 23:11:18 +0000 (00:11 +0100)]
Fix typo in configure.ac

Fixes an error when running ./configure:
./configure: line 31873: text: command not found

* configure.ac: Change "text" to "test", in libltdl-related code.

13 years agodeprecate turn-on-debugging, it is obsolete
Andy Wingo [Fri, 1 Oct 2010 11:17:44 +0000 (13:17 +0200)]
deprecate turn-on-debugging, it is obsolete

* libguile/script.c (scm_compile_shell_switches): Don't generate calls
  to turn-on-debugging.

* module/ice-9/boot-9.scm (turn-on-debugging): Remove.

* module/ice-9/deprecated.scm (turn-on-debugging): Add deprecated shim.

13 years agoscm_debug_opts to debug.c, backtrace on by default, scm_*_opts internal linkage
Andy Wingo [Fri, 1 Oct 2010 11:11:51 +0000 (13:11 +0200)]
scm_debug_opts to debug.c, backtrace on by default, scm_*_opts internal linkage

* libguile/eval.c:
* libguile/debug.c (scm_debug_opts): Move here, from eval.c. Change
  SCM_BACKTRACE_P to 1, initially.

* libguile/private-options.h: Make all options vars private.

13 years agodocument call-with-error-handling
Andy Wingo [Fri, 1 Oct 2010 11:03:08 +0000 (13:03 +0200)]
document call-with-error-handling

* doc/ref/api-debug.texi (Pre-Unwind Debugging): Document
  call-with-error-handling.

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

13 years agoupdate tour.texi
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 ...).

13 years agofinish cleaning out api-options.texi
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.

13 years agodebug and readline options doc tweak
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.

13 years agomove read and print options docs to the procedures they parameterize
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.

13 years agoremove elisp-strings and elisp-vectors read options
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.

13 years ago(foo-options 'full) displays options doc in correct order
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.

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

13 years agoadd ,registers
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.

13 years agofix check-guile.in for default vm change
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.

13 years agodefault to regular vm for noninteractive use
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.

13 years agoFix pattern variable extraction in `match' with `..1'.
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'.

13 years agoAdd support for `..1' to `match'.
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.

13 years agoAdd implementation of SRFI 27
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.

13 years agoadd call-with-vm; remove thread-vm bits; remove vm-apply; engines settable.
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.

13 years agoFix bignum memory leak.
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.

13 years agoAllocate bignums in pointer-less memory.
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.

13 years agoRemove `scm_t_aligned_cell'.
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.

13 years agoFix argument passing in VM hooks.
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.)

13 years agoHave `@abort' honor VM changes by winds.
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.

13 years agoFavor non-hex string escapes over hex escapes when writing strings
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

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.