bpt/guile.git
13 years agoTwo very small edits
Neil Jerram [Tue, 12 Oct 2010 22:41:41 +0000 (23:41 +0100)]
Two very small edits

* doc/ref/goops.texi (User-defined classes): Remove brackets around
  `formally', for better flow.
  (Creating Instances): Lengthen hyphen.

13 years agoEdit `Generic Functions and Accessors'
Neil Jerram [Tue, 12 Oct 2010 22:40:01 +0000 (23:40 +0100)]
Edit `Generic Functions and Accessors'

* doc/ref/goops.texi (Generic Function Internals): Moved to MOP section
  at end of chapter.
  (Basic Generic Function Creation): Flattened into parent, and text
  simplified.
  (Extending Primitives): Renamed from `Extending Guiles Primitives';
  removed `generic-capability?', which is no longer available;
  simplified a bit.
  (Merging Generics): New subsection for the material about merging;
  text simplified a bit.

13 years agoAllocate complex numbers in contiguous pointer-less memory.
Ludovic Courtès [Tue, 12 Oct 2010 20:57:08 +0000 (22:57 +0200)]
Allocate complex numbers in contiguous pointer-less memory.

* libguile/numbers.h (SCM_COMPLEX_MEM): Remove.
  (SCM_COMPLEX_REAL): Change to just fetch the `real' field of the
  pointed-to `scm_t_complex'.
  (SCM_COMPLEX_IMAG): Likewise.
  (scm_t_complex)[type, pad]: New fields.

* libguile/numbers.c (scm_c_make_rectangular): Allocate the whole
  complex contiguously, with `scm_gc_malloc_pointerless'.

13 years agoAllocate inexact numbers in pointer-less memory.
Ludovic Courtès [Tue, 12 Oct 2010 20:00:28 +0000 (22:00 +0200)]
Allocate inexact numbers in pointer-less memory.

* libguile/numbers.c (scm_from_double): Use `scm_gc_malloc_pointerless'
  instead of `scm_double_cell'.

13 years agoPlacate `-Wformat'.
Ludovic Courtès [Tue, 12 Oct 2010 19:59:53 +0000 (21:59 +0200)]
Placate `-Wformat'.

* module/scripts/compile.scm (fail): Use a fancy format string instead
  of a non-literal one.

13 years agoupdate NEWS for 1.9.13
Andy Wingo [Tue, 12 Oct 2010 20:27:01 +0000 (22:27 +0200)]
update NEWS for 1.9.13

* NEWS: Update for 1.9.13.

13 years agoAdd TeX form of jao's name
Neil Jerram [Tue, 12 Oct 2010 19:00:21 +0000 (20:00 +0100)]
Add TeX form of jao's name

* doc/ref/scheme-using.texi: Add TeX equivalent for José.

13 years agofold old news items into main news body
Andy Wingo [Tue, 12 Oct 2010 11:58:39 +0000 (13:58 +0200)]
fold old news items into main news body

* NEWS: Fold 1.9.12 items into the main body.

13 years ago,frame and related commands handle for-trap? appropriately
Andy Wingo [Tue, 12 Oct 2010 11:24:46 +0000 (13:24 +0200)]
,frame and related commands handle for-trap? appropriately

* module/system/repl/debug.scm (print-frame): Add #:next-source? arg,
  for when print-frame should use frame-next-source instead of
  frame-source.
  (print-frames): Add #:for-trap? arg. If true, the 0th frame should be
  printed with frame-next-source.

* module/system/repl/command.scm (define-stack-command): Introduce
  for-trap? into the lexical env.
  (backtrace, up, down, frame): Update to do the right thing regarding
  #:for-trap?.

13 years agodon't warn for (format #t fmt) -- format string actually named fmt
Andy Wingo [Tue, 12 Oct 2010 11:11:40 +0000 (13:11 +0200)]
don't warn for (format #t fmt) -- format string actually named fmt

* module/language/tree-il/analyze.scm (format-analysis): Don't warn on
  non-literal format string if the format string is a lexical ref to a
  variable named "fmt". A slight hack, but effective :)
* module/system/repl/command.scm (display-stat): Rename the format
  string to "fmt".

13 years agodebug has for-trap? field
Andy Wingo [Tue, 12 Oct 2010 11:09:48 +0000 (13:09 +0200)]
debug has for-trap? field

* module/system/repl/debug.scm (<debug>): New field, `for-trap?'. True
  if the stack is for a trap, and thus the top frame should use
  frame-next-source instead of frame-source.

* module/system/repl/command.scm (repl-pop-continuation-resumer)
  (repl-next-resumer):
* module/system/repl/error-handling.scm (call-with-error-handling):
  Update callers.

13 years agoremove gds docs, telling users instead to use geiser and paredit
Andy Wingo [Tue, 12 Oct 2010 11:01:10 +0000 (13:01 +0200)]
remove gds docs, telling users instead to use geiser and paredit

* doc/ref/scheme-using.texi (Using Guile in Emacs): Remove GDS docs, as
  we don't have GDS any more. Instead of surveying the field, be
  opinionated and tell users what to use: Geiser and Paredit.

13 years agominor doc fixups
Andy Wingo [Tue, 12 Oct 2010 10:58:36 +0000 (12:58 +0200)]
minor doc fixups

* doc/ref/scheme-scripts.texi (Invoking Guile): Some typos.
* doc/ref/tour.texi (Running Guile Scripts): More typos and PDF
  improvements.
* doc/ref/scheme-using.texi (Readline, Value History): Minor rewording.
  (Help Commands): Minor fixup.

13 years agoadd --listen docs
Andy Wingo [Mon, 11 Oct 2010 21:53:40 +0000 (23:53 +0200)]
add --listen docs

* doc/ref/scheme-scripts.texi (Invoking Guile): Add --listen
  documentation.

13 years agopreface contributors tweaks
Andy Wingo [Mon, 11 Oct 2010 21:32:30 +0000 (23:32 +0200)]
preface contributors tweaks

* doc/ref/preface.texi (Contributors): A couple tweaks

13 years agoupdate preface.texi contributors
Andy Wingo [Mon, 11 Oct 2010 20:50:55 +0000 (22:50 +0200)]
update preface.texi contributors

* doc/ref/preface.texi (Contributors): Rewrite and update.

13 years agoAllow arbitrary code in ASSOC procedures for weak hash tables (bug #29616).
Ludovic Courtès [Mon, 11 Oct 2010 13:38:06 +0000 (15:38 +0200)]
Allow arbitrary code in ASSOC procedures for weak hash tables (bug #29616).

* libguile/hashtab.c (struct t_assoc_args, do_weak_bucket_assoc):
  Remove.
  (struct t_fixup_args): New type.
  (do_weak_bucket_fixup): New function.
  (weak_bucket_assoc): Use it.  Keep strong references to BUCKET's
  entries in STRONG_REFS.  Call ASSOC once the alloc lock has been
  released.  This fixes bug #29616.

* test-suite/tests/weaks.test ("assoc can do anything"): New test.

13 years agoFix a bug in weak hash table bucket fixup.
Ludovic Courtès [Mon, 11 Oct 2010 13:14:55 +0000 (15:14 +0200)]
Fix a bug in weak hash table bucket fixup.

* libguile/hashtab.c (scm_fixup_weak_alist): Keep the value of PREV
  unchanged after a nullified pair is deleted; this fixes a bug whereby
  if several successive nullified pairs were encountered, not all of them
  would be removed, and the assertion in `weak_bucket_assoc' would be
  hit.  In addition, remove the `scm_is_pair (pair)' test.

13 years agoFix typo.
Ludovic Courtès [Sun, 10 Oct 2010 17:09:20 +0000 (19:09 +0200)]
Fix typo.

* module/system/repl/command.scm (repl-pop-continuation-resumer): Remove
  extraneous argument to `format'.

13 years agoAdd warnings for obvious syntax errors in format strings.
Ludovic Courtès [Sun, 10 Oct 2010 17:08:11 +0000 (19:08 +0200)]
Add warnings for obvious syntax errors in format strings.

* module/language/tree-il/analyze.scm (&syntax-error): New variable.
  (format-string-argument-count): Throw to &SYNTAX-ERROR when a syntax
  error in a format string is encountered.
  (format-analysis): Catch &SYNTAX-ERROR and convert as a warning of the
  appropriate type.

* module/system/base/message.scm (%warning-types)[format]: Handle
  `syntax-error' warnings.

* test-suite/tests/tree-il.test
  ("warnings")["conditionals"]("unterminated", "unexpected ~;",
  "unexpected ~]"): New tests.
  ["unterminated ~{...~}"]: New test.

13 years agoAdd new `format' warnings.
Ludovic Courtès [Sun, 10 Oct 2010 16:10:18 +0000 (18:10 +0200)]
Add new `format' warnings.

* module/language/tree-il/analyze.scm (format-analysis): Add new
  sub-warnings: `wrong-port', `wrong-format-string',
  `non-literal-format-string', and `wrong-num-args'.

* module/system/base/message.scm (%warning-types)[format]: Handle
  them.

* test-suite/tests/tree-il.test ("warnings")["wrong port arg",
  "wrong format string", "non-literal format string",
  "wrong number of args"]: New tests.

13 years agoCompile with `-Wformat'.
Ludovic Courtès [Sun, 10 Oct 2010 15:13:36 +0000 (17:13 +0200)]
Compile with `-Wformat'.

* am/guilec (GUILE_WARNINGS): Add `-Wformat'.

13 years agoImplement fancy format string analysis.
Ludovic Courtès [Sun, 10 Oct 2010 15:13:21 +0000 (17:13 +0200)]
Implement fancy format string analysis.

* module/language/tree-il/analyze.scm (format-string-argument-count):
  Return two values, the minimum and maximum number of arguments.
  Add support for most of `format' escapes, including conditionals.
  (format-analysis): Adjust accordingly.

* module/system/base/message.scm (%warning-types)[format]: Take two
  arguments, MIN and MAX, instead of EXPECTED.  Display warning
  accordingly.

* test-suite/tests/tree-il.test ("warnings")["format"]("~%, ~~, ~&, ~t,
  ~_, and ~\\n", "~{...~}", "~{...~}, too many args", "~@{...~}",
  "~@{...~}, too few args", "~(...~)", "~v", "~v:@y", "~*", "~?",
  "complex 1", "complex 2", "complex 3"): New tests.
  ("conditionals"): New test prefix.

13 years agoEscape newlines from format strings in warnings.
Ludovic Courtès [Sat, 9 Oct 2010 16:06:36 +0000 (18:06 +0200)]
Escape newlines from format strings in warnings.

* module/system/base/message.scm (%warning-types)[format]: Escape
  newlines from FMT.

13 years agoadd --listen command line argument.
Andy Wingo [Sun, 10 Oct 2010 10:56:53 +0000 (12:56 +0200)]
add --listen command line argument.

* libguile/script.c (scm_shell_usage, scm_compile_shell_switches): Add a
  --listen argument to spawn a REPL server, possibly specifying the port
  or path to listen on. The goal is for this to be the default way to
  allow debugging via Emacs or simply using netcat.

13 years agoadd (system repl server)
Andy Wingo [Sun, 10 Oct 2010 10:15:34 +0000 (12:15 +0200)]
add (system repl server)

* module/system/repl/server.scm: New module, listens on a socket for
  connections, then serves repls to those sockets.

* module/Makefile.am: Add repl server.

13 years agofix segfaults when closing the current input port
Andy Wingo [Sun, 10 Oct 2010 10:13:04 +0000 (12:13 +0200)]
fix segfaults when closing the current input port

* libguile/ports.c (scm_char_ready_p, scm_peek_char, scm_unread_char)
  (scm_unread_string): Always validate the port, even in the case that
  we get it the default current-input-port. Otherwise the following
  causes a segfault:

    (begin (close-port (current-input-port)) (peek-char))

13 years agoreadline repl-reader falls back to boot-9 definition for other ports
Andy Wingo [Sun, 10 Oct 2010 09:49:50 +0000 (11:49 +0200)]
readline repl-reader falls back to boot-9 definition for other ports

* guile-readline/ice-9/readline.scm (readline-repl-reader): Pull
  definition out of activate-readline. If the current input port is not
  the readline port, fall back to the boot-9 repl reader.
  (activate-readline): Adapt.

13 years agointerrupted syscalls run asyncs before throwing syserror
Andy Wingo [Sun, 10 Oct 2010 09:24:29 +0000 (11:24 +0200)]
interrupted syscalls run asyncs before throwing syserror

* libguile/error.c (scm_syserror, scm_syserror_msg): Run pending pending
  asyncs before throwing the error, as one of the asyncs might be a
  signal handler. But there is unfortunately a race here, as noted in a
  comment.

13 years agofurther repl tweaks
Andy Wingo [Fri, 8 Oct 2010 17:27:45 +0000 (19:27 +0200)]
further repl tweaks

* module/system/repl/error-handling.scm (error-string): Refactor a
  little.
  (call-with-error-handling): Ensure a trailing newline when printing
  the error-msg.

* module/system/repl/repl.scm (run-repl): We don't know the name of the
  meta-command here.

13 years agoImprove pretty-printing of tree-il objects.
Ludovic Courtès [Fri, 8 Oct 2010 13:24:15 +0000 (15:24 +0200)]
Improve pretty-printing of tree-il objects.

* module/language/tree-il.scm (print-tree-il): Print the AST with ~S
  instead of ~A.

13 years agoAdd `-Wformat'.
Ludovic Courtès [Fri, 8 Oct 2010 14:25:32 +0000 (16:25 +0200)]
Add `-Wformat'.

* module/language/tree-il/analyze.scm (format-string-argument-count):
  New procedure.
  (format-analysis): New tree analysis.

* module/language/tree-il/compile-glil.scm (%warning-passes): Add
  `format'.

* module/system/base/message.scm (%warning-types): Add `format'.

* test-suite/tests/tree-il.test (%opts-w-format): New variable.
  ("warnings")["format"]: New test prefix.

* doc/ref/api-evaluation.texi (Compilation): Mention `format' warnings.

13 years agoFixlets for REPL error handling.
Ludovic Courtès [Fri, 8 Oct 2010 11:50:24 +0000 (13:50 +0200)]
Fixlets for REPL error handling.

* module/system/repl/error-handling.scm (error-string): Don't call
  `display-error' when STACK is empty.
  (call-with-error-handling): Display ERROR-MSG instead of using
  `format', since ERROR-MSG may contain `format' escapes.

* module/system/repl/repl.scm (run-repl): Add missing argument to
  `format'.

13 years agoSRFI-1: Rewrite `split-at' and `split-at!' in Scheme.
Ludovic Courtès [Fri, 8 Oct 2010 11:48:02 +0000 (13:48 +0200)]
SRFI-1: Rewrite `split-at' and `split-at!' in Scheme.

This partially reverts commit bb560b9c16893f762699ba5a3109c8367fff8dfc
(Tue Mar 15 2005).

* module/srfi/srfi-1.scm (out-of-range, split-at, split-at!): New
  procedures.

* libguile/srfi-1.c (scm_srfi1_split_at, scm_srfi1_split_at_x): Remove.
* libguile/srfi-1.h (scm_srfi1_split_at, scm_srfi1_split_at_x): Ditto.

13 years agoSRFI-1: Rewrite `filter-map' in Scheme.
Ludovic Courtès [Fri, 8 Oct 2010 09:03:51 +0000 (11:03 +0200)]
SRFI-1: Rewrite `filter-map' in Scheme.

This partially reverts commit c16359466bcc3f2ebf6d750c069f787f629fc625
(Thu Mar 17 2005).

* libguile/srfi-1.c (scm_srfi1_filter_map): Remove.
* libguile/srfi-1.h (scm_srfi1_filter_map): Ditto.

* module/srfi/srfi-1.scm (filter-map): New procedure.

13 years agoSRFI-1: Make `fold-right' tail-recursive.
Ludovic Courtès [Fri, 8 Oct 2010 08:43:59 +0000 (10:43 +0200)]
SRFI-1: Make `fold-right' tail-recursive.

* module/srfi/srfi-1.scm (fold-right): Make tail-recursive.

* test-suite/tests/srfi-1.test ("fold-right"): New test prefix.

13 years agoSRFI-1: Make `unfold' tail-recursive (fix bug #30071).
Ludovic Courtès [Fri, 8 Oct 2010 08:23:52 +0000 (10:23 +0200)]
SRFI-1: Make `unfold' tail-recursive (fix bug #30071).

* module/srfi/srfi-1.scm (unfold): Make tail-recursive, following a
  suggestion by Szavai Gyula.

* test-suite/tests/srfi-1.test ("unfold"): New test prefix.

13 years agoRegister `scm_init_r6rs_ports' as an extension.
Ludovic Courtès [Fri, 8 Oct 2010 07:49:12 +0000 (09:49 +0200)]
Register `scm_init_r6rs_ports' as an extension.

* libguile/r6rs-ports.c (scm_register_r6rs_ports): New function.
* libguile/r6rs-ports.h (scm_register_r6rs_ports): New declaration.

* libguile/init.c (scm_i_init_guile): Call it.

13 years agoAlways run at least the ASCII regexp tests.
Ludovic Courtès [Fri, 8 Oct 2010 07:46:39 +0000 (09:46 +0200)]
Always run at least the ASCII regexp tests.

* test-suite/tests/regexp.test (with-ascii-or-latin1-locale): New macro.
  ("regexp-quote"): Use it instead of `with-latin1-locale'.

13 years agofix a bug in `finish'
Andy Wingo [Fri, 8 Oct 2010 10:29:54 +0000 (12:29 +0200)]
fix a bug in `finish'

* module/system/repl/command.scm (repl-pop-continuation-resumer)
  (finish): Fix a bug printing return values.

13 years agostepping traps use frame-next-source, not frame-source
Andy Wingo [Fri, 8 Oct 2010 10:23:34 +0000 (12:23 +0200)]
stepping traps use frame-next-source, not frame-source

* module/system/vm/trap-state.scm (add-ephemeral-stepping-trap!): Use
  frame-next-source in stepping traps.

13 years agoadd program-sources-pre-retire to core and define frame-next-source
Andy Wingo [Fri, 8 Oct 2010 10:21:20 +0000 (12:21 +0200)]
add program-sources-pre-retire to core and define frame-next-source

* libguile/programs.h:
* libguile/programs.c (scm_program_source): Add an optional arg, the
  sources table to traverse. Defaults to the result of
  scm_program_sources.

* module/system/vm/program.scm (program-sources-pre-retire): Move
  definition here from (system vm traps), and export.

* module/system/vm/traps.scm: Adapt.

* module/system/vm/frame.scm (frame-next-source): New exported binding,
  returns the source line corresponding to the next instruction instead
  of the previous instruction.

13 years agofix error in frame-return-values
Andy Wingo [Fri, 8 Oct 2010 09:53:59 +0000 (11:53 +0200)]
fix error in frame-return-values

* module/system/vm/frame.scm (frame-return-values): Fix off-by-one
  error.

13 years agofix tracing of mv returns
Andy Wingo [Fri, 8 Oct 2010 09:52:38 +0000 (11:52 +0200)]
fix tracing of mv returns

* module/system/vm/trace.scm (print-return): Fix multiple-value-return
  printing.

13 years agomore inlining in psyntax
Andy Wingo [Fri, 8 Oct 2010 09:43:15 +0000 (11:43 +0200)]
more inlining in psyntax

* module/ice-9/psyntax.scm (make-wrap, wrap-marks, wrap-subst): Use
  identifier syntax here too.

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

13 years agoinline symbol? and vector? to opcodes, and a psyntax inlining tweak
Andy Wingo [Fri, 8 Oct 2010 09:30:17 +0000 (11:30 +0200)]
inline symbol? and vector? to opcodes, and a psyntax inlining tweak

* libguile/vm-i-scheme.c (symbol?, vector?): New
  instructions. Renumbered the rest.
* libguile/vm-i-system.c: Renumber instructions.
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

* module/ice-9/psyntax.scm (binding-type, binding-value): Define using
  macros so that we inline to car and cdr opcodes. Oh, for an inliner :)

* module/language/tree-il/compile-glil.scm (*primcall-ops*)
* module/language/tree-il/primitives.scm
  (*interesting-primitive-names*, *effect-free-primitives*)
  (*effect+exception-free-primitives*): Add symbol? and vector?
  inlines.

13 years agoadd repl debugging command docs
Andy Wingo [Fri, 8 Oct 2010 09:13:19 +0000 (11:13 +0200)]
add repl debugging command docs

* doc/ref/scheme-using.texi (Debug Commands): Add docs for new debugging
  commands (break, step, registers, etc).

13 years agoproof-reading fixen in api-debug
Andy Wingo [Fri, 8 Oct 2010 08:54:03 +0000 (10:54 +0200)]
proof-reading fixen in api-debug

* doc/ref/api-debug.texi (Trap States, High-Level Traps): A couple of
  proof-reading fixes.

13 years agofinish traps documentation
Andy Wingo [Thu, 7 Oct 2010 22:00:16 +0000 (00:00 +0200)]
finish traps documentation

* doc/ref/api-debug.texi (Low-Level Traps, Tracing Traps, Trap States):
  Add notes on using modules.
  (High-Level Traps): Combine "Trap Handlers" and "Setting Traps"
  here. Flesh out docs.

13 years agoremove old debugging examples from api-debug
Andy Wingo [Thu, 7 Oct 2010 20:57:07 +0000 (22:57 +0200)]
remove old debugging examples from api-debug

* doc/ref/api-debug.texi (Debugging Examples): Remove section, as the
  tracing bits are adequately covered in tracing, and the breakpoints
  and such will get covered in the debugging meta-commands section.

13 years agodocument trap states
Andy Wingo [Thu, 7 Oct 2010 20:50:33 +0000 (22:50 +0200)]
document trap states

* module/system/vm/trap-state.scm: Export add-trap!.

* doc/ref/api-debug.texi (Trap States): Document.

13 years agodocument tracing traps
Andy Wingo [Thu, 7 Oct 2010 20:27:00 +0000 (22:27 +0200)]
document tracing traps

* doc/ref/api-debug.texi (Tracing Traps): Document the traps.

13 years agofinish documenting low-level traps, other api-debug.texi fixes
Andy Wingo [Thu, 7 Oct 2010 20:15:35 +0000 (22:15 +0200)]
finish documenting low-level traps, other api-debug.texi fixes

* doc/ref/api-debug.texi (Stack Capture): Rename from "Capturing the
  Stack or Innermost Stack Frame". Move start-stack docs here.
  (Frames): Document accessors for fp, sp, ip, et al.
  (Source Properties): Raise to a subsection.
  (VM Hooks): Add notes about the VM trace level within hook firing.
  (Low-Level Traps): Flesh out.

13 years agoupdate traps documentation (unfinished)
Andy Wingo [Thu, 7 Oct 2010 11:06:57 +0000 (13:06 +0200)]
update traps documentation (unfinished)

* doc/ref/Makefile.am:
* doc/ref/guile.texi:
* doc/ref/scheme-debugging.texi: Remove scheme-debugging.texi, which
  only described tracing. Tracing documentation is now in
  api-debugging.

* doc/ref/scheme-using.texi (Evaluating Scheme Code): Remove reference
  to source traps, as that section is going away.

* doc/ref/api-modules.texi (Included Guile Modules): Remove reference to
  Tracing. This section is a little silly, anyway...

* doc/ref/api-evaluation.texi (VM Behaviour): Remove section, it is in
  api-debugging now.

* doc/ref/api-debug.texi (Stacks, Frames): Rename sections from
  "Examining the Stack" and "Examining Stack Frames", respectively.
  (Traps): Update for current API. A big and not-quite-finished update.

13 years agoupdate docs regarding --debug
Andy Wingo [Thu, 7 Oct 2010 10:56:43 +0000 (12:56 +0200)]
update docs regarding --debug

* doc/ref/scheme-scripts.texi (Invoking Guile): Update docs on --debug.

13 years agorename vm-trace to call-with-trace
Andy Wingo [Thu, 7 Oct 2010 10:55:37 +0000 (12:55 +0200)]
rename vm-trace to call-with-trace

* module/system/vm/trace.scm (print-application, print-return): Change
  to add more whitespace, as (ice-9 debug) did.
  (call-with-trace): Rename from vm-trace, and make the vm a keyword
  argument.

* module/system/repl/command.scm: Don't autoload (system vm profile).
  (trace): Update for call-with-trace name change.

13 years agoupdate (system repl debug) todo
Andy Wingo [Wed, 6 Oct 2010 19:19:49 +0000 (21:19 +0200)]
update (system repl debug) todo

* module/system/repl/debug.scm: Update todo.

13 years agoadd ,step ,stepi ,next and ,nexti
Andy Wingo [Wed, 6 Oct 2010 19:19:08 +0000 (21:19 +0200)]
add ,step ,stepi ,next and ,nexti

* module/system/vm/traps.scm (trap-matching-instructions): New trap,
  just installs a next hook and runs the handler when a predicate
  succeeds.

* module/system/vm/trap-state.scm (add-ephemeral-stepping-trap!): New
  procedure, uses trap-matching-instructions with an appropriate
  predicate to handle step, stepi, next, and nexti repl metacommands.

* module/system/repl/command.scm (step, step-instruction, next)
  (next-instruction): New repl debugger commands.

13 years agocleanups to ,finish
Andy Wingo [Wed, 6 Oct 2010 19:17:06 +0000 (21:17 +0200)]
cleanups to ,finish

* module/system/repl/command.scm (repl-pop-continuation-resumer): Factor
  out of finish.
  (finish): Adapt.

* module/system/vm/trap-state.scm (add-ephemeral-trap-at-frame-finish!):
  Rename to add "ephemeral" to the name.

* module/system/vm/traps.scm (trap-calls-to-procedure): Remove unused
  #:width kwarg.

13 years agobuild guile-readline/ after module/
Andy Wingo [Wed, 6 Oct 2010 08:24:45 +0000 (10:24 +0200)]
build guile-readline/ after module/

* Makefile.am (SUBDIRS): Build module/ before guile-readline/. Reformat.

13 years agoadd ,finish repl meta-command
Andy Wingo [Tue, 5 Oct 2010 19:53:58 +0000 (21:53 +0200)]
add ,finish repl meta-command

* module/system/repl/command.scm (finish): New REPL meta command. Uses
  fancy prompt stuff.

13 years ago(system vm trap-state): add-trap-at-frame-finish!
Andy Wingo [Tue, 5 Oct 2010 19:53:29 +0000 (21:53 +0200)]
(system vm trap-state): add-trap-at-frame-finish!

* module/system/vm/traps.scm: Fix a comment.

* module/system/vm/trap-state.scm (<trap-state>): Add next-ephemeral-idx
  slot.
  (wrapper-at-index): Use eqv? instead of = to avoid type errors in user
  inputs.
  (next-ephemeral-index!, ephemeral-handler-for-index): New functions,
  allocate ephemeral trap ids for functions to be called only once.
  (add-trap-at-frame-finish!): New export, traps when a frame finishes.

13 years ago(system vm frame): frame-return-values
Andy Wingo [Tue, 5 Oct 2010 19:51:44 +0000 (21:51 +0200)]
(system vm frame): frame-return-values

* module/system/vm/frame.scm (frame-return-values): New exported
  function, gives the return values for a frame.
* module/system/vm/trace.scm: Remove frame-return-values from here.

13 years agodebug-trap-handler ephemeral trap enhancement
Andy Wingo [Tue, 5 Oct 2010 19:50:57 +0000 (21:50 +0200)]
debug-trap-handler ephemeral trap enhancement

* module/system/repl/error-handling.scm (call-with-error-handling): If
  the given index is false, assume this was an ephemeral trap, and don't
  print a welcome message or reference the trap by index.

13 years ago(system repl debug): add frame->stack-vector
Andy Wingo [Tue, 5 Oct 2010 19:49:13 +0000 (21:49 +0200)]
(system repl debug): add frame->stack-vector

* module/system/repl/debug.scm (frame->stack-vector): New public
  function.

13 years agofix embarrassing error preventing ,del from working
Andy Wingo [Tue, 5 Oct 2010 19:48:27 +0000 (21:48 +0200)]
fix embarrassing error preventing ,del from working

* module/system/vm/trap-state.scm (remove-trap-wrapper!): Oops, fix
  newbie error regarding delq and mutation.

13 years agosystem repl repl comments
Andy Wingo [Tue, 5 Oct 2010 17:58:13 +0000 (19:58 +0200)]
system repl repl comments

* module/system/repl/repl.scm (meta-reader): Add a comment about peek,
  read, and the EOF object.

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.