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+.

	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  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-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-02  Andy Wingo  <wingo@pobox.com>

	fix error message for bad objcode cookie
	* libguile/objcodes.c: Whoop-dee :)

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-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-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-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-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-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>

	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-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).

	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>

	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 ()'.

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>

	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>

	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  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-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-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-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.

2009-01-17  Neil Jerram  <neil@ossau.uklinux.net>

	Remove `INSTALL'
	* INSTALL: Removed.

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-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-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-10  Andy Wingo  <wingo@pobox.com>

	remove .cvsignore files

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  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.

	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-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  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  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  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  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>

	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-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.

	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>

	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-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  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  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>

	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-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-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
