2009-12-15  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 1.9.6.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

	Remove unneeded #include <assert.h>.
	* libguile/backtrace.c, libguile/eval.c, libguile/gc.c,
	  libguile/goops.c, libguile/memoize.c, libguile/threads.c,
	  libguile/uniform.c, libguile/vm.c,
	  test-suite/standalone/test-conversion.c,
	  test-suite/standalone/test-list.c: Don't include <assert.h>.

	Use Gnulib's `sys_stat' module; update Gnulib.
	* .x-sc_prohibit_S_IS_definition: New file.

	* m4/gnulib-cache.m4: Add `sys_stat'.

	* libguile/filesys.c: Remove `S_IS*' macro definitions for Ultrix and
	  MinGW.

	Remove obsolete test-suite makefile snippets.
	* test-suite/Makefile.am (SCM_TESTS_DIRS): Remove.
	  (dist-hook): Remove target.

	Disable thread-local storage on Solaris 8.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Special-case `*solaris2.8'.

	Change the Elisp compiler from GPLv2+ to LGPLv3+.
	* module/language/elisp/bindings.scm, module/language/elisp/lexer.scm,
	  module/language/elisp/parser.scm, module/language/elisp/runtime.scm,
	  module/language/elisp/runtime/function-slot.scm,
	  module/language/elisp/runtime/macro-slot.scm,
	  module/language/elisp/runtime/value-slot.scm: Switch from GPLv2+ to
	  LGPLv3+; fix copyright year.

	Use portable shell in `meta/uninstalled-env'.
	* meta/uninstalled-env.in: Don't use the `-q' and `-E' options, which are
	  specific to GNU grep.  Don't set-and-export environment variables at
	  once since this is a GNU Bash extension.

	Use the right `grep' command.
	* libguile/Makefile.am (.c.i): Use $(GREP), not `grep'.
	  (check_signals, check_errnos): Use $(EGREP), not `egrep'.

	Remove GNU Make-specific function call.
	* libguile/Makefile.am (c-tokenize.$(OBJEXT)): Remove use of GNU Make's
	  `filter-out' function.

	Remove extraneous semicolon after `SCM_ARRAY_IMPLEMENTATION' & co.
	* libguile/bitvectors.c, libguile/srfi-4.c, libguile/strings.c,
	  libguile/vectors.c: Remove extraneous semicolon after
	  `SCM_ARRAY_IMPLEMENTATION' and `SCM_VECTOR_IMPLEMENTATION'
	  invocations.

	Remove extraneous functions from `AC_REPLACE_FUNCS'.
	* configure.ac: Remove `inet_aton' and `putenv' from `AC_REPLACE_FUNCS'.

	Avoid `SCM_UNPACK ()' in constant expressions.
	They made Sun C 5.8 emit a warning such as:

	  line 71: warning: dead part of constant expression is nonconstant

	* libguile/print.c (scm_print_opts): Don't use `SCM_UNPACK ()' here.

	* libguile/read.c (scm_read_opts): Likewise.

	Remove `return' from `void' function.
	* libguile/print.c (scm_print_symbol_name): Remove `return' statement.

	Don't use GCC zero-length arrays.
	* libguile/frames.c, libguile/objcodes.c, libguile/programs.c,
	  libguile/vm-engine.c, libguile/vm-i-system.c, libguile/vm.c: Use
	  `SCM_C_OBJCODE_BASE ()' instead of accessing the `base' field of
	  `struct scm_objcode'.

	* libguile/objcodes.h (struct scm_objcode)[base]: Remove.

	Remove uses of the non-standard `__FUNCTION__'.
	* libguile/gc.c (scm_gc_sweep): Replace `__FUNCTION__' by `FUNC_NAME'.

	* libguile/read.c (scm_read_r6rs_block_comment): Likewise.

2009-12-15  Andy Wingo  <wingo@pobox.com>

	expose frame-previous, once again
	* libguile/frames.h:
	* libguile/frames.c (scm_frame_previous): Rename from scm_c_frame_prev,
	  and expose to Scheme. Skip boot frames.

	* libguile/stacks.c (stack_depth, narrow_stack, scm_make_stack)
	  (scm_stack_ref): Adjust for scm_frame_previous skipping boot frames.

2009-12-14  Ludovic Courtès  <ludo@gnu.org>

	Fix test environment issue with ltdl from Libtool 2.2.6b.
	Earlier versions of ltdl would look for extensions under $PWD; this
	behavior changed in 2.2.6b.

	* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Define
	  $builddir.

	* test-suite/standalone/test-asmobs: Specify the full path to
	  `libtest-asmobs', using $builddir.

	* test-suite/standalone/test-extensions: Likewise.

2009-12-13  Andy Wingo  <wingo@pobox.com>

	more NEWS updates
	* NEWS: Update some more.

	primitive-eval passes first N args on stack directly, not via apply
	* libguile/memoize.c (MAKMEMO_CALL): Memoize in the number of arguments
	  at the call site.
	  (memoize, scm_m_cond, memoize_named_let, unmemoize):
	* libguile/eval.c (eval): Adapt to changes in call memoization.

	* module/ice-9/eval.scm (primitive-eval): For calls, pass the first N
	  arguments directly on the stack, and only the rest as a consed
	  argument list to apply. Currently N is 4.

	interpreted closures cons less.
	* module/ice-9/eval.scm (primitive-eval): When making a closure with N
	  formals, actuall return a closure with N formals, if N is less than
	  *max-static-argument-count*, which currently is 8. If N is greater
	  than 8, do the arg-parsing loop as we did before. Requires some
	  macrology, but should reduce unnecessary consing for interpreted
	  closures.

	* test-suite/tests/goops.test:
	* test-suite/tests/hooks.test: Now that checks like (thunk? foo) are
	  going to work as a for interpreted code, remove some (throw
	  'unresolved).

2009-12-12  Andy Wingo  <wingo@pobox.com>

	commit draft of NEWS

	lame tweak to the inliner
	* module/language/tree-il/inline.scm: Tweak to avoid a (if #t #t #f).
	  Yes, it's lame.

	prepare NEWS for 1.9.6
	* NEWS: Prepare NEWS for 1.9.6.

2009-12-11  Ludovic Courtès  <ludo@gnu.org>

	Tweak the "unused modules are removed" test.
	* test-suite/tests/gc.test ("gc")["unused modules are removed"]: Add
	  loop to clean up stale references from the stack.

	SRFI-1: Use the built-in optional argument support.
	* module/srfi/srfi-1.scm (iota, unfold, unfold-right, alist-delete,
	  alist-delete!): Use `define*' and optional arguments instead of rest
	  arguments.

	Fix expansion of `(+ 1 x)'.
	* module/language/tree-il/primitives.scm (+): Fix typo.

	Typo.
	* test-suite/Makefile.am (SCM_TESTS): Fix typos:
	  `.text' -> `.test'.

	SRFI-9: Make accessors inlinable.
	* module/srfi/srfi-9.scm (define-inlinable): New macro.
	  (define-record-type): Use it.

	SRFI-9: Reimplement in terms of structs, using `syntax-case'.
	* module/srfi/srfi-9.scm (define-record-type): Rewrite to use raw
	  structs instead of records.  Use `syntax-case' instead of
	  `define-macro'.

	Add struct & vector benchmarks.
	* benchmark-suite/benchmarks/structs.bm,
	  benchmark-suite/benchmarks/vectors.bm: New files.

	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add.

	* benchmark-suite/benchmarks/bytevectors.bm: Fix copyright.

	Add opcodes for `struct?', `struct-vtable', and `make-struct'.
	* libguile/vm-engine.c (VM_NAME)[vm_error_not_a_struct]: New label.

	* libguile/vm-i-scheme.c (VM_VALIDATE_STRUCT): New macro.
	  (struct_p, struct_vtable, make_struct): New instructions.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add
	  `struct?', `struct-vtable', and `make-struct'.

	* module/language/tree-il/primitives.scm (*interesting-primitive-names*,
	  *effect-free-primitives*): Likewise.

2009-12-11  Andy Wingo  <wingo@pobox.com>

	vm no longer measures bogoclock or times, relies on os for that
	* libguile/vm.h (struct scm_vm): Remove "time" and "clock" members. The
	  time was bogusly measured, and the "clock" measured instructions
	  retired, which is not a very useful measurement, and it was causing
	  lots of memory accesses. Not that I have done a proper profile,
	  though...
	  (scm_vm_stats): Remove this procedure, which provided access to "time"
	  and "clock".

	* libguile/vm.c:
	* libguile/vm-engine.h:
	* libguile/vm-engine.c:
	* libguile/vm-i-system.c: Adapt to scm_vm changes and scm_vm_stats
	  removal.

	* module/system/repl/command.scm:
	* module/system/vm/vm.scm: Adapt to vm-stats removal by removing
	  vm-stats from <repl>.

	inline calls to (memv foo CONSTANT-LIST)
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Recognize memv and memq as well.

	* module/language/tree-il/inline.scm (inline!): Inline calls to memq and
	  memv where the list is a constant.

	rename <conditional> then and else to consequent and alternate
	* module/language/tree-il.scm (<tree-il>): Rename the "then" and "else"
	  clauses of <conditional> to "consequent" and "alternate". More
	  verbose, yes, but that way we avoid unexpected behavior with "else".
	  (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold):
	  (make-tree-il-folder, post-order!, pre-order!)
	* module/language/tree-il/analyze.scm (analyze-lexicals):
	* module/language/tree-il/compile-glil.scm (flatten):
	* module/language/tree-il/fix-letrec.scm (simple-expression?): Update
	  callers.

	rename lambda-case-else to lambda-case-alternate
	* module/language/tree-il.scm (<tree-il>): Rename the "else" field of
	  <lambda-case> to "alternate". Conflicts less with the "else" keyword
	  as used by case, cond, record-case, pmatch, etc.
	  (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold)
	  (make-tree-il-folder, post-order!, pre-order!): Adapt traversal
	  operators for <lambda-case> change.

	* module/language/tree-il/analyze.scm (analyze-lexicals)
	  (validate-arity):
	* module/language/tree-il/compile-glil.scm (flatten):
	* module/language/tree-il/inline.scm (inline!): Adapt for <lambda-case>
	  change.

	vm: handle interrupts on backwards jumps
	* libguile/vm-i-system.c (BR, br): Handle interrupts on backwards jumps,
	  so we can Ctrl-C an endless loop.

	less overhead for handling interrupts in the vm
	* libguile/__scm.h (SCM_ASYNC_TICK): Add some branch prediction.
	  (SCM_ASYNC_TICK_WITH_CODE): New helper for when BUILDING_LIBGUILE,
	  runs code only if we're going to call async_click().
	* libguile/vm-engine.h (VM_HANDLE_INTERRUPTS): New helper, uses
	  SCM_ASYNC_TICK_WITH_CODE to only save regs if we'll handle an
	  interrupt.
	* libguile/vm-i-system.c (call, goto/args, return): use
	  VM_HANDLE_INTERRUPTS.

2009-12-11  Andreas Rottmann  <a.rottmann@gmx.at>

	add partial support for tail patterns in syntax-rules/syntax-case
	I've prepared a patch that adds partial support for tail patterns.
	Things like the the SRFI-34 `guard' macro from [0] are supported, but
	you still can't combine dotted patterns with tail patterns, e.g.

	(syntax-rules (else)
	  ((foo bar ... (else something) . rest)
	   <TEMPLATE-HERE>))

	will *not* work; there's the issue that one can't just transcribe
	the implementation of this feature from the latest version of psyntax,
	as I've done for non-dotted tail patterns, as it's implemented using a
	dotted pattern like the above. Alas!

	[0] <http://article.gmane.org/gmane.lisp.guile.devel/9442>

	* module/ice-9/psyntax.scm (syntax-case, $sc-dispatch): Add support for
	  tail patterns, transcribed from the latest psyntax.

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

	* test-suite/tests/syncase.test: Add tests for tail patterns.

2009-12-11  Andy Wingo  <wingo@pobox.com>

	merge from master to elisp
	* module/language/elisp/compile-tree-il.scm: Update for changes to
	  tree-il (lambda-case, mainly).

	* module/language/elisp/spec.scm: Update GPL version to 3. Update reader
	  for new taking a port and environment argument.

	* libguile/_scm.h: Bump objcode version.

	* libguile/vm-i-system.c: Fix conflicts.

	* module/Makefile.am: Fix conflicts, and add elisp modules to the build.

2009-12-10  Andy Wingo  <wingo@pobox.com>

	add ice-9/quasisyntax.scm to NOCOMP_SOURCES
	* module/Makefile.am (NOCOMP_SOURCES): Add quasisyntax.scm.

	fix emission of meta procedures
	* module/language/glil/compile-assembly.scm: Fix the check for when to
	  emit a "meta" procedure. Fixes
	  http://thread.gmane.org/gmane.lisp.guile.user/7469/focus=7470.

	if we have no eval.go, load no .go
	* libguile/load.c (scm_init_eval_in_scheme): If we have no eval.go, null
	  out the load-compiled path so that we load no compiled code. Prevents
	  partially compiled Guile from turning tail-calls into stack-munching
	  calls.

	add gbt macro to gdbinit, and fix a bug in program-arity
	* gdbinit: Add gbt macro, to make a Guile backtrace whenever you want.
	* module/system/vm/program.scm (program-arity): If ip is #f, just take
	  the first arity.

2009-12-09  Andy Wingo  <wingo@pobox.com>

	fix arbiter compilation with the generic codepath
	* libguile/arbiters.c (scm_try_arbiter, scm_release_arbiter): Fix for
	  the generic case; not sure why it wasn't working.

	fix FUNC_NAME of scm_memoize_variable_access_x
	* libguile/memoize.c (scm_memoize_variable_access_x): Fix FUNC_NAME
	  definition.

2009-12-08  Andy Wingo  <wingo@pobox.com>

	add SCM_SMOB_TYPE_BITS and SCM_SMOB_TYPE_MASK
	* libguile/smob.h (SCM_SMOB_TYPE_BITS, SCM_SMOB_TYPE_MASK): New macros,
	  for when you want to identify a SMOB by type and mask.

	* libguile/arrays.c:
	* libguile/bitvectors.c:
	* libguile/srfi-4.c: Use the new macros.

	fix SCM_CELL macro usage.
	* libguile/vm.h (SCM_VM_CONT_DATA): Fix SCM_CELL macro usage.

	SCM_CELL in throw.c
	* libguile/throw.c (JBACTIVE, ACTIVATEJB, DEACTIVATEJB, JBJMPBUF)
	  (SETJBJMPBUF, SCM_JBPREUNWIND, SCM_SETJBPREUNWIND)
	  (pre_unwind_data_print, scm_ithrow): Fix SCM_CELL macro usage.

	SCM_VALIDATE_SMOB uses SCM_SMOB_PREDICATE
	* libguile/validate.h (SCM_VALIDATE_SMOB): Change to use
	  SCM_SMOB_PREDICATE instead of SCM_TYP16_PREDICATE.

	SCM_CELL in srfi-4.c
	* libguile/srfi-4.c (SCM_UVEC_TYPE, SCM_UVEC_LENGTH, SCM_UVEC_BASE): Fix
	  SCM_CELL macro usage.

	SCM_CELL in srcprop.c
	* libguile/srcprop.c (SRCPROPPOS, SRCPROPCOPY, SRCPROPALIST)
	  (SETSRCPROPPOS, SETSRCPROPCOPY, SETSRCPROPALIST): Fix erroneous
	  SCM_CELL macro usage.

	use the new public metatables from struct.c
	* libguile/procs.c (scm_init_procs): No need to lookup the
	  applicable-struct-with-setter vtable, as it is now exported.

	scm_i_alloc_struct does not take a "what" arg
	* libguile/struct.h:
	* libguile/struct.c (scm_i_alloc_struct): Change to not take a "what"
	  argument. Callers changed.

	reserve a vtable flag for smobs.
	* libguile/struct.h (SCM_VTABLE_FLAG_SMOB_0): Reserve a vtable flag for
	  smobs.

	add vtable finalizer and printer setter macros
	* libguile/struct.h (SCM_VTABLE_INSTANCE_FINALIZER): Use DATA_REF, not
	  SLOT_REF.
	  (SCM_SET_VTABLE_INSTANCE_FINALIZER, SCM_SET_VTABLE_INSTANCE_PRINTER):
	  New accessor macros.

	make some applicable struct vtable-vtable public to C
	* libguile/struct.h (scm_standard_vtable_vtable)
	  (scm_applicable_struct_vtable_vtable)
	  (scm_applicable_struct_with_setter_vtable_vtable)
	* libguile/struct.c: Make these stock meta-tables public to C.

	SCM_CELL in modules.c
	* libguile/modules.c (SCM_F_EVAL_CLOSURE_INTERFACE)
	  (SCM_EVAL_CLOSURE_INTERFACE_P, scm_standard_interface_eval_closure):
	  Fix to not use SCM_CELL macros.

	initialize smobs after structs
	* libguile/init.c (scm_i_init_guile): Move SMOB prehistory after structs
	  init. No effect for now.

	SCM_CELL in guardians.c
	* libguile/guardians.c (GUARDIAN_DATA): Fix SCM_CELL macro usage.

	SCM_CELL in filesys.[ch]
	* libguile/filesys.h (SCM_DIR_FLAG_OPEN, SCM_DIR_OPEN_P)
	* libguile/filesys.c (scm_readdir, scm_rewinddir, scm_closedir)
	  (scm_dir_print, scm_dir_free): Fix SCM_CELL macro usage.

	SCM_CELL in deprecated.c
	* libguile/deprecated.c (scm_smob_free): Fix SCM_CELL macro usage.

	fix SCM_CELL macro usage in continuations.[ch]
	* libguile/continuations.h (SCM_CONTREGS):
	* libguile/continuations.c (continuation_print): Fix SCM_CELL macro
	  usage.

	fix SCM_CELL_* macro usage in async.c
	* libguile/async.c (ASYNC_GOT_IT, SET_ASYNC_GOT_IT, ASYNC_THUNK): Fix
	  SCM_CELL_* macro usage.

	fix SCM_CELL_* macro usage in arbiters.c
	* libguile/arbiters.c (scm_try_arbiter, scm_release_arbiter): Fix
	  erroneous SCM_CELL_* macro usage.

	fix erroneous SCM_CELL_* usage in arrays.[ch]
	* libguile/arrays.h (SCM_I_ARRAY_FLAG_CONTIGUOUS, SCM_I_ARRAY_NDIM):
	  (SCM_I_ARRAY_CONTP, SCM_I_ARRAY_MEM):
	* libguile/arrays.c (SCM_SET_ARRAY_CONTIGUOUS_FLAG):
	  (SCM_CLR_ARRAY_CONTIGUOUS_FLAG): Fix macros to use SCM_SMOB macros
	  instead of SCM_CELL macros.

	clean up smob macro implementation
	* libguile/smob.h: Regularize the SCM_SMOB macros, and make them all go
	  through some generic SMOB accessor macros.

	* libguile/smob.c (scm_i_set_smob_flags): Remove, as it is unused.

2009-12-07  Andy Wingo  <wingo@pobox.com>

	add scm_c_make_struct[v]
	* libguile/struct.h (scm_c_make_struct, scm_c_make_structv): New
	  functions with which you can make a struct without consing a rest
	  list.

	* libguile/struct.c (scm_struct_init): Refactor to take an array of init
	  values, not a list.
	  (scm_make_struct, scm_make_vtable_vtable): Pull the rest arg out into
	  a list and pass it down to the new array-taking functions.

	* libguile/memoize.c: Remove a neeless #include <alloca>.

	procedures-with-setters implemented in terms of structs
	* libguile/tags.h (scm_tc7_pws): No more.

	* libguile/procs.c (scm_procedure_with_setter_p)
	  (scm_make_procedure_with_setter, scm_procedure, scm_setter): Implement
	  procedures-with-setters in terms of applicable structs with setters.

	* libguile/procs.h: Remove a big, outdated comment, and the deprecated
	  macros.

	* libguile/deprecated.h (SCM_PROCEDURE_WITH_SETTER_P, SCM_PROCEDURE)
	  (SCM_SETTER): Deprecate these. SCM_PROCEDURE and SCM_SETTER are bad
	  names.

	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/gc.c (scm_i_tag_name):
	* libguile/goops.c: (scm_class_of):
	* libguile/print.c (iprin1):
	* libguile/procprop.c (scm_i_procedure_arity):
	* libguile/procs.c (scm_procedure_p):
	* libguile/debug.c (scm_procedure_source): Remove a tc7_pws case.

	* libguile/goops.h:
	* libguile/goops.c (scm_class_procedure_with_setter): Remove this class;
	  it is subsumed by applicable_struct_with_setter.

	* libguile/struct.h: Update a comment.

	* libguile/vm-i-system.c (call, goto/args, mv-call): Remove PWS cases.

2009-12-05  Andy Wingo  <wingo@pobox.com>

	structs are alive early in guile's boot
	* libguile/init.c (scm_i_init_guile): Reorder deps so structs are
	  initialized early in the boot process.

	more annotations to scm_i_init_guile
	* libguile/init.c (scm_i_init_guile): Annotate things that need smobs.

	decruftify scm_sys_protects
	* libguile/root.h
	* libguile/root.c (scm_sys_protects): It used to be that for some reason
	  we'd define a special array of "protected" values. This was a little
	  silly, always, but with the BDW GC it's completely unnecessary. Also
	  many of these variables were unused, and none of them were good API.
	  So remove this array, and either eliminate, make static, or make
	  internal the various values.

	* libguile/snarf.h: No need to generate calls to scm_permanent_object.

	* guile-readline/readline.c (scm_init_readline): No need to call
	  scm_permanent_object.

	* libguile/array-map.c (ramap, rafe): Remove the dubious nullvect
	  optimizations.

	* libguile/async.c (scm_init_async): No need to init scm_asyncs, it is
	  no more.

	* libguile/eval.c (scm_init_eval): No need to init scm_listofnull, it is
	  no more.

	* libguile/gc.c: Make scm_protects a static var.
	  (scm_storage_prehistory): Change the sanity check to use the address
	  of protects.
	  (scm_init_gc_protect_object): No need to clear the scm_sys_protects,
	  as it is no more.

	* libguile/keywords.c: Make the keyword obarray a static var.
	* libguile/numbers.c: Make flo0 a static var.
	* libguile/objprop.c: Make object_whash a static var.
	* libguile/properties.c: Make properties_whash a static var.

	* libguile/srcprop.h:
	* libguile/srcprop.c: Make scm_source_whash a global with internal
	  linkage.

	* libguile/strings.h:
	* libguile/strings.c: Make scm_nullstr a global with internal linkage.

	* libguile/vectors.c (scm_init_vectors): No need to init scm_nullvect,
	  it's unused.

	further boot cleanups
	* libguile/srfi-14.c (define_charset):
	* libguile/deprecated.c (scm_create_hook): Don't bother making the
	  returned objects (hooks or charsets) into permanent objects; they are
	  already defined, and then the caller probably stores them away too.

	* libguile/init.c (scm_i_init_guile): Add a couple annotations.

	more boot cleanup
	* libguile/bytevectors.c (scm_bootstrap_bytevectors): Remove a call to
	  scm_gc_protect_object.

	* libguile/gc.h:
	* libguile/gc.c (scm_init_gc_protect_object): Rename from
	  scm_init_storage, and just return void. Make the GC boot procs have
	  internal linkage.

	* libguile/init.c: Adapt to the name change.

	remove a bunch of needless scm_permanent_object calls
	* libguile/array-handle.c:
	* libguile/bytevectors.c:
	* libguile/deprecated.c:
	* libguile/eval.c:
	* libguile/feature.c:
	* libguile/filesys.c:
	* libguile/gc.c:
	* libguile/gdbint.c:
	* libguile/goops.c:
	* libguile/instructions.c:
	* libguile/load.c:
	* libguile/modules.c:
	* libguile/numbers.c:
	* libguile/options.c:
	* libguile/ports.c:
	* libguile/scmsigs.c:
	* libguile/srcprop.c:
	* libguile/srfi-4.c:
	* libguile/stacks.c:
	* libguile/threads.c:
	* libguile/vm.c: Remove calls to scm_permanent_object, as they are no
	  longer needed with the BDW GC.

	some scm_i_init_guile cleanups
	* libguile/init.c (scm_i_init_guile): Since hash tables are tc7 objects,
	  things that depend on hash tables no longer depend on smobs, so move
	  smob_prehistory up a bit. No more struct_prehistory.

	* libguile/struct.h:
	* libguile/struct.c (scm_struct_prehistory): Remove empty function.

	remove scm_ports_prehistory
	* libguile/ports.h:
	* libguile/ports.c (scm_ports_prehistory): Remove this function. Just
	  initialize global vars to NULL/0 instead of needing a prehistory
	  function.

	add printer for dynamic-states
	* libguile/fluids.c:
	* libguile/fluids.h:
	* libguile/print.c: Add dynamic-state printing infrastructure.

	fluids are tc7 objects
	If you're wondering what I'm doing, I'm trying to eventually reimplement
	smobs in terms of structs, so that applicable smobs can just follow the
	applicable struct dispatch path. But to do that I have to get structs
	initialized before things that use smobs, which means transforming a
	bunch of smobby things to tc7 things. But this transformation is good
	for performance anyway, and we currently have a glut of unused tc7s,
	so here we go...

	* libguile/tags.h (scm_tc7_fluid, scm_tc7_dynamic_state): Fluids (and
	  dynamic states) now have tc7s.

	* libguile/fluids.h: Remove scm_fluids_prehistory, and add internal
	  scm_i_fluid_print. Update a comment.

	* libguile/fluids.c: Update for tc7 representation. Also remove the next
	  pointers while we're at it, as they aren't used in the new BDW GC.

	* libguile/eq.c (scm_equal_p): Remove the hashtable case. Hashtables
	  could never be equal? before, I don't see why to add stubs doing the
	  same thing now.

	* libguile/print.c (iprin1):
	* libguile/gc.c (scm_i_tag_name):
	* libguile/evalext.c (scm_self_evaluating_p): Add fluid and
	  dynamic_state cases.

	* libguile/goops.h: Remove scm_class_hashtable; it will be static.
	* libguile/goops.c: Make <hashtable> static, and add <fluid> and
	  <dynamic-state> classes.

	* libguile/hashtab.h:
	* libguile/hashtab.c: Remove scm_i_hashtable_equal_p.

	* libguile/init.c (scm_i_init_guile): Remove call to fluids_prehistory.

	hash tables have a tc7
	* libguile/tags.h (scm_tc7_hashtable): Allocate a tc7 for hashtables.

	* libguile/hashtab.h: Adjust macros accordingly.
	  (scm_i_hashtable_print, scm_i_hashtable_equal_p): New internal
	  functions.
	  (scm_hashtab_prehistory): Remove, no more need for this.

	* libguile/hashtab.c (scm_hash_fn_remove_x): Fix a longstanding bug.
	  (make_hash_table): Adapt to the new hash table representation.

	* libguile/eq.c (scm_equal_p)
	* libguile/evalext.c (scm_self_evaluating_p)
	* libguile/print.c (iprin1)
	* libguile/gc.c (scm_i_tag_name): Add some tc7_hashtab cases.

	* libguile/init.c: Remove unused environments init functions. Remove
	  call to hashtab_prehistory.

	* libguile/goops.h (scm_class_hashtable)
	* libguile/goops.c (scm_class_of, create_standard_classes): Have to
	  make a class for hash tables manually, because they aren't smobs any
	  more.

2009-12-04  Andy Wingo  <wingo@pobox.com>

	eval.c closures are now applicable smobs, not tc3s
	* libguile/debug.c (scm_procedure_name): Remove a SCM_CLOSUREP case and
	  some dead code.
	  (scm_procedure_module): Remove. This was introduced a few months ago
	  for the hygienic expander, but now it is no longer needed, as the
	  expander keeps track of this information itself.

	* libguile/debug.h: Remove scm_procedure_module.

	* libguile/eval.c: Instead of using tc3 closures, define a "boot
	  closure" applicable smob type, and represent closures with that. The
	  advantage is that after eval.scm is compiled, boot closures take up no
	  address space (besides a smob number) in the runtime, and require no
	  special cases in procedure dispatch.

	* libguile/eval.h: Remove the internal functions scm_i_call_closure_0
	  and scm_closure_apply, and the public function scm_closure.

	* libguile/gc.c (scm_storage_prehistory): No tc3_closure displacement
	  registration.
	  (scm_i_tag_name): Remove closure case, and a dead cclo case.

	* libguile/vm.c (apply_foreign):
	* libguile/print.c (iprin1):
	* libguile/procs.c (scm_procedure_p, scm_procedure_documentation);
	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/goops.c (scm_class_of): Remove tc3_closure/tcs_closure cases.
	* libguile/hash.c (scm_hasher):

	* libguile/hooks.c (scm_add_hook_x): Use new scm_i_procedure_arity.

	* libguile/macros.c (macro_print): Print all macros using the same code.
	  (scm_macro_transformer): Return any procedure, not just programs.

	* libguile/procprop.h:
	* libguile/procprop.c (scm_i_procedure_arity): Instead of returning a
	  list that the caller has to parse, have the same prototype as
	  scm_i_program_arity. An incompatible change, but it's an internal
	  function anyway.
	  (scm_procedure_properties, scm_set_procedure_properties)
	  (scm_procedure_property, scm_set_procedure_property): Remove closure
	  cases, and use scm_i_program_arity for arity.

	* libguile/procs.h (SCM_CLOSUREP, SCM_CLOSCAR, SCM_CODE)
	  (SCM_CLOSURE_NUM_REQUIRED_ARGS, SCM_CLOSURE_HAS_REST_ARGS)
	  (SCM_CLOSURE_BODY, SCM_PROCPROPS, SCM_SETPROCPROPS, SCM_ENV)
	  (SCM_TOP_LEVEL): Remove these macros that pertain to boot closures
	  only. Only eval.c should know abut boot closures.
	* libguile/procs.c (scm_closure_p): Remove this function. There is a
	  simple stub in deprecated.scm now.
	  (scm_thunk_p): Use scm_i_program_arity.
	* libguile/tags.h (scm_tc3_closure): Remove. Yay, another tc3 to play
	  with!
	  (scm_tcs_closures): Remove.

	* libguile/validate.h (SCM_VALIDATE_CLOSURE): Remove.

	* module/ice-9/deprecated.scm (closure?): Add stub.

	* module/ice-9/documentation.scm (object-documentation)
	* module/ice-9/session.scm (help-doc, arity)
	* module/oop/goops.scm (compute-getters-n-setters)
	* module/oop/goops/describe.scm (describe)
	* module/system/repl/describe.scm (display-object, display-type):
	  Remove calls to closure?.

	remove cxrs
	* libguile/pairs.h:
	* libguile/pairs.c: Previously scm_cdadr et al were implemented as
	  #defines that called scm_i_chase_pairs, and the Scheme-exposed
	  functions themselves were cxr subrs, which got special help in the
	  interpreter. Since now the special help is unnecessary (because the
	  compiler inlines and expands calls to car, cdadr, etc), the complexity
	  is a loss. So just implement cdadr etc using normal functions. There's
	  an advantage too, in that the compiler can unroll the cxring, reducing
	  branches.

	* libguile/tags.h (scm_tc7_cxr): Remove this tag.
	  (scm_tcs_subrs): Now there's only one kind of subr, yay!

	* libguile/debug.c (scm_procedure_name)
	* libguile/evalext.c (scm_self_evaluating_p)
	* libguile/gc.c (scm_i_tag_name)
	* libguile/goops.c (scm_class_of)
	* libguile/hash.c (scm_hasher)
	* libguile/print.c (iprin1)
	* libguile/procprop.c (scm_i_procedure_arity)
	* libguile/procs.c (scm_procedure_p, scm_subr_p)
	  (scm_make_procedure_with_setter)
	* libguile/vm.c (apply_foreign): Remove cxr cases. Replace uses of
	  scm_tcs_subrs with scm_tc7_gsubr.

	remove rpsubrs
	* libguile/tags.h: Remove rpsubrs (I chose to interpret the terse name
	  as "recursive predicate subrs"). Just use gsubrs with rest arguments,
	  or do a fold yourself.

	* libguile/array-map.c (scm_i_array_equal_p): Do the comparison in
	  order, why not.

	* libguile/chars.c:
	* libguile/eq.c:
	* libguile/numbers.c:
	* libguile/strorder.c: Add 0,2,1 gsubr wrappers for rpsubrs like eq?, <,
	  etc.

	* libguile/goops.c (scm_class_of)
	* libguile/procprop.c (scm_i_procedure_arity)
	* libguile/procs.c (scm_thunk_p)
	* libguile/vm.c (apply_foreign): Remove rpsubr cases.

	* test-suite/tests/numbers.test ("=", "<"): Turn a couple xfails into
	  passes.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	remove asubrs
	* libguile/tags.h (scm_tcs_subrs, scm_tc7_asubr): Remove definitions.

	* libguile/goops.c (scm_class_of)
	* libguile/procprop.c (scm_i_procedure_arity)
	* libguile/procs.c (scm_thunk_p)
	* libguile/vm.c (apply_foreign): Remove cases for asubrs.

	* libguile/array-map.c: Gut all of the optimizations, because there are
	  no more asubrs, soon won't be rpsubrs, and all of this should happen
	  on the Scheme level, ideally.

	speed up scm_call_N for non-programs
	* libguile/eval.c (scm_call_0, scm_call_1, scm_call_2, scm_call_3): All
	  of these should dispatch through the VM, without consing.

	simplify apply_foreign
	* libguile/vm.c (apply_foreign): Simplify.

	+, -, min, lcm, gcd now documented
	* test-suite/tests/numbers.test: Change some xfail documented? tests to
	  passes.

	change asubrs to be gsubrs
	* libguile/numbers.h:
	* libguile/numbers.c (scm_i_gcd, scm_i_lcm, scm_i_logand, scm_i_logior)
	  (scm_i_logxor, scm_i_min, scm_i_max, scm_i_sum, scm_i_difference)
	  (scm_i_product, scm_i_divide): Change asubrs to be gsubrs.

	+ is not an asubr
	* libguile/numbers.h:
	* libguile/numbers.c (scm_i_sum): Rework so that scm_sum is just a
	  normal function. Its generic is actually provided by scm_i_sum, a
	  gsubr with rest args. In that way, + is no longer an asubr.

	remove scm_tc7_dsubr
	* libguile/tags.h: Remove scm_tc7_dsubr. There are no more users of
	  this.

	* libguile/array-map.c:
	* libguile/eval.c:
	* libguile/eval.i.c:
	* libguile/goops.c:
	* libguile/procprop.c:
	* libguile/procs.h: Remove all dsubr cases.

	remove "primitive numerics" from the docs
	* doc/ref/api-data.texi: Update for $sin deprecation.

	implement transcendental sin, cos etc in c; deprecate $sin, $cos, etc
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_asinh, scm_acosh, scm_atanh): Deprecate
	  these stand-ins for the C99 asinh, acosh, and atanh functions. Guile
	  is not gnulib.
	  (scm_sys_atan2): Deprecate as well, in favor of scm_atan.

	* libguile/numbers.h:
	* libguile/numbers.c (scm_sin, scm_cos, scm_tan)
	  (scm_sinh, scm_cosh, scm_tanh)
	  (scm_asin, scm_acos, scm_atan)
	  (scm_sys_asinh, scm_sys_acosh, scm_sys_atanh): New functions,
	  replacing the combination of dsubrs and boot-9 wrappers with C subrs
	  that handle complex values. The latter three have _sys_ in their names
	  due to the name conflict with the deprecated scm_asinh et al.

	  Remove the $abs, $sin etc "dsubrs".

	* module/ice-9/boot-9.scm: Remove transcendental functions, as this all
	  happens in C now.

	* module/ice-9/deprecated.scm: Add aliases for $sin et al.

	* test-suite/tests/ramap.test ("array-map!"): Adjust "dsubr" tests to
	  use sqrt, not $sqrt. They don't actually test dsubrs now. In the
	  two-source test, I'm pretty sure the dsubr array-map! should have been
	  failing, as indeed it does now; I've changed the test case to expect
	  the failure. I'd still like to know why it was succeeding before.

	expt implemented in C, handles complex numbers
	* libguile/numbers.h:
	* libguile/numbers.c (scm_expt): Rename from scm_sys_expt, and handle
	  the complex cases as well.

	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_sys_expt): Add a deprecated shim.

	* module/ice-9/boot-9.scm (expt): Remove definition, scm_expt does all
	  we need.

	remove tc7_subr_* and tc7_lsubr_*
	* libguile/tags.h: Remove tc7 #defines for subrs, replacing them with
	  placeholders. These were public, but hopfully unused. I don't see how
	  to usefully deprecate them.

	* libguile/array-map.c (scm_array_map_x): Remove special cases for
	  certain subr types. This might make things slower for the moment,
	  otoh, native compilation should moot that question.

	* libguile/eval.i.c:
	* libguile/eval.c: Remove subr-handling cases. To regain this speed and
	  more won't have to wait for native compilation, though -- this change
	  smooths the way for subr dispatch in the VM.

	* libguile/gsubr.c (scm_i_gsubr_apply): Fix a bug in which we didn't
	  detect too-many-arguments. This would only show up when using ceval,
	  as only ceval called this function.

	* test-suite/tests/ramap.test ("array-map!"): Change the expected
	  exception if passed a procedure of the wrong arity. It now gives
	  wrong-num-args.
	  more won't have to wait for native compilation, though -- this change
	  smooths the way for subr dispatch in the VM.

	* libguile/goops.c (scm_class_of): Remove subr cases. No speed
	  implication.

	* libguile/objects.c (scm_valid_object_procedure_p): Remove this public
	  but undocumented, and useless, function. I do not think this will
	  affect anyone at all.
	  (scm_set_object_procedure_x): Replace a call to
	  scm_valid_object_procedure_p with scm_procedure_p, and actually wrap
	  with a scm_is_true.

	* module/oop/goops.scm (initialize-object-procedure): Don't call
	  valid-object-procedure?.

	all subrs are gsubrs
	* libguile/gsubr.c (create_gsubr, create_gsubr_with_generic): Always
	  create gsubrs -- never the specialized tc7 types. Allow gsubrs to have
	  generics, there doesn't seem to be any reason not to.

	* libguile/macros.c (scm_make_synt):
	* libguile/values.c (scm_init_values):
	* libguile/eval.c (scm_init_eval):
	* libguile/gc.c (scm_init_gc): Use scm_c_define_gsubr instead of
	  scm_c_define_subr.

	* libguile/goops.c (scm_class_of): Allow gsubrs to be primitive
	  generics.

	replace frame implementation with VM frames
	* libguile/stacks.h: Rework so that a stack doesn't copy information out
	  of VM frames, it just holds onto a VM frame, along with the stack id
	  and length. VM frames are now the only representation of frames in
	  Guile.
	  (scm_t_info_frame, SCM_FRAME_N_SLOTS, SCM_FRAME_REF, SCM_FRAME_NUMBER)
	  (SCM_FRAME_FLAGS, SCM_FRAME_SOURCE, SCM_FRAME_PROC, SCM_FRAME_ARGS)
	  (SCM_FRAME_PREV, SCM_FRAME_NEXT)
	  (SCM_FRAMEF_VOID, SCM_FRAMEF_REAL, SCM_FRAMEF_PROC)
	  (SCM_FRAMEF_EVAL_ARGS, SCM_FRAMEF_OVERFLOW)
	  (SCM_FRAME_VOID_P, SCM_FRAME_REAL_P, SCM_FRAME_PROC_P)
	  (SCM_FRAME_EVAL_ARGS_P, SCM_FRAME_OVERFLOW_P): Remove these macros
	  corresponding to the old frame implementation.
	  (scm_frame_p scm_frame_source, scm_frame_procedure)
	  (scm_frame_arguments): These definitions are now in frames.h.
	  (scm_last_stack_frame): Remove declaration of previously-removed
	  constructor. Probably should re-instate it though.
	  (scm_frame_number, scm_frame_previous, scm_frame_next)
	  (scm_frame_real_p, scm_frame_procedure_p, scm_frame_evaluating_args_p)
	  (scm_frame_overflow_p) : Remove these procedures corresponding to the
	  old stack implementation.

	* libguile/stacks.c: Update for new frames implementation.

	* libguile/frames.h:
	* libguile/frames.c: Rename functions operating on VM frames to have a
	  scm_frame prefix, not scm_vm_frame -- because they really are the only
	  frames we have. Rename corresponding Scheme functions too, from
	  vm-frame-foo to frame-foo.

	* libguile/deprecated.h: Remove scm_stack and scm_info_frame data types.

	* libguile/vm.c (vm_dispatch_hook): Adapt to scm_c_make_frame name
	  change.

	* module/system/vm/frame.scm: No need to export functions provided
	  frames.c now, as we load those procedures into the default environment
	  now. Rename functions, and remove a couple of outdated, unused
	  functions. The bottom half of this file is still bitrotten, though.

	* libguile/backtrace.c: Rework to operate on the new frame
	  representation. Also fix a bug displaying file names for compiled
	  procedures.

	* libguile/init.c: Load the VM much earlier, just because we can. Also
	  it allows us to have frames.[ch] loaded in time for stacks to be
	  initialized, so that scm_frame_arguments can do the right thing.

	remove debug frames
	* libguile/debug.h (scm_t_debug_frame): Remove this type, as it was
	  internal to the old evaluator.
	  (SCM_EVALFRAME, SCM_APPLYFRAME, SCM_VOIDFRAME, SCM_MACROEXPF)
	  (SCM_TAILREC, SCM_TRACED_FRAME, SCM_ARGS_READY, SCM_DOVERFLOW)
	  (SCM_MAX_FRAME_SIZE, SCM_FRAMETYPE)
	  (SCM_EVALFRAMEP, SCM_APPLYFRAMEP, SCM_VOIDFRAMEP, SCM_MACROEXPFP)
	  (SCM_TAILRECP, SCM_TRACED_FRAME_P, SCM_ARGS_READY_P, SCM_OVERFLOWP)
	  (SCM_SET_MACROEXP, SCM_SET_TAILREC, SCM_SET_TRACED_FRAME)
	  (SCM_SET_ARGSREADY, SCM_SET_OVERFLOW)
	  (SCM_CLEAR_MACROEXP, SCM_CLEAR_TRACED_FRAME, SCM_CLEAR_ARGSREADY):
	  Remove macro accessors to scm_t_debug_frame.
	  (SCM_DEBUGOBJP, SCM_DEBUGOBJ_FRAME, SCM_SET_DEBUGOBJ_FRAME):
	  (scm_debug_object_p, scm_make_debugobj): Remove debugobj accessors.
	  (scm_i_unmemoize_expr): Remove unused declaration.

	* libguile/debug.c (scm_debug_options): No more max limit on frame
	  sizes.
	  (scm_start_stack): Just call out to scm_vm_call_with_new_stack.
	  (scm_debug_object_p, scm_make_debugobj, scm_init_debug): No more
	  debugobj smob type.

	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_i_deprecated_last_debug_frame)
	  (scm_last_debug_frame): Remove deprecated debug-frame bits.

	* libguile/stacks.c (scm_make_stack): Rework this function and its
	  dependents to only walk VM frames.
	  (scm_stack_id): Call out to the holder of the VM frame in question,
	  which should be a VM or a VM continuation, for the stack ID. Currently
	  this bit is stubbed out.
	  (scm_last_stack_frame): Removed. It seems this is mainly useful for a
	  debugger, and we need to rewrite the debugger to work on the Scheme
	  level.

	* test-suite/tests/continuations.test ("continuations"): Remove test for
	  last-stack-frame.

	* libguile/continuations.h (struct scm_t_contregs):
	* libguile/continuations.c (scm_make_continuation):
	  (copy_stack_and_call, scm_i_with_continuation_barrier): No need to
	  save and restore debug frames.

	* libguile/threads.h (scm_i_thread): Don't track debug frames.
	  (scm_i_last_debug_frame, scm_i_set_last_debug_frame): Remove macro
	  accessors.

	* libguile/threads.c (guilify_self_1): Don't track debug frames.

	* libguile/throw.c: No need to track debug frames in a jmpbuf.

	* libguile/vm-engine.c (vm_engine, VM_PUSH_DEBUG_FRAMES): Don't push
	  debug frames.

	* libguile/vm.h:
	* libguile/vm.c (scm_vm_call_with_new_stack): New function. Currently
	  stubbed out though.

	clarify comments in eval.scm
	* module/ice-9/eval.scm: Add some more comments.

	really boot primitive-eval from scheme.
	* libguile/eval.c (scm_primitive_eval, scm_c_primitive_eval):
	  (scm_init_eval): Rework so that scm_primitive_eval always calls out to
	  the primitive-eval variable. The previous definition is the default
	  value, which is probably overridden by scm_init_eval_in_scheme.

	* libguile/init.c (scm_i_init_guile): Move ports and load-path up, so we
	  can debug when initing eval. Call scm_init_eval_in_scheme. Awesome.

	* libguile/load.h:
	* libguile/load.c (scm_init_eval_in_scheme): New procedure, loads up
	  ice-9/eval.scm to replace the primitive-eval definition, if everything
	  is there and up-to-date.

	* libguile/modules.c (scm_module_transformer): Export to Scheme, so it's
	  there for eval.go.

	* module/ice-9/boot-9.scm: No need to define module-transformer.

	* module/ice-9/eval.scm (capture-env): Only reference the-root-module if
	  modules are booted.
	  (primitive-eval): Inline a definition for identity. Throw a more
	  standard error for "wrong number of arguments".

	* module/ice-9/psyntax.scm (chi-install-global): The macro binding for a
	  syncase macro is now a pair: the transformer, and the module that was
	  current when the transformer was installed. The latter is used for
	  hygiene purposes, replacing the use of procedure-module, which didn't
	  work with the interpreter's shared-code closures.
	  (chi-macro): Adapt for the binding being a pair, and get the hygiene
	  from the cdr.
	  (eval-local-transformer): Adapt to new form of macro bindings.

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

	* .gitignore: Ignore eval.go.stamp.

	* module/Makefile.am: Reorder for fastest serial compilation, now that
	  there are no ordering constraints. I did a number of experiments here
	  and this seems to be the best; but the bulk of the time is compiling
	  psyntax-pp.scm with eval.scm. Not so great.

	* libguile/vm-engine.c (vm-engine): Throw a more standard error for
	  "wrong type to apply".

	* test-suite/tests/gc.test ("gc"): Remove a hack that shouldn't affect
	  the new evaluator, and throw in another (gc) for good measure.

	* test-suite/tests/goops.test ("defining classes"):
	* test-suite/tests/hooks.test (proc1): We can't currently check what the
	  arity is of a closure made by eval.scm -- or more accurately all
	  closures have 0 required args and no rest args. So punt for now.

	* test-suite/tests/syntax.test ("letrec"): The scheme evaluator can't
	  check that a variable is unbound, currently; perhaps the full "fixing
	  letrec" expansion could fix this. But barring that, punt.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	apply goes to the vm, not the interpreter
	* libguile/eval.c (eval): Call scm_vm_apply instead of apply.
	  (apply): Deleted, no longer referenced. Heh.
	  (scm_apply): Call scm_vm_apply.

	* libguile/init.c (scm_i_init_guile): Bootstrap the VM before the
	  evaluator.

	* libguile/vm.c (scm_vm_apply): Actually it's not necessary that the
	  procedure is a program; so that's cool, relax the check.

	vm doesn't call the evaluator at all (at least not directly)
	* libguile/vm-i-system.c (goto/args, mv-call): Finish the port to use
	  apply_foreign instead of scm_apply.

	first step to make the vm stop calling the interpreter
	* libguile/eval.h:
	* libguile/eval.c (scm_closure_apply): New function, applies a closure.
	  Won't be necessary in the future, but for now here it is, with
	  internal linkage.

	* libguile/gsubr.h:
	* libguile/gsubr.c (scm_i_gsubr_apply_array): New function, applies a
	  gsubr to an array of values, potentially extending that array for
	  optional arguments and rest arguments and such.

	* libguile/vm.c (apply_foreign): New function, applies a foreign
	  function to arguments on the stack, in place.

	* libguile/vm-i-system.c (call): Add a case for procedures-with-setters
	  (will go away when they are applicable structs). Instead of calling
	  the evaluator for foreign functions, call apply_foreign.

	add new scheme evaluator
	* module/ice-9/eval.scm: New evaluator, written in Scheme. Whee!
	  Batteries included but not wired up.

	* module/Makefile.am: Abuse touch(1) to make sure eval.go gets built
	  before everything. Can't just depend on eval.go, because eval.go will
	  get the timestamp of eval.scm, which might be newer than foo.go (and
	  thus foo.scm). Something better is warranted.

	add memoized expression accessors to scheme
	* libguile/eval.c: Fix a comment.
	  (eval): Abstract out the variable memoization into a function,
	  scm_memoize_variable_access_x.

	* libguile/memoize.c (memoized_tags): Fix a couple names.
	  (scm_memoize_variable_access_x): New internal function. Actually it's
	  public to Scheme, but we can't do much about that, because the new
	  evaluator will need it.
	  (scm_memoized_expression_typecode, scm_memoized_expression_data): New
	  accessors for memoized code, for Scheme.
	  (scm_memoized_typecode): Looks up the typecode for a symbol.

	export scm_define to scheme as define!
	* libguile/modules.c (scm_define): Export to Scheme as `define!'. The
	  evaluator needs it, and actually it's an OK thing to have around.

	wire through the existing vm ops for variable-ref and variable-set!
	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile
	  variable-ref and variable-set instructions specially.

	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Add cases for variable-ref and
	  variable-set!. The latter is a little tricky, because the args are
	  switched for the VM op, and we can't really change that easily.

	fixes to variable-ref, variable-set vm ops
	* libguile/vm-i-system.c (variable-ref, variable-set): Fix declared
	  number of pops and pushes.

	promises are in their own file now
	* libguile.h:
	* libguile/Makefile.am:
	* libguile/eval.c:
	* libguile/eval.h:
	* libguile/init.c:
	* libguile/promises.c:
	* libguile/promises.h: Split promises out into their own file.

	new evaluator, y'all
	* libguile/eval.c: So, ladies & gents, a new evaluator. It's similar to
	  the old one, in that we memoize and then evaluate, but in this
	  incarnation, memoization of an expression happens before evaluation,
	  not lazily as the expression is evaluated. This makes the evaluation
	  itself much cleaner, in addition to being threadsafe. In addition,
	  since this C evaluator will in the future just serve to bootstrap the
	  Scheme evaluator, we don't have to pay much concern for debugging
	  conveniences. So the environment is just a list of values, and the
	  memoizer pre-computes where it's going to find each individual value
	  in the environment.

	  Interface changes are commented below, with eval.h.

	  (scm_evaluator_traps): No need to reset the debug mode after rnning te
	  traps thing. But really, the whole traps system needs some love.

	* libguile/memoize.h:
	* libguile/memoize.c: New memoizer, which runs before evaluation,
	  checking all syntax before evaluation begins. Significantly, no
	  debugging information is left for lexical variables, which is not so
	  great for interactive debugging; perhaps we should change this to have
	  a var list in the future as per the classic interpreters. But it's
	  quite fast, and the resulting code is quite good. Also note that it
	  doesn't produce ilocs, memoized code is a smob whose type is in the
	  first word of the smob itself.

	* libguile/eval.h (scm_sym_and, scm_sym_begin, scm_sym_case)
	  (scm_sym_cond, scm_sym_define, scm_sym_do, scm_sym_if, scm_sym_lambda)
	  (scm_sym_let, scm_sym_letstar, scm_sym_letrec, scm_sym_quote)
	  (scm_sym_quasiquote, scm_sym_unquote, scm_sym_uq_splicing, scm_sym_at)
	  (scm_sym_atat, scm_sym_atapply, scm_sym_atcall_cc)
	  (scm_sym_at_call_with_values, scm_sym_delay, scm_sym_eval_when)
	  (scm_sym_arrow, scm_sym_else, scm_sym_apply, scm_sym_set_x)
	  (scm_sym_args): Remove public declaration of these symbols.
	  (scm_ilookup, scm_lookupcar, scm_eval_car, scm_eval_body)
	  (scm_eval_args, scm_i_eval_x, scm_i_eval): Remove public declaration
	  of these functions.
	  (scm_ceval, scm_deval, scm_ceval_ptr): Remove declarations of these
	  deprecated functions.
	  (scm_i_print_iloc, scm_i_print_isym, scm_i_unmemocopy_expr)
	  (scm_i_unmemocopy_body): Remove declarations of these internal
	  functions.
	  (scm_primitive_eval_x, scm_eval_x): Redefine as macros for their less
	  destructive siblings.

	* libguile/Makefile.am: Add memoize.[ch] to the build.

	* libguile/debug.h (scm_debug_mode_p, scm_check_entry_p)
	  (scm_check_apply_p, scm_check_exit_p, scm_check_memoize_p)
	  (scm_debug_eframe_size): Remove these vars that were tied to the old
	  evaluator's execution model.
	  (SCM_RESET_DEBUG_MODE): Remove, no more need for this.
	  (SCM_MEMOIZEDP, SCM_MEMOIZED_EXP, SCM_MEMOIZED_ENV): Remove macros
	  referring to old memoized code representation.
	  (scm_local_eval, scm_procedure_environment, scm_memoized_environment)
	  (scm_make_memoized, scm_memoized_p): Remove functions operating on old
	  memoized code representation.
	  (scm_memcons, scm_mem_to_proc, scm_proc_to_mem): Remove debug-only
	  code for old evaluator.

	* libguile/debug.c: Remove code to correspond with debug.h removals.
	  (scm_debug_options): No need to set the debug mode or frame limit
	  here, as we don't have C stack limits any more. Perhaps this is a bug,
	  but as long as we can compile eval.scm, we should be fine.

	* libguile/init.c (scm_i_init_guile): Init memoize.c.

	* libguile/modules.c (scm_top_level_env, scm_env_top_level)
	  (scm_env_module, scm_system_module_env_p): Remove these functions.

	* libguile/print.c (iprin1): No more need to handle isyms. Adapt to new
	  form of interpreted procedures.

	* libguile/procprop.c (scm_i_procedure_arity): Adapt to new form of
	  interpreted procedures.

	* libguile/procs.c (scm_thunk_p): Adapt to new form of interpreted
	  procedures.
	* libguile/procs.h (SCM_CLOSURE_FORMALS): Removed, this exists no more.
	  (SCM_CLOSURE_NUM_REQUIRED_ARGS, SCM_CLOSURE_HAS_REST_ARGS): New
	  accessors.

	* libguile/srcprop.c (scm_source_properties, scm_source_property)
	  (scm_set_source_property_x): Remove special cases for memoized code.

	* libguile/stacks.c (read_frame): Remove a source-property case for
	  interpreted code.
	  (NEXT_FRAME): Remove a case that I don't fully understand, that seems
	  to be designed to skip over apply frames. Will be obsolete in the
	  futures.
	  (read_frames): Default source value for interpreted frames to #f.
	  (narrow_stack): Don't pay attention to the system_module thing.

	* libguile/tags.h: Remove isyms and ilocs. Whee!

	* libguile/validate.h (SCM_VALIDATE_MEMOIZED): Fix to use the new
	  MEMOIZED_P formulation.

	* module/ice-9/psyntax-pp.scm (do, quasiquote, case): Adapt for these no
	  longer being primitive macros.
	* module/ice-9/boot-9.scm: Whitespace change, but just a poke to force a
	  rebuild due to and/or/cond/... not being primitives any more.

	* module/ice-9/deprecated.scm (unmemoize-expr): Deprecate, it's
	  unmemoize-expression now.

	* test-suite/tests/eval.test ("define set procedure-name"): XFAIL a
	  couple of tests here; I don't know what to do about them. I reckon the
	  expander should ensure that defined values are named.

	* test-suite/tests/chars.test ("basic char handling"): Fix expected
	  exception when trying to apply a char.

	goops moving away from evaluator opcodes, and a primitive compilation fix
	* module/oop/goops.scm (@slot-ref, @slot-set!): Define "primitives" for
	  these. Probably should do something more general, though, allowing
	  @struct-ref.

	* module/language/tree-il/primitives.scm (add-interesting-primitive!):
	  Error if the primitive isn't bound.

	remove (lang elisp), as it won't work with the new evaluator
	* lang/: Delete. This causes me some pain, but the new elisp compiler is
	  coming soon, and the old one really won't work with the new evaluator.
	* Makefile.am:
	* configure.ac: Autotoolery for elisp removal.
	* test-suite/tests/elisp.test: Comment out the body of the elisp test.
	  The tests themselves should be useful in the new world, though.

	local-eval will go away
	* module/ice-9/debugger/commands.scm:
	* module/ice-9/debugging/traps.scm:
	* module/ice-9/emacs.scm:
	* module/ice-9/gds-client.scm: Add some FIXMEs due to impending
	  local-eval removal.

	* module/oop/goops.scm (make-generic-bound-check-getter): Just the
	  compiled closure case here.

	no special treatment for memoized code in srcprop.c
	* libguile/srcprop.c (scm_set_source_properties_x): No need to treat
	  memoized code specially.

	* test-suite/tests/srcprop.test ("set-source-property!")
	  ("set-source-properties!"): Well, just throw 'unresolved on these for
	  now, because we need a few more things to land before these can be
	  fixed, or even considered.

	factor copy-tree and cons-source out of eval.[ch]
	* libguile.h:
	* libguile/Makefile.am
	* libguile/init.c (scm_i_init_guile): Add trees.[ch] to the build.

	* libguile/eval.c:
	* libguile/eval.h: Remove scm_copy_tree and scm_cons_source...

	* libguile/trees.h:
	* libguile/trees.c:
	* libguile/srcprop.h:
	* libguile/srcprop.c: ... factoring them out here and here,
	  respectively.

	* test-suite/tests/eval.test ("memoization"): Change expected exception
	  for circular data structures, given new copy-tree location.

	remove unused scm_eval_stack var
	* libguile/private-options.h:
	* libguile/eval.c (scm_eval_stack): Remove declaration and definition of
	  unused scm_eval_stack variable.

	remove evaluator-specific code from macros.c
	* libguile/macros.c (macro_print): No special printing for macros
	  whose code is an interpreted procedure.

	remove class-environment slot, goops grubs less in the evaluator
	* libguile/goops.h (scm_sys_tag_body): Remove declaration of undefined
	  function.
	  (SCM_CLASS_CLASS_LAYOUT, scm_si_environment, SCM_N_CLASS_SLOTS)
	  (scm_class_environment) Remove class environment slot and getter.

	* libguile/goops.c (compute_getters_n_setters): Use scm_primitive_eval
	  to produce the init thunk, instead of scm_i_eval_x; though really we
	  should be doing this in Scheme.
	  (scm_basic_basic_make_class, build_class_class_slots)
	  (create_basic_classes, scm_class_environment): Remove class
	  environment slot.
	  (get_slot_value, set_slot_value): Use scm_call_1 instead of evaluator
	  tricks.

	* module/oop/goops.scm: Remove class-environment export, and
	  environments throughout the file.

	fix to gdb_eval to use newer interfaces
	* libguile/gdbint.c (gdb_eval): Use scm_primitive_eval instead of
	  scm_i_eval_x.

	formally deprecate trampolines
	* libguile/eval.c:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_trampoline_0, scm_trampoline_1)
	  (scm_trampoline_2): Actually deprecate trampolines.

	* srfi/srfi-1.c: Fix all trampoline uses in srfi-1.c.

	remove uses of trampolines within guile itself
	* libguile/eval.c (scm_map, scm_for_each)
	* libguile/hashtab.c (scm_hash_for_each_handle)
	* libguile/list.c (scm_filter, scm_filter_x)
	* libguile/quicksort.i.c:
	* libguile/sort.c (scm_restricted_vector_sort_x, scm_sorted_p)
	  (scm_merge, scm_merge_list_x, scm_merge_x)
	  (scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x)
	  (scm_merge_vector_step, scm_stable_sort_x, scm_sort_list_x)
	  (scm_sort_list)nn
	* libguile/srfi-13.c (scm_string_any, scm_string_every)
	  (scm_string_tabulate, scm_string_trim, string_trim_right)
	  (scm_string_trim_both, scm_string_index, scm_string_index_right)
	  (scm_string_skip, scm_string_skip_right, scm_string_count)
	  (scm_string_map, scm_string_map_x, scm_string_for_each)
	  (scm_string_for_each_index, scm_string_filter, scm_string_delete):
	  Remove uses of trampolines.

	gut the backtrace implementation for memoized code
	* libguile/backtrace.c (display_header, display_expression)
	  (display_error_body, display_backtrace_get_file_line, display_frame):
	  Gut the implementation for memoized code, as memoized code as it is
	  currently understood is going away.

	remove some deprecated things, undeprecate scm_the_root_module()
	* libguile/deprecated.h
	* libguile/deprecated.c (SCM_ILOC00, SCM_IDINC, SCM_IDSTMSK)
	  (scm_s_expression, scm_s_test, scm_s_body, scm_s_bindings)
	  (scm_s_variable, scm_s_clauses, scm_s_formals, SCM_EVALIM2)
	  (SCM_EVALIM, SCM_XEVAL, SCM_XEVALCAR): Remove these macros and
	  constants, deprecated in 2003.
	  (scm_the_root_module): Undeprecate, it's actually a useful function,
	  that other parts of the code use.

	* libguile/modules.h (scm_the_root_module): Undeprecated.
	* libguile/modules.c (scm_the_root_module): Rename from
	  the_root_module. Use it in the rest of this file.

	tweak to eval.c
	* libguile/eval.c (eval_letrec_inits): Rename from ceval_letrec_inits.
	  Caller changed.

	eval.i.c -> eval.c
	* libguile/Makefile.am:
	* libguile/eval.i.c: Remove eval.i.c.

	* libguile/eval.c: Fold eval.i.c's contents into eval.c.

	more ceval excision
	* libguile/eval.c:
	* libguile/eval.i.c: Rename deval to eval. Substitute in some
	  preprocessor macros.

	remove code from eval.i.c that was only for CEVAL.
	* libguile/eval.i.c: Remove CEVAL-only code.

	Don't double-include eval.i.c -- let's only build deval.
	* libguile/eval.c (SCM_I_XEVAL, SCM_I_XEVALCAR): No more debug_p args,
	  we are always debugging. Adapt all callers.
	  (ceval_letrec_inits): For some reason this function is used by deval.
	  No idea why. Pull it out here.

	* libguile/eval.i.c (SCM_APPLY): scm_dapply is scm_apply.

	gut trampolines
	* libguile/eval.c: Gut the trampoline implementation. We'll be doing
	  much more clever things here that will obviate the need for the
	  procedure arg of map and for-each to be allocated in many cases...
	  trampolines were a noble attempt at optimizing in the wrong place.

	* srfi/srfi-1.c (scm_srfi1_lset_difference_x): Validate that we get a
	  proc, because the trampoline won't do it for us.

	* test-suite/tests/sort.test ("sort"):
	* test-suite/tests/srfi-1.test ("count", "fold", "list-index"):
	  Change expected exceptions, due to trampoline functions not doing any
	  computation.

	expand out named let to letrec in the eval case
	* module/ice-9/psyntax.scm: In the eval case, expand out named let to
	  letrec.
	* module/ice-9/psyntax-pp.scm: Regenerated.

2009-11-29  Ludovic Courtès  <ludo@gnu.org>

	Make `SCM' type definition acceptable for C++ compilers.
	* libguile/tags.h (SCM) [SCM_DEBUG_TYPING_STRICTNESS == 1]: Use a named
	  struct to avoid errors from C++ compilers such as "error: non-local
	  function ‘<anonymous struct>* foo(<anonymous struct>*)’ uses anonymous
	  type".  This fixes a regression introduced in
	  c6054feaf03f8bde236f5e45a946f38827074923 ("Add support for static
	  allocation of cells, strings and stringbufs.").  Reported by Linas
	  Vepstas <linasvepstas@gmail.com>.

2009-11-28  Ludovic Courtès  <ludo@gnu.org>

	Remove remaining uses of discouraged constructs, really.
	* libguile/throw.c, libguile/vm-engine.h, libguile/vm-i-system.c,
	  libguile/vm.c:  Replace uses of discouraged constructs by their
	  current counterparts.

	Remove remaining uses of discouraged constructs.
	* libguile/frames.c, libguile/instructions.c, libguile/objcodes.c,
	  libguile/programs.c, libguile/throw.c, libguile/vm-i-scheme.c,
	  libguile/vm.c:  Replace uses of discouraged constructs by their
	  current counterparts.

2009-11-27  Ludovic Courtès  <ludo@gnu.org>

	Disable encoding scanning on non-seekable file ports.
	* libguile/read.c (scm_i_scan_for_encoding): Don't attempt to scan
	  non-seekable file ports.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	header tidyings
	* libguile/goops.h:
	* libguile/struct.h: c-backslash-region some vars.

	brace placement fixes
	* libguile/goops.c (scm_sys_allocate_instance):
	* libguile/vm-i-loader.c (load-wide-string): Fix some brace placements.

	push goops compile delay out to 30 invocations, for great justice
	* module/oop/goops/dispatch.scm (timer-init): Init to 30 for faster
	  goops load time.

	generic method cache begone
	* libguile/goops.h (SCM_GENERIC_METHOD_CACHE)
	  (SCM_SET_GENERIC_METHOD_CACHE, scm_si_generic_cache)
	* libguile/goops.c (create_standard_classes): Remove slot for generic
	  method cache. Yay!

	remove code that manages the method cache
	* libguile/goops.h (SCM_MCACHE_N_SPECIALIZED)
	  (SCM_SET_MCACHE_N_SPECIALIZED, SCM_INITIAL_MCACHE_SIZE)
	  (scm_make_method_cache, scm_memoize_method, scm_mcache_lookup_cmethod)
	  (scm_mcache_compute_cmethod):
	* libguile/goops.c: Remove these procedures which managed the method
	  cache. There's still a slot there but it's not initialized. The method
	  cache is no longer necessary.

	* module/oop/goops/dispatch.scm (memoize-method!): Change to not take a
	  "cache" argument.

	* libguile/eval.i.c:
	* libguile/vm-i-system.c: Remove dispatch via the method cache.

	remove method cache management code from (oop goops dispatch)
	* module/oop/goops/dispatch.scm: Remove old method cache things.

	generics now dispatch as applicable structs
	* libguile/eval.i.c (CEVAL, SCM_APPLY): Dispatch applicable structs
	  before pure generics. In practice what this means is that we never hit
	  the mcache case, because all pure generics are applicable structs.
	  We're moving over to having generics dispatch themselves. Also, they
	  don't prepend the struct as an arg; in order to have that effect, the
	  user has closures.

	* libguile/goops.c (scm_apply_generic, scm_call_generic_0):
	  (scm_call_generic_1, scm_call_generic_2, scm_call_generic_3): Dispatch
	  directly to the struct procedures.
	  (scm_var_make_extended_generic): Remove a duplicate definition for
	  scm_var_make_extended_generic.
	  (create_standard_classes): Mark all instances of
	  <applicable-struct-class> (themselves classes) as applicable classes.
	  Meaning: generics are now applicable structs.

	* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT): The hashsets are actually
	  uw slots -- or at least, making subclasses maps the int slots to be uw
	  slots

	* libguile/vm-i-system.c (call, goto/args, mv-call): Dispatch applicable
	  structs in the VM.

	* module/oop/goops/dispatch.scm (emit-linear-dispatch): Fix bug in the
	  non-rest cache miss case.
	  (delayed-compile): Rework to avoid fluids.
	  (cache-dispatch): Don't call `equal?', it causes bootstrapping
	  problems with the primitive-generic equal?. Using our own version is
	  faster anyway.

	make sure that when equal? is extended, that the generic has a method
	* libguile/goops.h:
	* libguile/goops.c (scm_set_primitive_generic_x): New function, for now
	  local to the goops module.

	* module/oop/goops.scm (equal?): Make sure that when equal? is extended,
	  that the generic already has a default method.

	remove cache-mutex slot from generics
	* libguile/goops.c:
	* libguile/goops.h: Remove cache-mutex slot from generics, and renumber
	  other slots.

	remove locking in method memoization
	* libguile/goops.c (scm_memoize_method): Don't lock around method
	  memoization, as the new protocol will be reeentrant and lock-free.

	limn goops flags, remove foreign objs, rename entity to applicable-struct
	* libguile/goops.c (scm_class_applicable_struct)
	  (scm_class_applicable_struct_with_setter)
	  (scm_class_applicable_struct_class): Rename from
	  scm_class_entity, scm_class_entity_with_setter, and
	  scm_class_entity_class.
	  (scm_class_simple_method): Removed; this abstraction is not used.
	  (scm_class_foreign_class, scm_class_foreign_object): Remove these,
	  they are undocumented and unused. They might come back later.
	  (scm_sys_inherit_magic_x): Simply inherit the vtable flags from the
	  class's class. Flags are about layout, and it is the class that
	  determines the layout of the instance.
	  (scm_basic_basic_make_class): Don't bother setting GOOPS_OR_VALID,
	  inherit-magic will do that.
	  (scm_basic_make_class): Inherit magic after setting the layout. Allows
	  the struct magic checker to do its job.
	  (scm_accessor_method_slot_definition): Move implementation to Scheme.
	  Removes the need for the accessor flag.
	  (scm_sys_allocate_instance): Adapt to scm_i_alloc_struct name change,
	  and that alloc-struct will handle finalization.
	  (scm_compute_applicable_methods): Remove accessor check, as it's
	  unnecessary.
	  (scm_make): Adapt to new generic slot order, and no more
	  simple-method.
	  (create_standard_classes): What was the GF slot "dispatch-procedure"
	  is now the applicable-struct slot "procedure". No more foreign class,
	  foreign object, or simple method. Rename <entity> and friends to
	  <applicable-struct> and friends. No more entity-with-setter -- though
	  perhaps it will come back too. Instead generic-with-setter is its own
	  thing.

	* libguile/goops.h (SCM_CLASSF_METACLASS): "A goops class that is a
	  vtable" -- no need for a separate flag.
	  (SCM_CLASSF_FOREIGN, SCM_CLASSF_SIMPLE_METHOD)
	  (SCM_CLASSF_ACCESSOR_METHOD): Removed these unused flags.
	  (SCM_ACCESSORP): Removed.
	  Renumber generic slots, rename entity classes, and remove the foreign
	  class, foreign object, and simple method classes.

	* libguile/struct.c (scm_i_struct_inherit_vtable_magic): New function,
	  called when making new vtables.applicable structs
	  (scm_i_alloc_struct): Remove 8-bit alignment check, as libGC
	  guarantees this for us. Handle finalizer registration here.
	  (scm_make_struct): Factor some things to scm_i_alloc_struct and
	  scm_i_struct_inherit_vtable_magic.
	  (scm_make_vtable_vtable): Adapt to scm_i_alloc_struct name change.

	* libguile/struct.h (scm_i_alloc_struct): Change name from
	  scm_alloc_struct, and make internal.

	* module/oop/goops.scm (oop): Don't declare #:replace <class> et al,
	  because <class> isn't defined in the core any more.
	  (accessor-method-slot-definition): Defined in Scheme now.
	  Remove <foreign-object> methods.
	  (initialize on <class>): Prep layout before inheriting magic, as in
	  scm_basic_make_class.

	* module/oop/goops/dispatch.scm (delayed-compile)
	  (memoize-effective-method!): Adapt to 'procedure slot name change.

	%invalidate-method-cache invalidates the dispatch procedure too
	* libguile/goops.c (make_dispatch_procedure, clear_method_cache):
	  Properly reset the dispatch procedure.

	generic dispatch protocol in scheme, not yet wired up
	* module/oop/goops/dispatch.scm: Add a dispatch protocol in Scheme. The
	  idea is that instead of using a hardcoded C protocol, we compile
	  dispatch procedures at runtime. To avoid too much thrashing at bootup,
	  there is a simple JIT mechanism -- dispatch will be data-driven,
	  through the cache, for the first 5 invocations, then a dispatch
	  procedure will be compiled from the cache.

	  My initial timings indicate that interpreted dispatch takes about
	  100us, and that compiled dispatch takes about 60us. Compilation itself
	  takes about 16000us (16 ms). The compiled procedure dispatch times
	  will improve soon, hopefully.

	eqv? not a generic, equal? dispatches to generic only for objects
	* libguile/eq.c (scm_eqv_p): Not a generic any more. Since eqv? is used
	  by e.g. `case', which should be able to compile into dispatch tables,
	  it really doesn't make sense to dispatch out to a generic.
	  (scm_equal_p): So it was always the case that (equal? 'foo "foo") =>
	  #f. But (equal? 'foo 'bar) could actually be extended by a generic.
	  This was a bug, if you follow the other logic of the code. Changed so
	  that generic functions can only extend the domain of equal? when
	  operating on goops objects.

	* oop/goops.scm: No more eqv? generic.

	* test-suite/tests/goops.test: Remove eqv? tests.

	generic tweaks; realizing what the setter slot actually is
	* libguile/goops.h (scm_si_dispatch_procedure)
	  (scm_si_effective_methods): Rename the new generics slots to
	  "effective-methods" and "dispatch-procedure".
	  (scm_si_generic_setter): Rename this one from "%setter" to "setter",
	  and it's not a cache -- it's a pointer to the setter, which is also a
	  generic. I didn't realize that before. It's better this way (like it
	  always was.)
	  (SCM_SET_GENERIC_DISPATCH_PROCEDURE)
	  (SCM_CLEAR_GENERIC_EFFECTIVE_METHODS): New helper macros.

	* libguile/goops.c (clear_method_cache): Clear the new dispatch
	  procedure and the effective methods as well.
	  (create_standard_classes): Rename slots, and fix the setter slots.

	more clarity in (oop goops dispatch)
	* module/oop/goops/dispatch.scm (memoize-method!): If we don't have a
	  no-applicable-method, just call no-applicable-method directly.

	* test-suite/tests/goops.test ("no-applicable-method"): Add some tests.

	remove code-table slot from methods
	* libguile/goops.c (scm_sys_invalidate_method_cache_x, scm_make)
	  (create_standard_classes): Remove code-table slot from methods. The
	  generic cache completely does its job, afaict.

	* libguile/goops.h (scm_si_formals, scm_si_body, scm_si_make_procedure):
	  Renumber slots.

	* module/oop/goops.scm (initialize on <method>): No more code-table
	  slot.

	* module/oop/goops/compile.scm: Always "compile" a method, instead of
	  looking for a hit in an always-empty cache.

	remove used-by slot from generics
	* libguile/goops.c (clear_method_cache)
	  (scm_sys_invalidate_method_cache_x, scm_make)
	  (create_standard_classes): Remove the used-by method from generics, as
	  it is not used at all.

	* libguile/goops.h: Renumber generic slots.

	* module/oop/goops/dispatch.scm (memoize-method!): No more used-by slot.

	first step towards effective methods
	* libguile/goops.c (create_standard_classes):
	* libguile/goops.h *scm_si_applicable_methods, scm_si_effective_method)
	  (scm_si_applicable_setter_methods, scm_si_effective_setter_method):
	  Add space for the new form of the generic cache and effective method.

	a very big commit cleaning up structs & goops. also applicable structs.
	I tried to split this one, and I know it's a bit disruptive, but this
	stuff really is one big cobweb. So instead we'll pretend like these are
	separate commits, by separating the changelog.

	Applicable struct runtime support.

	* libguile/debug.c (scm_procedure_source):
	* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
	  (scm_trampoline_2):
	* libguile/eval.i.c (CEVAL):
	* libguile/goops.c (scm_class_of):
	* libguile/procprop.c (scm_i_procedure_arity):
	* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Allow
	  for applicable structs. Whee!

	* libguile/deprecated.h (scm_vtable_index_vtable): Define as a synonym
	  for scm_vtable_index_self.
	  (scm_vtable_index_printer): Alias scm_vtable_index_instance_printer.
	  (scm_struct_i_free): Alias scm_vtable_index_instance_finalize.
	  (scm_struct_i_flags): Alias scm_vtable_index_flags.
	  (SCM_STRUCTF_FLAGS): Be a -1 mask, we have a whole word now.
	  (SCM_SET_VTABLE_DESTRUCTOR): Implement by hand.

	Hidden slots.

	* libguile/struct.c (scm_make_struct_layout): Add support for "hidden"
	  fields, writable fields that are not visible to make-struct. This
	  allows us to add fields to vtables and not break existing make-struct
	  invocations.
	  (scm_struct_ref, scm_struct_set_x): Always get struct length from the
	  vtable. Support hidden fields.

	* libguile/goops.c (scm_class_hidden, scm_class_protected_hidden): New
	  slot classes, to correspond to the new vtable slots.
	  (scm_sys_prep_layout_x): Turn hidden slots into 'h'.
	  (build_class_class_slots): Reorder the class slots to account for
	  vtable fields coming out of negative-land, for name as a vtable slot,
	  and for hidden fields.
	  (create_standard_classes): Define <hidden-slot> and
	  <protected-hidden-slot>.

	Clean up struct.h.

	* libguile/struct.h: Lay things out cleaner. There are no more hidden
	  (negative) words. Names are nicer. The exposition is nicer. But the
	  basics are the same. The incompatibilities are that <vtable> has more
	  slots now, and that scm_alloc_struct's signature has changed. The
	  former is ameliorated by the "hidden" slots mentioned before, and the
	  latter, well, it was always a very internal thing...
	  (scm_t_struct_finalize): New type, a finalizer function to be run when
	  instances of a vtable are collected.
	  (scm_t_struct_free): Removed, structs' data is managed by the GC now,
	  and not freed by vtable functions.

	* libguile/struct.c: (scm_vtable_p): Now we keep flags on
	  vtable-vtables, so this check is cheaper.
	  (scm_alloc_struct): No hidden words. Yippee.
	  (struct_finalizer_trampoline): Entersify.
	  (scm_make_struct): No need to babysit extra words, though now we have
	  to babysit flags. Propagate the vtable, applicable, and setter flags
	  appropriately.
	  (scm_make_vtable_vtable): Update for new simplicity.
	  (scm_print_struct): A better printer.
	  (scm_init_struct): Define <applicable-struct-vtable>, a magical vtable
	  like CL's funcallable-standard-class. Also define
	  <applicable-struct-with-setter-vtable>.

	Remove foreign object implementation.

	* libguile/goops.h:
	* libguile/goops.c (scm_make_foreign_object, scm_make_class)
	  (scm_add_slot, scm_wrap_object, scm_wrap_component): Remove, these
	  were undocumented and unworking.

	Clean up goops.h, a little.

	* libguile/goops.h:
	* libguile/goops.c: Also clean up.
	* module/oop/goops/dispatch.scm (hashset-index): Adapt for new hashset
	  index.

2009-11-25  Ludovic Courtès  <ludo@gnu.org>

	Remove uses of discouraged constructs.
	* libguile/vm-i-scheme.c, libguile/vm-i-system.c, libguile/vm.c: Replace
	  uses of discouraged constructs by their current counterparts.

	Don't build `inet-aton' and `inet-ntoa' when --disable-networking.
	* libguile/deprecated.c (scm_inet_aton, scm_inet_ntoa): Conditionalize
	  on `HAVE_NETWORKING'.

2009-11-24  Ludovic Courtès  <ludo@gnu.org>

	Use $(PATH_SEPARATOR) where appropriate.
	* examples/Makefile.am (AM_CFLAGS, AM_LIBS): Use $(PATH_SEPARATOR)
	  instead of `:'.
	  (installcheck): Likewise.

	Fix makefile indentation.
	* benchmark-suite/Makefile.am, libguile/Makefile.am, meta/Makefile.am:
	  Use TAB instead of 8 spaces...

	* .x-sc_makefile_check: New file.

	Properly quote the first argument to `AC_DEFINE{,_UNQUOTED}'.
	* acinclude.m4, configure.ac, examples/compat/acinclude.m4: Properly
	  quote the first argument for `AC_DEFINE' and `AC_DEFINE_UNQUOTED'.

	* .x-sc_m4_quote_check: New file.

	Add `cfg.mk', for use by the top-level GNUmakefile.
	* cfg.mk: New file, with 1.9.5 `NEWS' hash.

	"filesystem" -> "file system"
	* doc/ref/misc-modules.texi, doc/sources/unix.texi,
	  module/ice-9/ftw.scm: Replace "filesystem" by "file system".

	Don't rely on `HAVE_' macros in public header "tags.h".
	* configure.ac: Check for `intptr_t' and `uintptr_t'.  Substitute
	  `SCM_I_GSC_T_INTPTR' and `SCM_I_GSC_T_UINPTR'.

	* libguile/__scm.h (SCM_T_UINTPTR_MAX, SCM_T_INTPTR_MIN,
	  SCM_T_INTPTR_MAX): New macros.

	* libguile/_scm.h (SIZEOF_SCM_T_BITS): New macro.

	* libguile/gen-scmconfig.c (main): Produce typedefs for `scm_t_intptr'
	  and `scm_t_uintptr'.

	* libguile/gen-scmconfig.h.in (SCM_I_GSC_T_INTPTR, SCM_I_GSC_T_UINPTR):
	  New macros.

	* libguile/tags.h: Don't check for `HAVE_INTTYPES_H' and
	  `HAVE_STDINT_H'; don't include <inttypes.h> nor <stdint.h>.
	  (scm_t_signed_bits, scm_t_bits): Define unconditionally as aliases for
	  `scm_t_intptr' and `scm_t_uintptr', respectively.
	  (SCM_T_SIGNED_BITS_MAX, SCM_T_SIGNED_BITS_MIN, SCM_T_BITS_MAX):
	  Likewise.
	  (SIZEOF_SCM_T_BITS): Remove.

	Remove unused, non-prefixed macros.
	* libguile/__scm.h (BIGNUMS, TICKS): Remove.

	Update to Gnulib v0.0-2923-g6575ab5.

	Really disable thread-local storage on NetBSD 5.0.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Adjust to match actual
	  NetBSD 5 triplet, `x86_64-unknown-netbsd5.0.' (note the final dot).

	Fix compilation `--without-threads'.
	* configure.ac: For `--without-threads' and `--with-threads=null', set
	  `SCM_I_GSC_HAVE_THREAD_STORAGE_CLASS=0'.  This fixes compilation of
	  `gen-scmconfig.c' in these cases.

2009-11-23  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `duplocale' module.
	* libguile/i18n.c (scm_make_locale): Simplify global locale handling,
	  using duplocale(3) for all kinds of locales.
	  (scm_init_i18n): Comment on why we don't just use `LC_GLOBAL_LOCALE'
	  for `global_locale_smob'.

	* m4/gnulib-cache.m4: Add `duplocale'.

	Use Gnulib's `locale' module.
	* configure.ac: Remove test for <xlocale.h>.

	* libguile/i18n.c: Remove conditional <xlocale.h> inclusion on
	  `HAVE_XLOCALE_H'.

	* m4/gnulib-cache.m4: Add `locale' module.

	Correct manual wrt. encoding names.
	* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
	  Don't suggest `latin1' as a good encoding name since Emacs cannot deal
	  with it.

	* libguile/read.c (scm_file_encoding): Fix "Emacs" spelling.

2009-11-21  Andy Wingo  <wingo@pobox.com>

	better printing of procedures with keyword arguments
	* module/system/vm/program.scm (arguments->lambda-list): Print keyword
	  arguments more sensibly.

	fix version-etc for older autoconf
	* lib/version-etc.c: Don't reference the undefined PACKAGE if
	  PACKAGE_URL is undefined. Probably should go upstream.

2009-11-18  Ludovic Courtès  <ludo@gnu.org>

	autogen.sh: Don't presume /usr/bin/m4.
	* autogen.sh: Don't presume /usr/bin/m4.

	Work around path name length limitations in `socket.test'.
	* test-suite/tests/socket.test (%tmpdir, %curdir): New variables.
	  Chdir to %TMPDIR.  Switch back to %CURDIR at the end.
	  (temp-file-path): Return a base file name, not an absolute path.

	Remove conflicting definition of $PACKAGE from `GUILE-VERSION'.
	This obviates the need for the previous commit,
	53da7372beca90a58b7401a84627815289a53d11.

	* GUILE-VERSION (VERSION, PACKAGE): Remove.  The latter was conflicting
	  with Automake's definition, which is "guile", not "GNU Guile".

	* Makefile.am (distdir): Remove.

	* configure.ac: Hardcode the package name passed to `AC_INIT'.
	  (pkgdatadir, pkgincludedir, pkglibdir, pkglibexecdir): Remove.

	Fix $(pkgdatadir) & co. so they refer to $(PACKAGE_TARNAME), not $(PACKAGE).
	This fixes a regression introduced in
	4f02b98d0ed4a314916c69a225d7a45dda3f5f8c ("Use Gnulib's
	`version-etc-fsf' for `--version' and `--help' output."), which led
	$(pkgdatadir) & co. to contain the string "GNU Guile" instead of
	"guile".

	* configure.ac (pkgdatadir, pkgincludedir, pkglibdir, pkglibexecdir):
	  New variables.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 1.9.5.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

	Don't use `-Werror' by default.
	* configure.ac (GUILE_ERROR_ON_WARNING): Default to "no".

	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.

	* NEWS: Update.

	Fix copyright headers.
	* module/system/vm/debug.scm, module/system/vm/frame.scm,
	  module/system/vm/vm.scm: Switch to LGPLv3+.

	Fix stylistic issues revealed by "make syntax-check".
	* libguile/gc-malloc.c (scm_must_free): Remove unnecessary `if' before
	  `free ()'.

	* libguile/stime.c (scm_localtime, scm_mktime): Likewise.

	* libguile/eval.i.c (ceval): Don't cast the result of alloca(3).

	* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Likewise.

	* test-suite/standalone/test-unwind.c: Likewise.

	* libguile/strings.c (scm_i_deprecated_string_chars): Don't end error
	  message in period.

	Add Gnulib maintainer modules.
	* m4/gnulib-cache.m4: Add `announce-gen', `gendocs', `gitlog-to-changelog',
	  `gnupload', `gnu-web-doc-update', and `maintainer-makefile'.

	* .gnuploadrc, .x-sc_GPL_version, .x-sc_avoid_if_before_free,
	  .x-sc_error_message_period, .x-sc_cast_of_alloca_return_value,
	  .x-sc_cast_of_argument_to_free, .x-sc_error_message_uppercase,
	  .x-sc_error_message_warn_fatal: New files.

	Use Gnulib's `version-etc-fsf' for `--version' and `--help' output.
	* m4/gnulib-cache.m4: Add `version-etc-fsf'.  Switch to LGPLv3+.

	* GUILE-VERSION (PACKAGE): Change to "GNU Guile".

	* Makefile.am (distdir): New variable.

	* libguile/script.c (scm_shell_usage): Improve formatting.  Use
	  `emit_bug_reporting_address ()'.
	  (scm_compile_shell_switches): Use `version_etc ()'.

	Build the C code with additional GCC warnings.
	* configure.ac (POTENTIAL_GCC_CFLAGS): Add
	  `-Wdeclaration-after-statement -Wundef -Wswitch-enum'.

	Remove references to undefined macros.
	The intent is to allow compilation with `-Wundef', which in turn should
	make it easier to catch erroneous uses of nonexistent macros.

	* libguile/__scm.h: Don't assume `BUILDING_LIBGUILE' is defined.

	* libguile/conv-uinteger.i.c (SCM_TO_TYPE_PROTO): Remove unneeded CPP
	  conditional on `TYPE_MIN == 0'.

	* libguile/fports.c: Check for the definition of `HAVE_CHSIZE' and
	  `HAVE_FTRUNCATE', not for their value.

	* libguile/ports.c: Likewise.

	* libguile/numbers.c (guile_ieee_init): Likewise with `HAVE_DINFINITY'
	  and `HAVE_DQNAN'.

	* test-suite/standalone/test-conversion.c (ieee_init): Likewise.

	* libguile/strings.c: Likewise with `SCM_STRING_LENGTH_HISTOGRAM'.

	* libguile/strings.h: Likewise.

	* libguile/tags.h: Likewise with `HAVE_INTTYPES_H' and `HAVE_STDINT_H'.

	* libguile/threads.c: Likewise with `HAVE_PTHREAD_GET_STACKADDR_NP'.

	* libguile/vm-engine.c (VM_NAME): Likewise with `VM_CHECK_IP'.

	* libguile/gen-scmconfig.c (main): Use "#ifdef HAVE_", not "#if HAVE_".

	* libguile/socket.c (scm_setsockopt): Likewise.

	Remove now unneeded `putenv.c'.
	* libguile/Makefile.am (EXTRA_libguile_la_SOURCES): Remove `putenv.c'.

	* libguile/putenv.c: Remove.

	Remove `qt/'.

	Fix C99-style declarations after statements.
	* libguile/eval.i.c (ceval): Move declarations before statements.

	* libguile/read.c (scm_read_extended_symbol): Likewise.

	* libguile/struct.c (scm_make_struct_layout): Likewise.

	* libguile/threads.c (fat_mutex_unlock): Likewise.

	* libguile/vm-i-system.c (br_if_nargs_ne, br_if_nargs_lt): Likewise.

	* libguile/vm.c (make_vm): Likewise.

	Remove deprecated guardian code.
	* libguile/guardians.c (guardian_apply): Remove `#if ENABLE_DEPRECATED'
	  section since it was never compiled in, not even in 1.8.
	  (scm_init_guardians): Likewise.

	Use Gnulib's `warning' module.
	* m4/gnulib-cache.m4: Add `warnings'.

	* configure.ac: Use `gl_WARN_ADD' to check whether compiler flags are
	  supported.

	* libguile/Makefile.am (libguile_la_LIBADD): Add $(LTLIBICONV).
	  (libguile_la_LDFLAGS): Add $(INET_NTOP_LIB) $(INET_PTON_LIB).

2009-11-17  Andy Wingo  <wingo@pobox.com>

	fold 1.9.5 NEWS items into the main text
	* NEWS: Fold 1.9.5 things into the main text.

	Update NEWS.
	* NEWS: Update for 1.9.5. Still needs these entries to be folded into
	  the main section though.

2009-11-16  Andy Wingo  <wingo@pobox.com>

	with a rest arg, allow for keywords anywhere
	* libguile/vm-i-system.c (br-if-nargs-gt): Fix variable declaration
	  placement.
	  (bind-kwargs): Patch mostly by Ludovic: it seems that in the mode in
	  which we have rest args, the keywords can appear anywhere. Bummer.
	  Change to allow for this.

	* module/ice-9/optargs.scm (parse-lambda-case): Same, add a
	  permissive-keys clause that handles the case in which there's a rest
	  argument.

2009-11-16  Ken Raeburn  <raeburn@raeburn.org>

	SCM_DEBUG fix: Don't apply SCM_CAR to non-pairs when walking argument lists in method cache matching.
	* libguile/goops.c (scm_mcache_lookup_cmethod): Don't apply SCM_CAR to
	  non-pairs when walking argument lists in method cache matching.
	  Don't check for CLASSP or symbol in the car slot, since the end of
	  the specifier list is a non-pair.  Update comments to reflect new
	  structure of method cache entry.
	* module/oops/goops/dispatch.scm: Update comments here too.

2009-11-16  Ludovic Courtès  <ludo@gnu.org>

	Add `iconv_open-solaris.h' to remove dependency on gperf.
	* lib/iconv_open-solaris.h: New file.

	Use Gnulib's `alignof' module.
	* m4/gnulib-cache.m4: Use `alignof'.

	* libguile/objcodes.c (scm_c_make_objcode_slice): Use `alignof_type'.

	Deprecate `inet-ntoa' and `inet-aton'.
	Suggested by Bruno Haible.

	* libguile/inet_aton.c: Remove.

	* libguile/Makefile.am (EXTRA_libguile_la_SOURCES): Remove
	  `inet_aton.c'.

	* libguile/deprecated.c (scm_inet_aton, scm_inet_ntoa): New functions.

	* libguile/deprecated.h: Update accordingly.

	* libguile/socket.c (scm_inet_aton, scm_inet_ntoa): Remove.

	* doc/ref/posix.texi (Network Address Conversion): Mark `inet-ntoa' and
	  `inet-aton' as deprecated.

	Use Gnulib's `inet_ntop' and `inet_pton' modules.
	* m4/gnulib-cache.m4: Add `inet_ntop' and `inet_pton'.

	* configure.ac: Don't check for `inet_ntop' and `inet_pton'.

	* libguile/socket.c (scm_inet_pton, scm_inet_ntop): Compile regardless
	  of `HAVE_INET_PTON' and `HAVE_INET_NTOP' respectively.

	* libguile/filesys.c: Use <stdlib.h> instead of <canonicalize.h>.

	Re-add an indirection in bytevectors.
	The intent is to allow for mmap(3) bindings and to actually reuse
	user-provided buffers in `scm_c_take_bytevector ()'.

	* libguile/bytevectors.h (SCM_BYTEVECTOR_HEADER_SIZE): Increment.
	  (SCM_BYTEVECTOR_CONTENTS): Take the pointer from the second word.
	  (SCM_BYTEVECTOR_CONTIGUOUS_P): New macro.
	  (SCM_BYTEVECTOR_ELEMENT_TYPE): Adjust to live alongside the CONTIGUOUS
	  flag.

	* libguile/bytevectors.c (SCM_BYTEVECTOR_SET_CONTENTS,
	  SCM_BYTEVECTOR_SET_CONTIGUOUS_P): New macros.
	  (SCM_BYTEVECTOR_SET_ELEMENT_TYPE): Adjust.
	  (SCM_BYTEVECTOR_TYPED_LENGTH): Properly parenthesize.
	  (make_bytevector): Adjust to new bytevector header.
	  (make_bytevector_from_buffer): Reuse CONTENTS.
	  (scm_c_shrink_bytevector): Differentiate between contiguous and
	  non-contiguous bytevectors.

	Remove unused internal bytevector functions.
	* libguile/bytevectors.c (scm_i_make_typed_bytevector,
	  scm_c_take_typed_bytevector): Remove.

	* libguile/bytevectors.h: Adjust accordingly.

	Run the GC and retry `open-file' when getting `EMFILE'.
	* libguile/fports.c (scm_open_file): Run the GC and retry when getting
	  `EMFILE'.

	Improve documentation of supported encoding names.
	* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
	  Mention IANA as the list of supported character encodings.  Thanks to
	  Bruno Haible for pointing this out.

	* doc/ref/api-io.texi (Ports): Likewise.  Improve documentation of
	  `%default-port-encoding'.

2009-11-16  Ken Raeburn  <raeburn@raeburn.org>

	Fix off-by-one error in processing Emacs-style coding declaration.
	* libguile/read.c (scm_i_scan_for_encoding): Don't copy the first
	  character after the coding declaration into the new string.

2009-11-15  Andy Wingo  <wingo@pobox.com>

	opcodes for bit twiddling (ash, logand, logior, logxor)
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/primitives.scm:
	* libguile/vm-i-scheme.c (ash, logand, logior, logxor): New opcodes.

	class-of has an opcode
	* libguile/vm-i-scheme.c (class-of): New opcode.
	* module/language/tree-il/compile-glil.scm:
	* module/oop/goops.scm: Compile class-of into an opcode.

	faster conditionals
	* module/language/tree-il/compile-glil.scm (flatten): Compile `if'
	  statements with `eq?' and `null?', and their `not?' variants, into
	  more specific bytecode.

	fix (apply f) -- without the args list
	* module/language/tree-il/primitives.scm (apply): Only inline if we
	  actually have an argument to apply.

	Revert "implement #:predicate" and remove predicate from <lambda-case>
	Turns out this was not a very useful idea, and semantically tricky to
	boot.

	This reverts commit 24bf130fd15afbc8b3a2ccdc50a027f9b6c9e623, and makes
	the following additional changes:

	* module/ice-9/optargs.scm (parse-lambda-case, let-optional)
	  (let-optional*, let-keywords, let-keywords*):
	* module/language/tree-il.scm: (<lambda-case>, parse-tree-il)
	  (unparse-tree-il, tree-il->scheme, tree-il-fold,
	  make-tree-il-folder)
	  (post-order!, pre-order!):
	* module/language/tree-il/analyze.scm (analyze-lexicals):
	* module/language/tree-il/compile-glil.scm (compile-glil):
	* module/language/tree-il/inline.scm (inline!): Remove all traces of
	  #:predicate from tree-il.

	* module/ice-9/psyntax.scm (build-simple-lambda, build-lambda-case)
	  (chi-lambda-case): Adapt to tree-il change.
	* module/ice-9/psyntax-pp.scm: Regenerated.

	* module/language/brainfuck/compile-tree-il.scm (compile-body):
	* module/language/ecmascript/compile-tree-il.scm (comp, comp-body):
	* test-suite/tests/tree-il.test: Adapt to tree-il change.

	* doc/ref/api-procedures.texi (Case-lambda): Remove mention of
	  #:predicate.

	actually set all 8 hashsets in classes
	* libguile/goops.c (prep_hashsets): Actually set all 8 hashsets. Doh...

	remove goops-local %tag-body
	* libguile/goops.c (scm_sys_tag_body): Remove goops-local hack that is
	  no longer necessary.

	SCM_VALIDATE_VTABLE tweak
	* libguile/validate.h (SCM_VALIDATE_VTABLE): Simply call
	  scm_struct_vtable_p.

	fix printing-programs bug
	* module/system/vm/program.scm (write-program): Fix a bug if we couldn't
	  get a procedure's arity.

	values.c defines a vtable, not a vtable-vtable
	* libguile/values.c (scm_init_values): Define a vtable, not a
	  "metaclass".

	srfi-35 properly uses vtable-offset-user
	* module/srfi/srfi-35.scm (condition-type-id):
	  (condition-type-parent, condition-type-all-fields): Don't ref fixed
	  struct indices, use vtable-offset-user instead.

	fix a structs.test test
	* test-suite/tests/structs.test ("equal?"): Instantiate vtables, not
	  vtable-vtables. "hello" is not a valid vtable layout.

	remove redundant, unnecessary instance size from struct vtables
	* libguile/struct.h (scm_struct_i_size): Remove this shared field -- I
	  mean, the slot is still there, but it's only used for flags.

	* libguile/goops.h (SCM_SET_CLASS_INSTANCE_SIZE):
	* libguile/goops.c (scm_sys_inherit_magic_x, scm_make_class): Remove
	  uses and definition of SCM_SET_CLASS_INSTANCE_SIZE. Light structs used
	  it, but you have that info in the layout; and foreign classes used it,
	  but that is going away soon anyway :)

	fold objects.[ch] into goops.[ch]
	Remove objects.h #includes as appropriate.

	remove support for "entities" -- a form of applicable struct
	Entities were meant to be a form of applicable struct. Unfortunately,
	the implementation is intertwingled with generics. Removing them, for
	now, will make it possible to cleanly re-add applicable struct support.

	* libguile/struct.h (SCM_STRUCTF_ENTITY): Remove.
	  (SCM_STRUCTF_GOOPS_HACK): New flag; sigh.
	* libguile/struct.c (scm_make_struct): We make "entity" structs if the
	  GOOPS_HACK flag is set. This will be fixed when we rework flags and
	  remove hidden words.

	* libguile/goops.c (scm_class_of): Structs are not applicable, for now
	  at least.
	  (scm_sys_inherit_magic_x, scm_basic_basic_make_class)
	  (scm_sys_allocate_instance, scm_sys_set_object_setter_x):
	  (make_struct_class): Adapt for no more entities (and thus no entity
	  flag).
	  (create_standard_classes): For some reason, generic functions were
	  getting the LIGHT flag set, after the ENTITY flag was removed; so for
	  now explicitly clear that flag.
	* libguile/goops.h (SCM_GENERIC_SETTER, SCM_SET_GENERIC_SETTER): New
	  macros.

	* libguile/objects.h:
	* libguile/objects.c: Remove code for entities.

	* libguile/debug.c: (scm_procedure_source): Only work with generics.

	* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
	  (scm_trampoline_2): Only handle generics.

	* libguile/eval.i.c (CEVAL): #ifdef out the pieces about entities.

	* libguile/procprop.c (scm_i_procedure_arity): Remove support for
	  entities.

	* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Remove
	  entity support.

	SCM_GENERIC_METHOD_CACHE macro splits from SCM_ENTITY_PROCEDURE
	* libguile/goops.h (SCM_GENERIC_METHOD_CACHE)
	  (SCM_SET_GENERIC_METHOD_CACHE): Two new macros; the same as
	  SCM_[SET_]ENTITY_PROCEDURE, but more reflecting the reality of the
	  generic hack.

	* libguile/eval.i.c:
	* libguile/goops.c:
	* libguile/objects.c:
	* libguile/vm-i-system.c: Use the new macros when it is appropriate to
	  do so.

	remove unused things from object.[ch]
	* libguile/objects.h:
	* libguile/objects.c (scm_object_procedure): Remove, it was only
	  compiled with SCM_DEBUG.

	* libguile/objects.h:
	* libguile/objects.c (scm_make_class_object, scm_make_subclass_object,
	  (scm_i_make_class_object, scm_metaclass_standard): Remove also. These
	  implemented an undocumented object system, and are totally replaced by
	  GOOPS.

	remove operators

	generic dispatch in the vm (sorta)
	* libguile/vm-i-system.c (call, goto/args, mv-call): Add a case for
	  generics, so we can avoid the evaluator in that case. Still have to
	  cons up a list -- the real solution comes later.

	remove unused struct gc chain macros
	* libguile/struct.h (SCM_STRUCT_GC_CHAIN, SCM_SET_STRUCT_GC_CHAIN):
	  Remove, no longer necessary given topological finalization, provided
	  by libGC.

	de-inline goops dispatch from the evaluator
	* libguile/eval.i.c: De-inline goops dispatch from the evaluator. Part
	  of a refactor.

2009-11-14  Andreas Rottmann  <a.rottmann@gmx.at>

	add quasisyntax
	* module/Makefile.am:
	* module/ice-9/boot-9.scm:
	* module/ice-9/quasisyntax.scm: Add quasisyntax. Implementation by Andre
	  van Tonder, patch by Andreas Rottmann.
	* test-suite/tests/srfi-10.test: Hack to remove srfi-10's clobbering of
	  #,.
	* test-suite/tests/syncase.test: Add a quasisyntax test.

2009-11-14  Andy Wingo  <wingo@pobox.com>

	add include-from-path
	* module/ice-9/psyntax.scm (include-from-path): New syntax. Searches the
	  load path for a file, and includes it.

	psyntax.scm uses #' shorthand for (syntax ...)
	* module/ice-9/psyntax.scm: Convert to use #'.

2009-11-14  Ludovic Courtès  <ludo@gnu.org>

	Add currently failing tests for optargs.
	* test-suite/tests/optargs.test (exception:unrecognized-keyword,
	  exception:extraneous-arguments): New variables.
	  ("define*")["extraneous arguments", "unrecognized keyword", "rest
	  given before keywords"]: New tests.

	Explicitly disable TLS on NetBSD 5.0.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Explicitly disable TLS on
	  NetBSD 5.0.

	Have `scm_scan_for_encoding ()' use GC-managed memory.
	* libguile/read.c (scm_scan_for_encoding): Rename to ...
	  (scm_i_scan_for_encoding): ... this; update callers.  Use
	  `scm_gc_strndup ()' instead of `scm_malloc ()'.

	* libguile/read.h: Update accordingly.

	* libguile/load.c (scm_primitive_load): Don't call free(3) on the value
	  returned by `scm_i_scan_for_encoding ()'.

	Replace `setbinary' by a public `%default-port-encoding' fluid.
	* doc/ref/api-evaluation.texi (Character Encoding of Source Files): Add
	  reference to the "Ports" node.

	* doc/ref/api-io.texi (Ports): Document `%default-port-encoding'.

	* libguile/ports.c (scm_port_encoding_var): Rename to...
	  (default_port_encoding_var): ... this; update callers.  Make `static'.

	* libguile/posix.c (scm_setbinary): Remove.

	* libguile/posix.h: Adjust accordingly.

	* test-suite/tests/numbers.test: Remove unneeded `setbinary' call.

	* test-suite/tests/ports.test: Replace `setbinary' call by equivalent
	  `%default-port-encoding' mutation and `set-port-encoding!' calls.

	* test-suite/tests/r6rs-ports.test: Replace `setbinary' call by
	  equivalent `%default-port-encoding' mutation.

	Explicitly require `sed'.
	* configure.ac: Use `AC_PROG_SED'.

2009-11-14  Andy Wingo  <wingo@pobox.com>

	fix bugs in ecmascript compiler
	* module/language/ecmascript/compile-tree-il.scm: Fix a number of bugs,
	  fallen out from the ghil->tree-il conversion.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add a hack
	  for "return" for javascript. Scheme shouldn't see this because it's
	  not an "interesting primitive".

	fix scoping in let-keywords
	* module/ice-9/optargs.scm (let-keywords): I thought that I had the
	  scoping right here, but I didn't. Make sure that the lambda formals
	  for the initializers are new, fresh identifiers, so that let scoping
	  works appropriately.

	fix bug in string comparison
	* libguile/srfi-13.c (compare_strings): Switch the "longer" and
	  "shorter" arguments. All the callers of this function assumed that
	  shorter came first. Fixes (string<? "abc" "abcd").

2009-11-10  Ludovic Courtès  <ludo@gnu.org>

	Improve the printer of SRFI-35 error conditions.
	* module/srfi/srfi-35.scm (print-condition): Print the name and value of
	  each field.

2009-11-08  Ludovic Courtès  <ludo@gnu.org>

	Add support for multiple arities in `arity-mismatch-analysis'.
	* module/language/tree-il/analyze.scm (validate-arity)[arity]: Rename
	  to...
	  [arities]: ... this.  Return all the arities of PROC.
	  Update caller accordingly.

	* test-suite/tests/tree-il.test ("warnings")["arity
	  mismatch"]("case-lambda", "case-lambda with wrong number of
	  arguments", "case-lambda*", "case-lambda* with wrong arguments"): New
	  tests.

	Update `.gitignore'.

	Fix C99-style comments.
	* libguile/generalized-vectors.c, libguile/programs.c, libguile/vm.c:
	  Replace C99-style comments by plain old C89 comments.

	Compile with `-Warity-mismatch'.
	* am/guilec (GUILE_WARNINGS): New variable; add `-Warity-mismatch'.
	  (.scm.go): Use it.

	Add tests for `unbound-variable-analysis'.
	* test-suite/tests/tree-il.test ("warnings")["unbound
	  variable"]("optional arguments are visible", "keyword arguments are
	  visible"): New tests.

	Fix optional argument handling in `unused-variable-analysis'.
	* module/language/tree-il/analyze.scm (unused-variable-analysis): Fix
	  optional argument handling in <lambda-case>.

	Add support for keyword arguments in `arity-mismatch-analysis'.
	* module/language/tree-il/analyze.scm
	  (validate-arity)[filter-keyword-args]: New procedure.
	  [arity]: Get accurate arity for programs, return ALLOW-OTHER-KEYS? as
	  an additional value.
	  Update to `arity' change; use `filter-keyword-args'.

	* test-suite/tests/tree-il.test ("warnings")["arity mismatch"]("keyword
	  not passed and quiet", "keyword passed and quiet", "keyword passed to
	  global and quiet", "extra keyword", "extra keywords allowed"): New
	  tests.

2009-11-07  Ludovic Courtès  <ludo@gnu.org>

	Fix typos leading to wrong argument counts.
	* module/ice-9/channel.scm (eval): Fix number of arguments to
	  `guile:eval'.

	* module/oop/goops/save.scm (write-readably): Fix number of arguments to
	  `write-array'.

	* module/srfi/srfi-19.scm (priv:char->int): Fix number of arguments to
	  `priv:time-error'.

	Fix typos in `psyntax'.
	* module/ice-9/psyntax.scm (lambda*-formals): Fix argument count in
	  `rest' invocations.
	  [pred]: Fix argument count in `syntax->datum' invocation.

	Add `arity-mismatch' warning type.
	* module/language/tree-il/analyze.scm (<arity-info>): New record type.
	  (validate-arity, arity-analysis): New variables.

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

	* module/system/base/message.scm (%warning-types): Likewise.

	* test-suite/tests/tree-il.test (read-and-compile): Remove, as it's now
	  public.
	  (%opts-w-arity): New.
	  ("warnings")["arity mismatch"]: New test prefix.

2009-11-06  Ludovic Courtès  <ludo@gnu.org>

	Coalesce tree traversals made for warnings.
	* module/language/tree-il/analyze.scm (<tree-analysis>): New type.
	  (analyze-tree): New procedure.
	  (report-unused-variables): Replace by...
	  (unused-variable-analysis): ... this, as a <tree-analysis>.
	  (report-possibly-unbound-variables): Replace by...
	  (unbound-variable-analysis): ... this, as a <tree-analysis>.

	* module/language/tree-il/compile-glil.scm (%warning-passes): Adjust
	  accordingly.
	  (compile-glil): Likewise.  Use `analyze-tree'.

2009-11-05  Ludovic Courtès  <ludo@gnu.org>

	Hold the GC lock when traversing weak hash table buckets.
	* libguile/hashtab.c (scm_fixup_weak_alist): Clarify comment.
	  (struct t_assoc_args): New.
	  (do_weak_bucket_assoc, weak_bucket_assoc): New.
	  (START_WEAK_BUCKET_FIXUP, END_WEAK_BUCKET_FIXUP): Remove.
	  (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x,
	  scm_hash_fn_remove_x): Use `weak_bucket_assoc ()' instead of
	  `START_WEAK_BUCKET_FIXUP'/`END_WEAK_BUCKET_FIXUP'.

	Fix snarfing of `SCM_DEFINE' with static allocation.
	* libguile/snarf.h (SCM_DEFINE)[SCM_SUPPORT_STATIC_ALLOCATION]: Provide
	  a declaration for FNAME since the last argument to
	  `SCM_IMMUTABLE_SUBR ()' refers to it.

2009-11-04  Neil Jerram  <neil@ossau.uklinux.net>

	Fill code coverage holes in continuations.c and keywords.c
	* test-suite/Makefile.am (SCM_TESTS): Add tests/keywords.test.

	* test-suite/standalone/Makefile.am (test-loose-ends): New test.

	* test-suite/standalone/test-loose-ends.c: New file.

	* test-suite/tests/continuations.test: Three new tests.

	* test-suite/tests/keywords.test: New file.

2009-11-03  Neil Jerram  <neil@ossau.uklinux.net>

	Increase benchmark iterations to improve precision in comparisons over time
	* benchmark-suite/benchmarks/continuations.bm: Increase "call/cc"
	  iterations from 300 to 12000.

	* benchmark-suite/benchmarks/srfi-13.bm ("strings"): Increase "copy"
	  iterations from 1100 to 20000, and "pad" from 6800 to 34000.

	* benchmark-suite/benchmarks/uniform-vector-read.bm
	  ("uniform-vector-read!"): Increase "uniform-vector-write" iterations
	  from 500 to 4000, and "uniform-vector-read!" from 500 to 20000.

2009-11-02  Ludovic Courtès  <ludo@gnu.org>

	Allocate vectors in a contiguous memory area.
	* libguile/vectors.c (scm_c_make_vector): Allocate the whole vector and
	  header with `scm_gc_malloc ()'.
	  (scm_vector_copy): Use `scm_c_make_vector ()'.
	  (scm_i_vector_free, MAKE_WEAK_VECTOR): Remove.
	  (allocate_weak_vector): Rename to...
	  (make_weak_vector): ... this.  Change to return the whole weak vector,
	  allocated with `scm_gc_malloc_pointerless ()'.
	  (scm_i_make_weak_vector, scm_i_make_weak_vector_from_list): Use
	  `make_weak_vector ()'.

	* libguile/vectors.h (SCM_I_VECTOR_HEADER_SIZE): New macro.
	  (SCM_I_VECTOR_ELTS): Write in terms of `SCM_I_VECTOR_WELTS ()'.
	  (SCM_I_VECTOR_WELTS): Update to the new representation.
	  (SCM_I_WVECT_EXTRA, SCM_I_SET_WVECT_EXTRA): Likewise.
	  (SCM_I_WVECT_GC_CHAIN, SCM_I_SET_WVECT_GC_CHAIN): Remove.

	* libguile/weaks.h (SCM_I_WVECT_DELTA, SCM_I_SET_WVECT_DELTA): Remove.

2009-11-01  Ludovic Courtès  <ludo@gnu.org>

	Restore signature of `scm_search_path ()' as found in 1.8.
	The incompatibly was introduced by
	22f4ee48822db5e30df3abf9a11b6066f2bab9d3 ("make primitive-load-path load
	compiled files if available").

	* doc/ref/api-options.texi (Build Config): Update `search-path'
	  documentation.

	* libguile/load.c (scm_search_path): Change C prototype to expect only 3
	  arguments.  Parse the rest argument accordingly.  Update callers.

	* libguile/load.h (scm_search_path): Update accordingly.

	Merge branch 'bdw-gc-static-alloc'
	Conflicts:
		acinclude.m4
		libguile/__scm.h
		libguile/bdw-gc.h
		libguile/eval.c

2009-10-30  Ken Raeburn  <raeburn@raeburn.org>

	Clean up some uses of old GC macros that don't exist any more.
	* libguile/deprecated.h (SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK):
	  Delete.
	* libguile/gc.c (scm_assert_cell_valid): Remove check of SCM_GC_MARK_P.

	Since support for "futures" in C has been completely disabled for some time, and should be easily implementable in Scheme with the current thread support, delete the C code.
	* libguile/futures.c, libguile/futures.h: Delete.
	* libguile/Makefile.am (libguile_la_SOURCES, DOT_X_FILES,
	  DOT_DOC_FILES, modinclude_HEADERS): Delete references to futures.*
	  files.

	* libguile.h: Don't include futures.h.
	* libguile/eval.c: Don't include futures.h.
	  (isymnames): Delete "#@future" entry.
	  (scm_m_future, s_future, scm_sym_future, unmemoize_future,
	  unmemoize_builtin_macro): Delete disabled futures code.
	* libguile/eval.i.c (CEVAL): Delete disabled futures code.
	* libguile/init.c: Don't include futures.h.
	  (scm_i_init_guile): Delete disabled futures initialization call.
	* libguile/tags.h (SCM_IM_FUTURE): Delete.
	  (SCM_IM_CALL_WITH_VALUES, SCM_IM_ELSE, SCM_IM_ARROW,
	  SCM_IM_NIL_COND, SCM_IM_BIND): Renumber.

	* doc/ref/api-scheduling.texi: Delete commented-out node on Futures.
	* doc/maint/guile.texi: Delete make-future and future-ref mentions.

	* meta/gdb-uninstalled-guile.in: Specify a path to libtool.

	Fix autogen.sh for Mac OS X.
	* autogen.sh: If uname indicates that the OS is Darwin, run "glibtool"
	  instead of "libtool" for the version number check.

2009-10-28  Michael Gran  <spk121@yahoo.com>

	Fix incorrect display of wide strings in decompilation
	A byte ordering error caused incorrect display of wide strings
	when using the ",c" decompilation from the REPL.

	* module/language/assembly/decompile-bytecode.scm (decode-bytecode):
	  wide strings are encoded in native endianness

	Modify bytevectors/string conversions to allow wide strings
	The bytevector to string conversion functions were accomplished
	by converting via locale strings.  This did not allow conversions
	of wide strings in an 8-bit locale.  This is avoided by using knowledge
	of the storage format of the string.

	* libguile/bytevectors.c (STRING_TO_UTF, scm_string_to_utf8): modify
	  string to bytevector conversion to use internal string information
	  (UTF_TO_STRING, scm_utf8_to_string): modify bytevector to string
	  conversion

2009-10-27  Mark H Weaver  <mhw@netris.org>

	fix nil handling in the vm
	* libguile/vm-i-scheme.c (not, not-not): Treat nil as false.
	  (null?, not-null?): Treat nil as null.

	* libguile/vm-i-system.c (br-if, br-if-not): Treat nil as false.
	  (br-if-null, br-if-not-null): Treat nil as null.

	the cube of lisp booleans (#f nil () #t)
	 * Renumbers the IFLAG constants.

	 * Adds several macros related to boolean type tests, null tests, and
	   boolean-truth testing (including lisp-style boolean-truth tests).

	 * Adds compile-time checks to verify the necessary IFLAG numbering
	   properties needed for the checks to work properly.

	 * Changes some existing code to use the new optimized macros, without
	   changing the semantics of the code at all (except that scm_is_bool
	   is changed from a function to a macro).

	I added the following macros, whose names explicitly state how %nil
	should be handled.  See the comments in the patch for more information
	about these.

	  scm_is_false_assume_not_lisp_nil  scm_is_true_assume_not_lisp_nil
	  scm_is_false_and_not_lisp_nil     scm_is_true_or_lisp_nil
	  scm_is_false_or_lisp_nil          scm_is_true_and_not_lisp_nil

	  scm_is_lisp_false                 scm_is_lisp_true

	  scm_is_null_assume_not_lisp_nil
	  scm_is_null_and_not_lisp_nil
	  scm_is_null_or_lisp_nil

	  scm_is_bool_and_not_lisp_nil
	  scm_is_bool_or_lisp_nil

	The following already-existing macros are defined as aliases, such
	that their semantics is unchanged (although scm_is_bool used to be a
	function and is now a macro).

	  scm_is_null   -->  scm_is_null_and_not_lisp_nil
	  scm_is_false  -->  scm_is_false_and_not_lisp_nil
	  scm_is_true   -->  scm_is_true_or_lisp_nil
	  scm_is_bool   -->  scm_is_bool_and_not_lisp_nil

	(I still believe that these should be changed to versions that handle
	 %nil properly, but await approval on that point, so these patches do
	 not make those changes)

	Also, if the preprocessor macro SCM_ENABLE_ELISP is not true (this
	macro already existed and was used in lang.h), all overheads
	associated with %nil handling are eliminated from the above macros.

	* libguile/tags.h (SCM_BOOL_F, SCM_BOOL_T, SCM_UNSPECIFIED)
	  (SCM_UNDEFINED, SCM_UNBOUND, SCM_ELISP_NIL): Renumber, so that a
	  number of important distinctions (false versus true, end-of-list, etc)
	  can be made by masking a single bit. Also define a number of
	  build-time tests to assert that this condition holds.

	* libguile/boolean.h (scm_is_false_and_not_nil, scm_is_true_or_nil)
	  (scm_is_false_assume_not_nil, scm_is_true_assume_not_nil):
	  (scm_is_false_or_nil, scm_is_true_and_not_nil)
	  (scm_is_bool_or_nil, scm_is_bool_and_not_nil): New exciting macros to
	  test certain boolean/end-of-list properties.
	  (scm_is_false, scm_is_true): Use a restrictive definition, where only
	  SCM_BOOL_F is false. Should probably change in the future.
	  (scm_is_bool): Incompatible change: changed to be a macro. Was a
	  function before. Probably should allow nil as a boolean, but that will
	  be for a later patch.
	  (scm_is_lisp_false, scm_is_lisp_true): New macros, implementing the
	  standard Lisp boolean predicates, where '() is actually false.

	* libguile/eval.i.c (CEVAL): Fix a number of false-or-nil and similar
	  tests to use the new macros.

	* libguile/lang.h (SCM_NULL_OR_NIL_P): Use scm_is_null_or_nil.

	* libguile/pairs.c: Add a compile-time check that null and nil differ by
	  only one bit.

	* libguile/pairs.h (scm_is_null_and_not_nil, scm_is_null_assume_not_nil)
	  (scm_is_null_or_nil): New exciting macros!
	  (scm_is_null): Just be scm_is_null_and_not_nil, for now.

	* libguile/print.c: Adapt to the reordering, and print suitably nasty
	  things for the not-to-be-used values.

2009-10-27  Ludovic Courtès  <ludo@gnu.org>

	Use proper fold/for-each function types in `hashtab.h'.
	* libguile/hashtab.h (scm_t_hash_fold_fn, scm_t_hash_handle_fn): New
	  types.
	  (scm_internal_hash_fold, scm_internal_hash_for_each_handle): Use them.

	* libguile/hashtab.c (scm_internal_hash_fold): Take an
	  `scm_t_hash_fold_fn'.  Update callers.
	  (scm_internal_hash_for_each_handle): Take an `scm_t_hash_handle_fn'.
	  Update callers.

	Use proper assoc/hash function types in `hashtab.c'.
	This is a followup to d587c9e8b27219e68f8813fb648fc6913c93be0f ("Use
	proper types for hash/assoc functions in `hashtab.h'.").

	* libguile/hashtab.c (scm_i_rehash, scm_hash_fn_create_handle_x,
	  scm_hash_fn_ref, scm_hash_fn_set_x, scm_hash_fn_remove_x): Use
	  `scm_t_hash_fn' and `scm_t_assoc_fn' as appropriate.

2009-10-27  Andy Wingo  <wingo@pobox.com>

	update procedure docs for programs, lambda*, case-lambda
	* module/system/vm/program.scm: Export the arity things again, and
	  program-arity. Why not.

	* doc/ref/api-procedures.texi (Compiled Procedures): Update for current
	  API.
	  (Optional Arguments): Update to assume lambda* and define* are always
	  available, and (ice-9 optargs) is now the ghetto.
	  (Case-lambda): Now here, moved from SRFI-16 docs. Also docs
	  case-lambda*.

	* doc/ref/srfi-modules.texi: Point to core case-lambda docs.

2009-10-26  Andy Wingo  <wingo@pobox.com>

	implement #:predicate
	will be useful for making e.g. typecase-lambda. Tough to tell though.

	* module/ice-9/psyntax.scm (lambda-formals, lambda*-formals): Parse out
	  a #:predicate, which goes right before the rest args. The vanilla
	  lambda doesn't parse it out of course, but it does return another
	  value.
	  (chi-lambda-case, lambda*, lambda): Expand and pass the predicate on
	  to build-lambda-case.

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

	* module/language/tree-il/compile-glil.scm (flatten): Compile a failing
	  predicate without an else clause into a call to `error'. Also, fix
	  something the compile warnings caught.

2009-10-26  Ludovic Courtès  <ludo@gnu.org>

	Don't use memset(3) after `GC_MALLOC ()' calls.
	* libguile/gc-malloc.c (scm_gc_calloc): Don't use memset(3) as it's not
	  needed.  Reported by Andy Wingo.

2009-10-25  Julian Graham  <julian.graham@aya.yale.edu>

	Resolve warning in gcc-4.3 about transposed parameters passed to memset
	* libguile/gc-malloc.c (scm_gc_calloc): Add explicit check on size parameter

2009-10-25  Ludovic Courtès  <ludo@gnu.org>

	SRFI-35: Provide nice vtable names, to make GOOPS happier.
	* module/srfi/srfi-35.scm (%make-condition-type): New procedure.
	  (make-condition-type, make-compound-condition-type): Use it.

	* test-suite/tests/srfi-35.test ("condition
	  types")["struct-vtable-name"]: New test.

	Fix GOOPS `class-of' for nameless structs.
	* libguile/goops.c (scm_class_of): Fix second argument for
	  `scm_make_extended_class_from_symbol ()' for nameless structs.

	* test-suite/tests/goops.test ("classes for built-in types")["struct
	  vtable"]: New test case.

2009-10-25  Andy Wingo  <wingo@pobox.com>

	srfi-16 just re-exports psyntax's case-lambda
	* module/srfi/srfi-16.scm (case-lambda): Just re-export the core's
	  case-lambda, it's semantically the same but faster and better
	  integrated.

	case-lambda, case-lambda* in psyntax
	* module/ice-9/psyntax.scm (case-lambda, case-lambda*): Add
	  implementations of these, present in the base environment.

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

	* module/srfi/srfi-16.scm (case-lambda): Replace the core's case-lambda
	  definition with our own. We're not quite ready to switch yet.

	assembly/disassembly support for br-if-nargs-*
	* module/language/assembly/compile-bytecode.scm (write-bytecode): Handle
	  br-if-nargs compilation.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  And decompile them nicely as well.

	* module/language/assembly/disassemble.scm (code-annotation): And,
	  present the disassembly if br-if-nargs-* nicely.

	arities can have noncontiguous starts and ends
	* module/language/glil/compile-assembly.scm (open-arity, close-arity)
	  (begin-arity, glil->assembly): Refactor so that arities can have
	  noncontiguous starts and ends. So within a prelude there is no arity
	  -- only before (the previous arity) or after (the new arity).

	* module/system/vm/program.scm (arity:end): Add this private accessor.
	  Arities are expected to be in the new format. While not a change in
	  objcode format, it is an incompatible change, so I'll bump the objcode
	  cookie.
	  (program-arity): Check that the ip is within both bounds of the arity.

	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

	* libguile/programs.c (scm_i_program_arity): Update for new arity format.

	* module/system/vm/frame.scm (vm-frame-arguments): Avoid throwing an
	  error in this function, which is called from the backtrace code.

	refactor psyntax.scm's treatment of lambda and lambda*
	* module/ice-9/psyntax.scm (lambda-formals, chi-simple-lambda)
	  (lambda*-formals, chi-lambda-case): Refactor the lambda
	  transformations with an eye to being able to do case-lambda.

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

	* test-suite/tests/syntax.test: Adapted tests so that the errors we
	  expect match what is given by psyntax.

2009-10-24  Andy Wingo  <wingo@pobox.com>

	define* in psyntax
	* module/ice-9/optargs.scm:
	* module/ice-9/psyntax-pp.scm:
	* module/ice-9/psyntax.scm: Make define* available in the default
	  environment, as lambda* is available there.

	procedure property table is only key-weak, not doubly-weak
	* libguile/procprop.c: Make the procedure property table only key-weak.
	  It seems that we want the association as long as the key is around.

2009-10-23  Ken Raeburn  <raeburn@raeburn.org>

	Reduce some errors under -DSCM_DEBUG=1.
	* goops.c (scm_sys_modify_instance, scm_sys_modify_class): Use
	SCM_{,SET_}CELL_WORD_[01] instead of SCM_{,SET}C[AD]R since the
	objects passed are not pairs.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	(ice-9 optargs) based on the new lambda* work
	* module/ice-9/optargs.scm (let-optional, let-optional*, let-keywords)
	  (let-keywords*): Implement in terms of parse-lambda-case, so all the
	  logic is in one place.
	  (lambda*): Re-export from the default environment -- it's all in the
	  VM now :-))
	  (define*, define*-public, defmacro*, defmacro*-public): Implement with
	  syntax-case.

	lambda* in psyntax
	* module/ice-9/psyntax.scm (build-lambda-case): Take an "inits" arg.
	  Also work around a nasty memoizer bug: see
	  http://article.gmane.org/gmane.lisp.guile.devel/9561.
	  (lambda*): Implement in psyntax, in the default environment. Exciting
	  stuff!

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

	* module/ice-9/optargs.scm (parse-lambda-case): Helper for lambda* when
	  we're running under the interpreter.

	separate "inits" field in <lambda-case>; compile fixes for inits, kwargs
	* module/language/tree-il.scm (<lambda-case>): Add "inits" field, so we
	  don't have to parse it out of opt and kw. Adapt the traversal
	  procedures.
	* module/language/tree-il/analyze.scm (analyze-lexicals): Analyze
	  lexicals in the <lambda-case> init expressions as well. Fix keyword
	  allocation.

	* module/language/tree-il/compile-glil.scm (compile-glil): Adapt to
	  make-lambda-case change.
	  (flatten): Adapt to "inits" slot, actually init uninitialized args,
	  and fix bugs related to keyword arguments.

	* module/language/tree-il/inline.scm (inline!): Adapt a little bit --
	  but with no effect.

	* module/language/glil/compile-assembly.scm (glil->assembly): Flesh out
	  <glil-kw-prelude> compilation some more. Add a "bound?" op for
	  <glil-lexical>, which will push #t if the local is bound.

	* module/ice-9/psyntax.scm (build-simple-lambda, build-lambda-case):
	  Update for new signature of make-lambda-case.
	* module/ice-9/psyntax-pp.scm: Regenerated.

	* module/language/brainfuck/compile-tree-il.scm (compile-body):
	* module/language/ecmascript/compile-tree-il.scm (comp):
	* test-suite/tests/tree-il.test ("lambda"): Update for new lambda-case
	  syntax.

	add some optargs tests
	* libguile/modules.c (scm_module_lookup, scm_lookup): Throw to
	  'unbound-variable, like eval.i.c does.

	* test-suite/tests/optargs.test: Add an optargs test. Run optargs tests
	  under both the VM and the interpreter.

	vm support for optional/kwarg init code, and bugfixes
	* libguile/vm-i-system.c (local-bound?, long-local-bound?)
	  (variable-bound?): New instructions, push #f unless the local is
	  bound. You can get unbound locals from optional arguments.
	  (bind-optionals/shuffle): A number of bugfixes.
	  (bind-kwargs): Bugfixes. If we enocunter an improper kwarg list but
	  the procedure has a rest argument, just stop kwarg processing, but
	  without an error.
	  Renumbered ops.

	* libguile/_scm.h (SCM_OBJCODE_MAJOR_VERSION): Bump.

	more work towards compiling and interpreting keyword args
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bumparoo
	* libguile/vm-i-system.c (push-rest, bind-rest): Logically there are
	  actually two rest binders -- one that pops, conses, and pushes, and
	  one that pops, conses, and local-sets. The latter is used on keyword
	  arguments, because the keyword arguments themselves have been shuffled
	  up on the stack. Renumber ops again.

	* module/language/tree-il/compile-glil.scm (flatten): Attempt to handle
	  compilation of lambda-case with keyword arguments. Might need some
	  help.

	* module/ice-9/psyntax.scm (build-lambda-case): An attempt to handle the
	  interpreted case correctly. This might need a couple iterations, but
	  at least it looks like the compile-glil code.

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

	* module/language/glil.scm (<glil>): Rename "rest?" to "rest" in
	  <glil-opt-prelude> and <glil-kw-prelude>, as it is no longer a simple
	  boolean, but if true is an integer: the index of the local variable to
	  which the rest should be bound.

	* module/language/glil/compile-assembly.scm (glil->assembly): Adapt to
	  "rest" vs "rest?". In the keyword case, use "bind-rest" instead of
	  "push-rest".

	* test-suite/tests/tree-il.test: Update for opt-prelude change.

	finish support for optional & keyword args; update ecmascript compiler
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
	* libguile/vm-i-system.c (br-if-nargs-ne, br-if-args-lt)
	  (br-if-nargs-gt): New instructions, for use by different lambda cases.
	  (bind-optionals, bind-optionals/shuffle, bind-kwargs): New
	  instructions, for binding optional and keyword arguments. Renumber
	  other ops.

	* module/language/ecmascript/compile-tree-il.scm (comp, comp-body):
	  Update for new tree-il. Use the new optional argument mechanism
	  instead of emulating it with rest arguments.

	* module/language/glil/compile-assembly.scm (glil->assembly): Tweaks for
	  optional and keyword argument compilation.

	* module/language/tree-il.scm (parse-tree-il, unparse-tree-il): Make the
	  else case optional, in the s-expression serialization of tree-il.

	* module/language/tree-il/compile-glil.scm (flatten): Handle all of the
	  lambda-case capabilities.

	fix brainfuck for new tree-il, and add tests
	* test-suite/Makefile.am:
	* test-suite/tests/brainfuck.test: Add a brainfuck test.

	* module/system/base/compile.scm: Also export read-and-compile.

	* module/language/tree-il/spec.scm (join): Fix the joiner in the
	  0-expression case.

	* module/language/tree-il/primitives.scm (+): Recognize (+ x -1) as 1-.

	* module/language/brainfuck/parse.scm (read-brainfuck): Return EOF if we
	  actually received EOF, and there were no expressions read.

	* module/language/brainfuck/compile-tree-il.scm (compile-body): Fix the
	  compiler for the new format of "lambda" in tree-il.

	tree-il support for case-lambda
	* module/language/tree-il.scm (<lambda>, <lambda-case>): Split lambda
	  into the lambda itself, denoting the procedure, and lambda-case,
	  denoting a particular arity case. Lambda-case is fairly featureful,
	  and has not yet been fully tested.
	  (<let-values>): Use a <lambda-case> as the binding expression. Seems
	  to suit the purpose well.
	  Adapt parsers, unparsers, traversal operators, etc. Sometimes in this
	  first version we assume there are no optional args, rest args, or a
	  predicate.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Adapt for the
	  new case-lambda regime. Fairly well commented. It actually simplifies
	  things.
	  (report-unused-variables): Update for new tree-il.

	* module/language/tree-il/compile-glil.scm: Adapt for the new tree-il.
	  There are some first stabs here at proper case-lambda compilation, but
	  they are untested as of yet.

	* module/language/tree-il/inline.scm (inline!): Rework so we can
	  recurse on a single node; though these transformations are strictly
	  reductive, so they should complete in bounded time. Simplify
	  accordingly, and adapt to case-lambda. Oh, and we handle lambda->let
	  in not just the nullary case.

	* module/ice-9/psyntax.scm (build-simple-lambda, build-case-lambda)
	  (build-lambda-case): New constructors. The idea is that after syntax
	  expansion, we shouldn't have to deal with improper lists any more.
	  Build-simple-lambda is a shortcut for the common case. The others are
	  not fully exercised yet. Adapt callers.
	  (syntax): Add some debugging in the lambda case. I don't fully
	  understand this, but in practice we don't seem to see rest args here.
	  (lambda): Inline chi-lambda-clause, and adapt for build-simple-lambda.
	* module/ice-9/psyntax-pp.scm: Regenerated.

	* test-suite/tests/tree-il.test: Update tests for new tree-il lambda
	  format, and to expect post-prelude labels for all glil programs.

	procedure property efficiency tweak
	* libguile/procprop.c (scm_procedure_property)
	  scm_set_procedure_property_x): Fix to not call
	  scm_procedure_properties(), and thus to avoid consing up the arity as
	  well.

	flesh out glil support for optional and keyword arguments
	* libguile/vm-i-system.c (bind-rest): Renamed from push-rest-list.
	  (reserve-locals): Change so that instead of reserving space for some
	  additional number of locals, reserve-locals takes the absolute number
	  of locals, including the arguments.

	* module/language/glil.scm (<glil-std-prelude>, <glil-opt-prelude>)
	  (<glil-kw-prelude>): New GLIL constructs, to replace <glil-arity>.

	* module/language/glil/compile-assembly.scm (glil->assembly): Compile
	  the new preludes. Some instructions are not yet implemented, though.

	* module/language/tree-il/analyze.scm (analyze-lexicals): The nlocs for
	  a lambda will now be the total number of locals, including arguments.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Update to
	  write the new prelude.

	* module/system/vm/program.scm (program-bindings-for-ip): If a given
	  index doesn't have a binding at the ip given, don't cons it on the
	  resulting list.

	* test-suite/tests/tree-il.test: Update for GLIL changes.

	de-nargs struct scm_objcode; procedure-property refactor
	* libguile/objcodes.h (struct scm_objcode): Remove nargs, nrest, and
	  nlocs, as they are no longer needed. Also obviates the need for a
	  padding word.

	* libguile/procs.c (scm_thunk_p): Use scm_i_program_arity for programs.

	* libguile/procprop.c (scm_i_procedure_arity): Use scm_i_program_arity
	  for programs.
	  (scm_procedure_properties, scm_set_procedure_properties_x)
	  (scm_procedure_property, scm_set_procedure_property_x): Rework so that
	  non-closure properties are stored directly in a weak hash, instead of
	  needing a weak hash of "stand-in" closures to hold the properties. Fix
	  docstrings also.

	* libguile/root.h (scm_stand_in_procs): Remove from the scm_sys_protects
	  set. Actually with libGC, we should be able to store the elements of
	  scm_sys_protects directly as global variables.
	* libguile/gc.c (scm_init_storage): Remove scm_stand_in_procs
	  initialization.

	* libguile/programs.c (scm_i_program_arity): New private accessor, tries
	  to determine the "minimum arity" of a program.

	* libguile/vm.c (really_make_boot_program): Adapt to changes in
	  struct scm_objcode.

	* module/language/assembly.scm (*program-header-len*, byte-length):
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  Adapt to changes in objcode.

	* module/system/xref.scm (program-callee-rev-vars): Adapt to changes in
	  assembly.

	* module/language/glil.scm: Remove nargs, nrest, and nlocs from
	  glil-program.

	* module/language/glil/compile-assembly.scm (make-meta, glil->assembly):
	* module/language/glil/decompile-assembly.scm (decompile-toplevel):
	  (decompile-load-program): Adapt to changes in GLIL and assembly.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Adapt to
	  changes in GLIL.

	* test-suite/tests/asm-to-bytecode.test: Adapt to assembly and bytecode
	  changes.
	* test-suite/tests/tree-il.test: Adapt to GLIL changes.

	callees now check their args, cons rest list, reserve locals
	* gdbinit: Ignore SIGPWR and SIGXCPU, which the BDW GC seems to use.

	* libguile/vm-engine.h (FETCH_WIDTH): Remove unused macro.
	  (INIT_ARGS, INIT_FRAME): Remove; callees now check their args and
	  reserve space for their locals.

	* libguile/vm-engine.c:
	* libguile/vm-i-system.c: Turn on callee arg checking and local
	  reservation. Seems to work!

	callees reserve their own local vars
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
	* libguile/vm-i-system.c (reserve-locals): New instruction, to reserve
	  space for local vars. Other ops renumbered.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Emit
	  reserve-locals instructions as necessary.

	* test-suite/tests/tree-il.test: Update to expect reserve-locals as
	  appropriate.

	runtime and debugging support for callee-parsed procedure args
	* libguile/objcodes.h: Bump for metadata format change.

	* libguile/frames.h: Rework so we don't frob the program's nargs, nlocs,
	  etc at runtime. Instead we don't really know what's a local var, an
	  argument, or an intermediate value. It's a little unfortunate, but
	  this will allow for case-lambda, and eventually for good polymorphic
	  generic dispatch; and the nlocs etc can be heuristically
	  reconstructed. Such a reconstruction would be better done at the
	  Scheme level, though.
	  (SCM_FRAME_STACK_ADDRESS): New macro, the pointer to the base of the
	  stack elements (not counting the program).
	  (SCM_FRAME_UPPER_ADDRESS): Repurpose to be the address of the last
	  element in the bookkeeping part of the stack -- i.e. to point to the
	  return address.

	* libguile/vm-engine.h:
	* libguile/vm-i-system.c: Adapt to removal of stack_base. Though we
	  still detect stack-smashing underflow, we don't do so as precisely as
	  we did before, because now we only detect overwriting of the frame
	  metadata.

	* libguile/vm-engine.c (vm_engine): Remove the stack_base variable. It
	  is unnecessary, and difficult to keep track of in the face of
	  case-lambda. Also fix miscommented "ra" and "mvra" pushes. Push the
	  vp->ip as the first ra...
	* libguile/vm-i-system.c (halt): ...because here we can restore the
	  vp->ip instead of setting ip to 0. Allows us to introspect ips all
	  down the stack, including in recursive VM invocations.

	* libguile/frames.h:
	* libguile/frames.c (scm_vm_frame_stack): Removed, because it's getting
	  more difficult to tell what's an argument and what's a temporary stack
	  element.
	  (scm_vm_frame_num_locals): New accessor.
	  (scm_vm_frame_instruction_pointer): New accessor.
	  (scm_vm_frame_arguments): Defer to an implementation in Scheme.
	  (scm_vm_frame_num_locals scm_vm_frame_local_ref)
	  (scm_vm_frame_local_set_x): Since we can get not-yet-active frames on
	  the stack now, with our current calling convention, we have to add a
	  heuristic here to jump over those frames -- because frames have
	  pointers in them, not Scheme values.

	* libguile/programs.h:
	* libguile/programs.c (scm_program_arity): Remove, in favor of..
	  (scm_program_arities): ...this, which a list of arities, in a new
	  format, occupying a slot in the metadata.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Fix mv-call decompilation.

	* module/system/vm/frame.scm (vm-frame-bindings, vm-frame-binding-ref)
	  (vm-frame-binding-set!): New functions, to access bindings by name in
	  a frame.
	  (vm-frame-arguments): Function now implemented in Scheme. Commented
	  fairly extensively.

	* module/system/vm/program.scm (program-bindings-by-index)
	  (program-bindings-for-ip): New accessors, parsing the program bindings
	  metadata into something more useful.
	  (program-arities, program-arguments): In a case-lambda world, we have
	  to assume that programs can have multiple arities. But it's tough to
	  detect this algorithmically; instead we're going to require that the
	  program metadata include information about the arities, and the parts
	  of the program that that metadata applies to.
	  (program-lambda-list): New accessor.
	  (write-program): Show multiple arities.

	* module/language/glil/compile-assembly.scm (glil->assembly): Add
	  "arities" to the state of the compiler, and add arities entries as
	  appropriate.

	steps on the way to have the callee check the number of arguments
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

	* libguile/vm-i-system.c (assert-nargs-ee, assert-nargs-ge)
	  (push-rest-list): New instructions, which for now don't actually do
	  anything. Renumber the rest of the ops in this file.

	* module/language/glil.scm (<glil-arity>): New GLIL type, an entity that
	  checks the number of args for a block, optionally consing a rest list,
	  and either branching or erroring if the arity doesn't match.

	* module/language/glil/compile-assembly.scm (glil->assembly): Compile
	  <glil-arity> to assembly. Some of these VM ops are not implemented --
	  notably the branching case.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Emit
	  <glil-arity>.

	* test-suite/tests/tree-il.test: Update.

2009-10-22  Ludovic Courtès  <ludo@gnu.org>

	Compile Guile modules with `-Wunbound-variable'.
	* am/guilec (.scm.go): Compile with `-Wunbound-variable'.

	Fix typos leading to unbound variable references.
	* module/ice-9/session.scm (help): Fix unbound reference to `env'.

	* module/system/vm/program.scm (program-property): Fix typo.

	* module/system/vm/frame.scm: Add missing `#:use-module (system vm
	  objcode)'.

	* module/system/repl/command.scm (guile:load): New.
	  (load): Use either `primitive-load' or `load'.

	* module/srfi/srfi-18.scm (thread-sleep!): Fix typo.

	* module/srfi/srfi-19.scm: Use `(ice-9 rdelim)'.
	  (date->broken-down-time, priv:year-day, priv:char->int): Fix typo.
	  (time-*->time-*, time-*->time-*!): Fix reference to unbound variable
	  `caller'.

	* module/oop/goops.scm (bound-check-get): Fix typo.

	* module/language/glil/compile-assembly.scm (glil->assembly): Fix typo.

	* module/language/glil.scm (parse-glil): Fix typo.

	* module/language/ecmascript/base.scm (object->value/string,
	  object->value/number, ->number): Fix typos.

	* module/language/assembly/disassemble.scm (disassemble-free-vars): Fix
	  typo.

	Adjust `unbound-variable' GOOPS heuristic for `goops.scm'.
	* module/language/tree-il/analyze.scm (goops-toplevel-definition): Add
	  ENV argument.  Deal with GOOPS macros expanded within `goops.scm'.
	  (report-possibly-unbound-variables): Adjust.

	Fix bytecode disassembler.
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Add missing argument to `ensure-label'.

	SRFI-88: Call `read-set!' at compile time and run time.
	* module/srfi/srfi-88.scm: Call `read-set!' both at compile time and run
	  time.

	Remove obsolete `save-stack' case.
	* module/ice-9/boot-9.scm (save-stack): Remove obsolete `tk-stack' case.

	Have `-Wunbound-variable' account for GOOPS top-level definitions.
	* module/language/tree-il/analyze.scm (goops-toplevel-definition): New
	  procedure.
	  (report-possibly-unbound-variables): Check for GOOPS top-level
	  definitions.

	* test-suite/tests/tree-il.test ("warnings")["GOOPS definitions are
	  visible"]: New test.

2009-10-21  Ludovic Courtès  <ludo@gnu.org>

	Add a `guile-2' SRFI-0 feature.
	* doc/ref/srfi-modules.texi (SRFI-0): Mention the `guile-2' feature.

	* module/ice-9/boot-9.scm (%cond-expand-features): Add `guile-2'.

2009-10-20  Ludovic Courtès  <ludo@gnu.org>

	Use proper types for hash/assoc functions in `hashtab.h'.
	Partly fixes bug #23681 ("Function declarators with empty parentheses
	should not be used").

	* libguile/goops.c (scm_wrap_component): Cast `scm_sloppy_assq'.

	* libguile/hashtab.c (scm_hash_fn_get_handle): Update to take functions
	  of type `scm_t_hash_fn' and `scm_t_assoc_fn'.  Update callers.
	  (scm_ihashx): Change to match `scm_t_hash_fn'.
	  (scm_sloppy_assx): Change to match `scm_t_assoc_fn'.

	* libguile/hashtab.h (scm_t_hash_fn, scm_t_assoc_fn): New types.
	  (scm_t_hashtable)[hash_fn]: Change to `scm_t_hash_fn'.
	  (scm_i_rehash, scm_hash_fn_get_handle, scm_hash_fn_create_handle_x,
	  scm_hash_fn_ref, scm_hash_fn_set_x, scm_hash_fn_remove_x): Change to
	  take `scm_t_hash_fn' and `scm_t_assoc_fn' parameters.

	* libguile/srcprop.h (scm_whash_get_handle, scm_whash_create_handle,
	  scm_whash_lookup): Implement in terms of `scm_hashq_*' instead of
	  `scm_hash_fn_*'.

	* libguile/struct.c (scm_struct_ihashq): Change to match
	  `scm_t_hash_fn'.
	  (scm_struct_create_handle): Cast `scm_sloppy_assq'.

	* libguile/struct.h (scm_struct_ihashq): Update, make internal.

2009-10-19  Julian Graham  <julian.graham@aya.yale.edu>

	Fix typo in psyntax.scm related to syntax-violation reporting.
	* module/ice-9/psyntax.scm (chi-macro): Replace `s' with `(wrap-subst w)'.

2009-10-19  Ludovic Courtès  <ludo@gnu.org>

	Add support for R6RS/SRFI-30 nested block comments.
	Suggested by Andreas Rottmann <a.rottmann@gmx.at>.

	* libguile/read.c (flush_ws, scm_read_sharp): Add support for
	  R6RS/SRFI-30 block comments.
	  (scm_read_r6rs_block_comment): New function.

	* test-suite/tests/reader.test (exception:unterminated-block-comment):
	  Adjust to match both block comment styles.
	  ("reading")["R6RS/SRFI-30 block comment", "R6RS/SRFI-30 nested block
	  comment", "R6RS/SRFI-30 block comment syntax overridden"]: New tests.
	  ("exceptions")["R6RS/SRFI-30 unterminated nested block comment"]: New
	  test.

	* doc/ref/api-evaluation.texi (Block Comments): Mention SRFI-30/R6RS
	  block comments.

	* doc/ref/srfi-modules.texi (SRFI-30): New node.

2009-10-16  Andy Wingo  <wingo@pobox.com>

	comment fixups to tree-il/compile-glil.scm
	* module/language/tree-il/compile-glil.scm: Remove some outdated
	  comments.

	jumps encoded using 24 bits, not 19; blocks no longer aligned
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
	* libguile/vm-i-system.c (FETCH_OFFSET, BR): Labels are no longer 8-byte
	  aligned; instead, jumps are encoded into 3 bytes instead of 2.
	  (br, br-if, br-if-not, br-if-eq, br-if-not-eq, br-if-null)
	  (br-if-not-null, mv-call): Adapt for new length of br instructions (3
	  bytes instead of 2).

	* libguile/vm.c (really_make_boot_program): Adapt hand-coded bytecode
	  for new offset regime.

	* module/language/assembly.scm (align-block): No alignment necessary.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
	  out breaks as 24-bit relative jumps.
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Decompile break instructions.

	compilation enviroments are always modules; simplifications & refactorings
	* module/ice-9/boot-9.scm (make-fresh-user-module): New public function,
	  makes an anonymous beautified module.

	* module/language/objcode/spec.scm: We used to have some things in here
	  that allowed lexical variable names and values to be a part of the
	  environment, but no more. Now an environment is just a module. If you
	  want to "inject" free variables into code, just use lambda.

	* module/language/scheme/compile-tree-il.scm (compile-tree-il): Same
	  here. Also, rely on the fact that an environment *will* be a module --
	  because (system base compile) guarantees that for us.

	* module/language/scheme/spec.scm (scheme): In the reader, rely on the
	  environment being a module. Define a #:make-default-environment
	  handler, which returns a beautified module, augmented with a fresh
	  definition for current-reader, so that side effects to current-reader
	  are restricted to the compilation unit.

	* module/language/tree-il/analyze.scm
	  (report-possibly-unbound-variables):
	* module/language/tree-il/compile-glil.scm (compile-glil):
	* module/language/tree-il/optimize.scm (optimize!): The environment will
	  be a module.

	* module/system/base/language.scm (<language>): New field,
	  `make-default-environment'. Defaults to `make-fresh-user-module'.
	  (default-environment): New accessor, returns a default environment for
	  a language.

	* module/system/repl/common.scm (repl-compile): Always compile relative
	  to the current module, because a module is always acceptable as an
	  environment.

	* module/system/base/compile.scm (compile-file, compile-and-load): Both
	  of these have a new keyword argument, #:env. For `compile-file', it
	  defaults to the default environment of the source language, and for
	  `compile-and-load', to the current module.
	  (read-and-compile): If there are no expressions read, pass the joiner
	  its default environment (via `default-environment joint').

	no more *compilation-environment* fluid
	* module/system/base/compile.scm (current-compilation-environment):
	  Remove, as the only thing that needed it (language readers) now get
	  the environment as an argument.
	  (read-and-compile, compile): Rework for no *compilation-environment*,
	  and default the environment using the define* mechanism.

	* module/language/tree-il/analyze.scm (env-module): Hack around the lack
	  of a current compilation module. Will fix this in the next commit so
	  that the environment is always valid.

	language-readers receive environment as an arg
	* module/language/assembly/spec.scm:
	* module/language/brainfuck/spec.scm:
	* module/language/bytecode/spec.scm:
	* module/language/ecmascript/spec.scm:
	* module/language/glil/spec.scm:
	* module/language/scheme/spec.scm:
	* module/language/tree-il/spec.scm: Language-readers now take two
	  arguments: the port and the environment. This should allow for
	  compile-environment-specific reader behavior.

	* module/system/base/compile.scm (read-and-compile):
	* module/system/repl/common.scm (repl-read): Pass the environment to the
	  language-reader.

	* module/system/repl/repl.scm (meta-reader, prompting-meta-read):
	* module/system/repl/command.scm (define-meta-command): Use the second
	  argument to repl-reader, so we avoid frobbing current-reader.

	repl-reader accepts optional "read" argument
	* module/ice-9/boot-9.scm (repl-reader): Accept an optional second
	  argument, the reader to use. If it is given, use it instead of
	  dereferencing the current-reader fluid.

	* guile-readline/ice-9/readline.scm (activate-readline): Make our
	  replacement definition of repl-reader compatible with boot-9.

	remove GHIL, Elisp, and R5RS languages
	GHIL is obsolete, and it's about time we got rid of it. Elisp and R5RS
	were unmodified since their import from Guile-VM, so we ditch them too.

	R5RS compilation is supported via compiling Scheme within an R5RS
	environment.

	Elisp will be supported when we merge in Daniel's work.

	bitvector tweaks
	* libguile/arrays.c (scm_from_contiguous_typed_array):
	* libguile/bytevectors.c (scm_uniform_array_to_bytevector): Error if the
	  uniform element size is more than 8 bits, but not divisible by 8 --
	  because our math could overflow in that case.

	* module/ice-9/deprecated.scm (#\y): Indeed, #* is the valid bitvector
	  syntax :)

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Improve TLS detection for systems with compiler support but no libc support.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Use `AC_LINK_IFELSE'
	  instead of `AC_COMPILE_IFELSE'.

	Bump version number for 1.9.4.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

	Fix compilation of literal bitvectors.
	* libguile/arrays.c (scm_from_contiguous_typed_array): Fix BYTE_LEN
	  sanity check for bitvectors.

	* test-suite/tests/unif.test ("syntax")["bitvector is self-evaluating"]:
	  New test.

	* module/ice-9/deprecated.scm (#\y): Fix deprecation comment: `#*' is
	  not a read syntax.

	Fix segfault for `(uniform-array->bytevector (bitvector))'.
	* libguile/bytevectors.c (scm_uniform_array_to_bytevector): Fix BYTE_LEN
	  computation for bitvectors.

	* test-suite/tests/bytevectors.test ("uniform-array->bytevector"): New
	  test prefix.

	Fix `gitlog-to-changelog' on NixOS.

	Document the interaction of the "compilee" with the compiler's current module.
	This is a followup to 87c595c757b7db84ffdcfda96f736ab235e674a8 ("Compile
	in a fresh module by default.") and
	f65e2b1ec5ae1962e57322ac3085ab4d44025694 ("Honor and confine
	expansion-time side-effects to `current-reader'.").

	* doc/ref/api-evaluation.texi (Loading): Explain how to change
	  `current-reader' in a compiler-friendly way.

	* doc/ref/compiler.texi (The Scheme Compiler): Explain use of a fresh
	  compilation module and separate `current-reader' fluid.

	* test-suite/tests/compiler.test ("current-reader")["with eval-when"]:
	  New test.

	Fix REPL environment for languages other than scheme.
	* module/system/repl/common.scm (repl-compile): Use `#:env #f' for
	  languages other than scheme.

2009-10-15  Andy Wingo  <wingo@pobox.com>

	signedness fix fix fix
	* libguile/inline.h: Fix signedness fix fix.

	`load' autocompiles -- in the current module.
	* module/ice-9/boot-9.scm (load): Pull `autocompiled-file-name' inside
	  `load', and make it autocompile in the current module. Should fix
	  Julian's issue noted in
	  http://article.gmane.org/gmane.lisp.guile.devel/9483.

	update NEWS for 1.9.4

	fix scm_array_handle_ref signedness fix
	* libguile/inline.h: Fix signedness fix.

	add back support for #y bitvector read syntax
	* module/ice-9/deprecated.scm (#\y): Add deprecated support for
	  #y(1 0 1 ...) bitvectors.

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Use pointer-less memory for `scm_gc_strdup ()'.
	* libguile/gc-malloc.c (scm_gc_strndup): Use `GC_MALLOC_ATOMIC ()'
	  instead of `GC_MALLOC ()'.

	Restore signature of `scm_primitive_load_path ()' as found in 1.8.
	The incompatibility was introduced by
	0fb81f95b0222c5ba49efd3e36cf797df54c0863 ("add exception_on_error
	optional arg to primitive-load-path").

	* libguile/load.c (scm_primitive_load_path): Change to take 1 rest
	  argument.  Interpret the argument as either a file name (C-level
	  backward compatibility with 1.8) or an actual argument list.
	  (scm_c_primitive_load_path): Update caller.

	* libguile/load.h (scm_primitive_load_path): Update accordingly.

	* doc/ref/api-evaluation.texi (Loading): Update documentation of
	  `primitive-load-path' and `scm_primitive_load_path ()'.

	Use GC-managed memory for port->encoding.
	* libguile/ports.c (scm_new_port_table_entry): Use `scm_gc_strdup ()'
	  instead of `strdup ()' for `entry->encoding'.
	  (scm_i_set_port_encoding_x): Likewise.  Remove free(3) call.
	  (scm_i_remove_port): Don't explicitly free memory.
	  (scm_unget_byte): Remove outdated and misleading comment.

2009-10-14  Ludovic Courtès  <ludo@gnu.org>

	Fix signed/unsigned mismatch in `scm_array_handle_{ref,set} ()'.
	* libguile/inline.h (scm_array_handle_ref, scm_array_handle_set): Cast
	  `h->base' so that it matches the signedness of `p'.

2009-10-13  Ken Raeburn  <raeburn@raeburn.org>

	Flush output before forking, to make test output consistent and avoid duplication.
	* test-suite/tests/socket.test: Before calling primitive-fork, call
	  force-output on the current output and error ports.

2009-10-13  Andy Wingo  <wingo@pobox.com>

	add $libir to the ltdl path, not $pkglibdir; add extensionsdir
	* libguile/Makefile.am (libpath.h): Fix SCM_LIB_DIR to point to the
	  libdir, not pkglibdir. Add SCM_EXTENSIONS_DIR, for a dir to put in the
	  dynamic-link search path that's not managed by ldconfig or the like;
	  and put this dir in the "extensionsdir" key of %guile-build-info.

	* libguile/dynl.c (sysdep_dynl_init): Rename the installed-libdir
	  environment var to GUILE_SYSTEM_EXTENSIONS_PATH (from
	  GUILE_SYSTEM_LTDL_PATH). Also add SCM_EXTENSIONS_DIR to the ltdl
	  search path in the default case.
	* meta/uninstalled-env.in: Adapt override to match.

	* meta/guile-2.0.pc.in: Add extensionsdir, so you can pkg-config
	  --variable=extensionsdir guile-2.0.

2009-10-12  Michael Gran  <spk121@yahoo.com>

	Modify regexp.test to work better with mac/darwin
	* test-suite/tests/regexp.test (set-latin-1): also add .ISO8859-1 as a
	  possible extension for latin-1 locales.  Use set-latin-1 exclusively
	  to set the locale for tests.

2009-10-09  Michael Gran  <spk121@yahoo.com>

	Revert changes that gather thread-specific local language
	The method used was not portable.  However, the underlying problem
	still exists: the uc_locale_language used by libunistring does not
	work with thread-specific locale_t locales.

	* libguile/i18n.c (locale_language): avoid unpacking semi-opaque type
	  locale_t.

	* test-suite/tests/i18n.test: set Turkish string and char locale upcase
	  and downcase tests to throw untested

2009-10-09  Ludovic Courtès  <ludo@gnu.org>

	Adjust to match changes in libgc's CVS (pre-7.2).
	In libgc CVS the `GC_do_blocking ()' declaration is now public but it
	uses a slightly different signature for its first argument.

	* configure.ac: Check for `GC_fn_type'.

	* libguile/threads.c (GC_fn_type)[HAVE_GC_DO_BLOCKING &&
	  !HAVE_GC_FN_TYPE]: New typedef.
	  (scm_without_guile): Explicitly cast `without_guile_trampoline' to
	  `GC_fn_type'.  This is because the upstream definition currently
	  looks like `typedef void * (extern *GC_fn_type)(void *);', which
	  isn't compatible.

	Use TLS when available for `SCM_I_CURRENT_THREAD'.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): New macro.

	* configure.ac: Use it.

	* libguile/__scm.h (SCM_THREAD_LOCAL): New macro.

	* libguile/gen-scmconfig.c (main): Define `SCM_HAVE_THREAD_STORAGE_CLASS'.

	* libguile/gen-scmconfig.h.in (SCM_I_GSC_HAVE_THREAD_STORAGE_CLASS):
	  New.

	* libguile/threads.c
	  (scm_i_current_thread)[SCM_HAVE_THREAD_STORAGE_CLASS]: New.
	  (SET_CURRENT_THREAD): New macro.
	  (guilify_self_1, on_thread_exit, init_thread_key): Use it.

	* libguile/threads.h
	  (scm_i_current_thread)[SCM_HAVE_THREAD_STORAGE_CLASS]: New
	  declaration.
	  (SCM_I_CURRENT_THREAD)[SCM_HAVE_THREAD_STORAGE_CLASS]: New macro.
	  (init_thread_key_once, init_thread_key): Conditionalize on
	  `!defined SCM_HAVE_THREAD_STORAGE_CLASS'.
	  (scm_i_init_thread_for_guile): Update accordingly.

	Arrange so that `SCM_I_CURRENT_THREAD' is not accessed outside of libguile.
	* libguile/__scm.h (scm_async_tick): New declaration.
	  (SCM_ASYNC_TICK)[!BUILDING_LIBGUILE]: Use `scm_async_tick ()'.

	* libguile/async.c (scm_critical_section_start,
	  scm_critical_section_end, scm_async_tick): New functions.

	* libguile/async.h (scm_i_critical_section_mutex): Made internal.
	  (scm_critical_section_start, scm_critical_section_end): New
	  declarations.
	  (SCM_CRITICAL_SECTION_START,
	  SCM_CRITICAL_SECTION_END)[!BUILDING_LIBGUILE]: Use the same-named
	  function (lower-case).

	* libguile/stackchk.h (SCM_STACK_OVERFLOW_P): Conditionalize on
	  `BUILDING_LIBGUILE'.

	* libguile/threads.h (SCM_I_CURRENT_THREAD, scm_i_dynwinds,
	  scm_i_set_dynwinds, scm_i_last_debug_frame,
	  scm_i_set_last_debug_frame): Conditionalize on `BUILDING_LIBGUILE'.

	Deprecate `scm_mask_ints'.
	* libguile/async.h (scm_mask_ints): Remove.

	* libguile/deprecated.c (scm_i_mask_ints): New.

	* libguile/deprecated.h (scm_mask_ints): New macro.
	  (scm_i_mask_ints): New declaration.

2009-10-07  Neil Jerram  <neil@ossau.uklinux.net>

	Revert "Change dynwind flag enums to #defines, for greater portability"
	This reverts commit b25aa0b9373d2798469e0fe999cd915e8beedc4f.

2009-10-06  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in `scm_array_p_2 ()'.
	* libguile/generalized-arrays.c (scm_array_p_2)[FUNC_NAME]: Fix.

	Add compiler warning for possibly unbound variables.
	* module/language/tree-il/analyze.scm (<toplevel-info>): New record
	  type.
	  (env-module, report-possibly-unbound-variables): New procedures.

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

	* module/system/base/message.scm (%warning-types): Likewise.

	* test-suite/tests/tree-il.test (read-and-compile, %opts-w-unbound):
	  New.
	  ("warnings")["unbound variable"]: New test prefix.

	tree-il: Pass the environment to warning passes.
	* module/language/tree-il/analyze.scm (report-unused-variables): Taken a
	  new parameter, ENV.

	* module/language/tree-il/compile-glil.scm (compile-glil): Pass E to
	  individual warning passes.

2009-10-02  Neil Jerram  <neil@ossau.uklinux.net>

	Change dynwind flag enums to #defines, for greater portability
	Thanks to Inge Gutheil for raising this problem.

	* doc/ref/api-control.texi (Dynamic Wind): Remove doc for
	  scm_t_dynwind_flags, and change uses of scm_t_dynwind_flags to int.
	  Mention possible flags inside doc for scm_dynwind_begin instead.
	  Similarly for scm_t_wind_flags.  In this case the doc on possible
	  flags is moved to after the four functions that can use them.

	* libguile/dynwind.c (scm_dynwind_begin): Change scm_t_dynwind_flags
	  to int.
	  (scm_dynwind_unwind_handler): Change scm_t_wind_flags to int.
	  (scm_dynwind_rewind_handler): Ditto.
	  (scm_dynwind_unwind_handler_with_scm): Ditto.
	  (scm_dynwind_rewind_handler_with_scm): Ditto.

	* libguile/dynwind.h (SCM_F_DYNWIND_REWINDABLE): Use #define instead
	  of typedef enum.
	  (SCM_F_WIND_EXPLICITLY): Ditto.
	  (function declarations): Change scm_t_dynwind_flags and
	  scm_t_wind_flags to int.

	* test-suite/standalone/test-unwind.c (check_cont_body): Change
	  scm_t_dynwind_flags to int.

2009-10-02  Ludovic Courtès  <ludo@gnu.org>

	Use `SCM_DEPRECATED' in declarations of deprecated functions/variables.
	* libguile/deprecated.c (SCM_BUILDING_DEPRECATED_CODE): New macro.

	* libguile/async.c (SCM_BUILDING_DEPRECATED_CODE): Likewise.

	* libguile/macros.c (SCM_BUILDING_DEPRECATED_CODE): Likewise.

	* libguile/async.h, libguile/deprecated.h, libguile/eval.h,
	  libguile/gc.h, libguile/gc.h, libguile/macros.h, libguile/ports.h,
	  libguile/srfi-4.h, libguile/strings.h: Change declarations of
	  deprecated functions and variables to use `SCM_DEPRECATED' instead of
	  `SCM_API'.

	Add `SCM_DEPRECATED' macro to declare deprecated C functions/variables.
	* libguile/__scm.h (SCM_DEPRECATED): New macro.

	Fix the argument list of gsubr stack frames.
	This fixes a bug introduced in e20d7001c3f7150400169fecb0bf0eefdf122fe2
	and reported by Neil.

	* libguile/eval.i.c (CEVAL)[DEVAL]: Don't duplicate ARG1 in
	  `debug.info->a.args' for gsubr stack frames.
	  (scm_apply): Likewise.

	* test-suite/tests/eval.test ("stacks")["arguments of a gsubr stack
	  frame"]: New test.

2009-10-02  Neil Jerram  <neil@ossau.uklinux.net>

	Fix doc for inet-ntop: always produces a string
	Thanks to Scott McPeak for reporting this.

	* libguile/socket.c (scm_inet_ntop): In docstring, add quotes around
	  IPv6 address (+ reflow a bit).

	* doc/ref/posix.texi (Network Address Conversion): Corresponding
	  change.

	* doc/maint/guile.texi: Corresponding change.

	Fix handling of IPv6 addresses
	Thanks to Scott McPeak for reporting this and providing a patch.

	* libguile/socket.c (scm_to_ipv6): When address is the wrong type,
	  provide more information in the exception message.

	  (scm_to_sockaddr): scm_to_ipv6 expects just an address, not the
	  whole vector.

	* test-suite/tests/socket.test ("AF_INET6/SOCK_STREAM"): New set of
	  tests.

2009-10-01  Neil Jerram  <neil@ossau.uklinux.net>

	Fix incorrect doc mentions of INADDR_LOCALHOST
	Thanks to Scott McPeak for reporting this.

	* doc/ref/posix.texi (Network Sockets and Communication): Change
	  INADDR_LOCALHOST to INADDR_LOOPBACK.

	Add define-module to signals.test
	* test-suite/tests/signals.test (test-suite): Add define-module form.

	Change signals.test to LGPLv3+
	* test-suite/tests/signals.test: Update licence statement.

	Remove unused environments code and tests
	* libguile/environments.c, libguile/environments.h,
	  test-suite/tests/environments.nottest: Deleted.

2009-09-30  Neil Jerram  <neil@ossau.uklinux.net>

	Fix spurious `throw from within critical section' errors
	The crux of this problem was that the thread doing a throw, and so
	checking scm_i_critical_section_level, was different from the thread
	that was in a critical section.

	* libguile/async.h (scm_i_critical_section_level): Removed, replaced
	  by per-thread critical_section_level.
	  (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END): Use
	  per-thread critical_section_level.

	* libguile/continuations.c (scm_dynthrow): Check per-thread
	  critical_section_level.

	* libguile/threads.c (guilify_self_1): Init per-thread
	  critical_section_level.
	  (scm_i_critical_section_level): Removed.

	* libguile/threads.h (scm_i_thread): New critical_section_level field.

	* libguile/throw.c (scm_ithrow): Check per-thread critical_section_level.

	Avoid throw from critical section, given invalid sigaction call
	* libguile/scmsigs.c (scm_sigaction_for_thread): Exit critical section
	  before raising out-of-range error.

	* test-suite/Makefile.am (SCM_TESTS): Add signals.test.

	* test-suite/tests/signals.test: New file.

2009-09-28  Ludovic Courtès  <ludo@gnu.org>

	Make `weaks.test' slightly more robust.
	* test-suite/tests/weaks.test (global-weak): Use `string-copy' on all
	  the keys, in case one of them is retained in `scm_source_whash' or
	  similar.

	Improve description of `scm_set_smob_mark ()'.
	* doc/ref/api-smobs.texi (Smobs): Improve description of
	  `scm_set_smob_mark ()'.  Mention malloc(3) regions.

	Remove unneeded SMOB/port mark/free procedures.
	* libguile/arrays.c (array_mark, array_free): Remove.
	  (scm_init_arrays): Adjust accordingly.

	* libguile/bitvectors.c (bitvector_free): Remove.
	  (scm_c_make_bitvector): Use `scm_gc_malloc_pointerless ()'.
	  (scm_init_bitvectors): Adjust accordingly.

	* libguile/strports.c (scm_make_stptob): Remove `scm_set_port_mark ()'
	  call.

	* libguile/vports.c (scm_make_sfptob): Likewise.

	Remove default port/SMOB finalizers.
	* libguile/ports.c (scm_port_free0): Remove.
	  (scm_make_port_type): Set `free' to NULL.

	* libguile/smob.c (scm_make_smob_type): Leave `free' to NULL.
	  (scm_smob_free): Remove.

	* libguile/smob.h (scm_smob_free): Remove.

	* libguile/deprecated.c (scm_smob_free): New.

	* libguile/deprecated.h (scm_smob_free): New declaration.

2009-09-26  Neil Jerram  <neil@ossau.uklinux.net>

	Clean meta/guile-config
	* meta/Makefile.am (CLEANFILES): New, containing guile-config.

2009-09-25  Neil Jerram  <neil@ossau.uklinux.net>

	Don't include guile-config and guile-tools in distribution
	They need to be regenerated, with the correct prefix, when configure
	and make run.

	* meta/Makefile.am (EXTRA_DIST): Remove bin_SCRIPTS.

	Fix make distcheck by looking for guile-config in $(srcdir)
	make distcheck is currently failing for me with:

	In file included from /usr/local/include/libguile/threads.h:35,
	                 from /usr/local/include/libguile/async.h:28,
	                 from /usr/local/include/libguile.h:37,
	                 from ../../examples/box/box.c:22:
	/usr/local/include/libguile/pthread-threads.h:33:31: error: libguile/boehm-gc.h: No such file or directory
	In file included from /usr/local/include/libguile.h:93,
	                 from ../../examples/box/box.c:22:

	- which is because it's picking up a load of installed headers,
	instead of those in the _inst tree

	- which is because there is no output from the preceding guile-config
	invocation:

	PATH=/home/neil/SW/Guile/ovnight/guile-master-20090924/_inst/bin:$PATH PKG_CONFIG_PATH=/home/neil/SW/Guile/ovnight/guile-master-20090924/_inst/lib/pkgconfig /home/neil/SW/Guile/ovnight/guile-master-20090924/_inst/bin/guile-config compile

	- which is because .../_inst/bin/guile-config is empty

	- which is because the rule in meta/Makefile.am that generates
	guile-config is missing $(srcdir), and so doesn't find
	guile-config.in.

	* meta/Makefile.am (guile-config): Look for guile-config.in in
	  $(srcdir).

2009-09-25  Michael Gran  <spk121@yahoo.com>

	Missing free in nl-langinfo
	This is a regression.

	* libguile/i18n.c (scm_nl_langinfo): free c_result

	Fix encoding of strings returned by nl-langinfo
	Strings returned by nl-langinfo were always being encoded using the
	global setlocale and not the scm_t_locale passed to the function.

	* libguile/i18n.c (scm_nl_langinfo): fix encoding of strings

2009-09-24  Michael Gran  <spk121@yahoo.com>

	Language-specific case-conversion doesn't honor locale
	Libunistring uses a function uc_locale_language to extract the
	current language from the locale information.  It does this by calling
	setlocale.  This makes incompatible with Guile functions that use the
	locale_t thread-specific locale API, because the values returned by the
	call to setlocale ignore the locale set by uselocale.

	As a workaround, this patch extracts the language from the locale_t
	structure's __names field.

	A more complete solution is needed.  Perhaps that solution would test
	that the __names field exists in the configure step and revert to
	!USE_GNU_LOCALE_API in that case.

	* libguile/i18n.c (locale_language): new function that performs the
	  same job as uc_locale_language but is compatible with uselocale
	  (u32_locale_casecoll, u32_locale_tocase): replace uc_locale_language
	  with locale_language

	Tests for locale-specific case conversion
	* test-suite/tests/i18n.test: add tests for case conversion of Turkish
	  letters 'i' to verify that the language is being honored.

	Try to adjust i18n for strict aliasing
	* libguile/i18n.c (u32_locale_tocase, scm_char_locale_downcase)
	  (scm_char_locale_upcase, scm_string_locale_downcase)
	  (scm_string_locale_upcase): use the scm_t_uint32 type for buffers
	  that are used primarily for libunistring and not for Guile strings.

2009-09-24  Ludovic Courtès  <ludo@gnu.org>

	Move "-z relro" out of $LDFLAGS so it's not in `guile-2.0.pc'.
	* acinclude.m4 (GUILE_GNU_LD_RELRO): Substitute `GNU_LD_FLAGS'.

	* libguile/Makefile.am (libguile_la_LDFLAGS): Add $(GNU_LD_FLAGS).

	* srfi/Makefile.am (AM_LDFLAGS): New.

	Have `guile-config' close over `pkg-config' and $(pkgconfigdir).
	* meta/Makefile.am (guile-config): New target.
	  (EXTRA_DIST): Add `guile-config.in'.

	* meta/guile-config.in: New, formerly `guile-config'.  Use the right
	  installed `guile', with the right $PKG_CONFIG_PATH.  Disable
	  auto-compilation.
	  (%pkg-config-program): New variable.
	  (pkg-config): Use it.

	Partially revert e5f5113c21f396705d7479a570c96690135c9d36.
	The intent is to maintain the readability of `pmatch' invocations.

	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  Don't use wildcards in `pmatch' invocations, even when the matched
	  elements are unused.

	* module/language/glil/decompile-assembly.scm (decompile-toplevel,
	  decompile-load-program): Likewise.

	* module/system/xref.scm (program-callee-rev-vars): Likewise.

	* module/language/assembly.scm (byte-length): Likewise.

	* module/language/tree-il/compile-glil.scm (flatten): Likewise.

	Reinstate backward-compatible `scm_array_p ()'.
	* libguile/generalized-arrays.c (scm_array_p_2): New, formerly
	  `scm_array_p ()'.
	  (scm_array_p): Add second argument, for compatibility with 1.8 and
	  earlier and to match what the doc says and what `SCM_VALIDATE_ARRAY'
	  expects.

	* libguile/generalized-arrays.h (scm_array_p_2): New.
	  (scm_array_p): Adjust.

2009-09-23  Michael Gran  <spk121@yahoo.com>

	Modify char and string locale upcase and downcase for Unicode
	* libguile/i18n.c (u32_locale_tocase): new helper function
	  (scm_char_locale_downcase, scm_char_locale_upcase): add capability
	  for UCS-4 characters.
	  (scm_string_locale_downcase, scm_string_locale_upcase): modify for
	  the new scheme strings.

2009-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	Manual link from `Guile Initialization' to `Initialization'
	Thanks to Dale Smith for suggesting this.

	* doc/ref/libguile-linking.texi: Add ref to full doc of Guile
	  initialisation functions.

	Changes so that benchmark-guile runs successfully
	* benchmark-suite/benchmarks/bytevectors.bm: Add "coding: latin1"
	  comment where Guile will find it.

	* benchmark-suite/benchmarks/chars.bm: Ditto.

	* benchmark-suite/benchmarks/srfi-13.bm: Ditto.

	* benchmark-suite/benchmarks/read.bm ("read"): Divide numbers of
	  iterations by 10, so that the benchmarks complete within a few
	  minutes.

	* benchmark-suite/lib.scm (benchmark): Use `run-benchmark' in macro
	  definition, not `,run-benchmark'.

	* benchmark-suite/benchmarks/0-reference.bm,
	  benchmark-suite/benchmarks/continuations.bm,
	  benchmark-suite/benchmarks/if.bm,
	  benchmark-suite/benchmarks/logand.bm: Add define-module.

	* benchmark-suite/results/neil-arudy: New file, containing benchmark
	  results from my computer.

	GDS usability: operation without a mouse
	Derek Peschel provided this patch and described it as follows.

	"Most of the time I use Terminal in OS X, rather than xterm.  I also don't
	bother with the GUI versions of Emacs.  So unfortunately I have no mouse
	support in Emacs.  Also the system I'm testing Guile on thinks my terminal
	doesn't support color and I haven't fixed it yet.  The attached patch makes
	GDS more usable for me.

	"With no mouse, the "[click here to show error stack]" design is very
	inconvenient.  You added a C-M (return) binding at some point.  I copied
	that, but I also changed the message to show it.  And I made the return
	work when the cursor is after the right bracket."

	* emacs/gds-scheme.el (gds-display-results): Make "click here" message
	  more helpful for people without mice.  Also extend text properties
	  so that a RET key press works at the end of that line.

	Typo fixes

	Fix GDB in Emacs incantation

2009-09-21  Michael Gran  <spk121@yahoo.com>

	Tests for record types
	* test-suite/tests/records.test: new tests

	More tests for strings
	* test-suite/tests/vectors.test: test make-vector and interactions between
	  strings and vectors

	* test-suite/tests/strings.test: test string-null?, string? and backslash
	  escapes

	* test-suite/tests/srfi-13.test: test null input strings in string-any and
	  string-every

2009-09-21  Ludovic Courtès  <ludo@gnu.org>

	Remove unused variables in system/language.
	* module/language/assembly.scm (byte-length): Don't match unused
	  record slots.

	* module/language/tree-il.scm (tree-il->scheme, post-order!,
	  pre-order!): Likewise.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Likewise.

	* module/language/tree-il/compile-glil.scm (flatten): Likewise.

	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  Don't match unused list elements.

	* module/language/glil/decompile-assembly.scm (decompile-toplevel,
	  decompile-load-program): Likewise.

	* module/system/xref.scm (program-callee-rev-vars): Likewise.

	* module/language/assembly/compile-bytecode.scm
	  (write-bytecode)[write-sized-loader]: Remove.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Factorize `pad' variables.

	* module/language/ecmascript/base.scm (object->value/string,
	  object->value/number)[v]: Remove.

	* module/language/ecmascript/tokenize.scm (read-slash)[c0]: Remove.

	* module/language/objcode/spec.scm (decompile-value)[nargs]: Remove.

	* module/system/repl/command.scm (time)[vms-start, vms-end]: Remove.

	* module/system/repl/repl.scm (prompting-meta-read): Use `prompt'.

	Remove unused variables in ice-9/goops/srfi/scripts.
	* module/ice-9/boot-9.scm (scm-style-repl)[-abort]: Remove.

	* module/oop/goops.scm (class)[slot-defs]: Remove.
	  (compute-slot-accessors)[name]: Remove.
	  (compute-get-n-set)[env]: Remove.

	* module/oop/goops/active-slot.scm (compute-get-n-set)[env, name]:
	  Remove.

	* module/oop/goops/dispatch.scm (cache-try-hash!)[max-misses]: Remove.

	* module/oop/goops/save.scm (make-mapper)[dims]: Remove.

	* module/scripts/autofrisk.scm (>>checks)[prog]: Remove.

	* module/srfi/srfi-19.scm (priv:read-directives)[ireaderf, eireader4]:
	  Remove.

2009-09-20  Ludovic Courtès  <ludo@gnu.org>

	Honor and confine expansion-time side-effects to `current-reader'.
	* module/language/scheme/spec.scm (scheme)[#:reader]: Honor the
	  compilation environment's `current-reader'.

	* module/system/base/compile.scm (*compilation-environment*): New
	  fluid.
	  (current-compilation-environment): New procedure.
	  (make-compilation-module): Provide a fresh `current-reader' fluid.
	  (read-and-compile): Set `*compilation-environment*' appropriately.
	  (compile): Likewise.

	* test-suite/tests/compiler.test (read-and-compile): New.
	  ("current-reader"): New test prefix.

	Fix copyright in `(srfi srfi-4 gnu)'.

	Compile in a fresh module by default.
	* module/system/base/compile.scm (make-compilation-module,
	  language-default-environment): New procedures.
	  (read-and-compile, compile): Have ENV default to
	  `(language-default-environment from)'.
	  (compile-and-load): Compile in `(current-module)'.

	* module/system/repl/common.scm (repl-compile): Explicitly compile in
	  the current module so that macro definitions are visible.

	* libguile/load.c (kw_env): New variable.
	  (do_try_autocompile): Call `compile-file' with `#:env (current-module)'.

	* test-suite/tests/compiler.test ("psyntax")["compile uses a fresh module by
	  default", "compile-time definitions are isolated"]: New tests.
	  ["compile in current module"]: Specify `#:env (current-module)'.
	  ["redefinition"]: Adjust.

	* test-suite/tests/bytevectors.test (c&e): Explicitly compile in the
	  current module so that its imports are visible.

2009-09-18  Andy Wingo  <wingo@pobox.com>

	fix bitvectors after the array handle refactoring
	* libguile/uniform.h (scm_array_handle_uniform_element_bit_size): New
	  public accessor.

	* libguile/uniform.c (scm_array_handle_uniform_element_size): Better
	  errors in non-byte-aligned arrays.
	  (scm_uniform_vector_element_type, scm_uniform_vector_element_size)
	  (scm_c_uniform_vector_ref, scm_c_uniform_vector_set_x):
	  (scm_uniform_vector_to_list): Don't require byte-aligned access.

	* libguile/bytevectors.c (scm_uniform_array_to_bytevector):
	* libguile/arrays.c (scm_from_contiguous_typed_array):  Fix for
	  uniform arrays whose element size is not a multiple of the byte size.

	fix thinko in api-memory.texi

2009-09-18  Ludovic Courtès  <ludo@gnu.org>

	i18n: Remove non-local exists from `u32_locale_casecoll ()'.
	* libguile/i18n.c (u32_locale_casecoll): Add RESULT argument.  Return
	  zero or ERRNO.
	  (compare_u32_strings_ci): Adjust accordingly.

	i18n: Always use locale-dependent string collation.
	* libguile/i18n.c (compare_u32_strings, compare_u32_strings_ci): Always
	  use locale-dependent string collation.

	* test-suite/tests/i18n.test: Recoded in UTF-8.
	  (%french-utf8-locale-name): New.
	  (under-locale-or-unresolved): New.  Don't catch errors on GNU systems.
	  (under-french-locale-or-unresolved): Use it.
	  (under-french-utf8-locale-or-unresolved): New.
	  ("text collation (French)")["string-locale-ci=? (2 args, wide
	  strings)", "string-locale-ci=? (3 args, wide strings)",
	  "string-locale-ci<>? (wide strings)", "string-locale-ci<>? (wide and
	  narrow strings)", "char-locale-ci<>? (wide)"]: New tests.

	i18n: Avoid needless heap allocation.
	* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Allocate buffers on the stack
	  rather on the heap.
	  (SCM_U32_BUF_FREE): Remove.  Callers updated.

	i18n: Simplify `RUN_IN_LOCALE_SECTION' (GNU version).
	* libguile/i18n.c (RUN_IN_LOCALE_SECTION)[USE_GNU_LOCALE_API]: Remove
	  extraneous uselocale(3) call.

	Add the `%host-type' global variable.
	* configure.ac: Define `HOST_TYPE'.

	* libguile/load.c (sys_host_type): New variable.

	* doc/ref/api-options.texi (Build Config): Document `%host-type'.

2009-09-17  Michael Gran  <spk121@yahoo.com>

	Adapt i18n string and char comparison funcs for Unicode
	* libguile/i18n.c (RUN_IN_LOCALE_SECTION) [USE_GNU_LOCALE_API]: new
	  macro for this define.  Should work the same as the !USE_GNU_LOCAL_API
	  version
	  (SCM_STRING_TO_U32_BUF, SCM_U32_BUF_FREE): helper macros
	  (compare_u32_strings, compare_u32_strings_ci): new functions that
	  compare scheme strings in the presence of the locale
	  (u32_locale_casecoll): new helper function for compare_u32_strings_ci
	  (compare_strings, compare_strings_ci): removed and replaced by
	  compare_u32_strings and compare_u32_strings_ci
	  (scm_string_locale_lt, scm_string_locale_gt, scm_string_locale_ci_lt)
	  (scm_string_locale_ci_gt, scm_string_locale_ci_eq): modified to
	  use new compare_u32_strings and compare_u32_strings_ci comparison
	  functions
	  (scm_char_locale_lt, scm_char_locale_gt, scm_char_locale_ci_lt)
	  (scm_char_locale_ci_gt, scm_char_locale_ci_eq): modified to use
	  new compare_u32_strings and compare_u32_strings_ci comparison
	  functions

2009-09-17  Neil Jerram  <neil@ossau.uklinux.net>

	Remove deprecation warnings from the build
	* module/srfi/srfi-35.scm: Remove explicit use of (ice-9 syncase).

	* test-suite/tests/r5rs_pitfall.test: Same again.

	* test-suite/tests/syncase.test: Remove "(ice-9 syncase) loads" test;
	  syncase is always loaded now.

	Convenience for running GDB on Guile in Emacs
	* meta/gdb-uninstalled-guile.in: Add (in a comment) an elisp form that
	  can be evaluated to run GDB on Guile in Emacs.

	Fix omission of VM frames from backtrace
	From the time when a #<program> was a SMOB, really_make_boot_program
	in vm.c was still using SCM_SET_SMOB_FLAGS to set the
	SCM_F_PROGRAM_IS_BOOT flag - which meant that it was setting flag
	1<<32 :-) which obviously was then missed by the SCM_PROGRAM_IS_BOOT
	calls in stacks.c.

	* libguile/programs.h (SCM_F_PROGRAM_IS_BOOT): Use a less significant
	  bit for this flag, now that programs use a tc7 type.

	* libguile/vm.c (really_make_boot_program): Don't use
	  SCM_SET_SMOB_FLAGS, now that programs aren't SMOBs.

	Fix incorrect stack count warnings
	* libguile/stacks.c (stack_depth): Decrement depth count for a
	  macro-expansion frame.  (Missing this decrement will cause a "stack
	  count incorrect" warning but is actually benign, as it only means
	  that scm_make_stack allocates a bit more space for the stack than it
	  really needs.)

	  (read_frames): Increment count of remaining unused frames, when
	  cutting out a macro transformer application frame.  (Missing this
	  increment could cause the "stack count incorrect" warning, and could
	  make read_frames think it's filled up all the available stack frames
	  when there's actually still one frame unused; this wasn't benign,
	  because it could cause information to be missing from a stack
	  trace.)

	Remove unhittable else branch for nonexistent type of debug frame
	* libguile/stacks.c (stack_depth): Remove unhittable else branch
	  apparently catering to a kind of frame that isn't an eval, apply or
	  void frame - in fact there are no other kinds of frames.

2009-09-16  Andy Wingo  <wingo@pobox.com>

	add the libdir to the ltdl lib search path
	* libguile/Makefile.am (libpath.h): Fix pkgdatadir, pkglibdir, and
	  pkgincludedir entries. Add a new define, SCM_LIB_DIR.

	* libguile/dynl.c (sysdep_dynl_init): Add the libdir to the libltdl
	  search path. Should fix
	  http://thread.gmane.org/gmane.lisp.guile.bugs/4289/focus=4296 -- that
	  is, it should allow guile to be invoked from whereever it is
	  installed, without munging LTDL_LIBRARY_PATH or the like variables.

	  There is a trick though -- during the build, we don't want to be
	  looking in the $libdir for loadable modules. So as with
	  GUILE_SYSTEM_PATH, we have GUILE_SYSTEM_LTDL_PATH.

	* meta/uninstalled-env.in: Set GUILE_SYSTEM_LTDL_PATH to "" when
	  building.

2009-09-15  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 1.9.3.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

	Use fixnums for int32 when the native word size of greater than 4 bytes.
	This should also fix "condition is always true" warnings.

	* libguile/vm-i-scheme.c (bv_u32_native_ref, bv_s32_native_ref,
	  bv_u32_native_set, bv_s32_native_set): Conditionalize use of
	  `BV_FIXABLE_INT_REF' vs. `BV_INT_REF' based on `SIZEOF_VOID_P'.

	Keep the weak pair API internal.
	* libguile/weaks.h (scm_weak_car_pair, scm_weak_cdr_pair,
	  scm_doubly_weak_pair): Make them internal.

	Fix bug #27450 ("Fat mutexes not GC'd until their owner dies").
	* libguile/threads.c (do_thread_exit): Deal with `t->mutexes' being a
	  weak list.
	  (fat_mutex_lock): Use weak-car pairs when building up `t->mutexes'.

	* test-suite/tests/threads.test ("mutex-ownership")["mutex with owner
	  not retained (bug #27450)"]: New test.

	Fix the (currently unused) weak pair accessors.
	* libguile/weaks.h (SCM_WEAK_PAIR_WORD): Fixed; changed to return
	  `SCM_UNDEFINED' when the word has been nullified.

	"Document" the `set-module-eval-closure!' weak hash table glitch.
	* module/ice-9/boot-9.scm (set-module-eval-closure!): Add link to an
	  explanation.

	* test-suite/tests/gc.test ("gc")["Unused modules are removed"]:
	  Increase the `cleanup' loop.

	Nitpick in `srfi-14.c'.
	* libguile/srfi-14.c (scm_i_ucs_range_to_char_set): Fix warning about
	  the position of BASE_CS.

	Make the precise stack mark procedure more robust.
	* libguile/vm.c (vm_stack_mark): Return if VM is NULL.

	Use GC-robust queues/lists in `threads.c'.
	* libguile/threads.c (remqueue, dequeue, on_thread_exit): Initialize the
	  "next" link of the item returned/removed.

	Remove explicit thread/condvar/mutex finalization.
	* libguile/threads.c (fat_mutex_free): Remove explicit `scm_gc_free ()'
	  call.
	  (fat_cond_free, thread_free): Remove.
	  (scm_threads_prehistory): Adjust accordingly.

2009-09-14  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

	Merge `libguile-i18n' into `libguile'.
	* GUILE-VERSION (LIBGUILE_I18N_MAJOR, LIBGUILE_I18N_INTERFACE_CURRENT,
	  LIBGUILE_I18N_INTERFACE_REVISION, LIBGUILE_I18N_INTERFACE_AGE,
	  LIBGUILE_I18N_INTERFACE): Remove.

	* doc/ref/api-i18n.texi (i18n Introduction): Don't mention
	  `libguile-i18n'.

	* libguile.h: Include "libguile/i18n.h".

	* libguile/Makefile.am (lib_LTLIBRARIES): Remove `libguile-i18n-v*'.
	  (libguile_la_SOURCES): Add `i18n.c'.
	  (libguile_i18n_v_*_SOURCES, libguile_i18n_v_*_CFLAGS,
	  libguile_i18n_v_*_LIBADD, libguile_i18n_v_*_LDFLAGS): Remove.

	* libguile/i18n.c (scm_bootstrap_i18n): New function.

	* libguile/i18n.h (scm_nl_langinfo, scm_init_i18n): Made internal.
	  (scm_bootstrap_i18n): New declaration.

	* libguile/init.c (scm_i_init_guile): Invoke `scm_bootstrap_i18n ()'.

	* module/ice-9/i18n.scm: Load from `libguile' instead of
	  `libguile-i18n-v-0'.

	Switch the `encoding*.test' files to LGPLv3+.
	* test-suite/tests/encoding-escapes.test,
	  test-suite/tests/encoding-iso88591.test,
	  test-suite/tests/encoding-iso88597.test,
	  test-suite/tests/encoding-utf8.test: Switch to LGPLv3+ for the sake of
	  consistency.

	Update `scm_without_guile ()' documentation.
	* doc/ref/api-scheduling.texi (Blocking): Mention that
	  `scm_without_guile ()' & co. aren't needed any longer.

	Rename "boehm-gc.h" to "bdw-gc.h"; add to the distribution.
	* libguile/Makefile.am (modinclude_HEADERS): Add `bdw-gc.h'.

	* libguile/bdw-gc.h: Rename from "boehm-gc.h"; users updated.  Update to
	  LGPLv3+.

	Remove unused IA64 macro.
	* libguile/threads.c (SCM_MARK_BACKING_STORE): Remove.

2009-09-11  Michael Gran  <spk121@yahoo.com>

	More setlocale robustness in regexp tests
	* test-suite/tests/regexp.test (mysetlocale, set-latin-1): new functions
	  (with-latin1-locale): removed
	  (regexp-quote tests): try to print test names in locale but run tests
	  in ISO-8859-1.

2009-09-11  Ludovic Courtès  <ludo@gnu.org>

	Remove `scm_enter_guile ()' and `scm_leave_guile ()'.
	* libguile/threads.c (scm_t_guile_ticket): Remove type.
	  (resume, scm_enter_guile, suspend, scm_leave_guile): Remove.
	  (scm_i_init_thread_for_guile): Set `t->top' to NULL, which has the
	  same effect as calling `scm_enter_guile ()'.
	  (scm_leave_guile_cleanup, scm_i_with_guile_and_parent): Remove
	  `scm_leave_guile ()' call.

	Add `λ' macro as an alternative to `lambda'.
	* module/ice-9/boot-9.scm (λ): New macro.

	* NEWS: Update.

	Report missing libunistring at `configure'-time.
	* configure.ac: Reinstate libunistring check from
	  1ee2c72eafaae5f91f4c899bc4b4853af5c16f28.

2009-09-10  Ludovic Courtès  <ludo@gnu.org>

	Remove unnecessary uses of `scm_{leave,enter}_guile ()'.
	* libguile/threads.c (scm_pthread_cond_wait,
	  scm_pthread_cond_timedwait): Remove `scm_{leave,enter}_guile ()'
	  calls.

	Link with `-z relro' when available.
	* acinclude.m4 (GUILE_GNU_LD_RELRO): New macro.

	* configure.in: Use `GUILE_GNU_LD_RELRO'.

2009-09-09  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc_os_dep.c

	Avoid unneeded `scm_dynwind_free ()'.
	* libguile/array-map.c (indices_gc_hint): New variable.
	  (scm_ramapc, scm_array_index_map_x): Avoid `scm_dynwind_free ()' using
	  `scm_gc_malloc_pointerless ()'.

	Update doc of `scm_gc_protect_object ()' and SMOB mark/free.
	* doc/ref/api-memory.texi (Garbage Collection
	  Functions)[scm_gc_protect_object]: Explain that it's equivalent to
	  storing in a global variable.

	* doc/ref/api-smobs.texi (Smobs)[scm_set_smob_free]: Expand on the
	  relationship with `scm_gc_malloc ()'.
	  [scm_set_smob_mark]: Explain that it's usually not needed.

2009-09-09  Michael Gran  <spk121@yahoo.com>

	Avoid prematurely ending regexp test when ISO-8859-1 locale not found
	* test-suite/tests/regexp.test (with-latin1-locale): new function
	  Call tests in context of with-latin1-locale

	Make scm_i_from_stringn into API for use with libguilereadline
	* libguile/strings.c (scm_i_from_stringn): renamed to scm_from_stringn.
	  All callers changed.

	* libguile/strings.h: change declaration of scm_i_from_stringn to
	  scm_from_stringn

	* libguile/strports.c (scm_strport_to_string): scm_i_from_stringn ->
	  scm_from_stringn

	* guile-readline/readline.c (internal_readline): scm_i_from_stringn ->
	  scm_from_stringn

2009-09-09  Ludovic Courtès  <ludo@gnu.org>

	Update documentation of `scm_gc_malloc ()' & co.
	* doc/ref/api-memory.texi (Memory Blocks): Update description of
	  `scm_gc_malloc ()' & co.  Add `scm_gc_malloc_pointerless ()'.

	Update `README'.

2009-09-08  Ludovic Courtès  <ludo@gnu.org>

	Fix misleading comments in `gc-benchmarks/run-benchmark.scm'.
	* gc-benchmarks/run-benchmark.scm (pretty-print-result): Fix comments.

	Improve `gc-benchmarks/run-benchmark.scm'.
	* gc-benchmarks/run-benchmark.scm (pretty-print-result)[ref-heap,
	  ref-time]: New variable.
	  [distance, score, score-string]: New procedures.
	  [print-line]: Use `score-string'.
	  (print-raw-result): New procedure.
	  (%options)["raw", "load-results"]: New options.
	  (%default-options): Add `printer' pair.
	  (show-help): Update.
	  (main): Add support for `--raw' and `--load-results'.

2009-09-08  Michael Gran  <spk121@yahoo.com>

	8-bit locale needed for 8-bit regexp tests
	Since the regex library expects 8-bit clean characters and
	an 8-bit locale, tests of 8-bit characters need to occur within
	the context of an 8-bit locale.

	* test-suite/tests/regexp.test (regexp-quote tests): wrap them in an
	  ISO-8859-1 locale

	Fix broken interaction between readline and Unicode
	This requires separate small fixes.

	Readline has internal logic to deal with multi-byte characters, so
	it wants bytes, not characters.

	scm_c_read gets called by the vm when readline is activated, and it was
	truncating multi-byte characters because soft ports didn't have the
	UCS-4 capability.

	Soft ports need the capability to read UCS-4 characters.  Since soft ports
	may have a single byte buffer, full characters need to be stored into the
	pushback buffer.

	This broke the optimizations in scm_c_read for using an alternate buffer
	for single-byte-buffered ports, because the opimization wasn't expecting
	anything in the pushback buffer.

	* libguile/vports.c (sf_fill_input): store complete chars, not single bytes

	* libguile/ports.c (scm_c_read): don't use optimized path for non Latin-1.
	  Add debug prints.

	* libguile/string.h: make scm_i_from_stringn and scm_i_string_ref public
	  so that readline can use them

	* guile-readline/readline.c: read bytes, not complete chars, from the
	  input port.  Convert output to the output port's locale

2009-09-06  Andy Wingo  <wingo@pobox.com>

	fix compile-time bug compiling (+ "foo" " bar")
	* module/language/tree-il/primitives.scm (+, -): Avoid calling exact? on
	  non-numeric args.

	update news; ready for 1.9.3
	* doc/ref/api-control.texi:
	* doc/ref/goops.texi: Fix some typos.

	* NEWS: Update.

	update NEWS
	* NEWS: Minor text revisions, and fold new NEWS entries into the main
	  body too.

2009-09-05  Michael Gran  <spk121@yahoo.com>

	Avoid string buffer overrun in scm_scan_for_encoding
	* libguile/read.c (scm_scan_for_encoding): possible overrun if
	  coding declaration is at end of file

	Doc updates for character encoding of source code files
	* NEWS

	* doc/ref/scheme-scripts.texi: doc updates for character encoding of
	  source code

	* doc/ref/api-evaluation.texi: doc updates for character encoding of
	  source code

2009-09-04  Michael Gran  <spk121@yahoo.com>

	Doc updates for Unicode string escapes and port encodings
	* NEWS: string and port changes

	* doc/ref/api-data.texi: string escapes and string-ci

	* doc/ref/api-io.texi: port encoding functions

	Remove locale u8vector functions
	Locale u8vector functions deemed harmful.

	* libguile/strports.c (scm_strport_to_locale_u8vector)
	  (scm_call_with_output_locale_u8vector, scm_open_input_locale_u8vector)
	  (scm_get_output_locale_u8vector): removed

	* libguile/strports.h: removed declarations for
	  scm_strport_to_locale_u8vector,
	  scm_call_with_output_u8vector,
	  scm_input_locale_u8vector,
	  scm_get_output_locale_u8vector

	* test-suite/tests/encoding-iso88591.test: display tests removed

	* test-suite/tests/encoding-iso88597.test: display tests removed

	Initialize string ports with UTF-8 encoding
	String ports should be able to accept any string characters, regardless
	of the current locale.  Setting it to UTF-8 achieves that.

	* libguile/strports.c (scm_i_mkstrport): set port's locale to UTF-8
	  (scm_mkstrport): convert input string to UTF-8

	write-char should handle UCS-4 characters
	* libguile/print.c (scm_write_char): call UCS-4 printing routine, instead
	  of 8-bit primitive

2009-09-03  Ken Raeburn  <raeburn@raeburn.org>

	Make test-case compilation with -DSCM_DEBUG=1 work.
	* gc.h (scm_i_expensive_validation_check): Declare SCM_API.

2009-09-03  Michael Gran  <spk121@yahoo.com>

	Doc updates for srfi-14 character sets
	* NEWS: updates for srfi-14 character sets

	* doc/ref/api-data.texi: update char-set section and some spellchecking

	Update docs and docstrings for Unicode characters
	* doc/ref/api-data.texi: more info about characters and codepoints

	* libguile/chars.c: replace 'code point' with 'Unicode code point' in
	  docstrings

	Add char-set debugging function
	* libguile/srfi-14.c (scm_sys_char_set_dump): new function

	* libguile/srfi-14.h: declaration of scm_sys_char_set_dump

	Distinguish between all codepoints and designated codepoints in char-sets
	* libguile/unidata_to_charset.pl (designated): renamed from full

	* libguile/srfi-14.c (scm_char_set_designated): new char-set

	* libguile/srfi-14.i.c (cs_designated): renamed from cs_full

	Modify read and print of combining characters
	Since combining characters, such as accents, modify the appearance of the
	previous letter, it looks awkward in its character literal form (#\name)
	since it modified the backslash.  This instead prints the combining
	character on a small circle.

	* libguile/chars.h (SCM_CODEPOINT_DOTTED_CIRCLE): new #define

	* libguile/print.c (iprint1): print combining characters on dotted circles

	* libguile/read.c (scm_read_character): parse the combination of combining
	  characters and dotted circles

2009-09-03  Ludovic Courtès  <ludo@gnu.org>

	Fix invalid syntax in `dynamic-input-large.sch' (gc-benchmarks).
	* gc-benchmarks/larceny/dynamic-input-large.sch: Remove invalid "\;"
	  escape.

	Add test case for `scm_take_u8vector ()'.
	This is a followup to commit d7e7a02a6251c8ed4f76933d9d30baeee3f599c0
	("Fix leaky behavior of `scm_take_TAGvector ()'.") and a reminder that
	the uniform vector implementation can't do away with the cell->buffer
	indirection.

	* test-suite/standalone/Makefile.am (test_scm_take_u8vector_SOURCES,
	  test_scm_take_u8vector_CFLAGS, test_scm_take_u8vector_LDADD): New.
	  (check_PROGRAMS, TESTS): Add `test-scm-take-u8vector'.

	* test-suite/standalone/test-scm-take-u8vector.c: New file.

2009-09-02  Michael Gran  <spk121@yahoo.com>

	Remove always-true range checks in scm_i_ucs_range_to_char_set
	* libguile/srfi-14.c (scm_i_ucs_range_to_char_set): limits are always
	  non-negative due to the type of the variable

	More srfi-14 char-set tests
	* test-suite/tests/srfi-14.test: many new tests

	Unreachable code in charset set operator
	* libguile/srfi-14.c (scm_i_charset_set): remove unreachable code
	  in scm_i_charset_set

	Optimize charset union operator
	* libguile/srfi-14.c (charsets_union): call scm_i_charset_set_range
	  instead of setting characters one-by-one.

	The charset complement operator should not include surrogates
	* libguile/srfi-14.c (charsets_complement): skip over surrogates
	  when making a charset complement

	char-set-filter! does not properly iterate over the charset
	* libguile/srfi-14.c (scm_char_set_filter_x): iterate over
	  codepoints

	ucs-range->char-set should not store surrogates and has off-by-one error
	* libguile/srfi-14.c (scm_i_ucs_range_to_char_set): new function that
	  contains the functionality of ucs_range_to_char_set, fixes
	  off-by-one, and doesn't store surroges
	  (scm_ucs_range_to_char_set, scm_ucs_range_to_char_set_x): call
	  scm_i_ucs_range_to_char_set
	  (scm_i_charset_set_range): new helper function

	char-set-any improperly unpacks charset data
	* libguile/srfi-14.c (scm_char_set_any): unpack the charset correctly

	char-set-xor! should modify the input parameter
	char-set-xor! was not modifying its input parameter.  It isn't
	technically required to do so by the spec, but, the other similar
	functions do it.

	* libguile/srfi-14.c (scm_char_set_xor_x): modify the input parameter

2009-09-02  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc
	Conflicts:
		acinclude.m4
		libguile/strings.c

2009-09-01  Ludovic Courtès  <ludo@gnu.org>

	Fix leaky behavior of `scm_take_TAGvector ()'.
	* libguile/srfi-4.c (free_user_data): New function.

	* libguile/srfi-4.i.c (scm_take_TAGvector): Register `free_user_data ()'
	  as a finalizer for DATA.

	* libguile/objcodes.c (scm_objcode_to_bytecode): Allocate with
	  `scm_malloc ()' since the memory taken by `scm_take_u8vector ()' will
	  eventually be free(3)d.

	* libguile/vm.c (really_make_boot_program): Likewise.

2009-09-01  Andy Wingo  <wingo@pobox.com>

	fix nontail loops within loops
	* module/language/tree-il/compile-glil.scm (flatten): Fix compilation of
	  loops within loops in non-tail positions. Will add a test case soon,
	  but one way to reproduce it was with the following function:

	(define (test)
	  (let lp ()
	    (pk 'zero)
	    (let ((fk (lambda ()
	                (let ((fk2 (lambda () (pk 'two))))
	                  (let ((fk3 (lambda () (if #t (pk 'three) (fk2)))))
	                    (if #t
	                        (fk3)
	                        (fk2)))))))
	      (pk 'one)
	      (fk))
	    (lp)))

	One would expect to see a sequence of "zero one three", but in fact zero
	only showed once.

	This should fix simplex as well.

2009-09-01  Ludovic Courtès  <ludo@gnu.org>

	Remove the distinction between inline/outline storage for stringbufs.
	* libguile/strings.c (STRINGBUF_HEADER_SIZE, STRINGBUF_HEADER_BYTES):
	  New macros.
	  (STRINGBUF_F_INLINE, STRINGBUF_INLINE, STRINGBUF_OUTLINE_CHARS,
	  STRINGBUF_OUTLINE_LENGTH, STRINGBUF_INLINE_CHARS,
	  STRINGBUF_INLINE_LENGTH, STRINGBUF_MAX_INLINE_LEN): Remove.
	  (STRINGBUF_CHARS, STRINGBUF_WIDE_CHARS): Adjust to return a fixed
	  location.
	  (STRINGBUF_LENGTH): Get the length from word 1.
	  (make_stringbuf, make_wide_stringbuf): Adjust to use a contiguous
	  memory region.
	  (wide_stringbuf): Renamed from `widen_stringbuf'.  Adjust similarly.
	  Return the new stringbuf.  Callers updated.
	  (narrow_stringbuf): Likewise.
	  (scm_sys_string_dump, scm_sys_symbol_dump): Remove `stringbuf-inline'
	  pair.

	* test-suite/tests/strings.test ("string internals")["null strings are
	  inlined", "short Latin-1 encoded strings are inlined", "long Latin-1
	  encoded strings are not inlined", "short UCS-4 encoded strings are not
	  inlined", "long UCS-4 encoded strings are not inlined"]: Remove.

	* test-suite/tests/symbols.test ("symbol internals")["null symbols are
	  inlined", "short Latin-1 encoded symbols are inlined", "long Latin-1
	  encoded symbols are not inlined", "short UCS-4 encoded symbols are not
	  inlined", "long UCS-4 encoded symbols are not inlined"]: Remove.

	Fix leaky handling of `scm_take_locale_{symbol,string} ()'.
	* libguile/strings.c (scm_i_take_stringbufn, scm_i_c_take_symbol):
	  Remove.
	  (scm_take_locale_stringn): Rewrite in terms of `scm_from_locale_stringn ()'.

	* libguile/strings.h (scm_i_c_take_symbol, scm_i_take_stringbufn):
	  Remove declarations.

2009-08-31  Michael Gran  <spk121@yahoo.com>

	Update docs for Unicode characters
	* NEWS: add note about Unicode characters

	* doc/ref/api-data.texi: update Characters subsection

	* libguile/chars.c: update docstrings to match manual

	Tests for display and writing of characters
	* test-suite/tests/encoding-iso88591.test: tests for writing and display
	  of characters

	* test-suite/tests/encoding-iso88597.test: tests for writing and display
	  of characters

	* test-suite/tests/encoding-utf8.test: tests for writing and display
	  of characters

	Fix escape sequence normalization for wide strings
	* libguile/strings.c (scm_to_stringn): convert unistring escapes to
	  guile escapes for both wide and narrow strings

	Fix encoding errors with strings returned by string ports
	String ports, being 8-bit, store strings using the character encoding
	of the port.  This fixes a bug where the default character encoding, and
	not the port's encoding, was being used to convert the string port data
	back to a string.

	* libguile/strports.c: extra comments
	  (scm_strport_to_string):  use port's encoding when converting port data
	  to a string

	* libguile/strings.c (scm_i_from_stringn): renamed from scm_from_stringn
	  and made internal.  All callers changed.
	  (scm_from_stringn): renamed to scm_i_from_stringn.

	* libguile/strings.h: declaration for scm_i_from_stringn

2009-08-31  Ludovic Courtès  <ludo@gnu.org>

	Fix `benchmark-guile'.
	* benchmark-guile.in (guile): Use `meta/guile', not `pre-inst-guile'.

	Remove the distinction between inline/outline storage for bytevectors.
	* libguile/bytevectors.c (SCM_BYTEVECTOR_INLINE_THRESHOLD,
	  SCM_BYTEVECTOR_INLINEABLE_SIZE_P, SCM_BYTEVECTOR_SET_CONTENTS,
	  SCM_BYTEVECTOR_SET_INLINE): Remove.
	  (SCM_BYTEVECTOR_HEADER_BYTES): New macro.
	  (SCM_BYTEVECTOR_SET_ELEMENT_TYPE): Adjust to new flag layout.
	  (make_bytevector): Remove content inlining machinery; use
	  `scm_gc_malloc_pointerless ()' in all cases; special-case zero-sized
	  vu8 buffers.
	  (make_bytevector_from_buffer): Simplified.
	  (scm_c_shrink_bytevector): New, formerly `scm_i_shrink_bytevector ()'.
	  Remove buffer inlining machinery.
	  (scm_bootstrap_bytevectors): Use `make_bytevector ()' for
	  SCM_NULL_BYTEVECTOR.

	* libguile/bytevectors.h (SCM_BYTEVECTOR_HEADER_SIZE): New macro.
	  (SCM_BYTEVECTOR_CONTENTS): Adjust to new layout.
	  (SCM_SET_BYTEVECTOR_FLAGS): Properly cast F.
	  (SCM_F_BYTEVECTOR_INLINE, SCM_BYTEVECTOR_INLINE_P): Remove.
	  (SCM_BYTEVECTOR_ELEMENT_TYPE): Adjust.
	  (scm_c_shrink_bytevector): Remove macro, make a C function
	  declaration.

2009-08-30  Ludovic Courtès  <ludo@gnu.org>

	Use a TC7 tag instead of a SMOB for bytevectors.
	* libguile/bytevectors.c (scm_tc16_bytevector): Remove.
	  (SCM_BYTEVECTOR_SET_LENGTH, SCM_BYTEVECTOR_SET_CONTENTS,
	  SCM_BYTEVECTOR_SET_INLINE, SCM_BYTEVECTOR_SET_ELEMENT_TYPE,
	  make_bytevector_from_buffer, scm_is_bytevector,
	  scm_bootstrap_bytevectors): Adjust to the SMOB->tc7 change.
	  (scm_i_print_bytevector): New, formerly `print_bytevector ()'.
	  (bytevector_equal_p): Remove.

	* libguile/bytevectors.h (SCM_BYTEVECTOR_LENGTH,
	  SCM_BYTEVECTOR_CONTENTS, SCM_BYTEVECTOR_P): Adjust to SMOB->tc7
	  change.
	  (SCM_BYTEVECTOR_FLAGS, SCM_SET_BYTEVECTOR_FLAGS): New macros.
	  (scm_tc16_bytevector): Remove declaration.
	  (scm_i_print_bytevector): New declaration.

	* libguile/eq.c (scm_equal_p): Handle `scm_tc7_bytevector'.

	* libguile/evalext.c (scm_self_evaluating_p): Likewise.

	* libguile/print.c (iprin1): Likewise.

	* libguile/tags.h (scm_tc7_bytevector): New.
	  (scm_tc7_unused_8): Remove.

	* libguile/validate.h (SCM_VALIDATE_BYTEVECTOR): Adjust.

	* test-suite/tests/bytevectors.test ("Datum
	  Syntax")["self-evaluating?"]: New test.

2009-08-30  Neil Jerram  <neil@ossau.uklinux.net>

	Export readline history functions
	* guile-readline/ice-9/readline.scm: Export history functions.

2009-08-29  Michael Gran  <spk121@yahoo.com>

	Range check octal-escaped characters
	* libguile/read.c (scm_read_character): range check octal escapes

	More tests for chars.test
	Testing out-of-range octals, bad charnames, and write format

	* test-suite/tests/chars.test

	More tests for chars.test
	* test-suite/tests/chars.test: more tests

	Surrogate characters shouldn't be in charsets
	* libguile/srfi-14.c (charsets_complement): use surrogate #defines instead
	  of hardcoded numbers

	* libguile/srfi-14.i.c (cs_full_ranges): remove surrogates from full
	  charset

	* libguile/unidata_to_charset.pl (full): test for surrogates

	Better range check for codepoints
	* libguile/chars.h (SCM_IS_UNICODE_CHAR): check for negative codepoints

	Cast the input to isalpha et al to integer
	* libguile/gc_os_dep.c (GC_linux_stack_base) [LINUX_STACKBOTTOM]: cast
	  input of ctype functions to int

	* libguile/inet_aton.c (inet_aton): cast input of ctype functions to int

	* libguile/read.c (scm_scan_for_encoding): cast input of isalnum to int

	* libguile/win32-socket.c (scm_i_socket_uncomment): cast input of isspace
	  to int

2009-08-28  Ludovic Courtès  <ludo@gnu.org>

	Add `BDW_GC_CFLAGS' to the `.pc' files.
	This is needed because <gc/gc.h> is included in public headers (via
	<libguile/boehm-gc.h>.

	* meta/guile-2.0-uninstalled.pc.in (Cflags): Add `@BDW_GC_CFLAGS'.

	* meta/guile-2.0.pc.in (Cflags): Likewise.

	Remove deprecated variables/macros from the GC headers.
	* libguile/deprecated.c (scm_mtrigger, scm_mallocated,
	  scm_max_segment_size): New global variables, from gc.c.
	  (scm_map_free_list,
	  scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New stubs.

	* libguile/deprecated.h (scm_mallocated, scm_mtrigger,
	  scm_max_segment_size): New declarations.
	  (scm_map_free_list,
	  scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New
	  declarations.

	* libguile/gc-malloc.c (scm_i_minyield_malloc): Remove.
	  (scm_gc_init_malloc): Remove references to `scm_i_minyield_malloc' and
	  `scm_mtrigger'.

	* libguile/gc.c (scm_mtrigger, scm_mallocated): Remove.
	  (scm_init_storage): Remove reference to `SCM_HEAP_SEG_SIZE'.

	* libguile/gc.h (scm_max_segment_size, SCM_SET_FREELIST_LOC,
	  SCM_FREELIST_LOC, scm_i_master_freelist, scm_i_master_freelist2,
	  scm_mallocated, scm_mtrigger): Remove.
	  (scm_map_free_list,
	  scm_gc_set_debug_check_freelist_x)[SCM_ENABLE_DEPRECATED &&
	  GUILE_DEBUG_FREELIST]: Remove.

	* libguile/private-gc.h (SCM_DEFAULT_INIT_HEAP_SIZE_1,
	  SCM_DEFAULT_MIN_YIELD_1, SCM_DEFAULT_MIN_YIELD_2,
	  DEFAULT_SWEEP_AMOUNT, SCM_DEFAULT_MAX_SEGMENT_SIZE,
	  SCM_MIN_HEAP_SEG_SIZE, SCM_HEAP_SEG_SIZE,
	  SCM_GC_CARD_BVEC_SIZE_IN_LONGS, SCM_GC_IN_CARD_HEADERP): Remove.
	  (scm_getenv_int): Made internal.
	  (scm_i_marking, scm_mark_all, scm_i_deprecated_memory_return,
	  scm_i_find_heap_calls, scm_gc_init_malloc, scm_gc_init_freelist,
	  scm_gc_init_segments, scm_gc_init_mark): Remove declarations.

	* libguile/gc-segment-table.c: Remove, finally.

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/Makefile.am
		libguile/bytevectors.c
		libguile/gc-card.c
		libguile/gc-mark.c
		libguile/programs.c
		libguile/srcprop.c
		libguile/srfi-14.c
		libguile/symbols.c
		libguile/threads.c
		libguile/unif.c
		libguile/vm.c

2009-08-28  Andy Wingo  <wingo@pobox.com>

	fix case in which compiled path had stale .go, but fallback had fresh .go
	* libguile/load.c (scm_primitive_load_path): If the compiled path was
	  out of date, but the fallback path was current, we correctly detected
	  that case, but loaded the wrong file. So here fix the typo.

2009-08-28  Michael Gran  <spk121@yahoo.com>

	Don't presume existence or success of setlocale in test-suite
	* test-suite/lib.scm (with-locale, with-locale*): new test functions

	* test-suite/tests/encoding-escapes: don't fail if en_US.utf8 doesn't exist

	* test-suite/tests/encoding-iso88591.test: set and restore locale, if
	  possible

	* test-suite/tests/encoding-iso88597.test: set and restore locale, if
	  possible

	* test-suite/tests/encoding-utf8.test: set and restore locale, if possible

	* test-suite/tests/srfi-14.test: don't need to setlocale to Latin-1 to
	  test Latin-1 since string conversion is handled at read/compile time.
	  Set and restore locale, if possible.

	scm_getc improperly handles Latin-1 characters
	Upper-plane Latin-1 characters should be converted to codepoints.

	* libguile/ports.c (scm_getc): improper conversion of char to scm_t_wchar

	Fix FUNC_NAME definitions and #endif in srfi-14.[ch]
	* libguile/srfi-14.c: whitespace and FUNC_NAME fixes

	* libguile/srfi-14.h: #endif comment

	Script to generate srfi-14 charsets from UnicodeData.txt
	This script was used to generate srfi-14.i.c from the UnicodeData.txt
	file supplied by ftp://www.unicode.org/Public/UNIDATA/

	* libguile/unidata_to_charset.pl

2009-08-28  Neil Jerram  <neil@ossau.uklinux.net>

	Fix GDS utility client startup
	* emacs/gds-scheme.el (gds-start-utility-guile): Use buffer-local
	  variable gds-client instead of client, as client is actually unbound
	  when the process-filter lambda runs.  (i.e. This isn't Scheme code!)

2009-08-28  Ludovic Courtès  <ludo@gnu.org>

	Add missing `FUNC_NAME' definition.
	* libguile/load.c (scm_sys_warn_autocompilation_enabled): Define
	  `FUNC_NAME'.

2009-08-27  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'ossau-gds-dev'
	Conflicts:

		THANKS

	Fix doc of let*-values
	Thanks to Judy Hawkins for reporting this.

	* doc/ref/api-modules.texi (Included Guile Modules): Change
	  `let-values*' to `let*-values'.

	Make GDS resilient to autocompilation comments
	* emacs/gds-scheme.el (gds-start-utility-guile): Make the extraction
	  of client number more robust; in particular when the client emits
	  comments (about auto compilation) before the number.

	Incorporate ice-9-debugger-extensions properly
	i.e. put the extensions where they need to be, and delete
	ice-9-debugger-extensions.scm.

	* doc/ref/api-debug.texi (Single Stepping through a Procedure's Code):
	  Change mentions of (ice-9 debugging ice-9-debugger-extensions)
	  module to whatever is appropriate now (or just remove them).

	* module/Makefile.am (NOCOMP_SOURCES): Remove
	  ice-9-debugger-extensions.scm.

	* module/ice-9/debugger.scm (debug-trap): Move here from
	  ice-9-debugger-extensions.scm.

	* module/ice-9/debugger/command-loop.scm ("continue", "finish",
	  "step", "next"): Move here from ice-9-debugger-extensions.scm.

	* module/ice-9/debugger/commands.scm (assert-continuable, continue,
	  finish, step, next): Move here from ice-9-debugger-extensions.scm.

	* module/ice-9/debugging/breakpoints.scm: Don't use
	  ice-9-debugger-extensions module.

	* module/ice-9/debugging/ice-9-debugger-extensions.scm: Removed.

	* module/ice-9/debugging/trace.scm, module/ice-9/debugging/traps.scm:
	  Remove more old version code.

	* module/ice-9/debugging/traps.scm (guile-trap-features): Hardcoded as
	  '(tweaking).

	Remove superfluous ice-9-debugger-extensions code for old Guile versions
	* module/ice-9/debugging/ice-9-debugger-extensions.scm: Remove all
	  code checking for version < 1.7, and move code for versions >= 1.7
	  up to top level.  Comment out dummy mutex definitions for now, as
	  I'm not sure how to rewrite them correctly for psyntax.

2009-08-27  Daniel Kraft  <d@domob.eu>

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

	Support circular structures in elisp reader.
	* module/language/elisp/lexer.scm: Recognize circular markers.
	* module/language/elisp/parser.scm: Handle them correctly.
	* test-suite/tests/elisp-reader.test: Check circular structure parsing.

2009-08-27  Michael Gran  <spk121@yahoo.com>

	Default srfi-14 character set information
	* libguile/srfi-14.i.c: structures containing the default srfi-14
	  sets

2009-08-27  Daniel Kraft  <d@domob.eu>

	Replaced generated elisp parser with hand-written one to fix source properties.
	* module/language/elisp/parser.scm: Hand-written parser.
	* test-suite/tests/elisp-reader.test: Test for source properties.

2009-08-27  Michael Gran  <spk121@yahoo.com>

	Always cast input to toupper as int
	* libguile/read.c (scm_scan_for_encoding): add cast to int

	Segfault when writing non-Latin-1 characters under Latin-1 locale
	* libguile/print.c (iprin1): handle write of non-Latin-1 characters
	  under the Latin-1 locale

	Unicode-capable srfi-14 charsets
	* libguile/Makefile.am: distribute new files srfi-14.i.c and
	  unidata_to_charset.pl

	* chars.c (scm_c_upcase, scm_c_downcase): use unicode-enable toupper
	  and tolower

	* libguile/srfi-14.h (scm_t_char_range, scm_t_char_set): new structures
	  to describe char-sets
	  (scm_t_char_set_cursor): new structure to describe char-set-cursors
	  (SCM_BITS_PER_LONG): removed
	  (SCM_CHARSET_GET): calls function
	  New declarations for scm_i_charset_get, scm_i_charset_set,
	  scm_i_charset_unset, and scm_debug_char_set.

	* test-suite/tests/srfi-14.test: new tests

	* libguile/srfi-14.c (SCM_CHARSET_DATA): new macro
	  (SCM_CHARSET_SET, SCM_CHARSET_UNSET): call function
	  (BYTES_PER_CHARSET, LONGS_PER_CHARSET): removed
	  (scm_i_charset_get, scm_i_charset_set, scm_i_charset_unset)
	  (charsets_equal, charsets_leq, charsets_union)
	  (charsets_intersection, charsets_complement, charsets_xor): new
	  functions that are low-level charset operators
	  (charset_print, charset_free): modified for new charset struct
	  (charset_cursor_print, charset_cursor_free): new function
	  (make_char_set, scm_char_set_p, scm_char_set_eq, scm_car_set_leq)
	  (scm_char_set_hash, scm_char_set_cursor, scm_char_set_ref)
	  (scm_char_set_cursor_next, scm_end_of_char_set_p, scm_char_set_fold)
	  (scm_char_set_unfold, scm_char_set_unfold_x, scm_char_set_for_each)
	  (scm_char_set_map, scm_char_set_copy, scm_char_set, scm_list_to_char_set)
	  (scm_list_to_char_set_x, scm_string_to_char_set, scm_string_to_char_set_x)
	  (scm_char_set_filter, scm_char_set_filter_x, scm_ucs_range_to_char_set)
	  (scm_ucs_range_to_char_set_x, scm_to_char_set, scm_char_set_size)
	  (scm_char_set_count, scm_char_set_to_list, scm_char_set_to_string)
	  (scm_char_set_contains_p, scm_char_set_every, scm_char_set_any)
	  (scm_char_set_adjoin, scm_char_set_delete, scm_char_set_adjoin_x)
	  (scm_char_set_delete_x, scm_char_set_complement, scm_char_set_union)
	  (scm_char_set_intersection, scm_char_set_difference, scm_char_set_xor)
	  (scm_char_set_diff_plus_intersection, scm_char_set_complement_x)
	  (scm_char_set_union_x, scm_char_set_intersection_x, scm_char_set_difference_x)
	  (scm_char_set_xor_x, scm_char_set_diff_plus_intersection_x): modified
	  to use new charset and charset-cursor data structures
	  (CSET_BLANK_PRED, CSET_SYMBOL_PRED, CSET_PUNCT_PRED, CSET_LOWER_PRED)
	  (CSET_UPPER_PRED, CSET_LETTER_PRED, CSET_DIGIT_PRED, CSET_WHITESPACE_PRED)
	  (CSET_CONTROL_PRED, CSET_HEX_DIGIT_PRED, CSET_ASCII_PRED, CSET_LETTER_PRED)
	  (CSET_LETTER_AND_DIGIT_PRED, CSET_PRINTING_PRED, CSET_TRUE_PRED)
	  (CSET_FALSE_PRED): removed
	  (scm_srfi_14_compute_char_sets): removed - too slow to iterate
	  over all of unicode at startup
	  (scm_debug_char_set) [SCM_CHARSET_DEBUG]: new function

2009-08-27  Daniel Kraft  <d@domob.eu>

	Don't accept backquote/unquote/unquote-splicing any longer in elisp.
	The real names \`, \, and \,@ should be used instead and are returned
	now by the real reader.

	* module/language/elisp/compile-tree-il.scm: Only accept correct names.

2009-08-27  Andy Wingo  <wingo@pobox.com>

	Revert "eval is actually compile"
	This reverts commit afe5e6baa76796b1467890fd55416a7f304bed5c.

2009-08-27  Ken Raeburn  <raeburn@raeburn.org>

	Don't leave and reenter guile mode if mutex is available
	On Aug 5, 2009, at 10:06, Ken Raeburn wrote:
	> (1) In scm_pthread_mutex_lock, we leave and re-enter guile mode so
	> that we don't block the thread while in guile mode.  But we could
	> use pthread_mutex_trylock first, and avoid the costs scm_leave_guile
	> seems to incur on the Mac.  If we can't acquire the lock, it should
	> return immediately, and then we can do the expensive, blocking
	> version.  A quick, hack version of this changed my run time for
	> A(3,8) from 17.5s to 14.5s, saving about 17%; sigaltstack and
	> sigprocmask are still in the picture, because they're called from
	> scm_catch_with_pre_unwind_handler.  I'll work up a nicer patch
	> later.

	Ah, we already had scm_i_pthread_mutex_trylock lying around; that made
	things easy.
	A second timing test with A(3,9) and this version of the patch (based
	on 1.9.1) shows the same improvement.

	* libguile/threads.c (scm_pthread_mutex_lock): Try the mutex before
	  leaving and reentering guile mode.

	Pick up in tree headers rather than installed ones
	From Ken Raeburn:

	The Mac build off of "master" fails for me currently in srfi-13.c,
	with the comparison-always-false warning Greg discussed.  I hacked
	around that, but then guile-readline doesn't build:

	Making all in guile-readline
	../libguile/guile-snarf -o readline.x ../../guile-readline/readline.c
	-
	DHAVE_CONFIG_H  -I. -I.. -I../../guile-readline/.. -I../../guile-
	readline/lib -I./lib  -g -O2
	In file included from ../../guile-readline/readline.c:29:
	../../guile-readline/../libguile.h:25:17: error: gmp.h: No such file
	or directory
	In file included from ../../guile-readline/../libguile.h:95,
	                 from ../../guile-readline/readline.c:29:
	../../guile-readline/../libguile/strings.h:26:21: error: uniconv.h: No
	such file or directory

	Neither the path specified for libgmp nor the path specified for
	libunistring at configure time is included here.

	I don't think any of this is Mac-specific; I'm surprised that it works
	on GNU/Linux systems.  Perhaps I'm building it in ways that are
	unusual for the other developers (build dir != src dir, libgmp and
	guile-1.8 installed in the same place, libgmp and libunistring
	installed in different nonstandard directories)?

	If I use CPPFLAGS=... and LDFLAGS=... instead of --with-libfoo-prefix
	configure options to specify paths to find libgmp and libunistring,
	the tests still pick old, installed Guile headers (which this time
	I've poisoned to highlight the problem) from those locations instead
	of the in-tree versions:

	Making all in test-suite
	Making all in standalone
	../../libguile/guile-snarf -o test-asmobs-lib.x ../../../test-suite/
	standalone/test-asmobs-lib.c -DHAVE_CONFIG_H
	-I. -I../../../test-suite/ standalone -I../.. -I/opt/local/include
	-I/Users/raeburn/dev/guile/ libunistring-0.9.1/I/include -g -O2
	-I../../.. -I../../../lib -I../../ lib -I../..
	In file included from /opt/local/include/libguile.h:30,
	                 from ../../../test-suite/standalone/test-asmobs-
	lib.c:23:
	/opt/local/include/libguile/__scm.h:3:2: error: #error Poison!

	I might be building Guile as part of a larger package
	(*cough*Emacs*cough*) that wants to include stuff from the same system
	directories (e.g., for MacPorts, pkgsrc, whatever) where an old
	version of Guile is installed, and thus Guile gets passed CPPFLAGS/
	LDFLAGS settings that add that old version to the search paths.  So I
	think the CPPFLAGS/LDFLAGS version needs to be made to work, as well
	as the --with-libfoo-prefix version.

	With the attached patch, I can get guile to build with CPPFLAGS= and
	LDFLAGS= ... someone more familiar than I am with automake will have
	to fix the guile-readline stuff.

2009-08-26  Daniel Kraft  <d@domob.eu>

	Error in lexer when 'empty' symbol would have been read.

	Parser for elisp and use it as reader.
	* module/language/elisp/parser.scm: New parser file.
	* module/language/elisp/lexer.scm: Fix lexer/1 and add unquote-splicing support.
	* module/language/elisp/spec.scm: Use new elisp-reader.
	* module/language/elisp/README: Document we've got a reader now.
	* test-suite/tests/elisp-reader.test: Test the parser.

	get-lexer/1 for elisp that finishes after the first full expression is read.
	* module/language/elisp/lexer.scm: Add get-lexer/1.
	* test-suite/tests/elisp-reader.test: Test lexer/1.

	Character and string literal support for the elisp lexer.
	* module/language/elisp/lexer.scm: Handle character and string literals.
	* test-suite/tests/elisp-reader.test: Test it.

	A first, rough lexer for elisp still missing some stuff.
	* module/language/elisp/lexer.scm: New lexer file.
	* test-suite/Makefile.am: Register elisp-reader.test as new test.
	* test-suite/tests/elisp-reader.test: New test-case.

2009-08-26  Andy Wingo  <wingo@pobox.com>

	fix uninitialized variable in scm_read_character
	* libguile/read.c (scm_read_character): Fix uninitialized variable.

	actually install guile-tools
	* meta/Makefile.am (bin_SCRIPTS): Re-add guile-tools here (removed in
	  54b38caf19deb0e5a6e8146c65b3e176e7fffa60). Otherwise guile-tools
	  doesn't get installed. I think that 1.9.2 had this bug.

	fix guile-readline linker bug
	* acinclude.m4 (GUILE_READLINE): Fix typo that caused readline not to be
	  linked to termcap.

2009-08-25  Ludovic Courtès  <ludo@gnu.org>

	Remove the `scm_tc_free_cell' SMOB type.
	* libguile/deprecated.h (SCM_FREEP, SCM_NFREEP): Changed to constants.

	* libguile/gc.c (scm_i_tag_name): Remove reference to
	  `scm_tc_free_cell'.

	* libguile/gc.h (SCM_FREE_CELL_CDR, SCM_SET_FREE_CELL_CDR): Remove.

	* libguile/smob.c (free_print): Remove.
	  (scm_smob_prehistory): Don't create the "free" SMOB type.

	* libguile/struct.c (struct_finalizer_trampoline): Use a bare
	  `scm_tc3_struct' tag for finalized structs instead of
	  `scm_tc_free_cell'.

	* libguile/tags.h (scm_tc_free_cell): Remove.

2009-08-25  Andy Wingo  <wingo@pobox.com>

	Merge commit 'origin/master'
	Conflicts:
		libguile/unif.c

	Merge wip-array refactor, up to cd43fdc5b7a7c
	Conflicts:
		NEWS
		libguile/print.c

2009-08-25  Michael Gran  <spk121@yahoo.com>

	Add full Unicode capability to ports and the default reader
	Ports are given two additional properties: a character encoding and
	a conversion failure strategy.  These properties have getters and setters.
	The new properties are used to convert any locale text to/from the
	internal representation of strings.

	If unspecified, ports use a default value. The default value of these
	properties is held in a fluid.  The default character encoding can be
	modified by calling setlocale.

	ISO-8859-1 is treated specially.  Since it is a native encoding of
	strings, it can be processed more quickly.  Source code is assumed to be
	ISO-8859-1 unless otherwise specified.  The encoding of a source code
	file can be given as 'coding: XXXXX' in a magic comment at the top of a
	file.

	The C functions that deal with encoding often use a null pointer
	as shorthand for the native Latin-1 encoding, for efficiency's sake.

	* test-suite/tests/encoding-iso88591.test: new tests
	* test-suite/tests/encoding-iso88597.test: new tests
	* test-suite/tests/encoding-utf8.test: new tests
	* test-suite/tests/encoding-escapes.test: new tests
	* test-suite/tests/numbers.test: declare 'binary' encoding
	* test-suite/tests/ports.test: declare 'binary' encoding
	* test-suite/tests/r6rs-ports.test: declare 'binary' encoding

	* module/system/base/compile.scm (compile-file): use source-code
	  file's self-declared encoding when compiling files

	* libguile/strports.c: store string ports in locale encoding
	  (scm_strport_to_locale_u8vector, scm_call_with_output_locale_u8vector)
	  (scm_open_input_locale_u8vector, scm_get_output_locale_u8vector):
	  new functions

	* libguile/strings.h: new declaration for scm_i_string_contains_char

	* libguile/strings.c (scm_i_string_contains_char): new function
	  (scm_from_stringn, scm_to_stringn):  use NULL for Latin-1
	  (scm_from_locale_stringn, scm_to_locale_stringn): respect character
	  encoding of input and output ports

	* libguile/read.h: declaration for scm_scan_for_encoding

	* libguile/read.c:
	  (read_token): now takes scheme string instead of C string/length
	  (read_complete_token): new function
	  (scm_read_sexp, scm_read_number, scm_read_mixed_case_symbol)
	  (scm_read_number_and_radix, scm_read_quote, scm_read_semicolon_comment)
	  (scm_read_srfi4_vector, scm_read_bytevector, scm_read_guile_bit_vector)
	  (scm_read_scsh_block_comment, scm_read_commented_expression)
	  (scm_read_extended_symbol, scm_read_sharp_extension, scm_read_shart)
	  (scm_read_expression): use scm_t_wchar for char type, use read_complete_token
	  (scm_scan_for_encoding): new function to find a file's character encoding
	  (scm_file_encoding): new function to find a port's character encoding

	* libguile/rdelim.c: don't unpack strings

	* libguile/print.h: declaration for modified function
	  scm_i_charprint

	* libguile/print.c: use locale when printing characters and
	  strings
	  (scm_i_charprint): input parameter is now scm_t_wchar
	  (scm_simple_format): don't unpack strings

	* libguile/posix.h: new declaration for scm_setbinary.

	* libguile/posix.c (scm_setlocale): set default and stdio port
	  encodings based on the locale's character encoding
	  (scm_setbinary): new function

	* libguile/ports.h (scm_t_port): add encoding and failed
	  conversion handler to port type.  Declarations for new or modified
	  functions scm_getc, scm_unget_byte, scm_ungetc,
	  scm_i_get_port_encoding, scm_i_set_port_encoding_x,
	  scm_port_encoding, scm_set_port_encoding_x,
	  scm_i_get_conversion_strategy, scm_i_set_conversion_strategy_x,
	  scm_port_conversion_strategy, scm_set_port_conversion_strategy_x.

	* libguile/ports.c: assign the current ports to zero on startup so
	  we can see if they've been set.
	  (scm_current_input_port, scm_current_output_port,
	  scm_current_error_port): return #f if the port is not yet
	  initialized
	  (scm_new_port_table_entry): set up a new port's encoding and
	  illegal sequence handler based on the thread's current defaults
	  (scm_i_remove_port): free port encoding name when port is removed
	  (scm_i_mode_bits_n): now takes a scheme string instead of a c
	  string and length.  All callers changed.
	  (SCM_MBCHAR_BUF_SIZE): new const
	  (scm_getc): new function, since the scm_getc in inline.h is now
	  scm_get_byte_or_eof.  This pulls one codepoint from a port.
	  (scm_lfwrite_substr, scm_lfwrite_str): now uses port's encoding
	  (scm_unget_byte): new function, incorportaing the low-level functionality
	  of scm_ungetc
	  (scm_ungetc): uses scm_unget_byte

	* libguile/numbers.h (scm_t_wchar): compilation order problem with
	  scm_t_wchar being use in functions in multiple headers.  Forward
	  declare scm_t_wchar.

	* libguile/load.c (scm_primitive_load): scan for file encoding at
	  top of file and use it to set the load port's encoding

	* libguile/inline.h (scm_get_byte_or_eof): new function
	  incorporating most of the functionality of scm_getc.

	* libguile/fports.c (fport_fill_input): now returns scm_t_wchar

	* libguile/chars.h (scm_t_wchar): avoid compilation order problem
	  with declaration of scm_t_wchar

2009-08-23  Michael Gran  <spk121@yahoo.com>

	Avoid unpacking symbols in GOOPS
	* libguile/goops.c (scm_make_extended_class_from_symbol): new function
	  (scm_class_of): don't unpack symbol chars
	  (wrap_init): don't unpack symbol chars
	  (make_class_from_symbol): new function
	  (make_struct_class): don't unpack symbol chars

	Modify socket and time functions for wide strings
	* libguile/socket.c (scm_recv): receive the message without holding the
	  stringbuf writing lock
	  (scm_send): try to narrow a string before using it

	* libguile/stime.c (strftime): convert string to UTF-8 so that it can
	  be safely passed to strftime
	  (strptime): convert input string to UTF-8 so that it can be safely
	  passed through strptime

	* libguile/strings.c (narrow_stringbuf): new function
	  (scm_i_try_narrow_string): new function

	* libguile/strings.h: new declaration for scm_i_try_narrow_string

	Use string and symbol accessors in struct, throw, and array funcs
	* libguile/struct.c (scm_make_struct_layout, scm_struct_init)
	  (scm_struct_vtable_p, scm_struct_ref, scm_struct_set_x): use string
	  and symbol accessors and avoid unpacking strings and symbols

	* libguile/throw.c (scm_ithrow): allow wide symbols in the error message

	* libguile/unif.c (scm_enclose_array, scm_istr2bve): use string
	  accessors and avoid unpacking strings

	Avoid type-punning warning in scm_gentemp
	Int and size_t may not have the same storage size

	* libguile/deprecated.c (scm_gentemp): use size_t for string length

2009-08-21  Neil Jerram  <neil@ossau.uklinux.net>

	Update NEWS

2009-08-22  Neil Jerram  <neil@ossau.uklinux.net>

	Avoid clash with system setjmp/longjmp on IA64
	Problem was that if an application includes both libguile.h and the
	system's setjmp.h, and is compiled on IA64, it gets compile errors
	because of jmp_buf, setjmp and longjmp being multiply defined.

	* libguile/__scm.h (__ia64__): Define scm_i_jmp_buf, SCM_I_SETJMP and
	  SCM_I_LONGJMP instead of jmp_buf, setjmp and longjmp.

	  (all other platforms): Map scm_i_jmp_buf, SCM_I_SETJMP and
	  SCM_I_LONGJMP to jmp_buf, setjmp and longjmp.

	* libguile/continuations.c (scm_make_continuation): Use `SCM_I_SETJMP'
	  instead of `setjmp'.
	  (copy_stack_and_call): Use `SCM_I_LONJMP' instead of `longjmp'.
	  (scm_ia64_longjmp): Use type `scm_i_jmp_buf' instead of `jmp_buf'.

	* libguile/continuations.h (scm_t_contregs): Use type `scm_i_jmp_buf'
	  instead of `jmp_buf'.

	* libguile/threads.c (suspend): Use `SCM_I_SETJMP' instead of
	  `setjmp'.

	* libguile/threads.h (scm_i_thread): Use type `scm_i_jmp_buf' instead
	  of `jmp_buf'.

	* libguile/throw.c (JBJMPBUF, make_jmpbuf, jmp_buf_and_retval): Use
	  type `scm_i_jmp_buf' instead of `jmp_buf'.
	  (scm_c_catch): Use `SCM_I_SETJMP' instead of `setjmp'.
	  (scm_ithrow): Use `SCM_I_LONGJMP' instead of `longjmp'.

	Remove trailing whitespace

	Fix set-source-properties so that the special source properties work
	* libguile/srcprop.c (scm_set_source_properties_x): Look for the special
	  source properties, save them off, and then construct a srcprops object
	  using them.

	In srcprop.c change all occurrences of "plist" to "alist"
	As with the previous commit, this is to avoid any suggestion that
	the source properties API uses the property list format, i.e.
	(key1 value1 key2 value2 ...).

	Also remove scm_srcprops_to_plist () from the API.  It doesn't have any
	external usefulness and has never documented.

	Minor improvements to doc on source properties
	In particular avoid any suggestion that the API uses the
	property list format, i.e. (key1 value1 key2 value2 ...),
	as opposed to the alist format that it actually does use.

2009-08-21  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'wip-manual' of ssh://ossau@git.sv.gnu.org/srv/git/guile
	Conflicts:

		doc/ref/autoconf.texi
		doc/ref/vm.texi

2009-08-21  Michael Gran  <spk121@yahoo.com>

	Use uc_tolower in number conversion
	* libguile/numbers.c (XDIGIT2UINT): use uc_tolower

	Use string accessors for string->number conversion
	* libguile/numbers.c (scm_i_print_fraction): use string accessors
	  (XDIGIT2UINT): use libunistring function
	  (mem2uinteger, mem2integer, mem2decimal_from_point, mem2ureal)
	  (mem2complex): take scheme string instead of c string; use accessors
	  (scm_i_string_to_number): new function
	  (scm_c_locale_string_to_number): use scm_i_string_to_number

	* libguile/numbers.h: declaration for scm_i_string_to_number

	* libguile/strings.c (scm_i_string_strcmp): new function

	* libguile/strings.h: declaration for scm_i_string_strcmp

	Add initial support for wide symbols
	* libguile/hash.c (scm_i_string_hash): new function
	  (scm_hasher): don't unpack string: use scm_i_string_hash

	* libguile/hash.h: new declaration for scm_i_string_hash

	* libguile/print.c (quote_keywordish_symbol): use symbol accessors
	  (scm_i_print_symbol_name): new function
	  (scm_print_symbol_name): call scm_i_print_symbol_name
	  (iprin1): use scm_i_print_symbol_name to print symbols

	* libguile/print.h: new declaration for scm_i_print_symbol_name

	* libguile/symbols.c (lookup_interned_symbol): now takes scheme string
	  instead of c string; callers changed
	  (lookup_interned_symbol): add wide symbol support
	  (scm_i_c_mem2symbol): removed
	  (scm_i_mem2symbol): removed and replaced with scm_i_str2symbol
	  (scm_i_str2symbol): new function
	  (scm_i_mem2uninterned_symbol): removed and replaced with
	  scm_i_str2uninterned_symbol
	  (scm_i_str2uninterned_symbol): new function
	  (scm_make_symbol, scm_string_to_symbol, scm_from_locale_symbol)
	  (scm_from_locale_symboln): use scm_i_str2symbol

	* test-suite/tests/symbols.test: new tests

	Use symbol accessors in scm_gc_mark_dependencies
	* libguile/gc-mark.c (scm_gc_mark_dependencies): don't unpack symbols.
	  Use symbol accessors.

	Use string accessors in scm_basename and scm_dirname
	* libguile/filesys.c (basename, dirname): don't unpack strings.
	  Use string accessor functions.

	Avoid type-limits warning in SCM_TO_TYPE_PROTO
	* libguile/conv-uinteger.i.c (SCM_TO_TYPE_PROTO): avoid a comparison
	  that is always true due to the limited range of the data type

	Type-limits error in GC environment initialization
	* libguile/gc-malloc.c (scm_gc_init_malloc): GUILE_INIT_MALLOC_LIMIT
	  is cast to unsigned then tested as if it were still signed

	Avoid accessing symbol internals in call_dsubr_1 and DEVAL
	The symbol's characters are only accessed in case they are needed
	for an error message.  This can be avoided by passing the symbol
	all the way to a error message function.

	* libguile/__scm.h (SCM_WTA_DISPATCH_1_SUBR): new macro

	* libguile/error.c (scm_i_wrong_type_arg_symbol): new error function

	* libguile/error.h: declaration of scm_i_wrong_type_arg_symbol

	* libguile/eval.c (call_dsubr_1): use new macro SCM_WTA_DISPATCH_1_SUBR
	  to avoid having to unpack the symbol's chars

	* libguile/eval.i.c: use new macro SCM_WTA_DISPATCH_1_SUBR

	Use string and symbol accessors with obarrays and keyword-dash-symbols
	* libguile/deprecated.c (intern_obarray_soft): new function
	  (scm_intern_obarray_soft, scm_string_to_obarray_symbol): use
	  intern_obarray_soft
	  (scm_gentemp): don't unpack string chars, use intern_obarray_soft

	* libguile/discouraged.c (scm_make_keyword_from_dash_symbol): use
	  symbol accessor

2009-08-21  Ludovic Courtès  <ludo@gnu.org>

	Aggregate `guile-readline' makefiles.
	* configure.ac: Don't produce `guile-readline/ice-9/Makefile'.

	* guile-readline/Makefile.am (SUBDIRS): Remove.
	  (ice9dir, nobase_ice9_DATA): New, formerly under `ice-9'.
	  (ETAGS_ARGS, EXTRA_DIST): Augment.
	  (DEFS): Move outside of `if'.
	  (MKDEP): Remove.

	* guile-readline/ice-9/Makefile.am: Remove.

	Don't use a sub-`configure' for `guile-readline'.
	* acinclude.m4 (GUILE_READLINE): New macro, based on the former
	  `guile-readline/configure.ac'.

	* configure.ac: Remove `AC_CONFIG_SUBDIRS' invocation.  Add
	  `GUILE_READLINE' invocation.  Produce files under `guile-readline'.

	* guile-readline/Makefile.am: Conditionalize the meat under
	  `HAVE_READLINE'.
	  (INCLUDES): Rename to...
	  (AM_CPPFLAGS): this.  Users updates.
	  (AM_CFLAGS): New variable.
	  (libguilereadline_v_@LIBGUILEREADLINE_MAJOR@_la_LIBADD): Add
	  $(READLINE_LIBS).

	* guile-readline/readline.c: Include <config.h>.

	* guile-readline/configure.ac, guile-readline/autogen.sh: Remove.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	eval is actually compile
	* module/ice-9/boot-9.scm (eval): Here at the tail of boot-9, replace
	  the root definition of `eval' with a procedure that will call
	  `compile'.

	* test-suite/tests/syntax.test ("top-level define"):
	  ("internal define"): Run unmemoization tests in the interpreter, using
	  primitive-eval.

	programs have their own tc7 now
	* libguile/tags.h (scm_tc7_program):
	* libguile/programs.h: Programs now have their own tc7 code. Fix up the
	  macros appropriately.

	* libguile/programs.c: Remove smobby bits, leaving marking, printing,
	  and application for other parts of Guile.

	* libguile/debug.c (scm_procedure_source):
	* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
	  (scm_trampoline_2): Add cases for tc7_program.
	* libguile/eval.i.c (CEVAL, SCM_APPLY):
	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/gc-card.c (scm_i_sweep_card, scm_i_tag_name):
	* libguile/gc-mark.c (1):
	* libguile/print.c (iprin1):
	* libguile/procs.c (scm_procedure_p, scm_thunk_p)
	* libguile/vm-i-system.c (make-closure): Adapt to new procedure
	  representation.

	* libguile/procprop.c (scm_i_procedure_arity): Do the right thing for
	  programs.
	* test-suite/tests/procprop.test ("procedure-arity"): Arity test now
	  succeeds.

	* libguile/goops.c (scm_class_of): Programs now belong to the class
	  <procedure>, not a smob class.

	* libguile/vm.h (struct vm, struct vm_cont):
	* libguile/vm-engine.c (vm_engine):
	* libguile/frames.h (SCM_FRAME_BYTE_CAST, struct vm_frame):
	* libguile/frames.c (scm_c_make_vm_frame): Fix usages of scm_byte_t,
	  changing them to scm_t_uint8.

	eval-elisp uses primitive-eval
	* lang/elisp/interface.scm (eval-elisp): Use primitive-eval, as we will
	  be switching the evaluator soon.

	define @bind using syntax-case
	* module/ice-9/boot-9.scm (@bind): Define a VM-compatible syntax
	  definition for this old evaluator primitive.

	* test-suite/tests/dynamic-scope.test: Change the expected error
	  messages.

	use primitive-eval in run-vm-tests.scm
	* testsuite/run-vm-tests.scm (run-vm-tests): Use primitive-eval, as
	  we'll be changing eval soon.

	better VM error messages
	* libguile/vm-engine.c: Attempt to make error messages more friendly
	  and uniform with historical expectation.

	update docs for calling convention change
	* doc/ref/vm.texi: Update.

	push new frame on stack before procedure & args
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump

	* libguile/vm-engine.c (vm_engine): Push a frame corresponding to the
	  mv-call.

	* libguile/vm-i-system.c: Renumber ops.
	  (new-frame): New op, pushes a frame.
	  (call, mv-call): No need to shuffle args, though we do need to pop the
	  frame in the non-vm call case.
	  (goto/args): Inconsequential tweaks.
	  (call/cc): Push a frame if needed.

	* module/language/tree-il/compile-glil.scm (flatten): Emit `new-frame'
	  as appropriate.

	* test-suite/tests/tree-il.test: Fix to expect new-frame.

	reorder frame layout
	* libguile/frames.h: Reorder the frame layout so the return address
	  comes below the arguments.working
	  (SCM_FRAME_SET_RETURN_ADDRESS, SCM_FRAME_SET_MV_RETURN_ADDRESS): New
	  macros.

	* libguile/frames.c (scm_vm_frame_arguments): Use the macros to access
	  the arguments.

	* libguile/vm-engine.c (vm_engine): Fix for new calling convention.

	* libguile/vm-engine.h (INIT_FRAME): New macro. Does part of what
	  NEW_FRAME used to do.

	* libguile/vm-i-system.c (call, mv-call): Shuffle args up to make room
	  for the stack, and adapt to new calling convention.
	  (goto/args): Shuffling down is easier now.
	  (return, return/args): Adapt to new frame layout.

	* libguile/vm.c (vm_mark_stack): Adapt to new frame layout, and the
	  possibility of there being crap on the stack.
	  (really_make_boot_program): Remove extraneous comment.

	remove dead weight from vm-i-system.c
	* libguile/vm-i-system.c: Remove mark, list-mark, cons-mark,
	  vector-mark, and list-break, as they are no longer used.
	  (call, goto/args, mv-call): Remove bits about trampolines, which was
	  slower, and VM continuations, which are not used (we use Guile's
	  continuations as the applicable objects).

	  Renumber ops.

	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

	disable autocompilation in the test suite
	* check-guile.in: Disable autocompilation while working in the test
	  suite, for now at least. We'll enable it again later.

	autocompiled files before installation go to a cache dir in the builddir
	* libguile/load.c (scm_init_load_path): Append a slash after
	  XDG_CACHE_HOME.

	* meta/gdb-uninstalled-guile.in:
	* meta/guile.in (XDG_CACHE_HOME): Export this var so we write to a cache
	  within the build directory. Probably we should have a GUILE_CACHE_DIR
	  to be more specific, though.

	* Makefile.am (clean-local): Clear the cache when making clean.

2009-08-20  Michael Gran  <spk121@yahoo.com>

	type limits error in string-tabulate
	* libguile/srfi-13.c (scm_string_tabulate): test range of signed integer
	  before casting it to unsigned size_t

2009-08-20  Ludovic Courtès  <ludo@gnu.org>

	Relax assumptions made in the precise VM stack marking procedure.
	* libguile/vm.c (vm_stack_mark): Change assertions into checks to
	  determine whether VM points to a sane (initialized) object.  The
	  assumption previously was that free-list elements would be zeroed, as
	  implied by the comment in <gc/gc_mark.h>, but this doesn't appear to
	  be the case.

2009-08-20  Michael Gran  <spk121@yahoo.com>

	Update srfi-13 functions for Unicode
	* libguile/srfi-13.c (MY_SUBF_VALIDATE_SUBSTRING_SPEC): new macro
	  (MY_VALIDATE_SUBSTRING_SPEC_COPY): now unused, removed
	  (MY_VALIDATE_SUBSTRING_SPEC_UCOPY): now unused, removed
	  (REF_IN_CHARSET): new macro
	  (race_error)[0]: unused, removed
	  (scm_string_any, scm_string_every, scm_string_tabulate)
	  (scm_substring_to_list, scm_reverse_string_to_list)
	  (scm_reverse_list_to_string, scm_string_join)
	  (s_scm_srfi13_substring_copy, scm_string_copy, scm_string_copy_x)
	  (scm_string_pad, scm_string_pad_right, scm_string_trim)
	  (scm_string_trim_right, scm_string_trim_both, scm_substring_fill_x):
	  (scm_string_compare, scm_string_compare_ci): modified for
	  both wide and narrow strings
	  (compare_string): new function
	  (scm_string_eq, scm_string_neq, scm_string_lt, scm_string_gt)
	  (scm_string_le, scm_string_ge, scm_string_ci_eq, scm_string_ci_neq)
	  (scm_string_ci_lt, scm-string_ci_gt, scm_string_ci_le, scm_string_ci_gt)
	  (scm_substring_hash, scm_string_prefix_length, scm_string_suffix_length)
	  (scm_string_prefix_length_ci, scm_string_suffix_length_ci)
	  (scm_string_prefix_p, scm_string_prefix_ci_p, scm_string_suffix_p)
	  (scm_string_suffix_ci_p, scm_string_index, scm_string_index_right)
	  (scm_string_skip, scm_string_skip_right, scm_string_count)
	  (scm_string_contains, scm_string_contains_ci, string_upcase_x)
	  (scm_substring_upcase_x, scm_substring_upcase, string_downcase_x)
	  (scm_string_downcase_x, scm_string_downcase, scm_string_titlecase_x)
	  (scm_string_titlecase, scm_string_capitalize, scm_string_reverse)
	  (scm_string_reverse_x, scm_string_map, scm_string_map_x)
	  (scm_string_fold, scm_string_fold_right, scm_string_unfold)
	  (scm_string_unfold_right, scm_xsubstring, scm_string_xcopy_x)
	  (scm_string_replace, scm_string_tokenize, scm_string_split)
	  (scm_string_filter, scm_string_delete): modified for both wide and
	  narrow strings

	Some srfi-13 test with wide strings
	* test-suite/tests/srfi-13.test: more tests

	Updates to benchmarks for srfi-13
	Test more of the positive paths.  Add test for string-prefix-ci?
	string-suffix-ci? and string-hash-ci.  Update the counts per test
	to give approximately the same bench/interp time for each test for
	1.8.7.

	* benchmark-suite/benchmarks/srfi-13.bm: update benchmarks

	Avoid possible mutex hang on error message output
	Avoid possible mutex hang when scm_lfwrite_substr is used in error
	message output and when an error has caused the stringbuf write
	mutex to not be unlocked.  scm_lfwrite_substr makes a substring:
	making a substring requires that mutex.

	Hopefully, all cases of non-local jumps when the stringbuf write
	lock is held have been eliminated anyway, making this O.B.E.

	* libguile/ports.c (scm_lfwrite_str): include functionality in this
	  function instead of making this a special case of scm_lfwrite_substr

	Add VM exception in strings.test
	* test-suite/tests/strings.test (exception:wrong-type-arg): change regex

	Try to optimize scm_string for speed
	* libguile/strings.c (scm_string): optimize for speed

	Rename string-width to string-bytes-per-char
	* libguile/strings.h: rename scm_string_width to scm_string_bytes_per_char

	* libguile/strings.c (scm_string_width): renamed to scm_string_bytes_per_char
	  (scm_string_bytes_per_char): renamed from scm_string_width

	* module/language/assembly/compile-bytecode.scm (write-bytecode): string-width
	  -> string-bytes-per-char

	* module/language/glil/compile-assembly.scm (dump-object): string-width
	  -> string-bytes-per-char

	Misleading error message text in scm_i_string_writable_wide_chars
	* libguile/strings.c (scm_i_string_writable_wide_chars): change error text

2009-08-20  Ludovic Courtès  <ludo@gnu.org>

	Implement precise marking of the VM stack.
	Suggested by Andy Wingo.

	* libguile/vm.c (VM_ENABLE_PRECISE_STACK_GC_SCAN): New macro.
	  (vm_stack_gc_kind): New variable.
	  (make_vm)[VM_ENABLE_PRECISE_STACK_GC_SCAN]: Use `GC_generic_malloc ()'
	  to allocate the stack.
	  (vm_stack_mark): New function.
	  (scm_bootstrap_vm)[VM_ENABLE_PRECISE_STACK_GC_SCAN]: Initialize
	  `vm_stack_gc_kind'.

	Fix bogus computation of `vm->stack_limit'.
	* libguile/vm.c (make_vm): Remove bogus "- 3" when computing
	  `stack_size'.

	* libguile/vm-engine.h (CHECK_OVERFLOW): Change accordingly.

	Simplify the creation of the SMOB GC "kind".
	* libguile/smob.c (smob_freelist): Remove.
	  (scm_smob_prehistory): Adjust accordingly.

	Include "scmconfig.h" in <libguile/boehm-gc.h>.
	* libguile/boehm-gc.h: Use "scmconfig.h".  Check for
	  `SCM_USE_PTHREAD_THREADS', not `SCM_I_GSC_USE_PTHREAD_THREADS'.

2009-08-19  Andy Wingo  <wingo@pobox.com>

	procedure-documentation works on vm procedures
	* libguile/procs.c (scm_procedure_documentation): Add a hack so that
	  this function works for compiled procedures too.

2009-08-19  Michael Gran  <spk121@yahoo.com>

	Display wide strings using escapes
	* libguile/print.c (iprin1): for now, display wide strings
	  as escaped strings

	Avoid double-casts of stringbuf
	Conversion from char to scm_t_wchar require an intermediate cast to
	unsigned char.  By changing the return type of SCM_STRINGBUF_INLINE_CHARS
	to unsigned char *, doublecasts in the code can be avoided.  Also,
	some clarification of return types.

	* libguile/strings.c (STRINGBUF_OUTLINE_CHARS)
	(STRINGBUF_INLINE_CHARS): now returns unsigned char *; all callers changed.

	Avoid compilation warnings in SCM_MAKE_CHAR
	* libguile/chars.h (SCM_MAKE_CHAR): change inequality

	Benchmarks for common character and string procedures
	* benchmark-suite/benchmarks/chars.bm: new benchmarks

	* benchmark-suite/benchmarks/srfi-13.bm: new benchmarks

2009-08-19  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded `scm_without_guile ()' call.
	* libguile/scmsigs.c (read_without_guile_data, do_read_without_guile,
	  read_without_guile): Remove.
	  (signal_delivery_thread): Use read(2) instead of `read_without_guile ()'.

	Reinstate missing IA64 helper functions.
	* libguile/threads.c (scm_ia64_register_backing_store_base,
	  scm_ia64_ar_bsp): New, formerly in `gc.c', which was removed in the
	  BDW-GC branch.

2009-08-18  Ludovic Courtès  <ludo@gnu.org>

	Use `scm_gc_malloc_pointerless ()' for bytevectors.
	* libguile/bytevectors.c (make_bytevector): Use
	  `scm_gc_malloc_pointerless ()' for the buffer itself.

	* libguile/r6rs-ports.c (scm_get_bytevector_some,
	  scm_get_bytevector_all, bop_buffer_grow): Likewise.

2009-08-18  Andy Wingo  <wingo@pobox.com>

	remove (ice-9 lineio)'s dependency on (ice-9 readline)
	* module/ice-9/lineio.scm: Use (ice-9 rdelim) instead of (ice-9
	  readline) to remove readline dependency.

	`load' autocompiles
	* libguile/load.h:
	* libguile/load.c (scm_sys_warn_autocompilation_enabled): New primitive,
	  not exported. Since `load' autocompiles now, it should warn in the
	  same way that the bits hardcoded into C warn.
	  (scm_try_autocompile): Use scm_sys_warn_autocompilation_enabled.

	* module/ice-9/boot-9.scm (autocompiled-file-name): New helper.
	  (load): Try autocompiling the argument, if appropriate. Will
	  autocompile files passed on Guile's command line. `primitive-load' is
	  unaffected.

2009-08-18  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded SMOB mark/free procedures.
	* libguile/bytevectors.c (free_bytevector): Remove.
	  (scm_bootstrap_bytevectors): Update accordingly.

	* libguile/r6rs-ports.c (bip_mark, cbp_mark, bop_free, bop_proc_mark):
	  Remove.
	  (initialize_bytevector_input_ports,
	  initialize_custom_binary_input_ports,
	  initialize_bytevector_output_ports,
	  initialize_custom_binary_output_ports): Update accordingly.

	Fix malloc/scm_c_take_bytevector mismatch.
	* libguile/bytevectors.c (STRING_TO_UTF): Use `make_bytevector ()'
	  instead of `scm_c_take_bytevector ().
	  (scm_string_to_utf8): Likewise.

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		lib/Makefile.am
		libguile/Makefile.am
		libguile/frames.c
		libguile/gc-card.c
		libguile/gc-freelist.c
		libguile/gc-mark.c
		libguile/gc-segment.c
		libguile/gc_os_dep.c
		libguile/load.c
		libguile/macros.c
		libguile/objcodes.c
		libguile/programs.c
		libguile/strings.c
		libguile/vm.c
		m4/gnulib-cache.m4
		m4/gnulib-comp.m4
		m4/inline.m4

2009-08-17  Ludovic Courtès  <ludo@gnu.org>

	Thanks, Mike.

	Update `NEWS' for commit d8dd381fa781c236ae777ca1ac55b73d3ca91c2a.

2009-08-15  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 1.9.2.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

	Turn off auto-compilation to stand-alone tests.
	* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Add
	  "GUILE_AUTO_COMPILE=0".

	Update the manual and `NEWS' regarding `guile-2.0.pc'.
	* NEWS: Mention `guile-2.0.pc'.

	* doc/ref/autoconf.texi (Autoconf Macros): Update to `guile-2.0'.

	Add proper `--help' and `--version' for `guile-tools compile'.
	* configure.ac: Produce `meta/guile-tools'.

	* meta/Makefile.am (EXTRA_DIST): Add `guile-tools.in'.
	  (bin_SCRIPTS): Remove `guile-tools'.

	* meta/uninstalled-env.in (PATH): Add "${top_builddir}/meta".

	* module/scripts/compile.scm (%options): Add `--version'.
	  (parse-args): Show the offending option name upon error.
	  (show-version): New.
	  (compile): Use `%guile-bug-report-address'.

2009-08-15  Andy Wingo  <wingo@pobox.com>

	update NEWS for 1.9.2
	* NEWS: Update.

2009-08-15  Ludovic Courtès  <ludo@gnu.org>

	Update `.gitignore' for GNU Global.

	Switch from `guile-1.8.pc' to `guile-2.0.pc'.
	* configure.ac: Produce guile-2.0*.pc.

	* meta/Makefile.am (EXTRA_DIST): Rename guile-1.8*.pc.in to
	  guile-2.0*.pc.in.
	  (pkgconfig_DATA): Update accordingly.

	* meta/guile-config (guile-module): Likewise.

2009-08-13  Ludovic Courtès  <ludo@gnu.org>

	Uncomment run-time objcode alignment check.
	This should now work thanks to the changes in
	28b119ee3da0f4b14cb87e638794d22843778cda ("make sure all programs are
	8-byte aligned").  This commit is a follow-up to
	ec99fe8ecb412e49e8e981246eb62ca46b32754b ("Add FIXMEs about misaligned
	objcode-metas.").

	* libguile/objcodes.c (scm_c_make_objcode_slice): Uncomment assertion
	  that checks for proper alignment of PTR.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Update
	  comment about META's alignment.

	Remove deprecated semi-public memoizers.
	* libguile/eval.c (scm_m_expand_body, scm_macroexp, scm_unmemocar):
	  Remove.
	  (scm_m_undefine): Make `static'.

	* libguile/eval.h (scm_m_undefine, scm_m_expand_body, scm_unmemocar,
	  scm_macroexp): Remove declarations.

	Make the evaluator's memoizers private.
	* libguile/eval.c (macroexp): Move upwards.
	  (scm_m_quote, scm_m_begin, scm_m_if, scm_m_set_x, scm_m_and, scm_m_or,
	  scm_m_case, scm_m_cond, scm_m_lambda, scm_m_letstar, scm_m_do,
	  scm_m_quasiquote, scm_m_delay, scm_m_generalized_set_x,
	  scm_m_define, scm_m_letrec, scm_m_let, scm_m_at, scm_m_atat,
	  scm_m_apply, scm_m_cont, scm_m_nil_cond, scm_m_atfop,
	  scm_m_atbind, scm_m_atslot_ref, scm_m_atslot_set_x,
	  scm_m_at_call_with_values, scm_m_eval_when): New static
	  declarations; definitions made static.
	  (s_atslot_ref, s_atslot_set_x): New, from `goops.c'.

	* libguile/eval.h (scm_m_quote, scm_m_begin, scm_m_if, scm_m_set_x,
	  scm_m_vref, scm_m_vset, scm_m_and, scm_m_or, scm_m_case, scm_m_cond,
	  scm_m_lambda, scm_m_letstar, scm_m_do, scm_m_quasiquote, scm_m_delay,
	  scm_m_generalized_set_x, scm_m_future, scm_m_define, scm_m_letrec,
	  scm_m_let, scm_m_at, scm_m_atat, scm_m_apply, scm_m_cont,
	  scm_m_nil_cond, scm_m_atfop, scm_m_atbind, scm_m_atslot_ref,
	  scm_m_atslot_set_x, scm_m_atdispatch, scm_m_at_call_with_values,
	  scm_m_eval_when): Remove public declarations.

	* libguile/goops.c (s_atslot_ref, s_atslot_set_x): Remove.

	compiler.test: Enforce evaluation order.
	* test-suite/tests/compiler.test ("psyntax")["redefinition", "compile in
	  current module", "compile in fresh module"]: Use `begin' to enforce
	  evaluation order.  Thanks Andy!

	Allow fresh modules to be passed to `compile'.
	* module/ice-9/boot-9.scm (module-name): When making MOD non-anonymous,
	  bind it in the `(%app modules)' name space.

	* test-suite/tests/compiler.test ("psyntax")["compile in current
	  module", "compile in fresh module"]: New tests.

	* test-suite/tests/modules.test ("foundations")["modules don't remain
	  anonymous"]: New test.

	Allow redefinitions in compiled code as in `(define round round)'.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	* module/ice-9/psyntax.scm (chi-top)[define-form]: If a same-named
	  imported variable exists, take its value instead of `#f'.

	* test-suite/tests/compiler.test ("psyntax")["redefinition"]: New tests.

2009-08-12  Andy Wingo  <wingo@pobox.com>

	update docs for recent vm/compiler work
	* doc/ref/compiler.texi:
	* doc/ref/vm.texi: Update for recent changes.
	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  Don't print nops, they are distracting.

	"fix" <let>-bound lambda expressions too
	* module/language/tree-il/compile-glil.scm (compile-glil): Compute
	  warnings before optimizing, as unreferenced variables will be
	  optimized out.

	* libguile/_scm.h: Fix C99 comment.

	* module/language/tree-il/fix-letrec.scm (partition-vars): Also analyze
	  let-bound vars.
	  (fix-letrec!): Fix a bug whereby a set! to an unreffed var would be
	  called for value, not effect. Also "fix" <let>-bound lambda
	  expressions -- really speeds up pmatch.

	* test-suite/tests/tree-il.test ("lexical sets", "the or hack"): Update
	  to take into account the new optimizations.

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Don't include libunistring headers in Guile public headers
	This requres the creation of a new type
	scm_t_string_failed_conversion_handler to replace libunistring's
	enum iconveh_ilseq_handler.

	* libguile/strings.h: don't include <uniconv.h>
	(scm_t_string_failed_conversion_handler): new enum type
	(SCM_FAILED_CONVERSION_ERROR, SCM_FAILED_CONVERSION_QUESTION_MARK):
	(SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE): new enum type values

	* libguile/strings.c (scm_to_stringn): now takes type
	scm_t_string_failed_conversion_handler.  All callers changed.

	* libguile/print.c: include <uniconv.h>

	* libguile/ports.c (scm_lfwrite_substr): use
	scm_t_string_conversion_handler's constants

	* libguile/gen-scmconfig.c (SCM_ICONVEH_ERROR):
	(SCM_ICONVEH_QUESTION_MARK, SCM_ICONVEH_ESCAPE_SEQUENCE): store
	iconveh_ilseq_hander constants as #define's

	Regression, scm_string fails to test for circular lists
	* libguile/string.c (scm_string): Restores the functionality
	  where scm_string tests for circular lists

	* test-suite/tests/strings.test: add test for circular lists

	Some signed/unsigned comparison and conversions
	* libguile/ports.c (scm_lfwrite_str, scm_lfwrite_substr): signed/unsigned
	  conversion and comparison

	* libguile/strings.c (scm_string_append): signed/unsigned comparison

2009-08-12  Andy Wingo  <wingo@oblong.net>

	rework the vm support for wide strings
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

	* libguile/vm-engine.c (vm_error_bad_wide_string_length): New error
	  case.

	* libguile/vm-i-loader.c (load-unsigned-integer, load-integer)
	  (load-keyword): Remove these instructions. The former two are
	  obsoleted by make-int64/make-uint64, the latter via make-keyword.
	  (load-string): Only handle narrow strings.
	  (load-symbol): Only handle narrow symbols. The wide case is handled
	  via make-symbol.
	  (load-wide-string): New instruction, for wide strings.

	* libguile/vm-i-system.c (define): Move here from loaders.c, as now it
	  just takes a sym on the stack.
	  (make-keyword, make-symbol): New instructions.

	* module/language/assembly.scm: Remove removed instructions. No more
	  width byte in load-string etc.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Adapt
	  to change in instruction set.

	* module/language/glil/compile-assembly.scm (glil->assembly): Compile
	  define by pushing the sym then emitting (define).
	  (dump-object): Dump narrow and wide strings differently. Use
	  make-keyword and make-symbol as appropriate.

	* module/language/tree-il/compile-glil.scm (flatten): When compiling a
	  ref to a primitive (not a call), first see if the primitive is
	  actually bound in the root module. (That's not the case with e.g.
	  bytevector-u8-ref).

	* module/system/xref.scm (program-callee-rev-vars): Don't parse out
	  "nexts".

	* test-suite/tests/asm-to-bytecode.test ("compiler"): Adapt to bytecode
	  format change.

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Fix disassembly of strings and symbols
	* module/language/assembly/decompile-bytecode.scm (decode-bytecode):
	  fix disassembly of strings, symbols, keywords, and defines

	Quiet signed/unsigned comparison warnings in chars.[ch]
	* libguile/chars.h (SCM_MAKE_CHAR): quiet signed/unsigned
	  comparison warnings

	* libguile/chars.c (scm_i_charname):
	  (scm_i_charname_to_char): quiet signed/unsigned comparison
	  warnings

	Avoid unitialized and unused warnings in scm_string_append
	* libguile/strings.c (scm_string_append): avoid warnings

	Revert to locale-dependent toupper and tolower
	To avoid leaving Guile in a broken state, the conversion
	from locale-dependent case modification to Unicode case modification
	should be an atomic commit

	* libguile/chars.c (scm_c_upcase): revert to locale-dependent
	  toupper and tolower

	Only pass ints to tolower and toupper
	* libguile/strings.c (unistring_escapes_to_guile_escapes): cast
	  tolower's parameter to int

	* libguile/read.c (CHAR_DOWNCASE): cast tolower's parameter to int

2009-08-12  Andy Wingo  <wingo@pobox.com>

	debitrot the ecmascript compiler
	* module/Makefile.am (ECMASCRIPT_LANG_SOURCES):
	* module/language/ecmascript/compile-ghil.scm:
	* module/language/ecmascript/compile-tree-il.scm: SOURCES): Replace the
	  GHIL compiler with a ->tree-il compiler. Not fully functional, but the
	  basics work.

	* module/language/ecmascript/spec.scm: Only include the tree-il compiler.

	* module/language/ecmascript/tokenize.scm (read-punctuation): Avoid
	  mutating a constant.

2009-08-11  Andy Wingo  <wingo@pobox.com>

	make the fallback path look less like line noise
	* libguile/_scm.h:
	* libguile/load.c: Rework to only include the relevant pieces in the
	  fallback path.

	include objcode cookie in the fallback path
	* libguile/_scm.h (SCM_OBJCODE_COOKIE): Move the objcode cookie define
	  here, so that load.c can use it. This is a private header.

	* libguile/load.c (FALLBACK_DIR): Include the objcode cookie in the
	  fallback path. Should fix problems when objcode changes incompatibly
	  during the 1.9 series.

	* libguile/objcodes.c: Adapt to SCM_OBJCODE_COOKIE move.

	This should fix http://article.gmane.org/gmane.lisp.guile.devel/9059.

2009-08-11  Michael Gran  <spk121@yahoo.com>

	More string and symbol tests
	        * test-suite/tests/strings.test: more tests

	        * test-suite/tests/symbols.test: more tests

	Fix %string-dump and %symbol-dump fields
	        * libguile/strings.c (scm_sys_string_dump): don't print
	        stringbuf. Print read-only status.
	        (scm_sys_symbol_dump): don't print stringbuf.  Print interned
	        status.

2009-08-10  Ludovic Courtès  <ludo@gnu.org>

	Change `defined?' to accept a module as its second argument.
	Reported by Daniel Kraft <d@domob.eu>.

	* doc/ref/api-binding.texi (Binding Reflection): Update documentation of
	  `defined?'.

	* libguile/evalext.c (scm_defined_p): Expect a module as the second
	  argument, not a lexical environment.

2009-08-10  Michael Gran  <spk121@yahoo.com>

	Make scm_charprint and scm_i_string_wide_chars SCM_INTERNAL.
	Also, scm_charprint is renamed to scm_i_charprint.

	        * libguile/strings.h: make scm_i_string_wide_chars internal.

	        * libguile/print.h: rename scm_charprint to scm_i_charprint.  Make
	        internal.

	        * libguile/print.c (scm_i_charprint): renamed from scm_charprint
	        (scm_charprint): renamed to scm_i_charprint. All callers changed.

	Improve %string-dump and %symbol-dump
	%string-dump and %symbol-dump are modified to return assocation lists
	of string and symbol attributes instead of printing to stderr.  They
	are no longer conditional on SCM_DEBUG.

	        * libguile/strings.c (scm_sys_string_dump)
	        (scm_sys_symbol_dump): now returns alist of properties.  No longer
	        require that SCM_DEBUG be defined.
	        (scm_sys_stringbuf_hist): now conditional on
	        SCM_STRING_LENGTH_HISTOGRAM

	        * libguile/strings.h: scm_sys_string_dump and scm_sys_symbol dump
	        are now declared as API

	More comments for string functions
	        * libguile/strings.c: comments

	Missing parentheses in SCM_MAKE_CHAR macro
	* libguile/chars.h (SCM_MAKE_CHAR): missing parentheses

	Port position macros shouldn't require enclosing braces
	The port position macros incorrectly required enclosing braces
	when used within if statements.

	        * libguile/ports.h (SCM_INCLINE, SCM_ZEROCOL, SCM_INCCOL)
	        (SCM_DECCOL, SCM_TABCOL): enclose macro in do/while

	        * libguile/ports.c (update_port_lf): remove extra braces

2009-08-09  Ludovic Courtès  <ludo@gnu.org>

	Use a linker version script for libguile.
	* libguile/Makefile.am (libguile_la_LDFLAGS)[HAVE_LD_VERSION_SCRIPT]:
	  Use `libguile.map'.
	  (EXTRA_DIST): Add `libguile.map'.

	* libguile/libguile.map: New file.

	Use Gnulib's `lib-symbol-versions' module.
	* m4/gnulib-cache.m4: Add `lib-symbol-versions'.

	Remove bogus `configure' test for GNU libunistring.
	* configure.ac: Remove explicit test for libunistring, which conflicted
	  with Gnulib's own test.  This fixes commit
	  f4863880f5ef539cb545999c19b6b5c0eec9382d.

2009-08-09  Neil Jerram  <neil@ossau.uklinux.net>

	Misc GOOPS chapter updates
	* doc/ref/goops-tutorial.texi: Update intro text.  Fix `an' typo.

	* doc/ref/goops.texi: Update quick start intro text.  Simplify
	  example that uses `format'.

	Use #:keyword syntax in preference to :keyword
	because that is Guile's default.

	In general, use @lisp in preference to @smalllisp
	because it looks better in the DVI output.  Exceptions are

	- wide examples, which would cause overfull hboxes if they
	  used the bigger @lisp font

	- very large examples, which may look too big at the @lisp size.

	Use @result{} instead of -->
	* doc/ref/goops.texi: Use @result{} instead of -->.

	Update GOOPS Getting Started section
	* doc/ref/goops.texi (Getting Started): Renamed `Quick Start', to fit
	  better with following Tutorial.  Also add a bit more text to the
	  Methods subsection.

2009-08-08  Neil Jerram  <neil@ossau.uklinux.net>

	Minor textual improvements to slot sections

	Move tutorial sections on slots before inheritance
	* doc/ref/goops-tutorial.texi (Instance creation and slot access, Slot
	  description): Move to before Inheritance.

	Change <complex> to <my-complex> in GOOPS tutorial
	* doc/ref/goops-tutorial.texi (Class Definition): Minor text
	  improvements.  Change the class being defined to <my-complex>, to
	  reduce the confusion with the built in <complex> class.

	Start updating/merging GOOPS getting started / tutorial text
	* doc/ref/goops-tutorial.texi (Introduction): Merge this subsection's
	  non-duplicate text into the introductory text of the whole section,
	  then remove this subsection.

	  (Tutorial): Textual updates to introductory text.

	  (Class definition and instantiation): Rename `Class definition',
	  since that's all it covers.  Remove unnecessary footnote about
	  loading (oop goops) module.

	  (All @nodes): Remove explicit up, next and prev nodes.  (They make
	  the document harder to change.)

	* doc/ref/goops.texi (Tutorial): Move from the end of the GOOPS
	  chapter to the beginning of it.

	  (Running GOOPS): Removed; useful text merged into containing
	  section.

	Remove page break after heading of Chapter 6 (Modules)
	This brings this chapter into line with the others, which do not have
	page breaks before the first section.

	Use GOOPS Introduction as intorudctory text for the whole GOOPS chapter

2009-08-08  Michael Gran  <spk121@yahoo.com>

	Merge commit 'origin/master'

	Add Unicode strings and symbols
	This adds full Unicode strings as a datatype, and it adds some
	minimal functionality.  The terminal and port encoding is assumed
	to be ISO-8859-1.  Non-ISO-8859-1 characters are written or
	input as string character escapes.

	The string character escapes now have 3 forms: \xXX \uXXXX and
	\UXXXXXX, for unprintable characters that have 2, 4 or 6 hex digits.

	The process for writing to strings has been modified.  There is now a
	function scm_i_string_start_writing that does the copy-on-write
	conversion if necessary.

	To compile strings that may be wide, the VM storage of strings and
	string-likes has changed.

	Most string-using functions have not yet been updated and may break
	when used with wide strings.


	        * module/language/assembly/compile-bytecode.scm (write-bytecode):
	        use variable width string bytecode format

	        * module/language/assembly.scm (byte-length): use variable width
	        bytecode format

	        * libguile/vm-i-loader.c (load-string, load-symbol):
	        (load-keyword, define): use variable-width bytecode format

	        * libguile/vm-engine.h (FETCH_WIDTH): new macro

	        * libguile/strings.h: new declarations

	        * libguile/strings.c (make_wide_stringbuf): new function
	        (widen_stringbuf): new function
	        (scm_i_make_wide_string): new function
	        (scm_i_is_narrow_string): new function
	        (scm_i_string_wide_chars): new function
	        (scm_i_string_start_writing): new function
	        (scm_i_string_ref): new function
	        (scm_i_string_set_x): new function
	        (scm_i_is_narrow_symbol): new function
	        (scm_i_symbol_wide_chars, scm_i_symbol_ref): new function
	        (scm_string_width): new function
	        (unistring_escapes_to_guile_escapes): new function
	        (scm_to_stringn): new function
	        (scm_i_stringbuf_free): modify for wide strings
	        (scm_i_substring_copy): modify for wide strings
	        (scm_i_string_chars, scm_string_append): modify for wide strings
	        (scm_i_make_symbol, scm_to_locale_stringn): modify for wide strings
	        (scm_string_dump, scm_symbol_dump, scm_to_locale_stringbuf):
	        (scm_string, scm_i_deprecated_string_chars): modify for wide strings
	        (scm_from_locale_string, scm_from_locale_stringn): add null test

	        * libguile/srfi-13.c: add calls for scm_i_string_start_writing for
	        each call of scm_i_string_stop_writing
	        (scm_string_for_each): modify for wide strings

	        * libguile/socket.c: add calls for scm_i_string_start_writing for each
	        call of scm_i_string_stop_writing

	        * libguile/rw.c: add calls for scm_i_string_start_writing for each
	        call of scm_i_string_stop_writing

	        * libguile/read.c (scm_read_string): allow reading of wide strings

	        * libguile/print.h: add declaration for scm_charprint

	        * libguile/print.c (iprin1): print wide strings and add new string
	        escapes
	        (scm_charprint): new function

	        * libguile/ports.h: new declarations for scm_lfwrite_substr and
	        scm_lfwrite_str

	        * libguile/ports.c (update_port_lf): new function
	        (scm_lfwrite): use update_port_lf
	        (scm_lfwrite_substr): new function
	        (scm_lfwrite_str): new function

	        * test-suite/tests/asm-to-bytecode.test ("compiler"): add string
	        width byte to sting-like asm tests

2009-08-07  Andy Wingo  <wingo@pobox.com>

	lambda, the ultimate goto
	* module/language/tree-il/analyze.scm (analyze-lexicals): Rework to
	  actually determine when a fixed-point procedure may be allocated as a
	  label.
	* module/language/tree-il/compile-glil.scm (emit-bindings): Always emit
	  a <glil-bind>. Otherwise it's too hard to pair with unbindings.
	  (flatten-lambda): Consequently, here we only `bind' if there are any
	  vars to bind. This doesn't make any difference, given that lambdas
	  don't have trailing unbind instructions, but it does keep the GLIL
	  output the same for thunks -- no extraneous (bind) instructions. Keeps
	  tree-il.test happy.
	  (flatten): Some bugfixes. Yaaay, it works!!!

	implement compilation of label-allocated lambda expressions
	* module/language/tree-il/compile-glil.scm (flatten-lambda, flatten):
	  Implement compilation of label-allocated lambda expressions. Quite
	  tricky, we'll see if this works when the new analyzer lands.

	add label alist to lambda allocations in tree-il->glil compiler
	* module/language/tree-il/analyze.scm: Add some more comments about
	  something that will land in a future commit: compiling fixpoint
	  lambdas as labels.
	  (analyze-lexicals): Reorder a bit, and add a label alist to procedure
	  allocations. Empty for now.

	* module/language/tree-il/compile-glil.scm (flatten): Adapt to the free
	  variables being in the cddr of the allocation, not the cdr.

2009-08-06  Andy Wingo  <wingo@pobox.com>

	loop detection in the house
	* libguile/vm-i-scheme.c (vector-ref, vector-set): Sync registers if we
	  call out to C.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Add an
	  extra argument, the self-label, which should be the gensym under which
	  the procedure is bound in a <fix> expression.
	  (flatten): If we see a call to a lexical ref to the self-label in a
	  tail position, rename and goto instead of goto/args, which will tear
	  down the frame -- or will, in the future. It's a primitive form of
	  loop detection.

	* module/language/tree-il/primitives.scm (zero?): Expand to (= x 0).

	actually implement "fixing letrec"
	* module/Makefile.am (SOURCES): Reorganize so GHIL is compiled last,
	  along with ecmascript.

	* module/language/scheme/spec.scm: Remove references to GHIL, as it's
	  bitrotten and obsolete..

	* module/language/tree-il.scm (make-tree-il-folder): Rework so that we
	  only have down and up procs, and call down and up on each element.
	* module/language/tree-il/analyze.scm (analyze-lexicals): Fix a thinko
	  handling let-values.

	* module/language/tree-il/fix-letrec.scm: Actually implement fixing
	  letrec. The resulting code will perform better, but violations of the
	  letrec restriction are not detected. This behavior is allowed by the
	  spec, but it is undesirable. Perhaps that will be fixed later.

	* module/language/tree-il/inline.scm (inline!): Fix a case in which
	  ((lambda args foo)) would be erroneously inlined to foo. Remove empty
	  let, letrec, and fix statements.

	* module/language/tree-il/primitives.scm (effect-free-primitive?): New
	  public predicate.

	actually inline call-with-values to tree-il's <let-values>
	* module/srfi/srfi-11.scm (let-values): In the one-clause case, avoid
	  going through temporary variables.

	* module/language/tree-il/inline.scm (inline!): Add another case:
	  (call-with-values (lambda () ...) (lambda ... ...) -> let-values.

	* module/language/tree-il/compile-glil.scm (flatten): Fix a bug
	  compiling applications in "vals" context.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Fix a couple
	  bugs with let-values and rest arguments.

2009-08-06  Neil Jerram  <neil@ossau.uklinux.net>

	Include GOOPS pictures in the distribution

2009-08-05  Andy Wingo  <wingo@pobox.com>

	let-values in terms of syntax-case, add make-tree-il-folder
	* module/language/tree-il.scm (tree-il-fold): Fix for let-values case.
	  (make-tree-il-folder): New public macro, makes a multi-valued folder
	  specific to the number of seeds that the user wants.
	* module/language/tree-il/optimize.scm (optimize!): Reverse the order of
	  inline! and fix-letrec!, as the latter might expose opportunities for
	  the former.
	* module/srfi/srfi-11.scm (let-values): Reimplement in terms of
	  syntax-case, so that its expressions may reference hygienically bound
	  variables. See the NEWS for the rationale.
	  (let*-values): An empty let*-values still introduces a local `let'
	  binding contour.
	* module/system/base/syntax.scm (record-case): Yukkkk. Reimplement in
	  terms of syntax-case. Ug-ly, but see the NEWS again: "Lexical bindings
	  introduced by hygienic macros may not be referenced by nonhygienic
	  macros."

	add <fix> tree-il construct, and compile it
	* libguile/vm-i-system.c (fix-closure): New instruction, for wiring
	  together fixpoint procedures.

	* module/Makefile.am (TREE_IL_LANG_SOURCES): Add fix-letrec.scm.

	* module/language/glil/compile-assembly.scm (glil->assembly): Reindent
	  the <glil-lexical> case, and handle 'fix for locally-bound vars.

	* module/language/tree-il.scm (<fix>): Add the <fix> tree-il type and
	  accessors, for fixed-point bindings. This IL construct is taken from
	  the Waddell paper.
	  (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold)
	  (pre-order!, post-order!): Update for <fix>.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Update for
	  <fix>. The difference here is that the bindings may not be assigned,
	  and are not marked as such. They are not boxed.
	  (report-unused-variables): Update for <fix>.

	* module/language/tree-il/compile-glil.scm (flatten): Compile <fix> to
	  GLIL.

	* module/language/tree-il/fix-letrec.scm: A stub implementation of
	  fixing letrec -- will flesh out in a separate commit.

	* module/language/tree-il/inline.scm: Fix license, it was mistakenly
	  added with LGPL v2.1+.

	* module/language/tree-il/optimize.scm (optimize!): Run the fix-letrec!
	  pass.

	add a brain-dead inliner
	* module/Makefile.am (TREE_IL_LANG_SOURCES):
	* module/language/tree-il/inline.scm: Add a brain-dead inliner, to
	  inline ((lambda () x)) => x.

	* module/language/tree-il/optimize.scm (optimize!): Invoke the inliner.

	add1 and sub1 instructions
	* libguile/vm-i-scheme.c: Add add1 and sub1 instructions.
	* module/language/tree-il/compile-glil.scm: Compile 1+ and 1- to add1
	  and sub1.

	* module/language/tree-il/primitives.scm (define-primitive-expander):
	  Add support for `if' statements in the consequent.
	  (+, -): Compile (- x 1), (+ x 1), and (+ 1 x) to 1- or 1+ as
	  appropriate.
	  (1-): Remove this one. Seems we forgot 1+ before, but we weren't
	  compiling it nicely anyway.

	* test-suite/tests/tree-il.test ("void"): Fix expected compilation of (+
	  (void) 1) to allow for add1.

2009-08-04  Andy Wingo  <wingo@pobox.com>

	perform gmp/unistring compile checks with AC_LIB_HAVE_LINKFLAGS
	* configure.ac: Rework gmp and unistring checks to use
	  AC_LIB_HAVE_LINKFLAGS, so that the compilation checks run with the
	  right -L/-l flags.

	* libguile/Makefile.am (libguile_la_LIBADD): Adapt to need to add
	  $(LIBGMP) and $(LIBUNISTRING) here.

	Hopefully this solves
	http://article.gmane.org/gmane.lisp.guile.bugs/4288.

	rename configure.in to configure.ac
	* configure.ac:
	* guile-readline/configure.ac: Rename from configure.in, as recommended
	  by the autoconf manual.

	fix buffer overrun reading partial numbers: 1.0f, 1.0/, and 1.0+
	* libguile/numbers.c (mem2decimal_from_point, mem2ureal, mem2complex):
	  Fix a number of cases where, for invalid numbers, we could read past
	  the end of the buffer. This happened in e.g. "1.0+", "1/" and "1.0f".
	  But I couldn't figure out how to test for these, given that the
	  behavior depended on the contents of uninitialized memory in the
	  reader buffer. We'll just have to be happy with this.

	Thanks to Kjetil S. Matheussen for the report.

2009-08-04  Neil Jerram  <neil@ossau.uklinux.net>

	Git-Ignore effective-version.texi

	Fix overfull hboxes

	Typos

	Add an effective version variable for the manual

	Add copyright statements to goops.texi and goops-tutorial.texi

2009-08-04  Daniel Kraft  <d@domob.eu>

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

	Abstracted dynamic binding a little off the fluids.
	* module/language/elisp/compile-tree-il.scm: Move dynamic binding to one place
	  and changed names that refer to `fluids' for dynamic binding.
	* module/language/elisp/bindings.scm: Changed names referring to `fluids'.

2009-08-04  Neil Jerram  <neil@ossau.uklinux.net>

	Move GOOPS documentation into the main manual
	Nothing editorial here, just the minimum to move the GOOPS documentation
	into the main manual, and then still have everything build properly.

2009-08-03  Daniel Kraft  <d@domob.eu>

	Implement catch and unwind-protect as macros.
	* module/language/elisp/compile-tree-il.scm: Remove catch and unwind-protect.
	* module/language/elisp/runtime/macro-slot.scm: Re-implement them here.

2009-08-03  Neil Jerram  <neil@ossau.uklinux.net>

	Move `Continuation Barriers' to the section that covers continuations
	Since continuation barriers protect against non-local exits, it makes
	better sense to document them in the same section as continuations and
	exceptions.

	Review/update sections on arbiters and asyncs

	Miscellaneous small updates
	- Typos
	- Minor changes to texinfo markup
	- Minor wording changes

	Remove the idea of a separate manual edition number
	I don't believe this has ever been useful, and I doubt that we've
	consistently incremented it in the past.  The reality is that the
	manual evolves with the rest of Guile, so Guile's version number
	should apply to the manual too.  It is conceivable that we might
	one day revise the manual for an existing Guile release, so we keep
	a REVISION number to cover that.

2009-08-01  Michael Gran  <spk121@yahoo.com>

	Don't doubly define scm_t_wchar
	        * libguile/chars.h: don't define scm_t_wchar
	        * libguile/numbers.h: define scm_t_wchar here

	Fix coding style compliance for recent 32-bit char changes
	        * libguile/print.c (iprin1): extra braces

	        * libguile/chars.h (SCM_IS_UNICODE_CHAR): coding style

	Don't use GNU extensions for SCM_MAKE_CHAR macro
	Since the contents of SCM_MAKE_CHAR are evaluated more than once,
	don't use it in situations where this could cause side-effects.

	        * libguile/vm-i-system.c (make-char8): avoid side-effects with
	        SCM_MAKE_CHAR call

	        * libguile/chars.h (SCM_MAKE_CHAR): modified

	Make charname declarations module-level and GCS
	Charname array declarations are corrected for style and
	are made module-level.  Array list length variables are
	replaced with macros.

	        * libguile/chars.c: variable declaration fixes

	Update NEWS for charname changes
	        * NEWS: updated

2009-08-01  Daniel Kraft  <d@domob.eu>

	Allow lexical binding of lambda arguments.
	* module/language/elisp/compile-tree-il.scm: Rework lambda compiler to allow
	  opional lexical binding of (some) lambda arguments.
	* test-suite/tests/elisp-compiler.test: Check this.

2009-07-31  Daniel Kraft  <d@domob.eu>

	Compiler option to always bind certain symbols lexically. Affects so far let-bound symbols, lambda arguments to come in the future.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Add :always-lexical option.
	* test-suite/tests/elisp-compiler.test: Test it.

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-07-31  Ludovic Courtès  <ludo@gnu.org>

	Add unused variable analysis in the tree-il->glil compiler.
	* module/language/tree-il/analyze.scm (<binding-info>): New record type.
	  (report-unused-variables): New procedure.

	* module/language/tree-il/compile-glil.scm (%warning-passes): New
	  variable.
	  (compile-glil): Honor `#:warnings' from OPTS.

	* test-suite/tests/tree-il.test (call-with-warnings): New procedure.
	  (%opts-w-unused): New variable.
	  ("warnings"): New test prefix.

	Add `(system base message)', a simple warning framework.
	* module/Makefile.am (SOURCES): Add `system/base/message.scm'.

	* module/scripts/compile.scm (%options): Add `--warn'.
	  (parse-args): Update default value for `warnings'.
	  (show-warning-help): New procedure.
	  (compile)[compile-opts]: Add `#:warnings'.
	  Update help message.

	* module/system/base/compile.scm (compile): Sanity-check the requested
	  warnings.

	* module/system/base/message.scm: New file.

	Add `tree-il-fold', a purely functional iterator on `tree-il'.
	* module/language/tree-il.scm (tree-il-fold): New procedure.

	* test-suite/tests/tree-il.test ("tree-il-fold"): New test prefix.

2009-07-30  Daniel Kraft  <d@domob.eu>

	Use explicit guile-primitive forms in the macro expansion of dotimes and dolist.

	Implement some elisp constructs in macros instead of hard-coded compiler code.
	* module/language/elisp/compile-tree-il.scm: Remove implementation of prog1,
	  and, or, cond, dolist.
	* module/language/elisp/runtime/macro-slot.scm: Implement them here instead.

	Switch use of guile-primitive to now available funcall in test.

	without-void-checks as new extension for fine-control
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Handle without-void-checks.
	* test-suite/tests/elisp-compiler.test: Test it.

2009-07-29  Daniel Kraft  <d@domob.eu>

	funcall, apply and eval built-ins.
	* module/language/elisp/README: Document new features.
	* module/language/elisp/runtime/function-slot.scm: Implement funcall, apply and
	  eval by using the existing compiler code.
	* test-suite/tests/elisp-compiler.test: Test those.

2009-07-29  Michael Gran  <spk121@yahoo.com>

	Add 32-bit characters
	This adds the 32-bit standalone characters.  Strings are still
	8-bit.  Characters larger than 8-bit can only be entered or
	displayed in octal format at this point.  At this point, the
	terminal's display encoding is expected to be Latin-1.

	        * module/language/assembly/compile-bytecode.scm (write-bytecode):
	        add 32-bit char

	        * module/language/assembly.scm (object->assembly): add 32-bit char
	        (assembly->object): add 32-bit char

	        * libguile/vm-i-system.c (make-char32): new op

	        * libguile/print.c (iprin1): print 32-bit char

	        * libguile/numbers.h: add type scm_t_wchar

	        * libguile/numbers.c: add type scm_t_wchar

	        * libguile/chars.h: new type scm_t_wchar
	        (SCM_CODEPOINT_MAX): new
	        (SCM_IS_UNICODE_CHAR): new
	        (SCM_MAKE_CHAR): operate on 32-bit char

	        * libguile/chars.c: comparison operators now use Unicode
	        codepoints
	        (scm_c_upcase): now receives and returns scm_t_wchar
	        (scm_c_downcase): now receives and returns scm_t_wchar

2009-07-29  Daniel Kraft  <d@domob.eu>

	Added guile-primitive construct for references to primitives from Elisp.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Implement guile-primitive.
	* test-suite/tests/elisp-compiler.test: Switched a usage of guile-ref to
	  the now available guile-primitive.

	Added length built-in.
	* module/language/elisp/runtime/function-slot.scm: Add length built-in.
	* test-suite/tests/elisp-compiler.test: Test length.

	Implemented lexical-let and lexical-let* for elisp.
	* module/language/elisp/README: Document it.
	* module/language/elisp/bindings.scm: New fields in bindings data structure
	  to keep track of lexical bindings for symbols.
	* module/language/elisp/compile-tree-il.scm: Implement lexical-let(*).
	* test-suite/tests/elisp-compiler.test: Test lexical scoping with lexical-let.

2009-07-28  Michael Gran  <spk121@yahoo.com>

	Replace global charnames variables with accessors
	The global variables scm_charnames and scm_charnums are replaced with
	the accessor functions scm_i_charname and scm_i_charname_to_num.
	Also, the incomplete and broken EBCDIC support is removed.

	       * libguile/print.c (iprin1): use new func scm_i_charname

	        * libguile/read.c (scm_read_character): use new func
	        scm_i_charname_to_num

	        * libguile/chars.c (scm_i_charname): new function
	        (scm_i_charname_to_char): new function
	        (scm_charnames, scm_charnums): removed

	        * libguile/chars.h: new declarations

2009-07-27  Daniel Kraft  <d@domob.eu>

	In elisp-compiler.test, check that let* works without values given, too.

2009-07-26  Andy Wingo  <wingo@pobox.com>

	increase range of relative jumps by aligning blocks to 8-byte boundaries
	* libguile/objcodes.c (OBJCODE_COOKIE): Bump again, as our jump offsets
	  are now multiplied by 8.

	* libguile/vm-i-system.c (BR): Interpret the 16-bit offset as a relative
	  jump to the nearest 8-byte-aligned block -- increasing relative jump
	  range from +/-32K to +/-240K.
	  (mvra): Do the same for the mvra jump.

	* libguile/vm.c (really_make_boot_program): Align the mvra.

	* module/language/assembly.scm (align-block): New export, for aligning
	  blocks.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Emit
	  jumps to the nearest 8-byte-aligned block. Effectively our range is 18
	  bits in either direction. I would like to do this differently -- have
	  long-br and long-br-if, and all the other br instructions go to 8 bits
	  only. But the assembler doesn't have an appropriate representation to
	  allow me to do this yet, so for now this is what we have.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Decode the 19-bit jumps.

	make sure all programs are 8-byte aligned
	* libguile/objcodes.c (OBJCODE_COOKIE): Bump objcode cookie, as we added
	  to struct scm_objcode.
	* libguile/objcodes.h (struct scm_objcode): Add a uint32 after metalen
	  and before base, so that if the structure has 8-byte alignment, base
	  will have 8-byte alignment too. (Before, base was 12 bytes from the
	  start of the structure, now it's 16 bytes.)

	* libguile/vm-engine.h (ASSERT_ALIGNED_PROCEDURE): Add a check that can
	  be turned on with VM_ENABLE_PARANOID_ASSERTIONS.
	  (CACHE_PROGRAM): Call ASSERT_ALIGNED_PROCEDURE.

	* libguile/vm-i-system.c (long-local-ref): Add a missing semicolon.

	* libguile/vm.c (really_make_boot_program): Rework to operate directly
	  on a malloc'd buffer, so that the program will be 8-byte aligned.

	* module/language/assembly.scm (*program-header-len*): Add another 4 for
	  the padding.
	  (object->assembly): Fix case in which we would return (make-int8 0)
	  instead of (make-int8:0). This would throw off compile-assembly.scm's
	  use of addr+.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
	  out the padding int.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  And pop off the padding int too.

	* module/language/glil/compile-assembly.scm (glil->assembly): Don't pack
	  the assembly, assume that assembly.scm has done it for us. If a
	  program has a meta, pad out the program so that meta will be aligned.

	* test-suite/tests/asm-to-bytecode.test: Adapt to expect programs to
	  have the extra 4-byte padding int.

	fix alignment of subprograms of subprograms
	* module/language/glil/compile-assembly.scm (glil->assembly)
	  (dump-object): Fix an exciting bug! Subprograms of subprograms were
	  not being aligned correctly, because the code was generated too early.
	  So instead delay dumping the object table until the proper time.

	fix unused SCM_FRAME_SET_DYNAMIC_LINK macro
	* libguile/frames.h (SCM_FRAME_SET_DYNAMIC_LINK): Fix for new stack
	  layout, though this macro is not used.

	fix vmstack gdb macro for new stack frame layout
	* gdbinit (vmstack): No more external link.

2009-07-24  Andy Wingo  <wingo@pobox.com>

	check that jumps are within the range of a signed 16-bit int
	* module/language/assembly/compile-bytecode.scm (write-bytecode): Check
	  that the offset is within the range of a signed int16 value.

	fix gensym creation in psyntax
	* module/ice-9/psyntax.scm (build-lexical-var): Make our gensyms really
	  unique. Before, there was a chance that different lexicals could
	  result in the same gensym.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	increase default stack size to 64 kilowords
	* libguile/vm.c (VM_DEFAULT_STACK_SIZE): Increase to 64 kilowords.
	  Really, we should simply add overflow handlers, but in the meantime,
	  this will do.

2009-07-24  Daniel Kraft  <d@domob.eu>

	Compiler option to disable void-checks in elisp.
	* module/language/elisp/README: Document the change.
	* module/language/elisp/compile-tree-il.scm: Add disable-void-check option.
	* test-suite/tests/elisp-compiler.test: Test it.

2009-07-24  Andy Wingo  <wingo@pobox.com>

	compiler support for nlocs >= 256
	* libguile/vm-i-system.c (long-local-ref, long-local-set)
	  (make-variable): New intructions, for handling nlocs >= 256.
	* module/language/glil/compile-assembly.scm (glil->assembly): Compile
	  <glil-lexical> with support for nlocs >= 256.

2009-07-24  Daniel Kraft  <d@domob.eu>

	Don't pass the bindings-data all around in compile-tree-il, but use fluids for this dynamic binding.
	* module/language/elisp/compile-tree-il.scm: Use fluid for bindings-data.

2009-07-24  Andy Wingo  <wingo@pobox.com>

	nlocs is now 16 bits wide
	* libguile/objcodes.h (struct scm_objcode): Remove the "unused" field --
	  the old "nexts" -- and expand nlocs to 16 bits.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
	  the nlocs as a uint16.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Decompile 16-bit nlocs. It seems this decompilation is little-endian
	  :-/

	* test-suite/tests/asm-to-bytecode.test: Fix up to understand nlocs as a
	  little-endian value. The test does the right thing regarding
	  endianness.

2009-07-24  Daniel Kraft  <d@domob.eu>

	Implemented the flet and flet* extensions.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Implement flet and flet*.
	* test-suite/tests/elisp-compiler.test: Test flet and flet*.

2009-07-23  Andy Wingo  <wingo@pobox.com>

	remove all mentions of "external" from the compiler and related code
	With this, GHIL is effectively bitrotten. I need to port the ECMAScript
	compiler to tree-il, then I'll remove it.

	* module/language/assembly.scm (byte-length):
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  (disassemble-free-vars, code-annotation):
	* module/language/glil.scm (<glil-program>, <glil-local>)
	  (<glil-exteral>, parse-glil, unparse-glil):
	* module/language/glil/compile-assembly.scm (make-meta):
	  (compile-assembly, glil->assembly):
	* module/language/glil/decompile-assembly.scm (decompile-toplevel):
	  (decompile-load-program):
	* module/language/objcode/spec.scm (decompile-value):
	* module/language/tree-il/compile-glil.scm (flatten-lambda):
	* module/system/vm/frame.scm (frame-binding-ref):
	  (frame-binding-set!):
	* module/system/vm/program.scm (binding:boxed?):
	* module/system/vm/trace.scm (trace-next):
	* test-suite/tests/asm-to-bytecode.test ("compiler"):
	* test-suite/tests/tree-il.test: Remove all mentions of "external", and
	  of <glil-local>. Docs updates will come soon.

	rename "closure-ref" to "free-ref"; s/vars/variables/ in some names
	* libguile/programs.h:
	* libguile/programs.c: (SCM_PROGRAM_FREE_VARIABLES): Rename from
	  SCM_PROGRAM_FREE_VARS. Callers changed.
	* libguile/programs.c (scm_make_program): Rename arg to
	  "free_variables".
	  (scm_program_free_variables): Rename from program-free-vars.

	* libguile/vm-engine.h:
	* libguile/vm-engine.c (VM_CHECK_FREE_VARIABLES): Rename from
	  VM_CHECK_CLOSURE.
	  (vm_engine, CACHE_PROGRAM): Rename closure and closure_count to free_vars and
	  free_vars_vount.

	* libguile/vm-i-system.c (FREE_VARIABLE_REF): Rename from CLOSURE_REF.
	  (free-ref, free-boxed-ref, free-boxed-set): Rename from closure-ref,
	  closure-boxed-ref, closure-boxed-set.
	  (make-closure): Renamed from make-closure2.

	* module/language/glil/compile-assembly.scm (glil->assembly): Hack to
	  never write out the the old "make-closure" instruction. Will fix
	  better later. Change to emit free-ref etc instead of closure-ref.

	* module/language/tree-il/compile-glil.scm (flatten): Emit make-closure
	  instead of make-closure2, now that the old make-closure is gone.

	* module/system/vm/program.scm (system): Rename program-free-vars to
	  program-free-variables.

	* test-suite/tests/tree-il.test ("lambda"): Update for make-closure.

	remove "externals" from the vm
	* libguile/frames.c (scm_frame_external_link): Removed.
	* libguile/frames.h: No need to have the "external link" in the stack
	  frame -- update macros to take the new situation into account.

	* libguile/objcodes.h (struct scm_objcode): Rename the nexts field to
	  "unused". In the future we can use it for nlocs, I think.
	  (SCM_OBJCODE_NEXTS): removed.

	* libguile/programs.h:
	* libguile/programs.c (scm_make_program): Expect the third argument to
	  be a vector of free variables, not a list of free variables.
	  SCM_BOOL_F indicates no free variables, not SCM_EOL.
	  (program_mark): Adapt.
	  (scm_program_arity): No more nexts.
	  (scm_program_free_vars): Replaces scm_program_externals.

	* libguile/vm-engine.c (VM_CHECK_EXTERNAL)
	  (vm_engine): No need for the "external" var.
	* libguile/vm-engine.h (CACHE_PROGRAM): Update for SCM_PROGRAM_FREE_VARS
	  instead of SCM_PROGRAM_EXTERNALS.
	  (NEW_FRAME): Update for new frame size, and no need to cons up
	  externals. Yay :)

	* libguile/vm-i-loader.c (load-program): Update for scm_make_program.

	* libguile/vm-i-system.c (external-ref, external-set): No more.
	  (make-closure): No more.
	  (goto/args): No need to re-cons externals here. Update for new stack
	  frame size.
	  (mv-call, return, return/values): Update for new frame size. No need
	  to reinstate externals on return.

	* libguile/vm.c (really_make_boot_program, scm_load_compiled_with_vm):
	  Update for scm_make_program.
	* module/language/objcode/spec.scm (objcode-env-externals): Treat '() as
	  #f, for the externals. Need to clean this up later...
	* module/system/vm/program.scm (arity:nexts): Remove. Rename
	  program-external to program-free-vars.

	compile lexical variable access and closure creation to the new ops
	* module/language/glil.scm (<glil>): New GLIL type, <glil-lexical>,
	  which will subsume other lexical types.
	* module/language/glil/compile-assembly.scm: Compile <glil-lexical>.
	  (make-open-binding): Change the interpretation of the second argument
	  -- instead of indicating an "external" var, it now indicates a boxed
	  var.
	  (open-binding): Adapt to new glil-bind format.
	* module/language/tree-il/analyze.scm: Add a lot more docs.
	  (analyze-lexicals): Change the allocation algorithm and output format
	  to allow the tree-il->glil compiler to capture free variables
	  appropriately and to reference bound variables in boxes if necessary.
	  Amply documented.

	* module/language/tree-il/compile-glil.scm (compile-glil): Compile
	  lexical variable access to <glil-lexical>. Emit variable capture and
	  closure creation code here, instead of leaving that task to the
	  GLIL->assembly compiler.

	* test-suite/tests/tree-il.test: Update expected code emission.

2009-07-23  Daniel Kraft  <d@domob.eu>

	Implemented dynamic symbol access built-ins (set, fset, symbol-value, makunbound...)
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Moved ensure-fluid! to runtime function.
	* module/language/elisp/runtime.scm: Runtime functions to support dynamic value access.
	* module/language/elisp/runtime/function-slot.scm: Defined the built-ins.
	* test-suite/tests/elisp-compiler.test: Test them.

2009-07-22  Daniel Kraft  <d@domob.eu>

	Added guile-ref extension construct, change throw implementation to easier one using a built-in function and implement unwind-protect.
	* module/language/elisp/README: Document the changes.
	* module/language/elisp/compile-tree-il.scm: Implement unwind-protect.
	* module/language/elisp/runtime/function-slot.scm: throw as built-in.
	* test-suite/tests/elisp-compiler.test: Test unwind-protect.

	Implemented catch and throw in elisp.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement catch and throw.
	* test-suite/tests/elisp-compiler.test: Test catch/throw.

2009-07-22  Andy Wingo  <wingo@pobox.com>

	vm support for display closures
	* libguile/vm-i-system.c (box, empty-box): Boxing values and storing
	  them in local variables.
	  (local-boxed-ref, local-boxed-set): A combination of local-ref then
	  variable-ref/set.
	  (make-closure2, closure-ref, closure-boxed-ref, closure-boxed-set):
	  New ops. The idea is to migrate Guile over to using flat dispay
	  closures. See the paper "Three Implementation Models for Scheme" by
	  Kent Dybvig for more details; this is the "stack-based" model.

	* libguile/vm-engine.c:
	* libguile/vm-engine.h: Add the necessary infrastructure to keep track
	  of a "closure" variable, like our "externals" in semantics, but
	  minimal, flat, and O(1) in implementation.

2009-07-21  Andy Wingo  <wingo@pobox.com>

	renumber vm ops (objcode cookie bumped)
	* libguile/objcodes.c (OBJCODE_COOKIE): Bump.

	* libguile/vm-i-loader.c:
	* libguile/vm-i-scheme.c:
	* libguile/vm-i-system.c: Renumber instructions, so I can have a bit
	  more space to work.

2009-07-21  Daniel Kraft  <d@domob.eu>

	Don't ensure fluids all over the place but scan for variables needed and ensure just before the compiled code all those.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement it here, pass bindings all around the compilation.
	* module/language/elisp/bindings.scm: New module with symbol-tracking abilities needed for this.

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-07-20  Daniel Kraft  <d@domob.eu>

	Implemented prog1, prog2, dotimes, dolist control structures.
	* module/language/elisp/README: Document it and some further ideas written down.
	* module/language/elisp/compile-tree-il.scm: Implement prog1, dolist.
	* module/language/elisp/runtime/macro-slot.scm: prog2 and dotimes.
	* test-suite/tests/elisp-compiler.test: Test prog1, prog2, dotimes, dolist.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	fix (bytevector-ieee-single-native-set! x 0 0)
	* libguile/bytevectors.c (VALIDATE_REAL): SCM_VALIDATE_REAL is not what
	  we need for checking values for bytevector-ieee-single-native-set! et
	  al, so define our own validator.
	  (IEEE754_SET, IEEE754_NATIVE_SET): Use it.

	bytevectors have "element type" field, e.g. for generalized-vector-ref
	Bytevectors have a very close relationship to other forms of uniform
	vectors. Often you want to view a u64vector as a series of bytes, for
	writing over a socket; or to process an incoming stream using the
	convenient and less error-prone s16vector-ref API rather than
	bytevector-s16-native-ref.

	The essential needs of the representation of a bytevector and an
	s64vector are the same, so we take advantage of that and extend the
	bytevector implementation to have a "native type" field, which defaults
	to VU8.

	This commit doesn't actually expose any user-noticeable changes,
	however.

	* libguile/bytevectors.h (SCM_BYTEVECTOR_ELEMENT_TYPE): New internal
	  defines.
	  (scm_i_make_typed_bytevector, scm_c_take_typed_bytevector): New
	  internal functions.

	* libguile/bytevectors.c (SCM_BYTEVECTOR_SET_ELEMENT_TYPE):
	  (SCM_BYTEVECTOR_TYPE_SIZE):
	  (SCM_BYTEVECTOR_TYPED_LENGTH): New internal macros.
	  (make_bytevector, make_bytevector_from_buffer): Take an extra
	  argument, the element type. The length argument is interpreted as
	  being the number of elements, which corresponds to the number of bytes
	  in the default VU8 case. Doing it this way eliminates a class of bugs
	  -- e.g. a u32vector of length 3 bytes doesn't make sense. We do have
	  to check for another class of bugs: overflow. The length stored on the
	  bytevector itself is still the byte length, though.
	  (scm_i_make_typed_bytevector):
	  (scm_c_take_typed_bytevector): New internal functions.
	  (scm_i_shrink_bytevector): Make sure the new size is valid for the
	  bytevector's type.
	  (scm_i_bytevector_generalized_set_x): Remove this function, the
	  array-handle infrastructure takes care of this for us.
	  (print_bytevector): Print the bytevector according to its type.
	  (scm_make_bytevector, scm_bytevector_copy)
	  (scm_uniform_array_to_bytevector)
	  (scm_u8_list_to_bytevector, scm_bytevector_to_uint_list): Adapt to
	  make_bytevector extra arg.
	  (bv_handle_ref, bv_handle_set_x): Adapt to ref and set based on the
	  type of the bytevector, e.g. f64 or u8.
	  (bytevector_get_handle): Set the typed length of the vector, not the
	  byte length.

	Conflicts:

		libguile/bytevectors.c

	bytevector inlinedness indicated by flag, not length
	* libguile/bytevectors.h (SCM_BYTEVECTOR_INLINE_P): Change to check a
	  flag instead of checking the length of the bytevector.

	* libguile/bytevectors.c (make_bytevector_from_buffer): Handle the len
	  <= inline threshold case as well. Set the inline flag as appropriate.
	  (make_bytevector): Updat the inline flag as appropriate.
	  (scm_c_take_bytevector): Just dispatch to make_bytevector_from_buffer.
	  (scm_i_shrink_bytevector): Update the inline flag as appropriate.
	  Update the length when shrinking an already-inlined vector.
	  (STRING_TO_UTF): Fix some indentation.

	any->u8vector and family now implemented in Scheme
	* module/Makefile.am:
	* module/srfi/srfi-4/gnu.scm: New module, for extensions to srfi-4.
	  Currently defines the any->FOOvector family.

	* libguile/srfi-4.c:
	* libguile/srfi-4.i.c: Dispatch scm_any_to_FOOvector calls to the
	  scheme-implemented functions in (srfi srfi-4 gnu).

	make-typed-array builds backing vector via make-generalized-vector
	* libguile/arrays.c: Rework to use scm_make_generalized_vector instead
	  of our own type table.

	* libguile/bitvectors.c: Fix some includes.

	add registry of vector constructors, make-generalized-vector
	* libguile/generalized-vectors.h:
	* libguile/generalized-vectors.c: Add a registry of vector constructors.
	  (scm_make_generalized_vector): New public function, constructs a
	  vector of a given type.

	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/srfi-4.c:
	* libguile/strings.c:
	* libguile/vectors.c: Register vector constructors.

	* libguile/extensions.c (scm_init_extensions): No need to NULL the list
	  of registered extensions here, the static init does it for us. Allows
	  scm_c_register_extension to be called before scm_init_extensions.

	* libguile/init.c (scm_i_init_guile): Move array initialization earlier,
	  so e.g. scm_init_strings has access to a valid list of array element
	  types when registering its vector constructor.

	uniform vector functions to their own file
	* libguile/uniform.c:
	* libguile/uniform.h:
	* libguile/srfi-4.c:
	* libguile/srfi-4.h:
	* libguile/Makefile.am: Move uniform vector funcs out of srfi-4 to their
	  own file.

	* libguile.h:
	* libguile/arrays.c:
	* libguile/bytevectors.c: Update includers.

	generic vector ops to own file
	* libguile/Makefile.am:
	* libguile/vectors.c:
	* libguile/vectors.h:
	* libguile/generalized-vectors.c:
	* libguile/generalized-vectors.h: Move generic vector ops off into their
	  own file too. The implementation is now based on the generic
	  array-handle infrastructure.

	* libguile.h:
	* libguile/array-map.c:
	* libguile/bitvectors.c:
	* libguile/random.c:
	* libguile/srfi-4.c: Update includers.

	move generic array foo out to its own file
	* libguile/arrays.h:
	* libguile/arrays.c:
	* libguile/generalized-arrays.h:
	* libguile/generalized-arrays.c: Move some generic functionality out of
	  arrays.c to a new file.

	* libguile/array-map.c:
	* libguile/deprecated.c:
	* libguile/init.c: Update includers.

	remove enclosed arrays
	* libguile/arrays.h:
	* libguile/array-map.c:
	* libguile/arrays.c:
	* libguile/deprecated.c: Remove "enclosed arrays". The only user-facing
	  procedures that this affects are scm_enclose_array / enclose-array. If
	  enclosed arrays are added back, it should be through the generic array
	  interface; but really, it sounds like something that would be better
	  implemented in Scheme.

	add generic array implementation facility
	* libguile/array-handle.c (scm_i_register_array_implementation):
	  (scm_i_array_implementation_for_obj): Add generic array facility,
	  which will (in a few commits) detangle the array code.
	  (scm_array_get_handle): Use the generic array facility. Note that
	  scm_t_array_handle no longer has ref and set function pointers;
	  instead it has a pointer to the array implementation. It is unlikely
	  that code out there used these functions, however, as the supported
	  way was through scm_array_handle_ref/set_x.
	  (scm_array_handle_pos): Move this function here from arrays.c.
	  (scm_array_handle_element_type): New function, returns a Scheme value
	  representing the type of element stored in this array.

	* libguile/array-handle.h (scm_t_array_element_type): New enum, for
	  generically determining the type of an array.
	  (scm_array_handle_rank):
	  (scm_array_handle_dims): These are now just #defines.

	* libguile/arrays.c:
	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/srfi-4.c:
	* libguile/strings.c:
	* libguile/vectors.c: Register array implementations for all of these.

	* libguile/inline.h: Update for array_handle_ref/set change.
	* libguile/deprecated.h: Need to include arrays.h now.

	rename unif.[ch] to arrays.[ch]
	* libguile/Makefile.am:
	* libguile/unif.c:
	* libguile/unif.h:
	* libguile/arrays.c:
	* libguile/arrays.h: Rename unif.[ch] to arrays.[ch].

	* libguile.h:
	* libguile/array-handle.c:
	* libguile/array-map.c:
	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/eq.c:
	* libguile/gc-card.c:
	* libguile/gc-malloc.c:
	* libguile/gc-mark.c:
	* libguile/gc.c:
	* libguile/init.c:
	* libguile/inline.h:
	* libguile/print.c:
	* libguile/random.c:
	* libguile/read.c:
	* libguile/socket.c:
	* libguile/sort.c:
	* libguile/srfi-4.c:
	* libguile/srfi-4.h:
	* libguile/strports.c:
	* libguile/vectors.c:
	* libguile/vectors.h: Update includers.

	bitvector exodus from unif.[ch]
	* libguile/Makefile.am:
	* libguile/unif.c:
	* libguile/unif.h:
	* libguile/bitvectors.c:
	* libguile/bitvectors.h: Move bitvector functionality out of unif.[ch].

	* libguile/array-handle.c:
	* libguile/array-map.c:
	* libguile/init.c:
	* libguile/read.c:
	* libguile/srfi-4.c:
	* libguile/vectors.c: Oh, what a tangled web we weave...

	parts of unif.[ch] to array-handle.[ch]
	* libguile/array-handle.c:
	* libguile/array-handle.h: Move some parts of unif.c and unif.h to these
	  new files.

	* libguile/unif.c:
	* libguile/unif.h: Update includers. Since unif.h depends on the array
	  handle type, we include array-handle.h, which also means that there
	  will be no difference for our callers.

	* libguile/init.c: Call scm_init_array_handle, though it does nothing as
	  of yet.

	* libguile/Makefile.am: Adapt for new files.

	rename ramap.[ch] to array-map.[ch]
	* libguile/array-map.c:
	* libguile/array-map.h: Rename from ramap.c and ramap.h.

	* libguile.h:
	* libguile/Makefile.am:
	* libguile/eq.c:
	* libguile/init.c:
	* libguile/sort.c:
	* libguile/unif.c:
	* libguile/vectors.c: All referrers changed.

	rename scm_i_make_ra to scm_i_make_array
	* libguile/unif.c (scm_i_make_array): Rename from scm_i_make_ra. All
	  callers changed.

	clean up libguile/Makefile.am
	* libguile/Makefile.am: Clean up some of the file lists, should make
	  future diffs easier to parse.

	remove convert.{c,i.c,h}
	* libguile/convert.c:
	* libguile/convert.h:
	* libguile/convert.i.c: Remove these functions, which were undocumented,
	  not in the libguile/ header, and thus unlikely to have been used.

	remove deprecated functions from unif.c
	* libguile/unif.h:
	* libguile/unif.c: Remove deprecated functions.

	* module/ice-9/deprecated.scm: Remove array-related deprecated
	  functions.

	* NEWS: Update.

2009-07-18  Daniel Kraft  <d@domob.eu>

	Implemented some important list built-ins.
	* module/language/elisp/runtime.scm: Updated/added convenience macros.
	* module/language/elisp/runtime/function-slot.scm: Implement list built-ins.
	* module/language/elisp/runtime/macro-slot.scm: Implement list built-ins.
	* test-suite/tests/elisp-compiler.test: Test the implemented built-ins.

	Implemented unless, when and dotimes using built-in macros.
	* module/language/elisp/README: Document that.
	* module/language/elisp/runtime.scm: Defined built-in-macro macro.
	* module/language/elisp/runtime/macro-slot.scm: Implement unless, when, dotimes.
	* test-suite/tests/elisp-compiler.test: Test for those constructs.

	Return correct value for setq form.
	* module/language/elisp/compile-tree-il.scm: Fix implementation of setq.
	* test-suite/tests/elisp-compiler.test: Check for value of setq form.

	Implemented real quotation (added support for backquotation).
	* module/language/elisp/README: Document that.
	* module/language/elisp/compile-tree-il.scm: Implement backquote.
	* test-suite/tests/elisp-compiler.test: Test quotation and backquotes.

	Implemented eq and equal built-in predicates.
	* module/language/elisp/runtime/function-slot.scm: Implement eq and equal.
	* test-suite/tests/elisp-compiler.test: Test them.

2009-07-16  Daniel Kraft  <d@domob.eu>

	Implemented macros in elisp compiler.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Implement defmacro and expansion.
	* module/language/elisp/runtime/macro-slot.scm: New module to keep definitions.
	* test-suite/Makefile.am: Add elisp-compiler.test to list of tests.
	* test-suite/tests/elisp-compiler.test: Basic macro tests.

	Extended test-suite to cover already implemented built-ins and fixed errors found.
	* module/language/elisp/runtime/function-slot.scm: Fixed errors in number preds.
	* test-suite/tests/elisp-compiler.test: Test built-ins already implemented.

2009-07-15  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 1.9.1.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

	Make the non-integrated VM test-suite less verbose.
	* testsuite/run-vm-tests.scm (run-vm-tests): Don't display the number of
	  tests passed since it's always 1 or 0.

	Add FIXMEs about misaligned objcode-metas.
	* libguile/objcodes.c (scm_c_make_objcode_slice): Add comment about
	  misaligned `objcode-meta'.

	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	  Likewise.

	Fix unaligned access in the VM code.
	* libguile/vm.c (struct t_32bit_aligned): New.
	  (really_make_boot_program)[bytes]: Use it.  This fixes possibly
	  unaligned accesses, which cause a "bus error" on some platforms (e.g.,
	  sparc-*).

	Const-qualify buffers passed to `scm_c_make_objcode_slice ()'.
	* libguile/objcodes.c (scm_c_make_objcode_slice): Add `const' qualifier
	  for PTR and DATA.

	* libguile/objcodes.h: Update accordingly.

	Switch remaining GPLv2+ Guile-VM headers to LGPLv3+.
	* module/system/base/compile.scm, module/system/base/syntax.scm,
	  module/system/repl/common.scm, module/system/repl/describe.scm,
	  module/system/vm/instruction.scm, module/system/vm/objcode.scm,
	  module/system/vm/profile.scm, module/system/vm/program.scm,
	  module/system/vm/trace.scm: Switch header from GPLv2+ to LGPLv3+.

2009-07-15  Daniel Kraft  <d@domob.eu>

	Test-suite for elisp compiler so far, excluding the built-ins.
	* test-suite/tests/elisp-compiler.test: Tests for compiler so far.

	Removed wrong not in zerop built-in.
	* module/language/elisp/runtime/function-slot.scm: Fix zerop.

2009-07-15  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in the compile-type verification of `OBJCODE_COOKIE'.
	* libguile/objcodes.c: Fix `sizeof (OBJCODE_COOKIE)' assertion: the
	  trailing 0 must not be taken into account, and multiple of 8 means the
	  3 LSBs are clear.

	Make sure at compile-time that `OBJCODE_COOKIE' has the right size.
	* libguile/objcodes.c: Use `verify' to assert that the size of
	  `OBJCODE_COOKIE' is a multiple of 8.

	Explicitly use Gnulib's `verify' module.
	* m4/gnulib-cache.m4: Add `verify'.

	Augment `OBJCODE_COOKIE' to detect wrong endianness or word size.
	* libguile/objcodes.c (OBJCODE_ENDIANNESS, _OBJCODE_STRINGIFY,
	  OBJCODE_STRINGIFY, OBJCODE_WORD_SIZE): New macros.
	  (OBJCODE_COOKIE): Use them.  The intent is that `.go' files compiled
	  for a different endianness or word size are detected.

	Remove the `long_long' and `ulong_long' types.
	* libguile/gen-scmconfig.c (main): Don't emit typedefs for `long_long'
	  and `ulong_long'.  This was already deprecated in 1.8 and known to
	  cause conflicts with other libraries such as HDF5, as reported by Mark
	  Patterson <mpatterson@physics.queensu.ca>
	  (http://lists.gnu.org/archive/html/bug-guile/2009-02/msg00003.html).

2009-07-14  Andy Wingo  <wingo@pobox.com>

	update NEWS
	* NEWS: Update.

	NEWS has info on 1.9.N to 1.9.N+1 in addition to 1.8 to 2.0
	* NEWS: Update to have an incremental section in addition to a
	  comprehensive 1.8->2.0 section.

	fix race in which some instruction name symbols could go unmarked
	* libguile/instructions.c: In loops, replace scm_op_last with
	  SCM_VM_NUM_INSTRUCTIONS.
	  (fetch_instruction_table): Protect the instruction symbols from
	  collection. Before they were only marked by the name->opcode hash
	  table, leading to races in which they could be collected.
	  (scm_lookup_instruction_by_name): Protect the hash table earlier, as
	  it's not actually a stack variable, since it's static.

	fix bounds checks for the last element of bv-*-{ref,set}
	* libguile/vm-i-scheme.c (BV_FIXABLE_INT_REF, BV_INT_REF):
	  (BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET): Fix the
	  bounds check for the last element.

2009-07-14  Daniel Kraft  <d@domob.eu>

	Implemented defconst, defvar, defun special forms for elisp.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement defconst/defvar/defun.

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-07-14  Ludovic Courtès  <ludo@gnu.org>

	Remove potential "uninitialized variable" GCC warnings.
	* libguile/vm-i-scheme.c (vector_ref, vector_set, BV_FIXABLE_INT_REF,
	  BV_INT_REF, BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET,
	  BV_FLOAT_SET): Explicitly initialize all locals, to make some versions
	  of GCC happier.  Patch by Dale P. Smith <dsmich@roadrunner.com>.

	Fix tests that assumed little endian.
	* test-suite/tests/asm-to-bytecode.test (u32->u8-list): New procedure.
	  ("compiler")[(load-program 3 2 1 0 () 3 #f (make-int8 3) (return)),
	  (load-program 3 2 1 0 () 3 (load-program 3 2 1 0 ...))]: Make these
	  tests work on hosts whose endianness is not little endian.

2009-07-13  Daniel Kraft  <d@domob.eu>

	Some bug fixes on the way and mainly implemented some built-ins (arithmetic).
	* module/language/elisp/README: Document changes.
	* module/language/elisp/compile-tree-il.scm: Bug fixes to fluid-creation.
	* module/language/elisp/runtime.scm: Some helping definitions for built-ins.
	* module/language/elisp/runtime/function-slot.scm: Defined artihmetic built-ins.

	Automatically create fluids when necessary.
	* module/language/elisp/README: Document that.
	* module/language/elisp/compile-tree-il.scm: Create fluids when necessary.
	* module/language/elisp/runtime/function-slot.scm: Fix module name.

	Fixed lambda expressions and implemented function calls using the basic list notation.
	* module/language/elisp/README: Document that.
	* module/language/elisp/compile-tree-il.scm: Implement function calls.

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

	Lambda expressions in elisp, but not yet function calls.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement lambda expressions.

2009-07-07  Daniel Kraft  <d@domob.eu>

	Implemented let and let* in elisp.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Implement let and let*.

	Implemented while construct in elisp.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement while construct.

2009-07-05  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `vsnprintf' module.
	* m4/gnulib-cache.m4: Use `vsnprintf', needed by `deprecation.c'.

	Update `NEWS'.
	* NEWS: Update.

	Enclose `bit-operations.test' in its own module.
	* test-suite/tests/bit-operations.test: Use the `define-module' clause.

	Fix the `BUILD_PTHREAD_SUPPORT' Automake conditional when not using pthread.
	* configure.in: Set $build_pthread_support to "no" when thread support
	  isn't built.  This fixes the `BUILD_PTHREAD_SUPPORT' Automake
	  conditional.

2009-07-04  Daniel Kraft  <d@domob.eu>

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-07-03  Daniel Kraft  <d@domob.eu>

	Implemented fluid-based variable references and setting using setq.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement variable references, setq
	* module/language/elisp/runtime.scm: New file for runtime definitions.
	* module/language/elisp/runtime/function-slot.scm: Ditto.
	* module/language/elisp/runtime/value-slot.scm: Ditto.

2009-07-02  Andy Wingo  <wingo@pobox.com>

	fix error message for bad objcode cookie
	* libguile/objcodes.c: Whoop-dee :)

2009-07-02  Daniel Kraft  <d@domob.eu>

	Implemented elisp's or form.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement or.

	For elisp's (cond ...) and (condition) forms without body, return the condition as value.
	* compile-tree-il.scm: Fix compilation of (cond ...) for bodyless conditions.

2009-07-01  Neil Jerram  <neil@ossau.uklinux.net>

	Read complex numbers where both parts are inexact decimals
	Thanks to Bill Schottstaedt for reporting this problem!

	* libguile/numbers.c (mem2ureal): Don't be misled by *p_exactness
	  being INEXACT on entry (as is possible when reading a complex
	  number): use local exactness variable x which starts as EXACT.
	  Call mem2decimal_from_point () with &x instead of p_exactness.

	* test-suite/tests/numbers.test ("string->number"): Add complex number
	  tests suggested by Bill.

	Correction to doc on Accessing Arrays from C
	Thanks to Ludovic for the new wording!

	* doc/ref/api-compound.texi (Accessing Arrays from C): Correct text to
	  reflect the current implementation of scm_array_get_handle and
	  scm_array_handle_release - which don't actuall do any dynwind stuff.

2009-06-29  Daniel Kraft  <d@domob.eu>

	Added make-nil instruction to VM and use it for Emacs' nil in the compiler.
	* doc/ref/vm.texi: Document new instruction.
	* libguile/vm-i-system.c: Add it to the VM.
	* module/language/assembly.scm: Compile (const %nil) to (make-nil) assembly.
	* module/language/glil/decompile-assembly.scm: Handle (make-nil)
	* module/language/elisp/compile-tree-il.scm: Use (const %nil) for nil.

2009-06-28  Ludovic Courtès  <ludo@gnu.org>

	Remove seek/truncate shortcuts to file ports.
	Suggested by Neil.

	* libguile/fports.c (fport_seek_or_seek64): Rename to `fport_seek ()'.
	  (fport_seek, scm_i_fport_seek, scm_i_fport_truncate): Remove.

	* libguile/fports.h (scm_i_fport_seek, scm_i_fport_truncate): Remove
	  declarations.

	* libguile/ports.c (scm_seek): Remove shortcut that would call out to
	  `scm_i_fport_seek ()'.
	  (scm_truncate_file): Likewise.

2009-06-27  Daniel Kraft  <d@domob.eu>

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-06-26  Andy Wingo  <wingo@pobox.com>

	bytevector ops now compile down to low-level VM ops
	* libguile/instructions.c (scm_instruction_list): Fix a longstanding bug
	  in this humble function.

	* libguile/vm-i-scheme.c (BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET):
	  Fix some bugs in these macros -- now the bytevector ops work.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile
	  bytevector calls to VM ops.

	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Resolve bytevector calls to primitive
	  calls.

	run bytevectors tests under the compiler and evaluator
	* test-suite/tests/bytevectors.test: Run a number of tests under the
	  compiler/vm and the evaluator.

	vector-ref and vector-set! now have opcodes
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Resolve vector-ref and vector-set!.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): And compile
	  vector-ref and vector-set! to their opcodes.

	* libguile/vm-i-scheme.c (vector-ref, vector-set): New opcodes, placed
	  before the bytevector ops. The renumbering shouldn't affect anyone,
	  given that the bytevector ops were not yet used. Fix a few bugs in the
	  bytevector ops.

	add bytevector ops to the vm
	* libguile/instructions.h (SCM_VM_NUM_INSTRUCTIONS): Enlarge to 255. Not
	  sure what performance effects this will have.

	* libguile/vm-engine.c: Add new error case, vm_error_not_a_bytevector.

	* libguile/vm-engine.h: Don't assign specific registers for i386. Having
	  added the new VM vector ops, GCC 4.4 is erroring for me now.

	* libguile/vm-i-scheme.c: Add bytevector-specific ops to the VM.
	  We don't actually use them yet, though.

	bytevectors provide scm_i_native_endianness to the vm
	* libguile/bytevectors.h (scm_i_native_endianness): Allow the VM to use
	  scm_i_native_endianness, but still keep it marked as internal.

	* libguile/bytevectors.c: Adjust to use scm_i_native_endianness instead
	  of native_endianness. Define it at bootstrap time.

	minor doc tweaks
	* doc/ref/api-compound.texi: Generalized vector doc fixups.

	* doc/ref/api-data.texi: Minor fixes to bytevector docs.

2009-06-26  Neil Jerram  <neil@ossau.uklinux.net>

	Revert "* FAQ: New file."
	This reverts commit d53f85dd859fa69af8a0b67482774d2a88aaf407.

	It was a confusing mistake to create an FAQ file in the Guile
	repository/distribution, because there was already an FAQ page on the
	Guile web site.  The information that was in the FAQ file is now in
	the FAQ web page.

2009-06-25  Ludovic Courtès  <ludo@gnu.org>

	Add `scm_t_off' type so that `scm_t_port' has a fixed layout.
	* libguile/gen-scmconfig.c (main): Produce a definition for
	  `scm_t_off'.

	* libguile/ports.h (scm_t_port)[read_buf_size, saved_read_buf_size,
	  write_buf_size, seek, truncate]: Use `scm_t_off' instead of `off_t' so
	  that the layout and size of the structure does not depend on the
	  application's `_FILE_OFFSET_BITS' value.  Reported by Bill
	  Schottstaedt, see
	  http://lists.gnu.org/archive/html/bug-guile/2009-06/msg00018.html.
	  (scm_set_port_seek, scm_set_port_truncate): Update.

	* libguile/ports.c (scm_set_port_seek, scm_set_port_truncate): Use
	  `scm_t_off' and `off_t_or_off64_t'.

	* libguile/fports.c (fport_seek, fport_truncate): Use `scm_t_off'
	  instead of `off_t'.

	* libguile/r6rs-ports.c (bip_seek, cbp_seek, bop_seek): Use `scm_t_off'
	  instead of `off_t'.

	* libguile/rw.c (scm_write_string_partial): Likewise.

	* libguile/strports.c (st_resize_port, st_seek, st_truncate): Likewise.

	* doc/ref/api-io.texi (Port Implementation): Update prototype of
	  `scm_set_port_seek ()' and `scm_set_port_truncate ()'.

	* NEWS: Update.

	Fix `load-objcode' FD/mapping leak occurring upon failure.
	* libguile/objcodes.c (make_objcode_by_mmap): Close FD and unmap ADDR
	  upon failure.

2009-06-24  Andy Wingo  <wingo@pobox.com>

	allow primcall ops to push 0 values
	* libguile/objcodes.c (OBJCODE_COOKIE): Bump the objcode cookie. We'll
	  be doing this on incompatible changes until 2.0.

	* libguile/vm-i-scheme.c (set_car, set_cdr, slot_set): These
	  instructions don't have natural return values -- so declare them that
	  way, that they push 0 values.

	* module/language/tree-il/compile-glil.scm (flatten): When compiling
	  primitive calls, check `(instruction-pushes op)' to see how many
	  values that instruction will push, and do something appropriate,
	  instead of just assuming that all primcall ops push 1 value.

	remove lambda wrap hack of brainfuck tree-il compiler
	* module/language/brainfuck/compile-tree-il.scm (compile-tree-il):
	  Remove the hack where we wrapped the compiled code in a `lambda',
	  because not only should the tree-il compiler optimize that away, it
	  was really papering around other inefficiencies, and obtuse to boot.

2009-06-24  Neil Jerram  <neil@ossau.uklinux.net>

	Remove AC_SYS_RESTARTABLE_SYSCALLS and related code
	As the Autoconf documentation says, "These days portable programs
	[...] should not rely on `HAVE_RESTARTABLE_SYSCALLS', since nowadays
	whether a system call is restartable is a dynamic issue, not a
	configuration-time issue."

	In other words, if we ever rely on HAVE_RESTARTABLE_SYSCALLS, we are
	at the mercy of any code that Guile happens to be linked with, because
	that code could install a signal handler without the SA_RESTART flag,
	and then a Guile system call could unexpectedly return EINTR.

	The readline part of this goes back to this problem report:
	http://sources.redhat.com/ml/guile/2000-05/msg00177.html; and is an
	excellent example of the above paragraph.  It was noted during the
	discussion that undefining HAVE_RESTARTABLE_SYSCALLS would fix the
	problem, but that solution wasn't adopted - I guess because Guile was
	still using cooperative threads then (not pthreads) and so there was a
	significant concern (whether founded or not) that not using
	restartable syscalls (where available) could lead to a loss of
	performance.

	Now Guile's default mode of operation is with pthreads, where we
	already don't assume that HAVE_RESTARTABLE_SYSCALLS is reliable, so
	there is no possible further performance loss.  And in any case we
	really have no choice, if we want correct operation.

	Thanks to Sylvain Beucler for reporting this and suggesting the fix.

	* configure.in (AC_SYS_RESTARTABLE_SYSCALLS): Removed.

	* doc/ref/posix.texi (Signals): Remove statement that Guile always
	  sets SA_RESTART flag.

	* guile-readline/configure.in (GUILE_SIGWINCH_SA_RESTART_CLEARED):
	  Remove this setting, together with its test code.
	  (HAVE_RL_PRE_INPUT_HOOK): Remove this setting and its code, as no
	  longer needed.

	* guile-readline/readline.c (sigwinch_enable_restart): Removed.
	  (scm_init_readline): Remove setting of rl_pre_input_hook.

	* libguile/_scm.h (SCM_SYSCALL): Remove the definition that relies on
	  HAVE_RESTARTABLE_SYSCALLS.

	* libguile/scmsigs.c (scm_sigaction_for_thread): Don't always set the
	  SA_RESTART flag if available.  Update docstring accordingly.
	  (scm_init_scmsigs): Remove code that sets SA_RESTART flag for all
	  signals.

	* THANKS: Add Sylvain.

2009-06-22  Andy Wingo  <wingo@pobox.com>

	flush whitespace from the repl input buffer *before* evaluation
	* module/system/repl/repl.scm (start-repl): Given that the input port of
	  the repl is line-buffered, it's likely we have #\newline in the input
	  that is strictly extraneous, an in-band indicator to the repl that it
	  should begin reading now. So flush out that newline, so that you can
	  (read-char) at the repl, and it actually does wait for you to type in
	  a char instead of just returning #\newline.

	  While it's not an overriding concern, this does fix some brainfuck
	  programs that want to input from the user.

	more docs to brainfuck->tree-il compiler
	* module/language/brainfuck/compile-tree-il.scm (compile-tree-il): Wrap
	  the result in a ((lambda () ...)), so we can use toplevel-ref. Add
	  lots more comments.

	meta-commands read off their own arguments
	* module/system/repl/command.scm: Update copyright.
	  (meta-command): Rework so that it's the various meta-commands that do
	  the reading for their arguments. This way you can compile forms that
	  span more than one line, and forms that need to be read with another
	  language's reader.
	  (define-meta-command): New helper macro. Update commands to use it.
	  (help): Allow ,help on commands too.

	* module/system/repl/repl.scm: Update copyright.
	  (start-repl): Adjust to give meta-command what it wants.

2009-06-22  Ludovic Courtès  <ludo@gnu.org>

	Always create the bytevector SMOB type.
	* libguile/bytevectors.c (scm_tc16_bytevector, print_bytevector,
	  bytevector_equal_p, free_bytevector): Don't use the snarfing macros.
	  (scm_bootstrap_bytevectors): New.
	  (scm_init_bytevectors): No longer initialize SCM_NULL_BYTEVECTOR,
	  which is done by `scm_bootstrap_bytevectors ()'.

	* libguile/bytevectors.h (scm_bootstrap_bytevectors): New declaration.
	  (scm_init_bytevectors): Made internal.  This can be done because we
	  explicitly register it with `scm_c_register_extension ()' in
	  `scm_bootstrap_bytevectors ()'.

	* libguile/init.c (scm_i_init_guile): Call `scm_bootstrap_bytevectors ()'.
	  This is so that expressions like "(generalized-vector-length #vu8())"
	  work even when `(rnrs bytevector)' hasn't been loaded.

	Make bytevectors accessible using the generalized-vector API.
	As a side effect, this allows compilation of literal bytevectors
	("#vu8(...)"), which gets done by the generic array handling
	of the GLIL->assembly compiler.

	* doc/ref/api-compound.texi (Generalized Vectors): Mention bytevectors.
	  (Arrays, Array Syntax): Likewise.

	* doc/ref/api-data.texi (Bytevectors as Generalized Vectors): New node.

	* libguile/bytevectors.c (scm_i_bytevector_generalized_set_x): New.

	* libguile/bytevectors.h (scm_i_bytevector_generalized_set_x): New
	  declaration.

	* libguile/srfi-4.c (scm_i_generalized_vector_type,
	  scm_array_handle_uniform_element_size,
	  scm_array_handle_uniform_writable_elements): Add support for
	  bytevectors.

	* libguile/unif.c (type_creator_table): Add `vu8'.
	  (bytevector_ref, bytevector_set): New functions.
	  (memoize_ref, memoize_set): Add support for bytevectors.

	* libguile/vectors.c (scm_is_generalized_vector,
	  scm_c_generalized_vector_length, scm_c_generalized_vector_ref,
	  scm_c_generalized_vector_set_x): Add support for bytevectors.

	* test-suite/tests/bytevectors.test ("Generalized Vectors"): New test
	  set.

	bytevectors: Add a C-friendly API.
	* doc/ref/api-data.texi (Bytevector Manipulation): Add
	  `scm_is_bytevector ()', `scm_c_bytevector_length ()',
	  `scm_c_bytevector_length ()', and `scm_c_bytevector_set_x ()'.

	* libguile/bytevectors.c (scm_is_bytevector, scm_c_bytevector_length,
	  scm_c_bytevector_ref, scm_c_bytevector_set_x): New functions.
	  (scm_bytevector_p): Use `scm_is_bytevector ()'.
	  (scm_bytevector_length): Use `scm_c_bytevector_length ()'.

	* libguile/bytevectors.h (scm_is_bytevector, scm_c_bytevector_length,
	  scm_c_bytevector_ref, scm_c_bytevector_set_x): New declarations.

	bytevectors: Use `size_t' rather than `unsigned' for sizes.
	* doc/ref/api-data.texi (Bytevector Manipulation): Update.

	* libguile/bytevectors.c (INTEGER_ACCESSOR_PROLOGUE,
	  make_bytevector_from_buffer, scm_c_make_bytevector,
	  scm_c_take_bytevector, scm_i_shrink_bytevector): Use `size_t' for
	  bytevector lengths.

	Fix documentation of `make-bytevector'.
	* doc/ref/api-data.texi (Bytevector Manipulation): Fix documentation of
	  the FILL argument of `make-bytevector'.

2009-06-21  Andy Wingo  <wingo@pobox.com>

	add brainfuck->tree-il compiler
	* module/Makefile.am (BRAINFUCK_LANG_SOURCES): Compile at the end. Add
	  compile-tree-il.scm.

	* module/language/brainfuck/compile-tree-il.scm: New compiler, compiles
	  to tree-il instead of scheme. I thought it would be more illustrative,
	  though there are some uncommented bits.

	* module/language/brainfuck/parse.scm: Modify not to put a header on the
	  scheme representation. After all, we don't put <scheme> before scheme
	  code, do we? :)

	* module/language/brainfuck/spec.scm: Add tree-il compiler.

	* module/language/tree-il.scm: Understand (set! (lexical foo) ...).

	* module/system/base/language.scm: Update license. Actually, updates
	  licenses on all these.

	formatting changes to (language brainfuck compile-scheme)
	* module/language/brainfuck/compile-scheme.scm: Standalone comments
	  should have more than one semicolon, and update copyright to LGPLv3+.

	link to brainfuck wikipedia page
	* doc/ref/compiler.texi: Point to more info on Brainfuck. Patch by
	  Daniel Kraft.

2009-06-21  Daniel Kraft  <d@domob.eu>

	added documenting comments to the brainfuck compiler and mention it in the VM documentation.
	* doc/ref/compiler.texi: Mention the new brainfuck compiler as an example.
	* module/language/brainfuck/compile-scheme.scm: Add a lot of documentation comments.
	* module/language/brainfuck/parse.scm: Ditto.
	* module/language/brainfuck/spec.scm: Ditto.

	basic brainfuck -> scheme example compiler.
	* module/Makefile.am: Install the brainfuck compiler modules.
	* module/language/brainfuck/spec.scm: New file.
	* module/language/brainfuck/parse.scm: New file.
	* module/language/brainfuck/compile-scheme.scm: New file.

2009-06-21  Andy Wingo  <wingo@pobox.com>

	remove obsolete guile-vm.texi
	* doc/guile-vm.texi: Remove, has been folded into the Guile manual for a
	  while now.

	* doc/Makefile.am: Remove guile-vm.texi.

	update .gitignore
	* .gitignore: Update.

2009-06-21  Neil Jerram  <neil@ossau.uklinux.net>

	Deterministic test for the r6rs-ports.test segmentation fault
	* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports"): Add (gc), to
	  test the (ex-)bug in cbp_mark () when marking a closed port.

2009-06-21  Andy Wingo  <wingo@pobox.com>

	Fix crash when marking closed custom bytevector port
	* libguile/r6rs-ports.c (cbp_mark): A closed port will have had its
	  stream destroyed, so don't dereference the stream in that case. Patch by
	  Mike Gran.

2009-06-20  Andy Wingo  <wingo@pobox.com>

	put autocompiled files into ~/.cache or $XDG_CACHE_HOME
	* module/system/base/compile.scm (compiled-file-name): Remove unneeded
	  path separator.

	* libguile/load.c (scm_init_load_path): Change so the default cache path
	  is ~/.cache/guile/ccache/1.9, and respect $XDG_CACHE_HOME.

	fix source information lossage for (define (foo) ...) lambda sugar
	* module/ice-9/psyntax.scm (source-wrap): Use decorate-source, for
	  clarity.
	  (syntax-type): When turning the RHS of (define (foo) ...) into a
	  lambda, decorate the resulting lambda expression with source
	  information, as the RHS later goes to chi-expr, which receives no
	  source information. Perhaps that is a bug. In any case, fixes some
	  source location lossage, reported by Jao.

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

	better error in make_objcode_by_mmap
	* libguile/objcodes.c (make_objcode_by_mmap): Better error when the
	  object header is incorrect.

	source information for the interpreter
	* module/ice-9/psyntax.scm: Try to propagate source information when
	  generating output for the interpreter.

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

2009-06-19  Ludovic Courtès  <ludo@gnu.org>

	Make `cond-expand' compilable.
	* module/ice-9/boot-9.scm (cond-expand): Changed into a `define-macro'
	  macro.

	Fix copyright year and authorship of `guile-tools'.

	Slightly improve `NEWS'.

	Fix "guile-tools disassemble".
	* module/scripts/disassemble.scm (disassemble): Accept a variable number
	  of arguments.  Invoke the right `disassemble' procedure.

2009-06-19  Andy Wingo  <wingo@pobox.com>

	don't autocompile at installcheck
	* examples/Makefile.am: Don't autocompile our tests at installcheck
	  time.

	new function: canonicalize-path. use when autocompiling
	* libguile/filesys.h:
	* libguile/filesys.c (scm_canonicalize_path): New function,
	  canonicalize-path.

	* module/system/base/compile.scm (compiled-file-name): Canonicalize the
	  filename so that compiling e.g. ../foo.scm doesn't compile to
	  ~/.guile-ccache/1.9/../foo.scm.

	gnulib-tool --import canonicalize-lgpl

	generate changelogs at dist time
	* Makefile.am: Add rule to make a ChangeLog at dist-time. The rule comes
	  from coreutils.

	* build-aux/gitlog-to-changelog: New helper script, from gnulib.

	rename SCM_SNAME to SCM_SUBR_NAME
	* libguile/procs.h: Rename SCM_SNAME to SCM_SUBR_NAME.

	* libguile/debug.c:
	* libguile/eval.c:
	* libguile/eval.i.c:
	* libguile/goops.c:
	* libguile/gsubr.c:
	* libguile/print.c:
	* libguile/procs.c: Update callers.

	another draft of NEWS
	* NEWS: Another draft.

2009-06-19  Ludovic Courtès  <ludo@gnu.org>

	Fix decompilation of the `load-array' instruction.
	This allows, e.g., ",c #u8(1 2 3)" at the REPL to actually work instead
	of failing to decode `load-array'.

	* module/language/assembly/decompile-bytecode.scm (decode-bytecode):
	  Account for the `load-array' instruction, which is followed by a
	  bytevector instead of a string.  We should find a more elegant way to
	  do that.

	Fix the REPL's `,compile' command.
	* module/system/repl/command.scm (compile): Use `guile:disassemble'
	  instead of the former `disassemble-objcode'.

	Implement R6RS bytevector read syntax.
	* libguile/read.c (scm_read_bytevector): New function.
	  (scm_read_sharp): Add `v' case for bytevectors.

	* test-suite/lib.scm (exception:read-error): New variable.

	* test-suite/tests/bytevectors.test ("Datum Syntax"): New test set.

	Fix `equal?' on bytevectors.
	* libguile/bytevectors.c (bytevector_equal_p): New function.

	* test-suite/tests/bytevectors.test ("2.3 Operations on Bytes and
	  Octets")["equal?"]: New test.

2009-06-18  Ludovic Courtès  <ludo@gnu.org>

	Import documentation for the R6RS bytevector and port APIs.
	* doc/ref/api-compound.texi (Uniform Numeric Vectors): Add xref to the
	  bytevector API.

	* doc/ref/api-data.texi (Bytevectors): New node.

	* doc/ref/api-io.texi (R6RS I/O Ports): New node.

2009-06-18  Andy Wingo  <wingo@pobox.com>

	update NEWS, THANKS
	* NEWS: Update, but only partially. I wanted to push out this
	  incomplete, not yet organized draft for review, if anyone had
	  comments. I'll pick it up tomorrow morning.

	* THANKS: Add Juhani, whose last name changed?

2009-06-17  Neil Jerram  <neil@ossau.uklinux.net>

	Change guile-readline license to GPLv3+

	Complete changing license to LGPLv3+
	(Still guile-readline to do, but that will all be GPLv3+.)

	Reinstate lines removed by mistake from chars.test

	Change Guile license to LGPLv3+
	(Not quite finished, the following will be done tomorrow.
	   module/srfi/*.scm
	   module/rnrs/*.scm
	   module/scripts/*.scm
	   testsuite/*.scm
	   guile-readline/*
	)

2009-06-14  Neil Jerram  <neil@ossau.uklinux.net>

	Update README on using libraries in non-standard locations
	* README: Update instructions on using libraries in non-standard
	  locations.  Also change expected next stable release number from
	  1.10.0 to 2.0.0.

	Add Tex and texinfo output and auxiliary suffixes to .gitignore

	Provide easier configure options for GMP and readline
	This patch uses the AC_LIB_LINKFLAGS macro, provided by Gnulib's
	havelib module, to provide --with-gmp-prefix and
	--with-readline-prefix configure options.  Many thanks to Bruno Haible
	for suggesting and explaining this to me.

	* configure.in (top level): Add AC_LIB_LINKFLAGS(gmp).

	* guile-readline/configure.in (AC_CONFIG_AUX_DIR): Change to
	  ../build-aux, to share the main build-aux directory and so avoid
	  having to distribute multiple copies of config.rpath.
	  (top level): Add AC_LIB_LINKFLAGS(readline).

	* lib/Makefile.am, m4/gnulib-cache.m4: Regenerated by gnulib-tool for
	  new import of the `havelib' module.

2009-06-13  Neil Jerram  <neil@ossau.uklinux.net>

	Fix for make distcheck
	* examples/Makefile.am (AM_CFLAGS, AM_LIBS): Set PATH so that
	  guile-config can find guile.

	Fix `make distcheck'
	* libguile/r6rs-ports.c (scm_init_r6rs_ports): Add libguile/ to
	  included .x file name.

2009-06-12  Neil Jerram  <neil@ossau.uklinux.net>

	Note Andy as a contributor

2009-06-10  Andy Wingo  <wingo@oblong.net>

	fix defmacro*, defmacro*-public
	* module/ice-9/boot-9.scm (define-private): Remove apocyphal comment. The
	  FIXME would really be to remove `define-private', though...

	* module/ice-9/optargs.scm (defmacro*, defmacro*-public): Fix these
	  macros. Thanks to Dale Smith for the report.

	bump default stack limit to 160000 words
	* libguile/eval.c (scm_debug_opts): Up the default stack limit by a
	  factor of 4. Psyntax expansions currently bounce back and forth between
	  the VM and the interpreter, due to `map'. (Hopefully that won't be the
	  case in the future, when have map in scheme, and we get an inliner.)
	  Anyway when expanding a big nested expression, as for example in
	  (language ecmascript compile-ghil) -- the pmatch code ends up being
	  super-nested -- we can consume loads o stack.

	  So given that on desktop machines, where rlimit is likely to be unset,
	  default rlimits are around 8 or 10 MB or so, let's bump up our default
	  limit to 640KB (on 32-bit). Should be enough for anyone.

	  See http://thread.gmane.org/gmane.lisp.guile.devel/8599/focus=8662 for
	  more info. Thanks to Mark H. Weaver for the diagnosis!

2009-06-10  Andy Wingo  <wingo@pobox.com>

	fix debug-options
	* module/ice-9/boot-9.scm (define-option-interface): Fix (debug-options
	  'full), along with other options. Thanks to Mark Weaver for the tip.

	* THANKS: Update, though many more names need to be added.

2009-06-09  Andy Wingo  <wingo@pobox.com>

	some attempts to solve the ecmascript stack overflow problem
	* module/language/ecmascript/compile-ghil.scm (comp): Just use pmatch,
	  not ormatch. Now with syncase running over everything, it doesn't
	  matter.

	* module/ice-9/boot-9.scm (false-if-exception): Avoid saving stacks
	  inside false-if-exception. There's probably a more general solution to
	  this, though. Fixes getting bogus backtraces sometimes.

	* module/Makefile.am (ECMASCRIPT_LANG_SOURCES): Reorder things so that
	  spec comes last.

2009-06-09  Daniel Kraft  <d@domob.eu>

	First code for elisp compilation, handling a very limited set of operations (but not really usable yet).
	* module/language/elisp/README: New file containing some notes.
	* module/language/elisp/compile-tree-il.scm: New file with compilation code.
	* module/language/elisp/spec.scm: Updated language definition.

2009-06-08  Andy Wingo  <wingo@pobox.com>

	a start to changing VM scheme copyrights
	* module/language/tree-il/primitives.scm: Change copyright to LGPLv2.1.
	  Others will follow.

	pretty-print psyntax-pp.scm
	* module/ice-9/compile-psyntax.scm: Pretty-print psyntax-pp.scm, given
	  that we are going to compile it anyway.

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

2009-06-08  Andy Wingo  <wingo@oblong.net>

	don't autocompile snarfing m4 docs
	* doc/ref/Makefile.am (autoconf-macros.texi): Yet another place we
	  shouldn't autocompile.

2009-06-08  Andy Wingo  <wingo@pobox.com>

	fix bootstrapping after last night's psyntax patch
	* module/Makefile.am (ice-9/psyntax-pp.scm): Don't try autocompiling when
	  making psyntax-pp.scm.

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

	* module/ice-9/psyntax.scm (chi-top): Only affect the compile-time
	  environment if modules have booted.

	call-with-values can make fewer closures
	* module/language/tree-il.scm: Rename let-exp and letrec-exp to let-body
	  and letrec-body. Add <let-values>, a one-expression let-values that
	  should avoid the needless creation of two closures in many common
	  multiple-value cases. We'll need to add an optimization pass to the
	  compiler to produce this form, though, as well as rewriting lambdas
	  into lets, etc.

	  I added this form instead of adding more special cases to the
	  call-with-values compile code because it's a useful intermediate form
	  -- it will allow the optimizer to perform constant folding across more
	  code.

	* module/language/tree-il.scm (parse-tree-il, unparse-tree-il)
	  (tree-il->scheme, post-order!, pre-order!): Adapt to let/letrec body
	  renaming, and let-values.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Adapt for
	  renaming, and add cases for let-values.

	* module/language/tree-il/compile-glil.scm (flatten): Add a new context,
	  `vals', used by let-values code for the values producer. Code that
	  produces multiple values can then jump to the let-values MV return
	  address directly, instead of trampolining into a procedure. Add code to
	  compile let-values.

2009-06-07  Andy Wingo  <wingo@pobox.com>

	fix incorrect inlining of + when + is locally redefined
	* libguile/vm-i-scheme.c (FUNC2): Use a signed value for the intermediate
	  result here. Not sure what the effect is, though.

	* module/ice-9/psyntax.scm (chi-top): Toplevel definitions ensure that
	  variables are defined in the current module. Fixes the specific case of
	  guile-lib's md5.scm, which redefines + -- this code is needed so that
	  we don't incorrectly open-code +.

	* module/language/tree-il/primitives.scm (resolve-primitives!): I think
	  there were some cases in which vars and names would not resolve
	  properly here. Fix those.

	new instructions: make-int64, make-uint64
	* doc/ref/vm.texi (Loading Instructions): Remove references to
	  load-integer and load-unsigned-integer -- they're still in the VM but
	  will be removed at some point.
	  (Data Control Instructions): Add make-int64 and make-uint64.

	* libguile/vm-i-loader.c (load-unsigned-integer): Allow 8-byte values.
	  But this instruction is on its way out, yo.

	* libguile/vm-i-system.c (make-int64, make-uint64): New instructions.

	* module/language/assembly.scm (object->assembly): Write out make-int64
	  and make-uint64 instructions, using bytevectors to do the endianness
	  conversion.
	  (assembly->object): And pretty-print them back, for disassembly.

	* module/language/glil/compile-assembly.scm: Don't generate load-integer
	  / load-unsigned-integer instructions.

	fix bug in goops' method cache with rest args
	* module/oop/goops/compile.scm (code-table-lookup): Fix a tricky little
	  bug!

	* test-suite/tests/goops.test ("the method cache"): Add a wee test.

2009-06-06  Neil Jerram  <neil@ossau.uklinux.net>

	Fix popen.test on NetBSD and Ubuntu Jaunty, where sh is not Bash
	Thanks to Greg Troxel for reporting, and Barry Fishman for the
	explanation and fix.

	* test-suite/tests/popen.test ("open-input-pipe"): Use shell function
	  `read' with an explicit argument, as apparently not all shells
	  support read with no argument.

2009-06-06  Andy Wingo  <wingo@pobox.com>

	support ((@ ...) ...) where the car is a macro
	* module/ice-9/psyntax.scm (syntax-type): Remove `external-macro', not
	  used any more. Take an extra arg, `for-car?', indicating that we're
	  checking on the type of a form in the car position. In the case that
	  the expression is a pair, do a full recursion on the car, which allows
	  us to catch the fact that the car of the following form is a macro:
	     ((@ (ice-9 optargs) let-optional) ...)
	  and thus the form itself should be macroexpanded.

	  But, since we want to distingush `lambda' from `(lambda ...)', just as
	  we have global and global-call, we have core to the new `core-form'.

	  (chi-top, chi, chi-expr, chi-body, set!): Adapt to changes to
	  syntax-type.

2009-06-05  Neil Jerram  <neil@ossau.uklinux.net>

	State and explain dependency on libtool 2.2
	* HACKING: Updated to recommend libtool 2.2 and anti-recommend libtool
	  1.5.26.

	Fix `Mismatching FUNC_NAME' warning from guile-func-name-check
	* libguile/bytevectors.c (FUNC_NAME): Change to match function name.

2009-06-05  Andy Wingo  <wingo@pobox.com>

	add ability to compile uniform arrays
	* module/rnrs/bytevector.scm (rnrs):
	* libguile/bytevectors.h:
	* libguile/bytevectors.c (scm_uniform_array_to_bytevector): New function.

	* libguile/unif.h:
	* libguile/unif.c (scm_from_contiguous_typed_array): New function.

	* libguile/vm-i-loader.c (load-array): New instruction, for loading byte
	  data into uniform vectors. Currently it copies out the data, though in
	  the future we could avoid that.

	* module/language/assembly.scm (align-code): New exported function,
	  aligns code on some boundary.
	  (align-program): Use align-code.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Support
	  the load-array instruction.

	* module/language/glil/compile-assembly.scm (dump-object): Dump uniform
	  arrays. Neat :)

	add long-object-ref, long-toplevel-ref, long-toplevel-set
	* libguile/vm-i-system.c (long-object-ref, long-toplevel-ref)
	  (long-toplevel-set): Add new instructions, for accessing the object
	  table with a 16-bit offset. HTMLprag defines a test program that has
	  more than 256 constants, necessitating this addition.

	* doc/ref/vm.texi: Mention the new instructions.

	* module/language/glil/compile-assembly.scm: Emit long refs for object
	  tables bigger than 256 entries.

	disable autocompilation when running guile-tools compile
	* module/scripts/compile.scm (compile): Disable autocompilation when
	  running guile-tools compile.

	refactoring for toplevel-ref, toplevel-set, link-now
	* libguile/vm-i-system.c (toplevel-ref, toplevel-set)
	* libguile/vm-i-loader.c (link-now):
	* libguile/vm.c (resolve_variable): Factor out common code to a static
	  method. The compiler can still inline it, so it shouldn't have a
	  significant performance effect.

	* libguile/vm-engine.c (vm_error_no_such_module): Remove now-unused
	  label.

	add gperf-generated files to git
	* lib/iconv_open-osf.h:
	* lib/iconv_open-aix.h:
	* lib/iconv_open-hpux.h:
	* lib/iconv_open-irix.h: Add to git. Should remove build-time dep on
	  gperf; we'll see if this causes problems.

	stamp .go with timestamp of .scm; a fresh go has same mtime of .scm
	* libguile/load.c (compiled_is_fresh): Rename from compiled_is_newer.
	  Check that the mtines of the .go and .scm match exactly, so we don't
	  get fooled by rsync-like modifications of the filesystem.

	* module/system/base/compile.scm (call-with-output-file/atomic): Add
	  optional arg, a reference file. If present we utime the output file to
	  match the source file, before the rename.
	  (compile-file): Stamp the .go file with the timestamp of the .scm.

	compile and install srfi-98.
	* module/Makefile.am (SRFI_SOURCES): Add SRFI-98.

	final (?) tweaks to the autocompile code
	* libguile/load.c (do_try_autocompile): Use module_variable, not
	  module_lookup, when resolving compile-file, so we get #f instead of an
	  exception if the compiler is in the process of being loaded.
	  (scm_primitive_load_path): In what I hope is the last patch to this
	  code, recheck the fallback path if we found a stale installed .go file.

	simplify autocompilation some more
	* libguile/load.c (scm_init_load_path): Set the fallback path even if
	  GUILE_SYSTEM_COMPILED_PATH is set. Now that we store full paths in the
	  autocompiled files, and the path contains the effective Guile version,
	  there's no danger of accidental collisions.
	  (do_try_autocompile, autocompile_catch_handler, scm_try_autocompile):
	  Simplify again -- since there's only one place we put autocompiled
	  files, and compile-file finds it itself, there's no need to pass along
	  the compiled file path.
	  (scm_primitive_load_path): Don't call out to compiled-file-name to get
	  the fallback path, as we might not be autocompiling, and besides that
	  we need to check if the file exists at all.

	* module/system/base/compile.scm (compiled-file-name): Simplify again.
	  The auto-compiled path is just fallback path + full source path + .go.

	further autocompilation tweaks
	* module/system/base/compile.scm (compiled-file-name):
	* libguile/load.c (scm_init_load_path, scm_try_autocompile)
	  (scm_primitive_load_path): Rework so that we search for .go files in
	  the load-compiled path and in the fallback path, but we only
	  autocompile to the fallback path. Should produce a more desirable experience.

2009-06-04  Andy Wingo  <wingo@pobox.com>

	propagate timestamps to installed .scm and .go files
	* am/guilec: Propagate timestamps of .scm and .go files on to their
	  installed variants. Helps the is-the-.go-file-stale? code do its job.

2009-06-04  Andy Wingo  <wingo@oblong.net>

	fix .go installation
	* am/guilec (nobase_ccache_DATA): Fix .go installation.

	turn off autocompilation when snarfing
	* libguile/Makefile.am (snarf2checkedtexi): Turn off autocompilation when
	  snarfing.

2009-06-03  Andy Wingo  <wingo@pobox.com>

	fix error autocompiling parts of the compiler; make check works
	* libguile/load.c (scm_try_autocompile): Punt if compiled-file-name does
	  not resolve, which would indicate that the file in question is part of
	  the compiler itself.

	* test-suite/tests/elisp.test: Today I was an evil one -- disable
	  autocompilation for the elisp tests, as they are meant only for the
	  memoizer's eyes. Hopefully Daniel will fix this :-)

	tweaks to autocompile code
	* libguile/load.c (compiled_is_newer): Tweak diagnostic output.
	  (do_try_autocompile, autocompile_catch_handler, scm_try_autocompile):
	  Rework to compute the name of the compiled file in advance. If the
	  computed name is different from the found .go file and is fresh, use it
	  directly.

	  Fixes the case where /usr/lib/.../foo.go is out of date but the user
	  doesn't have permissions to recompile, so we use the user's local
	  compile cache instead if it's fresh.

	  (scm_primitive_load): Pass the found .go file as well to
	  scm_try_autocompile.

	implement autocompilation
	* am/guilec (.scm.go): Set GUILE_AUTO_COMPILE=0 when compiling individual
	  files, and remove the mkdir -p as compile-file takes care of that now.

	* libguile/load.c (do_try_autocompile, autocompile_catch_handler)
	  (scm_try_autocompile, scm_init_load): Implement autocompilation.

	* libguile/script.c (scm_shell_usage, scm_compile_shell_switches): Add
	  --autocompile / --no-autocompile command-line options, and support for
	  the GUILE_AUTO_COMPILE environment variable, defaulting to
	  autocompilation enabled.

	add exception_on_error optional arg to primitive-load-path
	* libguile/init.c (scm_load_startup_files): Use
	  scm_c_primitive_load_path.

	* libguile/load.c (scm_primitive_load_path): Add an optional arg,
	  exception_on_error, which if #f will cause primitive-load-path to just
	  return #f if no file is found. This is to help out the semantics of
	  try-module-autoload. We can't just catch misc-error, because loading
	  the file could raise any exception.
	  (scm_c_primitive_load_path): Add the extra arg to
	  scm_primitive_load_path.

	* libguile/load.h: Adapt scm_primitive_load_path prototype.

	* module/ice-9/boot-9.scm (try-module-autoload): Refactor slightly to be
	  clearer.

	refactors to load.c to support auto-compilation
	* libguile/load.c (compiled_is_newer): Factored out of
	  scm_primitive_load_path.
	  (scm_try_autocompile): New stub, for autocompiling. Currently just
	  returns false.
	  (scm_primitive_load_path): Refactor, and call out to
	  scm_try_autocompile if the .go is missing or not fresh.

	compiled-file-name tries to put the .go in the %load-compiled-path
	* module/system/base/compile.scm (ensure-writable-dir): Rename from
	  ensure-directory.
	  (dsu-sort): Helper, does a decorate / sort / undecorate.
	  (compiled-file-name): Refactor to only return a writable filename. The
	  readable case is handled by load.c now, and the other case was silly.
	  Hopefully it will do the right thing.
	  (load-ensuring-compiled): Remove, load.c will call out to compile-file
	  if necessary.
	  (ensure-fallback-path): Remove, load.c will add the ~/.guile-ccache dir
	  to the load-compiled path, which will prompt its creation if necessary.

	install .go files under $libdir, not $datadir
	* am/guilec: Install .go files to
	  $(pkglibdir)/$GUILE_EFFECTIVE_VERSION/ccache.

	file-exists? doesn't cause a throw, simpler try-module-autoload
	* module/ice-9/boot-9.scm (file-exists?): Change to use the stat
	  interface that doesn't throw exceptions.
	  (try-module-autoload): Simplify to take advantage of the fact that
	  primitive-load-path does the right thing with regards to loading
	  compiled files if they are available.

	update uninstalled-env.in for load-compiled path separation
	* meta/uninstalled-env.in: Update to set GUILE_LOAD_COMPILED_PATH and
	  GUILE_SYSTEM_COMPILED_PATH.

	add exception-on-error optional arg to `stat' in scheme
	* libguile/filesys.h:
	* libguile/filesys.c (scm_stat): Add optional arg, exception-on-error,
	  which if #f (not the default) will just return #f instead of raising an
	  exception if the stat fails.

	separate the load-compiled path from the load path
	* libguile/Makefile.am (libpath.h): Add definitions for SCM_CCACHE_DIR
	  and SCM_EFFECTIVE_VERSION. These are private, the header is not
	  installed. Add ccachedir to build-info. Rework some other build-info
	  definitions.

	* libguile/load.c (scm_loc_load_compiled_path): New global, corresponding
	  to the new environment variable, GUILE_LOAD_COMPILED_PATH. Compiled
	  files will now be searched for in this path, and only in this path.
	  (scm_init_load_path): Init the load-compiled path too. We initialize it
	  with $pkglibdir/guile/$effective_version/ccache, and also with
	  $HOME/.guile-ccache/$effective_version/. This will respect the
	  libdir/datadir difference, and it is a preparation for automatic
	  compilation support.
	  (scm_primitive_load_path): Search only the GUILE_LOAD_COMPILED_PATH for
	  compiled files.
	  (scm_init_load): Cache scm_loc_load_compiled_path.

2009-06-02  Julian Graham  <julian@transmetropolitan.(none)>

	Merge branch 'master' of git://git.savannah.gnu.org/guile

2009-05-31  Julian Graham  <julian@transmetropolitan.(none)>

	Implementation of SRFI-98 (An interface to access environment variables).
	* NEWS: Add SRFI-98 to 1.8.7 features.

	* doc/ref/srfi-modules.text (SRFI-98): Documentation for SRFI-98.

	* module/srfi/srfi-98.scm: New file.  SRFI-98 implementation.

	* test-suite/tests/srfi-98.test: New file.  SRFI-98 unit tests.

2009-05-29  Andy Wingo  <wingo@pobox.com>

	Merge branch 'syncase-in-boot-9'
	Conflicts:
		module/Makefile.am

2009-05-28  Ludovic Courtès  <ludo@gnu.org>

	Import R6RS bytevectors and I/O ports from Guile-R6RS-Libs 0.2.
	* README: Document dependency on GNU libunistring.

	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
	  `benchmark/bytevectors.bm'.

	* configure.in: Make sure we have libunistring; update $LIBS.

	* libguile.h: Include "bytevectors.h" and "r6rs-ports.h".

	* libguile/Makefile.am (libguile_la_SOURCES): Add `bytevectors.c' and
	  `r6rs-ports.c'
	  (DOT_X_FILES): Add `bytevectors.x' and `r6rs-ports.x'.
	  (DOT_DOC_FILES): Add `bytevectors.doc' and `r6rs-ports.doc'.
	  (noinst_HEADERS): Add `ieee-754.h'.
	  (modinclude_HEADERS): Add `bytevectors.h' and `r6rs-ports.h'

	* libguile/validate.h (SCM_VALIDATE_BYTEVECTOR): New macro.

	* module/Makefile.am (SOURCES): Add $(RNRS_SOURCES).
	  (RNRS_SOURCES): New variable.

	* test-suite/Makefile.am (SCM_TESTS): Add `bytevectors.test' and
	  `r6rs-ports.test'.

	Use GNU libunistring and Gnulib modules needed by R6RS bytevectors and ports.
	* m4/gnulib-cache.m4 (gl_MODULES): Add `byteswap', `iconv_open-utf',
	  `libunistring', `striconveh', and `string'.

2009-05-28  Andy Wingo  <wingo@pobox.com>

	add tests for #' etc
	* test-suite/tests/reader.test ("#'"): Add tests for the hash-syntax
	  reader macros.

	add reader tests for #;
	* test-suite/tests/reader.test ("#;"): Add reader tests for #;.

	add reader support for #; #` #' #, and #,@. fix bug in compile-and-load.
	* libguile/read.c (flush_ws, scm_read_commented_expression)
	  (scm_read_sharp): Add support for commenting out expressions with #;.
	  (scm_read_syntax, scm_read_sharp): Add support for #', #`, #, and #,@.

	* module/ice-9/boot-9.scm: Remove #' read-hash extension, which actually
	  didn't do anything at all. It's been there since 1997, but no Guile
	  code I've ever seen uses it, and it conflicts with #'x => (syntax x)
	  from modern Scheme.

	* module/system/base/compile.scm (compile-and-load): Whoops, fix a number
	  of bugs here.

2009-05-27  Neil Jerram  <neil@ossau.uklinux.net>

	Remove possible deadlock in scm_join_thread_timed
	* libguile/threads.c (scm_join_thread_timed): Recheck t->exited before
	  looping round to call block_self again, in case thread t has now
	  exited.

	* test-suite/tests/threads.test ("don't hang when joined thread
	  terminates in SCM_TICK"): New test.

	Fix wait-condition-variable so that it doesn't leave asyncs blocked
	* libguile/threads.c (fat_mutex_unlock): Unblock asyncs when breaking
	  out of loop.

	* test-suite/tests/threads.test (asyncs-still-working?): New function,
	  to test if asyncs are working (i.e. unblocked).  Use this throughout
	  threads.test, in particular before and after the "timed locking
	  succeeds if mutex unlocked within timeout" test.

2009-05-26  Andy Wingo  <wingo@pobox.com>

	adjust VM copyright notices to LGPL, use SCM_INTERNAL/API properly
	* libguile/frames.c:
	* libguile/frames.h:
	* libguile/instructions.c:
	* libguile/instructions.h:
	* libguile/objcodes.c:
	* libguile/objcodes.h:
	* libguile/programs.c:
	* libguile/programs.h:
	* libguile/vm-bootstrap.h:
	* libguile/vm-engine.c:
	* libguile/vm-engine.h:
	* libguile/vm-expand.h:
	* libguile/vm-i-scheme.c:
	* libguile/vm.c:
	* libguile/vm.h: Update to use SCM_API and SCM_INTERNAL correctly. Adjust
	  copyright to be the same as the copyright of Guile itself, which should
	  be fine given that the FSF holds the whole thing.

	fix backtraces with compiled boot-9
	* module/ice-9/boot-9.scm (default-pre-unwind-handler): Since we were
	  tail-called by pre-unwind-handler-dispatch, we can't use
	  pre-unwind-handler-dispatch as a narrowing argument. Instead just
	  narrow by one frame.
	  (pre-unwind-handler-dispatch): Deprecate.
	  (error-catching-loop): Remove crack comment and code, and just use
	  default-pre-unwind-handler as our pre-unwind handler.

	* module/ice-9/stack-catch.scm (stack-catch):
	* module/system/repl/repl.scm (call-with-backtrace): Use
	  default-pre-unwind-handler directly.

2009-05-26  Andy Wingo  <wingo@wingomac.bcn.oblong.net>

	gnulib-tool --import environ; rely on gnulib for environ definitions
	* libguile/posix.c:
	* libguile/stime.c: Remove environ definition, gnulib provides it now.

	symbols are now hidden unless explicitly exported by SCM_API
	* libguile/__scm.h (SCM_API, SCM_INTERNAL): Take the reverse strategy: symbols will
	  be hidden by default, and only exported with SCM_API. In addition to working
	  on Mac OS, it has the several nice efficiency benefits on Linux, and unifies
	  codepaths with Win32.

	* libguile/Makefile.am: Define BUILDING_LIBGUILE when building Guile.

	gnulib-tool --import lib-symbol-visibility

2009-05-26  Andy Wingo  <wingo@oblong.net>

	distcheck fix, fix (ice-9 time)
	* lang/Makefile.am (elisp_sources): Add elisp/expand.scm.

	* module/ice-9/time.scm (time): Fix for new macro expander. Ew.

2009-05-25  Andy Wingo  <wingo@pobox.com>

	update docs -- sections on assembly and objcode
	* doc/ref/api-procedures.texi:
	* doc/ref/compiler.texi:
	* doc/ref/vm.texi: Update the docs some more.

2009-05-24  Andy Wingo  <wingo@pobox.com>

	update docs, clean up VM vestiges, macro docs, fix (/ a b c)
	* doc/ref/api-procedures.texi (Compiled Procedures): Fix for API changes.

	* doc/ref/compiler.texi (Compiling to the Virtual Machine): Replace GHIL
	  docs with Tree-IL docs. Update the bits about the Scheme compiler to
	  talk about Tree-IL and the expander instead of GHIL. Remove
	  <glil-argument>. Add placeholder sections for assembly and bytecode.

	* doc/ref/vm.texi: Update examples with what currently happens. Reword
	  some things. Fix a couple errors.

	* libguile/vm-i-system.c (externals): Remove this instruction, it's not
	  used.

	* module/ice-9/documentation.scm (object-documentation): If the object is
	  a macro, try to return documentation on the macro transformer.

	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  Fix problem in which we skipped the first element of the object vector,
	  because of changes to procedure layouts a few months ago.

	* module/language/scheme/spec.scm (read-file): Remove read-file
	  definition.

	* module/language/tree-il.scm: Reorder exports. Remove <lexical>, it was
	  a compat shim to something that was never released. Fix `location'.

	* module/language/tree-il/primitives.scm (/): Fix expander for more than
	  two args to /.

	* module/system/base/compile.scm (read-file-in): Remove unused
	  definition.

	* module/system/base/language.scm (system): Remove language-read-file.

	* module/language/ecmascript/spec.scm (ecmascript): Remove read-file
	  definition.

2009-05-22  Ludovic Courtès  <ludo@gnu.org>

	Rewrite SRFI-35 macros using `syntax-rules'.
	* module/srfi/srfi-35.scm: Use `(ice-9 syncase)'.
	  (define-condition-type, condition): Rewritten using `syntax-rules'.
	  (compound-condition, condition-instantiation): New helper internal
	  macros.  Thanks to Andy Wingo for his help!

2009-05-22  Andy Wingo  <wingo@pobox.com>

	fix (oop goops) compilation for (language tree-il primitives)
	* module/oop/goops.scm (compile): Whoop-dee, fix up (oop goops) for
	  (language tree-il primitives) change.

	source location tracking in psyntax, booya!
	* module/ice-9/psyntax.scm (source-annotation): Return #f if
	  source-properties returns null.
	  (source-wrap): Rework a bit.
	  (syntax-type): Don't throw away source info for wrapped expressions.
	  Can has source location info, fools!
	  (chi-body): Correctly propagate source info for body subforms.
	  (syntax): Remove special case for map, it doesn't apply (ahem) for
	  Guile.

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

	remove annotations in psyntax in favor of guile's source properties
	* module/ice-9/psyntax.scm: Remove references to annotation objects,
	  we're just going to try and use Guile's source properties now. It works
	  until `syntax' reconstructs output, at which point it seems we lose it.

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

	fix problem naming internal definitions
	* module/ice-9/psyntax.scm (chi-body): Fix a problem introduced in
	  dc1eed52f71, that internal syntax definitions were included in the id
	  lis along with value definitions. Only showed up on a second bootstrap.
	  Psyntax, how I love thee.

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

	move things to (language tree-il primitives)
	* module/language/tree-il/optimize.scm:
	* module/language/tree-il/primitives.scm: Move primitive-related things
	  to primitive.scm from inline.scm and optimize.scm.

	* module/Makefile.am: Update for inventory changes.

	fix tree-il test to work if source info happens to be present
	* module/language/tree-il/compile-glil.scm (flatten-lambda): Fix source
	  emission.

	* test-suite/tests/tree-il.test (strip-source): Strip source info on
	  tree-il before compiling, so we don't get extraneous source info in the
	  glil. Make check passes!

	fix bad call to make-glil-src
	* module/language/tree-il/compile-glil.scm (flatten-lambda): Fix bad call
	  to make-glil-src, unfortunately not hit during production because
	  psyntax doesn't yet understand source locations.

	fix expansion of (ice-9 threads)
	* module/ice-9/threads.scm: Move syntax definitions before the procedures
	  that use them, and rewrite as hygienic macros since they are so much
	  nicer that way. Fixes the thread tests.

	syntax.test is passing, yay
	* test-suite/tests/syntax.test ("top-level define"): Remove the test for
	  currying, as we don't do that any more by default. It should be easy
	  for the user to add in if she wants it, though.
	  ("do"): Remove unmemoization tests, as sc-expand fully expands `do'.
	  ("while"): Remove while tests in empty environments. They have been
	  throwing 'unresolved, and the problem they seek to test is fully
	  handled by hygiene anyway.

	  And otherwise tweak expected exception strings, and everything passes!

	residualize names into procedures. re-implement srfi-61. module naming foo.
	* module/ice-9/boot-9.scm (cond): Implement srfi-61; most of the code is
	  from the SRFI itself. Yuk.
	  (%print-module, make-modules-in, %app, (%app modules))
	  (module-name): Syncase needs to get at the names of modules, even at
	  anonymous modules. So lazily assign gensyms as module names. Name %app
	  as (%app), but since (%app modules) is at the top of the module
	  hierarchy, name it ().

	* module/ice-9/psyntax.scm: When building tree-il, try to name lambdas in
	  definitions and in lets.
	  (let, letrec): Give more specific errors in a couple of cases.

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

	* test-suite/tests/syntax.test: More work. Many exceptions have different
	  messages than they used to, many more generic; we can roll this back to
	  be faithful to the original strings, but it doesn't seem necessary to
	  me.

2009-05-21  Andy Wingo  <wingo@pobox.com>

	some work on syntax.test
	* module/language/tree-il.scm (tree-il->scheme):
	* module/ice-9/psyntax.scm (build-conditional): Attempt to not generate
	  (if #f #f) as the second arm of an if, but it doesn't seem to be
	  successful.

	* module/ice-9/psyntax-pp.scm (syntax-rules): Regenerate.

	* test-suite/tests/syntax.test (exception:unexpected-syntax): Change
	  capitalization.
	  ("unquote-splicing"): Update test.
	  ("begin"): Add in second arms on these ifs, to avoid the strange though
	  harmless expansion of `if'.
	  (matches?): New helper macro.
	  ("lambda"): Match on lexically bound symbols, as they will be
	  alpha-renamed.

	catch syntax errors in unquote and unquote-splicing
	* module/ice-9/psyntax.scm (quasiquote): Catch syntax errors in unquote
	  and unquote-splicing.

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

	fix multiple values returning from srfi-18's `with-exception-handler'
	* module/srfi/srfi-18.scm (with-exception-handler): Hah! Fixed a
	  scurrilous bug in which we assumed that the thunk returned one or more
	  values. Hah.

	fix apply and call/cc in drop contexts
	* module/language/tree-il/compile-glil.scm (flatten): Actually apply only
	  needs one arg after the proc. And shit, call/cc and apply in drop
	  contexts also need to be able to return arbitrary numbers of values;
	  work it by trampolining through their applicative (non-@) definitions.
	  Also, simplify the single-valued drop case to avoid the
	  truncate-values.

	* module/language/tree-il/inline.scm (call/cc):
	* module/language/tree-il/optimize.scm (*interesting-primitive-names*):
	  Define call/cc as "interesting". Perhaps we should be hashing on value
	  and not on variable.

	* test-suite/tests/tree-il.test ("application"): Fix up test for new,
	  sleeker output. (Actually the GLIL is more verbose, but the assembly is
	  better.)
	  ("apply", "call/cc"): Add some more tests.

	procedures in "drop" contexts can return unspecified values
	* module/language/tree-il/compile-glil.scm (flatten): For applications in
	  "drop" context, allow the procedure to return unspecified values
	  (including 0 values).

	* test-suite/tests/tree-il.test ("application"): Adapt test.

	* module/srfi/srfi-18.scm (wrap): Clarify.

	* test-suite/tests/srfi-18.test: Fix so that the expression importing
	  srfi-18 is expanded before the tests. However the tests are still
	  failing, something about 0-valued returns...

	fix srfi-17.test
	* test-suite/tests/srfi-17.test (exception:bad-quote): Change the
	  expected exception for (set! (quote foo) ...) errors.

	just parse method arguments once.
	* module/oop/goops.scm (method): Tweak to just run through the arguments
	  once. Thanks to Eli Barzilay for the tip.

	rewrite `method' as a hygienic macro to re-allow lexical specializers
	* module/oop/goops.scm (method): Reimplement as a hygienic macro. This
	  seriously took me like 6 hours to figure out. Allows for lexical
	  specializers: (let ((<x> ...)) (define-method (foo (arg <x>)) ...)).

	* module/oop/goops/compile.scm (next-method?, compile-make-procedure):
	  Remove these, as `method' does it all now, hygienically.

2009-05-21  Ludovic Courtès  <ludo@gnu.org>

	Make use of Gnulib's `flock' module.
	* libguile/posix.c: Always use <sys/file.h>, which is provided by
	  Gnulib.
	  (flock)[__MINGW32__]: Remove.
	  (scm_flock): Compile unconditionally.  Always use Gnulib's flock(2).

	Make use of Gnulib's `putenv' module.
	* libguile/posix.c: Include <stdlib.h> since the putenv(3) declaration
	  is there (POSIX and Gnulib).
	  (scm_putenv): Rely on Gnulib's `putenv' module.

	Add Gnulib portability modules; update Gnulib files.
	* m4/gnulib-cache.m4 (gl_MODULES): Add `flock' (provides flock(2)
	  declaration and implementation), `fpieee' (fixes floating point
	  behavior on Alpha and SH), `stdlib' (provides an unsetenv(3)
	  declaration, among others), `putenv' (provides a putenv(3) declaration
	  and implementation with the semantics we need).

	Update `NEWS'.

2009-05-21  Michael Gran  <spk121@yahoo.com>

	Symbols longer than 128 chars can cause an exception.  Also, the terminating colon of long postfix keywords are not handled correctly.
		* test-suite/tests/reader.test ("read-options"): Add test
		for long postfix keywords.

		* libguile/read.c (scm_read_mixed_case_symbol): Fix
		exception on symbols are greater than 128 chars.  Also,
		colons are not stripped from long postfix keywords.

2009-05-21  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS' wrt. `branch_release-1-8'.

	Fix compilation of `test-round.c' on BSD.
	* test-suite/standalone/test-round.c (HAVE_MACHINE_FPU_H): Include
	  <sys/types.h> when available.  This fixes compilation on NetBSD.
	  Reported by Greg Toxel.

	Update `NEWS'.

	Don't use raw divisions by zero in `test-conversion.c'.
	* test-suite/standalone/test-conversion.c (ieee_init): New function.
	  (guile_Inf, guile_NaN): New variables.
	  (test_from_double, test_to_double): Use them.  Divisions by zero made
	  `cc' on Tru64 5.1b ("Compaq C V6.5-011") bail out and led to a
	  floating point exception when compiled with GCC on the same platform.
	  (main): Call `ieee_init ()'.

	Use <machine/fpu.h> instead of <fenv.h> when needed (e.g., Tru64 5.1b).
	* configure.in: Look for <machine/fpu.h>.

	* test-suite/standalone/test-round.c: Use <machine/fpu.h> if available.

	Work around lack of cuserid(3) declaration on Tru64 5.1b.
	* configure.in: Check for a cuserid(3) declaration.

	* libguile/posix.c [HAVE_CUSERID][!HAVE_DECL_CUSERID]: Provide a
	  declaration.

	Work around the lack of hstrerror(3) declaration on Tru64.
	* configure.in: Look for the declaration of hstrerror(3).

	* libguile/net_db.c: Add hstrerror(3) declaration if
	  `HAVE_DECL_HSTRERROR' is undefined.

2009-05-20  Ludovic Courtès  <ludo@gnu.org>

	Remove extraneous semicolons from `test-conversion.c'.
	* test-suite/standalone/test-conversion.c: Remove extraneous semicolon
	  following `DEF[SU]TST' invocations since that made Compaq C
	  V6.5-011 (`cc' on Tru64 5.1b) bail out.

	Fix compilation of `numbers.c' on Tru64.
	* libguile/numbers.c (scm_c_make_polar): Don't use sincos(3) on non-GNU
	  platforms.  Reported by Didier Godefroy <ldg@ulysium.net>.

	Fix compilation of `gcc_os_dep.c' on Tru64.
	* libguile/gc_os_dep.c [OSF1](_end): Specify the type.
	  (scm_get_stack_base): Suitably cast RESULT.  Reported by Didier
	  Godefroy <ldg@ulysium.net>.

	Update `NEWS' and `THANKS'.

2009-05-20  Neil Jerram  <neil@ossau.uklinux.net>

	Avoid "no duplicate" popen tests leaving zombie processes
	On the one hand we want the child process in these tests to exit.  On
	the other, we don't want it to exit before the parent Guile code has
	tested the relevant condition (EOF in the first test, broken pipe in
	the second) - because these conditions would obviously be true if the
	child had already exited, and that's not what we're trying to test
	here.  We're trying to test getting EOF and broken pipe while the
	child process is still alive.

	* test-suite/tests/popen.test (open-input-pipe:no duplicate): Add
	  another pipe from parent to child, so that the child can finish by
	  reading from this.  Then the parent controls the child lifetime by
	  writing to this pipe.

	* test-suite/tests/popen.test (open-output-pipe:no duplicate): Add
	  another pipe from child to parent, and have the child finish by
	  endlessly writing into this.  Then the parent controls the child
	  lifetime by closing its end of the pipe, causing a broken pipe in
	  the child.

	Fix `explicitely' typos, should be `explicitly'

2009-05-20  Andy Wingo  <wingo@pobox.com>

	fix failing macro-as-parameter tests in eval.test
	* module/ice-9/psyntax.scm (chi-lambda-clause): Strip the docstring
	  before passing it on to the continuation.

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

	* test-suite/tests/eval.test (exception:failed-match): New exception, for
	  syntax-case failed matches.
	  ("evaluator"): Fix macro-as-parameter tests. They pass now :)

	remove compile-time-environment
	* module/ice-9/boot-9.scm (guile-user): Move the `compile' autoload to
	  the guile-user module. Remove reference to compile-time-environment.

	* module/language/scheme/compile-ghil.scm:
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/optimize.scm:
	* module/system/base/compile.scm:
	* test-suite/tests/compiler.test: Remove definition of and references to
	  compile-time-environment. While I do think that recompilation based on
	  a lexical environment can be useful, I think it needs to be implemented
	  differently. So for now we've lost nothing if we take it away, as it
	  doesn't work with syncase anyway.

	Fix a bug in the (ice-9 match) test
	* testsuite/t-match.scm (matches?): Fix match invocation. As far as I can
	  tell, although (ice-9 match) does advertise a => form of clauses, it
	  requires that the end of the => be a symbol. For some reason this
	  works in the interpreter:

	    ((lambda () (begin => #t)))

	  It's part of the expansion of matches?. It also worked in the old
	  compiler. Thinking that maybe toplevel references could cause side
	  effects, I made the new compiler actually ref =>, which brought this to
	  light.

	fix @slot-ref / @slot-set! compilation
	* module/language/tree-il/compile-glil.scm: Add primcall compilers for
	  @slot-ref and @slot-set.

	* module/language/tree-il/optimize.scm (add-interesting-primitive!): New
	  export. Creates an association between a variable in the current module
	  and a primitive name.

	* module/oop/goops.scm: Rework compiler hooks to work with tree-il and
	  not ghil.

	compile `list' and `vector' to their associated opcodes
	* module/language/glil/compile-assembly.scm (glil->assembly): Check the
	  length when emitting calls to variable-argument stack instructions.
	  Allow two-byte lengths -- allows e.g. calls to `list' with more than
	  256 arguments.

	* module/language/tree-il/compile-glil.scm: Add primcall associations for
	  `list' and `vector', with any number of arguments. Necessary because
	  syncase's quasiquote expansions will produce calls to `list' with many
	  arguments.

	* module/language/tree-il/optimize.scm (*interesting-primitive-names*):
	  Add `list' and `vector' to the set of primitives to resolve.

	don't allocate too many locals for expansions of `or'
	* module/language/tree-il/analyze.scm (analyze-lexicals): Add in a hack
	  to avoid allocating more locals than necessary for expansions of `or'.
	  Documented in the source.

	* test-suite/tests/tree-il.test: Add a test case.

	a few fixups
	* module/ice-9/psyntax.scm (chi-install-global, syntax-case): Fix a
	  couple of cases in which bare datums were passed to output
	  constructors.

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

	* module/language/scheme/spec.scm (scheme): Clean up the #:compilers
	  list.

	* module/language/tree-il/compile-glil.scm (flatten): Fix call to
	  `length' in call/cc compiler.

	and, or, cond etc use syntax-rules, compile scheme through tree-il
	* libguile/vm-i-system.c:
	* libguile/vm-engine.h (ASSERT_BOUND): New assertion, that a value is
	  bound. Used by local-ref and external-ref in paranoid mode.

	* module/ice-9/boot-9.scm (and, or, cond, case, do): Since we are
	  switching to use psyntax as the first pass of the compiler, and perhaps
	  soon of the interpreter too, we need to make sure it expands out all
	  forms to primitive expressions. So define expanders for these derived
	  syntax forms, as in the R5RS report.

	* module/ice-9/psyntax-pp.scm: Regenerate, with core forms fully
	  expanded.

	* module/ice-9/psyntax.scm (build-void): New constructor, for making
	  undefined values.
	  (build-primref): Add in a hack so that primitive refs in the boot
	  module expand out to toplevel refs, not module refs.
	  (chi-void): Use build-void.
	  (if): Define an expander for if that calls build-conditional.

	* module/language/scheme/compile-tree-il.scm (compile-tree-il): Use let*
	  so as not to depend on binding order for the result of
	  (current-module).

	* module/language/scheme/spec.scm (scheme): Switch over to tree-il as the
	  primary intermediate language. Not yet fully tested, but at least it
	  can compile psyntax-pp.scm.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Arguments don't
	  count towards a function's nlocs.

	* module/language/tree-il/compile-glil.scm (*comp-module*, compile-glil):
	  Define a "compilation module" fluid.
	  (flatten-lambda): Fix a call to make-glil-argument. Fix bug in
	  heapifying arguments.
	  (flatten): Fix number of arguments passed to apply instruction. Add a
	  special case for `(values ...)'. If inlining primitive-refs fails,
	  try expanding into toplevel-refs if the comp-module's variable is the
	  same as the root variable.

	* module/language/tree-il/optimize.scm (resolve-primitives!): Add missing
	  src variable for <module-ref>.

	* test-suite/tests/tree-il.test ("lambda"): Fix nlocs counts. Add a
	  closure test case.

2009-05-18  Andy Wingo  <wingo@pobox.com>

	add tree-il->glil compilation test suite
	* module/language/tree-il.scm (parse-tree-il): Fix a number of bugs.
	  (unparse-tree-il): Apply takes rest args now.

	* module/language/tree-il/analyze.scm (analyze-lexicals)
	  (analyze-lexicals): Heap vars shouldn't increment the number of locals.

	* module/language/tree-il/optimize.scm (resolve-primitives!): Don't
	  resolve public refs to primitives, not at the moment anyway.

	* test-suite/Makefile.am (SCM_TESTS): Add tree-il test.

	* test-suite/lib.scm (pass-if, expect-fail, pass-if-exception)
	  (expect-fail-exception): Rewrite as syntax-rules macros. In a very
	  amusing turn of events, it turns out that bindings introduced by
	  hygienic macros are not visible inside expansions produced by
	  defmacros. This seems to be expected, so go ahead and work around the
	  problem.

	* test-suite/tests/srfi-31.test ("rec special form"): Expand in eval.

	* test-suite/tests/syntax.test ("begin"): Do some more expanding in eval,
	  though all is not yet well.

	* test-suite/tests/tree-il.test: New test suite, for tree-il->glil
	  compilation.

	special cases for more types of known applications
	* module/language/tree-il/compile-glil.scm (flatten): Handle a number of
	  interesting applications, and fix a bug for calls in `drop' contexts.

	* module/language/tree-il/inline.scm: Define expanders for apply,
	  call-with-values, call-with-current-continuation, and values.

2009-05-17  Andy Wingo  <wingo@pobox.com>

	inline calls to some primitives
	* module/system/base/pmatch.scm: Wrap consequents in (let () ) instead of
	  (begin ) so that they can have local definitions.

	* module/language/tree-il/compile-glil.scm: Inline some calls to
	  primitives.

	define `delay' in terms of make-promise
	* module/ice-9/boot-9.scm (delay): Define `delay' in terms of
	  make-promise.

	* module/ice-9/psyntax-pp.scm (compile): Regenerated with a fully
	  compiled Guile, so that the gensym numbers are the same.

	* module/language/tree-il/compile-glil.scm: Add some notes about what
	  needs doing to catch up to the old compiler.

	and now, we residualize the original names into the metadata. yay!
	* module/language/tree-il/compile-glil.scm (vars->bind-list)
	  (emit-bindings, flatten-lambda, flatten): Write the original names into
	  <glil-bind> structures. Yaaaaay!

	actually pass original ids on to tree-il data types
	* module/ice-9/psyntax.scm (build-lambda, build-let, build-named-let)
	  (build-letrec): Actually pass along the original ids to tree-il
	  constructors.

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

	* module/language/tree-il.scm: Add fields in <lambda>, <let>, and
	  <letrec> for the original variable names.

	* module/language/tree-il/compile-glil.scm (compile-glil): Adapt for new
	  make-lambda arg.

	preserve original var names in lets and lambdas
	* module/ice-9/psyntax.scm (build-letrec, build-let, build-lambda)
	  (build-named-let): Take extra args for the original names of the
	  gensyms. Not used yet. Callers adapted.

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

2009-05-15  Andy Wingo  <wingo@pobox.com>

	tree-il -> glil compiler works now, at least in initial tests
	* module/language/tree-il/analyze.scm: Break analyzer out into its own
	  file.

	* module/language/tree-il/compile-glil.scm: Port the GHIL->GLIL compiler
	  over to work on tree-il. Works, but still misses a number of important
	  optimizations.

	* module/language/tree-il.scm: Add <void>. Not used quite yet.

	* module/language/glil.scm: Remove <glil-argument>, as it is the same as
	  <glil-local> (minus an offset).

	* module/language/glil/compile-assembly.scm:
	* module/language/glil/decompile-assembly.scm:
	* module/language/ghil/compile-glil.scm: Adapt for <glil-argument>
	* removal.

	* module/Makefile.am (TREE_IL_LANG_SOURCES): Reorder, and add
	  analyze.scm.

2009-05-14  Andy Wingo  <wingo@pobox.com>

	add lexical analyzer and allocator
	* module/language/tree-il/optimize.scm: Rework to just export the
	  optimize! procedure.

	* module/language/tree-il/compile-glil.scm (analyze-lexicals): New
	  function, analyzes and allocates lexical variables. Almost ready to
	  compile now.
	  (codegen): Dedent.

2009-05-12  Andy Wingo  <wingo@pobox.com>

	add primitive expander for tree-il
	* module/Makefile.am: Add inline.scm.

	* module/language/tree-il.scm (pre-order!, post-order!): pre-order! is
	  new. post-order! existed but was not public. They do destructive tree
	  traversals of tree-il, and need more documentation. Also, add
	  predicates to tree-il's export list.

	* module/language/tree-il/inline.scm: New file, which expands primitives
	  into more primitive primitives. In the future perhaps it will not be
	  necessary, as the general inlining infrastructure will handle these
	  cases, but for now it's useful.

	* module/language/tree-il/optimize.scm: Move post-order! out to better
	  pastures.

2009-05-11  Andy Wingo  <wingo@pobox.com>

	add tree-il optimizer
	* module/language/tree-il/optimize.scm: New module, for optimizations.
	  Currently all we have is resolving some toplevel refs to primitive
	  refs.

	* module/Makefile.am: Add new module.

	* module/language/tree-il.scm: Fix exports for accessors for `src'.

	* module/language/tree-il/compile-glil.scm: Tweaks, things still aren't
	  working yet.

2009-05-08  Andy Wingo  <wingo@pobox.com>

	more work on tree-il compilation
	* module/language/scheme/amatch.scm: Remove, this approach won't be used.

	* module/Makefile.am: Adjust for additions and removals.

	* module/language/scheme/compile-ghil.scm: Remove an vestigial debugging
	  statement.

	* module/language/scheme/spec.scm:
	* module/language/scheme/compile-tree-il.scm:
	* module/language/scheme/decompile-tree-il.scm: Add tree-il compiler and
	  decompiler.

	* module/language/tree-il/compile-glil.scm: Add some notes.

	* module/language/tree-il/spec.scm: No need to wrap expressions in
	  lambdas -- GHIL needs somewhere to put its variables, we don't.

2009-05-07  Andy Wingo  <wingo@pobox.com>

	go ahead and regenerate psyntax-pp.scm

	remove (ice-9 expand-support)
	* module/ice-9/Makefile.am:
	* module/ice-9/expand-support.scm: Remove module, no longer used.

	* module/ice-9/psyntax.scm: Fix a comment.

	new language: tree-il. psyntax generates it when run in compile mode.
	* module/Makefile.am: Add tree-il sources.

	* module/ice-9/compile-psyntax.scm: Adjust for sc-expand producing
	  tree-il in compile mode.

	* module/ice-9/psyntax.scm: Switch from expand-support to tree-il for
	  generating output in compile mode. Completely generate tree-il -- the
	  output wasn't Scheme before, but now it's completely not Scheme.

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

	* module/language/scheme/compile-ghil.scm: Strip structures using
	  tree-il, not expand-support.

	* module/language/tree-il.scm:
	* module/language/tree-il/spec.scm
	* module/language/tree-il/compile-glil.scm: New language. It will compile
	  to GLIL, though it doesn't yet.

	make expand-support structure constructors take a source argument
	* module/ice-9/expand-support.scm (make-module-ref, make-lexical): Add
	  source arguments to these constructors.

	* module/ice-9/psyntax.scm:
	* module/ice-9/psyntax-pp.scm: Adapt to match, though we don't wire
	  everything up yet.

	fix install-global construction of `define' forms
	* module/ice-9/psyntax.scm (build-global-definition): Remove mod
	  argument, as it does not seem we could ever define something in another
	  module.
	  (chi-install-global): Build the define as a definition, not an
	  application. Doesn't matter now, but it will later.
	  (chi-top): Fix build-global-definition call.

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

2009-05-04  Andy Wingo  <wingo@pobox.com>

	when compiling, use make-lexical to residualize original var names
	* module/ice-9/psyntax.scm (build-lexical-reference): Change to be a
	  function. Take an extra arg, the original name of the variable. If we
	  are compiling, make a #<lexical>, annotated with the original var name.
	  All callers changed.
	  (build-lexical-assignment): Also a function, taking also the original
	  var name, using build-lexical-reference to build its output.

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

	sc-expand in compile mode produces (ice-9 expand-support) structures
	* module/ice-9/psyntax.scm (*mode*): New moving part, a fluid.
	  (sc-expand): Dynamically bind *mode* to the expansion mode.
	  (build-global-reference): Change to be a procedure instead of local
	  syntax. Import the logic about when to make a @ or @@ form to here,
	  from boot-9.scm. If we are compiling, build output using (ice-9
	  expand-support)'s make-module-ref, otherwise just making the familiar
	  s-expressions. (This will allow us to correctly expand in modules in
	  which @ or @@ are not bound, at least when we are compiling.)
	  (build-global-assignment): Use the result of build-global-reference. A
	  bit hacky, but hey.
	  (top-level-eval-hook, local-eval-hook): Strip expansion structures
	  before evalling.

	* module/ice-9/boot-9.scm (make-module-ref): Remove, this logic is now
	  back in psyntax.scm.

	* module/ice-9/compile-psyntax.scm (source): Since we expand in compile
	  mode, we need to strip expansion structures.

	* module/ice-9/expand-support.scm (strip-expansion-structures): Remove
	  the logic about whether and how to strip @/@@ from here, as it's part
	  of psyntax now.

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

	* module/language/scheme/compile-ghil.scm (compile-ghil): Strip expansion
	  structures -- for now. In the future, we might translate directly from
	  these structures into GHIL.

	replace sc-expand with sc-expand3, removing binding for sc-expand3
	* module/ice-9/boot-9.scm (sc-expand3):
	* module/ice-9/psyntax.scm (sc-expand3): Replace sc-expand with
	  sc-expand3, as expand3 with one argument is the same as sc-expand.

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

	* module/ice-9/compile-psyntax.scm:
	* module/language/scheme/compile-ghil.scm: Change callers to sc-expand3
	  to use sc-expand.

2009-04-29  Andy Wingo  <wingo@pobox.com>

	remove (void) from boot-9 and psyntax
	* module/ice-9/psyntax.scm: Tweak comments. Remove references to `void';
	  just produce (if #f #f) instead of (void).

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

	* module/ice-9/boot-9.scm (void): Remove this binding.

	more cleanups to boot-9/psyntax
	* module/ice-9/boot-9.scm: Comment some more things.

	* module/ice-9/psyntax.scm: Remove error-hook -- callers should just use
	  syntax-violation. Change all callers.

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

	remove andmap from public API (we still have and-map)
	* module/ice-9/boot-9.scm (and-map, or-map): Move these definitions up so
	  psyntax can use them.
	  (andmap): Remove, yay.

	* module/ice-9/psyntax.scm: Remove notes about andmap, and just use
	  Guile's and-map -- except in cases that need the multiple list support,
	  in which case we have a private and-map*.

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

	cleanups to boot-9
	* module/ice-9/boot-9.scm: Shuffle around some definitions.
	  (module-add!): Removed stub definition, no longer used.
	  (install-global-transformer): Removed, no longer used (yay!).

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

	* module/ice-9/psyntax.scm: Remove install-global-transformer.

	first-class macro representation (no bits on variables)
	* libguile/macros.c (scm_macro_p): Update docs.

	* module/ice-9/boot-9.scm (module-define!, module-ref): Define pre-boot
	  forms of these functions as well. I suspect module-add! can go soon.
	  (module-lookup-keyword, module-define-keyword!)
	  (module-undefine-keyword!) Remove these.

	* module/ice-9/psyntax-pp.scm: Regenerate. Notice the difference?

	* module/ice-9/psyntax.scm (put-global-definition-hook)
	  (get-global-definition-hook): Rework to expect first-class macros. Heh
	  heh.
	  (remove-global-definition-hook): Pleasantly, this hook can go away.
	  (chi-install-global): Terrorism to generate the right kind of output --
	  will clean up.
	  (chi-top): Unify definition handling for all kinds of values.

	a different tack for syncase macro representation
	* libguile/macros.c (macro_print): Show syntax-case bindings, if present.
	  (macro_mark): Mark the extra two words if they're there.
	  (scm_make_syncase_macro, scm_make_extended_syncase_macro): OK! A new
	  take at the "how do we represent syncase macros in Guile" problem.
	  Whereas we need a disjoint type, but would like it to be compatible
	  with old predicates (e.g. `macro?'), and need to be able to extend
	  existing syntax definitions (e.g. `cond'), let's add a bit to macros to
	  indicate whether they have syncase macro bindings or not, and a fourth
	  macro type for native syncase macros.
	  (scm_macro_type): Return 'syntax-case for native syntax-case macros.
	  Note that other macro types may have syntax-case bindings.
	  (scm_macro_name): Return #f if the transformer is not a procedure.
	  (scm_syncase_macro_type, scm_syncase_macro_binding): New accessors for
	  the syncase macro bindings.

	* libguile/macros.h: Add API for syncase macros.

	* module/ice-9/boot-9.scm (module-define-keyword!): Adapt to use syncase
	  macros, though they are not yet used. Reorder other syncase API.

	* module/ice-9/psyntax.scm (chi-expr): Fix syntax-violation invocation.

2009-04-26  Andy Wingo  <wingo@pobox.com>

	syntax-dispatch -> $sc-dispatch
	* module/ice-9/boot-9.scm:
	* module/ice-9/psyntax-pp.scm:
	* module/ice-9/psyntax.scm: Change syntax-dispatch to $sc-dispatch, as it
	  is in current psyntax. The idea is that this isn't really a public
	  variable, though it has to be, currently, so just obscure that fact
	  with an obscure name.

	build ecmascript stuff last
	* module/Makefile.am: Wait to build ecmascript until the compiler has
	  bootstrapped.

	syntax-object->datum => syntax->datum, likewise datum->syntax
	* module/ice-9/boot-9.scm (datum->syntax, syntax->datum): Rename from
	  datum->syntax-object and syntax-object->datum, following r6rs. Change
	  all callers. Reorder some of the other exports from psyntax.

	* module/ice-9/psyntax.scm: Change datum->syntax and syntax->datum
	  definitions and callers.

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

	* module/oop/goops.scm (define-class-pre-definition): Update for changes.

	replace psyntax's syntax-error with r6rs' syntax-violation
	* module/ice-9/boot-9.scm (syntax-violation): Well, as long as we have to
	  have a function for indicating syntax errors, let's let it be a
	  well-thought-out one -- syntax-violation from r6rs. No more
	  syntax-error.

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

	* module/ice-9/psyntax.scm: Replace instances of syntax-error with
	  syntax-violation. Implement as a scm-error to 'syntax-error, with some
	  nice arguments.

	add module-{define-keyword!,undefine-keyword!,lookup-keyword}
	* libguile/modules.c (scm_module_local_variable): Allow this to be called
	  before modules are booted with #f as the module.

	* module/ice-9/boot-9.scm (module-define-keyword!)
	  (module-lookup-keyword, module-undefine-keyword!): Well, if syncase
	  forces us to allow the keyword bindings to be partitioned from value
	  bindings, let's go ahead and do that in boot-9 instead of in
	  psyntax. A step on the way to removing `install-global-transformer'.
	  (sc-chi): Remove.

	* module/ice-9/psyntax.scm (put-global-definition-hook):
	  (remove-global-definition-hook, get-global-definition-hook): Use our
	  new module-* functions.
	  (sc-chi): Remove, no longer needed.

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

	remove sc-macro definition
	* module/ice-9/boot-9.scm (sc-macro): Remove sc-macro definition, yay.

	fix module-bound?, start compiling srfi-18.scm
	* module/Makefile.am (SRFI_SOURCES): Let's finally start compiling
	  srfi-18.scm, what the hell.

	* module/ice-9/boot-9.scm (module-bound?): module-bound? was returning
	  true if (not (variable-bound? (module-local-variable m v))), but
	  (variable-bound? (module-variable m v)). Fix to cut out on the first
	  variable it finds. This bug has been there for a while now.

2009-04-25  Andy Wingo  <wingo@pobox.com>

	Fix the elisp memoizer code for syncase-in-boot-9
	* lang/elisp/interface.scm:
	* lang/elisp/internals/lambda.scm:
	* lang/elisp/primitives/syntax.scm:
	* lang/elisp/transform.scm: Use (lang elisp expand) as the transformer,
	  because we really are intending this code for the memoizer and not the
	  compiler.

	* lang/elisp/expand.scm: A null expander.

	* lang/elisp/interface.scm (use-elisp-file, use-elisp-library):
	* lang/elisp/transform.scm (scheme): Turn these defmacros into
	  procedure->memoizing-macro calls, given that without syncase we have no
	  defmacro either.

	* lang/elisp/primitives/fns.scm (macroexpand): Comment out, as Scheme's
	  macro expander (temporarily on hiatus) won't work with elisp.

	allow defmacros to have docstrings
	* module/ice-9/boot-9.scm (define-macro, defmacro): Add the ability to
	  have a docstring.

	* module/ice-9/documentation.scm (object-documentation): Remove
	  references to defmacro? and macro?. Since we store the transformation
	  procedure as the binding, we can get docs from the procedure directly.

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

	* module/ice-9/psyntax.scm (put-global-definition-hook):
	  Take the type and the value separately, so we can set the variable to
	  the procedure, while keeping the *sc-expander* to be the "binding
	  object".
	  (global-extend): Pass type and val separately.

	all of guile compiles now, expanded with syncase
	* libguile/eval.c (scm_m_eval_when): Whoops, eval-when has an implicit
	  begin. Fix.

	* module/oop/goops.scm: Syncase doesn't like definitions in expression
	  context, and grudgingly I have decided to go along with that. But that
	  doesn't mean we can't keep the old semantics, via accessing the module
	  system directly. So do so. I took the opportunity to rewrite some
	  macros with syntax-rules and syntax-case -- the former is nicer than
	  the latter, of course.

	* module/oop/goops/save.scm: Don't define within an expression.

	* module/oop/goops/simple.scm (define-class): Use define-syntax.

	* module/oop/goops/stklos.scm (define-class): Use define-syntax.

	fix bad syntax in define-macro, (ice-9 match), and (oop goops)
	* module/ice-9/boot-9.scm (define-macro): Use syntax-case to destructure
	  macro arguments, so we get good errors.

	* module/ice-9/match.scm (defstruct, define-const-structure): Don't
	  unquote in the `defstruct' macro as a value in expansions.

	* module/oop/goops.scm (standard-define-class): Can't define a macro with
	  `define', use `define-syntax' instead.
	  (define-accessor): Use syntax-rules. Doesn't give us much in this case.
	  (toplevel-define!): New helper, to let us keep GOOPS' behavior with the
	  new expander. Some solution that works lexically and at the toplevel
	  would be nice, though.
	  (define-method): Reimplement with syntax-rules -- soooo much nicer.

	* module/oop/goops/dispatch.scm (lookup-create-cmethod): Don't define
	  within an expression.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	allow docstrings with internal definitions
	* module/Makefile.am (SCHEME_LANG_SOURCES):
	* module/language/scheme/expand.scm: Remove expand.scm, we don't need it
	  any more.

	* module/ice-9/psyntax.scm (build-lambda, chi-lambda-clause): Support
	  docstrings with internal definitions. What are Scheme people thinking
	  these days?

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

	make sure we compile boot code in (guile), not (guile-user)
	* libguile/eval.h:
	* libguile/eval.c (scm_m_eval_when): Define a cheap eval-when, used
	  before syncase has booted.

	* module/Makefile.am: Reorder to put (system vm) and (system repl)
	  modules after the compiler, as they are not needed at runtime.

	* module/ice-9/boot-9.scm: Move the eval-when earlier, to be the first
	  thing -- so when we recompile Guile we do so all in the '(guile)
	  module, not '(guile-user).

	* module/ice-9/compile-psyntax.scm: Rewrite to assume that psyntax.scm
	  will eval-when to set its module, etc. Have everything in a let --
	  otherwise the `format' call is in (guile), but `target' was defined
	  in (guile-user). Also, write in an eval-when to the expanded file.

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

	* module/ice-9/networking.scm:
	* module/ice-9/psyntax.scm:
	* module/ice-9/r4rs.scm: Sprinkles of eval-when, for flavor.

	handle pre-module macro procedures correctly
	* module/ice-9/psyntax.scm (chi-macro): It's possible for a macro
	  procedure to have no module, if the procedure was made before modules
	  were booted.

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

	Merge branch 'master' into syncase-in-boot-9

	merge ice-9, srfi, oop makfiles into module makefile
	* configure.in: No longer output the Makefile.ins.

	* module/Makefile.am: Include the contents of ice-9/, srfi/, and oop/.

	* module/ice-9/Makefile.am:
	* module/ice-9/debugger/Makefile.am:
	* module/ice-9/debugging/Makefile.am:
	* module/oop/Makefile.am:
	* module/oop/goops/Makefile.am:
	* module/srfi/Makefile.am: Removed.

	finish transition to bare/hygiene/public/private
	* module/ice-9/boot-9.scm (make-module-ref): Remove the transition
	  support.

	* module/ice-9/psyntax.scm (get-global-definition-hook): Remove
	  transition support. Also remove support for guile-macro.
	  (build-global-reference, build-global-assignment): Remove transition
	  support.

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

	only bend hygiene in macro-introduced output, not for explicit @/@@
	* module/ice-9/psyntax.scm
	* module/ice-9/psyntax-pp.scm
	* module/ice-9/boot-9.scm (make-module-ref): We were so almost there
	  with what we had, sniff. The deal is that
	    (begin (load "foo.scm") ((@@ (foo) bar)))
	  would expand to
	    (begin (load "foo.scm") (bar))
	  because bar was unbound at expansion time, and make-module-ref assumed
	  it was like the else in a cond. But it shouldn't have, because we
	  /explicitly/ asked for the @@ var -- so now if we see a @ or @@, we
	  never drop it. @@ introduced by hygiene can be dropped if it doesn't
	  reference a var, though.

	  Practically speaking, this means tagging all modules in psyntax with
	  their intent: public or private (corresponding to @ or @@), hygiene
	  (introduced by a macro), or bare (when we don't have a module). I'm
	  not sure when we'd see a bare.

	  The implementation is complicated by the need to support the old
	  format and the new format at the same time, so that psyntax-pp can be
	  regenerated.

	fix @ and syncase
	* module/ice-9/boot-9.scm
	  (make-module-ref): equal?, not eq?, when matching on module name.
	  (Module names don't have to come from an invocation of module-name in
	  this process.)

	* module/ice-9/psyntax.scm (build-global-reference)
	  (build-global-assignment, @): Rework the format of the module in syntax
	  objects so that a car of #f indicates a public reference. Loading (foo
	  %module-public-interface) didn't guarantee that (foo) was loaded and
	  useful.

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

	* module/language/scheme/compile-ghil.scm (lookup-transformer):
	  primitive-macro? does not exist any more.

	ice-9 syncase now deprecated, woo
	Remove #:use-module (ice-9 syncase) from lots of places, as it's no
	longer needed.

	it is alive!!!!! + concision + fix to compile-ghil
	* module/ice-9/boot-9.scm: Remove lots of debugging prints. Remove some
	  already-deprecated attempts to load modules from shared libraries.

	* module/ice-9/psyntax.scm: If we have to create a variable for a
	  syntactic binding, initialize its contents to a gensym. I'd like
	  something more meaningful, but at least this way we can tell different
	  macros apart. Only warn about missing modules if modules are booted.
	  Chi the value part of a (set! (@ ...) ) expression -- whoops!

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

	* module/language/glil.scm (parse-glil): Fix an unquoting error.

	* module/language/scheme/compile-ghil.scm: No need to import syncase, we
	  gots it. Rework compiler to expand only once, with syncase, instead of
	  incrementally. Fix define-scheme-transformer to work with syncase, by
	  not referencing bare keywords. It works!

	allow redefinition of global macros to variables
	* module/ice-9/psyntax.scm: Allow the redefinition of keywords to
	  variables. Otherwise we can't do (define let #f), which is totally
	  useful and stuff.

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

	fix load for syncase-in-boot-9; compile-psyntax works again
	* module/ice-9/r4rs.scm:
	* module/ice-9/boot-9.scm (%load-verbosely, assert-load-verbosity)
	  (%load-announce, %load-hook, load): Move these from r4rs.scm to
	  boot-9.scm.

	* module/ice-9/compile-psyntax.scm: Update to work with
	  syncase-in-boot-9.

	* module/ice-9/psyntax-pp.scm: Recompiled with syncase-in-boot-9.

	leap of faith: (ice-9 syncase) in psyntax-pp.scm -> (guile)
	* module/ice-9/psyntax-pp.scm: Manually switch psyntax-pp over to (guile)
	  from (ice-9 syncase). Heh heh.

	syncase early in boot-9, defmacros in terms of syntax-case -- halfway working
	* module/ice-9/boot-9.scm
	  (eval-when): Remove, as syncase is going to handle this one for us.
	  (sc-expand, sc-expand3, sc-chi, install-global-transformer)
	  (syntax-dispatch, syntax-error, annotation?, bound-identifier=?)
	  (datum->syntax-object, free-identifier=?, generate-temporaries)
	  (identifier?, syntax-object->datum, void, andmap): Oh, ugly of uglies:
	  add these exciting definitions to the main environment. Hopefully we
	  can pull them back out soon.
	  (make-module-ref, resolve-module): Stub these out, as a replacement for
	  expand-support.
	  (%pre-modules-transformer): Define to sc-expand, so that we are using
	  syncase from the very start.
	  (defmacro, define-macro): Define in terms of syntax-case.
	  (macroexpand, macroexpand-1): Remove, there should be a different way
	  to get at this -- though perhaps with the same name.
	  (make-module): Make sc-expand the default module-transformer.
	  (process-define-module): Issue a deprecation warning when using ice-9
	  syncase.
	  (primitive-macro?): Remove, no meaning...
	  (use-syntax): Deprecate.
	  (define-private, define-public, defmacro-public): Rework in terms of
	  syntax-rules.

	* module/ice-9/syncase.scm: Gut, as syncase is provided by core now.

	module-name returns '(guile) during boot; psyntax tweak
	* module/ice-9/boot-9.scm (module-name): Return '(guile) before the
	  module system is booted, for syncase's benefit. Defer redefinition
	  until the module system is booted.

	* module/ice-9/psyntax.scm (put-global-definition-hook): Only set a
	  variable if it's unbound.

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

	more steps on the way to boot-time syncase
	* module/ice-9/boot-9.scm: Define a version of module-add! for psyntax,
	  before modules are booted.

	* module/ice-9/psyntax.scm: Remove a warning, and rename a variable.
	  Initialize a new variable to 'sc-macro, though it will have no effect.

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

2009-04-23  Andy Wingo  <wingo@pobox.com>

	I ain't broke, but brother I'm badly bent
	* module/ice-9/expand-support.scm (strip-expansion-structures): If, when
	  producing @/@@ forms, we find that an @@ variable is not bound in its
	  module, just serialize the symbol. This bends hygiene, in that it can
	  introduce a global (but not lexical) reference in the expanded module,
	  but it seems necessary to not produce (@@ (foo) else) in forms like
	  ((@@ (foo) cond) ((test then) ((@@ (foo) else) bar))).

2009-04-22  Andy Wingo  <wingo@pobox.com>

	fix erroneous #:use-syntax clausen
	* module/system/repl/command.scm:
	* module/system/repl/common.scm:
	* module/system/repl/repl.scm:
	* module/system/vm/debug.scm:
	* module/system/vm/trace.scm: Change #:use-syntax to #:use-module, as
	  that's really what we want to do.

	move pk, peek, and warn to the beginning of boot-9
	* module/ice-9/boot-9.scm (peek, pk, warn): Move these helpers up to the
	  top. I like them!
	  (load-compiled): Don't define within an if, syncase doesn't like that.

	module-name before syncase is booted
	* module/ice-9/boot-9.scm (module-name): Give psyntax a module-name
	  definition, even before psyntax is booted (in a future commit).

2009-04-21  Andy Wingo  <wingo@pobox.com>

	fix begin-deprecated
	* module/ice-9/boot-9.scm (begin-deprecated): Fix to output source code,
	  doh.

	tweaks to boot-9
	* module/ice-9/boot-9.scm: Move the r4rs init up to the top.
	  (try-module-autoload): Don't use with-fluids before it's defined.

	allow eval to be called before modules are booted
	* libguile/eval.c (scm_eval): If the module system isn't booted, assert
	  not on the module argument.

	commit some tweaks to expand.scm, likely obviated by syncase though
	* module/language/scheme/expand.scm (re-annotate, expand): A couple of
	  speculative cases for dealing with syncase better -- but all of this
	  code is likely to go.

	scm_[current_]module_transformer returns the %pre-modules-transformer, if set
	* libguile/modules.c (scm_module_transformer)
	  (scm_current_module_transformer): So, if the module system hasn't yet
	  booted, take the current transformer from a variable named
	  %pre-modules-transformer from the %pre-modules-obarray. This is a
	  prequel to booting syncase early in boot-9.

	make syncase aware of (set! (@ (foo) bar) baz)
	* module/ice-9/psyntax.scm (set!): Handle (set! (@ (foo ..) bar) val)
	  inside syncase. Heh heh heh.

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

	syncase knows about @ / @@
	* module/ice-9/psyntax.scm (syntax-type): Handle a new type, module-ref.
	  Like external-macro, it also has a procedure as a binding.
	  (chi-expr): module-ref forms -- that is to say, (@ (foo ...) bar) -- as
	  expressions they are global references, but with respect to a specific
	  module.
	  (@, @@): Define module-ref syntax handlers.

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

	* module/ice-9/syncase.scm: Mark as primitive syntax so we don't clobber
	  their definitions.

	The reason I'm doing things like this is so as to support (set! (@@ ...)
	...) sensibly, which will be the next patch.

2009-04-21  Andy Wingo  <wingo@oblong.net>

	distcheck fixen
	* examples/Makefile.am: Fix the installed guile-config invocation to set
	  PKG_CONFIG_PATH.

	* meta/Makefile.am (EXTRA_DIST): Dist the bin_SCRIPTS.

	* meta/guile-config (pkg-config): Better error messages if pkg-config
	  invocation fails.

	* meta/uninstalled-env.in (PATH): Now that guile-config and guile-tools
	  are not generated, make it the srcdir/meta instead of the builddir.
	  (Guile itself will be picked up from libguile.)

2009-04-20  Andy Wingo  <wingo@pobox.com>

	Merge branch 'syncase'

2009-04-20  Andy Wingo  <wingo@wingomac.bcn.oblong.net>

	fix guile.m4 for sitedir change
	* meta/guile.m4

	scripts take rest args
	* meta/guile-tools: Instead of fixing scripts I should have been fixing
	  the script runner.

	* module/scripts/compile.scm:
	* module/scripts/snarf-guile-m4-docs.scm: Fix to take rest args.

	some more build fixes for bugs that I introduced
	* meta/guile-1.8.pc.in: Include a pkgdatadir, which will map down to
	  `guile-config info pkgdatadir', used in existing guile.m4 files.

	* meta/guile-config: Fix guile-config info varname. Facepalm.

	* meta/guile.m4: Make GUILE_SITE_DIR use the sitedir variable instead.
	  Really it should use pkg-config directly, though.

	fix build errors on fresh checkout
	* meta/guile-tools: We can't use srfi-1, because on a fresh checkout
	  the srfi-1 shlib isn't built yet. Bummer.

	* meta/uninstalled-env.in: Fix up the DYLD lines for BSDen.

	* module/scripts/snart-guile-m4-docs.scm: Fix expected arguments.

2009-04-20  Andy Wingo  <wingo@oblong.net>

	fix m4->texi snarfage after the guile-tools change
	* doc/ref/Makefile.am: Fix to work after a make clean with the recent
	  guile-tools changes.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	no positions when reading psyntax-pp, validation in @/@@, cleanups
	* module/ice-9/syncase.scm (old-debug): Re-disable position recording
	  when reading psyntax-pp.

	* libguile/eval.c (scm_m_at, scm_m_atat): More input validation.

	* libguile/debug.c (scm_procedure_module): Use scm_env_module. Remove
	  extraneous docstring.

	fix hygiene + modules + local macros
	* module/ice-9/psyntax-pp.scm: Regenerate.

	* module/ice-9/psyntax.scm (syntax-type): Look up the type of the car of
	  a form relative to its module, if it is a syntax object. Fixes hygiene
	  wrt modules and private macros.

	* module/ice-9/syncase.scm (sc-macro): Add a comment.

	* module/system/base/pmatch.scm: The big test case: just export pmatch,
	  not ppat too.

	fix handling of pre-modules errors in the vm
	* libguile/vm-i-system.c (toplevel-ref, toplevel-set): Correct situation
	  whereby we would not throw when toplevel vars were unbound, before
	  modules had booted.

	@ and @@ as primitive macros
	* libguile/eval.h:
	* libguile/eval.c (error_unbound_variable, error_defined_variable):
	  Move these prototypes up earlier.
	  (scm_m_at, scm_m_atat): New functions, provide the @ and @@
	  functionality. Moved here from defmacros because they are
	  "special", inasmuch as syncase doesn't really understand them in
	  interpreted code.

	* module/ice-9/boot-9.scm (@, @@): Don't define as defmacros, as
	  defmacros have to actually return source now.

	hygienic compilation
	* module/language/scheme/compile-ghil.scm (lookup-transformer): Recognize
	  macros as initial (@ ...) or (@@ ...) forms, enabling hygienic
	  compilation.

	houston, we have hygiene
	* module/ice-9/expand-support.scm (strip-expansion-structures): Enable
	  @/@@ substitution.

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

	* module/ice-9/psyntax.scm: Since syntax objects are quotable, make the
	  module field the module name, not the module itself. Scope the operand
	  of global calls appropriately. Thread modules through syntax-dispatch
	  destructuring. Houston, we have hygiene.

	* module/ice-9/syncase.scm: Adapt to module / module-name changes.

	more work on modules and hygiene, not finished yet, alas.
	* module/ice-9/compile-psyntax.scm: No more expansion-eval-closure.

	* module/ice-9/expand-support.scm (strip-expansion-structures): Only @@
	  names whose module is not the current module. Actually @@ serialization
	  is disabled for this commit, just to get this one in and keep things
	  working.

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

	* module/ice-9/psyntax.scm (put-global-definition-hook)
	  (get-global-definition-hook): Instead of going through that stupid
	  getprop/putprop interface, let's just inline Guile-specific code here.
	  (build-global-reference, build-global-assignment): Fix a bug where the
	  module and public? were switched, which happily allowed things to
	  compile. (We reintroduce a similar bug above in expand-support.)
	  (lookup): Add a module argument.
	  (global-extend): Adapt for put-global-definition-hook invocation.
	  (syntax-type): Lookup with mod. Return mod even for lexicals and
	  define-form -- why not.
	  (chi-top, fluid-let-syntax, syntax, set!): Lookup with mod. Wrap with
	  mod.

	* module/ice-9/syncase.scm (expansion-eval-closure)
	  (current-eval-closure, env->eval-closure): OK! So the idea is: module
	  hygiene is syncase's business, not ours. So lose the eval-closure
	  fluid. Also, eval closures are so 1990s.
	  (sc-macro): But, we have to take the module from the env, sadly. In the
	  future this will be different.
	  Remove the rest of the eval-closure bits. Enable source reporting,
	  while we're debugging.

	* module/language/scheme/compile-ghil.scm (lookup-transformer): Adapt for
	  eval closure fluid changes.

	eval-closure-module, here hopefully not for long
	* libguile/modules.h:
	* libguile/modules.c (scm_eval_closure_module): Define a
	  new-yet-deprecated accessor, to ease a transition.

	thread the module through syntax-case's expansion
	* libguile/debug.h:
	* libguile/debug.c (scm_procedure_module): New procedure, returns the
	  module that was current when the given procedure was defined. Used by
	  syncase to scope free identifiers.

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

	* module/ice-9/psyntax.scm: Thread the module through the syntax
	  expansion. This is harder than it would appear because in many places
	  the different components of syntax objects are destructured.

	* module/ice-9/syncase.scm (guile-macro): Adapt to new signature for
	  syntax transformer functions.

	finish bootstrap to syntax-objects with modules
	* module/ice-9/psyntax.scm: Now that we have gone through the
	  intermediate step (in which both representations of syntax-object had
	  to coexist), change all callers to make-syntax-object to pass the third
	  argument, and restore the define-structure definition of syntax
	  objects.

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

	add modules to syntax objects (part 1, intermediate step)
	* module/ice-9/psyntax.scm (make-syntax-object): As an intermediate step
	  to adding modules to syntax objects, replace the definition of
	  syntax-object as a structure with an expanded-out definition that has
	  (1) a constructor that takes 2 or 3 arguments, and (2) a predicate that
	  works with vectors of length 3 or 4. I couldn't just redefine
	  make-syntax-object, for example, because these are internal
	  definitions, and we can't have duplicate bindings in a letrec.

	serialize module information into syncase's output -- getting ready for hygiene
	* module/ice-9/Makefile.am: Replace annotate.scm with expand-support.scm.

	* module/ice-9/annotate.scm: Removed; subsumed into expand-support.scm.

	* module/ice-9/compile-psyntax.scm: Strip out expansion structures before
	  writing to disk.

	* module/ice-9/expand-support.scm: New file. Provides annotation support,
	  and other compound data types for use by the expander. Currently the
	  only one that is used is the toplevel reference, <module-ref>, but we
	  will record lexicals this way soon.

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

	* module/ice-9/psyntax.scm (build-global-reference)
	  (build-global-assignment): Instead of expanding out global references
	  as symbols, expand them as <module-ref> structures, with space to
	  record the module that they should be scoped against. This is in
	  anticipation of us actually threading the module info through the
	  syntax transformation, so that we can get hygiene with respect to
	  modules.

	* module/ice-9/syncase.scm: Replace eval-when. Since sc-expand will give
	  us something that isn't Scheme because we put the <module-ref>
	  structures in it, strip that info whenever we actually do need scheme.

	* module/language/scheme/compile-ghil.scm (lookup-transformer): Strip
	  expansion structures here too.

	* module/language/scheme/expand.scm (language): Swap annotate for
	  expand-support. But this file will die soon, I think.

	fix a tricky GC bug in scm_c_make_subr
	* libguile/procs.c (scm_c_make_subr): Fix a really tricky bug!!! If
	  scm_double_cell caused GC, the symbolic name wouldn't be marked. But
	  the symptom wouldn't appear until you accessed that symbol much later,
	  for example during tab completion / apropos grovelling. Not sure why we
	  didn't see this earlier.

	guile-tools is a scheme script that loads scheme modules
	* meta/guile-tools: Changed to be a scheme script. Instead of looking for
	  executables in a "scripts dir", we just look for modules in (scripts),
	  and load the modules directly.

	* module/Makefile.am:
	* module/scripts/: Move the scripts into module/ so they can be compiled.
	  Rename scripts from `foo' to `foo.scm'.

	* libguile/Makefile.am: Invoke the snarf->texi code via guile-tools.

	* configure.in:
	* .gitignore: Update for changes.

	fix a couple gc-related continuations bugs
	Thanks to Juhani Rantanen for the report.

	* libguile/continuations.c (scm_make_continuation): Delay making the smob
	  until the data is fully initialized. Fixes a bug whereby a GC in
	  scm_vm_capture_continuations would catch the us with an undefined
	  continuation->vm_conts, leading to marking badness.

	* libguile/vm.c (vm_cont_free): Report the correct size to scm_gc_free.

2009-04-16  Andy Wingo  <wingo@pobox.com>

	support expression-by-expression compilation
	* module/language/ghil.scm (unparse-ghil): Fix unparsing of quasiquoted
	  expressions.

	* module/language/ghil/spec.scm (join): Define a joiner for GHIL.

	* module/language/scheme/compile-ghil.scm (cenv-ghil-env): Expand the
	  definition of a CENV so it can have an actual ghil-env, if available.
	  (compile-ghil): Return the actual ghil env in the cenv.

	* module/system/base/compile.scm (compile-file): Rewrite. `output-file'
	  is now a keyword argument, along with the new kwargs `env' and `from'.
	  We now allow exceptions to propagate up, and instead of printing the
	  output file to the console, we return a string corresponding to its
	  location.
	  (compile-and-load): Use read-and-compile.
	  (compile-fold): Thread around the cenv as well. Return all three
	  values.
	  (find-language-joint, read-and-compile): New exciting helpers. The idea
	  is that compiling a file should be semantically equivalent to compiling
	  each expression in it, one by one. Compilation can have side effects,
	  e.g. affecting the current language or the current reader. So what we
	  do is find a point in the compilation path at which different
	  expressions of a given language can be joined into one. Expressions
	  from the source language are compiled to the joint language, then
	  joined and compiled to the target.
	  (compile): Just return the first value from compile-fold.

	* module/system/base/language.scm (language-joiner): New optional field.

	* scripts/compile: Rework for changes to compile-file.

	compilation passes return third value: the continuation environment
	* module/system/base/compile.scm: Expect compile passes to produce three
	  values, not two. The third is the "continuation environment", the
	  environment that can be used to compile a subsequent expression from
	  the same source language. For example, expansion-time side effects can
	  set the current module, which would be reflected appropriately in the
	  continuation environment.

	* module/language/assembly/compile-bytecode.scm:
	* module/language/bytecode/spec.scm:
	* module/language/ecmascript/compile-ghil.scm:
	* module/language/ghil/compile-glil.scm:
	* module/language/glil/spec.scm:
	* module/language/objcode/spec.scm:
	* module/language/scheme/compile-ghil.scm:
	* module/system/base/compile.scm: Update compile passes to return a
	  continuation environment.

2009-04-06  Andy Wingo  <wingo@pobox.com>

	guile-config rebased on top of pkg-config
	* configure.in:
	* meta/Makefile.am (EXTRA_DIST): Remove guile-config.in bits.

	* meta/guile-config: Reimplement to work on top of pkg-config. This lets
	  guile-config not be substed by configure.

	* meta/uninstalled-env.in: Remove the path to guile-config, belatedly.
	  Set the pkg-config path correctly.

2009-04-05  Ludovic Courtès  <ludo@gnu.org>

	Avoid uses of deprecated forms in the VM code.
	Reported by Daniel Kraft <d@domob.eu>.

	* libguile/frames.c, libguile/vm.c: Include <stdlib.h>, use `size_t'
	  instead of `scm_sizet'.

	* libguile/objcodes.c, libguile/programs.c, libguile/vm-engine.c,
	  libguile/vm-i-loader.c, libguile/vm-i-system.c: Use `scm_list_X ()'
	  instead of the deprecated `SCM_LISTX ()'.

2009-04-05  daniel  <daniel@dani.localdomain.invalid>

	Make `--disable-deprecated' work.
	* configure.in (enable_deprecated): Set SCM_WARN_DEPRECATED_DEFAULT
	  even when --disable-deprecated is passed.
	* libguile/deprecation.h: Declare deprecation-issuing methods even
	  if SCM_ENABLE_DEPRECATED is not set.
	* libguile/deprecation.c: Ditto.
	  (scm_init_deprecation): Include full body even for unset
	  SCM_ENABLE_DEPRECATED.

2009-04-04  Jose A. Ortega Ruiz  <jao@gnu.org>

	Improved handling of callers cache in (system xref).
	  * We cache callees in each module, and keep a list of modified
	    ('tainted') modules, which is used to reconstruct the callers
	    database incrementally.
	  * `procedure-callers' now returns an a-list, keyed by module name.

2009-04-04  Andy Wingo  <wingo@pobox.com>

	fix nondeterminism in vm-i-system.c
	* libguile/vm-i-system.c (br-if-eq, br-if-not-eq): Fix some
	  nondeterminism caught by GCC 4.4.

2009-04-03  Andy Wingo  <wingo@pobox.com>

	no hard-coded stack limitations if the user has getrlimit
	* libguile/debug.c (init_stack_limit): Instead of "1 MB or 80% of rlimit,
	  whichever is lower", just use 80% of the rlimit, if set.

2009-03-31  Andy Wingo  <wingo@pobox.com>

	add test case for load-extension bug, fix gdb-uninstalled-guile
	* test-suite/standalone/test-extensions:
	* test-suite/standalone/test-extensions-lib.c:
	* test-suite/standalone/Makefile.am: Add a test case for the
	  load-extension bug.

	* meta/gdb-uninstalled-guile.in: Fix the path to include meta/.

2009-03-29  Andy Wingo  <wingo@pobox.com>

	Merge branch 'wingo'

	fix duplicates in procedure-callers
	* module/system/xref.scm (ensure-callers-db): OK! Since we can see the
	  same variable twice, e.g. in different modules, keep a unified hash of
	  seen vars and modules. Prevents duplicates in procedure-callers.

	fix spurious duplicates in procedure-callees and callers
	* module/system/xref.scm (program-callee-rev-vars): It's possible to get
	  duplicates when combining callees of inner procedures, so ignore dups.
	  Quadratic, boo.

2009-03-28  Andy Wingo  <wingo@pobox.com>

	bugfix: don't dynamic link if we found a registered extension
	* libguile/extensions.c (load_extension): Don't do dynamic linking if we
	  actually did find an extension in the list.

	frame, program, objcode, etc inits use load-extension
	* libguile/extensions.h: Define a scm_t_extension_init_func.

	* libguile/frames.c:
	* libguile/instructions.c:
	* libguile/objcodes.c:
	* libguile/programs.c:
	* libguile/vm.c: Register extension init funcs. Should play nicer with a
	  static Guile, in addition to working on Darwin with non-default
	  installation prefixes without munging DYLD_LIBRARY_PATH.

	* module/system/vm/frame.scm:
	* module/system/vm/instruction.scm:
	* module/system/vm/objcode.scm:
	* module/system/vm/program.scm:
	* module/system/vm/vm.scm: Use load-extension.

	fix distcheck hopefully, by cleaning the vm-i-*.i files
	* libguile/Makefile.am (CLEANFILES): Clean vm-i-*.i.

	fix "linking" of guile-config
	* meta/guile-config.in: Adjust "linking"; @bindir@ doesn't get fully
	  expanded. So instead use a shell trampoline.

	fix check for guile-tools running uninstalled
	* meta/guile-tools.in (mydir): Fix check for running uninstalled.

2009-03-27  Andy Wingo  <wingo@pobox.com>

	rely on getrlimit to DTRT, don't make stack calibration file
	* libguile/measure-hwm.scm: Remove.

	* .gitignore: Update for removal.

	* test-suite/standalone/test-fast-slot-ref.in:
	* test-suite/standalone/test-use-srfi.in:
	* am/guilec:
	* check-guile.in: Revert back to normal guile invocation.

	* libguile/Makefile.am: Don't make a stack calibration file, as the
	  getrlimit-based limit setting should work fine.

	getrlimit-based stack limits
	* libguile/debug.c (init_stack_limit): Initialize the stack limit based
	  on operating system limits (via getrlimit(2)), or 1 MB -- whichever is
	  smaller.

	add getrlimit and setrlimit wrappers
	* README: Some rewording.

	* configure.in: Check for getrlimit and setrlimit.

	* libguile/posix.h:
	* libguile/posix.c: Add some getrlimit and setrlimit wrappers. They're
	  documented, but I suspect something else has to be done to get them
	  into the manual.

	allow building against uninstalled guile; move some things to meta/
	* README: Add more info about building against an uninstalled Guile.

	* meta/: New directory. The proximate cause of its creation is that I
	  want to be able to build external packages against uninstalled Guile,
	  and to do that I need guile-tools in the PATH, but I don't want
	  $top_builddir/libtool in the path. But it seems like a good
	  reorganization, for things that are /about/ Guile: pkg-config files, m4
	  files, guile-config... then we also include uninstalled info: the
	  environment, the pre-inst-guile script, etc.

	* meta/guile-1.8-uninstalled.pc.in: New pkg-config template. pkg-config
	  prefers -uninstalled pkg-config files, if they are in its path.

	* meta/Makefile.am:
	* meta/ChangeLog-2008:
	* meta/gdb-uninstalled-guile.in:
	* meta/guile-1.8.pc.in:
	* meta/guile-config.in:
	* meta/guile.m4:
	* meta/guile-tools.in: Moved to meta/.

	* meta/guile.in: This is the new name of pre-inst-guile.in.

	* meta/uninstalled-env.in: And this, pre-inst-guile-env.in.

	* Makefile.am:
	* am/guilec:
	* am/pre-inst-guile:
	* check-guile.in:
	* configure.in:
	* doc/ref/Makefile.am:
	* gc-benchmarks/run-benchmark.scm:
	* test-suite/standalone/Makefile.am:
	* test-suite/standalone/README:
	* testsuite/Makefile.am: Adapt to meta/ change.

2009-03-27  Ludovic Courtès  <ludo@gnu.org>

	Improve wording in `libguile/Makefile.am' regarding stack calibration.
	* libguile/Makefile.am (stack-limit-calibration.scm): Improve wording of
	  the comment.  Suggested by Neil Jerram.

2009-03-26  Ludovic Courtès  <ludo@gnu.org>

	Run the stack calibration script before running the compiler.
	* am/guilec (.scm.go): Use `pre-inst-guile' and load
	  `stack-limit-calibration.scm'.  This is particularly useful when
	  building the first `.go' files where the compiler is run using the
	  interpreter, which may end up using a lot of stack space.

	* libguile/Makefile.am (BUILT_SOURCES): Add
	  `stack-limit-calibration.scm'.
	  (TESTS, TESTS_ENVIRONMENT): Remove.
	  (stack-limit-calibration.scm): Prepend `-' so that any errors during
	  the calibration are ignored.

	Remove multiple definition of `scm_i_marking'.
	* libguile/private-gc.h (scm_i_marking): Turn definition into a
	  declaration.
	  (scm_mark_all): Mark as `SCM_INTERNAL'.

	* libguile/gc-mark.c (scm_i_marking): New definition.

2009-03-25  Ludovic Courtès  <ludo@gnu.org>

	Fix `testsuite/Makefile.am' for `distcheck'.
	* testsuite/Makefile.am (check_SCRIPTS): Remove, renamed to `TESTS'.
	  (EXTRA_DIST): Add $(TESTS).

2009-03-24  Ludovic Courtès  <ludo@gnu.org>

	Aggregate `Makefile.am' files under `examples/'.
	* configure.in: Don't produce `examples/*/Makefile'.

	* examples/Makefile.am (SUBDIRS): Remove.
	  (EXTRA_DIST, AM_CFLAGS, AM_LIBS): New.
	  (box/box, box/box.o, box-module/box, box-module/box.o, libbox.la,
	  box-dynamic/box.lo, libbox-module.la, box-dynamic-module/box.lo,
	  installcheck, CLEANFILES, clean-local): New targets, aggregated from
	  `Makefile.am' files formerly in sub-directories.

	* examples/check.test: New file, aggregated from `check.test' files in
	  sub-directories.

	Include <alloca.h> in `gsubr.c'.
	* libguile/gsubr.c: Include <alloca.h>.  Reported by Carlo Bramini
	  <carlo.bramix@libero.it>.

2009-03-22  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded SMOB mark procedure in `i18n.c'.
	* libguile/i18n.c (smob_locale_mark): Remove.
	  (scm_init_i18n): Remove `scm_set_smob_mark ()' call.

	Remove references to `scm_in_heap_p ()'.
	* libguile/gc.c (scm_i_expensive_validation_check): Don't call
	  `scm_in_heap_p ()'.  Cells don't necessarily live in the heap
	  nowadays.

	* libguile/gc.h (scm_in_heap_p): Remove declaration.

	Remove unneeded VM SMOB mark/free procedures.
	* libguile/vm.c (vm_mark_stack, vm_cont_mark, vm_cont_free, vm_mark,
	  vm_free): Remove.
	  (scm_bootstrap_vm): Remove corresponding `scm_set_smob_mark ()' and
	  `scm_set_smob_free ()' calls.

	* libguile/frames.c (vm_frame_mark, vm_frame_free): Remove.
	  (scm_bootstrap_frames): Remove `scm_set_smob_mark ()' and
	  `scm_set_smob_free ()' calls.

	* libguile/objcodes.c (objcode_mark): Remove.
	  (scm_bootstrap_objcodes): Remove call to `scm_set_smob_mark ()'.

	* libguile/programs.c (program_mark): Remove.
	  (scm_bootstrap_programs): Remove call to `scm_set_smob_mark ()'.

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/continuations.c
		libguile/gc-freelist.c
		libguile/gc-mark.c
		libguile/symbols.c
		libguile/threads.c
		module/ice-9/boot-9.scm

2009-03-20  Andy Wingo  <wingo@pobox.com>

	speed up goops rehashing
	* module/oop/goops/dispatch.scm (cache-try-hash!): Speed up goops
	  rehashing, in theory. I haven't measured, though.

	fix interpreted methods with empty bodies
	* module/oop/goops.scm (method): If a method has no body, subst in `(if
	  #f #f)' instead of `(begin)', to please the memoizer.

	add generic method-formals; fixes to method-source
	* module/oop/goops.scm (method-source): Don't throw an error if this
	  method has no source.
	  (method-formals): New generic function, the complement of
	  method-specializers for introspection.

	fix casts to unsigned long in objcodes.c
	* libguile/objcodes.c (scm_c_make_objcode_slice): Fix casts to unsigned
	  long.

2009-03-19  Ludovic Courtès  <ludo@gnu.org>

	Have `scm_take_locale_symbol ()' return an interned symbol (fixes bug #25865).
	* libguile/symbols.c (intern_symbol): New function, with code formerly
	  duplicated in `scm_i_c_mem2symbol ()' and `scm_i_mem2symbol ()'.
	  (scm_i_c_mem2symbol, scm_i_mem2symbol): Use it.
	  (scm_take_locale_symboln): Use `intern_symbol ()'.  This fixes
	  bug #25865.

	* test-suite/standalone/Makefile.am
	  (test_scm_take_locale_symbol_SOURCES,
	  test_scm_take_locale_symbol_CFLAGS,
	  test_scm_take_locale_symbol_LDADD): New variables.
	  (check_PROGRAMS, TESTS): Add `test-scm-take-locale-symbol'.

2009-03-18  Andy Wingo  <wingo@pobox.com>

	rework procedure-callers to stay correct as callees are redefined
	* module/system/xref.scm (procedure-callers): Rework to calculate the
	  callers of a *variable*, not of a value. This is because the
	  module-observers only get fired when the module changes, not with the
	  variables change values. Also accept either a variable, a symbol
	  (resolved in the current module), or a modname . symname pair.

	doubly-weak callers db
	* module/system/xref.scm (ensure-callers-db): Store the callers db as a
	  doubly-weak hash table.

	implement procedure-callers
	* module/system/xref.scm: Implement procedure-callers, as the inverse of
	  procedure-callees, with a cache invalidated by changes in modules.

	* module/ice-9/boot-9.scm (module-use!): Don't poke module observers when
	  module-use! is called for an already-used module.

2009-03-17  Andy Wingo  <wingo@pobox.com>

	add xref stub for interpreted procedures
	* module/system/xref.scm (hacky-procedure-callees): Add a
	  procedure-callees implementation for procedures with source, that
	  currently does nothing. Not sure what to do, going into the future.

	add xref.scm
	* module/system/xref.scm: New module, will provide callers/callees info.

	* module/Makefile.am (SOURCES): Add xref.scm.

	tweaks to the un-integrated test cases
	* testsuite/Makefile.am: Sortof turn these VM tests into more
	  automake-like tests. Needs further work.

	non-srcdir build fixes
	* guile-tools.in: Fix the checks to account for non-srcdir builds.

	* libguile/frames.c:
	* libguile/objcodes.c:
	* libguile/programs.c:
	* libguile/instructions.c:
	* libguile/vm.c: Fix snarf-includes to cope with non-srcdir builds.

	* libguile/instructions.h:
	* libguile/instructions.c: Fix the stubs inclusion to be non-srcdir
	  compatible.

	* libguile/vm-expand.h (VM_DEFINE_INSTRUCTION): Fix some things so as not
	  to require the instructions.h defintitions, since we have the codes
	  already. Not important tho :)

	* pre-inst-guile-env.in: Minor tweak that should have no effect.

	* test-suite/standalone/Makefile.am (all-local): Remove a chmod +x step,
	  the configure.ac rule should do that if necessary.

	try a new way of checking byte order

	decompile source info into <glil-source> annotations.
	* module/language/glil/decompile-assembly.scm (decompile-load-program):
	  Decompile source information into <glil-source> annotations.

	fix bug serializing filenames in source locations
	* module/language/glil/compile-assembly.scm (limn-sources): Fix bug
	  whereby filename was serialized as a ("foo") instead of "foo".

	tweaks to asm->glil decompiler, perhaps fix a (program-source p 0) bug
	* module/language/ghil/compile-glil.scm (codegen): Push a program's
	  source locations before copying external args to heap -- perhaps fixes
	  (program-source p 0) for some programs.

	* module/language/glil/decompile-assembly.scm (decompile-load-program):
	  Take another arg, the object vector. Emit <glil-bind> and <glil-unbind>
	  correctly. Properly unparse properties. Just have to deal with source
	  locations now.

	add assembly->glil decompiler
	* module/language/glil/decompile-assembly.scm: A first pass at an
	  assembly->glil decompiler. Works for a small subset of programs.

	* module/Makefile.am (GLIL_LANG_SOURCES):
	* module/language/glil/spec.scm (glil): Add the decompiler.

	update disassembler for changes to decompiler
	* module/language/assembly/disassemble.scm (disassemble-load-program)
	  (code-annotation): And update the disassembler for changes to
	  decompiler.

	parse jumps as labels when decompiling bytecode->assembly
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Parse out jumps as labels.

	procedure-arity on vm-compile apply: verily, unresolved.
	* test-suite/tests/procprop.test ("procedure-arity"): Procedure-property
	  'arity on "apply" will fail if "apply" is a program. I suggest that
	  procedure-property is actually the wrong interface for this; if we even
	  want to preseve the old arity forms, we should have an accessor for
	  arity directly that the VM can implement. But in the meantime throw
	  this nasty error while we decide.

2009-03-17  Andy Wingo  <wingo@oblong.net>

	Merge commit 'cb9d473112ac172a3d328bb029b5b550918d4262' into vm-check

	Merge commit 'e20d7001c3f7150400169fecb0bf0eefdf122fe2' into vm-check
	Conflicts:

		libguile/stacks.c

	fix marking of double-cell subrs
	* libguile/gc-mark.c (scm_gc_mark_dependencies): Mark the name, generic,
	  and properties of subrs.

	Merge commit 'e092357058850a6f998bf462bdc5504c6379c96f' into vm-check

	Merge commit 'feccd2d3100fd2964d4c2df58ab3da7ce4949a66' into vm-check

	Merge commit 'cce8b2ce93703aff953750fb40cb53176ea66504' into vm-check

	Merge commit '4c9e29ec38350a5206aa3e8e72ad4376512ada2b' into vm-check

	Merge commit 'ad5f5ada1d50ecdab634d60ffe3a13b9193156aa' into vm-check

	Merge commit '95a040cd2be7ad03bf197edbdb1fec2c52749ef6' into vm-check

	Merge commit '6290d3f10927f887102a164ccb1a7291cc62288d' into vm-check

	Merge commit '5bb2d903b9e54fdd5858a16ba11fa91a9dc0c692' into vm-check

	Merge commit '04795a1cb259c20896fb2edb50c58086027281b0' into vm-check

	Merge commit '202271f291971cf14175f5a1a193955f72d43d79' into vm-check

	Merge commit 'c010924a71f942100dc7b4021d5ef1c6decf9c85' into vm-check

	Merge commit '53d81399bef1d9396665e79fb6b9c25eb8e2a6ad' into vm-check
	Also cherry-picks the changes from 1405f1b60fa178303484cd428068ecd01ff6d322

	Conflicts:

		module/ice-9/session.scm

	Merge commit 'ab878b0f8e675a741a7dd56f52638a7cc0419907' into vm-check

	Merge commit 'cbee5075d69cb057c4af4c5e24319da90367897f' into vm-check

	Merge commit '32a2609de06af65341e6b4db6961557b788821e8' into vm-check

	Merge commit 'e95d11110b7af0f528404d28209c3a464ab7074d' into vm-check

	Merge commit '752be95a475132506c35922d284884cf776149d0' into vm-check
	Conflicts:

		INSTALL

	Merge commit '8b0174c879bf74981efe702a00471ed5b8e6912e' into vm-check

2009-03-17  Andy Wingo  <wingo@pobox.com>

	revert annotation support in syncase. another day perhaps.
	* module/ice-9/syncase.scm: Revert support for annotations, as I'm seeing
	  wierd problems whereby syntax-object->datum does not fully strip its
	  input.

2009-03-16  Ludovic Courtès  <ludo@gnu.org>

	Allow the static allocation of all types of subrs.
	This is a follow-up to 46f9baf49a8ea4461e8494c75a88b87d0f5c5195 ("Allow
	the static initialization of subrs.") and
	e20d7001c3f7150400169fecb0bf0eefdf122fe2 ("Remove "compiled closures"
	("cclos") in favor of a simpler mechanism.").

	* libguile/procs.h (SCM_SUBR_ARITY_TO_TYPE): Return the appropriate type
	  for gsubrs instead of returning -1.

	* libguile/Makefile.am (snarf-gsubr.h): Remove target.
	  (BUILT_SOURCES, nodist_modinclude_HEADERS, MOSTLYCLEANFILES): Remove
	  `snarf-gsubr.h'.

	* libguile/snarf.h (SCM_DEFINE)[SCM_SUPPORT_STATIC_ALLOCATION]: Don't
	  include "libguile/snarf-gsubr.h".
	  (SCM_DEFINE_SUBR_reqX_optY_rstZ): Remove.

	Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc
	Conflicts:
		libguile/procs.h

2009-03-09  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

2009-03-08  Andy Wingo  <wingo@pobox.com>

	Fix errors when stripping annotations
	* module/ice-9/annotate.scm (set-annotation-stripped!): Fix prototype to
	  correspond to what syncase needs.

	* module/ice-9/psyntax.scm (strip-annotation): Use `if', not `when', for
	  portability.

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

2009-03-08  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc-card.c
		libguile/gc-mark.c

	Aggregate `Makefile.am' files under `lang/'.
	* lang/Makefile.am (SUBDIRS): Remove.
	  (elisp_sources): Aggregate the value of `elisp_SOURCES' formerly found
	  in sub-directories' `Makefile.am'.

	Move `guardians.test' to its own module.
	* test-suite/tests/guardians.test: Add `define-module' clause.

	Provide a C vararg interface to gsubr invocation.
	* libguile/eval.i.c (CEVAL): Update calls to `scm_i_gsubr_apply ()' with
	  a fixed number of arguments.  Use `scm_i_gsubr_apply_list ()' for
	  calls with a list of arguments of unknown length.
	  (SCM_APPLY): Use `scm_i_gsubr_apply_list ()' instead of
	  `scm_i_gsubr_apply ()'.

	* libguile/gsubr.c (gsubr_apply_raw): New.
	  (scm_i_gsubr_apply): Change to take a C vararg list instead of a
	  Scheme list.  Use `gsubr_apply_raw ()'.
	  (scm_i_gsubr_apply_list): Use `gsubr_apply_raw ()'.

	* libguile/gsubr.h (scm_i_gsubr_apply): Update prototype.
	  (scm_i_gsubr_apply_list): New declaration.

	Slightly simplify gsubr invocation in the evaluator.
	* libguile/eval.i.c (CEVAL): Remove the `cclon' label; replace jumps to
	  `cclon' with `RETURN (scm_i_gsubr_apply (...))'.

	Add new subr invocation benchmarks.
	* benchmark-suite/benchmarks/subr.bm (hook1, hook3): New variables.
	  ("subr invocation")("generic subr with rest arg", "generic subr with
	  rest arg and 3+ parameters"): New benchmarks.
	  ("subr application")("generic subr with rest arg", "generic subr with
	  rest arg and 3+ parameters"): New benchmarks.

2009-03-06  Andy Wingo  <wingo@pobox.com>

	actually use syncase's source information tracking. rock!
	* module/ice-9/annotate.scm (deannotate/source-properties): Version of
	  deannotate that sets source properties on the resulting expressions.

	* module/ice-9/syncase.scm (sc-macro, syncase): Annotate expressions
	  before they go into syncase, and deannotate/source-properties when they
	  come out. The upshot is that syncase now understands source
	  information, yay!

	modify psyntax so it produced annotated source if given annotated source
	* module/ice-9/psyntax.scm (build-annotated): New helper, used by the
	  output constructors.
	  (build-application, build-conditional, build-lexical-reference)
	  (build-lexical-assignment, build-global-reference)
	  (build-global-assignment, build-global-definition, build-lambda)
	  (build-primref, build-data, build-sequence, build-let)
	  (build-named-let, build-letrec, build-lexical-var): Use
	  build-annotated, so we produce annotated source if we have source
	  information.

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

	support source-level annotations in syncase
	* module/ice-9/annotate.scm (<annotation>): Slightly more concise
	  printing.
	  (annotate): Don't create annotations if we have no source info.

	* module/ice-9/psyntax.scm (annotation?): Remove this definition, as we
	  now provide annotation support.

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

	* module/ice-9/syncase.scm: Use (ice-9 annotate).

	* module/language/scheme/expand.scm (eval-when): Define the eval-when
	  transformer.

	fix eval-when statements in boot-9
	* module/ice-9/boot-9.scm: Fix a couple eval-when statements.

	Replace eval-case with eval-when
	* module/ice-9/boot-9.scm (eval-when): Replace eval-case with eval-when.
	  Eval-when is *much* simpler, and more expressive to boot. Perhaps in
	  the future we'll get 'visit and 'revisit too.

	* module/ice-9/deprecated.scm (eval-case): Provide mostly-working
	  deprecated version of eval-case.

	* module/ice-9/boot-9.scm (defmacro, define-macro): Relax condition: we
	  can make defmacros that are not at the toplevel now. But in the future
	  we should replace this implementation of defmacros with one written in
	  syntax-case.
	  (define-module, use-modules, use-syntax): Allow at non-toplevel.
	  (define-public, defmacro-public, export, re-export): Don't evaluate at
	  compile-time, I can't see how that helps things. Allow `export' and
	  `re-export' at non-toplevel.

	* module/ice-9/getopt-long.scm:
	* module/ice-9/i18n.scm:
	* module/oop/goops.scm:
	* module/oop/goops/compile.scm:
	* module/oop/goops/dispatch.scm: Switch to use eval-when, not
	  eval-case.

	* module/language/scheme/compile-ghil.scm (eval-when): Replace eval-case
	  transformer with eval-when transformer. Sooooo much simpler, and it
	  will get better once we separate expansion from compilation.

	* module/language/scheme/expand.scm (quasiquote): Hm, expand quasiquote
	  properly. Not hygienic. Syncase needed.
	  (lambda): Handle internal defines with docstrings propertly.

2009-03-02  Andy Wingo  <wingo@pobox.com>

	fixups to expand.scm
	* module/language/scheme/expand.scm: Some changes to avoid unnecessary
	  begins or empty lets, and properly handle internal defines (finally).

	add separate expansion phase, to detwingle things a bit
	* module/language/scheme/expand.scm: New module, implements a separate
	  expansion phase, not interleaved with compilation.

	* module/language/scheme/amatch.scm: Helper for expand.scm, it's pmatch
	  with support for annotated source.

	* module/ice-9/Makefile.am (SOURCES): Add annotate.scm to build list --
	  early on because it will be used in the compiler.

	* module/ice-9/annotate.scm: Fix the printer, default to unstripped
	  (whatever that is), and add a deannotator.

	* module/system/base/compile.scm (call-with-compile-error-catch): Fix for
	  new representation of source locations.

	* module/Makefile.am (SCHEME_LANG_SOURCES): Add amatch and expand.

	fix printer in struct docs
	* doc/ref/api-compound.texi (Vtables): Fix example printer.

	add annotation module
	* module/ice-9/annotate.scm: Add annotation module, for source location
	  tracking with syncase, and for internal use in the compiler.

2009-03-02  Ludovic Courtès  <ludo@gnu.org>

	Mark `scm_gsubr_apply ()' as internal.
	* libguile/gsubr.h (scm_gsubr_apply): Renamed to...
	  (scm_i_gsubr_apply): this.  Marked as `SCM_INTERNAL'.  Callers
	  updated.

	Remove "compiled closures" ("cclos") in favor of a simpler mechanism.
	The idea is to introduce `gsubrs' whose arity is encoded in their type
	(more precisely in the sizeof (void *) - 8 MSBs).  This removes the
	indirection introduced by cclos and simplifies the code.

	* libguile/__scm.h (CCLO): Remove.

	* libguile/debug.c (scm_procedure_source, scm_procedure_environment):
	  Remove references to `scm_tc7_cclo'.

	* libguile/eval.c (scm_trampoline_0, scm_trampoline_1,
	  scm_trampoline_2): Replace `scm_tc7_cclo' with `scm_tc7_gsubr'.

	* libguile/eval.i.c (CEVAL): Likewise.  No longer make PROC the first
	  argument.  Directly invoke `scm_gsubr_apply ()' instead of jump to the
	  `evap(N+1)' label or call to `SCM_APPLY ()'.

	* libguile/evalext.c (scm_self_evaluating_p): Remove reference to
	  `scm_tc7_cclo'.

	* libguile/gc-card.c (scm_i_sweep_card, scm_i_tag_name): Likewise.

	* libguile/gc-mark.c (scm_gc_mark_dependencies): Likewise.

	* libguile/goops.c (scm_class_of): Likewise.

	* libguile/print.c (iprin1): Likewise.

	* libguile/gsubr.c (create_gsubr): Use `unsigned int's for REQ, OPT and
	  RST.  Use `scm_tc7_gsubr' instead of `scm_makcclo ()' in the default
	  case.
	  (scm_gsubr_apply): Remove calls to `SCM_GSUBR_PROC ()'.
	  (scm_f_gsubr_apply): Remove.

	* libguile/gsubr.h (SCM_GSUBR_TYPE): New definition.
	  (SCM_GSUBR_MAX): Changed to 33.
	  (SCM_SET_GSUBR_TYPE, SCM_GSUBR_PROC, SCM_SET_GSUBR_PROC,
	  scm_f_gsubr_apply): Remove.

	* libguile/procprop.c (scm_i_procedure_arity): Remove reference to
	  `scm_tc7_cclo'; add proper handling of `scm_tc7_gsubr'.

	* libguile/procs.c (scm_makcclo, scm_make_cclo): Remove.
	  (scm_procedure_p): Remove reference to `scm_tc7_cclo'.
	  (scm_thunk_p): Likewise, plus add proper `scm_tc7_gsubr' handling.

	* libguile/procs.h (SCM_CCLO_LENGTH, SCM_MAKE_CCLO_TAG,
	  SCM_SET_CCLO_LENGTH, SCM_CCLO_BASE, SCM_SET_CCLO_BASE, SCM_CCLO_REF,
	  SCM_CCLO_SET, SCM_CCLO_SUBR, SCM_SET_CCLO_SUBR, scm_makcclo,
	  scm_make_cclo): Remove.

	* libguile/stacks.c (read_frames): Remove reference to `scm_f_gsubr_apply'.

	* libguile/tags.h (scm_tc7_cclo): Remove.
	  (scm_tc7_gsubr): New.
	  (scm_tcs_subrs): Add `scm_tc7_gsubr'.

	Change `scm_gsubr_apply ()' to take the gsubr as its first argument.
	* libguile/gsubr.c (scm_gsubr_apply): Make SELF the first argument
	  instead of the first element of ARGS.

	* libguile/gsubr.h: Update.

	* libguile/eval.i.c (CEVAL): Update.

	Add subr invocation benchmark.
	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add `subr.bm'.

2009-02-28  Ludovic Courtès  <ludo@gnu.org>

	Move `guardians.test' to its own module.
	* test-suite/tests/guardians.test: Add `define-module' clause.

	Increase chances that `guardians.test' can be successfully run.
	* test-suite/tests/guardians.test: Document overall test sloppiness.
	  ("g2-garbage saved"): Document failure.
	  ("guarding independent objects")["guarding non-immediate", "guarding
	  two non-immediates", "re-guarding non-immediates"]:
	  Improve chances to remove references to the dying object left on the
	  stack.
	  ("guarding weakly referenced objects")["guarded weak vector element
	  gets returned from guardian"]: Likewise.
	  ("guarding weak containers")["element of guarded weak vector gets
	  collected"]: Likewise.
	  ("guarding objects more than once")["guarding twice in one guardian",
	  "guarding twice in two guardians"]: Likewise.

	Add `DEBUG_GUARDIANS' macro for guardian finalization debugging.
	* libguile/guardians.c (finalize_guarded): Use `#ifdef DEBUG_GUARDIANS'
	  instead of `#if 0'.  Add "  guardian for %p vanished\n" debugging
	  statement.

2009-02-27  Andy Wingo  <wingo@pobox.com>

	make the ES compiler more readable via use of ->
	* module/language/ecmascript/compile-ghil.scm: Use -> to make the ES
	  compiler more readable. Fix bugs in do, while, and for, whereby we were
	  missing ->boolean calls.

	use -> macro in scheme->ghil compiler
	* module/language/scheme/compile-ghil.scm (->): New macro, makes GHIL
	  generation a bit more palatable. Use it in all the transformers.

	slight optimization in transform-record, note in optimize*
	* module/language/ghil/compile-glil.scm (optimize*): Add a note.

	* module/system/base/syntax.scm (transform-record): Access the common
	  slots once at the beginning. Cuts down on the number of toplevel refs
	  needed by the generated code.

	introduce -> binding inside transform-record body expressions
	* module/system/base/syntax.scm (transform-record): Introduce a ->
	  binding inside the body, that produces records of the same type.

	* module/language/ghil/compile-glil.scm (optimize*): Remove our ->ghil
	  definition, as transform-record introduces a -> binding for us. Nice.

	first stabs as s-expression-driven transformation of GHIL
	* module/language/ghil/compile-glil.scm (optimize*): Rewritten optimizer
	  -- not yet in use, but it's closer to the code that I'd like to write.

	* module/system/base/syntax.scm (transform-record): New crazy macro,
	  makes GHIL a little less painful to work with.

	common slot accessors are procedures-with-setters
	* module/system/base/syntax.scm (define-type): Common slot accessors are
	  also procedures-with-setters.

	use common slots mechanism in ghil
	* module/system/base/syntax.scm (define-type): Fix getter for common
	  slot.

	* module/language/ghil.scm (<ghil>): Use the common slots mechanism.

	define-type has #:common-slots
	* module/system/base/syntax.scm (define-type): Accept a #:common-slots
	  argument, defining slots that are in all instances of this type.

2009-02-25  Andy Wingo  <wingo@pobox.com>

	fix variable not initialized spurious warnings
	* libguile/vm-i-system.c: Work around some spurious "variable not
	  initialized" messages on Etch's gcc.

	don't crash etch's gcc
	* libguile/vm-engine.h: Don't allocate registers in registers if we're on
	  Etch's GCC.

	export procedure-arguments from ice-9 session
	* module/system/vm/program.scm (program-arguments): New function, used by
	  procedure-arguments.

	* module/ice-9/session.scm (procedure-arguments): New exported function,
	  returns an alist describing the given procedure.

2009-02-24  Ludovic Courtès  <ludo@gnu.org>

	Aggregate makefiles for `module/system' and `module/language'.
	* am/guilec (.scm.go): Create the target's directory, in case
	  $(builddir) != $(srcdir).

	* configure.in: Don't output any makefile under `module/system' or
	  `module/language'.

	* module/Makefile.am (SUBDIRS): Remove `language' and `system'.  Add `.'
	  to the front.
	  (modpath, SOURCES, SCHEME_LANG_SOURCES, ECMASCRIPT_LANG_SOURCES,
	  GHIL_LANG_SOURCES, GLIL_LANG_SOURCES, ASSEMBLY_LANG_SOURCES,
	  BYTECODE_LANG_SOURCES, OBJCODE_LANG_SOURCES, VALUE_LANG_SOURCES): New
	  variables, taken from former `Makefile.am' files in sub-directories.

2009-02-24  Andy Wingo  <wingo@pobox.com>

	unbork the repl
	* module/system/repl/repl.scm (meta-reader): Whoops, unbork the repl.

	in meta-reader, return directly if the peeked char is EOF
	* module/system/repl/repl.scm (meta-reader): If the (next-char #t)
	  returns EOF, return that EOF directly, as it seems that with guile -q,
	  the subsequent `read' actually waits for another C-d. Dunno why.

	use umask when making permissions on .go files
	* module/system/base/compile.scm (call-with-output-file/atomic): Temp
	  files get created 0600. After we're done writing, chmod them to
	  something in line with the user's umask.

	use nobase in am/guilec
	* am/guilec (nobase_mod_DATA): Use nobase_mod_DATA so we install to the
	  correct dir for foo/bar.scm.

2009-02-22  Andy Wingo  <wingo@pobox.com>

	parse division vs regexps properly
	* module/language/ecmascript/tokenize.scm (make-tokenizer/1): Whoops, fix
	  the cases in which we detect that division is valid.

	compile for-in
	* module/language/ecmascript/base.scm (prop-keys): New method, returns
	  the list of keys of props of this instance.

	* module/language/ecmascript/impl.scm: Refactor the global object into a
	  special kind of module object. Provide a prop-keys implementation for
	  module objects.

	* module/language/ecmascript/compile-ghil.scm (comp): Compile for-in.

	* module/language/ecmascript/impl.scm: Reshuffly things, and implement
	  make-enumerator, a helper for use in for-in statements.

	* module/language/ecmascript/parse.scm (parse-ecmascript): Fix parsing of
	  for (var foo in bar) {}...

	fix "for" compilation
	* module/language/ecmascript/compile-ghil.scm (comp): Whoops, fix `for'
	  compilation.

	add scheme integration to js via `require'
	* module/language/ecmascript/impl.scm: Add <js-module-object>, that wraps
	  a module. Add js-require, a javascript-happy function that returns an
	  object that wraps a Guile module. Bind it to `require' in the default
	  environment.

	ecmascript tokens have source info
	* module/language/ecmascript/tokenize.scm: Attach source information to
	  tokens. We have to enhance the lalr parser to actually let this
	  information propagate through, though...

	throw SyntaxError on bad syntax
	* module/language/ecmascript/parse.scm (syntax-error):
	* module/language/ecmascript/tokenize.scm (syntax-error): Throw an error
	  on bad syntax.

	more arithmetic on non-numbers
	* module/language/ecmascript/compile-ghil.scm (comp): Convert to number
	  on unary +.

	* module/language/ecmascript/impl.scm: Define -, *, /, <, <=, >=, >
	  operations on non-numbers.

	+ for strings, global js object, new Foo() works
	* module/language/ecmascript/array.scm (*array-prototype*): Declare the
	  constructor.

	* module/language/ecmascript/base.scm (pput, pdel): Remove some needless
	  checks.
	  (new): Move definition of new here, and use the constructor.

	* module/language/ecmascript/compile-ghil.scm (compile-ghil): Add a stub
	  so that when we load a compiled JS program, we make sure the runtime
	  has been booted.

	* module/language/ecmascript/function.scm (js-constructor): Export a
	  js-constructor method instead of a new method.

	* module/language/ecmascript/impl.scm (<js-global-object>): Define a new
	  class for the global "this" object, wrapping bindings from the current
	  module.
	  (init-js-bindings!): Define the dozen or so global properties, in the
	  current module.
	  (+): Define addition operations for non-numbers. This is efficient
	  because the generics are only dispatched if the fast-path fails.

2009-02-21  Andy Wingo  <wingo@pobox.com>

	compile ecmascript's parser. yay! instant load-time!
	* module/language/ghil/compile-glil.scm (codegen): If there are more than
	  255 arguments, make a list and use apply instead of calling directly.

	* module/language/Makefile.am: Now we can compile parse.scm. Yay!

	* module/language/scheme/compile-ghil.scm: Add a note.

	* module/language/ecmascript/compile-ghil.scm: Add a note.

	be smarter about allocating local variables, reusing slots if possible
	* module/language/Makefile.am: OK, we can compile compile-ghil.scm now,
	  thankfully.

	* module/language/ecmascript/compile-ghil.scm (ormatch): New macro, a
	  wrapper around pmatch to avoid some of the more egregious
	  non-tail recursiveness.
	  (comp): Use ormatch.

	* module/language/ghil.scm (unparse-ghil): The body of bind and mv-bind
	  is a single expression, not a list of expressions.

	* module/language/ghil/compile-glil.scm (codegen): Be more clever when
	  allocating "local" variables -- if a variable goes out of scope, its
	  index can be re-used later.

	* module/language/glil.scm (parse-glil, unparse-ghil): The "rest" of a
	  mv-bind is a flag, not a list. The "ra" of an mv-call is a label, not a
	  GLIL expression.

	* module/language/objcode/spec.scm (collapse-locals, decompile-value):
	  When decompiling a value, process the bindings list differently.
	  Comments in the code.

	* module/language/scheme/compile-ghil.scm (define-scheme-translator): Fix
	  the generated error procedure.
	  (let): Re-indent.
	  (letrec): Re-indent.

	* module/system/base/syntax.scm (record-case): If the body of a clause is
	  null, fill it with the unspecified value.

	implement break and continue, work around overly recursive pmatch expansion
	* libguile/vm-i-system.c (goto/args): On a tail call to a different
	  procedure, init the locals to valid scheme values. Shouldn't matter for
	  well-compiled scheme, but inspecting uninitialized locals could give
	  garbage, or badly-compiled code could cause a crash.

	* module/language/Makefile.am (NOCOMP_SOURCES): For the moment, don't
	  compile compile-ghil.scm. I need to fix this.

	* module/language/ecmascript/compile-ghil.scm (load-toplevel): Sigh, and
	  disable stack checking in the evaluator too. Grr.
	  (comp): Implement (unnamed) break and continue.

	* module/language/ecmascript/parse.scm (parse-ecmascript): Fix var
	  statements in `for' -- though it still doesn't work.

2009-02-21  Ludovic Courtès  <ludo@gnu.org>

	Fix `.go' compilation for $(builddir) != $(srcdir).
	* am/guilec (.scm.go): Use "-o $@" to make sure the output file ends up
	  in $(builddir).

	Add `-o'/`--output' option to "guile-tools compile".
	* module/system/base/compile.scm (compile-file): Add optional
	  OUTPUT-FILE argument.

	* scripts/compile (fail): New procedure.
	  (%options): Add `-o'/`--output' option.
	  (compile): Handle `-o'.

2009-02-21  Andy Wingo  <wingo@pobox.com>

	implement do, while, for
	* module/language/ecmascript/compile-ghil.scm (comp): Use ghil-bind when
	  making temp vars, so that disassembly understands things. Implement do,
	  while, and for.

	* module/language/ecmascript/parse.scm (parse-ecmascript): Some tweaks.

	* module/language/ecmascript/impl.scm (language): Export ->boolean.

	implement more operations
	* module/language/ecmascript/base.scm: Implement some more robust
	  property getters that convert strings to symbols. Implement
	  has-property?.

	* module/language/ecmascript/compile-ghil.scm (comp): Implement lots more
	  mathematical operators. We now do all expressions; on to statements.

	* module/language/ecmascript/impl.scm: Define some math helpers. They
	  probably need to call ->number on some things.

	* module/language/ecmascript/parse.scm (parse-ecmascript): Fix a typo.

	clean up ++ and -- a little bit
	* module/language/ecmascript/compile-ghil.scm (comp): Define let1 and
	  begin1 helpers. Use them in pre- and post- increment and decrement.

	implement ++, --, new, delete, void, typeof
	* module/language/ecmascript/compile-ghil.scm (@impl): Implement with
	  @implv.
	  (comp): Implement ++ and -- (pre- and post-). Quite a pain. I'll be
	  looking for ways to simplify this notation. Also implement new, delete,
	  and void.

	* module/language/ecmascript/impl.scm: Implement typeof.

	handle "this" in ecmascript
	* module/language/ecmascript/base.scm:
	* module/language/ecmascript/compile-ghil.scm:
	* module/language/ecmascript/impl.scm:
	* module/language/ecmascript/parse.scm: Compile "method calls" in such a
	  way that "this" gets propagated correctly.

	implement more of the standard runtime
	* module/language/Makefile.am:
	* module/language/ecmascript/impl.scm:
	* module/language/ecmascript/array.scm:
	* module/language/ecmascript/base.scm:
	* module/language/ecmascript/function.scm: Split out the runtime into
	  different files. Implement more of the spec's runtime.

2009-02-20  Ludovic Courtès  <ludo@gnu.org>

	Fix interpretation of `(ice-9 getopt-long)'.
	* module/ice-9/getopt-long.scm (define-one-option-spec-field-accessor,
	  define-one-option-spec-field-modifier): Eval-case for `load-toplevel'
	  as well so that the interpreter can load this module.

	Fix compilation of `(ice-9 getopt-long)'.
	* module/ice-9/getopt-long.scm (option-spec-fields): Enclose in a
	  `(load-toplevel compile-toplevel)' `eval-case'.
	  (define-one-option-spec-field-accessor,
	  define-one-option-spec-field-modifier): Enclose in a
	  `compile-toplevel'-only `eval-case'.

	Add `-L'/`--load-path' option to "guile-tools compile".
	* scripts/compile (%options): Add `-L'/`--load-path'.
	  (parse-args): Have `load-path' default to '().
	  (compile): Handle `--load-path' option.

	Change "guile-tools compile" to use SRFI-37 to process options.
	* scripts/compile (%options): Rewrite in SRFI-37 style.
	  (parse-args): New procedure.
	  (compile): Update to SRFI-37.

	Make the `module-defer-observers-mutex' recursive.
	* module/ice-9/boot-9.scm (module-defer-observers-mutex): Made
	  recursive.  See
	  http://lists.gnu.org/archive/html/guile-devel/2009-02/msg00068.html
	  for an example where it matters.

2009-02-19  Andy Wingo  <wingo@pobox.com>

	support foo["bar"] in addition to foo.bar
	* module/language/ecmascript/parse.scm (parse-ecmascript): And update the
	  function declaration forms for the new var syntax.

	* module/language/ecmascript/compile-ghil.scm (comp): Support foo["bar"]
	  in addition to foo.bar.

	* module/language/ecmascript/impl.scm (pget, pput): Some fixes for when
	  we get non-symbols -- it can happen, yo. I suppose we should allow for
	  non-string keys too..

	implement object literals
	* module/language/ecmascript/impl.scm:
	* module/language/ecmascript/compile-ghil.scm (comp): Object literals.

	* module/language/ecmascript/parse.scm (parse-ecmascript): Fix some
	  object literal parsing.

	var at toplevel works too
	* module/language/ecmascript/compile-ghil.scm (comp): Fix the var form at
	  toplevel.

	property gets and puts implemented, yays
	* module/language/ecmascript/compile-ghil.scm (@impl): Ok, don't recurse
	  on args here.
	  (comp): Implement property gets and puts and lexical assignment.
	  (comp-body): Fix scanning of var forms.

	* module/language/ecmascript/impl.scm (prop-attrs): Allow for the prop
	  attr array to be #f.

	* module/language/ecmascript/parse.scm (parse-ecmascript): Fix assignment
	  parsing.

	add array support
	* module/language/ecmascript/compile-ghil.scm (@impl): Whoops, fix this
	  macro.
	  (comp): Handle array literals.

	* module/language/ecmascript/impl.scm: Add support for arrays.

	further ecmascript work
	* libguile/vm-i-system.c (drop, return): Declare drop and return as
	  popping one arg from the stack.

	* module/language/ghil/compile-glil.scm:
	* module/language/glil/compile-assembly.scm (make-meta): Adjust so that
	  we declare 'drop and 'return calls as popping one arg from the stack.

	* module/language/ecmascript/compile-ghil.scm (comp, comp-body): Flesh
	  out a bit more. Most significantly, scoping within functions obeys
	  javascript semantics better, modulo bits about with() forms.

	* module/language/ecmascript/impl.scm: Define some runtime helper
	  routines.
	* module/language/Makefile.am (SOURCES): Add impl.scm.

	* module/language/ecmascript/parse.scm (parse-ecmascript): Minor tweaks.

	* module/language/ecmascript/tokenize.scm (read-identifier): Identifiers
	  now read as symbols, not strings.

2009-02-18  Andy Wingo  <wingo@pobox.com>

	add more ecmascript compilation -- functions work now
	* module/language/ecmascript/parse.scm (parse-ecmascript): Lambdas always
	  just have one member in their bodies.

	* module/language/ecmascript/compile-ghil.scm (comp): Add some more silly
	  compilers.

2009-02-18  Ludovic Courtès  <ludo@gnu.org>

	Add `load-unsigned-integer' instruction.
	* libguile/vm-i-loader.c (load_unsigned_integer): New loader.

	* module/language/assembly.scm (byte-length): Handle
	  `load-unsigned-integer'.

	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	  Likewise.

	* module/language/glil/compile-assembly.scm (dump-object): Emit a
	  `load-unsigned-integer' instruction for positive integers.  This fixes
	  loading of integers greater than 2^31 - 1.

	* testsuite/Makefile.am (vm_test_files): Add `t-literal-integers.scm'.

	* doc/ref/vm.texi (Loading Instructions): Add `load-unsigned-integer'.

2009-02-18  Andy Wingo  <wingo@pobox.com>

	world's stupidest ecmascript compiler
	* module/language/ecmascript/spec.scm: Add language spec for ecmascript.

	* module/language/ecmascript/compile-ghil.scm: Add a stupid compiler.

	* module/language/Makefile.am: Buildage.

	add ecmascript parser
	* module/language/ecmascript/parse-lalr.scm: Add the Boucher/Bison lalr
	  parser. This is from guile-lib, but with : changed to -> so as not to
	  molest `prefix' keywords. Should probably be elsewhere.

	* module/language/ecmascript/parse.scm: Add parser for ECMAScript. Rules
	  from the spec, 3rd edition.

	* module/language/ecmascript/tokenize.scm: Add ECMAScript tokenizer,
	  hand-written. Neat stuff.

	* module/language/Makefile.am: Autofoo.

2009-02-17  Andy Wingo  <wingo@pobox.com>

	lengths written out in native endianness
	* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
	  out the lengths that are mapped to struct scm_objcode using native
	  endianness.

2009-02-17  Andy Wingo  <wingo@oblong.net>

	avoid deprecated functions in SCM_VALIDATE_VECTOR_LEN
	* libguile/validate.h (SCM_VALIDATE_VECTOR_LEN): Don't use deprecated
	  functions.

2009-02-17  Ludovic Courtès  <ludo@gnu.org>

	Add tests for the stack inspection API.
	* test-suite/tests/eval.test (stack->frames): New procedure.
	  ("stacks"): New test prefix.

	Add new GOOPS tests for built-in types.
	* test-suite/tests/goops.test ("classes for built-in types"): New test
	  prefix.

2009-02-16  Ludovic Courtès  <ludo@gnu.org>

	Add test for `procedure-properties'.
	* test-suite/Makefile.am (SCM_TESTS): Add `tests/procprop.test'.

2009-02-14  Andy Wingo  <wingo@pobox.com>

	better alignment
	* module/language/assembly.scm (align-program): Whoops, align programs
	  properly.

	* module/language/glil/compile-assembly.scm (compile-assembly): Start
	  with addr=-1, for the unserialized load-program byte.
	  (glil->assembly): Align programs in all cases.

2009-02-14  Ludovic Courtès  <ludo@gnu.org>

	Change `compiled-file-name' to preserve the input file's directory.
	* module/system/base/compile.scm (compiled-file-name): Prepend "(dirname
	  file)" so that "guile-tools compile foo/bar.scm" produces
	  "foo/bar.go", not "bar.go".

2009-02-14  Andy Wingo  <wingo@pobox.com>

	align programs on 8-byte boundaries
	* module/language/assembly.scm (addr+): New helper.
	  (align-program): New function, aligns a (load-program) form, currently
	  to 8-byte boundaries.

	* module/language/glil/compile-assembly.scm (<subprogram>): Record the
	  object table and the program code separately, so that we can align the
	  program after the object table has been written.
	  (glil->assembly): Use addr+.
	  (dump-object): Rework to fold `addr' through dumping of compound
	  objects, so that procedures can be aligned properly.

	re-enable assembly packing
	* module/language/glil/compile-assembly.scm (glil->assembly): Enable
	  assembly packing, for e.g. (make-int8:0).

2009-02-14  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc
	Conflicts:
		.gitignore
		libguile/procs.h

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc-mark.c
		libguile/procs.c
		libguile/procs.h
		libguile/threads.c
		libguile/threads.h

2009-02-14  Andy Wingo  <wingo@pobox.com>

	a slight add-method speedup
	* module/oop/goops.scm (add-method-in-classes!): Use memq instead of
	  memv.

	generate the fixed-offset accessors at compile-time
	* module/language/scheme/compile-ghil.scm (define-scheme-translator):
	  Only add an else clause if the transformer didn't have one.

	* module/oop/goops.scm (min-fixnum, max-fixnum): Define at compile-time
	  as well.
	  (@slot-ref, @slot-set!): Only define transformers for these at
	  compile-time. Avoids loading up the compiler unnecessarily. Also, allow
	  for the `n' to be determined lexically, in which case we dispatch to
	  the primitive.
	  (num-standard-pre-cache, define-standard-accessor-method)
	  (bound-check-get, standard-get, standard-set): Rework the fixed-offset
	  getters and setters so that they can be computed at compile-time.
	  Accessors to fields with n > num-standard-pre-cache will be dispatched
	  to the primitive instead of within the VM.

2009-02-13  Andy Wingo  <wingo@pobox.com>

	don't re-enter the compiler during method dispatch
	* libguile/goops.c (scm_make): In the pre-inst `make', default
	  `procedure' to #f, and read a `make-procedure' instead of
	  `compile-env'.

	* libguile/goops.h (scm_si_make_procedure): This instead of
	  scm_si_compile_env.

	* module/oop/goops.scm (make-method): Remove this unused function. Users
	  should use (make <method> ...) directly.
	  (method): Capture `make-procedure' instead of `procedure' in the case
	  that the body calls a next-method. Allows for the kind of
	  "recompilation" that we were using before, but with closures instead of
	  re-entering the compiler. Type-specific compilation is still
	  interesting, but probably should be implemented in another way.
	  (initialize): Default #:procedure to #f, and
	  s/compile-env/make-procedure/.

	* module/oop/goops/compile.scm (code-table-lookup): Just return the
	  cmethod, not the entry -- since the entry is now just (append types
	  cmethod).
	  (compile-make-procedure): New procedure, returns a form that, when
	  evaluated/compiled, will yield a procedure of one argument, the
	  next-method. When called with a next-method, the procedure returns an
	  actual method implementation. compile-make-procedure returns #f if the
	  body doesn't call next-method.
	  (compile-method): Unify to always return procedures. Much cleaner and
	  *much* faster in the compiled case. In the interpreted case, there
	  might be a slight slowdown, but if there is one it should be slight.

	* module/oop/goops/dispatch.scm (method-cache-install!): Adapt to removal
	  of compute-entry-with-cmethod.

	flush output when writing .go files
	* module/system/base/compile.scm (call-with-output-file/atomic): Close
	  the port we are writing to before renaming it, so that we flush output.
	  Might fix some 0-length write errors that Jao was seeing.

	inline record predicates into record-case
	* module/system/base/syntax.scm (record-case): Inline record predicates
	  into the record-case. Shaves off a few more milliseconds from a GOOPS
	  load.

	no keyword arguments in GHIL / GLIL, just optional args -- faster compiles
	* module/system/base/syntax.scm (define-record): So, in the generated
	  constructors, allow optional arguments, but not keyword arguments.
	  Conses much less in the constructors.
	  (define-record/keywords): And the old define-record is here.

	* module/language/ghil.scm (parse-ghil):
	* module/language/ghil/compile-glil.scm (codegen):
	* module/language/scheme/compile-ghil.scm (translate-1, quote)
	  (quasiquote): Don't use keywords in this compiler hotpath.

	* module/system/base/language.scm (<language>):
	* module/system/repl/common.scm (<repl>):
	* module/system/vm/debug.scm (<debugger>): Use define-record/keywords.

2009-02-12  Ludovic Courtès  <ludo@gnu.org>

	Link with `-z relro' when available.
	* acinclude.m4 (GUILE_GNU_LD_RELRO): New macro.

	* configure.in: Use `GUILE_GNU_LD_RELRO'.

	Update `NEWS'.

	Small cleanup relative to the use of double cells for subrs.
	* libguile/procs.c (scm_c_make_subr): Remove comments about the number
	  of subrs, improve formatting.

	Use double-cells to store subrs.
	* libguile/procs.c (scm_subr_table, scm_subr_table_size,
	  scm_subr_table_room, subr_table_gc_hint, scm_init_subr_table,
	  scm_mark_subr_table): Remove.
	  (scm_c_make_subr): Simply return a double-cell, with the procedure
	  name and properties stored in a two-element array.
	  (scm_free_subr_entry): Free the meta-info slot.

	* libguile/init.c (scm_i_init_guile): Remove call to
	  `scm_init_subr_table ()'.

	* libguile/procs.h (SCM_SUBR_META_INFO): New macro.
	  (SCM_SNAME, SCM_SUBR_PROPS): Use it.
	  (SCM_SUBR_GENERIC, SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC):
	  Update.
	  (scm_t_subr_entry, SCM_SUBR_ENTRY, SCM_SUBRNUM, scm_subr_table,
	  scm_mark_subr_table, scm_init_subr_table): Remove.

2009-02-11  Ludovic Courtès  <ludo@gnu.org>

	Add `SCM_SET_SUBR_GENERIC ()' to replace `SCM_SUBR_GENERIC ()' as an lvalue.
	* libguile/goops.c (scm_c_extend_primitive_generic): Use
	  `SCM_SET_SUBR_GENERIC ()' instead of using `SCM_SUBR_GENERIC ()' as an
	  lvalue.

	* libguile/procs.c (scm_c_make_subr_with_generic): Use `SCM_SET_SUBR_GENERIC_LOC ()'.

	* libguile/procs.h (SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC): New macros.

	Use `SCM_SNAME ()' when requesting the name of a subr.
	* libguile/gsubr.c (create_gsubr, create_gsubr_with_generic):
	  Use `SCM_SNAME ()' instead of `SCM_SUBR_ENTRY (subr).name'.

	* libguile/procs.c (scm_c_define_subr_with_generic, scm_makcclo):
	  Likewise.
	  (scm_c_make_subr_with_generic): Same with `SCM_SUBR_GENERIC ()'.

	Small cleanup relative to the use of double cells for subrs.
	* libguile/procs.c (scm_c_make_subr): Remove comments about the number
	  of subrs, improve formatting.

	* libguile/Makefile.am: Comment the generation of `snarf-gsubr.h'.

2009-02-11  Andy Wingo  <wingo@pobox.com>

	provide program apply_0, apply_1, apply_2 implementations
	* libguile/programs.c (program_apply_0, program_apply_1)
	  (program_apply_2, scm_bootstrap_programs): Provides some cons-less
	  smob application procedures. This molests some internal interfaces, but
	  hey, we're internal.

	speed up record-case
	* module/language/ghil.scm: Whoops, export some unquote-splicing
	  accessors that we didn't have exported before.

	* module/system/base/syntax.scm: Speed up record-case, by syntactically
	  determining the predicates and accessors. Nasty, in a way; but also
	  much faster.

2009-02-10  Andy Wingo  <wingo@pobox.com>

	match bare literals with eq? in pmatch, not equal?
	* module/system/base/pmatch.scm (ppat): Match atoms with eq?, not equal?.
	  This speeds up compilation considerably, as we never match against
	  numbers or strings or what-have-you. Note, you can match against
	  literals with equal? via quoting the literal in the pattern.

	propagate much more source info through compilation
	* module/language/ghil/compile-glil.scm (codegen): Record source location
	  for offset 0 into a lambda, if we can.

	* module/language/scheme/compile-ghil.scm (translate-1)
	  (define-scheme-translator): In the retrans procedures, propagate the
	  location information from the enclosing expression if the subexpression
	  has no location information. Gives source information to many more
	  expressions.
	  (location): Just propagate the source properties as they are, the
	  glil->assembly compiler will interpret them.

	* module/language/glil.scm (<glil>): Change glil-source to take "props"
	  and not "loc", as it's the source properties that we're interested in.

	* module/language/glil/compile-assembly.scm (limn-sources): New function,
	  takes a list of addr-source property pairs and "compresses" them for
	  serialization to disk.
	  (glil->assembly): Limn the sources before writing them to disk. Avoid
	  non-tail recursion when determining total byte length of code.

	* module/system/vm/program.scm (source:file, source:line, source:column):
	  Update for new source representation.
	  (program-source): Export.
	  (write-program): Nicer pretty-printing of anonymous procedures.

	* libguile/backtrace.c (display_backtrace_get_file_line): Update for the
	  new VM source representation.

	* libguile/programs.h:
	* libguile/programs.c (scm_program_sources): Update for the new
	  serialized source representation, where the filename is not in the
	  stream unless it changes.
	  (scm_program_source): New exported function, looks up the source for a
	  given ip offset.
	  (scm_c_program_source): Update to return the last source information
	  that was <= the given IP, because we only serialize source info when it
	  changes.

2009-02-09  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'master' into ossau-gds-dev

	Clean lib-version.texi
	* doc/ref/Makefile.am (CLEANFILES): Add lib-version.texi.

2009-02-09  Andy Wingo  <wingo@pobox.com>

	nicety in the compiler
	* module/language/scheme/compile-ghil.scm (lookup-transformer): Use @@.
	  Delightfully metacircular.

	allow defmacros to unquote in macros into expanded expressions
	* module/language/scheme/compile-ghil.scm (lookup-transformer): Allow
	  macros to be unquoted into the car of any form that results from macro
	  expansion. This lets modules export defmacros built on other defmacros
	  that are not exported.

	minor cleanups
	* libguile/stacks.c (scm_make_stack): Instead of aborting when we misread
	  the number of stack frames, just print a warning. I'd like to figure
	  out what these cases are, exactly.

	* module/language/scheme/compile-ghil.scm (lambda): Reindent the lambda
	  transformer.

	* module/system/base/compile.scm (call-with-compile-error-catch): Write
	  the expression instead of displaying it.
	  (call-with-output-file/atomic): Don't actually redirect output to this
	  port, as it's not necessary -- the language-printer should respect the
	  port that we pass.

2009-02-08  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'master' into ossau-gds-dev

	Allow @ to work with (ice-9 syncase)
	(Reported by Panicz Maciej Godek.)

	* test-suite/tests/syncase.test ("@ works with syncase"): New test.

	* ice-9/syncase.scm (guile-macro): When a Guile macro transformer
	  produces a variable, don't pass it through sc-expand.

	Fix build when compiled with -Wundef -Werror
	(Reported by David Fang)

	* libguile/inline.h: Check if __APPLE_CC__ is defined before testing
	  its value.

2009-02-05  Andy Wingo  <wingo@pobox.com>

	fix the ping-pong between evaluator and vm stacks in make-stack
	* libguile/frames.c (vm_frame_print): Add a frame printer.

	* libguile/stacks.c (stack_depth, read_frames): Only switch the VM stack
	  for boot program dframes.

	* libguile/vm-engine.c (VM_NAME): Push one debug frame per invocation,
	  unconditionally. (If we push them at all, of course.)

	fix boot program detection, which in turn makes `make-stack' actually work
	* libguile/programs.h (SCM_F_PROGRAM_IS_BOOT, SCM_PROGRAM_IS_BOOT): Flags
	  for determining if a program is a boot program. It turns out that our
	  heuristics e.g. in stacks.c would catch non-boot programs, like
	  programs that end with (goto/args 1), because the 1 is the same byte as
	  `halt'. That took a while to find...

	* libguile/stacks.c (stack_depth, read_frames): Use the new boot prog
	  macros.
	  (scm_make_stack): Assert that we read the number of frames that we said
	  we would.

	* libguile/vm.c (really_make_boot_program): Mark boot programs
	  appropriately.

	in debug mode, make sure that calls to the vm can be captured via make-stack
	* libguile/vm-engine.c (VM_PUSH_DEBUG_FRAMES): New knob, if true we much
	  with the scm_i_last_debug_frame when entering the VM, because sometimes
	  the evaluator doesn't do it for us.
	  (VM_ENGINE): Plug through debug frame fondling. Now, program exit comes
	  back to the main text. Rename err_args to finish_args, and reuse for
	  the return value.

	* libguile/vm-engine.h (PUSH_LIST):
	* libguile/vm-i-loader.c:
	* libguile/vm-i-scheme.c:
	* libguile/vm-i-system.c: Update for finish_args.
	  (halt): goto vm_done, now, instead of returning directly.

	scm_call_N doesn't cons for calling programs
	* libguile/eval.c (scm_call_0, scm_call_1, scm_call_2, scm_call_3)
	  (scm_call_4): Special-case compiled procedures here, to avoid consing.

	* libguile/vm.h:
	* libguile/vm.c (scm_c_vm_run): Take a SCM after all.
	  (scm_vm_apply, scm_load_compiled_with_vm): Adapt to vm_run change.

	use append-map in goops
	* module/oop/goops.scm (ensure-metaclass, make-extended-generic): Some
	  minor optimizations to use append-map.

	inline call to scm_make_program when making closures
	* libguile/programs.c (scm_make_program): Add a comment.

	* libguile/vm-engine.h (INIT_ARGS): Add a couple of UNLIKELY notes.

	* libguile/vm-i-system.c (make-closure): Inline the call to
	  scm_make_program, which avoids some redundant checks.

2009-02-04  Andy Wingo  <wingo@pobox.com>

	enable multiple vm engines (regular, debug, ...)
	* libguile/vm-engine.c (VM_USE_HOOKS, VM_USE_CLOCK, VM_CHECK_EXTERNAL)
	  (VM_CHECK_OBJECT): Update to define these here, before including
	  vm-engine.h.
	  (vm_run): Change so that we can make different engines. Also, we take
	  an array of arguments, and the struct scm_vm directly, so as to avoid
	  any need to cons.

	* libguile/vm-engine.h (CHECK_EXTERNAL, CHECK_OBJECT): Add some UNLIKELY
	  bits; don't seem to help.

	* libguile/vm.c (vm_dispatch_hook): Change to not pass the VP. This needs
	  some love, and perhaps we revert to the old way.
	  (VM_ENGINE): Actually make two engines, vm_regular_engine and
	  vm_debug_engine. Probably there is room for improvement here. Actually
	  their speeds are the same at the moment.
	  (make_vm): Choose which engine to run; currently the debug engine by
	  default.
	  (scm_c_vm_run): A thin wrapper to invoke a VM without consing.
	  (scm_vm_apply): Use scm_c_vm_run.
	  (scm_load_compiled_with_vm): Use scm_c_vm_run.

	"optimize" dispatch to specific GF's in goops
	* libguile/goops.c: Some micro-optimizations so that calling generic
	  functions as part of the protocol doesn't cons.

	make catch cache and restore vm regs, not the vm itself -- speedy speedy
	* libguile/throw.c (scm_c_catch): Stash away the current vm's regs, and
	  restore them if there's a nonlocal exit. There is a terrible case we
	  have to handle if we catch from when the vm smob type isn't registered
	  but the throw has the vm registered, but I think we handle this fine.

	* libguile/vm-engine.c (vm_run):
	* libguile/vm-i-system.c (halt): Don't make a dynwind context, so that
	  entering the VM doesn't cons at all, except for the arg list. Maybe we
	  can fix that bit too.

	* libguile/vm.c (vm_reset_stack): Remove, as there is no more dynwind.
	  (make_vm): Return #f if the tc16 hasn't yet been registered.

2009-02-03  Andy Wingo  <wingo@pobox.com>

	make symbol -> opcode lookup faster
	* libguile/instructions.c (fetch_instruction_table)
	  (scm_lookup_instruction_by_name): Rework so we lazily load instructions
	  into an array keyed by opcode, and a hash table keyed by symbolic name.
	  Much faster, in this hot spot of compilation.

	* libguile/vm-engine.c (vm_run): Use malloc instead of scm_gc_malloc,
	  given that we aren't ever going to free this thing.

	* libguile/vm-expand.h (VM_DEFINE_FUNCTION, VM_DEFINE_LOADER): Rework to
	  always be aliases to VM_DEFINE_INSTRUCTION.
	  (VM_DEFINE_INSTRUCTION): In the table case, update to work with
	  fetch_instruction_table().

	inline dispatch to program cmethods, tick in return, remove old goops methods
	* libguile/objects.c (scm_apply_generic): Inline the case when the
	  generic is a program.

	* libguile/vm-i-system.c (return): Tick when functions return.

	* module/oop/goops.scm (object-eqv?, object-equal?): Remove these
	  historical methods.

2009-02-03  Ludovic Courtès  <ludo@gnu.org>

	GOOPS: Statically allocate the PORT class array.
	* libguile/goops.c (scm_port_class): Statically allocate it.
	  (create_port_classes): Don't use `scm_calloc ()'.

	* libguile/goops.h (scm_port_class): Update declaration.

	* libguile/ports.c (scm_make_port_type): When checking whether
	  GOOPS is initialized, check whether the first element of
	  SCM_PORT_CLASS is non-zero.

	Publish the maximum number of port types as `SCM_I_MAX_PORT_TYPE_COUNT'.
	* libguile/goops.c (create_port_classes): Use
	  `SCM_I_MAX_PORT_TYPE_COUNT' instead of a hard-wired 256.

	* libguile/objects.h (SCM_OUT_PCLASS_INDEX, SCM_INOUT_PCLASS_INDEX):
	  Likewise.

	* libguile/ports.c (scm_make_port_type): Likewise.

	* libguile/ports.h (SCM_I_MAX_PORT_TYPE_COUNT): New macro.

	GOOPS: Statically allocate the SMOB class array.
	* libguile/goops.c (scm_smob_class): Statically allocate it.
	  (create_smob_classes): Don't malloc(3) `scm_smob_class'.

	* libguile/goops.h (scm_smob_class): Update declaration.

	* libguile/smob.c (scm_make_smob_type, scm_set_smob_apply): When
	  checking whether GOOPS is initialized, check whether the first element
	  of SCM_SMOB_CLASS is non-zero.

	Publish the maximum number of SMOB types as `SCM_I_MAX_SMOB_TYPE_COUNT'.
	* libguile/goops.c (create_smob_classes): Refer to
	  `SCM_I_MAX_SMOB_TYPE_COUNT' rather than 255 (which is wrong) or 256.

	* libguile/smob.c (MAX_SMOB_COUNT): Alias for `SCM_I_MAX_SMOB_TYPE_COUNT'.

	* libguile/smob.h (SCM_I_MAX_SMOB_TYPE_COUNT): New macro.

2009-02-02  Andy Wingo  <wingo@pobox.com>

	Name anonymous let- or letrec-bound procedures
	* module/language/scheme/compile-ghil.scm (let, letrec): Give names to
	  procedures of the form (let ((foo (lambda ....)))).

	tick in calls, procedure-name works on compiled procedures
	* module/system/vm/program.scm:
	* libguile/programs.h:
	* libguile/programs.c (scm_program_bindings, scm_program_bindings)
	  (scm_program_properties, scm_program_name): Unfortunately, implement
	  more procs in C, so that C can use them more easily.

	* libguile/debug.c (scm_procedure_name): Dispatch to scm_program_name as
	  appropriate.

	* libguile/vm-i-system.c (call): Tick in a call.

2009-02-02  Julian Graham  <julian@transmetropolitan.(none)>

	Update SRFI-11 docs to use correct name for let*-values.

2009-02-01  Ludovic Courtès  <ludo@gnu.org>

	Use `GC_base ()' to determine whether a pointer points to the heap.
	* libguile/boehm-gc.h (SCM_I_IS_POINTER_TO_THE_HEAP): Use `GC_base ()'
	  instead of `GC_{least,greatest}_plausible_heap addr' since the GC does
	  not assume that the heap is contiguous (suggested by Ivan Maidanski
	  and Hans Boehm).

2009-02-01  Andy Wingo  <wingo@pobox.com>

	fix the disassembler for load-string, load-symbol et al
	* module/language/assembly/decompile-bytecode.scm (decode-bytecode): Fix
	  decoding of lengths in loader instructions.

	no disasm in measure.scm
	* benchmark/measure.scm: Don't use (system vm disasm).

	don't make intermediate garbage when making vectors in the vm
	* libguile/vm-i-system.c (vector): Don't cons up a list just to make a
	  vector. Saves a couple percent in total cell allocation when loading
	  syncase. Probably not worth it, but foo!

	avoid 8 words of allocation per lambda, whoooo
	* libguile/objcodes.c (scm_bytecode_to_objcode): Check that the length of
	  the vector matches the length embedded in the bytecode.

	* libguile/programs.c (scm_program_meta): Call through to
	  scm_objcode_meta, instead of looking in the object table. Avoids
	  consing up a program+objcode slice for the meta until the meta is
	  actually called.

	* libguile/vm-i-loader.c (load-program): Step past the metadata too.

	* module/language/glil/compile-assembly.scm (make-meta): Just return the
	  load-program form, or #f.
	  (assoc-ref-or-acons, object-index-and-alist, make-object-table): Don't
	  write the meta into the object table.
	  (glil->assembly): Instead write the meta into the load-program form.

	add code for writing out metadata to the end of a program
	* libguile/objcodes.c (make_objcode_by_mmap, scm_c_make_objcode_slice):
	  Verify the lengths with the meta-length.
	  (scm_objcode_meta): New procedure, for getting at the meta-info of an
	  objcode.
	  (scm_objcode_to_bytecode):
	  (scm_write_objcode): Write bytecode with the metadata too.

	* module/system/vm/objcode.scm: Export object-meta.

	* module/language/assembly.scm (byte-length):
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/disassemble.scm (disassemble-load-program):
	* module/language/glil/compile-assembly.scm (glil->assembly):
	* test-suite/tests/asm-to-bytecode.test ("compiler"): Change to
	  load-program format to have meta-or-#f instead of meta-length, so that
	  we can serialize the meta as objcode without a load-program byte. Add a
	  test for writing out the meta.

	add metalen field to bytecode serialization
	* libguile/objcodes.h (struct scm_objcode): Add a new field, metalen, in
	  preparation for embedding metadata within a program.
	  (SCM_OBJCODE_META_LEN, SCM_OBJCODE_TOTAL_LEN): New defines.

	* libguile/vm.c (really_make_boot_program):
	* module/language/assembly.scm (*program-header-len*, byte-length):
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/disassemble.scm (disassemble-load-program):
	* module/language/glil/compile-assembly.scm (glil->assembly):
	* test-suite/tests/asm-to-bytecode.test ("compiler"): Update for metalen
	  addition.

2009-02-01  Ludovic Courtès  <ludo@gnu.org>

	Fix invalid writes to read-only stringbufs.
	* libguile/strings.c (SET_STRINGBUF_SHARED): Don't modify BUF if it's
	  already marked as shared since it might be a read-only stringbuf.
	  This error can be caught when linking with GNU ld with "-z relro".

2009-01-31  Ludovic Courtès  <ludo@gnu.org>

	Allow the static initialization of subrs.
	* libguile/Makefile.am (snarf-gsubr.h): New target.
	  (BUILT_SOURCES, nodist_modinclude_HEADERS, MOSTLYCLEANFILES): Add
	  `snarf-gsubr.h'.

	* libguile/procs.h (SCM_SUBR_ARITY_TO_TYPE): New macro.

	* libguile/snarf.h (SCM_DEFINE): Rename to...
	  (SCM_DEFINE_GSUBR): this.
	  (SCM_DEFINE_SUBR)[SCM_SUPPORT_STATIC_ALLOCATION]: New macro.
	  (SCM_DEFINE_SUBR_reqX_optY_rstZ)[SCM_SUPPORT_STATIC_ALLOCATION]: New
	  set of macros.
	  (SCM_IMMUTABLE_SUBR): New macro.

2009-01-31  Andy Wingo  <wingo@pobox.com>

	cache 8 boot programs
	* libguile/vm.c (vm_make_boot_program): Cache boot programs for nargs <
	  8.

2009-01-31  Ludovic Courtès  <ludo@gnu.org>

	Allow several `SNARF_INIT ()' per CPP output line.
	* libguile/guile-snarf.in (modern_snarf): Allow several `SNARF_INIT ()'
	  per line.  This makes it possible to write snarffing macros that
	  contain several `SNARF_INIT ()' invocations.

	Improve CPP token pasting in <snarf.h>.
	* libguile/snarf.h (scm_i_paste, scm_i_paste3): New macros.
	  (SCM_SYMBOL, SCM_GLOBAL_SYMBOL, SCM_IMMUTABLE_STRING): Use them.

	Don't register disappearing links for non-heap objects.
	* libguile/boehm-gc.h (SCM_I_IS_POINTER_TO_THE_HEAP,
	  SCM_I_REGISTER_DISAPPEARING_LINK): New.

	* libguile/vectors.c (scm_c_vector_set_x): Use
	  `SCM_I_REGISTER_DISAPPEARING_LINK ()' instead of
	  `GC_GENERAL_REGISTER_DISAPPEARING_LINK ()'.

	* libguile/weaks.c (scm_weak_car_pair, scm_weak_cdr_pair,
	  scm_doubly_weak_pair): Likewise.

2009-01-30  Andy Wingo  <wingo@pobox.com>

	remove conv.scm, disasm.scm; objcode->bytecode rename
	* module/system/vm/Makefile.am:
	* module/system/vm/conv.scm:
	* module/system/vm/disasm.scm: Remove these modules, as their
	  functionality is now in (language ...).

	* libguile/objcodes.h:
	* libguile/objcodes.c:
	* module/system/vm/objcode.scm: Rename objcode->u8vector to
	  objcode->bytecode.

	* module/system/vm/frame.scm:
	* module/language/bytecode/spec.scm: Fix for objcode->bytecode.

	* scripts/disassemble:
	* testsuite/run-vm-tests.scm: Fix for (system vm disasm) removal.

	* module/system/repl/command.scm: Use the right disassembler.

	add disassembler that fits in with old compiler tower
	* module/language/assembly/Makefile.am:
	* module/language/assembly/disassemble.scm: Add a disassembler, based on
	  the old one but fitting in with the decompiler tower.

	* module/language/objcode/spec.scm (decompile-value): When decompiling
	  programs, shove all the metadata that we know about into the "env".

	* module/system/base/compile.scm (decompile-fold, decompile): Return the
	  env from `decompile' as a second value. Not sure if `compile' should do
	  this too.

	add decompilers that can take us back to assembly
	* module/language/assembly/Makefile.am:
	* module/language/assembly/spec.scm:
	* module/language/assembly/decompile-bytecode.scm: Add a bytecode
	  decompiler. Neat!

	* module/language/bytecode/spec.scm (decompile-objcode):
	* module/language/objcode/spec.scm (decompile-value): Add some
	  "decompilers" here too.

	* module/system/base/compile.scm (current-language): Since we can refer
	  to languages by name, do so here -- removes the previous
	  anti-circularity hack.
	  (compile-file, compile): Refer to target languages by name.
	  (decompile): New public function. Neat!

	* module/system/base/language.scm (lookup-decompilation-order): Fix so we
	  look for decompilers with the high-level language definition.

	allow specification of languages by name; add decompilers to languages
	* module/system/base/language.scm (lookup-decompilation-order): New
	  function, like its compiling cousin, but backwards.
	  (compute-translation-order): Rework so that languages can be specified
	  either by name or by identity. Return a list of language - procedure
	  pairs, without the "to" language in the list, instead of a list of
	  languages.
	  (invalidate-compilation-cache!): Invalidate the decompilation cache
	  too.
	  (<language>): Add a decompiler field.

	* module/system/base/compile.scm (compile-passes): Much simpler now that
	  lookup-compilation-order gives us the procedures directly.

	* module/language/*/spec.scm: Specify compilers by name, so that we can
	  avoid unnecessary module loads, and so that when we specify
	  decompilers, we can avoid cycles.

	remove glil->objcode path in favor of passing through assembly; refactorings.
	* module/language/assembly.scm: Refactor a bit; remove the name "code"
	  from the API, as it's too generic, and replace with "assembly".

	* module/language/assembly/compile-bytecode.scm: Get byte lengths via,
	  well, byte-length.

	* module/language/glil/Makefile.am:
	* module/language/glil/spec.scm:
	* module/language/glil/compile-objcode.scm: Remove compile-objcode, as we
	  just go through bytecode now.

	* module/language/glil/compile-assembly.scm (glil->assembly)
	  (dump-object): s/object->code/object->assembly/.

	add new language between assembly and objcode: bytecode
	* module/language/bytecode/Makefile.am:
	* module/language/bytecode/spec.scm: Add another language to the stack,
	  bytecode. Bytecode is the u8vector form of object code..

	* configure.in:
	* module/language/Makefile.am:
	* module/language/assembly/Makefile.am:
	* test-suite/tests/asm-to-bytecode.test:
	* module/language/assembly/spec.scm:
	* module/language/assembly/compile-bytecode.scm: Update to include the
	  new pass.

2009-01-29  Andy Wingo  <wingo@pobox.com>

	remove GPKG.def files
	* module/language/ghil/GPKG.def:
	* module/language/r5rs/GPKG.def: Reove these, they aren't used any more.

	static opcodes; refactor program/objcode division; use new assembly pipeline
	* gdbinit: Untested attempts to get the stack fondling macros to deal
	  with the new program representation.

	* libguile/frames.c (scm_vm_frame_arguments, scm_vm_frame_source)
	  (scm_vm_frame_local_ref, scm_vm_frame_local_set_x): SCM_PROGRAM_DATA is
	  a struct scm_objcode*.

	* libguile/instructions.h:
	* libguile/instructions.c: Hide the instruction table and the struct
	  scm_instruction structure; all access to instructions now goes through
	  procedures. This is because instructions are no longer in a packed
	  array indexed by opcode. Also, declare a mask that all instructions
	  should fit in.

	* libguile/objcodes.h:
	* libguile/objcodes.c: Rewrite so that object code directly maps its
	  arity and length from its bytecode. This makes it unnecessary to keep
	  this information in programs, allowing programs to be simple conses
	  between the code (objcodes) and data (the object table and the closure
	  variables).

	* libguile/programs.c (scm_make_program): Rework so that make-program
	  takes objcode, an object table, and externals as arguments. It's much
	  clearer this way, and we avoid malloc().

	* libguile/stacks.c (is_vm_bootstrap_frame): Update for program/objcode
	  changes.

	* libguile/vm-engine.c (vm_run): Initialize the jump table on the first
	  run, with the opcodes declared in the instruction sources, and with bad
	  instructions raising an error instead of wandering off into the
	  Unknown.

	* libguile/vm-engine.h (FETCH_LENGTH): Always represent lengths as 3
	  bytes. The old code was too error-prone.
	  (NEXT_JUMP): Mask the instruction with SCM_VM_INSTRUCTION_MASK.
	  (NEW_FRAME): Update for program/objcode changes.

	* libguile/vm-expand.h (VM_DEFINE_FUNCTION, VM_DEFINE_INSTRUCTION)
	  (VM_DEFINE_LOADER): Update so that we explicitly specify opcodes, so
	  that we have a stable bytecode API.

	* libguile/vm-i-loader.c: Update license to LGPLv2+. Explicitly declare
	  opcodes.
	  (load-integer): Use an int instead of a long as the accumulator; still
	  need to revisit this code at some point, I think.
	  (load-program): Simplify, thankfully!! Just creates the objcode slice
	  and rolls with it.

	* libguile/vm-i-scheme.c: Number the opcodes explicitly.

	* libguile/vm-i-system.c: Update license to LGPLv2+. Explicitly declare
	  opcodes.
	  (make-closure): Update for new program API.

	* libguile/vm.c (vm_make_boot_program): Update for new program/objcode
	  API. Still a bit ugly.
	  (scm_load_compiled_with_vm): Update for new program/objcode API.

	* module/language/assembly.scm (byte-length): Fix byte-length calculation
	  for loaders, and load-program.
	  (code-pack, code-unpack): Start to move things from (system vm conv)
	  here.
	  (object->code, code->object): More things from conv.scm.

	* module/language/glil.scm (<glil-program>): Add a new field,
	  closure-level.
	  (make-glil-program, compute-closure-level): Calculate the "closure
	  level" when making a glil program. This is the maximum depth of
	  external binding refs in this closure.
	  (unparse-glil): Fix label serialization.

	* module/language/glil/compile-assembly.scm (make-meta): Prepend #f for
	  the meta's object table, though maybe in the future we can avoid
	  creating assembly in the first place.
	  (assoc-ref-or-acons, object-index-and-alist): GRRR! Caught again by the
	  different sets of arguments to assoc and assoc-ref!
	  (glil->assembly): Attempt to make the <glil-program> case more
	  readable, and fix the bugs. Sorry I don't know how to comment this
	  change any more than this.
	  (glil->assembly): For <glil-module> serialize the whole key, not just
	  the name.
	  (dump-object): subprogram-code is already a list. Serialize integers as
	  strings, not u8vectors. Fix the order of lists and vectors.

	* module/language/glil/spec.scm (glil): Switch orders, so we prefer glil
	  -> assembly -> objcode. Actually glil->objcode doesn't work any more,
	  needs to be removed I think.

	* module/language/objcode/spec.scm (objcode->value):
	  s/objcode->program/make-program/.

	* module/language/scheme/inline.scm: Add acons inline.

	* module/system/vm/conv.scm (make-byte-decoder): Skip the first 8 bytes,
	  they are header. Handle subprograms properly. Still needs help though.
	  (decode-length): Lengths are always 3 bytes now.

	* module/system/vm/disasm.scm: Superficial changes to keep things
	  working. I'd like to fix this better in the future.

	* module/system/vm/frame.scm (bootstrap-frame?): Fixes for
	  program-bytecode.

	* module/system/vm/program.scm: Export make-program. It's program-objcode
	  now, no more program-bytecode.

	* module/system/vm/vm.scm (vm-load): Use make-program.

	* test-suite/tests/asm-to-bytecode.test: New test, very minimal.

	* module/system/vm/objcode.scm: Export word-size, byte-order, and
	  write-objcode.

2009-01-28  Andy Wingo  <wingo@pobox.com>

	cleanups to value and help help handlers
	* ice-9/session.scm (*value-help-handlers*): Define object-documentation
	  as the default value help handler.
	  (remove-value-help-handler!, add-name-help-handler!)
	  (remove-name-help-handler!): Fix docs.
	  (help, help-doc): Fix so that we try object-documentation through
	  try-value-help, and we obey the docs regarding what happens with return
	  values.

2009-01-27  Andy Wingo  <wingo@pobox.com>

	merge in from guile-lib: add some extensibility to `help'
	* ice-9/session.scm (add-value-help-handler!)
	  (remove-value-help-handler!, add-name-help-handler!)
	  (remove-name-help-handler!): New public interfaces, to allow some basic
	  extensibility of the help interface. Merged in from guile-lib's (scheme
	  session).

2009-01-23  Neil Jerram  <neil@ossau.uklinux.net>

	Fix build when scm_t_timespec is different from struct timespec
	Reported by Roland Haeder.  The declaration and definition of
	scm_pthread_cond_timedwait were using possibly different types for the
	third arg.

	* THANKS: Added Roland Haeder.

	* libguile/threads.h (scm_pthread_cond_timedwait): Use scm_t_timespec
	  for third arg rather than struct timespec, for consistency with the
	  function implementation.

	Fix MinGW HAVE_STRUCT_TIMESPEC build problem
	Reported by Carlo Bramini.  See the comment in _scm.h.

	* THANKS: Add Carlo Bramini.

	* libguile/_scm.h: Undefine HAVE_STRUCT_TIMESPEC.

2009-01-21  Ludovic Courtès  <ludo@gnu.org>

	Use double-cells to store subrs.
	* libguile/procs.c (scm_subr_table, scm_subr_table_size,
	  scm_subr_table_room, subr_table_gc_hint, scm_init_subr_table): Remove.
	  (scm_c_make_subr): Simply return a double-cell, with the procedure
	  name and properties stored in a two-element array.

	* libguile/init.c (scm_i_init_guile): Remove call to
	  `scm_init_subr_table ()'.

	* libguile/procs.h (SCM_SUBR_META_INFO): New macro.
	  (SCM_SNAME, SCM_SUBR_PROPS): Use it.
	  (SCM_SUBR_GENERIC, SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC):
	  Update.
	  (scm_t_subr_entry, SCM_SUBR_ENTRY, SCM_SUBRNUM, scm_subr_table,
	  scm_init_subr_table): Remove.

2009-01-20  Ludovic Courtès  <ludo@gnu.org>

	Add `SCM_SET_SUBR_GENERIC ()' to replace `SCM_SUBR_GENERIC ()' as an lvalue.
	* libguile/goops.c (scm_c_extend_primitive_generic): Use
	  `SCM_SET_SUBR_GENERIC ()' instead of using `SCM_SUBR_GENERIC ()' as an
	  lvalue.

	* libguile/procs.c (scm_c_make_subr_with_generic): Use `SCM_SET_SUBR_GENERIC_LOC ()'.

	* libguile/procs.h (SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC): New macros.

	Use `SCM_SNAME ()' when requesting the name of a subr.
	* libguile/gsubr.c (create_gsubr, create_gsubr_with_generic):
	  Use `SCM_SNAME ()' instead of `SCM_SUBR_ENTRY (subr).name'.

	* libguile/procs.c (scm_c_define_subr_with_generic, scm_makcclo):
	  Likewise.
	  (scm_c_make_subr_with_generic): Same with `SCM_SUBR_GENERIC ()'.

2009-01-19  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc

2009-01-19  Andy Wingo  <wingo@pobox.com>

	add assembly intermediate language
	* configure.in:
	* module/language/Makefile.am:
	* module/language/assembly/Makefile.am: Automakery.

	* module/language/assembly.scm:
	* module/language/assembly/spec.scm: Add a new language, which is oddly
	  even lower than GLIL. I got tired of GLIL's terrible
	  compile-objcode.scm, and wanted a cleaner intermediate format.

	* module/language/glil/compile-assembly.scm: A purely-functional
	  assembler, that produces "assembly". Will document later.

	* module/language/glil/spec.scm: Declare the compiler to assembly.

2009-01-18  Ludovic Courtès  <ludo@gnu.org>

	Remove useless cooperative multi-threading source files.

	Make variables related to the subr table size private and unsigned.
	* libguile/procs.c (scm_subr_table_size, scm_subr_table_room): Made
	  `static' and `unsigned'.
	  (scm_c_make_subr)[entry]: Made `unsigned'.

	* libguile/procs.h (scm_subr_table_size, scm_subr_table_room): Remove
	  declarations.

	GOOPS: Statically allocate the PORT class array.
	* libguile/goops.c (scm_port_class): Statically allocate it.
	  (create_port_classes): Don't use `scm_calloc ()'.

	* libguile/goops.h (scm_port_class): Update declaration.

	* libguile/ports.c (scm_make_port_type): When checking whether
	  GOOPS is initialized, check whether the first element of
	  SCM_PORT_CLASS is non-zero.

	Publish the maximum number of port types as `SCM_I_MAX_PORT_TYPE_COUNT'.
	* libguile/goops.c (create_port_classes): Use
	  `SCM_I_MAX_PORT_TYPE_COUNT' instead of a hard-wired 256.

	* libguile/objects.h (SCM_OUT_PCLASS_INDEX, SCM_INOUT_PCLASS_INDEX):
	  Likewise.

	* libguile/ports.c (scm_make_port_type): Likewise.

	* libguile/ports.h (SCM_I_MAX_PORT_TYPE_COUNT): New macro.

	GOOPS: Statically allocate the SMOB class array.
	* libguile/goops.c (scm_smob_class): Statically allocate it.
	  (create_smob_classes): Don't malloc(3) `scm_smob_class'.

	* libguile/goops.h (scm_smob_class): Update declaration.

	* libguile/smob.c (scm_make_smob_type, scm_set_smob_apply): When
	  checking whether GOOPS is initialized, check whether the first element
	  of SCM_SMOB_CLASS is non-zero.

	Publish the maximum number of SMOB types as `SCM_I_MAX_SMOB_TYPE_COUNT'.
	* libguile/goops.c (create_smob_classes): Refer to
	  `SCM_I_MAX_SMOB_TYPE_COUNT' rather than 255 (which is wrong) or 256.

	* libguile/smob.c (MAX_SMOB_COUNT): Alias for `SCM_I_MAX_SMOB_TYPE_COUNT'.

	* libguile/smob.h (SCM_I_MAX_SMOB_TYPE_COUNT): New macro.

	Use `scm_gc_malloc ()' when allocating GOOPS `t_extension' objects.
	* libguile/goops.c (extension_gc_hint): New.
	  (scm_c_extend_primitive_generic): Use `scm_gc_malloc ()' instead of
	  `scm_malloc ()'.
	  (setup_extended_primitive_generics): Don't call `free(3)' when
	  removing a `t_extension' object.

	Use `scm_gc_malloc ()' when allocating hook entries.
	* libguile/hooks.c (hook_entry_gc_hint): New.
	  (scm_c_hook_add): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.
	  (scm_c_hook_remove): Don't explicitly free(3) the entry, let the GC do
	  its job.

	Use `scm_gc malloc_pointerless ()' in `scm_i allocate_string_pointers ()'.
	* libguile/dynl.c (free_string_pointers): Remove.
	  (scm_dynamic_args_call): Remove reference to `free_string_pointers ()'
	  and remove dynwind.

	* libguile/posix.c (free_string_pointers): Remove.
	  (scm_execl, scm_execlp, scm_execle, scm_environ): Remove references
	  to `free_string_pointers ()'.

	* libguile/simpos.c (free_string_pointers): Remove.
	  (scm_system_star): Remove reference to `free_string_pointers ()',
	  remove enclosing dynwind.

	* libguile/strings.c (scm_i_allocate_string_pointers): Use
	  `scm_gc_malloc_pointerless ()' and `scm_gc_malloc ()'
	  instead of `scm_malloc ()' and `scm_to_locale_string ()',
	  so that the result is automatically GC'd when no longer
	  referenced.  Remove unneeded dynwind.
	  (scm_i_free_string_pointers): Remove.

	* libguile/strings.h (scm_i_free_string_pointers): Remove declaration.

	Use `scm_gc_malloc ()' when allocating the allocated fluid vector.
	* libguile/fluids.c (next_fluid_num): Use `scm_gc_malloc ()'.  Don't
	  explicitly free the previously allocated array.

	Remove useless cooperative multi-threading source files.

	Use `scm_gc_malloc ()' and friends when allocating the subr table.
	* libguile/procs.c (subr_table_gc_hint): New.
	  (scm_c_make_subr): Use `scm_gc_realloc ()' instead of `scm_realloc ()'.
	  (scm_init_subr_table): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.

	Make variables related to the subr table size private and unsigned.
	* libguile/procs.c (scm_subr_table_size, scm_subr_table_room): Made
	  `static' and `unsigned'.
	  (scm_c_make_subr)[entry]: Made `unsigned'.

	* libguile/procs.h (scm_subr_table_size, scm_subr_table_room): Remove
	  declarations.

	Don't use `scm_immutable_cell ()' for subrs.
	* libguile/procs.c (scm_c_make_subr): Use `scm_cell ()' instead of
	  `scm_immutable_cell ()' since subr cells can be mutated, e.g., via
	  `SCM_SUBR_GENERIC ()' as in `scm_c_extend_primitive_generic ()' (this
	  doesn't make any difference in practice as of libgc 7.1, though).

2009-01-17  Neil Jerram  <neil@ossau.uklinux.net>

	Remove `INSTALL'
	* INSTALL: Removed.

2009-01-17  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		lib/Makefile.am
		m4/gnulib-cache.m4
		m4/gnulib-comp.m4

2009-01-17  Andy Wingo  <wingo@pobox.com>

	move module and meta inside programs' object tables
	* libguile/programs.h (struct scm_program): Remove the module and meta
	  fields.

	* libguile/programs.c (scm_c_make_program): Add a new argument, `objs'.
	  If it's a vector, we'll look for the module and the metadata in there,
	  instead of having them in the scm_program structure.
	  (scm_c_make_closure, program_mark, scm_program_meta)
	  (scm_c_program_source, scm_program_module): Adapt to the new program
	  representation.

	* libguile/objcodes.c (scm_objcode_to_program): Pass #f as the object
	  table when making the program.

	* libguile/vm-engine.h (CACHE_PROGRAM):
	* libguile/vm-engine.c (vm_run): Rework to use the simple vector API for
	  getting the current object table. Call the helper,
	  vm_make_boot_program, to make the boot program.

	* libguile/vm-i-loader.c (load-program): Set the current module and the
	  meta in the object vector, which we pass to scm_c_make_program.

	* libguile/vm-i-system.c (toplevel-ref, toplevel-set): Adapt to the new
	  program representation.

	* module/language/glil/compile-objcode.scm (codegen): Clarify.

	placeholder for meta and module in a program's object table
	* module/language/glil/compile-objcode.scm (codegen): If the generated
	  objcode will have a meta or it has objects, prepend two cells to the
	  object table: one for the meta, and one for the module. This is a
	  placeholder for future work.

2009-01-16  Neil Jerram  <neil@ossau.uklinux.net>

	Don't try to unlock already unlocked heap mutex
	For each thread that goes into Guile mode, Guile pushes a cleanup
	function, scm_leave_guile_cleanup, whose purpose is to execute
	`scm_leave_guile ()' if the thread is terminated while in Guile mode.
	The problem is that there are various places - like
	scm_pthread_cond_wait, scm_without_guile and scm_std_select - where
	the thread temporarily leaves Guile mode (which means unlocking the
	heap mutex), and the cleanup function is still in place.  Therefore if
	the thread is terminated at these places, the cleanup function ends up
	trying to unlock a mutex (the heap mutex) which isn't actually locked.

	* libguile/threads.h (scm_i_thread): New heap_mutex_locked_by_self field.

	* libguile/threads.c (scm_enter_guile): Set heap_mutex_locked_by_self.
	  (scm_leave_guile): Only unlock if heap_mutex_locked_by_self is 1.
	  (guilify_self_1): Initialize heap_mutex_locked_by_self.
	  (scm_i_thread_sleep_for_gc): Remove incorrect use of t->held_mutex
	  here.

2009-01-15  Andy Wingo  <wingo@pobox.com>

	fold in ludovic's suggestions for new manual sections
	* INSTALL: Update from newest merge

	* doc/ref/compiler.texi:
	* doc/ref/vm.texi: Fold in Ludovic's suggestions

	Merge commit 'origin/master' into vm
	Conflicts:

		INSTALL

2009-01-15  Neil Jerram  <neil@ossau.uklinux.net>

	Invoke gnulib-tool with --no-vc-files option, and
	remove files that should not have been committed to the repository.

	Revert lib/.gitignore and m4/.gitignore to how they should be
	(before my confused Gnulib commits...)

	Revert unintended change to INSTALL made by commit 4a462e35440fdc3f10b0f88b3fb737fa76ed146d

	Add more missing Gnulib files

2009-01-14  Neil Jerram  <neil@ossau.uklinux.net>

	Add more missing Gnulib files

	Add missing Gnulib file (m4/localcharset.m4)

2009-01-14  Ludovic Courtès  <ludo@gnu.org>

	Add support for static allocation of cells, strings and stringbufs.
	* libguile/__scm.h (SCM_ALIGNED): New macro.

	* libguile/_scm.h: Include "libguile/strings.h", to make the
	  string/stringbuf-related constants visible to snarffed code.

	* libguile/snarf.h (SCM_SUPPORT_STATIC_ALLOCATION): New macro.
	  (SCM_SYMBOL, SCM_GLOBAL_SYMBOL)[SCM_SUPPORT_STATIC_ALLOCATION]: New
	  alternative versions of these macros with support for (almost) static
	  allocation via the use of `string->symbol'.
	  (SCM_IMMUTABLE_DOUBLE_CELL, SCM_IMMUTABLE_STRINGBUF,
	  SCM_IMMUTABLE_STRING): New macros.

	* libguile/tags.h (SCM)[SCM_DEBUG_TYPING_STRICTNESS==1]: Use a pointer
	  type that is compatible with other pointer types, to avoid potential
	  violation of strict aliasing rules.

2009-01-13  Ludovic Courtès  <ludo@gnu.org>

	Expose some of the string/stringbuf internal flags and tags.
	* libguile/strings.h (scm_tc7_ro_string, SCM_I_STRINGBUF_F_SHARED,
	  SCM_I_STRINGBUF_F_INLINE): New macros.

	* libguile/strings.c (STRINGBUF_F_SHARED): Alias for
	  `SCM_I_STRINGBUF_F_SHARED'.
	  (STRINGBUF_F_INLINE): Alias for `SCM_I_STRINGBUF_F_INLINE'.
	  (RO_STRING_TAG): Alias for `scm_tc7_ro_string'.

2009-01-13  Andy Wingo  <wingo@pobox.com>

	fix marking empty VM continuations
	* libguile/vm.h (struct scm_vm_cont):
	* libguile/vm.c (capture_vm_cont, reinstate_vm_cont): Change so we just
	  store the registers as they are, with the reloc.
	  (vm_cont_mark): Only mark the stack if it has elements on it, otherwise
	  we get a bogus fp.

	* libguile/stacks.c (scm_make_stack): Update for change to vm
	  continuations.

2009-01-12  Andy Wingo  <wingo@pobox.com>

	Merge branch 'master' into vm

2009-01-12  Ludovic Courtès  <ludo@gnu.org>

	Fixlet for `run-benchmark.scm'.
	* gc-benchmarks/run-benchmark.scm (%default-options): Default to the
	  empty list for `input'.

	gc-benchmarks: Adapt `gcold.scm' so that if conforms to the framework.
	* gc-benchmarks/larceny/gcold.scm (main): Rename to `gcold-benchmark'.
	  (GCOld): Fix the order of the predicate and run-maker.

	gc-benchmarks: Add `gcold.scm', by Clinger, Hansen et al.
	See http://www.ccs.neu.edu/home/will/Twobit/benchmarksAbout.html for
	details.

	gc-benchmarks: Add `run-benchmark.scm'.

	gc-profile: Show the result of `(version)'.
	* gc-benchmarks/gc-profile.scm (main): Show `(version)'.

	gc-benchmarks: Allow the iteration count to be passed to `gc-profile.scm'.
	* gc-benchmarks/gc-profile.scm (*iteration-count*): New parameter.
	  (run-benchmark): Moved from `twobit-compat.scm'.  Honor
	  `*iteration-count*'.
	  (%options): Add `--iterations'.
	  (show-help): Document it.
	  (main): Parameterize `*iteration-count*'.

	Import GC benchmarks from Larceny, by Hansen, Clinger, et al.
	These GPLv2+-licensed GC benchmarks are available from
	http://www.ccs.neu.edu/home/will/GC/sourcecode.html .

	gc-benchmarks: Add a Larceny/Twobit benchmark compatibility layer.
	* gc-benchmarks/gc-profile.scm: Load "twobit-compat.scm".
	  (save-directory-excursion, load-larceny-benchmark): New procedures.
	  (%options): New variable.
	  (show-help, parse-args): New procedures.
	  (main): Use `parse-args' and `load-larceny-benchmark'.

	Add GC benchmarks.

2009-01-12  Neil Jerram  <neil@ossau.uklinux.net>

	Make sure that we have a real on-the-stack alloca()
	Because of how Guile saves and restores continuations (by copying the
	stack), and how it uses alloca to create space for debug information
	on the stack, we must have an alloca() that really does use the stack,
	and not one that uses the heap.

	To do this, we use the Gnulib "alloca-opt" module instead of "alloca".

	This commit also updates the Gnulib sources from the current Gnulib
	Git repository.

2009-01-12  Andy Wingo  <wingo@pobox.com>

	remove a paranoid define; fix bitrot in measure.scm.
	* benchmark/measure.scm (measure): Fix bitrot.

	* libguile/vm.c (VM_ENABLE_STACK_NULLING): Undefine this, as it hasn't
	  caught any errors in quite a while.

	fix mismerge on srfi-19.scm
	* module/srfi/srfi-19.scm (priv:locale-abbr-weekday->index): Whoops, fix
	  broken manual merge on srfi-19.scm.

	fix typo when compiling receive forms
	* module/language/glil/compile-objcode.scm (codegen): Fix an embarassing
	  typo, introduced in c2c82b62f40242a4212528c3d3e882038b48f0a2

	Merge commit 'origin/master' into vm
	Conflicts:

		.gitignore
		guile-tools.in
		srfi/srfi-19.scm

2009-01-11  Andy Wingo  <wingo@pobox.com>

	fold in neil's feedback to history.texi
	* doc/ref/history.texi: Fold in Neil's feedback

	word tweaks
	* doc/ref/guile.texi: Finish some wording.

	* doc/ref/compiler.texi: Fix some goofiness.

	tweaks to compiler.texi
	* doc/ref/compiler.texi: Minor tweaks.

	finish compiler.texi, woo
	* libguile/objcodes.c (do-pair): Removed unused debuging hack.

	* module/language/glil/spec.scm (glil): Simplify a bit.

	* module/system/repl/repl.scm (default-catch-handler): Don't catch
	  vm-error, as vm-backtrace doesn't exist any more.

	* doc/ref/compiler.texi: Finish documenting GLIL and object code.

	rename <glil-asm> to <glil-program>
	* module/language/glil.scm (<glil-program>): Rename from <glil-asm>.

	* module/language/ghil/compile-glil.scm (codegen):
	* module/language/glil.scm (parse-glil, unparse-glil):
	* module/language/glil/compile-objcode.scm (preprocess, codegen): Adapt
	  to naming change.

	remove useless <glil-vars> helper type, serialize GHIL more strictly
	* module/language/ghil.scm (parse-ghil, unparse-ghil): Rework to make the
	  parse format correspond more closely with the object representation, so
	  that I only have to document it once in the manual. The salient change
	  is that no expression is self-quoting, and that variable references
	  should go through `(ref FOO)'. Rename `set!' to `set'.

	* module/language/ghil/compile-glil.scm: Add a couple of compilers for
	  unquote and unquote-splicing, that just raise an error. This way I can
	  document unquote and unquote-splicing as normal ghil expressions,
	  except that it's the compiler that catches them if they're outside a
	  quasiquote.
	  (codegen): Adapt to change in <glil-asm>.

	* module/language/ghil/spec.scm (parse): Fix parser typo bug.

	* module/language/glil.scm (<glil-asm>): Remove useless <glil-vars>
	  structure, which also had a confusing name. Just put the nargs, nrest,
	  nlocs, and nexts in the <glil-asm> directly.
	  (parse-glil, unparse-glil): Serialize `asm' more straightforwardly.

	* module/language/glil/compile-objcode.scm (<bytespec>): Remove
	  <glil-vars>, as with <glil-asm>.
	  (preprocess, make-meta, codegen, dump-object!): Adapt to change in
	  <glil-asm>.

2009-01-09  Andy Wingo  <wingo@pobox.com>

	rename translate.scm to compile-ghil.scm, and more work on compiler.texi
	* doc/ref/api-evaluation.texi: Fix some typos and xrefs.

	* doc/ref/compiler.texi (The Scheme Compiler): Document the scheme
	  compiler, and start documenting the GHIL language.

	* doc/ref/guile.texi (Guile Implementation): Whoops, put autoconf after
	  the implementation foo. Unless we want it before?

	* doc/ref/history.texi (The Emacs Thesis): Fix typo.

	* doc/ref/vm.texi (Environment Control Instructions): Rename offset to
	  index.

	* module/language/ghil.scm (parse-ghil): Fix what I think was a bug --
	  the consumer in a mv-call shouldn't be a rest arg.

	* module/language/scheme/Makefile.am (SOURCES):
	* module/language/scheme/compile-ghil.scm: Rename this file from
	  translate.scm.

	* module/oop/goops.scm:
	* module/language/scheme/spec.scm: Deal with renaming.

	fix some xrefs, flesh out compiler.texi a bit more
	* doc/ref/api-debug.texi:
	* doc/ref/vm.texi: Fix some cross-references.

	* doc/ref/compiler.texi: Hack some more, finishing the section on the
	  compiler tower.

	finish api-procedures.texi
	* doc/ref/api-procedures.texi: Finish documenting bits on compiled
	  procedures.

2009-01-08  Andy Wingo  <wingo@pobox.com>

	more work on api-procedures.texi
	* doc/ref/api-procedures.texi (Compiled Procedures): Stub out these docs
	  some more, taking some commented-out docs from vm.texi.

	* doc/ref/vm.texi: Move docs ^.

	start at documenting the compiler
	* doc/ref/api-evaluation.texi: Add documentation for the standard
	  compilation interface, and some notes about compiled files.

	* doc/ref/api-procedures.texi (Compiled Procedures): A stub at
	  documenting compiled procedures.

	* doc/ref/compiler.texi (Compiling to the Virtual Machine): Flesh out
	  with some structure, though much of the text remains to be written.
	  This stuff is hard to write!

	(language ghil def) becomes (language ghil)
	* module/language/Makefile.am:
	* module/language/ghil/Makefile.am:
	* module/language/ghil.scm:
	* module/language/ghil/compile-glil.scm:
	* module/language/ghil/spec.scm:
	* module/language/glil/Makefile.am:
	* module/language/glil.scm:
	* module/language/glil/compile-objcode.scm:
	* module/language/glil/spec.scm:
	* module/language/scheme/inline.scm:
	* module/language/scheme/translate.scm:
	* module/oop/goops.scm: Rename (language ghil def) and (language glil
	  def) to not have the "def". They're nicer names.

	move lang-specific modules, e.g. (system il compile) to (language ghil compile-glil)
	* configure.in: Remove module/system/il directory.

	* module/language/ghil/Makefile.am (SOURCES):
	* module/language/ghil/compile-glil.scm (system):
	* module/language/ghil/def.scm (language):
	* module/language/ghil/spec.scm (language, ghil):
	* module/language/glil/Makefile.am (SOURCES):
	* module/language/glil/compile-objcode.scm (language):
	* module/language/glil/def.scm (language):
	* module/language/glil/spec.scm (language, compile):
	* module/language/scheme/Makefile.am (SOURCES):
	* module/language/scheme/inline.scm (system, define-inline):
	* module/language/scheme/translate.scm (language): Move files, renaming
	  the modules.

	* module/oop/goops.scm (load-toplevel): Unfortunately the GHIL name
	  leaked here. Patch it up.

	* module/system/vm/Makefile.am (SOURCES): Remove assemble.scm.

2009-01-06  Andy Wingo  <wingo@pobox.com>

	react to comments by ludovic on history.texi
	* doc/ref/history.texi: Adjust to some of Ludovic's comments.

	finish vm.texi except references
	* doc/ref/vm.texi: Finish writing the VM reference, all correct except
	  for the missing references.

2009-01-04  Neil Jerram  <neil@ossau.uklinux.net>

	NEWS entry for %fast-slot-ref/set! fix

	Fix implementation of %fast-slot-ref and %fast-slot-set!
	* libguile/goops.c (scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x):
	  Correct incantation for getting the number of slots of the specified
	  instance.

	* libguile/goops.h (SCM_NUMBER_OF_SLOTS): Removed (because wrong).

	* test-suite/standalone/test-fast-slot-ref.in: New standalone test.

	* configure.in: Generate test-suite/standalone/test-fast-slot-ref.

	* test-suite/standalone/Makefile.am (check_SCRIPTS): Add
	  test-fast-slot-ref.

2009-01-04  Andy Wingo  <wingo@pobox.com>

	allow `apply' on %nil-terminated lists
	* libguile/vm-engine.h (PUSH_LIST): Add a parameter to check that the
	  list was proper.

	* libguile/vm-i-system.c: Adapt PUSH_LIST callsites to pass SCM_NULLP or
	  SCM_NULL_OR_NIL_P, as appropriate. Add a check to return/values*.

	* libguile/vm.c: Add lang.h header for SCM_NULL_OR_NIL_P.

	* test-suite/tests/elisp.test: Fix XFAIL for elisp + apply.

2009-01-03  Neil Jerram  <neil@ossau.uklinux.net>

	Update autogen.sh
	* autogen.sh: Don't call guile-readline/autogen.sh; not needed because
	  autoreconf recurses itself.  Remove copies of config.guess and
	  config.sub, which are now invalid because we don't have those files
	  in the top level directory.  Remove mention of
	  --enable-maintainer-mode, as we don't use AM_MAINTAINER_MODE any
	  more.

2009-01-03  Ludovic Courtès  <ludo@gnu.org>

	Delete redundant `config.{guess,sub}'.

2008-12-26  Andy Wingo  <wingo@pobox.com>

	remove heap links in VM frames, incorporate vm frames into normal backtraces
	* doc/ref/vm.texi (Stack Layout): Update to remove references to the
	  "heap link".

	* gdbinit: Update for "heap link" removal.

	* libguile/frames.c:
	* libguile/frames.h: Update macros and diagram for removal of "heap
	  link". As part of this, we also remove "heap frames", replacing them
	  with "vm frames", which are much like the interpreter's debug objects,
	  but for VM stacks. That is to say, they don't actually hold the stack
	  themselves, just the pointers into stack that's held by a continuation
	  (either captured or current).

	* libguile/stacks.c (stack_depth, read_frames): Since a "stack" object is
	  really a copy of information that comes from somewhere else, it makes
	  sense to copy over info from the VM, just as `make-stack' does from the
	  evaluator. The tricky bit is to figure out how to interleave VM and
	  interpreter frames. We do that by starting in the interpreter, and
	  whenever the current frame's procedure is actually a program, we switch
	  to the VM stack, switching back when we reach a "bootstrap frame". The
	  last bit is hacky, but it does work...
	  (is_vm_bootstrap_frame): Hacky predicate to see if a VM frame is a
	  bootstrap frame.
	  (scm_make_stack): Accept a VM frame in addition to debug frames.
	  Probably has some bugs in this case. But in the case that the arg is
	  #t (a common case), do the right thing, capturing the top VM frame as
	  well, and interleaving those frames appropriately on the stack.

	  As an accident, we lost the ability to limit the number of frames in
	  the backtrace. We could add that back, but personally I always want
	  *all* frames in the trace... Narrowing still works fine, though there
	  are some hiccups sometimes -- e.g. an outer cut to a procedure that
	  does a tail-call in VM code will never find the cut, as it no longer
	  exists in the continuation.

	* libguile/vm.h (struct scm_vm): So! Now that we have switched to save
	  stacks in the normal make-stack, there's no more need for `this_frame'
	  or `last_frame'. On the other hand, we can take this opportunity to fix
	  tracing: when we're in a trace hook, we set `trace_frame' on the VM,
	  so we know not to fire hooks when we're already in a hook.
	  (struct scm_vm_cont): Expose this, as make-stack needs it to make VM
	  frames from VM continuations.

	* libguile/vm.c (scm_vm_trace_frame): New function, gets the current
	  trace frame.
	  (vm_mark, make_vm): Hook up the trace frame.
	  (vm_dispatch_hook): New hook dispatcher, with a dynwind so it does the
	  right thing if the hook exits nonlocally.

	* libguile/vm-engine.c (vm_run): No more this_frame in the wind data.

	* libguile/vm-engine.h (RUN_HOOK): Run hooks through the dispatcher.
	  (ALIGN_AS_NON_IMMEDIATE, POP_LIST_ON_STACK): Remove unused code.
	  (NEW_FRAME): Adapt for no HL in the frame.

	* libguile/vm-i-system.c (goto/args, mv-call, return, return/values):
	  Adapt for no HL in the frame.

	* module/system/vm/frame.scm:
	* module/system/vm/vm.scm: Beginnings of some reworkings, needs more
	  thought.

	repl.scm relies on `display-backtrace' to do everything, some naming tweaks
	* module/ice-9/boot-9.scm (default-pre-unwind-handler): Rename from
	  default-lazy-handler.
	  (pre-unwind-handler-dispatch): Rename from lazy-hadler-dispatch.
	  (error-catching-loop): Adjust caller.

	* module/system/repl/repl.scm (default-pre-unwind-handler): Remove this
	  definition, in favor of the default one in boot-9.
	  (default-catch-handler): Don't do a vm-backtrace, as we will soon be
	  relying on core machinery to do that for us.
	  (call-with-backtrace): Start a new stack for the thunk.
	  (with-backtrace): Macro version of call-with-backtrace.
	  (start-repl): Use with-backtrace for brevity. Start a stack with #t as
	  the tag instead of repl-eval, because all traces of repl-eval are gone
	  after it does a tail-call.

	* module/ice-9/debugger.scm:
	* module/ice-9/debugging/traps.scm:
	* module/ice-9/stack-catch.scm: Adapt to s/lazy/pre-unwind/ in
	  boot-9.scm.

	add scm_c_program_source
	* libguile/programs.h:
	* libguile/programs.c (scm_c_program_source): New helper for getting
	  source information from C.

	backtrace.c: allow vectors for SCM_FRAME_SOURCE (frame)
	* libguile/backtrace.c (display_backtrace_get_file_line): If the source
	  is a vector, treat it as a #(line column file) vector, as emitted by
	  the VM. Needs subsequent patches to make sense.

	fix doc typo
	* doc/ref/data-rep.texi (Non-immediate objects): Fix a typo, thanks to
	  Dale Smith.

2008-12-22  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in SRFI-19.
	* srfi/srfi-19.scm (priv:string->date): Check for EOF on CH, not PORT.

2008-12-19  Andy Wingo  <wingo@pobox.com>

	remove the `late-bind' instruction
	* doc/ref/vm.texi: Minor fixes.

	* libguile/vm-i-loader.c: Remove the unused `late-bind' instruction.

	write history.texi
	* doc/ref/vm.texi: Flesh out the VM documentation, adding a rationale.

	* doc/ref/history.texi: Write the Guile history.

	* doc/ref/guile.texi (Top): Some tweaks.

2008-12-18  Ludovic Courtès  <ludo@gnu.org>

	Update `INSTALL', from Automake 1.10.2.

	Don't use deprecated functions in `debug-malloc.c'.
	* libguile/debug-malloc.c (scm_malloc_stats): Use
	  `scm_from_locale_string ()'.  Patch by Linas Vepstas
	  <linasvepstas@gmail.com>.

	srfi-19: Fix `string->date' weekday lookup.
	* srfi/srfi-19.scm (priv:locale-abbr-weekday->index): Use
	  `locale-day-short' since it expects integers in the range 1-7, unlike
	  `priv:locale-abbr-weekday'.
	  (priv:locale-long-weekday->index): Likewise.

	* test-suite/tests/srfi-19.test ("SRFI date/time
	  library")["string->date works on Sunday"]: New test.

2008-12-14  Ludovic Courtès  <ludo@gnu.org>

	Fixlet for `run-benchmark.scm'.
	* gc-benchmarks/run-benchmark.scm (%default-options): Default to the
	  empty list for `input'.

	Fix typo in makefile.
	* libguile/Makefile.am (DOT_X_FILES): Substitute `gettext.x' to
	  `gettext.c'.

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		lib/Makefile.am
		libguile/struct.c
		libguile/threads.c
		m4/gnulib-cache.m4
		m4/gnulib-comp.m4

2008-12-13  Neil Jerram  <neil@ossau.uklinux.net>

	Ignore gds-test.debug and gds-test.transcript

	Support multiple concurrent instances of Emacs + GDS server
	By:

	- Making the Unix socket name unique (for each Emacs instance), by
	  appending Emacs's PID to it.

	- Changing the GDS server to listen on both Unix domain and TCP (and
	  not to mind if the TCP bind fails, which will happen if another GDS
	  instance has already bound to the TCP port number).

	- Adding this unique Unix socket name to the environment (as
	  GDS_UNIX_SOCKET_NAME), so that Guile clients started from inside
	  Emacs can pick it up.

	- Changing the GDS client code to look for GDS_UNIX_SOCKET_NAME in the
	  environment, and to connect to the Unix socket with that name
	  instead of over TCP.

	  Guile clients started outside Emacs will not find
	  GDS_UNIX_SOCKET_NAME and so will fall back to using TCP.  This means
	  they will connect to whichever Emacs + GDS server instance started
	  first.

	* emacs/gds-server.el (gds-start-server): Take both Unix socket name
	  and TCP port args, instead of just one (which could be either Unix
	  or TCP), and pass these on to `run-server'.  Remove unused optional
	  bufname arg.

	* emacs/gds.el (gds-unix-socket-name, gds-tcp-port): New variables.
	  (gds-socket-type-alist): Removed.
	  (gds-run-debug-server): Pass gds-unix-socket-name and gds-tcp-port
	  to gds-start-server.  Add the Unix socket name to the environment.
	  (gds-server-socket-type): Note now obsolete.

	* ice-9/gds-client.scm (connect-to-gds): Get Unix socket name from
	  environment, and connect to this in preference to using TCP.

	* ice-9/gds-server.scm (run-server): Take both Unix socket name and
	  TCP port args.  Listen and accept connections on both.

2008-12-12  Neil Jerram  <neil@ossau.uklinux.net>

	Thank people who provided reports or fixes for GDS
	(while it was a standalone project)

	* THANKS (R Clayton, John Steele Scott, Thomas Wawrzinek): Added.

	Add more files that I wrote to the list in AUTHORS
	* AUTHORS (Neil Jerram): Several files added.

	Add GDS test and documentation files
	(Transferred from the remains of the old standalone guile-debugging
	project at gna.org.)

	* emacs/gds-faq.txt, emacs/gds-test.el, emacs/gds-test.sh,
	  emacs/gds-test.stdin, emacs/gds-tutorial.txt: New files.

2008-12-11  Neil Jerram  <neil@ossau.uklinux.net>

	Add a GDS protocol hook, that we can use for testing
	* emacs/gds.el (gds-protocol-hook): New hook.
	  (gds-debug-protocol): Run this hook for each received protocol form.

2008-12-10  Neil Jerram  <neil@ossau.uklinux.net>

	Revert "(scm_shell_usage): Note need for subscription to bug-guile@gnu.org."
	This reverts commit f3e3f530c28cfa5c7830c5d9b01de6fc388bc42a, which is
	appropriate because subscription is not now required for someone to
	send a message to bug-guile@gnu.org.

	Conflicts:

	Revert "Note need for subscription to bug-guile@gnu.org."
	This reverts commit cbea802b3763aa8cb43c88f7df272da3e41c32da, which is
	appropriate because subscription is not now required for someone to
	send a message to bug-guile@gnu.org.

	Conflicts:

	Revert "(Reporting Bugs): Note need for subscription to"
	This reverts commit e563095988a1c64feb30307928bcc090828cdda9, which is
	appropriate because subscription is not now required for someone to
	send a message to bug-guile@gnu.org.

	Conflicts:

	Revert "* README: Note need for subscription to bug-guile@gnu.org."
	This reverts commit 51d079ab0d23e4175d333ce22eb3e74aeae5913d, which is
	appropriate because subscription is not now required for someone to
	send a message to bug-guile@gnu.org.

2008-12-10  Ludovic Courtès  <ludo@gnu.org>

	i18n: Add comment about standardization of the `locale_t' API.
	* libguile/i18n.c: Add pointer to the POSIX 2008 standardization of the
	  API.

	Fix erroneous differences in `NEWS' compared to `branch_release-1-8'.

	configure: Check for <ltdl.h>.
	* configure.in: Check for <ltdl.h>, to clarify misconfigurations.

	configure: Don't substitute `DLPREOPEN'.
	* configure.in: Don't substitute `DLPREOPEN' since it's no longer used
	  (see commit 72db29f200c38fca64a8ccd0d679821eb25de5a9).

2008-12-10  Neil Jerram  <neil@ossau.uklinux.net>

	Remove everything to do with GDS Breakpoints
	(which I now regard as an unsuccesful experiment)

	This commit makes all affected files the same in master as they are in branch_release-1-8.

	* doc/ref/api-debug.texi (Breakpoints): Removed.

	* doc/ref/scheme-using.texi (GDS Introduction, GDS Getting Started,
	  Displaying the Scheme Stack): Remove mentions of breakpoints.
	  (Setting Specific Breakpoints, Setting GDS-managed Breakpoints,
	  Setting and Managing Breakpoints, Listing and Deleting Breakpoints,
	  Moving and Losing Breakpoints): Removed.

	* emacs/gds-scheme.el (gds-bufferless-breakpoints,
	  gds-bpdef:behaviour, gds-bpdef:type, gds-bpdef:file-name,
	  gds-bpdef:proc-name, gds-bpdef:lc, gds-breakpoint-number,
	  gds-breakpoint-buffers, gds-breakpoint-programming,
	  gds-breakpoint-cache, gds-breakpoint-face,
	  gds-breakpoints-file-name, gds-delete-lost-breakpoints,
	  gds-bpdefs-cache, gds-read-breakpoints-file, gds-adopt-breakpoints,
	  gds-adopt-breakpoint, gds-make-breakpoint-overlay,
	  gds-send-breakpoint-to-client, gds-default-breakpoint-type,
	  gds-set-breakpoint, gds-defun-name-region,
	  gds-breakpoint-overlays-at, gds-write-breakpoints-file,
	  gds-fold-breakpoints, gds-delete-breakpoints, gds-delete-breakpoint,
	  gds-breakpoint-at-point, gds-union, gds-user-selected-breakpoint,
	  gds-describe-breakpoints, gds-describe-breakpoint,
	  gds-after-save-update-breakpoints, gds-breakpoint-map): Removed.
	  (gds-nondebug-protocol): Removed handling for `breakpoint' and
	  `get-breakpoints'.

	* emacs/gds.el (gds-scheme-first-load): Removed.

	* ice-9/debugging/Makefile.am (ice9_debugging_sources): Removed
	  breakpoints.scm and load-hooks.scm.

	* ice-9/debugging/breakpoints.scm: Removed.

	* ice-9/debugging/load-hooks.scm: Removed.

	* ice-9/gds-client.scm (handle-nondebug-protocol): Remove everything
	  to do with breakpoints.
	  (breakpoints, set-gds-breakpoints): Removed.
	  (run-utility): Call `connect-to-gds' instead of `set-gds-breakpoints'.

2008-12-09  Ludovic Courtès  <ludo@gnu.org>

	Mention the end of `ChangeLog' files in `NEWS'.

	Make `config.status' happier.
	* guile-tools.in (datarootdir): New variable, needed since `pkgdatadir'
	  may refer to `${datarootdir}'.

2008-12-08  Ludovic Courtès  <ludo@gnu.org>

	Add other missing Gnulib files.

2008-12-07  Ludovic Courtès  <ludo@gnu.org>

	Remove useless references to Libtool's `dlpreopen' mechanism.
	* libguile/Makefile.am (guile_LDFLAGS): Remove `@DLPREOPEN@' since it
	  has no effect.

	* libguile/guile.c (main): Don't invoke `LTDL_SET_PRELOADED_SYMBOLS ()'
	  since it had no effect given how we invoke `libtool'.  It also fixes
	  compatibility issues when using libltdl 1.5 with a Libtool 2.2
	  package.

	Add missing Gnulib M4 files.
	Reported by Neil Jerram.

2008-12-07  Neil Jerram  <neil@ossau.uklinux.net>

	Several new hash table tests, written by Gregory Marton.
	* test-suite/tests/hash.test ("make-hash-table, hash-table?",
	  "hash-set and hash-ref", "auto-resizing hashx", "hashx"): New tests.

	* AUTHORS, THANKS: Add Gregory Marton as a contributor.

2008-12-02  Ludovic Courtès  <ludo@gnu.org>

	Fix sloppy bound checking in `string-{ref,set!}' with the empty string.
	* libguile/strings.c (scm_string_ref): Add proper range checking for the
	  empty string.
	  (scm_string_set_x): Likewise.
	  Reported by Bill Schottstaedt <bil@ccrma.Stanford.EDU>.

	* test-suite/tests/strings.test ("string-ref"): New test prefix.
	  ("string-set!")["empty string", "empty string and non-zero index",
	  "out of range", "negative index", "regular string"]: New tests.

	* NEWS: Update.

	Update `NEWS'.

2008-11-30  Ludovic Courtès  <ludo@gnu.org>

	Fix potential deadlock in `make-struct'.
	* libguile/struct.c (scm_make_struct): Remove critical section, as
	  suggested by Linas Vepstas <linasvepstas@gmail.com>.  See
	  http://lists.gnu.org/archive/html/bug-guile/2008-11/msg00036.html for
	  a discussion.

	Make GNU Libtool 2.2.x happier.
	* configure.in: Use `AC_CONFIG_MACRO_DIR([m4])'.  Reverts patch
	  b01284227e180d223c97e1b9ba7e2cbd0ddded7e and makes `libtoolize' from
	  Libtool 2 happier (removes a couple of warnings).

	* Makefile.am (ACLOCAL_AMFLAGS): Remove `-I guile-config' since that
	  directory only contains macros that we distribute, not macros that we
	  use.

	Check the return value of libc's functions to make `_FORTIFY_SOURCE=2' work.
	This fixes bug #24009 reported by Martin Pitt.

	* libguile/threads.c (guilify_self_1): Check the return value of
	  pipe(2).
	  (scm_std_select): Use `full_read ()' instead of `read ()' when reading
	  from WAKEUP_FD.

	* libguile/async.c (scm_i_queue_async_cell): Use `full_write ()' instead
	  of write(2) when writing to SLEEP_FD.

	* libguile/fports.c (fport_flush): Likewise.

	* libguile/posix.c (getgroups): Use the return value of getgroups(2) as
	  NGROUPS.
	  (scm_nice): Get the return value of nice(2) to make glibc happy.

	* libguile/scmsigs.c (take_signal): Use `full_write ()' instead of
	  write(2).

	Use Gnulib's `full-write' and `full-read' modules.

	Update Gnulib files to commit d4b129b8e5f8a8d1198020fd6fc79310d305936c.

2008-11-24  Ludovic Courtès  <ludo@gnu.org>

	Use orthodox libtoology in `guile'.
	* libguile/guile.c (main): Use `LTDL_SET_PRELOADED_SYMBOLS ()' instead
	  of our own trick.

	Run the handler of SRFI-34's `with-exception-handler' in the right dyn. env.
	* srfi/srfi-34.scm (with-exception-handler): Use `with-throw-handler'
	  instead of `lazy-catch'.

	* test-suite/tests/srfi-34.test ("SRFI 34")["`with-exception-handler'
	  invokes HANDLER in THUNK's dynamic env."]: New test.

	* test-suite/tests/srfi-39.test: Use `(srfi srfi-34)'.
	  ("SRFI-39")["SRFI-34"]: New test.

	* NEWS: Update.

	Fix comments in `test-scm-c-read.c'.
	* test-suite/standalone/test-scm-c-read.c (make_port): Fix comments.

2008-11-23  Ludovic Courtès  <ludo@gnu.org>

	Add C unit test for `scm_c_read ()' and the port API.
	* test-suite/standalone/Makefile.am (check_PROGRAMS, TESTS): Add
	  `test-scm-c-read'.
	  (test_scm_c_read_SOURCES, test_scm_c_read_CFLAGS,
	  test_scm_c_read_LDADD): New.

2008-11-23  Neil Jerram  <neil@ossau.uklinux.net>

	Make scm_c_read use caller buffer only for unbuffered ports.
	We recently modified scm_c_read so that it temporarily swaps the
	caller's buffer with the port's normal read buffer, in order to
	improve performance in the case where the port is unbuffered (which
	actually means having a single-byte buffer) - but we implemented the
	swap in the buffered case too.  The latter turns out to be a bad idea
	- because it means that the C code of a custom port implementation
	cannot rely on a port's buffer always being the same as when it was
	first set up - and so this commit reverts that.  The buffer swapping
	trick now applies to unbuffered ports only.

	* libguile/ports.c (scm_c_read): Only do swapping of port and caller
	  buffer for unbuffered ports.

2008-11-20  Andy Wingo  <wingo@pobox.com>

	late-variable-{ref,set} -> toplevel-{ref,set}
	* benchmark/lib.scm:
	* libguile/vm-i-system.c (toplevel-ref, toplevel-set):
	* module/system/vm/assemble.scm (codegen):
	* module/system/vm/disasm.scm (code-annotation):
	  s/late-variable/toplevel/. It's just a better name.

	merge vm docs into guile reference (as yet unfinished)
	* doc/ref/compiler.texi: A new empty section on the compiler.

	* doc/ref/data-rep.texi: Made to be a section of a chapter instead of an
	  appendix. The beginnings of some revision, but not there yet.

	* doc/ref/guile.texi: Put the "Data Representation" essay into the new
	  "History and Implementation Details" chapter.

	* doc/ref/history.texi: New empty section on Guile history.

	* doc/ref/libguile-concepts.texi:
	* doc/ref/libguile-smobs.texi: Fix up some xrefs.

	* doc/ref/vm.texi: New section documenting the VM. Not done yet.

2008-11-14  Andy Wingo  <wingo@pobox.com>

	nifty generic compiler infrastructure -- no more hardcoded passes
	* module/system/base/language.scm (<language>): Rework so that instead of
	  hardcoding passes in the language, we define compilers that translate
	  from one language to another. Add `parser' to the language fields, a
	  bit of a hack but useful for languages with s-expression external
	  representations but with record internal representations.
	  (define-language, *compilation-cache*, invalidate-compilation-cache!)
	  (compute-compilation-order, lookup-compilation-order): Add an algorithm
	  that does a depth-first search for a translation path from a source
	  language to a target language, caching the result in a lookup table.

	* module/language/scheme/spec.scm:
	* module/language/ghil/spec.scm: Update to the new language format.

	* module/language/glil/spec.scm: Add a language specification for GLIL,
	  with a compiler to objcode. Also there are parsers and printers, for
	  repl usage, but for some reason this doesn't work yet.

	* module/language/objcode/spec.scm: Define a language specification for
	  object code. There is some sleight of hand here, in the "compiler" to
	  values; but there is method behind the madness, because this way we
	  higher levels can pass environments (a module + externals pair) to
	  objcode->program.

	* module/language/value/spec.scm: Define a language specification for
	  values. There is something intellectually dishonest about this, but it
	  does serve its purpose as a foundation for the language hierarchy.

	* configure.in:
	* module/language/Makefile.am
	* module/language/ghil/Makefile.am
	* module/language/glil/Makefile.am
	* module/language/objcode/Makefile.am
	* module/language/value/Makefile.am:
	  Autotomfoolery for the ghil, glil, objcode, and value languages.

	* module/language/scheme/translate.scm (translate): Import the bits that
	  understand `compile-time-environment' here, and pass on the relevant
	  portions of the environment to the next compiler pass.

	* module/system/base/compile.scm (current-language): New procedure, refs
	  the current language fluid, or lazily sets it to scheme.
	  (call-once, call-with-output-file/atomic): Refactor these bits to use
	  with-throw-handler. No functional change.
	  (compile-file, compile-and-load, compile-passes, compile-fold)
	  (compile): Refactor the public interface of the compiler to be generic
	  and simple. Uses `lookup-compilation-order' to find a path from the
	  source language to the target language.

	* module/system/base/syntax.scm (define-type): Adapt to changes in
	  define-record.
	  (define-record): Instead of expecting all slots in the first form,
	  expect them in the body, and let the first form hold the options.

	* module/system/il/compile.scm (compile): Adapt to the compilation pass
	  API (three in and two out).

	* module/system/il/ghil.scm (<ghil-var>, <ghil-env>)
	  (<ghil-toplevel-env>): Adapt to define-record changes.

	* module/system/il/glil.scm (<glil-vars>): Adapt to define-record
	  changes.
	  (<glil>, print-glil): Add a GLIL record printer that uses unparse.
	  (parse-glil, unparse-glil): Update unparse (formerly known as pprint),
	  and write a parse function.

	* module/system/repl/common.scm (<repl>): Adapt to define-record changes.
	  (repl-parse): New function, parses the read form using the current
	  language. Something of a hack.
	  (repl-compile): Adapt to changes in `compile'.
	  (repl-eval): Fix up the does-the-language-have-a-compiler check for
	  changes in <language>.

	* module/system/repl/repl.scm (start-repl): Parse the form before eval.

	* module/system/repl/command.scm (describe): Parse.
	  (compile): Be more generic.
	  (compile-file): Adapt to changes in compile-file.
	  (disassemble, time, profile, trace): Parse.

	* module/system/vm/debug.scm:
	* module/system/vm/assemble.scm: Adapt to define-record changes.

	* module/language/scheme/translate.scm (receive): Fix an important bug
	  that gave `receive' letrec semantics instead of let semantics. Whoops!

2008-11-14  Ludovic Courtès  <ludo@gnu.org>

	Update `THANKS'.

	Update the thread stack base when `scm_with_guile' is invoked multiple times.
	* NEWS: Update.

	* libguile/threads.c (scm_i_init_thread_for_guile): When the thread is
	  already guilified, update `t->base' so that it corresponds to the new
	  stack base.  Bug report and patch by Linas Vepstas <linasvepstas@gmail.com>.

	* test-suite/standalone/Makefile.am (test_scm_with_guile_CFLAGS,
	  test_scm_with_guile_LDADD): New.
	  (check_PROGRAMS, TESTS): Add `test-scm-with-guile'.

2008-11-13  Ludovic Courtès  <ludo@gnu.org>

	Augment `.gitignore'.

	Update "guile(1)" man page.
	* doc/guile.1: Remove reference to the version and date.  Mention R5RS,
	  instead of R4RS.  Explicitly say that the full documentation is in
	  Texinfo (as other GNU packages do).

	Add "guile(1)" man page.
	Robert Merkel's copyright assignment to the FSF had apparently been on
	file for some time.

	* NEWS: Update.

	* doc/Makefile.am (dist_man1_MANS): New.

2008-11-12  Andy Wingo  <wingo@pobox.com>

	more ghil parsing fixen
	* module/system/il/ghil.scm (parse-ghil): Fix a typo for values*
	  (unparse-ghil): Only output (quote foo) if the object is a symbol.
	  (unparse-ghil): Fix some missing ,@.

2008-11-11  Andy Wingo  <wingo@pobox.com>

	fix unparse-ghil errors with quasiquote
	* module/system/il/ghil.scm (unparse-ghil): Fix some issues with
	  quasiquote and unquote[-splicing]. Doh!

	rashly bump stack limit to 40k words
	* libguile/eval.c (scm_debug_opts): Whereas, today's machines are larger
	  than yesterday's; GCC consumes more words per stack frame than it used
	  to; and you can get quite some recursion in a halfway-compiled system,
	  be it resolved: let's bump up the C stack limit to 40k words (160 kB /
	  320 kB, depending on word size).

	add parsers and unparser for ghil; ,language ghil works now
	* module/system/repl/common.scm (repl-print): Slightly refine the meaning
	  of "language-printer": a language printer prints an expression of a
	  language, not the result of evaluation. `write' prints values.

	* module/language/ghil/spec.scm (ghil): Define a language printer, and a
	  translator for turning s-expressions (not scheme, mind you) into GHIL.

	* module/language/scheme/translate.scm (quote, quasiquote): Add some
	  #:keyword action, so that we can (quote #:keywords).

	* module/system/base/language.scm (<language>):
	* module/system/base/compile.scm (read-file-in): Don't require that a
	  language have a read-file; instead error when read-file is called.
	  (compile-passes, compile-in): Refactor to call a helper method to turn
	  the language + set of options into a set of compiler passes.

	* module/system/base/syntax.scm (define-type): Allow the type to be a
	  list, with the car being the name and the cdr being keyword options.
	  Interpret #:printer as a printer, and pass it down to...
	  (define-record): Here.

	* module/system/il/ghil.scm (print-ghil, <ghil>): New printer for GHIL,
	  yay!
	  (parse-ghil, unparse-ghil): New lovely functions. Will document them in
	  the manual.

2008-11-11  Ludovic Courtès  <ludo@gnu.org>

	gc-benchmarks: Adapt `gcold.scm' so that if conforms to the framework.
	* gc-benchmarks/larceny/gcold.scm (main): Rename to `gcold-benchmark'.
	  (GCOld): Fix the order of the predicate and run-maker.

	gc-benchmarks: Add `gcold.scm', by Clinger, Hansen et al.
	See http://www.ccs.neu.edu/home/will/Twobit/benchmarksAbout.html for
	details.

	gc-benchmarks: Add `run-benchmark.scm'.

	gc-profile: Show the result of `(version)'.
	* gc-benchmarks/gc-profile.scm (main): Show `(version)'.

2008-11-10  Ludovic Courtès  <ludo@gnu.org>

	Have `version' return `PACKAGE_VERSION'.
	* libguile/version.c (scm_version): Return `PACKAGE_VERSION' instead of
	  "MAJOR.MINOR.MICRO".

	Change `GUILE_VERSION' to `1.9.0-bdwgc'.
	* GUILE-VERSION (GUILE_VERSION): Add `-bdwgc' prefix.

	Use `pkg-config' to detect BDW-GC at configure-time.
	* configure.in: Use `PKG_CHECK_MODULES' to look for libgc.  This only
	  works with GC 7.x+, which is what we want anyway.

	gc-benchmarks: Allow the iteration count to be passed to `gc-profile.scm'.
	* gc-benchmarks/gc-profile.scm (*iteration-count*): New parameter.
	  (run-benchmark): Moved from `twobit-compat.scm'.  Honor
	  `*iteration-count*'.
	  (%options): Add `--iterations'.
	  (show-help): Document it.
	  (main): Parameterize `*iteration-count*'.

	Import GC benchmarks from Larceny, by Hansen, Clinger, et al.
	These GPLv2+-licensed GC benchmarks are available from
	http://www.ccs.neu.edu/home/will/GC/sourcecode.html .

	gc-benchmarks: Add a Larceny/Twobit benchmark compatibility layer.
	* gc-benchmarks/gc-profile.scm: Load "twobit-compat.scm".
	  (save-directory-excursion, load-larceny-benchmark): New procedures.
	  (%options): New variable.
	  (show-help, parse-args): New procedures.
	  (main): Use `parse-args' and `load-larceny-benchmark'.

2008-11-10  Andy Wingo  <wingo@pobox.com>

	remove .cvsignore files

2008-11-05  Ludovic Courtès  <ludo@gnu.org>

	Work around unintentional retention of modules by the GC.
	This reverts par of "Document the failure of `gc.test' wrt. unused modules."
	(commit 328efeb9a66dddcf78a24fad96d3db58e9c3375d.)

	* ice-9/boot-9.scm (set-module-eval-closure!): Don't set the `module' property
	  on CLOSURE.

	* libguile/modules.c (scm_lookup_closure_module): Call `abort ()' to make it
	  clear that code that uses the `module' property no longer works.  That code
	  is unused anyway.

2008-11-04  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/threads.c

2008-11-02  Ludovic Courtès  <ludo@gnu.org>

	Remove the SMOB mark procedure for source properties.
	* libguile/srcprop.c (srcprops_mark): Remove.
	  (scm_init_srcprop): Remove call to `scm_set_smob_mark ()'.

2008-11-02  Andy Wingo  <wingo@pobox.com>

	proper printing of thunks, reduced disasm verbosity
	* module/system/vm/disasm.scm (disassemble-program): Don't print the
	  nargs= nrest= etc line, it's redundant.

	* module/system/vm/program.scm (program-bindings-as-lambda-list): If the
	  program bindings is null, then that's that.

2008-11-01  Andy Wingo  <wingo@pobox.com>

	define macros before functions using macros; more MV fixen in srfi-69
	* module/srfi/srfi-69.scm: Move the macros up before the functions that
	  use them, so that the compiler can do its job.
	  (hash-table-walk): While it is true about what I said about R5RS
	  before, it seems that for R6 this will have to change. Anyway. In the
	  meantime, since the test suite checks that hash-table-walk procedures'
	  return values and number of return values are ignored, call that
	  procedure within a call-with-values.

	fix for (apply values '(1))
	* libguile/vm-i-system.c (return/values): In the
	  multiple-values-to-a-single-value-continuation (or MV but where N=1),
	  null out the correct number of values from the stack. Fixes aborts on
	  (apply values '(1)).

	* testsuite/t-values.scm (call-with-values): Add a test.

	fix multiple values coming from interpreted or C procedures
	* libguile/vm-i-system.c (call, goto/args): Handle the case in which a
	  non-program (i.e. interpreted program or a subr) returns multiple
	  values.

	* testsuite/t-values.scm: Add test case that exhibited this problem.

	make-procedure-with-setter inherits name from getter
	* libguile/procs.c (scm_make_procedure_with_setter): Patch through the
	  getter's procedure name to the procedure-with-setter. Fixes part of the
	  srfi-17 test, as the VM doesn't set procedure-name on define -- but
	  perhaps that is the bug that should be fixed. In any case this patching
	  is cheap.

	* test-suite/tests/eval.test: Change so that (define name pws) is
	  initially passed an anonymous procedure-with-setter, as was the case
	  before the procs.c change.

	avoid delivering 0 values to 1-valued continuations in srfi-19
	* module/srfi/srfi-19.scm: Some parts of this code used a strange idiom,
	  `(values)', to indicate that a procedure did nothing. However, quoth
	  R5RS:

	     Except for continuations created by the `call-with-values'
	     procedure, all continuations take exactly one value.

	  Indeed the VM indicated this error. I reworked the code to avoid these
	  cases.

	move scm srfi files to module/srfi, and compile them.
	* .gitignore: Add gdb-pre-inst-guile.

	* configure.in: Add module/srfi/Makefile.

	* module/Makefile.am: Add srfi/.

	* module/srfi/: SRFI scheme files moved here, and compiled.

	* srfi/Makefile.am: Remove the bits about the scheme files.

	move guilec.mk to am/guilec
	* am/Makefile.am:
	* am/guilec: guilec moved here from /guilec.mk.

	All includers of guilec adapted.

	remove stale env script, clean up gdb-pre-inst-guile
	* env: Removed (a vestige of the guile-vm merge).

	* gdb-pre-inst-guile.in: Make a bit more robust (using libtool
	  --mode=execute).

	move ice-9/ and oop/ under module/
	Moved ice-9/ and oop/ under module/, with the idea being that we have
	only scheme under module/. Adjusted configure.in and Makefile.am
	appropriately. Put oop/ at the end of the compilation order.

2008-10-31  Ludovic Courtès  <ludo@gnu.org>

	Fix initialization of the SMOB GC "kind".
	* libguile/smob.c (scm_smob_prehistory): When initializing
	  SMOB_GC_KIND, pass 1 as the CLEAR_NEW_OBJECTS argument to
	  `GC_new_kind ()'.  Without this, an assertion failure is
	  triggered in libgc's `reclaim.c'.

2008-10-31  Andy Wingo  <wingo@pobox.com>

	compile goops accessors. woot!
	* oop/goops.scm: Define compiler hooks for dealing with @slot-ref and
	  @slot-set!.
	  (make-bound-check-get, make-get, make-set): Compile these indexed
	  accessors instead of having them be closures. Probably slower for the
	  memoizer, but faster for the vm... not sure what the perfect solution
	  is.

	* test-suite/tests/goops.test ("defining classes"): Add a test that
	  defining a class with accessors works (it didn't until I figured out
	  that (@ (system base compile) compile) thing).

	new ops: slot-ref, slot-set. remove and recompile your .go files
	* libguile/vm-i-scheme.c (slot-ref, slot-set): New ops.

	fix bug in define-scheme-translator
	* module/language/scheme/translate.scm (define-scheme-translator): Fix a
	  bug in this macro for the syntax-error case.

	pass backtraces through the compiler
	* module/system/base/compile.scm (call-with-nonlocal-exit-protect): New
	  helper, like unwind-protect but only for nonlocal exits.
	  (call-with-output-file/atomic): Use call-with-nonlocal-exit-protect so
	  that we don't mess up backtraces by catching all and then rethrowing.
	  Should fix this more comprehensively somewhere, though.

	make define-inline more usable from external modules
	* module/system/il/inline.scm (define-inline): Use @ when accessing
	  module vars so that other modules don't need to import all of our
	  modules. However case-lambda is still needed.

	rework the scheme translator so it's extensible by external modules
	* module/language/scheme/translate.scm (*translate-table*)
	  (define-scheme-translator): Rework the translator to have the clauses
	  defined separately via the define-scheme-translator macro, so that
	  external modules can define their own translators. Should be no
	  functional change in this commit, though.

	compile goops submodules, goops.test now passes again
	* libguile/goops.c (get_slot_value, set_slot_value): While keeping the
	  inlined getter/setter dispatch for closures, allow the getters and
	  setters to be any kind of procedure.

	* oop/goops.scm (compute-getters-n-setters): Relax the checks on
	  getter/setter procedures, so that if a getter is a procedure but not a
	  closure, we don't try to poke its arity.

	* oop/goops/Makefile.am (SOURCES): Compile all the goops submodules!

	* oop/goops/old-define-method.scm: Removed, in an act of housekeeping.

	* oop/goops/compile.scm:
	* oop/goops/dispatch.scm: Break a circular module dependency by making
	  sure that (oop goops) is loaded when we go to compile submodules.

	* oop/goops/compile.scm (compile-method/memoizer)
	  (compile-method/memoizer+next): Allow a procedure without source
	  through. This can happen with getter and setter lambdas that were
	  compiled, and in that case there is no next-method call anyway. Ideally
	  we should be able to specify compile-method for accessor methods...

	fix chaining up from interpreted to compiled methods; allow compiled init-thunk
	* libguile/goops.c (scm_sys_initialize_object): Don't assume that an init
	  thunk is a closure; just go through scm_call_0 instead.

	* oop/goops/compile.scm (make-make-next-method/memoizer): Allow for the
	  case that the next method is compiled.

2008-10-31  Ludovic Courtès  <ludo@gnu.org>

	Don't invoke `on_thread_exit ()' from a pthread key destructor.
	The `on_thread_exit ()' function allocates memory via libgc.  When
	called from the context of a pthread key detructor, the thread is
	essentially "dead" already and `GC_lookup_thread ()' returns NULL,
	which triggers an assertion in libgc's `thread_local_alloc.c'.  This
	patch arranges so that `on_thread_exit ()' is called from a suitable
	context.

	* libguile/threads.c (on_thread_exit): Remove now invalid comment
	  about access to libgc's TLS.
	  (init_thread_key): Don't pass `on_thread_exit ()' to
	  `scm_i_pthread_key_create ()'.
	  (scm_leave_guile_cleanup): Invoke `do_thread_exit ()'.
	  (really_launch): Invoke `pthread_exit ()'.

2008-10-31  Andy Wingo  <wingo@pobox.com>

	compile goops
	The pending task is to make the accessors compiled too, and also to
	compile compile.scm and dispatch.scm, and to integrate dispatch into the
	VM.

	* oop/Makefile.am (SOURCES): VM-ify the makefile, so we compile goops.scm
	  by default.

	* oop/goops.scm (load-toplevel): Load goops builtins when compiling too.
	  (method): Fix a literal #<unspecified> in the generated procedure (for
	  an empty body).
	  (internal-add-method!): Cleverness when bootstrapping add-method!.
	  Neat!
	  (initialize for <generic>): Use the `method' macro so we get
	  compilation support.

	* oop/goops/dispatch.scm (cache-methods): Don't assume entries are pairs.

2008-10-30  Andy Wingo  <wingo@pobox.com>

	compile occam-channel
	* ice-9/Makefile.am (SOURCES): Compile the goops-using occam-channel.scm.

	fix up some assumptions that cmethods were lists
	* libguile/eval.i.c (type_dispatch, apply_vm_cmethod)
	  (apply_memoized_cmethod): Tweak the nastiness a bit more so as to deal
	  with the '(no-method) empty entries. I would like to stop the search if
	  the cdr isn't a pair, but currently with the inlined memoized bits, the
	  cdr is a pair. The fix would be to make the memoizer return a procedure
	  and not the already-inlined bits -- slightly slower but the vm will be
	  faster anyway.

	* libguile/objects.c (scm_mcache_lookup_cmethod): Same fixes here.

	* oop/goops/dispatch.scm (cache-hashval, cache-try-hash!): Allow non-list
	  cmethod tails.

	runtime byte compilation of goops methods, whooooo
	* ice-9/boot-9.scm (make-modules-in): Change to make sure that we are
	  making modules in modules; that is, that a global binding of `compile'
	  doesn't prevent a module from importing a submodule named `compile'.
	  (resolve-module): Clean up a bit, and serialize the logic.

	* libguile/objects.c (scm_mcache_lookup_cmethod, scm_apply_generic):
	* libguile/eval.i.c (CEVAL): Now that cmethod entries can have a program
	  as their tail instead of a memoized proc, we have to change the halting
	  condition on the method cache search, in both places: the one that's
	  inlined into eval.i.c and the one in objects.c. If the cmethod isn't a
	  pair, apply it.

	* libguile/goops.c (make): In the `make' procedure that's used before
	  GOOPS is booted, bind #:formals, #:body, and #:compile-env on methods.

	* oop/goops/compile.scm (compute-entry-with-cmethod): There was a
	  terrible trick here that involved putting a dummy pair in the cache,
	  then modifying it in place with the result of memoization. The note
	  claimed that this was to cut recursion short, or something. I can't see
	  how it could recurse, given that `methods' is changing each time. Also,
	  the pair trick doesn't work with byte-compiled methods. So, remove it.
	  (compile-method): Dispatch to the appropriate method compiler, based on
	  whether the method was defined with the interpreter or with the
	  compiler.
	  (make-next-method): New function, generically computes a `next-method'
	  procedure, though the caller has to supply the arguments.
	  (compile-method/vm): Exciting method byte compiler!
	  (make-make-next-method/memoizer, compile-method/memoizer): Add the
	  /memoizer suffix, and move all this code to the bottom of the file.

	recompiling with compile environments, fluid languages, cleanups
	* ice-9/boot-9.scm (compile-time-environment): Remove definition from
	  boot-9 -- instead, autoload it and `compile' from (system base
	  compile).

	* libguile/objcodes.h:
	* libguile/objcodes.c (scm_objcode_to_program): Add an optional argument,
	  `external', the external list to set on the returned program.

	* libguile/vm-i-system.c (externals): New instruction, returns the
	  external list. Only used by (compile-time-environment).

	* libguile/vm.c (scm_load_compiled_with_vm): Adapt to
	  scm_objcode_to_program change.

	* module/language/scheme/translate.scm (translate): Actually pay
	  attention to the environment passed as an argument.
	  (custom-transformer-table): Expand out (compile-time-environment) to
	  something that can be passed to `compile'.

	* module/system/base/compile.scm (*current-language*): Instead of
	  hard-coding `scheme' in various places, use a current language fluid,
	  initialized to `scheme'.
	  (compile-file, load-source-file): Adapt to *current-language*.
	  (load-source-file): Ada
	  (scheme-eval): Removed, no one used this.
	  (compiled-file-name): Don't hard-code "scm" and "go"; instead use the
	  %load-extensions and %load-compiled-extensions.
	  (cenv-module, cenv-ghil-env, cenv-externals): Some accessors for
	  compile-time environments.
	  (compile-time-environment): Here we define (compile-time-environment)
	  to something that will return #f; the compiler however produces
	  different code as noted above.
	  (compile): New function, compiles an expression into a thunk, then runs
	  the thunk to get the value. Useful for procedures. The optional second
	  argument can be either a module or a compile-time-environment; in the
	  latter case, we can recompile even with lexical bindings.
	  (compile-in): If the env specifies a module, set that module for the
	  duration of the compilation.

	* module/system/base/syntax.scm (%compute-initargs): Fix a bug where the
	  default value for a field would always replace a user-supplied value.
	  Whoops.

	* module/system/il/ghil.scm (ghil-env-dereify): New function, takes the
	  result of ghil-env-reify and turns it back into a GHIL environment.

	* scripts/compile (compile): Remove some of the tricky error handling, as
	  the library procedures handle this for us.

	* test-suite/tests/compiler.test: Add a test for the dynamic compilation
	  bits.

2008-10-28  Ludovic Courtès  <ludo@gnu.org>

	Document the impossibility to call the GC from within `on_thread_exit ()'.
	* libguile/threads.c (on_thread_exit): Add `FIXME' comment.

2008-10-26  Neil Jerram  <neil@ossau.uklinux.net>

	Fix stack calibration-related errors when running make distcheck.
	* libguile/Makefile.am (stack-limit-calibration.scm): Use $(srcdir), to
	  support building in a different directory.
	  (MOSTLYCLEANFILES): Add stack-limit-calibration.scm.

2008-10-25  Andy Wingo  <wingo@pobox.com>

	add `formals', `body', and `compile-env' slots to <method>
	* ice-9/boot-9.scm (compile-time-environment): Return #f instead of
	  erroring under the interpreter, a bit more sane.

	* libguile/goops.c (create_standard_classes):
	* libguile/goops.h (scm_si_formals, scm_si_body, scm_si_compile_env):
	* oop/goops.scm (method, initialize): Add `formals', `body', and
	  `compile-env' slots to <method>.

	defmacroize (oop goops accessors), (oop goops save)
	* oop/goops/accessors.scm (define-class-with-accessors)
	  (define-class-with-accessors-keywords): Turn into defmacros.

	* oop/goops/save.scm (readable, restore, write-component): Turn into
	  defmacros.

	Both of these changes are untested, unfortunately.

	add `compile-time-environment'
	* ice-9/boot-9.scm (compile-time-environment): New function, with
	  documentation. The trick is that the compiler recognizes calls to
	  (compile-time-environment) and replaces it with a representation of the
	  *available* lexicals. Note that this might not be all the lexicals;
	  only the heap-allocated ones are returned.

	* module/language/scheme/translate.scm (custom-transformer-table):
	  Compile `compile-time-environment' to <ghil-reified-env>.

	* module/system/il/compile.scm (codegen): Add <ghil-reified-env> clause,
	  which calls ghil-env-reify.

	* module/system/il/ghil.scm (ghil-env-reify): New procedure, returns a
	  list of (NAME . EXTERNAL-INDEX).
	  (<ghil>): Add <ghil-reified-env> object.

	define-type no longer expects `|' subform
	* module/system/base/syntax.scm (define-type): Rework to not require the
	  `|', which confuses Emacs.

	* module/system/il/ghil.scm (<ghil>):
	* module/system/il/glil.scm (<glil>): Adapt to define-type changes.

2008-10-25  Neil Jerram  <neil@ossau.uklinux.net>

	Add measure-hwm.scm to the set of distribution files.
	* libguile/Makefile.am (EXTRA_DIST): Add measure-hwm.scm.

2008-10-24  Neil Jerram  <neil@ossau.uklinux.net>

	Fix hang in srfi-18.test
		* libguile/threads.h (held_mutex): New field.

		* libguile/threads.c (enqueue, remqueue, dequeue): Use critical
		section to protect access to the queue.
		(guilify_self_1): Initialize held_mutex field.
		(on_thread_exit): If held_mutex non-null, unlock it.
		(fat_mutex_unlock, fat_cond_free, scm_make_condition_variable,
		fat_cond_signal, fat_cond_broadcast): Delete now unnecessary uses
		of c->lock.
		(fat_mutex_unlock): Pass m->lock to block_self() instead of
		c->lock; move scm_i_pthread_mutex_unlock(m->lock) call from before
		block_self() to after.
		(scm_pthread_cond_wait, scm_pthread_cond_timedwait,
		scm_i_thread_sleep_for_gc): Set held_mutex before pthread call;
		reset it afterwards.

	I was seeing a hang in srfi-18.test, when running make check in master,
	in the "exception handler installation is thread-safe" test.  It wasn't
	100% reproducible, so looked like a race.

	The problem is that wait-condition-variable is not actually
	atomic in the way that it is supposed to be.  It unlocks the mutex,
	then starts waiting on the cond var.  So it is possible for another
	thread to lock the same mutex, and signal the cond var, before the
	wait-condition-variable thread starts waiting.

	In order for wait-condition-variable to be atomic - e.g. in a race
	where thread A holds (Scheme-level) mutex M, and calls
	(wait-condition-variable C M), and thread B calls (begin (lock-mutex
	M) (signal-condition-variable C)) - it needs to call pthread_cond_wait
	with the same underlying mutex as is involved in the `lock-mutex'
	call.  In terms of the threads.c code, this means that it has to use
	M->lock, not C->lock.

	block_self() used its mutex arg for two purposes: for protecting
	access and changes to the wait queue, and for the pthread_cond_wait
	call.  But it wouldn't work reliably to use M->lock to protect C's
	wait queue, because in theory two threads can call
	(wait-condition-variable C M1) and (wait-condition-variable C M2)
	concurrently, with M1 and M2 different.  So we either have to pass
	both C->lock and M->lock into block_self(), or use some other mutex to
	protect the wait queue.  For this patch, I switched to using the
	critical section mutex, because that is a global and so easily
	available.  (If that turns out to be a problem for performance, we
	could make each queue structure have its own mutex, but there's no
	reason to believe yet that it is a problem, because the critical
	section mutex isn't used much overall.)

	So then we call block_self() with M->lock, and move where M->lock is
	unlocked to after the block_self() call, instead of before.

	That solves the first hang, but introduces a new one, when a SRFI-18
	thread is terminated (`thread-terminate!') between being launched
	(`make-thread') and started (`thread-start!').  The problem now is
	that pthread_cond_wait is a cancellation point (see man
	pthread_cancel), so the pthread_cond_wait call is one of the few
	places where a thread-terminate! call can take effect.  If the thread
	is cancelled at that point, M->lock ends up still being locked, and
	then when do_thread_exit() tries to lock M->lock again, it hangs.

	The fix for that is a new `held_mutex' field in scm_i_thread, which is
	set to point to the mutex just before a pthread_cond_(timed)wait call,
	and set to NULL again afterwards.  If on_thread_exit() finds that
	held_mutex is non-NULL, it unlocks that mutex.

	A detail is that checking and unlocking held_mutex must be done before
	on_thread_exit() calls scm_i_ensure_signal_delivery_thread(), because
	the innards of scm_i_ensure_signal_delivery_thread() can do another
	pthread_cond_wait() call and so overwrite held_mutex.  But that's OK,
	because it's fine for the mutex check and unlock to happen outside
	Guile mode.

	Lastly, C->lock is then not needed, so I've removed it.

	Fix hang in srfi-18.test
		* libguile/threads.h (held_mutex): New field.

		* libguile/threads.c (enqueue, remqueue, dequeue): Use critical
		section to protect access to the queue.
		(guilify_self_1): Initialize held_mutex field.
		(on_thread_exit): If held_mutex non-null, unlock it.
		(fat_mutex_unlock, fat_cond_free, scm_make_condition_variable,
		fat_cond_signal, fat_cond_broadcast): Delete now unnecessary uses
		of c->lock.
		(fat_mutex_unlock): Pass m->lock to block_self() instead of
		c->lock; move scm_i_pthread_mutex_unlock(m->lock) call from before
		block_self() to after.
		(scm_pthread_cond_wait, scm_pthread_cond_timedwait,
		scm_i_thread_sleep_for_gc): Set held_mutex before pthread call;
		reset it afterwards.

	I was seeing a hang in srfi-18.test, when running make check in master,
	in the "exception handler installation is thread-safe" test.  It wasn't
	100% reproducible, so looked like a race.

	The problem is that wait-condition-variable is not actually
	atomic in the way that it is supposed to be.  It unlocks the mutex,
	then starts waiting on the cond var.  So it is possible for another
	thread to lock the same mutex, and signal the cond var, before the
	wait-condition-variable thread starts waiting.

	In order for wait-condition-variable to be atomic - e.g. in a race
	where thread A holds (Scheme-level) mutex M, and calls
	(wait-condition-variable C M), and thread B calls (begin (lock-mutex
	M) (signal-condition-variable C)) - it needs to call pthread_cond_wait
	with the same underlying mutex as is involved in the `lock-mutex'
	call.  In terms of the threads.c code, this means that it has to use
	M->lock, not C->lock.

	block_self() used its mutex arg for two purposes: for protecting
	access and changes to the wait queue, and for the pthread_cond_wait
	call.  But it wouldn't work reliably to use M->lock to protect C's
	wait queue, because in theory two threads can call
	(wait-condition-variable C M1) and (wait-condition-variable C M2)
	concurrently, with M1 and M2 different.  So we either have to pass
	both C->lock and M->lock into block_self(), or use some other mutex to
	protect the wait queue.  For this patch, I switched to using the
	critical section mutex, because that is a global and so easily
	available.  (If that turns out to be a problem for performance, we
	could make each queue structure have its own mutex, but there's no
	reason to believe yet that it is a problem, because the critical
	section mutex isn't used much overall.)

	So then we call block_self() with M->lock, and move where M->lock is
	unlocked to after the block_self() call, instead of before.

	That solves the first hang, but introduces a new one, when a SRFI-18
	thread is terminated (`thread-terminate!') between being launched
	(`make-thread') and started (`thread-start!').  The problem now is
	that pthread_cond_wait is a cancellation point (see man
	pthread_cancel), so the pthread_cond_wait call is one of the few
	places where a thread-terminate! call can take effect.  If the thread
	is cancelled at that point, M->lock ends up still being locked, and
	then when do_thread_exit() tries to lock M->lock again, it hangs.

	The fix for that is a new `held_mutex' field in scm_i_thread, which is
	set to point to the mutex just before a pthread_cond_(timed)wait call,
	and set to NULL again afterwards.  If on_thread_exit() finds that
	held_mutex is non-NULL, it unlocks that mutex.

	A detail is that checking and unlocking held_mutex must be done before
	on_thread_exit() calls scm_i_ensure_signal_delivery_thread(), because
	the innards of scm_i_ensure_signal_delivery_thread() can do another
	pthread_cond_wait() call and so overwrite held_mutex.  But that's OK,
	because it's fine for the mutex check and unlock to happen outside
	Guile mode.

	Lastly, C->lock is then not needed, so I've removed it.

2008-10-23  Ludovic Courtès  <ludo@gnu.org>

	Expose `GC_dump ()' at the Scheme level.
	* libguile/gc.h (scm_gc_dump): New declaration.

	* libguile/gc.c (scm_gc_dump): New function.

2008-10-23  Andy Wingo  <wingo@pobox.com>

	method is a defmacro.
	* oop/goops.scm (method): Make into a defmacro.

	define-method is a defmacro
	* oop/goops.scm (define-method): Make into a defmacro -- didn't change
	  any of the logic, but the logic is a bit dodgy (see the note in the
	  source).

	define-generic, define-accessor are defmacros too
	* oop/goops.scm (define-generic, define-accessor): Define as defmacros. I
	  find their semantics to be a bit odd, though -- but the test case
	  checks for this behavior, so we'll follow the test cases.

	make `define-class' and `class' into defmacros
	* oop/goops.scm: Use srfi-1, as util.scm already does.
	  (kw-do-map): New helper for processing keyword args.
	  (define-class-pre-definition, define-class): Rework so that
	  define-class is a defmacro without side effects. There are two
	  functional differences: we don't check that define-class is called only
	  at the toplevel, because defining a lexical class might makes sense,
	  and defmacros don't give us the toplevel check that we would want.
	  Second in the redefinition case, we don't do a `define', as we don't
	  actually need a new variable.
	  (class): Similarly, make `class' a defmacro.

2008-10-18  Andy Wingo  <wingo@pobox.com>

	fix typo in assembler
	* module/system/vm/assemble.scm (dump-object!): Whoops, spell `nexts'
	  correctly.

	fix bug in self-tail-recursion with "external" variables; other sundries
	* gdbinit (pp, inst): New commands.

	* libguile/vm-engine.c (vm_error_not_a_pair): New error case.

	* libguile/vm-i-scheme.c (VM_VALIDATE_CONS): New macro -- use this
	  instead of SCM_VALIDATE_* because SCM_VALIDATE will exit nonlocally
	  before we have a chance to sync the regs.
	  (car, cdr, set-car, set-cdr): Use VM_VALIDATE_CONS.

	* libguile/vm-i-system.c (goto/args): Bugfix: when doing a
	  self-tail-recursion, allocate fresh externals. Fixes use of match.go.

	* module/system/vm/assemble.scm (dump-object!): Add some checks that we
	  aren't dumping out values that the VM can't handle.

	* module/system/vm/disasm.scm (disassemble-externals): Fix rotten call to
	  `print-info'.

	* oop/goops/dispatch.scm: Add a FIXME.

	* testsuite/Makefile.am (vm_test_files):
	* testsuite/t-closure4.scm (extract-symbols): New test, distilled with
	  much effort out of match.scm.

	* ice-9/Makefile.am (NOCOMP_SOURCES): Re-enable compilation of match.scm.
	  Yay!

	bug fix to enable code "packing"
	* module/system/vm/conv.scm (code-pack): Fix so that we actually
	  recognize (make-int8 1) and turn it into (make-int8:1).

2008-10-17  Neil Jerram  <neil@ossau.uklinux.net>

	Avoid `Stack overflow' errors when running `make check'
	For explanation, see comments and text in the new file
	libguile/measure-hwm.scm.

	* .gitignore: Add libguile/stack-limit-calibration.scm.

	* check-guile.in: Load libguile/stack-limit-calibration.scm.

	* configure.in: Add AC_CONFIG_FILES to generate test-use-srfi from
	  test-use-srfi.in.

	* libguile/Makefile.am (TESTS, TESTS_ENVIRONMENT,
	  stack-limit-calibration.scm): New targets, so that `make check'
	  calibrates the stack limit before running the Guile test suite.

	* libguile/measure-hwm.scm: New file, calibrates stack limit for `make
	  check'.

	* libguile/stackchk.c (scm_sys_get_stack_size): New primitive.

	* libguile/stackchk.h (scm_sys_get_stack_size): New primitive
	  (declaration).

	* test-suite/standalone/test-use-srfi: Renamed test-use-srfi.in, so
	  that ./configure can fill in variables in it.

	* test-suite/standalone/test-use-srfi.in: Load
	  libguile/stack-limit-calibration.scm.

2008-10-16  Andy Wingo  <wingo@pobox.com>

	elisp.test: apply to nil-terminated list is UNRESOLVED with compiled boot-9
	* test-suite/tests/elisp.test: If running the '(apply foo nil) test
	  fails with a vm-error, throw UNRESOLVED. This allows the test suite to
	  pass in the compiled boot-9.scm while still keeping the elisp apply
	  issue open.

	run the elisp test with a larger stack limit
	* test-suite/tests/elisp.test: Enlarge the stack for the duration of the
	  elisp test. It's a hack, but it at least allows the test to run with a
	  compiled ice-9.

	fix backtraces, broken since the program-bindings format change
	* module/system/vm/frame.scm (frame-bindings): Fix for new binding
	  format; actually use the bindings accessors.
	  (frame-lookup-binding): Clarify.

	fix use of `binding' data abstraction
	* module/system/vm/assemble.scm (make-temp-binding, btemp:name)
	  (btemp:extp, btemp:index): Don't abuse program.scm's make-binding to
	  make something that actually isn't a binding.
	  (codegen): Do use program.scm's make-binding to make something that
	  actually is a binding.

	* module/system/vm/program.scm (binding:start, binding:end): New
	  accessors.
	  (make-binding): Expand to have the start and end arguments in the
	  constructor.

	ensure that lists pushed onto the stack are proper
	I saw this problem when running elisp.test -- it tries to apply a
	function to an arglist ending in nil, which obviously is not null.

	* libguile/vm-engine.h (PUSH_LIST): New helper macro, pushes the elements
	  of a list onto the stack. Checks to make sure that the list is proper.

	* libguile/vm-i-system.c (list-break, mv-call, apply, goto/apply)
	  (goto/cc): Use LIST_BREAK.

	* libguile/vm-engine.c (vm_error_improper_list): New error case.

	fix asyncs running in the vm; re-enable popen.scm compilation
	* libguile/vm-i-system.c (goto/args): Sync the registers before doing the
	  SCM_TICK. We probably need a different SCM_TICK that saves the regs
	  only if necessary. This fixes GC problems with a compiled popen.scm.

	* ice-9/Makefile.am: Re-enable popen.scm compilation.

2008-10-15  Andy Wingo  <wingo@pobox.com>

	fix `(help)'
	* ice-9/session.scm (help): Return valid scheme forms in the no-arg and
	  no-regex cases.

	fix mv-call disasm bug
	* module/system/vm/disasm.scm (code-annotation): Fix bug with mv-call.

	fix disasm bugs, add some more instruction annotations
	* module/system/vm/disasm.scm (disassemble-program): Fix misunderstanding
	  of nlocs: the *actual* number of locals is nlocs + nargs, even if the
	  arg is heap-allocated -- because our calling convention always puts the
	  initial val on the stack. Also: don't disassemble the objects, they are
	  now woven into the text.
	  (code-annotation): Fix external-{ref,set} handling to allow for
	  referencing externals from enclosed stack frames. Really this should be
	  statically determined, though. Add late-variable-{ref,set} handling.

2008-10-12  Ludovic Courtès  <ludo@gnu.org>

	Add GC benchmarks.

2008-10-12  Andy Wingo  <wingo@pobox.com>

	make disassembly better -- a more woven text.
	* module/system/vm/assemble.scm (pop): Define a pop here too.
	  (codegen): Rework how bindings are represented in a program's
	  meta-info, so they declare their range in the binding list instead of
	  you having to figure out when they end.

	* module/system/vm/conv.scm (make-byte-decoder): Return the end-address
	  as well; requires a change to callers.

	* module/system/vm/disasm.scm (disassemble-objcode, disassemble-program)
	  (disassemble-bytecode, disassemble-objects, disassemble-externals)
	  (disassemble-meta, source->string, make-int16, code-annotation)
	  (print-info): Rework to display my domination of `format', and, more
	  seriously, start to integrate the "subsections" of the disassembly into
	  the main disassembly text.

	* module/system/vm/program.scm (program-bindings-as-lambda-list): Update
	  for new bindings format; should be more correct.

2008-10-11  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/Makefile.am
		libguile/threads.c

2008-10-11  Andy Wingo  <wingo@pobox.com>

	simplify disassembly annotations a bit
	* module/system/vm/disasm.scm (original-value): Simplify a bit to
	  normally dispatch on the instruction, only trying code->object at the
	  end.

	make each invocation of `while' throw to different keys
	* ice-9/boot-9.scm (while): Further fixes to while, brought out by the
	  test suite. Also updated documentary comments.

	relax an assertion -- the test suite completes without aborting, whee
	* libguile/vm-i-system.c (call/cc, goto/cc): Don't assert that ip matches
	  vp->ip, because vp->ip is not restored by vm_reset_stack, and indeed
	  it's re-set to 0 by `halt'. But still, perhaps reset_stack and halt
	  should indeed reset vp->ip.

	truly thread-local vms; don't compile popen.scm
	* ice-9/Makefile.am: Don't compile popen.scm, its behaviour at runtime
	  is not consistent -- seems to miss some GC references? I suspect a bug
	  in the compiler. In any case without popen.scm being compiled,
	  continuations.test, r4rs.tes, and r5rs_pitfall.test do pass.

	* libguile/threads.h (scm_i_thread):
	* libguile/threads.c (thread_mark, guilify_self_2): Add a field for the
	  thread's vm. Previously I had this as a fluid, but it seems that newly
	  created threads share their fluid values from the creator thread; as
	  expected, I guess. In any case one VM should not be active in two
	  threads.

	* libguile/vm.c (scm_the_vm): Change to access the thread-local vm,
	  instead of accessing a fluid.
	  (scm_the_vm_fluid): Removed.

	* module/system/vm/vm.scm: Removed *the-vm*.

2008-10-10  Ludovic Courtès  <ludo@gnu.org>

	Fix compilation error due to strict aliasing rules on `i386-unknown-freebsd7.0'.
	* libguile/threads.c (scm_threads_mark_stacks): Cast `&t->regs' to
	  `(void *)' rather than `(SCM_STACKITEM *)' to avoid "warning:
	  dereferencing type-punned pointer will break strict-aliasing rules"
	  with GCC 4.2.1 on `i386-unknown-freebsd7.0'.

2008-10-09  Ludovic Courtès  <ludo@gnu.org>

	Fix compilation of the hard copy of the R5RS, tutorial and GOOPS manual.
	* doc/tutorial/Makefile.am (TEXINFO_TEX): Remove.

	* doc/goops/Makefile.am (TEXINFO_TEX): Remove.

	* doc/r5rs/Makefile.am (TEXINFO_TEX): Remove.

	Add test case to make sure `read' returns mutable strings.
	* test-suite/tests/reader.test ("reading")["returned strings are
	  mutable"]: New test, as reported by szgyg <szgyg@ludens.elte.hu>.

	Revert "Make literal strings (i.e., returned by `read') read-only."
	This reverts commit fb2f8886c4d537b0c7d3e9e78a8d4e5e272a36f4.

	The rationale is that `read' must return mutable strings, as reported
	by szgyg <szgyg@ludens.elte.hu>.

2008-10-09  Andy Wingo  <wingo@pobox.com>

	NULLSTACK fixes for nonlocal exits in reentrant pre-wind handlers
	* libguile/vm-i-system.c (goto/cc): Add some asserts here.

	* libguile/vm.c (capture_vm_cont): Add some asserts here too.
	  (reinstate_vm_cont): Null the correct number of bytes. Add a FIXME.
	  (vm_reset_stack): Make the code a bit clearer. Null the correct number
	  of bytes.

	* libguile/vm-engine.h (NULLSTACK_FOR_NONLOCAL_EXIT): New macro, handles
	  a very tricky case that took me days to find! Amply commented. Expands
	  to nothing in the normal case.

	* libguile/vm-i-system.c (call, goto/args, mv-call): Call
	  NULLSTACK_FOR_NONLOCAL_EXIT in the right places. Fixes
	  continuations.test.

	sundries: side effects in interpreted repl, wrong-num-args in vm, self-checks
	* libguile/vm-engine.c (vm_error_wrong_num_args): Sync the registers
	  before calling scm_wrong_num_args. (The other cases are handled more
	  uniformly.)

	* libguile/vm.c (vm_heapify_frames_1): Add a FIXME: I don't think we
	  should be modifying the stack.
	  (scm_vm_save_stack): If stack nulling is enabled, verify the stack here
	  before reifying it.

	* module/language/scheme/spec.scm (scheme): Use primitive-eval here
	  instead of eval, because at the repl we do want to allow evaluations to
	  have side effects like setting the current module.

	handle throws to unknown keys in the repl
	* module/system/repl/repl.scm (default-catch-handler): Don't rethrow if
	  we don't know the key, just print an error.

	fix dynwind + nonlocal entrance/exit + programs bug
	* libguile/dynwind.c (scm_i_dowinds): Invoke guard procedures when
	  entering and exiting nonlocally. Previously this procedure was
	  program-racist.

2008-10-03  Andy Wingo  <wingo@pobox.com>

	precise stack marking, fix some missed references, still imperfect
	* libguile/vm-engine.h (CHECK_STACK_LEAK, NULLSTACK): Add a new mode,
	  VM_ENABLE_STACK_NULLING, that tries to ensure that all stack data past
	  the top of the stack is NULL. This helps to verify the VM's
	  consistency. If VM_ENABLE_STACK_NULLING is not defined, there is no
	  overhead.
	  (DROP, DROPN): Hook into NULLSTACK.
	  (POP_LIST): Hoo, fix a good bug: if CONS triggered a GC, the elements
	  of the list that had not yet been consed would not be marked, because
	  the sp was already below them.
	  (NEXT): Hook into CHECK_STACK_LEAK.
	  (INIT_ARGS): Add a note that consing the rest arg can cause GC.
	  (NEW_FRAME): Cons up the external data after initializing the frame, so
	  that if GC is triggered, the precise marker sees a well-formed frame.

	* libguile/vm-i-loader.c (load-program): In the four-integers case, use
	  the POP macro so that we can hook into NULLSTACK (if necessary).

	* libguile/vm-i-scheme.c (ARGS2, ARGS3): Hook into NULLSTACK.

	* libguile/vm-i-system.c (halt): Null the nvalues. Rework some asserts
	  into using ASSERT, and null the stack when we free the frame.
	  (variable-set): Use DROPN instead of sp -= 2.
	  (BR): Hook into NULLSTACK.
	  (goto/args): Hook into NULLSTACK. In the non-self case, delay updating
	  the frame until after INIT_ARGS so that GC sees a well-formed frame.
	  Delay consing the externals until after the frame is set up, as in
	  NEW_FRAME.
	  (call/cc): Add some asserts.
	  (return): Rework some asserts into ASSERT, and hook into NULLSTACK.
	  (return/values): Hook into NULLSTACK, and use ASSERT.
	  (return/values*) Use ASSERT.

	* libguile/vm.c (VM_ENABLE_ASSERTIONS, VM_ENABLE_STACK_NULLING): These
	  are the variables that control assertions and nulling. Perhaps we can
	  do these per-engine when we start compiling the debug engine separate
	  from a speedy engine.
	  (vm_mark_stack): Add a precise stack marker. Yay!
	  (vm_cont_mark): Mark the continuation stack precisely.
	  (capture_vm_cont): Record the difference from the vp's stack_base too,
	  so that we can translate the dynamic links when marking the
	  continuation stack. Memset the stack to NULL if we are doing nulling.
	  (reinstate_vm_cont): If we are nulling, null out the relevant part
	  of the stack.
	  (vm_reset_stack): When resetting sp due to a nonlocal exit, null out
	  the stack too.
	  (vm_mark): If we are nulling, assert that there are no extra values on
	  the stack. Mark the stack precisely.

	remove repl.scm's start-stack definition
	* module/system/repl/repl.scm: Now that we actually compile start-stack,
	  no need to provide our own definition here.

	add gdb-pre-inst-guile
	* configure.in:
	* gdb-pre-inst-guile.in: Add gdb-pre-inst-guile, because I'm tired of
	  typos. You can run it just like Guile. For compiling, you might try
	  GUILE=./gdb-pre-inst-guile scripts/compile foo.scm.

2008-10-02  Andy Wingo  <wingo@pobox.com>

	be more like the interpreter in signalling wrong-num-args
	* libguile/vm-engine.c: Call scm_wrong_num_args in the wrong-num-args
	  case, to be more like the interpreter.

	* libguile/vm-engine.h (ASSERT): New macro.

	* libguile/vm-i-system.c (apply, goto/apply): Assert that nargs >= 2,
	  because the compiler should always feed us correct instructions.
	  (call/cc): If no values are returned to the continuation, signal
	  no_values instead of wrong_num_args.

2008-09-30  Andy Wingo  <wingo@pobox.com>

	load the i18n extension when compiling i18n.scm
	* ice-9/i18n.scm: Load the i18n extension when compiling too, so that the
	  macros that depend on (provided? 'nl-langinfo) actually have
	  nl-langinfo. Fixes the i18n test.

	fix compilation of quasiquote with splicing and improper lists
	* libguile/vm-engine.h (POP_CONS_MARK): New macro, analagous to
	  POP_LIST_MARK; used in quasiquote on improper lists.

	* libguile/vm-i-system.c (cons-mark): New instruction. You know the
	  drill, remove all your .go files please.

	* module/system/il/compile.scm (codegen): Compile quasiquoted improper
	  lists with splices correctly. Additionally check that we don't have
	  slices in the CDR of an improper list.

	* testsuite/t-quasiquote.scm: Add a test for unquote-splicing in improper
	  lists.

	fix some missed references when calling C functions
	* gdbinit: Update to be a bit more useful.

	* libguile/vm-i-system.c: Make sure that arguments to C procedures are
	  visible on the stack so they get marked. Could be a source for the
	  missed references.

	Merge commit 'origin/master' into vm
	Conflicts:

		doc/Makefile.am
		ice-9/Makefile.am
		libguile/gc.c

	(oop goops) works again, after (the-environment) removal
	* oop/goops.scm: Update so as not to use (the-environment), which no
	  longer exists. I think that the speed characteristics are the same,
	  broadly speaking.

	object-documentation knows about programs
	* ice-9/documentation.scm (object-documentation): Add hooks for getting
	  documentation for compiled procedures, too. (Goops would be helpful
	  here.)

	don't require users of users of optargs to have used optargs
	* ice-9/optargs.scm: Do the compile-friendly equivalent of unquoting in a
	  value into the macro: use @@.

	compile @ and @@
	* libguile/vm-engine.c (vm_run): Add new error case for resolving @ or @@
	  references, but there is no such module. Possible if
	  module-public-interface returns #f.

	* libguile/vm-i-loader.c (link-now): Allow the stack arg to be a sym, as
	  before, or a list, indicating an absolute reference. Could be two
	  separate instructions, but I'm lazy.

	* libguile/vm-i-system.c (late-variable-ref, late-variable-set): As in
	  link-now, allow the lazy reference to be a list, for @ and @@.

	* module/language/scheme/translate.scm (custom-transformer-table):
	  Compile @ and @@, and set! forms for both of them. This will ease the
	  non-hygienic pain for exported macros.

	* module/system/il/compile.scm (make-glil-var): Translate public and
	  private module variable references into glil-module variables.

	* module/system/il/ghil.scm (ghil-var-at-module!): New function, resolves
	  a variable for @ or @@.

	* module/system/il/glil.scm (<glil-module>): Revival of <glil-module>,
	  this time with the semantics that it really links to a particular
	  module.

	* module/system/vm/assemble.scm (<vlink-now>, <vlink-later>): Redefine as
	  taking a "key" as the argument, which may be a sym or a list; see the
	  notes on link-now for more details.
	  (codegen): Compile <glil-module> appropriately. Some duplication here,
	  probably could use some cleanup later.

2008-09-29  Andy Wingo  <wingo@pobox.com>

	call toplevel variables "toplevel", not "module"
	* module/system/il/ghil.scm (ghil-var-for-set!, ghil-var-for-ref!)
	  (ghil-var-define!): ghil-var-kind of a toplevel var is now 'toplevel.

	* module/system/il/glil.scm: Renamve <glil-module> to <glil-toplevel>.
	  Remove the unused `module' field. Remove the unused <glil-late-bound>
	  type.

	* module/system/il/compile.scm (make-glil-var): s/toplevel/module/

	* module/system/vm/assemble.scm (<vlink-later>, <vdefine>): Remove the
	  unused `module' parameters from these two types.
	  (codegen, dump-object!): Adapt to module/toplevel name changes.

	remove `type' and `value' fields from <ghil-var>
	* module/system/il/ghil.scm (<ghil-var>): Remove `type' and `value'
	  fields, as they were not used.

	move module-public-interface to C, and expose it as C API
	* libguile/modules.h:
	* libguile/modules.c:
	* ice-9/boot-9.scm (module-public-interface): Move definition of
	  module-public-interface to C, where it is now available as
	  scm_module_public_interface ().

2008-09-28  Han-Wen Nienhuys  <hanwen@lilypond.org>

	Remove GH and its traces.

2008-09-28  Andy Wingo  <wingo@pobox.com>

	allocate variables that are set! on the heap
	* module/system/il/ghil.scm (ghil-lookup): So, it turns out this function
	  needed to be split into three:
	  (ghil-var-is-bound?, ghil-var-for-ref!, ghil-var-for-set!): The
	  different facets of ghil-lookup. Amply commented in the source. The
	  difference being that we now allocate variables that are set! on the
	  heap, so that other continuations see their possibly-modified values.
	  (force-heap-allocation!): New helper.

	* testsuite/Makefile.am:
	* testsuite/t-call-cc.scm: New test, that variables that are set! are
	  allocated on the heap, so that subsequent modifications are still
	  seen by the continuation. The test was distilled from test 7.3 in
	  r5rs_pitfall.test.

	revert part of 7ff017002ddc980 that caused missed references
	* libguile/programs.c (scm_c_make_closure): If the program is actually
	  not a program, abort. This can happen if GC misses a reference, as
	  currently seems to happen.

	* libguile/vm.c (vm_mark): Revert part of
	  7ff017002ddc980f684120653549a10c6c7cde5c, which changed the call to
	  scm_mark_locations. I'm 99% *sure* this is wrong, but it seems to
	  prevent missed references when recompiling the .go files in guile
	  itself. Needs revisiting soon, but for the time being we can go back to
	  where we were a couple of days ago.

	* libguile/vm-i-system.c (halt, vector, vector-mark): Sync the registers
	  before calling into C, as it may GC.

	don't compile psyntax.scm
	* ice-9/Makefile.am: Don't try to compile psyntax.scm

2008-09-26  Ludovic Courtès  <ludo@gnu.org>

	Don't use `scm_leave_guile ()' in mutex/cond-related procedures.
	* libguile/threads.c (scm_pthread_mutex_lock, scm_pthread_cond_wait,
	  scm_pthread_cond_timedwait): Don't call `scm_{leave,enter}_guile ()'.

	Implement `scm_std_select ()' in terms of `scm_without_guile ()'.
	* libguile/threads.c (struct select_args): New.
	  (do_std_select): New function.
	  (scm_std_select): Don't use `scm_{leave,enter}_guile ()' since they don't
	  have any effect; use `scm_without_guile ()' instead.

2008-09-26  Andy Wingo  <wingo@pobox.com>

	rename psyntax.ss to psyntax.scm to hack around makefile foo
	* ice-9/Makefile.am (SOURCES):
	* ice-9/syncase.scm:
	* ice-9/psyntax.scm: Renamve psyntax.ss to psyntax.scm. This way the
	  guilec rules won't delete it on a make clean. Doh!

	Fix continuation marking, and some tests.
	* libguile/continuations.c (continuation_mark): Mark the vm
	  continuations.

	* libguile/vm.c (vm_cont_mark): Fix the marking function.
	  (vm_mark): Fix this one too -- the size is a number of STACKITEMS,
	  which we foolishly assume are the same size as SCM.

	* test-suite/tests/ftw.test: Make our stat hacks verifyable without
	  assuming that they are interpreted.

	* test-suite/tests/r5rs_pitfall.test: Re-indent.

	actually compile start-stack to something useful
	* ice-9/boot-9.scm (start-stack): Define as a defmacro instead of an acro
	  in C. We have a way to delay evaluation of the exp, after all: putting
	  it in a thunk is sufficient.

	* libguile/debug.h:
	* libguile/debug.c (scm_sys_start_stack): Renamed from scm_start_stack,
	  and exposed to the user. Takes a thunk instead of an expression +
	  environment.
	  (scm_m_start_stack): Remove this acro.

	* module/language/scheme/translate.scm (custom-transformer-table): Remove
	  the start-stack special case.

2008-09-25  Ludovic Courtès  <ludo@gnu.org>

	Enclose `regexp.test' in a module.
	* test-suite/tests/regexp.test: Add `define-module' clause.

	Fix handling of the FLAGS argument in `fold-matches'.
	* ice-9/regex.scm (fold-matches): If FLAGS is non-null, use
	  `(car flags)', not `flags'.

	* test-suite/tests/regexp.test ("fold-matches"): New test prefix.

	* NEWS: Update.

2008-09-25  Andy Wingo  <wingo@pobox.com>

	further compilation fixes -- all files compile fine now
	* ice-9/runq.scm (strip-sequence): Remove use of obtuse guile `define'
	  extension.

	* ice-9/boot-9.scm (while): Redefine so as not to unquote in a procedure.
	  Less hygienic. Perhaps we should switch to syncase at some point.

	* ice-9/session.scm (help): Redefine as a normal macro, so that it can be
	  compiled. Not very useful though -- further effort should go into
	  (system repl ...).
	  (system-module): Removed, it didn't work, and is not useful as far as I
	  can tell.

	* ice-9/string-fun.scm (string-prefix-predicate): Remove guile define
	  extension usage. Compilation also fixed by `while' compilation fix.

	* ice-9/threads.scm (par-mapper): Remove guile define extension usage.

	compile `delay' into `make-promise' with a thunk
	* module/language/scheme/translate.scm (custom-transformer-table):
	  Translate `delay' into `make-promise'.

	export `make-promise' to scheme
	* libguile/eval.h:
	* libguile/eval.c (scm_make_promise): Rename from `scm_makprom', and
	  export as the scheme procedure, `make-promise'.

	* libguile/eval.i.c (CEVAL): s/makprom/make_promise/.

	enable compilation of more modules
	* ice-9/Makefile.am: Compile most modules. There are still a couple that
	  fail to compile.

	a number of small compilation fixes
	* ice-9/boot-9.scm: Allow a compiled load of posix, networking, and
	  deprecated files.

	* module/language/scheme/translate.scm (lookup-transformer): Lookup the
	  sc-macro by value, not by name. Works around the fact that compiled
	  macros don't have names, which is probably a bug.

	* module/system/base/compile.scm (syntax-error)
	  (call-with-compile-error-catch): Throw and catch a key that's not used
	  by anyone else. Write error messages to the error port.

	* module/system/repl/repl.scm (default-catch-handler): Call display-error
	  with the correct number of arguments.

	* module/system/vm/frame.scm (frame-program-name): Guard against unbound
	  variables.

	* ice-9/optargs.scm (let-keywords-template): Don't unquote in a helper
	  procedure. A bit irritating. I suppose we should fix the modules +
	  syncase situation at some point, and then switch to syncase.

	compile psyntax-pp
	* ice-9/Makefile.am: Compile psyntax-pp.scm, which is the new name of
	  psyntax.pp.

	* ice-9/syncase.scm: Load the pre-processed source as psyntax-pp so that
	  we load up a .go file if available.

	fix handling of multiple values from c functions
	* libguile/vm-i-system.c (mv-call, goto/cc): Fix handling of values
	  returns from C or interpreted functions.

	add gdbinit for debugging the vm
	* gdbinit: Add my gdbinit. The most useful commands are gwrite and
	  vmstack.

	compile call/cc, yee ha
	* libguile/vm-i-system.c (call, goto/args): Add a FIXME for handling the
	  case in which a call to the interpreter returns a values object.
	  (call/cc, goto/cc): Flesh out, and handle full continuations (with the
	  C stack also).

	* module/language/scheme/translate.scm (custom-transformer-table):
	  Compile call-with-current-continuation. This is necessary so that the
	  called procedure is called in tail position.

	* module/system/il/compile.scm (codegen): Translate apply to goto/apply,
	  call/cc to goto/cc, etc when in tail position.

	fix bug introduced in the fluid commit
	* libguile/vm.c (the-vm): If the dynamic binding of *the-vm* is false,
	  make a new vm. Fixes multiple threads with the vm since the *the-vm*
	  fluid changes.

2008-09-24  Andy Wingo  <wingo@pobox.com>

	make call/cc capture and restore the vm stacks
	* libguile/continuations.c (scm_make_continuation): Capture VM
	  continuations as well, as their stack is outside the C stack.
	  (copy_stack): Reinstate VM stacks with the C stack.

	* libguile/continuations.h (scm_t_contregs): Add a pointer for VM stacks.
	  A binary-incompatible change -- hopefully not too many people were
	  messing around with this struct, though.

	* libguile/vm-engine.c (vm_run): Add a note about possibly maintaining a
	  stack of vms.

	* libguile/vm.c (struct scm_vm_cont): New struct, distinct from scm_vm.
	  (vm_cont_mark, vm_cont_free, capture_vm_cont, reinstate_vm_cont):
	  Reorder some code, and fix some bad assumptions about what part of the
	  stack to copy; obviously this code was never used.

	* libguile/vm.h:
	* libguile/vm.c (scm_vm_capture_continuations)
	  (scm_vm_reinstate_continuations): New public functions, used by
	  continuations.c.

	the vm is a fluid
	* module/system/vm/vm.scm:
	* libguile/vm.h:
	* libguile/vm.c: Make the `the-vm' procedure access a fluid, `*the-vm*'.
	  Export that fluid from vm.h and vm.scm.

2008-09-23  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc

	Make literal strings (i.e., returned by `read') read-only.
	* libguile/read.c (scm_read_string): Use `scm_i_make_read_only_string ()' to
	  return a read-only string, as mandated by R5RS.  Reported by Bill
	  Schottstaedt <bil@ccrma.Stanford.EDU>.

	* libguile/strings.c (scm_i_make_read_only_string): New function.
	  (scm_i_shared_substring_read_only): Special-case the empty string
	  so that the read-only and read-write empty strings are `eq?'.  This
	  optimization is relied on by the `substring/shared' `empty string'
	  test case in `srfi-13.test'.

	* libguile/strings.h (scm_i_make_read_only_string): New declaration.

	* test-suite/tests/strings.test ("string-set!")["literal string"]: New test.

	* NEWS: Update.

	Make `symbol->string' return a read-only string.
	* libguile/strings.c (scm_i_symbol_substring): Return a read-only string
	  since R5RS requires `symbol->string' to return a read-only string.
	  Reported by Bill Schottstaedt <bil@ccrma.Stanford.EDU>.

	* test-suite/tests/symbols.test: Add `define-module' clause.
	  (exception:immutable-string): Adjust to current exception.
	  ("symbol->string")["result is an immutable string"]: Use
	  `pass-if-exception' instead of `expect-fail-exception'.

	* NEWS: Update.

2008-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	Fix for incorrect (gcd -2) => -2; should give 2.
	(reported by Bill Schottstaedt)

	* libguile/numbers.c (scm_gcd): When only one arg given, use scm_abs
	  to ensure that result is non-negative.

	* test-suite/tests/numbers.test ("gcd"): New test, (gcd -2).

2008-09-19  Ludovic Courtès  <ludo@gnu.org>

	Use GC's accessors rather than its global variables.
	* libguile/gc.c (scm_storage_prehistory): Use `GC_set_free_space_divisor ()'
	  instead of accessing the global variable directly.

2008-09-18  Ludovic Courtès  <ludo@gnu.org>

	Fix `strftime' documentation wrt. `%Z'.
	* doc/ref/posix.texi (Time)[strftime]: Remove erroneous note saying
	  that `%Z' ignores `tm:zone'.  Reported by Neil Jerram.

2008-09-18  Andy Wingo  <wingo@pobox.com>

	don't poke installed scm, go, etc files when running pre-inst-guile
	* libguile/load.c (scm_init_load_path): If GUILE_SYSTEM_PATH is set, use
	  that instead of the compiled-in suffix to the load path. And, as a
	  special case, GUILE_SYSTEM_PATH= is interpreted as '(). A bit nasty.

	* pre-inst-guile-env.in (top_builddir): Set GUILE_SYSTEM_PATH to the
	  empty string, if it is not set.

2008-09-18  Ludovic Courtès  <ludo@gnu.org>

	Implement `scm_without_guile ()' in terms of `GC_do_blocking ()'.
	* libguile/threads.c (guilify_self_1): Initialize `t->guile_mode'.
	  (guilify_self_2): Likewise.
	  (struct without_guile_arg): New type.
	  (without_guile_trampoline): New function.
	  (scm_without_guile): Implement in terms of `GC_do_blocking ()'.

	* libguile/threads.h (scm_i_thread)[guile_mode]: New field.

	Remove double inclusion of <config.h> in `threads.c'.

	configure: Look for `GC_do_blocking ()' and its declaration.
	* configure.in: Look for `GC_do_blocking ()' and its declaration.

2008-09-18  Andy Wingo  <wingo@pobox.com>

	lambda-lifting for (lambda () ...) as consumer of call-with-values
	* libguile/vm-engine.c (vm_run): Add new error case,
	  vm_error_not_enough_values.

	* libguile/vm-i-system.c (goto/nargs, call/nargs): So, in these cases, if
	  we get too many values, we don't truncate the values like we do in the
	  single-value continuation case, or in the mvbind case. What to do? I
	  guess we either truncate them here, or only allow the correct number of
	  values. Dunno. Mark the code as a fixme.
	  (truncate-values): New instruction, for mv-bind: checks that the number
	  of values on the stack is compatible with the number of bindings we
	  have arranged for them, truncating if necessary.

	* module/language/scheme/translate.scm (custom-transformer-table):
	  Compile receive as a primary form -- not so much because it is a
	  primary form, but more to test the mv-bind machinery. Also it's more
	  efficient, I think.

	* module/system/il/compile.scm (lift-variables!): New helper, factored
	  out of `optimize'.
	  (optimize): Add a few more cases. Adapt `lambda' optimization, which
	  isn't much. I'm not happy with ghil as a mungeable language.
	  Add a case for call-with-values with the second argument is
	  a lambda: lift the lambda. Untested.
	  (codegen): Refactor the push-bindings! code. Compile mv-bind.

	* module/system/il/ghil.scm (<ghil-mv-bind>): Add mv-bind construct,
	  along with its procedures.

	* module/system/il/glil.scm (<glil-mv-bind>): Add mv-bind construct,
	  different from the high-level one. It makes sense in the source, I
	  think.

	* module/system/vm/assemble.scm (codegen): Assemble glil-mv-bind by
	  pushing onto the bindings list, and actually push some code to truncate
	  the values.

2008-09-18  Ludovic Courtès  <ludo@gnu.org>

	Use the `GC_FREE_SPACE_DIVISOR' environment variable.
	* libguile/gc.c (scm_storage_prehistory): Initialize `GC_free_space_divisor'
	  using the `GC_FREE_SPACE_DIVISOR' environment variable.

	Fix first-time compilation
	Hello!

	The attached patch fixes first-time compilation, by ensuring SRFI
	modules are built before "guile-tools compile" is ever run.

	Thanks,
	Ludo'.

	From 691a111c440a26c021f52b4027b0d9772f8e04cc Mon Sep 17 00:00:00 2001
	From: =?utf-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
	Date: Tue, 16 Sep 2008 23:13:38 +0200
	Subject: [PATCH] Fix compilation order of the sub-directories.

	* Makefile.am (SUBDIRS): Move `ice-9' past `srfi' and friends, so that
	  the SRFI modules needed by the compiler are built before "guile-tools
	  compile" is used.

2008-09-18  Andy Wingo  <wingo@pobox.com>

	fix case in which we can fail to exit the repl cleanly
	* module/system/repl/repl.scm (next-char): Don't throw if we get an EOF,
	  just return the EOF object. Fixes a case in which we fail to exit
	  cleanly.

2008-09-18  Ludovic Courtès  <ludo@gnu.org>

	Remove per-thread `gc_running_p'.
	* libguile/gc.c (scm_gc): Don't use `scm_gc_running_p' as
	  an lvalue.

	* libguile/gc.h (scm_gc_running_p): Define to 0.

	* libguile/threads.h (scm_i_thread)[gc_running_p]: Remove.

2008-09-17  Ludovic Courtès  <ludo@gnu.org>

	Remove GC-related fields from `scm_i_thread'.
	* libguile/gc.h (scm_i_freelist, scm_i_freelist2): Remove declarations.

	* libguile/threads.c (resume): Don't use `t->clear_freelists_p' and
	  `scm_i_freelist{,2}'.
	  (scm_enter_guile, scm_leave_guile, guilify_self_1): Don't use
	  the `heap_mutex' and other fields removed from `scm_i_thread'.
	  (scm_i_freelist, scm_i_freelist2): Remove.

	* libguile/threads.h (scm_i_thread)[heap_mutex, freelist, freelist2,
	  clear_freelists_p]: Remove.

	Remove code intended to put threads to sleep.
	Actually, threads would "go to sleep" either by blocking on a heap
	allocation, or by noticing `scm_i_thread_go_to_sleep' is set when
	running `SCM_TICK', which limits the applicability of this technique
	(e.g., it was not appropriate for the shared string code).

	* libguile/threads.c (scm_i_thread_go_to_sleep, scm_i_thread_put_to_sleep,
	  scm_i_thread_invalidate_freelists, scm_i_thread_wake_up,
	  scm_i_thread_sleep_for_gc): Remove.

	* libguile/threads.h (scm_i_thread_go_to_sleep, scm_i_thread_put_to_sleep,
	  scm_i_thread_invalidate_freelists, scm_i_thread_wake_up,
	  scm_i_thread_sleep_for_gc): Remove declarations.
	  (SCM_THREAD_SWITCHING_CODE): Do nothing.

	Remove use of `scm_i_thread_put_to_sleep ()' in the string code.
	* libguile/strings.c (scm_i_string_writable_chars): Remove use of
	  `scm_i_thread_put_to_sleep ()'.  This leaves a race condition,
	  which is hopefully not harmful.

	Remove GC-related code from fluids.
	* libguile/fluids.c (all_dynamic_states, all_fluids): Remove.  Together,
	  they prevented dynamic states and fluids to be collected.  Callers no
	  longer use them.
	  (resize_all_states): Remove.
	  (grow_dynamic_state): New function.
	  (next_fluid_num): Don't call `resize_all_states ()'.
	  (scm_i_fluid_num, scm_i_fast_fluid_ref, scm_i_fast_fluid_set_x): Remove,
	  as they broke encapsulation and would have needed duplication of the lazy
	  dynamic state growing code.
	  (scm_fluid_ref, scm_fluid_set_x): Lazily grow the dynamic state's fluid
	  vector.
	  (scm_fluids_prehistory): Don't set an `scm_after_sweep_c_hook'.

	* libguile/fluids.h (SCM_FLUID_NUM, SCM_FAST_FLUID_REF, SCM_FAST_FLUID_SET_X,
	  scm_i_fluid_num, scm_i_fast_fluid_set_x, scm_i_fast_fluid_ref): Remove.

	* libguile/load.c (the_reader_fluid_num): Remove.
	  (scm_primitive_load): Use `scm_fluid_ref ()' instead of
	  `SCM_FAST_FLUID_REF ()'.
	  (scm_init_load): Likewise.

2008-09-16  Ludovic Courtès  <ludo@gnu.org>

	Use immutable cells for vectors.
	* libguile/vectors.c (scm_c_make_vector): Use `scm_immutable_cell ()'.

	Use immutable double-cells for symbols.
	* libguile/strings.c (scm_i_make_symbol): Use `scm_immutable_double_cell ()'.

	Add `scm_immutable_double_cell ()'.
	* libguile/inline.h (scm_immutable_double_cell): New.

2008-09-16  Andy Wingo  <wingo@pobox.com>

	compile call-with-values, woot!
	* libguile/vm-engine.c (vm_run): Add another byte onto the bootstrap
	  program, as the offset passed to mv-call now takes two bytes.

	* module/system/vm/frame.scm (bootstrap-frame?): Update for the new
	  bootstrap length. Really we should just check for 'halt though.

	* libguile/vm-i-system.c (FETCH_OFFSET): New helper, used in BR().
	  (goto/nargs, call/nargs): Versions of goto/args and call, respectively,
	  that take the number of arguments from a value on the top of the stack.
	  (mv-call): Call FETCH_OFFSET to get the offset.

	* module/language/scheme/translate.scm (custom-transformer-table):
	  Compile call-with-values to <ghil-mv-call>. There is some trickery
	  because of the r4rs.scm call-with-values trampolines.

	* module/system/il/ghil.scm: Add <ghil-mv-call> and accessors.

	* module/system/il/compile.scm (codegen): Compile <ghil-mv-call>.

	* module/system/il/glil.scm: Add <glil-mv-call>, which needs some special
	  assembly because of the label. Fix some typos.

	* module/system/vm/assemble.scm (byte-length): New helper, factored out
	  and made more general.
	  (codegen): Assemble mv-call, including the label.
	  (check-length): New helper, makes sure that the addressing is
	  consistent within the produced object code.
	  (stack->bytes): Rewrite to be more generic -- now `br' instructions
	  aren't the only ones jumping around in the instruction stream.

	* module/system/vm/conv.scm (make-byte-decoder): Return two values in the
	  #f case.

	* module/system/vm/disasm.scm (disassemble-bytecode): Rewrite, because
	  the previous implementation depended on a guile interpreter quirk:
	  namely, that multiple values could be represented within one value, and
	  destructured later.

2008-09-15  Ludovic Courtès  <ludo@gnu.org>

	Use immutable cells for closures.
	* libguile/eval.c (scm_closure): Use `scm_immutable_cell ()' instead
	  of `scm_cell ()'.

	* libguile/procs.h (SCM_SETCODE, SCM_SETENV): Remove.

	Use immutable cells (aka. libgc "stubborn") for subrs.
	* libguile/procs.c (scm_c_make_subr): Use `scm_immutable_cell ()' instead
	  of `scm_cell ()'.
	  (scm_free_subr_entry): Remove.

	* libguile/procs.h (SCM_SET_SUBRNUM, SCM_SET_SUBRF): Remove.
	  (scm_free_subr_entry): Remove declaration.

	Add `scm_immutable_cell ()'.
	* libguile/inline.h (scm_immutable_cell): New.

	Remove unused GC string/symbol functions.
	* libguile/strings.c (scm_i_stringbuf_mark, scm_i_stringbuf_free,
	  scm_i_string_mark, scm_i_string_free, scm_i_symbol_mark,
	  scm_i_symbol_free): Remove.

	* libguile/strings.h: Remove corresponding declarations.

	Conditionalize GC 6.x code.
	* libguile/gc.c (scm_storage_prehistory): Have `GC_init ()' called only
	  with GC 6.x (it doesn't hurt with 7.x, though).

2008-09-15  Neil Jerram  <neil@ossau.uklinux.net>

	Make multi-byte reads on unbuffered ports more efficient.
	Idea and original patch were by Ludovic Courts, this is Neil Jerram's
	reworking of it.

		* libguile/srfi-4.c (scm_uniform_vector_read_x): Use scm_c_read,
		instead of equivalent code here.

		* libguile/ports.c (scm_fill_input): Add assertion that read
		buffer is empty when called.
		(port_and_swap_buffer, swap_buffer): New, for...
		(scm_c_read): Use caller's buffer for reading, to avoid making N
		1-byte low-level read calls, in the case where the port is
		unbuffered (or has a very small buffer).

2008-09-15  Ludovic Courtès  <ludo@gnu.org>

	Add `uniform-vector-read!' benchmark.

2008-09-15  Andy Wingo  <wingo@pobox.com>

	add special case for (apply values ...)
	* libguile/vm-engine.c (vm_run): Move nvalues to the top level, to avoid
	  (spurious, it seems) gcc warnings about it being used uninitialized.

	* libguile/vm-i-system.c (halt, return/values): Adapt to gcc silliness.
	  Deindent some of return/values.
	  (return/values*): New instruction, does what (apply values . args)
	  would do.

	* module/language/scheme/translate.scm (custom-transformer-table): Move
	  the apply and @apply cases here from inline.scm, because we need some
	  more cleverness when dealing with cases like (apply values . args).
	  (lookup-apply-transformer): Define an eval transformer for `values',
	  turning it into ghil-values*.

	* module/system/il/compile.scm (codegen): Compile <ghil-values*> into
	  return/values*.

	* module/system/il/ghil.scm: Add <ghil-values*> and accessors.
	  (ghil-lookup): Add optional argument, define?, which if false tells us
	  not to actually cache the binding if it is not found in the toplevel.

	* module/system/il/inline.scm: Remove apply clauses.

	* module/system/vm/frame.scm (bootstrap-frame?): Update heuristic for
	  bootstrap-frame?, as the bootstrap frame is now 5 bytes since it
	  accepts multiple values.

2008-09-14  Ludovic Courtès  <ludo@gnu.org>

	Fix detection of the GC version.
	* libguile/boehm-gc.h: Don't expect `GC_VERSION_MAJOR' to be defined,
	  as it's defined only since 7.x.

2008-09-14  Andy Wingo  <wingo@pobox.com>

	add multiple values support to the vm
	* libguile/vm-engine.c (vm_run): The bootstrap program now uses mv_call,
	  so as to allow multiple values out of the VM. (It did before, because
	  multiple values were represented internally as single scm_values
	  objects, but now that values go on the stack, we need to note the boot
	  frame as accepting multiple values.)
	  (vm_error_no_values): New error, happens if you pass no values into a
	  single-value continuation. Passing more than one is OK though, it just
	  takes the first one.

	* libguile/vm-i-system.c (halt): Assume that someone has pushed the
	  number of values onto the stack, and package up that number of values
	  as a scm_values() object, for communication with the interpreter.
	  (mv-call): New instruction, calls a procedure with a multiple-value
	  continuation, even handling calls out to the interpreter.
	  (return/values): New instruction, returns multiple values to the
	  continuation. If the continuation is single-valued, takes the first
	  value or errors if there are no values. Otherwise it returns to the
	  multiple-value return address, pushing the number of values on top of
	  the values.

	* module/system/il/compile.scm (codegen): Compile <ghil-values> forms.

	* module/system/il/ghil.scm (<ghil-values>) Add new GHIL data structure
	  and associated procedures.

	* module/language/scheme/translate.scm (custom-transformer-table):
	  Compile (values .. ) forms into <ghil-values>.

	look up scheme translators by value, not by name
	* module/language/scheme/translate.scm (custom-transformer-table): Rename
	  from `primitive-syntax-table', because now it will handle procedural
	  values as well.
	  (lookup-transformer): Update for renaming. Look up custom transformers
	  by value, not name.
	  (make-pmatch-transformers): Key the transformer table by value, not
	  name.

2008-09-13  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		lib/Makefile.am
		libguile/gc-card.c
		libguile/gc-freelist.c
		libguile/gc-mark.c
		libguile/gc-segment.c
		libguile/gc.c
		libguile/gc.h
		libguile/gc_os_dep.c
		libguile/private-gc.h
		m4/.cvsignore
		m4/gnulib-cache.m4
		m4/gnulib-comp.m4

	Include <config.h> in standalone tests.
	* test-suite/standalone/Makefile.am (test_cflags): Add `-I$(top_builddir)' so
	  that <config.h> can be found.
	  (snarfcppopts): Likewise.

	* test-suite/standalone/*.c: Include <config.h>.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	rename tail-call to goto/args, add some more tail instructions
	* libguile/vm-i-system.c (call): Rename continuation invocation from
	  `vm_call_cc' to `vm_call_continuation', because that's what it really
	  does. Add a note that it doesn't handle multiple values at the moment.
	  (goto/arg): Renamed from tail-call, in deference to the progenitors, on
	  Dale Smith's suggestion.
	  (goto/apply): New instruction, for `apply' in a tail context. Not yet
	  used, or vetted for that matter.
	  (call/cc): No need to pop the program, I don't think; although this
	  isn't tested either.
	  (goto/cc): New instruction, for call/cc in a tail context.

	* module/language/scheme/translate.scm (*forbidden-primitives*): Rename
	  from %forbidden-primitives.

	* module/system/il/compile.scm (codegen): Adapt to goto/args instead of
	  tail-call.

	* module/system/il/inline.scm: Start inlining some macros used in
	  r4rs.scm -- not yet fully tested.

	* ice-9/boot-9.scm: Allow load of a compiled r4rs file.

	add a multiple values return address to stack frames
	* libguile/frames.c (frame-mv-return-address): New accessor.

	* libguile/frames.h: Update frame diagram.
	  (SCM_FRAME_UPPER_ADDRESS): Update for data area
	  growing by one pointer.
	  (SCM_FRAME_MV_RETURN_ADDRESS): New macro.

	* libguile/vm-engine.h (NEW_FRAME): Update for frame getting bigger by a
	  pointer. In a normal NEW_FRAME, set the MV return address to NULL, to
	  indicate that this continuation does not accept multiple values.

	* libguile/vm-i-system.c (tail-call): Update frame replacement code to
	  understand the MV return address.
	  (return): Make room for the MVRA.

	inline frame replacement in tail-call
	* libguile/programs.c (program_print): Only try to lookup write-program
	  if the module system is booted.

	* libguile/vm-engine.h (FREE_FRAME): Remove, it's now inlined everywhere.

	* libguile/vm-i-system.c (tail-call): Inline FREE_FRAME, and implement
	  the calling bits here. Will make things more hackable.

2008-09-13  Ludovic Courtès  <ludo@gnu.org>

	Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	inline FREE_FRAME in halt
	* libguile/vm-i-system.c (halt): Inline FREE_FRAME, specialized for the
	  halt case.

	inline FREE_FRAME in return, sync stack_base in CACHE_REGISTER
	* libguile/vm-engine.h (CACHE_REGISTER): Sync stack_base too.

	* libguile/vm-i-system.c (return): Inline FREE_FRAME here,
	  micro-optimizing a wee bit. Sounds silly, but it's to enable some
	  refactoring.

	clean up NEW_FRAME macro
	* libguile/vm-engine.h (NEW_FRAME): Clean up this macro.

	readability improvement in vm-i-scheme
	* libguile/vm-engine.h:
	* libguile/vm-i-scheme.c: Move some helper macros closer to their use
	  sites.

	tweaks for printing programs
	* module/system/vm/program.scm (program-bindings-as-lambda-list): Handle
	  the bindings-is-null case too -- not sure how it comes about, though. A
	  thunk with no let, perhaps.
	  (write-program): Another default for the name: the source location at
	  which it was defined.

	* libguile/programs.c (program_print): Add some "logic" to stop doing
	  detailed prints if one print had a nonlocal exit -- preventing
	  exceptions in backtraces.

	programs can now get at their names, and print nicely
	* module/system/vm/frame.scm (frame-call-representation)
	  (frame-program-name): Rename program-name to frame-program-name, and
	  use the program-name if it is available.

	* module/system/vm/program.scm (program-bindings): Return #f if there are
	  no bindings.
	  (program-name): New public procedure.
	  (program-bindings-as-lambda-list, write-program): A more useful writer
	  for programs.

	* libguile/programs.c (scm_bootstrap_programs, program_print): Add a smob
	  printer for programs, which dispatches to `write-program'.

	(define (foo ...) ...) actually gives the lambda a name
	* module/language/scheme/translate.scm (primitive-syntax-table): In forms
	  like (define x y) where y is a lambda, and the lambda has no name yet,
	  set the lambda's name in its metadata.

	fix confusion in disassemble-bindings
	* module/system/vm/disasm.scm (disassemble-bindings): Fix external/local
	  confusion when printing args and locals.

	fix *another* bug in compiling `or'. incredible.
	* module/system/il/compile.scm (codegen): Fix *another* bug in compiling
	  `or' -- in the case in which the value was being discarded, as in `or'
	  used as a control structure, we were sometimes leaving a value on the
	  stack.

	* testsuite/t-or.scm: Add another test case for `or'.

2008-09-12  Andy Wingo  <wingo@pobox.com>

	untabify process-define-module
	* ice-9/boot-9.scm (process-define-module): Untabify.

	correctly disassemble program bindings (arguments, locals, externals)
	* module/system/vm/disasm.scm (disassemble-bindings): New function,
	  properly disassembles the bindings data. Neat!

2008-09-11  Ludovic Courtès  <ludo@gnu.org>

	Revert "Use Gnulib's `count-one-bits' module."
	We don't need it in this branch.

	This reverts commit d7014610b16cd5f273479e70db253bff2f0124fc.

	Adjust to be usable with `libgc' 7.1.
	* libguile/boehm-gc.h: Only include <gc/gc_local_alloc.h> with
	  `libgc' 6.x.  Define `GC_PTR' for `libgc' 7.x+.

	Fix bug in port eviction code
	* libguile/fports.c (scm_i_evict_port): Check whether PORT has a
	  ptab entry associated with it.  It's unclear when this can happen.

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Fix broken hash-table merge.
	* libguile/hashtab.c (scm_hash_fn_create_handle_x): Return IT only when
	  it satisfies `scm_is_pair ()'.

	Fix broken GC and threads merge.
	* libguile/private-gc.h (scm_i_tag_name): New declaration.

	* libguile/threads.c: Include <config.h>.

	Fix broken port merge.
	* libguile/ports.c (finalize_port): Don't call `scm_remove_from_port_table ()'.
	  (scm_flush): Don't refer to `scm_i_port_table_size'.
	  (scm_ports_prehistory): Don't allocate `scm_i_port_table'.

	* libguile/ports.h (scm_i_port_table_room): Remove declaration.

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/Makefile.am
		libguile/coop-defs.h
		libguile/gc-card.c
		libguile/gc-freelist.c
		libguile/gc-malloc.c
		libguile/gc-mark.c
		libguile/gc-segment.c
		libguile/gc.c
		libguile/gc.h
		libguile/gc_os_dep.c
		libguile/hashtab.c
		libguile/hashtab.h
		libguile/inline.h
		libguile/private-gc.h
		libguile/struct.c
		libguile/struct.h
		libguile/threads.c
		libguile/threads.h
		libguile/vectors.h
		libguile/weaks.h
		test-suite/tests/gc.test

2008-09-10  Ludovic Courtes  <ludo@gnu.org>

	Document the failure of `gc.test' wrt. unused modules.
	* test-suite/tests/gc.test (Unused modules are removed): Use guardians
	  instead of `gc-live-object-stats'.  Explain failure (FIXME).

	* ice-9/boot-9.scm (make-module): Add `FIXME' about circular reference.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-9

	Add comment about `GC_local_malloc ()' upon thread destruction.
	* libguile/threads.c (on_thread_exit): Add caveat about possible
	  segfault.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-8

	Remove `scm_get_stack_base ()'.
	* libguile/threads.c: Replace `scm_get_stack_base ()' by
	  `GC_stackbottom'.

	* libguile/gc.h (scm_get_stack_base): Remove declaration.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-7

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Merge commit '2e77f7202b11ad0003831fcff94ec7db80cca015' into boehm-demers-weiser-gc
	Conflicts:
		libguile/threads.c

	Merge commit '29776e85da637ec4d44b2b2822d6934a50c0084b' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc-card.c
		libguile/gc.c
		libguile/gc.h
		libguile/ports.c

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed warnings due to unused stuff.
	* libguile/gc.c (scm_cells_allocated, scm_last_cells_allocated,
	  scm_gc_cells_collected, scm_gc_cells_collected_1,
	  scm_gc_malloc_collected, scm_gc_time_taken, t_before_gc,
	  scm_gc_mark_time_taken, scm_gc_times, scm_gc_cells_swept,
	  scm_gc_cells_marked_acc, scm_gc_cells_swept_acc,
	  scm_gc_cell_yield_percentage, scm_gc_malloc_yield_percentage):
	  Removed.

	* libguile/gc.h: Updated accordingly.

	* libguile/gdbint.c (port_mark_p, stream_mark_p, string_mark_p,
	  unmark_port, remark_port): Removed.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-4

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Merge commit '7337d56d5714227865aeca2b40b6bd97cce296d2' into boehm-demers-weiser-gc
	Conflicts:
		libguile/struct.c

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	scm_gc_malloc: Handle zero-octet allocations.
	* libguile/gc-malloc.c (scm_gc_malloc): Pass a non-zero size to
	  `GC_MALLOC ()' when SIZE is zero.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-2

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Merge commit '032913739218c756f673bfb9c8f66ef9f8f02330' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc.c
		libguile/srcprop.c
		libguile/srcprop.h

2008-09-10  Ludovic Court`es  <ludovic.courtes@laas.fr>

	Reverted inappropriate merge in `gc.c'.
	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-53

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Merge commit 'f30e1bdf97ae8b2b2918da585f887a4d3a23a347' into boehm-demers-weiser-gc
	Conflicts:
		libguile/Makefile.am
		libguile/coop-pthreads.c
		libguile/gc-freelist.c
		libguile/gc-segment.c
		libguile/gc.c
		libguile/private-gc.h
		test-suite/tests/environments.nottest

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Use thread-local allocation (significant perf. improvement!); added the `boehm-gc.h' header.
	* libguile/Makefile.am (modinclude_HEADERS): Added `boehm-gc.h'.

	* libguile/coop-defs.h: Use "libguile/boehm-gc.h" instead of <gc/gc.h>.

	* libguile/coop-threads.h: Likewise.

	* libguile/coop.c: Likewise.

	* libguile/gc.c: Likewise.
	  (scm_storage_prehistory): Invoke `GC_init ()'.

	* libguile/guardians.c: Use "libguile/boehm-gc.h" instead of <gc/gc.h>.

	* libguile/inline.h: Likewise.
	  (scm_double_cell): Use `GC_MALLOC' instead of `GC_malloc'.

	* libguile/pthread-threads.h: Use "libguile/boehm-gc.h" instead of
	  <gc/gc.h>.

	* libguile/smob.c: Likewise.

	* libguile/smob.h: Likewise.

	* libguile/struct.c: Likewise.

	* libguile/threads.c: Likewise.

	* libguile/weaks.c: Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-51

	Removed `scm_gc_registered_roots' and `scm_permobjs'.
	* libguile/gc.c (scm_permanent_object): Use `scm_gc_protect_object ()'.
	  (scm_gc_register_root): Do nothing.
	  (scm_init_storage): Removed initialization of `scm_permobjs' and
	  `scm_gc_register_roots'.

	* libguile/root.h (scm_permobjs): Removed.
	  (scm_gc_registered_roots): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-50

	Expand heap size at startup time.
	* libguile/gc.c (scm_storage_prehistory): Invoke `GC_expand_hp ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-49

	Turn "all interior pointers" off (slight performance gain).
	* libguile/gc.c (scm_storage_prehistory): Set `GC_all_interior_pointers'
	  to 0.  Register `scm_tc3_cons' and `scm_tc3_closure' as valid
	  displacements.

	* libguile/struct.c (scm_alloc_struct): Register additional
	  displacements.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-48

	Implemented `gc-stats' using `libgc' information.
	* libguile/gc.c (protected_obj_count): Made `static'.
	  (scm_heap_size): Mapped to `heap-size' rather than `cell-heap-size'.
	  (scm_heap_free_size): New.
	  (scm_heap_total_allocated): New.
	  (scm_gc_stats): Rewritten.  Return the (little) information available
	  from `libgc'.
	  (scm_gc_disable): New.
	  (scm_gc_enable): New.
	  (scm_storage_prehistory): Don't call `GC_add_roots ()' with
	  SCM_SYS_PROTECTS.  Use `GC_is_visible ()' to check whether
	  SCM_SYS_PROTECTS is visible.

	* libguile/gc.h (scm_gc_enable): New declaration.
	  (scm_gc_disable): New declaration.
	  (scm_gc_for_alloc): Removed.
	  (scm_gc_for_newcell): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-46

	Have source properties only use regular GC mechanisms.
	* libguile/srcprop.c: Include "libguile/gc.h".
	  (srcprops_chunklist): Removed.
	  (srcprops_freelist): Removed.
	  (srcprops_free): Removed.
	  (scm_make_srcprops): Use `scm_gc_malloc ()' rather than
	  SRCPROPS_FREELIST et al.
	  (scm_init_srcprop): Don't call `scm_set_smob_free ()'.
	  (scm_finish_srcprop): Do nothing.

	* libguile/srcprop.h (SRCPROPS_CHUNKSIZE): Removed.
	  (scm_t_srcprops_chunk): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-45

	Fixed symbols so that interned symbols are only weakly referenced.
	* libguile/symbols.c (lookup_interned_symbol): When a deleted weak pair
	  is encountered, remove it and update the hashtable's item count.  Also,
	  check the hash table threshold and trigger a rehashing if needed.
	  (scm_i_c_mem2symbol): Allocate CELL using `scm_weak_car_pair ()' rather
	  than `scm_cons ()'.
	  (scm_i_mem2symbol): Likewise.
	  (scm_symbols_prehistory): Don't invoke `scm_permanent_object ()' for
	  SYMBOLS.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-44

	Re-fixed the hash table element counting in `scm_i_rehash ()'.
	* libguile/hashtab.c (scm_i_rehash): Don't invoke
	  `SCM_HASHTABLE_DECREMENT ()' when a weak pair is encountered in the
	  source bucket.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-43

	Fixed `guardians.test' so that it does not use symbols.
	* test-suite/tests/guardians.test: Use strings instead of symbols for
	  `g3-garbage' et al.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-42

	Allow guardians to be GC'd before the objects they guard.
	* libguile/guardians.c (finalize_guarded): While traversing
	  GUARDIANS_LIST, check for deleted weak-car pairs.
	  (scm_i_guard): Instantiate GUARDIANS_FOR_OBJ using `scm_weak_car_pair ()'
	  rather than `scm_cons ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-41

	Minor weak hashtables fixes.
	* libguile/hashtab.c (scm_fixup_weak_alist): Cosmetic change.
	  (scm_i_rehash): Call `SCM_HASHTABLE_DECREMENT ()' when a deleted weak
	  pair is encountered.
	  (scm_internal_hash_fold): Call `SCM_HASHTABLE_DECREMENT ()' instead of
	  a complicated `SCM_SET_HASHTABLE_N_ITEMS ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-40

	Moved weak pair code into `weaks.[ch]'.
	* libguile/hashtab.c: Don't include <gc/gc_typed.h> and <gc/gc.h>.
	  Updated users of weak
	  (wcar_cell_descr): Removed.
	  (wcdr_cell_descr): Removed.
	  (scm_weak_car_cell): Removed.
	  (scm_weak_cdr_cell): Removed.
	  (scm_doubly_weak_cell): Removed.
	  (SCM_WEAK_CELL_*_DELETED_P): Removed.
	  (SCM_WEAK_CELL_WORD): Removed.
	  (SCM_WEAK_CELL_C[AD]R): Removed.
	  (scm_hashtab_prehistory): Don't initialize weak pairs.

	* libguile/init.c (scm_i_init_guile): Invoke `scm_weaks_prehistory ()'
	  before `scm_hashtab_prehistory ()' in order to initialize weak pairs.

	* libguile/weaks.c: Include <gc/gc.h> and <gc/gc_typed.h>.
	  (wc[ad]r_cell_descr): New.
	  (scm_weak_c[ad]r_pair): New.
	  (scm_doubly_weak_pair): New.
	  (scm_weaks_prehistory): New.

	* libguile/weaks.h (scm_weak_c[ad]r_pair): New declaration.
	  (scm_doubly_weak_pair): New declaration.
	  (SCM_WEAK_PAIR_WORD_DELETED_P): New.
	  (SCM_WEAK_PAIR_CAR_DELETED_P): New.
	  (SCM_WEAK_PAIR_CDR_DELETED_P): New.
	  (SCM_WEAK_PAIR_DELETED_P): New.
	  (SCM_WEAK_PAIR_WORD): New.
	  (SCM_WEAK_PAIR_CAR): New.
	  (SCM_WEAK_PAIR_CDR): New.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-39

	Implemented rehashing of weak hash tables.
	* libguile/hashtab.c (weak_hashtables): Removed.
	  (SCM_WEAK_CELL_DELETED_P): New macro.
	  (START_WEAK_BUCKET_FIXUP): Added the HASHFN argument.  Invoke
	  `scm_i_rehash ()' when pairs have been removed.
	  (END_WEAK_BUCKET_FIXUP): Added the HASHFN argument.
	  (make_hash_table): Use `SCM_NEWSMOB2 ()' instead of `SCM_NEWSMOB3 ()'
	  -- last argument used to be WEAK_HASHTABLES.
	  (scm_i_rehash): Handle weak hash tables.
	  (to_rehash): Removed.
	  (scm_internal_hash_fold): Use `SCM_WEAK_CELL_DELETED_P ()' rather than
	  hand-written equivalent code.
	  (rehash_after_gc): Removed.
	  (scm_hashtab_prehistory): Don't add it as an after-gc hook.

	* libguile/hashtab.h (SCM_HASHTABLE_NEXT): Removed.
	  (SCM_HASHTABLE_NEXTLOC): Removed.
	  (SCM_SET_HASHTABLE_NEXT): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-38

	Implemented port finalization.
	* libguile/ports.c (register_finalizer_for_port): New.
	  (finalize_port): New.
	  (scm_new_port_table_entry): Call `register_finalizer_for_port ()'
	  before returning the new port.
	  (scm_ports_prehistory): Use `scm_gc_malloc_pointerless ()' instead of
	  `scm_gc_malloc ()' when allocating room for SCM_I_PORT_TABLE.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-37

	Use `scm_gc_malloc_pointerless' in various places (improves performance).
	* libguile/fports.c (scm_fport_buffer_add): Use
	  `scm_gc_malloc_pointerless ()' instead of `scm_gc_malloc ()' when
	  allocating room for the read/write buffers.

	* libguile/numbers.c (scm_c_make_rectangular): Likewise.

	* libguile/ports.c (scm_ungetc): Likewise.

	* libguile/random.c (scm_i_copy_rstate): Likewise.
	  (scm_c_make_rstate): Likewise.

	* libguile/regex-posix.c (scm_make_regexp): Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-36

	Removed the now-useless `scm_struct_free_*' functions.
	* libguile/struct.c (scm_alloc_struct): Set the `scm_struct_i_free'
	  element to 0 instead of `scm_struct_free_standard'.
	  (scm_struct_free_0): Removed.
	  (scm_struct_free_light): Removed.
	  (scm_struct_free_standard): Removed.
	  (scm_struct_free_entity): Removed.

	* libguile/struct.h (scm_struct_free_0): Removed.
	  (scm_struct_free_light): Removed.
	  (scm_struct_free_standard): Removed.
	  (scm_struct_free_entity): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-35

	Removed unnecessary uses of class destructors.
	* libguile/goops.c (scm_sys_inherit_magic_x): Don't invoke
	  `SCM_SET_CLASS_DESTRUCTOR' for legacy destructors that are no longer
	  needed (e.g., `scm_struct_free_entity ()', etc.).

	* libguile/objects.c (scm_init_objects): Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-34

2008-09-09  Andy Wingo  <wingo@pobox.com>

	really newline on eof
	* module/system/repl/repl.scm (next-char): Another newline-on-eof case.

	fix program disassembly for meta-in-a-thunk
	* module/system/vm/disasm.scm (disassemble-program): Fix for recent
	  meta-in-a-thunk change.

	run the vm repl instead of the scm-style-repl
	* ice-9/boot-9.scm (@, @@): Note that these don't work with the compiler.
	  Damn.
	  (top-repl): Run the VM repl. Whooo!

	* module/system/repl/repl.scm (start-repl): Catch 'quit, as the
	  scm-style-repl does. Newline after input EOF's, so that we don't leave
	  the user's shell messed up.

	add repl option to interpret rather than compile
	* module/language/scheme/spec.scm (scheme): Specify an evaluator, `eval'.

	* module/system/repl/common.scm (repl-default-options): Add option,
	  `interp', specifying that, if possible, the repl should interpret its
	  expressions rather than compile them. Defaults to #f.

	rework late binding resolution to be simpler and more efficient
	* libguile/programs.h (struct scm_program):
	* libguile/programs.c (scm_c_make_program): Record the current module
	  when making a program. This replaces the per-late binding recorded
	  module in the generated code, which should be more efficient, both in
	  terms of garbage, and in not calling resolve-module.
	  (program-module): New accessor.

	* module/system/vm/program.scm: Add program-module to exports.

	* libguile/vm-i-loader.c (link-later): Remove this instruction, since now
	  the entry in the object table is just a symbol, and can be loaded with
	  load-symbol.

	* libguile/vm-i-system.c (late-variable-ref, late-variable-set): Rework
	  so as to look up in the module of the current program. The logic could
	  be condensed quite a bit if scm_module_lookup () knew what to do with
	  mod==#f.

	* module/system/vm/assemble.scm (dump-object!): Dump <vlink-later> just
	  as load-symbol, as mentioned in the note on link-later.

	* module/system/il/ghil.scm: Update comment to reflect the new reality.

	final de-:prefixification
	* scripts/compile: Don't (read-set! keywords 'prefix) here either.

	use #:keywords in module/*.scm, not :keywords
	* module/system/base/syntax.scm (keywords): Don't enable :keywords, it
	  breaks code that may assume that ':foo is a symbol, like boot-9.

	* module/*.scm: Don't use :keywords, use #:keywords. The user can decide
	  if she wants #:keywords in their .guile, and :keywords might make us
	  compile modules differently.

2008-09-08  Andy Wingo  <wingo@pobox.com>

	lazily load meta info, for less consage
	* module/system/vm/assemble.scm (make-meta, codegen): Hide the "meta"
	  information -- the names of the bindings, source info, procedure
	  properties, etc -- behind a lambda. This way, loading up a program
	  conses less, because the metadata stays as mmap'd code until it is
	  needed.

	* libguile/vm-i-loader.c (load-program): Adjust load-program to expect
	  the metadata to be a program.

	* module/system/vm/program.scm (program-bindings, program-sources)
	  (program-properties): Adjust to new meta format.

2008-09-07  Andy Wingo  <wingo@pobox.com>

	compile boot-9. woop!
	* ice-9/Makefile.am (SOURCES, NOCOMP_SOURCES): Compile boot-9.scm.
	  Wooooo! This makes some things harder to debug, and program loading
	  needs to cons much less, but I think it makes sense to compile boot-9
	  by default if for no other reason than to catch bugs earlier.

	macro-transformer recognizes compiled macros
	* libguile/macros.c (macro-transformer): Recognize compiled as well as
	  interpreted transformer procedures.

	print compiled macros correctly
	* libguile/macros.c (macro_print): Print macros whose code is a program
	  as non-primitive. (Already, primitive-macro? would return #f.)

	allow boot-9.go load if available
	* libguile/init.c (scm_load_startup_files): Don't specify the .scm
	  suffix, so as to allow loading a boot-9.go if appropriate.

	remove define-syntax-macro from boot-9.scm
	* ice-9/boot-9.scm (defmacro:syntax-transformer, define-syntax-macro):
	  Removed these, as I could not see anywhere they were being used, and
	  they use the unnecessary procedure->syntax procedure.

	take procedure->memoizing-macro off of probation
	* module/language/scheme/translate.scm (%forbidden-primitives): Take
	  procedure->memoizing-macro off probation; although it's not a good
	  idea, there is a fair amount of existing code that uses it that can be
	  compiled fine. So allow it in that case.

	make thunk? understand programs
	* libguile/procs.c (thunk?): Return #t for thunk programs.

	reorder module system boot time
	* ice-9/boot-9.scm: Postpone module system boot until (%app modules) is
	  defined, so that resolve-module will work. This might not actually be
	  necessary given the previous tomfoolery in resolve-module, but it
	  doesn't seem like a bad change.

	module-variable accesses pre-module-obarray if module is #f
	* libguile/modules.c (module-variable): If module is #f, access the
	  pre-modules-array. This is so that nested-ref can work before the
	  module system is booted, I think.

	  Of course all of these dependency lines during bootstrap are just to
	  make sure the system can be booted properly, either interpreted or
	  compiled, so there's no one right way: there are many ways that could
	  work.

	prevent (resolve-module '(guile)) recursion
	* ice-9/boot-9.scm (resolve-module): Change so that resolving '(guile)
	  does not require any module lookups. This is so that while within a
	  call to (resolve-module '(guile)), we don't recurse when looking up the
	  location for e.g. `append'. I can imagine other ways to get around
	  this, but this one seems OK.

	make late-variable-{ref,set} work before module system boot
	* libguile/vm-i-system.c (late-variable-ref, late-variable-set): If the
	  module system isn't booted, do a simple scm_lookup. In the -ref case,
	  actually cache the variable location (doh!).

	better diagnostics on quasiquote errors
	* module/system/il/compile.scm (constant?, codegen): Add some diagnostics
	  so that we can get decent error reporting if we accidentally unquote an
	  unreadable value into the compiled output.

	allow multiple modules in one compilation unit
	* module/system/il/ghil.scm (<ghil-env>, <ghil-toplevel-env>): Refactor
	  so that all environments point (eventually) at one toplevel
	  environment. Instead of having potentially multiple toplevel
	  environments, each noting the module against which its bindings are
	  resolved, have each binding in the toplevel record what module it
	  should be resolved in. Should fix compilation units that define
	  multiple modules.
	  (ghil-lookup, ghil-define): Reworked to not be destructive. Module
	  variables now have the module name as their "env", and are keyed as
	  `(MODNAME . SYM)' in the var table.
	  (call-with-ghil-environment): Reindented.

	* module/system/il/inline.scm (try-inline-with-env): Adapt to
	  env/toplevel changes.

	* module/system/vm/assemble.scm (dump-object!): A vlink-later now holds
	  the module name, not the module itself.

	* module/system/il/compile.scm (make-glil-var): The "env" of a "module"
	  var is now the module name, not the module.

	* module/language/scheme/translate.scm (primitive-syntax-table): Update
	  the way we test for toplevel environments. Reindent the lambda
	  translator.
	  (lookup-transformer, trans): lookup-transformer now has 2 args, not 3.
	  (translate): Update the way we make toplevel environments.

	improve backtraces
	* module/system/vm/frame.scm (frame-call-representation): Show more of
	  lists.
	  (program-name): Avoid a traceback if (frame-address link) is #f. Not
	  sure when this can happen, but it does, and since this is already in
	  the backtrace function, there be badness there.

	update .gitignore files
	* .gitignore:
	* libguile/.gitignore: Update

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Added support for the free function of structures.
	* libguile/struct.c (struct_finalizer_trampoline): New.
	  (scm_struct_gc_init): Removed.
	  (scm_i_structs_to_free): Removed.
	  (scm_free_structs): Removed.
	  (scm_make_struct): Register a finalizer for the new struct if need be.
	  (scm_struct_prehistory): Cleared.

	* libguile/struct.h (scm_i_structs_to_free): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-33

	Use the SMOB API in `coop-pthreads.c' rather than low-level primitives.
	* libguile/coop-pthreads.c: Include "smob.h".
	  (make_thread): Use `SCM_NEWSMOB' rather than `scm_cell'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-32

	Fixed a warning in `symbols.c'.
	* libguile/symbols.c (lookup_interned_symbol): When checking for `NULL',
	  use `SCM2PTR' rather than `SCM_UNPACK' (this fixes a warning).

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-31

	Fixed the SMOB mark procedure so that it handles free-list objects.
	* libguile/smob.c (smob_mark): Check the 7-bit type tag and ignore those
	  whose type tag is not that of a SMOB in order to cleanly handle
	  free-list objects (this fixes a bug which showed up on SPARC64).
	  Also, don't mark & push ADDR itself.
	  (scm_gc_mark): Moved the definition and undefinition of
	  `CURRENT_MARK_PTR' and `CURRENT_MARK_LIMIT' here.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-30

	Fixed use of finalizers for guardians and SMOBs (undoes patches 23-24).
	* libguile/gc.c (finalizer_trampoline): Removed.
	  (scm_gc_register_finalizer): Removed (undoes patches 23 and 24).

	* libguile/gc.h (scm_gc_register_finalizer): Removed.

	* libguile/guardians.c (finalize_guarded): Undid patch 23.  Added support
	  for "proxied finalizers".
	  (scm_i_guard): Likewise.

	* libguile/smob.c (scm_i_finalize_smob): Adapted to
	  `GC_finalization_proc'.

	* libguile/smob.h: Include <gc/gc.h>.
	  (SCM_NEWSMOB): Use `GC_REGISTER_FINALIZER_NO_ORDER' instead of
	  `scm_gc_register_finalizer ()'.
	  (SCM_NEWSMOB3): Likewise.
	  (scm_i_finalize_smob): Updated.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-29

	Removed a lot of now-useless SMOB mark/free functions.
	* libguile/arbiters.c (scm_init_arbiters): Don't invoke `scm_set_smob_mark'.

	* libguile/async.c (async_gc_mark): Removed.
	  (scm_init_async): Don't invoke `scm_set_smob_mark'.

	* libguile/coop-pthreads.c (thread_mark): Removed.
	  (create_thread): Use `scm_gc_malloc' instead of `scm_malloc' when
	  allocating `launch_data'.
	  (mutex_mark): Removed.
	  (scm_threads_init): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/debug.c (scm_init_debug): Don't invoke `scm_set_smob_mark'.

	* libguile/dynl.c (dynl_obj_mark): Removed.
	  (scm_init_dynamic_linking): Don't invoke `scm_set_smob_mark'.

	* libguile/dynwind.c (winder_mark): Removed.
	  (scm_init_dynwind): Don't invoke `scm_set_smob_mark'.

	* libguile/environments.c (environment_mark): Removed.
	  (environment_free): Removed.
	  (observer_mark): Removed.
	  (core_environments_mark): Removed.
	  (core_environments_finalize): Removed.
	  (leaf_environment_mark): Removed.
	  (leaf_environment_free): Removed.
	  (leaf_environment_funcs): Don't refer to the above funcs.
	  (eval_environment_mark): Removed.
	  (eval_environment_free): Removed.
	  (eval_environment_funcs): Don't refer to the above funcs.
	  (import_environment_mark): Removed.
	  (import_environment_free): Removed.
	  (import_environment_funcs): Don't refer to the above funcs.
	  (export_environment_mark): Removed.
	  (export_environment_free): Removed.
	  (export_environment_funcs): Don't refer to the above funcs.
	  (scm_environments_prehistory): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/environments.h (scm_environment_funcs)[mark]: Removed.
	  [free]: Removed.

	* libguile/eval.c (promise_mark): Removed.
	  (promise_free): Removed.
	  (scm_init_eval): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/fluids.c (fluid_free): Removed.
	  (scm_fluids_prehistory): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/futures.c (future_mark): Removed.
	  (scm_init_futures): Don't invoke `scm_set_smob_mark'.

	* libguile/hashtab.c (hashtable_free): Removed.
	  (scm_hashtab_prehistory): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/hooks.c (scm_init_hooks): Don't invoke `scm_set_smob_mark'.

	* libguile/keywords.c (scm_init_keywords): Don't invoke
	  `scm_set_smob_mark'.

	* libguile/macros.c (scm_init_macros): Don't invoke `scm_set_smob_mark'.

	* libguile/modules.c (scm_init_modules): Don't invoke
	  `scm_set_smob_mark'.

	* libguile/print.c (scm_init_print): Don't invoke `scm_set_smob_mark'.

	* libguile/random.c (scm_i_copy_rstate): Use `scm_gc_malloc' instead of
	  `scm_malloc'.
	  (scm_c_make_rstate): Likewise.
	  (rstate_free): Removed.
	  (scm_init_random): Don't invoke `scm_set_smob_free'.

	* libguile/srcprop.c (srcprops_mark): Removed.
	  (scm_init_srcprop): Don't invoke `srcprops_mark'.

	* libguile/srfi-14.c (charset_free): Removed.
	  (scm_init_srfi_14): Don't invoke `scm_set_smob_free'.

	* libguile/srfi-4.c (uvec_mark): Removed.
	  (uvec_free): Removed.
	  (scm_init_srfi_4): Don't invoke `scm_set_smob_free' and
	  `scm_set_smob_mark'.

	* libguile/threads.c (thread_mark): Removed.
	  (fat_mutex_mark): Removed.
	  (fat_cond_mark): Removed.
	  (scm_init_threads): Dont invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/unif.c (bitvector_free): Removed.
	  (array_mark): Removed.
	  (array_free): Removed.
	  (scm_init_unif): Don't invoke `scm_set_smob_free' and
	  `scm_set_smob_mark'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-28

	Fixed the undocumented `scm_make_smob ()' function.
	* libguile/smob.c (scm_make_smob): Use `SCM_RETURN_NEWSMOB ()' instead of
	  `scm_cell ()' when instantiating the SMOB.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-27

	Added support for SMOBs free function (via finalizers).
	* libguile/smob.c (scm_i_finalize_smob): New.

	* libguile/smob.h (SCM_NEWSMOB): Register `scm_i_finalize_smob ()' as a
	  finalizer for Z if its SMOB type has a free function.
	  (SCM_NEWSMOB3): Likewise.
	  (scm_i_finalize_smob): New declaration.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-26

	Removed the free function from the malloc-object SMOB type.
	* libguile/mallocs.c (malloc_free): Removed.
	  (scm_init_mallocs): Don't invoke `scm_set_smob_free ()' because the
	  memory allocated by `scm_gc_malloc ()' will automatically be freed.
	  Furthermore, `malloc_free ()' used to invoke `free ()' instead of
	  `scm_gc_free ()' which is incorrect.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-25

	Fixed `scm_gc_register_finalizer ()' to avoid bootstrap problem.
	* libguile/gc.c (finalizer_trampoline): Don't use `scm_call_2 ()' to
	  invoke the finalizer: directly call the C function instead.
	  (scm_gc_register_finalizer): Don't create a real subr with
	  `scm_c_make_gsubr ()': simply convert the C function pointer to an
	  `SCM' object instead.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-24

	Generalized BGC's finalizer mechanism.  Use it in `guardians.c'.
	* libguile/gc.c (finalizer_trampoline): New.
	  (scm_gc_register_finalizer): New.

	* libguile/gc.h (scm_gc_register_finalizer): New declaration.

	* libguile/guardians.c (finalize_guarded): Updated to the new prototype.
	  (scm_i_guard): Use `scm_gc_register_finalizer ()' instead of
	  `GC_REGISTER_FINALIZER_NO_ORDER ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-23

	Added support for SMOB custom mark procedures.
	* libguile/gc.c (scm_gc_mark): Removed.
	  (scm_gc_mark_dependencies): Removed.
	  (scm_mark_locations): Removed.

	* libguile/gc.h (scm_gc_mark_dependencies): Removed.
	  (scm_mark_locations): Removed.

	* libguile/inline.h (scm_cell): Use `GC_MALLOC ()' instead of `GC_malloc ()'.

	* libguile/smob.c (smob_freelist): New.
	  (smob_gc_kind): New.
	  (smob_mark): New.
	  (scm_gc_mark): New.
	  (scm_i_new_smob_with_mark_proc): New.
	  (scm_smob_prehistory): Initialize `smob_freelist' and `smob_gc_kind'.

	* libguile/smob.h (scm_i_new_smob_with_mark_proc): New declaration.
	  (SCM_NEWSMOB): Use it if a mark procedure is available.
	  (SCM_NEWSMOB2): Likewise.
	  (SCM_NEWSMOB3): Likewise.

	* libguile/threads.c (guilify_self_1): Initialize the
	  `current_mark_stack_*' fields.

	* libguile/threads.h (scm_i_thread)[current_mark_stack_ptr]: New field.
	  [current_mark_stack_limit]: New field.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-22

	Removed the mark/free functions of continuations and threads.
	* libguile/continuations.c (continuation_mark): Removed.
	  (continuation_free): Removed.
	  (scm_init_continuations): Don't use them.

	* libguile/coop-pthreads.c (scm_threads_mark_stacks): Removed (was
	  unused).

	* libguile/threads.c (scm_threads_mark_stacks): Likewise.

	* libguile/threads.h (scm_threads_mark_stacks): Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-21

	Removed useless files; beautified `libguile/Makefile.am'.
	* libguile/Makefile.am: Beautified backslashification (complements `patch-1').

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-20

	Disabled the `environments' unit test.
	* test-suite/Makefile.am (SCM_TESTS): Removed `tests/environments.test'.

	* test-suite/tests/environments.nottest: Disabled.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-19

	procs/weaks/hashtab: Removed a bit of useless mark/free code.
	* libguile/hashtab.c (UNMARKED_CELL_P): Removed.
	  (scm_i_scan_weak_hashtables): Removed.

	* libguile/hashtab.h (scm_i_scan_weak_hashtables): Removed.

	* libguile/procs.c (scm_mark_subr_table): Removed.

	* libguile/procs.h (scm_mark_subr_table): Removed.

	* libguile/weaks.c (UNMARKED_CELL_P): Removed.
	  (scm_i_remove_weaks): Removed.
	  (scm_i_remove_weaks_from_weak_vectors): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-18

	Tiny updates in `environments.c'.
	* libguile/environments.c (scm_make_environment): Use
	  `SCM_RETURN_NEWSMOB' instead of `scm_cell'.
	  (core_environments_observe): Use `SCM_NEWSMOB3' instead of
	  `scm_double_cell'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-17

	Fixes in weak hash tables handling, notably in `hash-fold'.
	* libguile/hashtab.c (scm_i_rehash): Return immediately if TABLE is weak.
	  (scm_hash_fn_create_handle_x): Explicitly mention that we don't support
	  weak alist vectors.
	  (scm_internal_hash_fold): Handle weak pairs within buckets.

	* libguile/modules.c (scm_module_reverse_lookup): Handle weak alists
	  (currently, don't do anything if a NULL pair is met).

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-16

	Fixed a typo/bug in `make-doubly-weak-alist-vector'.
	* libguile/weaks.c (scm_make_doubly_weak_alist_vector): Fixed typo
	  (endless recursive call).

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-15

	Fixed printing of weak vectors.
	* libguile/print.c (iprin1): When displaying a weak vector, access
	  elements via `scm_c_vector_ref ()', not via the macro.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-14

	Fixed `list->weak-vector'.
	* libguile/vectors.c (scm_i_allocate_weak_vector): Removed.
	  (MAKE_WEAK_VECTOR): New macro.
	  (allocate_weak_vector): New.
	  (scm_i_make_weak_vector): New.
	  (scm_i_make_weak_vector_from_list): New.

	* libguile/vectors.h: Updated.

	* libguile/weaks.c (scm_make_weak_vector): Use `scm_i_make_weak_vector ()'.
	  (scm_weak_vector): Use `scm_i_make_weak_vector_from_list ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-13

	Fixed weak alist vectors by having them use weak hash tables instead.
	* libguile/weaks.c (scm_make_weak_key_alist_vector): Use
	  `scm_make_weak_key_hash_table ()'.
	  (scm_make_weak_value_alist_vector): Use `scm_make_weak_value_hash_table ()'.
	  (scm_make_doubly_weak_alist_vector): Use `scm_make_doubly_weak_hash_table ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-12

	First stab at the guardian implementation.  Works fine at first glance!
	* libguile/guardians.c: Overhauled.  Removed the `tconc' structure.
	  Much, much, simpler.
	  (finalize_guarded): New function.

	* libguile/init.c (scm_i_init_guile): Call `scm_init_guardians ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-11

2008-09-05  Ludovic Court`es  <ludovic.courtes@laas.fr>

	Tell `libgc' that we're using POSIX threads.  This fixes Guile on PPC.
	* libguile/coop-defs.h: If `GUILE_PTHREAD_COMPAT' is defined, then define
	  `GC_THREADS' and include <gc/gc.h> after <pthread.h>.

	* libguile/coop-pthreads.h: Likewise.

	* libguile/pthread-threads.h: Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-10

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed `scm_fixup_weak_alist ()'; update weak hash table size as needed.
	* libguile/hashtab.c (scm_fixup_weak_alist): Added a REMOVED_ITEMS
	  parameter.  Fixed a bug in the case where PREV is `SCM_EOL'.
	  (IS_WEAK_THING): New macro.
	  (START_WEAK_BUCKET_FIXUP): New macro.
	  (END_WEAK_BUCKET_FIXUP): New macro.
	  (scm_hash_fn_get_handle)[buckets]: New variable.  Use the above
	  macros.
	  (scm_hash_fn_create_handle_x): Likewise.
	  (scm_hash_fn_remove_x): Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-9

	Fixed the weak cell implementation (for weak hash tables).
	* libguile/hashtab.c (wcar_cell_descr): New.
	  (wcdr_cell_descr): New.
	  (scm_weak_car_cell): Use `GC_malloc_explicitly_typed ()' instead of
	  `scm_gc_malloc_pointerless ()'.
	  (scm_weak_cdr_cell): Likewise.
	  (SCM_WEAK_CELL_WORD_DELETED_P): Use `SCM_CELL_OBJECT' instead of
	  `SCM_CELL_WORD'.
	  (scm_hash_fn_get_handle): Call `GC_disable ()' before calling
	  `scm_fixup_weak_alist ()' and `GC_enable ()' afterwards.
	  (scm_hash_fn_create_handle_x): Likewise.
	  (scm_hash_fn_remove_x): Likewise.
	  (scm_hashtab_prehistory): Initialize WCAR_CELL_DESCR and
	  WCDR_CELL_DESCR.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-8

	First stab at implementing weak hash tables and vectors.  Unable to run the REPL.
	* libguile/hashtab.c (scm_weak_car_cell): New.
	  (scm_weak_cdr_cell): New.
	  (scm_doubly_weak_cell): New.
	  (SCM_WEAK_CELL_WORD_DELETED_P): New.
	  (SCM_WEAK_CELL_WORD): New.
	  (scm_fixup_weak_alist): New.
	  (make_hash_table): Always use non-weak vectors.  Allocate
	  `scm_t_hashtable' objects as pointerless.
	  (scm_i_rehash): Always make NEW_BUCKETS a non-weak vector.
	  (scm_hash_fn_get_handle): Call `scm_fixup_weak_alist ()' on weak
	  buckets before calling ASSOC_FN.
	  (scm_hash_fn_remove_x): Likewise.
	  (scm_hash_fn_create_handle_x): Likewise.  Also, use `scm_.*weak.*cell
	  ()' for HANDLE when needed.

	* libguile/symbols.c (lookup_interned_symbol): Check for nullified
	  pairs.

	* libguile/vectors.c (scm_vector_elements): Abort on weak vectors.
	  (scm_vector_writable_elements): Likewise.
	  (scm_c_vector_ref): Check whether the referenced element has been
	  nullified.
	  (scm_c_vector_set_x): Use `GC_GENERAL_REGISTER_DISAPPEARING_LINK ()'.
	  (scm_i_allocate_weak_vector): Use `scm_gc_malloc_pointerless ()'
	  instead of `scm_gc_malloc ()' when allocating room for the vector
	  itself.

	* libguile/weaks.c (scm_make_weak_key_alist_vector): Use
	  `scm_make_vector ()' instead of `scm_i_allocate_weak_vector ()'.
	  (scm_make_weak_value_alist_vector): Likewise.
	  (scm_make_doubly_weak_alist_vector): Likewise.
	  (weak_vectors): Removed.
	  (scm_i_init_weak_vectors_for_gc): Removed.
	  (scm_i_mark_weak_vector): Removed.
	  (scm_i_mark_weak_vector_non_weaks): Removed.
	  (scm_i_mark_weak_vectors_non_weaks): Removed.
	  (scm_i_remove_weaks_from_weak_vectors): Commented out.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-7

	Fixed GC initialization and static roots.
	* libguile/gc.c (scm_storage_prehistory): Call `GC_INIT ()'.  Invoke
	  `GC_add_roots ()' as well.
	  (scm_init_gc): Removed call to `GC_init ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-6

	Added `scm_gc_malloc_pointerless ()', equivalent to `GC_MALLOC_ATOMIC ()'.
	* libguile/gc-malloc.c (scm_gc_register_collectable_memory): Tidied.
	  (scm_gc_unregister_collectable_memory): Likewise.
	  (scm_gc_malloc_pointerless): New.

	* libguile/gc.h (scm_gc_malloc_pointer_less): New declaration.

	* libguile/strings.c (make_stringbuf): Use it.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-5

	Fixed garbage collection of ports: basics work (no SMOBs, no guardians, no WHT).
	* libguile/gc.c (scm_init_storage): Do not initialize SCM_I_PORT_TABLE
	  here: this is done in `scm_ports_prehistory ()'.  This fixes the bug
	  mentioned in the previous patch log.

	* libguile/ports.c (scm_new_port_table_entry): Slightly clarified the
	  code.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-4

	First ``working'' Guile!  Crashes in `flush-all-ports' (relates to SCM_I_PORT_TABLE).
	* libguile/gc.c (scm_gc_stats): Fixed so that it returns a relevant
	  result instead of just `SCM_EOL'.

	* libguile/ports.c: Include `assert.h'.  Don't include `malloc.h'.
	  (scm_make_port_type): Use `scm_gc_realloc ()' instead of `realloc ()'.
	  (scm_new_port_table_entry): Likewise.
	  (scm_flush): Added an assertion on the port number.
	  (scm_ports_prehistory): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-3

	Small fixes.  Gets to the REPL and `abort ()'s soon after.
	* libguile/inline.h (scm_cell): Re-added comment about the assignment
	  order of CAR/CDR.

	* libguile/srcprop.c (scm_make_srcprops): Use `scm_gc_malloc ()' instead
	  of `malloc' + `scm_gc_register_collectable_memory ()'.

	* libguile/threads.c (guilify_self_1): Likewise.
	  (guilify_self_2): Likewise.

	* libguile/strings.c (make_stringbuf): Use `GC_MALLOC_ATOMIC ()' instead
	  of `scm_gc_malloc ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-2

	Merge from lcourtes@laas.fr--2005-mobile
	Patches applied:

	 * lcourtes@laas.fr--2005-mobile/guile-core--boehm-gc--1.9  (base, patch 1)

	   - tag of lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--base-0
	   - Initial hack for Boehm's GC support: nothing works.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-1

2008-09-02  Andy Wingo  <wingo@pobox.com>

	superstition with no important effect
	* module/system/vm/assemble.scm (dump-object!): Some superstition, use
	  bit arithmetic instead of int arithmetic. Makes me happier.

	make primitive-load-path load compiled files if available
	* libguile/load.h: Update scm_search_path prototype.

	* libguile/load.c: Include vm.h for load-compiled/vm. Not sure if this is
	  bad wrt modularity.
	  (scm_c_string_has_an_ext): New private helper.
	  (scm_search_path): Add an extra optional arg, `require_exts'; if true,
	  require that the returned file name have one of the given extensions.
	  Changes the C API, but not the scheme API.
	  (scm_sys_search_load_path): Adapt to scm_search_path API change.
	  (primitive-load-path): Here is the craziness: load a compiled file if
	  found and newer than the corresponding (or not) source file.
	  (scm_init_load): Define %load-compiled-extensions as the list of
	  extensions denoting compiled files; defaults to '(".go").

	move up some initializations in the vm
	* libguile/vm.c: Move 'vm-run, 'vm-error, 'debug sym initialization up to
	  the bootstrap phase, so they are ready if load-compiled/vm is called
	  before (system vm vm) is loaded.

	turn define-option-interface into a defmacro
	* ice-9/boot-9.scm (define-option-interface): Turn into a defmacro
	  instead of an mmacro.

	disable start-stack in compiled code
	* module/language/scheme/translate.scm (primitive-syntax-table): Disable
	  semantics of start-stack in compiled code. I think start-stack
	  semantics aren't bad, but they don't have vm-based implementations at
	  this point.

	remove the-environment, the-root-environment, environment-module
	* ice-9/boot-9.scm (the-environment, the-root-environment)
	  (environment-module): Remove these representation of the interpreter's
	  idea of the environment, because they are not valid in the compiled
	  case, and are not part of the scheme spec anyway.

	avoid local-eval in record constructors and accessors
	* ice-9/boot-9.scm (record-constructor, record-accessor)
	  (record-modifier): Avoid local-eval when possible, because it uses the
	  interpreter's representation of environments; and when we need to eval,
	  use primitive-eval instead. Slight semantic change in that this
	  evaluates relative to the current module rather than the root module,
	  but not really a biggie. Should make this compilable in the future,
	  somehow.

	nits picked on boot-9.scm
	* ice-9/boot-9.scm (defmacro): Indentation fix.
	  (begin-deprecated): Don't cons in the `begin' macro itself, only the
	  symbol `begin'.

	enter into the (guile) module when compiling boot-9.scm
	* ice-9/boot-9.scm: Before doing very much, put us into the (guile)
	  module when compiling. This avoids some circularity in the module boot
	  process, whereby symbols are seen to resolve to the (guile-user)
	  module, whereas in fact they originally pertain to the (guile) module.

	Fix compilation #ifndef STACK_CHECKING.
	* libguile/debug.c (scm_debug_options): Fix compilation #ifndef
	  STACK_CHECKING.

	fix Makefile.am in module/language
	* module/language/Makefile.am: Actually recurse into scheme/.

	ditch the 8-bit compiled form of program parameters
	* libguile/vm-i-loader.c (load-program):
	* module/system/vm/assemble.scm (dump-object!): There are cases in which
	  we use the 16-bit representation for program params (nargs, nexts,
	  etc), but the actual 16-bit number actually fits into 8 bits -- which
	  is then misinterpreted by the loader as the 8-bit form. So ditch the
	  8-bit form entirely (it was never much of an optimization), and just
	  use the 16-bit form. Make sure to clear out all your .go files before
	  recompiling this one!

	fix a bug loading functions with 8 or more arguments
	* libguile/vm-i-loader.c: A combination of superstition and a bugfix:
	  make sure that we treat bits as being of a type as wide as we think it
	  is, and, more importantly, allow for programs with 8 <= nargs < 16.

	fix nested quasiquotes (yeepers)
	* module/language/scheme/translate.scm (primitive-syntax-table)
	  (trans-quasiquote): Fix handling of nested quasiquotes.

	* testsuite/Makefile.am (vm_test_files):
	* testsuite/t-quasiquote.scm: Add a quasiquote test case.

2008-08-28  Andy Wingo  <wingo@pobox.com>

	shamefully disable some more gc asserts
	* libguile/gc-freelist.c: Disable some more asserts. I have no idea why
	  they're hitting, however.

	move guilec and guile-disasm to be guile-tools scripts
	* .gitignore: Some touchups.

	* configure.in:
	* src/.cvsignore:
	* src/Makefile.am:
	* Makefile.am: No more src/.

	* scripts/compile:
	* scripts/disassemble: Moved here from src/ and changed into guile-tools
	  scripts.

	* scripts/Makefile.am: Add the new scriptes.

	* guilec.mk: Adapt to new way of invoking the compiler.

2008-08-26  Andy Wingo  <wingo@pobox.com>

	fix guile-disasm
	* src/guile-disasm.in: Adapt to the split-up of (system vm core).
	  Detabify.

	Patch by C. K. Jester-Young <cky944 <at> gmail.com>.

	m4 quoting foo in labels-as-values.m4.
	* m4/labels-as-values.m4: More m4 quoting love.

	Patch from C. K. Jester-Young <cky944 <at> gmail.com>.

	fix casting-pointers-to-ints bug
	* libguile/vm.c: Cast pointers to intptr_t, not int.

	Patch from C. K. Jester-Young <cky944 <at> gmail.com>.

	fetch an inum's bits into a scm_bits_t, not an int
	* libguile/vm-i-scheme.c (FUNC1): Remove, cause it's not used.
	  (FUNC2): Don't assume an inum can fit into an int, use scm_bits_t
	  instead. In reality though we should probably do use different checks,
	  i.e. for multiplication probably we overflow. (That would be a bug.)

	Based on a patch by C. K. Jester-Young <cky944 <at> gmail.com>.

	suppress autoconf warning
	* guile-tools.in: Suppress ``WARNING: $ac_file_inputs seems to ignore the
	  --datarootdir setting'' message.

	Patch from C. K. Jester-Young <cky944 <at> gmail.com>

	disable gc statistics asserts
	* libguile/gc.c: Disable the statistics asserts; see
	  http://thread.gmane.org/gmane.lisp.guile.devel/7505

	merge from guile master
	Had to fix up .gitignore for some conflicts.

	start compiling ice-9
	* ice-9/Makefile.am: Integrate with guilec.mk, and start compiling
	  sources. Have to figure out what to do with procedure->memoized-macro
	  though, to get boot-9.scm compiling.

2008-08-25  Andy Wingo  <wingo@pobox.com>

	module compilation fixen, post-integration
	Thanks to Dale Smith.

	* guilec.mk: Rework to expect the includer to define $(modpath), then
	  make $(moddir) from that.

	* module/language/Makefile.am:
	* module/language/scheme/Makefile.am:
	* module/system/base/Makefile.am:
	* module/system/il/Makefile.am:
	* module/system/repl/Makefile.am:
	* module/system/vm/Makefile.am: Define modpath instead.

	* src/guilec.in: Don't import (system vm bootstrap), it is no more.

2008-08-22  Andy Wingo  <wingo@pobox.com>

	merge guile-vm into libguile itself
	* ice-9/boot-9.scm: Only define load-compiled as #f if it's not already
	  defined, which won't normally be the case.

	* libguile/guile-vm.c: Removed, there's no more guile-vm binary.

	* libguile/frames.c: (with change frame? -> heap-frame?)
	* libguile/frames.h:
	* libguile/instructions.c:
	* libguile/instructions.h:
	* libguile/objcodes.c:
	* libguile/objcodes.h:
	* libguile/programs.c:
	* libguile/programs.h:
	* libguile/vm-bootstrap.h: (was bootstrap.h)
	* libguile/vm-engine.c: (was vm_engine.c)
	* libguile/vm-engine.h: (was vm_engine.h)
	* libguile/vm-expand.h: (was vm_expand.h)
	* libguile/vm-i-loader.c: (was vm_loader.c)
	* libguile/vm-i-scheme.c: (was vm_scheme.c)
	* libguile/vm-i-system.c: (was vm_system.c)
	* libguile/vm.c:
	* libguile/vm.h: These files moved here from src/, as guile-vm is now a
	  part of libguile.

	* libguile/init.c: Bootstrap the VM. Yay!

	* libguile/Makefile.am: The necessary chicanery here.

	* module/system/vm/Makefile.am:
	* module/system/vm/bootstrap.scm:
	* module/system/vm/frame.scm:
	* module/system/vm/instruction.scm:
	* module/system/vm/objcode.scm:
	* module/system/vm/program.scm:
	* module/system/vm/vm.scm:

	* pre-inst-guile-env.in: Add builddirs to the load path; add module/ to
	  the path in the empty-$GUILE_LOAD_PATH case as well.

	* src/Makefile.am: Moved out everything except guilec and guile-disasm,
	  which probably should be moved to the scripts directory?

	* testsuite/Makefile.am: Update to find guile-vm in the right place.

	* module/system/vm/Makefile.am:
	* module/system/vm/bootstrap.scm: Removed bootstrap.scm, scm_init_guile
	  handles the bootstrapping for us.

	* module/system/vm/frame.scm:
	* module/system/vm/instruction.scm:
	* module/system/vm/objcode.scm:
	* module/system/vm/program.scm:
	* module/system/vm/vm.scm: Call the init functions in libguile; should
	  fix at some point to avoid the dlopen?

	make pre-inst-guile use pre-inst-guile-env
	* pre-inst-guile-env.in:
	* pre-inst-guile.in: Change so that pre-inst-guile uses
	  pre-inst-guile-env. Fixed inconsistency regarding $subdirs_with_ltlibs.

2008-08-21  Andy Wingo  <wingo@pobox.com>

	chmod -x guilec.in.
	* src/guilec.in: Chmod -x.

2008-08-20  Andy Wingo  <wingo@pobox.com>

	fix some compilation warnings, in anticipation of moving to libguile/
	* src/Makefile.am: Use standard guile CFLAGS, which has -Werror and
	  -Wmissing-prototypes.

	* src/frames.h:
	* src/instructions.h:
	* src/objcodes.h:
	* src/programs.h:
	* src/vm.h:
	* src/vm.c: Fix warnings, mostly about prototypes.

	* src/vm_system.c: Fix a tricky x-is-not-initialized error. Thanks, GCC!

	remove unused "envs" code from guile-vm
	* src/Makefile.am:
	* src/envs.c:
	* src/envs.h: Remove the envs code, which was historically used to
	  implement modules. But since we use Guile's modules, these aren't
	  necessary.

	* src/vm.c:
	* src/vm_loader.c:
	* module/system/vm/assemble.scm: Remove code bits that trafficked in yon
	  deprecation.

2008-08-11  Andy Wingo  <wingo@pobox.com>

	make ,stats work
	* module/system/repl/command.scm (display-time-stat, display-mips-stat):
	  Always convert to float.

	* module/system/vm/frame.scm (print-frame): Write the args, don't display them.

	* module/system/repl/command.scm (statistics): gc-sweep-time is no more.

	ease-of-use improvement to ,m; catch read errors at the repl
	* module/system/repl/command.scm (module): Accept e.g. `,m ice-9 popen'
	  in addition to `,m (ice-9 popen)'.

	* module/system/repl/repl.scm (start-repl): Call read with a backtrace
	  handler too.

	fix bug in compilation of `and' and `or'; more robust underflow detection.
	* module/system/il/compile.scm (codegen): Rewrite handling of `and' and
	  `or' ghil compilation, because it was broken if drop was #t. Tricky
	  bug, this one! Took me days to track down!

	* module/system/repl/repl.scm: Export call-with-backtrace, which probably
	  should go in some other file.

	* src/vm.c (scm_vm_save_stack): Handle the fp==0 case for errors before
	  we have a frame.

	* src/vm_engine.h (NEW_FRAME, FREE_FRAME): Stricter underflow checking,
	  raising the stack base to the return address, in an attempt to prevent
	  inadvertant stack smashing (the symptom of the and/or miscompilation
	  bug).
	  (CHECK_IP): A check that the current IP is within the bounds of the
	  current program. Not normally compiled in. Perhaps it should be?

	* src/vm_system.c (halt): Set vp->ip to NULL. Paranoia, I know.
	  (return): Call CHECK_IP(), if such a thing is compiled in.

	* testsuite/Makefile.am (vm_test_files):
	* testsuite/t-catch.scm:
	* testsuite/t-map.scm:
	* testsuite/t-or.scm: New tests.

2008-08-09  Andy Wingo  <wingo@pobox.com>

	backtraces on meta-commands too
	* module/system/repl/repl.scm (call-with-backtrace): New helper.
	  (start-repl): Use the helper, for normal expressions *and* for
	  meta-commands.

	warn and load source file if newer than compile file
	* ice-9/boot-9.scm (try-module-autoload): Warn if the compiled file is
	  older than the source file, and in that case load the source file.

	don't truncate .go files, do an atomic rename to prevent SIGBUS
	* module/system/base/compile.scm (call-with-output-file/atomic): New
	  proc, outputs to a tempfile then does an atomic rename. Prevents SIGBUS
	  if a compiled file is truncated and rewritten, as the file's objcode is
	  mmap'd in.
	  (compile-file): Use the new helper.

	fix source location reporting for compiled code
	* module/system/repl/repl.scm (default-catch-handler): Cosmetic
	  improvements on VM error backtraces.

	* module/system/vm/frame.scm (print-frame): Cosmetic improvements.
	  (frame-line-number): source:line operates on the handle, not the cdr.
	  (print-frame-chain-as-backtrace): Cosmetic improvements.

2008-08-08  Andy Wingo  <wingo@pobox.com>

	heapify the bootstrap program
	* src/vm_engine.c (vm_run):
	* src/programs.c (scm_c_make_program): If the holder is #f, malloc *and*
	  copy the bytecode.

	* module/system/vm/frame.scm (bootstrap-frame?): Now that we actually
	  heapify the bootstrap program, we can check for `halt' in the bytecode.

	More relevant VM backtrace
	* module/system/repl/repl.scm: Remove a useless print in the backtrace
	  handler.

	* module/system/vm/debug.scm (vm-backtrace): s/reverse!/reverse/

	* module/system/vm/frame.scm (bootstrap-frame?): A heuristic to see if a
	  frame is a bootstrap frame, the one allocated on the stack in
	  vm_engine.c; need to have a better solution for this.
	  (make-frame-chain): Don't include bootstrap frames, they add no
	  information.
	  (print-frame-chain-as-backtrace): Remove a pk.

	* src/vm_engine.c (vm_run): Add a fixme about the bootstrap prograp.

	improve source loc info in nonlocal exits and backtraces
	* module/system/il/compile.scm (codegen): The currently-executing
	  instruction is actually the one right before the instruction pointer;
	  so for purposes of assv to find a source location for an ip, put the
	  source after the code, as it was before.

	* module/system/vm/debug.scm (vm-backtrace): Move more code to frame.scm.

	* module/system/vm/frame.scm (make-frame-chain): Include all frames, even
	  the bootstrap one. For a reentrant backtrace we'll have boostrap
	  programs anyway. Probably should check for objcode[2] == scm_op_halt,
	  to not show those frames in the trace.
	  (frame-line-number, frame-file): New helpers.
	  (print-frame): Print out the line number too.
	  (frame-call-representation): Code from print-frame-call moved here.
	  (print-frame-chain-as-backtrace): A backtrace printer, yays.
	  (program-name): Check link validity before calling frame-address on it.

	* module/system/vm/program.scm (source:addr, source:line, source:column)
	  (source:file): New accessors for the elements of program-sources.

	* module/system/vm/vm.scm (vm:last-ip): New export.
	  (vm-last-frame-chain): Use vm:last-ip in making the frame chain.

	* src/vm.h (struct scm_vm):
	* src/vm.c (make_vm, scm_vm_last_ip, scm_vm_save_stack): Save the last
	  instruction pointer when saving the stack. Really though, we should be
	  saving all of the stack data on a spaghetti stack.

	* src/vm_system.c (late-variable-ref): Pointless s/REGISTER/BEFORE_GC/.

	fix bug in variable-set instruction; ,x prints out program metadata
	* module/system/vm/disasm.scm (disassemble-program, disassemble-meta):
	  Disassemble program meta information too, if it's there.

	* src/vm_system.c (variable-set): Don't try to proxy name information;
	  maybe we can do this later, but the code as it was was calling SCM_CAR
	  on a variable, which is for the lose.

2008-08-07  Andy Wingo  <wingo@pobox.com>

	fix stack corruption on vm-save-stack; more robust with nonlocal exits
	* module/system/repl/command.scm: Coerce rationals to floats.

	* module/system/vm/program.scm (program-documentation): Fix a typo, doh!

	* src/vm.c (vm_reset_stack, struct vm_unwind_data): Add unwind handler to
	  reset vp->sp, vp->fp, and vp->this_frame when performing a nonlocal
	  exit from a vm_run.
	  (vm_heapify_frames_1): Don't repack the stack, it causes stack
	  corruption. I think we need spaghetti stacks to handle continuations,
	  not separate heap frames. I don't think call/cc is working now.
	  (vm-save-stack): Don't call heapify_frames, that modifies the stack
	  that we're copying. Instead call its helper, heapify_1.

	* src/vm_engine.c (vm_run): Set up the vm_reset_stack unwind handler.

	* src/vm_engine.h (IP_REG, SP_REG, FP_REG): If we got through all of the
	  checks without having these macros defined, define them as empty.
	  Happens on x86-64.

	* src/vm_system.c (halt): End the dynwind before we return from the VM.

	* src/vm_scheme.c (REL): Sync the regs before calling scm_lt_p et al,
	  cause they can do a nonlocal exit.

	vm backtrace improvements
	* module/system/repl/repl.scm (default-pre-unwind-handler): Save the VM
	  stack in addition to the interpreter stack. At some point these
	  functions should know about each other, I guess.
	  (default-catch-handler): Show the VM stack too. Needs a bit of work.

	* module/system/vm/frame.scm: Export make-frame-chain.

	* module/system/vm/vm.scm: Export vm-save-stack.

	* src/vm.c (scm_vm_save_stack): New function, heapifies the current
	  stack, saving it to vm->last_frame.

	* src/vm_engine.c (vm_run:vm_error): Don't heapify frames here, because
	  nonlocal exits avoid this code entirely. Instead rely on the user
	  saving the stack with a pre-unwind handler, as the repl does.

	build fixes
	* benchmark/measure.scm: Update for module changes.

	* module/system/vm/Makefile.am: Update the set of modules needing
	  compilation.

	* src/guile-vm.c: Bootstrap the VM, now that we have a function for it.

	* testsuite/Makefile.am:
	* testsuite/run-vm-tests.scm: Update to fix make check, broken since we
	  merged with Guile.

	big reorg of scheme modules -- e.g. programs.c -> (system vm program)
	This reorganization kills the ugly module-export-all hacks in
	bootstrap.scm and core.scm. In fact, it gets rid of core.scm entirely,
	breaking out its functionality into separate files.

	* module/system/vm/trace.scm:
	* module/system/vm/profile.scm:
	* module/system/vm/disasm.scm:
	* module/system/vm/debug.scm:
	* module/system/vm/conv.scm:
	* module/system/vm/assemble.scm:
	* module/system/repl/repl.scm:
	* module/system/repl/common.scm:
	* module/system/base/compile.scm:
	* module/system/repl/command.scm: Update for changes, and fix a bug in
	  procedure-documentation.

	* module/system/vm/bootstrap.scm: Just call scm_bootstrap_vm, which
	  handles setting load-compiled for us.

	* module/system/vm/core.scm: Removed, functionality folded into other
	  modules.

	* module/system/vm/frame.scm: Export the C frame procedures here; also
	  move scheme functions from core.scm here.

	* module/system/vm/instruction.scm: New file, exports procedures from
	  instructions.c.

	* module/system/vm/objcode.scm: New file, exports procedures from
	  objcodes.c.

	* module/system/vm/program.scm: New file, exports procedures from
	  programs.c, and some scheme functions originally from core.scm.

	* module/system/vm/vm.scm: New file, from vm.c and core.scm.

	* src/Makefile.am (libguile_vm_la_SOURCES): Add bootstrap.h.

	* src/bootstrap.h: New file, prototypes scm_bootstrap_vm (), which the
	  scm_init_* functions call.

	* src/frames.h:
	* src/frames.c (scm_init_frames):
	* src/frames.c (scm_bootstrap_frames):

	* src/vm.h:
	* src/instructions.h:
	* src/instructions.c (scm_init_instructions):
	* src/instructions.c (scm_bootstrap_instructions):
	* src/objcodes.h:
	* src/objcodes.c (scm_bootstrap_objcodes):
	* src/objcodes.c (scm_init_objcodes):
	* src/programs.h:
	* src/programs.c (scm_bootstrap_programs):
	* src/programs.c (scm_init_programs):
	* src/vm.c (scm_bootstrap_vm):
	* src/vm.c (scm_init_vm): Call scm_bootstrap_vm() before doing anything
	  in an init function. Bootstrap_vm will call bootstrap_instructions(),
	  etc to initialize types, then set load-compiled to point to
	  load-compiled/vm.

	* src/vm.c (scm_load_compiled_with_vm): Code to load .go files, if
	  they're present.

2008-08-06  Andy Wingo  <wingo@pobox.com>

	sync registers before calling c functions, really
	* src/vm_loader.c:
	* src/vm_scheme.c: Use SYNC_REGISTER, although it's the same as
	  SYNC_BEFORE_GC. A style issue?

	* src/vm_system.c (call, tail-call): Explicitly do a SYNC_REGISTER, not
	  relying on POP_LIST to do it for us, because POP_LIST won't do it if
	  there are 0 arguments. The way that this manifested itself to me was
	  badness after the second (read) call in a repl session. I wish I
	  understood more about this problem.

2008-08-05  Andy Wingo  <wingo@pobox.com>

	save vm's state before calling out to c procedures
	* .gitignore: Ignore .go files.

	* src/vm_loader.c:
	* src/vm_scheme.c:
	* src/vm_system.c: Sync the VM's state before calling out to C
	  procedures that might cons or cause a nonlocal exit.

	disable trampoline "optimizations"
	* src/vm_system.c: Disable those trampoline "optimizations", as they
	  actually slowed down benchmark/measure.scm '(fibo 30)'. They were
	  edifying, in that now I have an appreciation of the need for
	  SYNC_ALL().

	re-enable computed goto; fix ,help in the repl; subr dispatch optimizations
	* m4/labels-as-values.m4: New file, checks for computed goto.

	* configure.in: Use AC_C_LABELS_AS_VALUES.

	* module/system/repl/command.scm (procedure-documentation): Extend the
	  core's procedure-documentation in an ad-hoc way, so that ,help works.

	* module/system/vm/core.scm (program-properties): New function.
	  (program-documentation): New function.

	* src/vm_engine.h (DROP, DROPN): Decrement sp before checking for
	  underflow.

	* src/vm_system.c (call, tail-call): Add some optimized dispatch for some
	  C functions, so that we can avoid consing and the interpreter if
	  possible. However currently it seems that I'm always getting the
	  scm_call_* trampolines back.

2008-08-03  Andy Wingo  <wingo@pobox.com>

	Add docstring support
	* module/language/scheme/translate.scm (translate): Adapt to lambda
	  having a `meta' slot now.
	  (primitive-syntax-table, parse-lambda-meta): Parse out a docstring from
	  lambda forms, putting in the <ghil-lambda>'s meta slot.

	* module/system/il/compile.scm (optimize, codegen): Passthrough for the
	  `meta' slot to the <glil-asm> object.

	* module/system/il/ghil.scm (<ghil-lambda>): Add meta slot.

	* module/system/il/glil.scm (<glil-asm>): Add meta slot.
	  (unparse): Unparse meta.

	* module/system/vm/assemble.scm (preprocess): Pass through the meta slot.
	  (codegen): So, set the bytespec's meta slot as a list: bindings, source
	  info, then the tail is the meta-info, which should be an alist.
	  Currently the only defined key is `documentation', but `name' could
	  come in the future.

	* module/system/vm/core.scm (program-sources): Sources are now in the
	  cadr...
	  (program-property): And here we have access to the cddr.

	fix recording of source locations
	* module/language/scheme/translate.scm (translate, trans)
	  (make-pmatch-transformers): When recursing into subexpressions, get the
	  appropriate source location information.
	  (location): Include the source filename in the location information.

	* module/system/il/compile.scm (codegen): Record source locations in more
	  cases. (This information ends up being part of the procedure metadata,
	  not the actual codepath.)

	* module/system/il/glil.scm (unparse): Don't destructure the source
	  locations (it's a vector now).

2008-08-02  Andy Wingo  <wingo@pobox.com>

	only pass symbols to module-ref & c
	* module/language/scheme/translate.scm: Make sure that we're actually
	  passing symbols to module-ref et al.

	add compile-toplevel and evaluate conditions to eval-case
	* ice-9/boot-9.scm (eval-case): Define two more conditions:
	  compile-toplevel and evaluate, as common lisp and chez scheme do.
	  (defmacro, define-option-interface, define-macro, define-syntax-macro)
	  (define-module, use-modules, use-syntax, define-public)
	  (defmacro-public, export, re-export): Add `compile-toplevel' to all
	  uses of eval-case.

	make has-suffix? use string-suffix?
	* ice-9/boot-9.scm (has-suffix?): Use the core / srfi-13's
	  string-suffix?.

	Support loading of compiled syncase macros
	* ice-9/syncase.scm (current-eval-closure): New procedure.
	  (env->eval-closure): Don't default to the root module: if we have no
	  environment, we default to the current module via the logic in
	  current-eval-closure. This is because psyntax's compilation mode
	  doesn't know about guile modules, and thus won't dump the code to
	  twiddle the current eval closure.
	  (putprop, getprop, guile-macro): Use `current-eval-closure'.
	  At the end, leave the expansion-eval-closure set to #f.

	support thunks as prompts, as readline does.
	* ice-9/boot-9.scm (repl-reader): Support thunks as prompts.

	make readline's `repl-reader' impl check the current-reader fluid
	* guile-readline/ice-9/readline.scm (activate-readline): Use the current
	  binding of the current-reader fluid, if it is available.

	Fixes to make guile-vm compile in guile source tree
	* INSTALL: Updated.
	* m4/gnulib-cache.m4: Regenerated.

	* Makefile.am: Spelling fix.

	* guilec.mk:
	* src/Makefile.am:
	* src/vm.c: Update to actually work inside a guile source tree.

	* libguile/Makefile.am: Don't error on warnings in the flex-generated
	  c-tokenize function.

	merge guile-vm to guile
	An attempt to pull in the original history from guile-vm into guile itself.

2008-05-25  Andy Wingo  <wingo@pobox.com>

	Updated loop disassembly
	* benchmark/lib.scm: Update loop disassembly, with inlining. Neat!

	add inline macros for zero? and 1-
	* module/system/il/inline.scm (zero?, 1-): New inlines. Neat :) The loop
	  benchmark speedup is now up to 5x.

	Speed up the self-tail-recursive case (1x->2x)
	* benchmark/lib.scm: Add a comment, update the loop disassembly. Loop is
	  now faster in the VM, thankfully.

	* src/vm_engine.h (CACHE_PROGRAM): Only release and regrab the object
	  array handle if the program changed. That is to say, optimize the
	  self-tail-recursive case. But perhaps the thing to optimize here are
	  the procedure calls themselves. Worth looking at in the future.

	enable inlining; speed!
	* module/system/il/inline.scm: New module, implements generic inlining of
	  scheme functions. It even does the right thing regarding (define
	  arity:nopt caddr) and such. So now there are many more inlines: the
	  arithmetics, `apply', the caddr family, etc. This makes the benchmarks
	  *much* faster.

	* module/language/scheme/translate.scm (trans): Remove the
	  %scheme-primitives code in favor of the generic (scheme il inline)
	  code. Adds inlining for +, -, =, etc.

	* src/vm.c (vm_puts): Fix to work.

	* module/system/base/compile.scm (system): Export load/compile also.

	* module/system/il/compile.scm (optimize): Further debitrotting, but I
	  haven't tried this function yet. It seems that <ghil-inst> was what
	  <ghil-inline> is.

	* module/system/il/ghil.scm (*core-primitives*, *macro-module*)
	  (ghil-primitive-macro?, ghil-macro-expander, ghil-primitive?): Remove
	  these unused things.

	* module/system/il/macros.scm: Removed, replaced with inline.scm.

	* module/system/vm/assemble.scm (stack->bytes): Before, the final
	  serialization code did an (apply u8vector (apply append (map
	  u8vector->list ...))). Aside from the misspelling of append-map, this
	  ends up pushing all elements of the u8vector on the stack -- assuredly
	  not what you want. But besides even that, I think that pushing more
	  than 32k arguments on the stack brings out some other bug that I think
	  was hidden before, because now we actually use the `apply' VM
	  instruction. Further testing is needed here, I think. Fixed the code to
	  be more efficient, which fixes the manifestation of this particular
	  bug: a failure to self-compile after inlining was enabled.

	* module/system/vm/bootstrap.scm: New module, serves to bootstrap
	  boot-9's `load-compiled'. That way when we load (system vm core), we're
	  loading compiled code already.

	* module/system/vm/core.scm: Use (system vm bootstrap).

	* src/guilec.in: Use the bootstrap code, so that we really are compiling
	  with an entirely compiled compiler.

	* module/system/repl/repl.scm (default-catch-handler): An attempt at
	  making the repl print a backtrace; more work needed here.

	* module/system/vm/frame.scm (make-frame-chain): Fix some misspellings --
	  I think, anyway.

2008-05-20  Andy Wingo  <wingo@pobox.com>

	update news
	* NEWS: Update news for 0.7 release

	distcheck works now
	* guilec.mk: New file, to be included when building .go files.

	* module/language/scheme/Makefile.am:
	* module/system/base/Makefile.am:
	* module/system/il/Makefile.am:
	* module/system/repl/Makefile.am:
	* module/system/vm/Makefile.am: Use guilec.mk.

	* module/system/base/compile.scm (compiled-file-name): Work on the
	  basename of a file, so that we always create files in the directory
	  where we run. Perhaps should add a -o option to guilec in the future.

	* Makefile.am: Actually recurse into module/ in a normal build.

	include local copy of guile.m4
	* acinclude.m4: Add guile.m4 to this, because I really can't be arsed
	  with aclocal.

	* autogen.sh: More better vanilla.

	autotooling, version bump to 0.7
	* acconfig.h: Removed.

	* acinclude.m4: Use the extended AC_DEFINE for HAVE_LABELS_AS_VALUES, so
	  as to remove the need for acconfig.h.

	* autogen.sh: Use autoreconf.

	* configure.in: Update info, don't warn about non-gnu make, bump version
	  to 0.7.

	* doc/texinfo.tex: Automagically updated. (Should this be in VCS?)

	fix distcheck
	* src/Makefile.am (AM_CFLAGS, libguile_vm_la_LDFLAGS): Don't build with
	  -pg. (There are better profilers out there.)
	  (CLEANFILES): Add guilev and guile-disasm.

	* testsuite/Makefile.am (GUILE_VM): s/srcdir/builddir/.

	properly include config.h in source files, not headers
	* src/Makefile.am: Add $(DEFAULT_INCLUDES) to a couple of our custom
	  rules so we pick up the -I for config.h.

	* src/*.[ch]: Include the config.h in the C files, not in the headers.

	guile-vm is completely self-compiling now!
	* module/language/scheme/translate.scm (*the-compile-toplevel-symbol*):
	  Reset to compile-toplevel, which requires a patch to guile.

	* module/system/base/compile.scm (compile-file): Some foo so that we load
	  up the scheme language before call-with-output-file. Fixes compilation
	  of (language scheme) modules.

	* module/system/base/language.scm (define-language): Don't unquote in
	  make-language; refer to it by name instead, and export it.

	* module/system/repl/Makefile.am (vm_DATA): Don't compile describe.scm,
	  because we really can't deal with goops yet.

	* module/system/repl/repl.scm (compile-toplevel): If we're compiling, put
	  in a stub definition of start-stack, which is closely tied to the
	  interpreter.

	* src/vm_loader.c (load-program): Fix a very tricky corruption bug!

2008-05-19  Andy Wingo  <wingo@pobox.com>

	fix syntax error in describe.scm
	* module/system/repl/describe.scm (format-documentation): Remove bad
	  string syntax. This file doesn't compile though, due to define-macro
	  being a procedure->syntax macro.

	fix immediate linkage, some other fixes to allow vm/ to compile
	* module/language/scheme/translate.scm (lookup-transformer): Allow for
	  undefined variables when doing the transformation -- it's possible that
	  they come from a module definition's forward declaration.

	* module/system/repl/command.scm (import): Make into legal Scheme, caught
	  by the compiler :-)

	* module/system/vm/assemble.scm (<vlink-now>): Remove the module field.
	  Immediate bindings will now always be relative to the current module.
	  Fixes some mess about process-define-module not being defined when
	  loading modules, probably because we destructively modified the
	  ghil-env.
	  (codegen, dump-object!): Don't dump a module name.

	* src/vm_loader.c (link-now): Just use scm_lookup.

	bind all module-level variables lazily
	comments in ghil-lookup are pertinent.

	* module/system/il/compile.scm (make-glil-var): Require that ghil vars
	  have environments. Remove the 'unresolved case -- we'll treat all
	  module-level variables as late bound.

	* module/system/il/ghil.scm (ghil-lookup): Treat all module level vars as
	  late bound.

	* module/system/vm/assemble.scm: Instead of vlink and vlate-bound, have
	  vlink-now and vlink-later.
	  (codegen): Add a bunch of crap to get the various cases right.
	  (object-assoc, dump-object!): Handle the new cases, remove the old
	  cases.

	* src/vm_loader.c (link-now, link-later): Change from link and lazy-bind.
	  Include the module in which the link is to be done, so that callers
	  from other modules get the right behavior.

	* src/vm_system.c (late-variable-ref, late-variable-set): Instead of a
	  sym, the unbound representation is a module name / symbol pair.

	* testsuite/run-vm-tests.scm (run-vm-tests): Remove some debugging.

	Add instructions for doing very late binding
	Fixes the mutually-recursive toplevel definitions case. This could be
	fixed by rewriting bodies as letrecs, as r6 does, but that's not really
	repl-compatible.

	* module/system/il/ghil.scm (ghil-lookup): Ok, if we can't locate a
	  variable, mark it as unresolved.

	* module/system/il/compile.scm (make-glil-var): Compile unresolved
	  variables as <glil-late-bound> objects.

	* module/system/il/glil.scm: Add <glil-late-bound> definition.

	* module/system/vm/assemble.scm (codegen): And, finally, when we see a
	  <vlate-bound> object, allocate a slot for it in the object vector,
	  setting it to a symbol. Add a new pair of instructions to resolve that
	  symbol to a variable at the last minute.

	* src/vm_loader.c (load-number): Bugfix: the radix argument should be
	  SCM_UNDEFINED in order to default to 10.
	  (late-bind): Add an unresolved symbol to the object vector. Could be
	  replaced with load-symbol I guess.

	* src/vm_system.c (late-variable-ref, late-variable-set): New
	  instructions to do late symbol binding.

	* testsuite/Makefile.am (vm_test_files):
	* testsuite/t-mutual-toplevel-defines.scm: New test, failing for some
	  reason involving the core even? and odd? definitions.

	compile all of base/; some arbitrary changes; more "fixes" to `link'
	* module/language/scheme/translate.scm (lookup-transformer): When
	  expanding syncase macros, use the eval closure from the ghil-env.
	  Probably doesn't make any difference whatsoever.

	* module/system/base/Makefile.am (SOURCES): Compile pmatch.scm, now that
	  it works :-))

	* module/system/base/compile.scm (compile-in): Compile inside a
	  save-module-excursion, so that side effects of evaluation don't leak
	  out.

	* module/system/base/pmatch.scm: Change from :use-syntax/:export-syntax
	  to simply :use-modules/:export. Also probably has no effect.

	* module/system/il/ghil.scm (fix-ghil-mod!): Suppress warnings resulting
	  from compilation of define-module.

	* src/vm_loader.c (link): So, referencing variables defined but not
	  exported from the current module didn't work. Fixed that, but it's
	  hacky. There are still some uncaught cases.

	syncase macros compiling!
	* module/system/base/compile.scm: Also import load-objcode from (system
	  vm core).

	* module/language/scheme/translate.scm (lookup-transformer): Use
	  sc-expand3 in compilation mode when compiling macros. Yay, syncase
	  macros compile!

2008-05-15  Andy Wingo  <wingo@pobox.com>

	rudimentary syncase support; some dash symbol syncase removal
	* module/system/vm/assemble.scm (dump-object!):
	* src/vm_loader.c (VM_DEFINE_LOADER): Use scm_from_locale_keywordn, not
	  the krazy dash symbol stuff.

	* module/language/scheme/translate.scm (lookup-transformer): Add a
	  special case for syncase macros.

	avoid zealous unquotation
	* module/system/base/syntax.scm (define-record): Again, don't unquote in
	  actual objects, because this is uncompilable. Ah well. At least now all
	  of base/ is compiling.

	* module/system/vm/assemble.scm (dump-object!): More debug info.

	fix else in cond, letrec env corruption, syntax.scm compile, define-module side effects
	* module/language/scheme/translate.scm (primitive-syntax-table):
	  Translate the `else' clause of a cond as (begin ...). We used to use
	  trans-body, which processes internal defines, which are not legal
	  syntax here.

	* module/system/base/syntax.scm (define-record): Unfortunately, we can't
	  unquote in the actual procedure for `%compute-initargs', because that
	  doesn't work with compilation. So reference %compute-initargs by name,
	  and export it.

	* module/system/il/ghil.scm (apopq!): Gaaaaar. The order of the arguments
	  to assq-remove! was reversed, which was the badness, causing corruption
	  to the env after calling call-with-ghil-bindings. Grrrrrr.

	  (fix-ghil-mod!, ghil-lookup, ghil-define): As amply commented in the
	  code, deal with compile-time side effects to the current module by
	  lazily noticing and patching up the compile-time environment. A hacky
	  solution until such a time as we special-case something for
	  `define-module'.

	`link' instruction links to symbols by module
	* module/system/il/compile.scm (make-glil-var): Only dump the module if
	  we actually have one.

	* module/system/il/ghil.scm (ghil-define): Make sure that ghil-var-env is
	  a ghil-env.

	* src/vm_loader.c (link):
	* module/system/vm/assemble.scm (dump-object!): Rewrite `link' to take
	  two Scheme arguments on the stack: the symbol, as before, and the
	  module in which the symbol was found at compile time. This introduces
	  some undesireable early binding, but it does let the vm load up
	  modules, and (potentially) have multiple modules in one .go file. On a
	  practical level, I can now compile modules and have their .go files
	  load up the modules' dependencies as necessary.

	remove some debugging info
	* module/system/vm/assemble.scm: remove a pk

	push the module resolution info for variables down into glil
	* module/system/il/compile.scm (make-glil-var): Make the :mod of the
	  glil-var actually a guile module, not a ghil-env.

	* module/system/il/ghil.scm (module-lookup, ghil-lookup): For module
	  variables, encode the location where we found the variable in the
	  ghil-var.

	fix dumping of #:keywords
	* module/language/scheme/translate.scm (trans):
	* module/system/il/compile.scm (codegen): When making records where a
	  value can be a keyword, make sure to use the keyword initialization
	  form, so that the record initializer doesn't interpret the keyword as a
	  slot name.

	* module/system/base/Makefile.am (vm_DATA): For now, don't compile
	  pmatch.

	allow interpretation of load-toplevel as compile-toplevel
	* module/language/scheme/translate.scm (*the-compile-toplevel-symbol*)
	  (primitive-syntax-table): Existing eval-case invocations in boot-9.scm
	  only have `load-toplevel', not `load-toplevel' and `compile-toplevel'
	  as they should. Allow for interpreting `load-toplevel' as
	  `compile-toplevel'.

	rework eval-case handling to be like cl's eval-when
	* module/language/scheme/translate.scm (trans): Remove the hacky case for
	  the unspecified value, not needed any more.
	  (primitive-syntax-table): Rework eval-case to understand
	  compile-toplevel and evaluate contexts, as in common lisp's eval-when:
	  http://www.lisp.org/HyperSpec/Body/speope_eval-when.html
	  This is the Right Thing.

2008-05-14  Andy Wingo  <wingo@pobox.com>

	fix use-syntax / use-modules confusion -- fixes testsuites
	* testsuite/t-match.scm:
	* testsuite/t-records.scm: While the attempt to redefine use-syntax as
	  being "use during compilation" was cute, it does not reflect the
	  historical usage of use-syntax, nor does it correspond to existing code
	  that includes other modules and uses them during compilation.

	  So use-syntax has been replaced with use-modules. The test suites now
	  pass. In the future, compilation phases should be done on whole
	  modules, I think; r5rs-style computation does not have phases.

	fix macro compilation via hooking into eval-case
	* module/language/scheme/translate.scm (eval-at-compile-time)
	  (&compile-time-module, expand-macro): Remove this attempt at dealing
	  with macros. Instead, we're going to rely on macros being first-class,
	  and just catch eval-case at the bottom.
	  (lookup-transformer): Lookup all syntax transformers in the module's
	  eval closure. We catch the primitive-macros, compiling them to ghil,
	  and expand the rest.
	  (lookup-transformer): Fold in trans-pair here. Add a hacky case for the
	  unspecified value; the problem shows up when compiling e.g.
	  (define-macro (plus! x) `(set! ,x (1+ x))), as a fallout from
	  eval-case.
	  (make-pmatch-transformers, primitive-syntax-table): Define the
	  primitive syntax transformers as a data-driven table instead of a
	  function. There's a bit of syntax, too. Eval-case was rewritten to use
	  pmatch.

	* module/system/base/compile.scm (scheme): Define as a thunk instead
	  of a value, so as to allow (language scheme translate) to be imported
	  in the repl. Still, a hack.

	(void) -> (begin)
	* module/language/scheme/translate.scm (expand-macro, trans-pair): Remove
	  support for the scheme form, '(void). Replace it by (begin). What was
	  Keisuke thinking? :)

	remove x.foo.bar -> (slot x 'foo 'bar) compile-time translation
	* module/language/scheme/translate.scm (trans): Remove compile-time dot
	  expansion.

2008-05-13  Andy Wingo  <wingo@pobox.com>

	fix env script
	* env: Fix env script to find $top_srcdir correctly

	Update Makefile.am's; remove slib import
	* Makefile.am:
	* module/Makefile.am:
	* module/language/scheme/Makefile.am:
	* module/system/Makefile.am:
	* module/system/base/Makefile.am:
	* module/system/il/Makefile.am:
	* module/system/repl/Makefile.am:
	* module/system/vm/Makefile.am: Cleaned up to be more complete, if not
	  completely working.

	* module/guile/slib.scm:
	* module/slib/: Removed the slib import; it's a bit out of place here,
	  and bitrotten at that.

2008-05-12  Andy Wingo  <wingo@pobox.com>

	add env script
	* env: New file, run as ./env guile

	catch errors in the repl, with poor backtraces
	* module/system/repl/repl.scm (default-pre-unwind-handler)
	  (default-catch-handler): New procedures, to do some error handling in
	  the repl.
	  (start-repl): Catch errors in the repl loop.

	replace cenv with things in <repl> and fluids; remove the `use' meta-command
	* module/system/base/compile.scm (<cenv>): No more cenv, it was a useless
	  data structure.

	* module/system/repl/command.scm (*command-table*): Remove `use', it's
	  the same as `import'. Otherwise in this file, adapt to the repl having
	  direct pointers to the vm and the language, and to the module being in
	  the current-module fluid.

	* module/system/repl/repl.scm (prompting-meta-read):
	* module/system/repl/common.scm (<repl>): The repl now has a direct
	  pointer to the vm and language. Adapt accordingly.

	fixes so that typing asdfadfasff in the repl doesn't error
	Before:

	> ,c (set! x 3)
	   0    (make-int8 3)                   ;; 3
	   2    (link "x")
	   5    (variable-set)

	> ,c (define x 3)
	   0    (make-int8 3)                   ;; 3
	   2    (link "x")
	   5    (variable-set)

	After:
	> ,c (define x 3)
	   0    (make-int8 3)                   ;; 3
	   2    (define "x")
	   5    (variable-set)

	* src/vm_loader.c (link): `link' now errors if the variable is undefined.
	  This corresponds with desired behavior, for both `ref' and `set'
	  operations, for scheme. It's not what elisp wants, though. Perhaps
	  elisp linking needs another instruction.
	  (define): New instruction, the same as calling scm_define(), basically.

	* module/language/scheme/translate.scm (trans-pair): Don't try to look up
	  an existing variable definition when translating `define'; instead use
	  the special-purpose lookup from ghil.scm's `ghil-define'.

	* module/system/il/compile.scm (codegen): Compile to a different kind of
	  variable access from `set!', specifically via passing 'define as the op
	  to `make-glil-var'.

	* module/system/il/ghil.scm (ghil-lookup): Don't add to the module table
	  when compiling variable sets via `set!'.
	  (ghil-define): New procedure, for looking up variables for `define'.

	* module/system/vm/assemble.scm (<vdefine>): New record: a new
	  instruction type.
	  (codegen): Compile `define' module vars into <vdefine>.
	  (dump-object!): <vdefine> == `define'.

2008-05-11  Andy Wingo  <wingo@pobox.com>

	only allow `define' at toplevel
	* module/language/scheme/translate.scm (trans-pair): Add a guard to only
	  allow `define' at the top level; other defines are already filtered out
	  via trans-body.

	* module/system/il/ghil.scm (ghil-env-toplevel?): Export, and fix.

	remove define-private
	* module/language/scheme/translate.scm: Remove define-private.

	explicitly list exports instead of using define-public
	* module/system/base/compile.scm:
	* module/system/il/ghil.scm:
	* module/system/repl/describe.scm:
	* module/system/vm/core.scm:
	* module/system/vm/frame.scm:
	* module/system/vm/trace.scm: Explicitly list exports in the module
	  declaration instead of using define-public.

	<foo>? -> foo?; some exports cleanups
	* module/system/base/compile.scm: Export cenv? also.

	* module/system/base/syntax.scm: Clean up vestiges of the old structure
	  code. Make accessors defined as foo? instead of <foo>?.

	* module/system/il/glil.scm:
	* module/system/il/ghil.scm: Remove <foo>-1 accessors, since we have
	  named accessors.

	pmatchify a cond for prettiness
	* module/language/scheme/translate.scm: pmatchify, it's prettier.

	fix to meta-reader's optional port argument
	* module/system/repl/repl.scm (meta-reader): Make the generated read
	  procedure accept a port argument.

2008-05-09  Andy Wingo  <wingo@pobox.com>

	ice-9 history integration
	* module/system/repl/repl.scm (start-repl): (ice-9 history) integration
	  via the before-eval-hook and the before-print-hook.

	readline integration for guile-vm
	* module/system/repl/common.scm (repl-prompt): Return a string instead of
	  outputting to the port, for better readline integration.

	* module/system/repl/repl.scm (meta-reader, prompting-meta-read)
	  (start-repl): Integrate with (ice-9 readline) via the current-reader
	  fluid and the repl-reader function, both from boot-9.scm.

	more exports cleanups
	* module/system/repl/common.scm: Declare exports in the module
	  declaration.

	multiple-values help for the repl; exports cleanups
	* module/system/repl/command.scm (system): Declare exports in the module
	  declaration.

	* module/system/repl/repl.scm (start-repl): If the evaluation returns
	  multiple values, print them separately.

2008-05-04  Andy Wingo  <wingo@pobox.com>

	Replace ice-9 match's structures with guile's records
	* module/system/base/syntax.scm (define-record): Rebase to implement on
	  top of Guile's records, which are the substrate of srfi-9's records.
	  (%compute-initargs): Rename from %make-struct, just return the list of
	  values.
	  (get-slot, set-slot!, slot): Removed, no longer used.
	  (record-case): Allow slots of the form (MYNAME SLOTNAME), which binds
	  SLOTNAME to MYNAME (instead of SLOTNAME to SLOTNAME).
	  (record-case, record?): No more ice-9 match!

	* module/system/il/compile.scm (codegen): Tweaks so that the new record
	  code works.

	* module/system/il/ghil.scm: Fix some slot references.

	* module/system/vm/assemble.scm (preprocess, codegen): Remove calls to
	  `slot'.
	  (codegen): Fix some slot references.

	Removed dot-expander syntax foo
	* module/system/base/syntax.scm (expand-dot!, expand-symbol, syntax):
	  Removed, we don't use this syntax any more.

	finish dedottifying
	* module/system/base/compile.scm: Dedottify.

	* module/system/base/language.scm: Export language accessors.

	* module/system/repl/common.scm: Dedottify. It's ugly, I know.

	more dedottification, almost done
	* module/system/repl/common.scm:
	* module/system/base/compile.scm: Export some more things.

	* module/system/repl/command.scm: Dedottify.

	Dedottify some more
	* module/system/il/compile.scm: Dedottify.

	* module/system/il/ghil.scm: Export some more thingies.

	procedures-with-setters, debitrot `optimize', dedottification
	* module/system/base/syntax.scm (define-record): Define the accessors as
	  procedures-with-setters, not just as getters.

	* module/system/il/compile.scm (optimize): This function was bitrotten
	  since the addition of source locations in
	  cb4cca12e719edfef1740f238d9187c21c8e1e35. Untested attempts to
	  de-bitrot it. Dedottify as well.

	* module/system/il/ghil.scm:
	* module/system/il/glil.scm (unparse):
	* module/system/vm/debug.scm (debugger-repl): Ongoing dedottification.

	fix errors in (language scheme translate) introduced in pmatchification
	* module/language/scheme/translate.scm (trans-pair): Fix some errors
	  introduced in pmatchification.

	Start the process of de-dottification.
	* module/system/vm/assemble.scm: De-dottify.

	Define named accessors for legacy record types
	* module/system/base/syntax.scm (define-record): Define named accessors,
	  to prepare the code for srfi-9 records switchover.

	* module/system/il/ghil.scm:
	* module/system/il/glil.scm: Export a bunch of named accessors.

	Refactor (language scheme translate) to use pmatch
	* module/language/scheme/translate.scm: Refactor use of `match' to use
	  `pmatch'. Relatively straightforward.

	* module/system/base/pmatch.scm (ppat): Fix some copy-n-paste bugs: the _
	  rule, the quote rule.

2008-05-03  Andy Wingo  <wingo@pobox.com>

	more pmatchification
	* module/system/il/ghil.scm: No need for a match

	* module/system/repl/command.scm: Pmatchify

	* module/system/vm/disasm.scm: Pmatchify.

	bugfix to make-cenv
	* module/system/base/compile.scm (make-cenv): Fix make-cenv.

	start using pmatch instead of match
	* module/system/base/Makefile.am: Add pmatch.scm.

	* module/system/base/pmatch.scm: New file, taken from Dan Friedman's
	  alpha-kanren paper. Implements a less magical match syntax, pmatch.

	* module/system/vm/assemble.scm: No more need for (ice-9 match).

	* module/system/vm/conv.scm (code-pack, code->object): Change to use
	  pmatch.

	s/match-lambda\*/case-lambda/g
	* module/system/il/macros.scm: Use case-lambda from srfi-16 rather than
	  match-lambda*.

	convert a couple more modules to record-case
	* module/system/base/syntax.scm (record-case): Capture the match macro.

	* module/system/il/glil.scm:
	* module/system/il/compile.scm: Convert to record-case.

	unify variant types and records; also make-foo instead of <foo>
	* module/system/base/syntax.scm (define-record): Rework to separate the
	  type and its constructor. Now (define-record (<foo> bar)) will create
	  `make-foo' as the constructor, not `<foo>'. Also the constructor now
	  takes either keyword or positional arguments, so that it can be used as
	  the implementation of variant types as well.
	  (|): Map directly to define-record instead of rolling our own thing.

	* module/language/scheme/translate.scm:
	* module/system/base/language.scm:
	* module/system/il/compile.scm:
	* module/system/il/ghil.scm:
	* module/system/il/glil.scm:
	* module/system/repl/common.scm:
	* module/system/vm/assemble.scm:
	* module/system/vm/debug.scm: Change instances of record creation to use
	  the make-foo procedures instead of <foo>. Adjust module exports as
	  necessary.

	Convert assemble.scm to use record-case.
	* module/system/base/syntax.scm (record?): Temporarily export this thing,
	  so that code will remain correct when I change to srfi-9 records.

	* module/system/vm/assemble.scm: Convert to use record-case.

	fix to (system base syntax)'s syntax
	* module/system/base/syntax.scm: Fix define-module

	rebase record-case on `match'
	* module/system/base/syntax.scm (record-case): Rebase on `match', for
	  transition purposes.

	pull in srfi-9, implement record-case
	* module/system/base/syntax.scm: Pull in srfi-9. Define a record-case
	  macro that will replace (match foo (($ <type> slot ...) body...)).

2008-05-02  Andy Wingo  <wingo@pobox.com>

	clean up some syntax imports and exports
	* module/system/base/syntax.scm (system): Don't re-export receive or
	  and-let*; modules should explicitly import these if they want to. Don't
	  export an empty stack-catch definition!

	* module/system/repl/command.scm (system): Pull in and-let*.

	* module/system/vm/disasm.scm (system): Don't import and-let*.

	remove module.scm
	* module/system/base/module.scm: Removed module.scm, as it was unused
	  (see 9419ff9ae91c93983972797e607e135ecd1233bb).

	cleanups in syntax.scm
	* benchmark/lib.scm (fibo): Make fibo actually a fibonacci sequence.

	* module/system/base/syntax.scm (system): Forward-declare all exports.
	  (expand-symbol, slot): Rewrite expand-symbol to expand to a
	  non-recursive invocation of `slot', so that in the future when we get
	  rid of this syntax, the replacement will be more palatable to the eyes.

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Slowly improving support for macro compilation.
	* module/language/scheme/translate.scm (&current-macros): Removed.
	  (&current-macro-module): Removed.
	  (&compile-time-module): New.
	  (eval-at-compile-time): New.
	  (translate): Initialize `&compile-time-module'.
	  (expand-macro)[use-syntax]: New case.
	  [begin let...]: Don't expand these built-in macros.
	  [else]: Rewrote the macro detection and invocation logic.  Invoke macro
	  transformers in the current compile-time module.
	  (trans): Let `expand-macro' raise an exception if needed.
	  (trans-pair)[defmacro define-macro]: Evaluate the macro definition in
	  the compile-time module.

	* testsuite/t-match.scm: Use `use-syntax' instead of `use-modules' for
	  `(ice-9 match)' and `(srfi srfi-9)'.

	* testsuite/t-records.scm: Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-15

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	Fixed `autogen.sh' and removed `module' from the list of dirs to build.
	* autogen.sh: Fixed (call `libtoolize').

	* Makefile.am (SUBDIRS): Removed `module' which doesn't build right now.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-16

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Improved macro handling; started documenting the issue.
	* doc/guile-vm.texi (Compiling Scheme Code): New node.

	* module/language/scheme/translate.scm (&current-macro-module): New.
	  (translate): Evaluate macros in `&current-macro-module'.
	  (trans-pair): Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-13

	Fixed the exception handler of `guilec'.
	* src/guilec.in: Fixed the exception handler.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-12

	Encode the length of constant lists/vectors on 2 octets instead of 1.
	* module/system/vm/assemble.scm (dump-object!): New sub-procedure
	  `too-long'.  For `list' and `vector', encode the length on 2 octets
	  instead of 1 and report an error if a list/vector is longer than 65535.

	* module/system/vm/disasm.scm (original-value): New sub-procedure
	  `list-or-vector?'; when true, return the number of elements for that
	  list/vector.

	* src/vm_system.c (list): Fetch the length as a two-octet integer.
	  (vector): Likewise.

	* testsuite/t-basic-contructs.scm: New.

	* testsuite/Makefile.am (vm_test_files): Added the above file.

	* module/system/vm/core.scm (load-compiled): Added a bit of
	  documentation.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-11

	Renamed the library from `libguilevm' to `libguile-vm'.
	* src/Makefile.am (lib_LTLIBRARIES): Renamed to `libguilevm.la' to
	  `libguile-vm.la'.

	* module/system/vm/core.scm: Dynamic-link "libguile-vm" instead of
	  "libguilevm.so".

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-10

	Added support for `defmacro' and `define-macro' in the compiler.
	* module/language/scheme/translate.scm: Use `(srfi srfi-39)'.
	  (&current-macros): New top-level.
	  (expand-macro): New.
	  (scheme-primitives): Renamed `%scheme-primitives'.
	  (%forbidden-primitives): New.
	  (trans): Use `expand-macro' instead of `macroexpand'.
	  (trans-pair): Handle `define-macro' and `defmacro'.

	* module/system/base/compile.scm (call-with-compile-error-catch): Handle
	  non-pair LOC.

	* testsuite/t-macros2.scm: New test case.

	* testsuite/Makefile.am (vm_test_files): Updated.

	* testsuite/t-macros.scm: Test `read-options'.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-9

	Fixed an "unbound variable" in `(system vm conv)'.
	* module/system/vm/conv.scm: Autoload `(system vm core)' also when
	  `opcode->instruction' is hit.  This fixes an "unbound variable" problem.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-8

	Fixed error handling; detect and report macro expansion errors.
	* module/language/scheme/translate.scm (trans): Catch exceptions thrown
	  by `macroexpand' and throw a syntax error.
	  (trans-pair): Catch calls to `procedure->memoizing-macro' and raise a
	  syntax error.

	* module/system/base/compile.scm (call-with-compile-error-catch): Made a
	  macro (a procedure doesn't do the job).
	  (compile-file): Uncommented call to `call-with-compile-error-catch'.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-7

	Tried compiling more code; augmented the doc.
	* module/language/Makefile.am: New.

	* module/language/scheme/Makefile.am: New.

	* configure.in: Produce these two new Makefiles.

	* doc/guile-vm.texi: Documented `compile-file', `compiled-file-name', and
	  `compile-in'.

	* module/system/base/compile.scm: Cosmetic changes.

	* module/system/base/language.scm: Likewise.

	* module/system/il/Makefile.am: Tried (and failed) to compile more
	  things.

	* module/system/vm/Makefile.am: All source files in here can now be
	  compiled without harming further compilation.

	* module/system/vm/assemble.scm: Select only specific bindings from
	  `(system vm core)'.
	  (dump-object!): Show a more meaningful error message.

	* module/system/vm/conv.scm: Select only specific bindings from `(system
	  vm core)'.

	* module/system/vm/debug.scm: Likewise.

	* module/system/vm/frame.scm: Changed the header.  Use a renamer for
	  `(system vm core)'.

	* src/guilec.in: Added options, via `getopt-long'.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-6

	Fixed a Scheme translation bug; cleaned compilation with GCC 4.
	* module/language/scheme/translate.scm (trans-pair): In the `set!' case,
	  when a procedure-with-setter is passed, call `trans:pair' with an
	  actual pair.  This fixes a long-lasting bug which prevented compilation
	  of `set!' statements with procedures-with-setter (this showed up when
	  compiling `(system vm assemble)').

	* module/system/base/compile.scm: Added `objcode->u8vector' to the
	  `#:select' clause.

	* module/system/base/syntax.scm: Cosmetic changes.

	* module/system/vm/assemble.scm (preprocess): Removed debugging
	  statements.

	* src/frames.c: Cosmetic changes.

	* src/frames.h (SCM_FRAME_SET_DYNAMIC_LINK): New.

	* src/objcodes.c: Use `scm_t_uint8' instead of `char' when relevant.

	* src/vm.c (vm_heapify_frames_1): Use `SCM_FRAME_SET_DYNAMIC_LINK ()'.

	* src/vm_loader.c: Added casts to mute GCC 4 warnings.

	* testsuite/run-vm-tests.scm (*scheme*): Renamed to `%scheme'.
	  (run-test-from-file): Renamed to `compile/run-test-from-file'.
	  (run-vm-tests): Run each test using both the VM and the interpreter;
	  compare the results.

	* testsuite/t-proc-with-setter.scm: Try out `get/set'.

	* doc/Makefile.am (info_TEXINFOS): New.

	* doc/guile-vm.texi: Added index entries and indices.

	* doc/texinfo.tex: New file.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-5

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	Minor binding name clash tweak.
	* module/system/base/compile.scm: Only import `the-vm' and `vm-load' from
	  `(system vm core)'.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-10

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Started documenting the compiler.
	* doc/guile-vm.texi:  Documented the compiler (node `The Compiler').
	  Removed a number of things that might have been relevant to Guile-VM 0.0.

	* module/system/il/compile.scm (optimize):  Commented out the case
	  using `<ghil-inst?>'.

	* src/vm_engine.c (vm_run)[objects_handle]:  New variable.
	  Before leaving the function, release OBJECTS_HANDLE.

	* src/vm_engine.h (CACHE_PROGRAM):  Use `scm_vector_writable_elements'
	  instead of `scm_vector_elements';  don't release the handle right away.

	* src/vm_loader.c (load-program):  New commented out piece of code
	  dealing with simple vectors.

	* src/vm_system.c (object-ref):  Added the type of OBJNUM.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-3

	* src/objcodes.c (make_objcode_by_mmap):  Fixed the error type when the   object file is too small.
	* doc/guile-vm.texi:  Documented `make-closure'.  Improved the documentation
	  of `load-program'.

	* testsuite:  New directory.

	* configure.in:  Added `testsuite/Makefile' to `AC_OUTPUT'.

	* Makefile.am (SUBDIRS):  Added `testsuite'.

	* src/vm_engine.h (VM_CHECK_OBJECT):  New option.
	  (CHECK_OBJECT):  New macro.

	* src/vm_system.c (object-ref):  Use VM_CHECK_OBJECT.

	* module/system/vm/assemble.scm (preprocess):  Commented out the debugging
	  code.

	* benchmark/lib.scm (do-loop):  New procedure.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-2

	Removed a few more deprecated function calls;  documented closures.
	* src/Makefile.am (.c.x):  Fixed the rule.

	* src/envs.c:  Use `scm_hash_get_handle ()' instead of
	  `scm_sym2ovcell_soft ()' and `scm_hash_create_handle_x ()' instead of
	  `scm_intern_symbol ()'.

	* src/objcodes.c (bytecode->objcode):  Don't use `SCM_VALIDATE_INUM', use
	  `SCM_VALIDATE_NUMBER' instead.
	  (make_objcode_by_mmap):  Check whether the file is smaller than the
	  magic cookies; check whether the magic cookies are there.

	* src/frames.c (frame-local-ref):  Likewise, but use `SCM_MAKE_VALIDATE'.
	  (frame-local-set!):  Likewise.

	* src/instructions.c (opcode->instruction):  Likewise.

	* src/programs.c (program-external-set!):  New function.

	* src/guile-disasm.in:  New file.

	* src/Makefile.am:  Produce `guile-disasm'.

	* doc/guile-vm.texi:  Documented `external-ref', `external-set', `local-ref'
	  and `local-set'.

	* module/system/vm/disasm.scm (disassemble-bytecode):  Fixed the way
	  `load-program' is represented.

	git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-1

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	Playing with the procedure call mechanism.
	* src/objcodes.c (do-pair):  New experiment.
	* src/vm_engine.h (ALIGN_AS_NON_IMMEDIATE):  New macro.
	  (POP_LIST_ON_STACK):  New experimental macro.
	* src/vm_engine.c (call):  In the procedure call case, I tried using the above
	  macro.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-8

	Fixed a stack leak.  Now observing actual performance.
	* src/*.[ch]:  Replaced `scm_mem2symbol' by `scm_from_locale_symboln' and
	  `scm_ulong2num' by `scm_from_ulong'.
	* src/vm_system.c (tail-call):  Fixed stack leak (SP lacked decrement by
	  one more Scheme object in the tail-recursive case).
	* benchmark/measure.scm (measure):  Make sure we are using the compiled
	  procedure (i.e. a program object) when measuring.  This yields better
	  results than before.  :-)
	* doc/guile-vm.texi:  Augmented the instruction set documentation with
	  branch instructions, `call' and `tail-call'.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-7

	Improved the VM's efficiency.  The VM is as fast as the interpreter.  :-(
	* benchmark/lib.scm:  New file.
	* benchmark/measure.scm:  New file.
	* README:  Added useful pointers to various threads.
	* doc/guile-vm.texi:  Fixed the description of `load-program' (it now expects
	  _immediate_ integers).
	* src/*.[ch]:  Use immediate integers whereever possible, as in the original
	  code.  For `CONS', use `scm_cell' rather than `scm_cons'.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-6

	Got the VM up and running!  Augmented the documentation.
	* src/*.[ch]:  Replaced the remaining `SCM_MAKINUM', and changed `SCM_VELTS'
	  into `scm_vector_elements ()'.
	* src/vm_loader.c (link):  Fixed so that it pushed a variable object on
	  the stack.
	* src/vm_system.c (variable-ref):  Fixed so that it uses `scm_variable_ref ()'
	  and friends.
	* module/system/vm/assemble.scm (dump-object!):  Fixed the string case.
	* src/vm_engine.h (CONS):  Use `scm_cons' instead of `SCM_NEWCELL'.
	* doc/guile-vm.texi:  Added actual instruction definitions, explanations of
	  the program invocation mechanism, programs' object tables, etc., in the
	  `Instruction Set' chapter.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-5

	Fixed the compiler, got the disassembler working.
	* doc/guile-vm.texi:  Texified and cleaned up.
	* src/vm.c:  Use `scm_from_locale_string ()' instead of `scm_makfrom0str ()'.
	* src/vm_engine.c:  Likewise.
	* src/programs.c (scm_program_bytecode):  Return a u8vector instead of a string.
	* module/system/vm/conv.scm (make-byte-decoder):  Fixed a few things wrt. to
	  the string to u8vector transition.
	* src/objcodes.c (bytecode->objcode):  Fixed a bug where the last 10 bytes of
	  the bytecode where ignored.
	* module/system/vm/assemble.scm (dump-object!):  Don't convert everything
	  to a u8vector, keep strings where it makes sense.
	* module/system/vm/conv.scm (code->bytes):  Accordingly, convert strings to
	  u8vectors when needed.
	  (make-byte-decoder):  Accordingly too, when decoding instructions, return
	  variable-length instructions' argument as strings except for `load-program'.
	* module/system/vm/disasm.scm:  Export `disassemble-bytecode'.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-4

	Updated the assembly process so that `u8vectors' are used.  Compilation works.
	* module/system/vm/conv.scm (encode-length):  Use u8vectors.
	  (code->bytes):  Likewise.
	* module/system/vm/assemble.scm (codegen):  Use u8vectors instead
	  of strings.
	* src/objcodes.c (objcode->string):  Removed.
	  (objcode->u8vector):  New function.
	* module/system/base/compile.scm (compile-file):  Use `objcode->u8vector'
	  and `uniform-vector-write'.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-3

	Translation from Scheme to GHIL, and compilation to GLIL work.
	* src/*.c:  Removed calls to `scm_must_malloc', `SCM_MUST_MALLOC' and
	  `scm_must_free'.  Same for `SCM_INUMP', `SCM_INUM', `SCM_STRING_CHARS',
	  and the likes.
	* module/system/base/syntax.scm:  Do not import `(ice-9 match)' and do
	  not re-export `match', do not export `syntax-error' which was not
	  defined here.
	* module/system/base/compile.scm (call-with-compile-error-catch):  Use
	  the `catch' form instead of `try'.
	* src/instructions.c:  Use `scm_from_char ()' instead of the deprecated
	  macro `SCM_MAKINUM ()'.
	* src/instructions.h (scm_instruction):  Made `npop' a signed char.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-2

	Updated the C code base so that it compiles with Guile 1.7.2.
	* src/*.[ch]:  Introduced changes so that it compiles with Guile 1.7.2.

	git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-1

2001-05-02  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

2001-04-25  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

2001-04-23  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

2001-04-22  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

2001-04-20  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

2001-04-19  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

2001-04-16  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

2001-04-15  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

2001-04-14  Keisuke Nishida  <kxn30@po.cwru.edu>

	SLIB init file for Guile.

	Import SLIB 2d1.

2001-04-13  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

2001-04-12  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

2001-04-11  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

2001-04-10  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

2001-04-09  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

2001-04-08  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	apply

	*** empty log message ***

2001-04-07  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

2001-04-06  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

2001-04-05  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

	*** empty log message ***

2001-04-04  Keisuke Nishida  <kxn30@po.cwru.edu>

	Quick documentation.

	Don't use module.scm.

	*** empty log message ***

	Better current module system support.

	Don't load modules explicitly at initialization.

	Current module support hack.

	Current module support hack.

2001-04-03  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

2001-04-01  Keisuke Nishida  <kxn30@po.cwru.edu>

	New files.

	*** empty log message ***

	New VM.

	*** empty log message ***

2000-10-06  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	Use `values\' and `call-with-values\'.

2000-09-29  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	Create *.i from *.c and include them.

2000-09-28  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	Indirect threaded.  Performance is the same as before.  Wow\!

2000-09-22  Keisuke Nishida  <kxn30@po.cwru.edu>

	ChangeLog

	* src/vm.c: SCM_CHARS -> SCM_SYMBOL_CHARS.

	*** empty log message ***

	* src/vm_system.c (call): Call return-hook before reinstating a continuation. (tail_call): Call return-hook before a proper tail call.

2000-09-20  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	* src/vm_system.c (br_if_not_null): Set ac = SCM_BOOL_F if not null.

	*** empty log message ***

	* src/vm_number.c (FUNC2): New macro. (add2, sub2): Use FUNC2. (remainder): New instruction.

	* vm/bytecomp.scm (translate-ref): Combined translate-local-ref, translate-external-ref, and translate-top-level-ref. (translate-set): Combined translate-local-set, translate-external-set, and translate-top-level-ref. Set a name to the object. (translate-and, translate-or): Bug fixed.

	* vm/shell.scm (vm-frame->call): Updated.

	* src/vm_system.c (name): New instruction. (savet): Don't set name.

	* src/vm.c (scm_name_property): New variable. (scm_name, scm_set_name_x): New procedures. (scm_smob_print_with_name, init_name_property): New functions. (print_program, scm_program_name): Removed. (init_program_type, init_vm_type): Use scm_smob_print_with_name. (scm_init_vm): Call init_name_property.

	*** empty log message ***

	* src/vm_scheme.c (cons): Bug fixed. * src/vm_system.c (br_if_null): Set ac = SCM_BOOL_T if null.

2000-09-11  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	* autogen.sh: Run aclocal with check where guile.m4 is installed.

	*** empty log message ***

	* src/vm_system.c (push_list): New instruction. * src/vm_engine.c (VM_NAME): Don\'t validate VM and PROGRAM. * src/vm.c (scm_vm_apply): New procedure. (apply_program): New function. (init_program_type): Set the apply function for the program type.
	* src/vm.c (lookup_variable): Use scm_eval_closure_lookup.

2000-09-04  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	* src/vm_system.c (tail_call): Use SCM_TICK at the beginning.

2000-09-02  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	* src/vm_engine.c (VM_NAME): Renamed the variable `an\' to `nargs\'. Removed the variables `a2\' and `a3\'. * src/vm_engine.h (VM_SETUP_ARGS2, VM_SETUP_ARGS3): Setup local variables. (VM_SETUP_ARGS4): Removed. * src/vm_system.c, src/vm_scheme.c, src/vm_number.c: Updated.

2000-08-25  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	* src/vm.c (lookup_variable): New function. (scm_make_bytecode): Call lookup_variable for top-level variables. * src/vm_engine.h (VM_VARIABLE_REF, VM_VARIABLE_SET): New macros. * src/vm_system.c (TOPLEVEL_VAR, TOPLEVEL_VAR_SET): Removed. Use VM_VARIABLE_REF and VM_VARIABLE_SET instead.

2000-08-22  Keisuke Nishida  <kxn30@po.cwru.edu>

	*** empty log message ***

	Use frame-external-link.

	Create external frames dynamically.

	(compile-file): Output "(use-modules (vm vm))".

	(make-code): Check argument types. (make-code:and, make-code:or): Pass env to make-code.

	(translate-and, translate-or): Don't branch on the last expression.

	types.scm (env-variable-address): Reverted the last change.

	Add guile-compile.

	Initial import.

	Initial revision
