2022-02-10  Andy Wingo  <wingo@pobox.com>

	Exclude ChangeLog from assert-no-store-file-names distcheck rule
	* Makefile.am (assert-no-store-file-names): Remove ChangeLog.

	GNU Guile v3.0.8
	* GUILE-VERSION (GUILE_MICRO_VERSION, LIBGUILE_INTERFACE_CURRENT):
	(LIBGUILE_INTERFACE_AGE): Bump.

	Minor NEWS tweaks
	* NEWS: Minor tweaks.

2022-02-10  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Align argument type of scm_to_wchar with its declaration.
	* libguile/numbers.c (scm_from_wchar): Change argument type from wchar_t
	to scm_t_wchar which is the argument type in numbers.h.

	Align return type of scm_to_wchar with its declaration.
	* libguile/numbers.c (scm_t_wchar): Change return type from wchar_t to
	scm_t_wchar which is the return type in numbers.h.

2022-02-07  Ludovic Courtès  <ludo@gnu.org>

	psyntax: Pass source vectors to tree-il constructors.
	Avoiding systematic conversion from source vectors to property alists
	saves 20% on the final heap size of a process doing:

	  (compile-file FILE #:optimization-level 1)

	where FILE is large.

	* module/language/tree-il.scm (tree-il-src/ensure-alist): New procedure
	with setter.  Export as 'tree-il-src'.
	* module/ice-9/psyntax.scm (build-void, build-call)
	(build-conditional, build-lexical-reference, build-lexical-assignment)
	(build-global-reference, build-global-assignment)
	(build-global-definition, build-simple-lambda, build-case-lambda)
	(build-lambda-case, build-primcall, build-primref)
	(build-data, build-sequence, build-let, build-named-let)
	(build-letrec, expand-body): Remove (sourcev->alist src) calls.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/language/tree-il/analyze.scm (shadowed-toplevel-analysis): Use
	'tree-il-src' instead of accessing the 'src' slot directly.
	* module/system/vm/assembler.scm (link-debug): Adjust so PC can be
	followed by a vector or an alist.

2022-02-07  Ludovic Courtès  <ludo@gnu.org>

	'string->symbol' avoids copying the underlying string.
	* libguile/strings.c (scm_i_make_symbol): Reuse NAME's stringbuf unless
	it's mutable or NAME starts at a non-zero offset or has a different
	length.

2022-02-06  Andy Wingo  <wingo@pobox.com>

	Update unicode tables to Unicode 14.0.0; initial charsets immutable
	* libguile/srfi-14.i.c: Update from Unicode 14.0.0.
	* libguile/unidata_to_charset.pl (compute): Write arrays as static const
	data, to avoid polluting the namespace and to avoid adding these to the
	GC root set.
	* libguile/srfi-14.c (SCM_CODEPOINT_F_IMMUTABLE): New flag.
	(scm_charset_is_immutable): New internal predicate.
	(SCM_VALIDATE_MUTABLE_CHARSET): New internal validator.
	(cs_full_ranges, cs_full_ranges_len): Re-express as separate ranges and
	len, because the ranges pointer in scm_t_char_set is mutable.
	(scm_char_set_unfold_x, scm_list_to_char_set_x)
	(scm_string_to_char_set_x, scm_char_set_filter_x)
	(scm_i_ucs_range_to_char_set, scm_char_set_adjoin_x)
	(scm_char_set_delete_x, scm_char_set_complement_x)
	(scm_char_set_unfold_x, scm_char_set_intersection_x)
	(scm_char_set_difference_x, scm_char_set_xor_x): Require mutable
	charsets.
	(define_charset): Add immutable flag.
	(scm_init_srfi_14): Adapt initial charset definitions.

	NEWS fixup
	* NEWS: Remove duplicate word.

2022-02-04  Ludovic Courtès  <ludo@gnu.org>

	Deprecate symbol properties.
	* libguile/strings.c (scm_i_make_symbol): Remove 'props' argument.  Use
	3 words instead of 'scm_double_cell'.
	* libguile/strings.h: Adjust accordingly.
	* libguile/symbols.c (scm_i_str2symbol, scm_i_str2uninterned_symbol):
	Likewise.
	(scm_symbol_fref, scm_symbol_pref, scm_symbol_fset_x,
	scm_symbol_pset_x): Move to...
	* libguile/deprecated.c: ... here.  Rewrite in terms of object
	properties.
	(symbol_function_slot, symbol_property_slot): New variables.
	* libguile/symbols.h (SCM_SYMBOL_FUNC, SCM_SET_SYMBOL_FUNC)
	(SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS)
	(scm_symbol_fref, scm_symbol_pref, scm_symbol_fset_x)
	(scm_symbol_pset_x): Move to...
	* libguile/deprecated.h: ... here.  Mark declarations as 'SCM_DEPRECATED'.
	* module/system/base/types.scm (cell->object): Remove 'props' field for
	%TC7-SYMBOL.
	* doc/ref/api-data.texi (Symbol Props): Remove.
	* NEWS: Update.

2022-02-03  Ludovic Courtès  <ludo@gnu.org>

	Remove unused 'scm_i_c_make_symbol'.
	* libguile/strings.c (scm_i_c_make_symbol): Remove.
	* libguile/strings.h (scm_i_c_make_symbol): Remove declaration.

2022-02-02  Andy Wingo  <wingo@pobox.com>

	Update NEWS
	* NEWS: Update.

2022-02-01  Andy Wingo  <wingo@pobox.com>

	Slight bignum-fixnum multiplication optimization
	* libguile/integers.c (scm_integer_mul_zi): Use mpn_mul_1.

	Avoid source properties in psyntax
	* module/ice-9/psyntax.scm (source-annotation): Only return source
	properties from syntax objects.
	(source-wrap): Don't look for source properties.
	(expand-macro): Rebuild source properties on macro output via
	source-wrap, not source properties.  Only annotate head of a chain of
	pairs.
	(strip): Here's the only use of set-source-properties!: when stripping
	a syntax object to a datum.
	(macroexpand): If the input expression is not a syntax object, eagerly
	extract its source properties.
	(datum->syntax): Fix case in which source is given as an alist.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	Prebuild fewer files
	* prebuilt/i686-pc-linux-gnu/Makefile.am:
	* prebuilt/mips-unknown-linux-gnu/Makefile.am:
	* prebuilt/x86_64-unknown-linux-gnu/Makefile.am: Only prebuild eval.go,
	psyntax-pp.go, and boot-9.go.  The builder can handle the rest.
	Otherwise the tarball size would explode, given the expansion in
	bootstrap.am.

	Fix reproducibility for inlinable-exports
	* module/language/tree-il/inlinable-exports.scm (compute-decoder): Map
	items in order of their code.

	Rework bootstrap to be reproducible
	* configure.ac:
	* Makefile.am (SUBDIRS): Replace bootstrap/ with stage0, stage1, and
	stage2.
	* am/bootstrap.am: Include all files and all rules.
	* meta/build-env.in (GUILE_AUTO_COMPILE): Always turn off
	auto-compilation.  Take a GUILE_BOOTSTRAP_STAGE argument, which can be
	stage0, stage1, stage2, or unset.  Adapt the load-compiled path
	accordingly.
	* meta/uninstalled-env.in: Include .go files from stage2.
	* module/Makefile.am: Rework to use boostrap.am.
	* module/system/base/optimize.scm (available-optimizations): Punt the
	inlinable-exports machinery to -O2.
	* stage0/Makefile.am:
	* stage1/Makefile.am:
	* stage2/Makefile.am: New files.

2022-01-29  Andy Wingo  <wingo@pobox.com>

	Add -ftlo support
	* configure.ac: Check if the compiler supports link-time optimization.
	If it does, turn it on.  Saves around 15% off libguile binary size.
	Controllable via --enable-lto configure option.

2022-01-17  Andy Wingo  <wingo@pobox.com>

	peval cross-module-inlining gracefully handles missing interface
	* module/language/tree-il/peval.scm (peval): The intention was for
	resolve-interface to return an interface only if it exists, but actually
	it throws if the interface isn't know.  Fix to do what we intended to
	do.

	Fix inlinable-exports bug for pure modules
	* module/language/tree-il/inlinable-exports.scm (compute-decoder): Fix
	bug in which inlinable exports in a pure module would have a missing
	make-struct/no-tail binding.

2022-01-13  Andy Wingo  <wingo@pobox.com>

	Remove dead code in scm_integer_inexact_sqrt_z
	* libguile/integers.c (scm_integer_inexact_sqrt_z): Remove some dead
	code.

2022-01-13  Daniel Llorens  <lloda@sarc.name>

	Have log and log10(real nan) return real nan regardless of sign
	* libguile/numbers.c (log_of_shifted_double, scm_log10): Avoid complex
	  extension when the argument is a real nan.
	* test-suite/tests/numbers.test: Tests for nans of either sign.

	Don't use HAVE_COPYSIGN in libguile/numbers.c
	* libguile/numbers.c (icmplx2str): As stated. copysign() is required by C99 and
	  already used without guards elsewhere in this file.

	Simplify scm_abs for the real case
	* libguile/numbers.c (scm_abs): As stated. When x is a nan with the sign bit
	  set, this changes the behavior of (magnitude x) back to what it was in 3.0.7,
	  to clear that bit.

2022-01-13  Andy Wingo  <wingo@pobox.com>

	Optimize logand against a positive inum
	* libguile/integers.c (scm_integer_logand_zi): Optimize.

	Optimize integer-expt for fixnums
	* libguile/integers.c (scm_integer_expt_ii): Add some optimizations for
	cases in which we can avoid allocating an mpz.

	Optimize scm_integer_mul_ii
	* libguile/integers.c (make_bignum_2): Always include.
	(scm_integer_mul_ii): Avoid making a temporary allocation.

	Optimize bignum subtraction
	* libguile/integers.c (scm_integer_sub_iz):
	(scm_integer_sub_zi):
	(scm_integer_sub_zz): Optimize to avoid temporary allocations.

	Optimize bignum add to avoid temporary allocations
	* libguile/integers.c (do_add_1, do_add, do_sub_1, do_sub, do_cmp): New
	helpers.
	(scm_integer_add_zi):
	(scm_integer_add_zz): Use new helpers.

	Avoid bignum clone in scm_integer_sub_zz
	* libguile/integers.c (scm_integer_abs_z): Just call
	scm_integer_negate_z if negation is needed.
	(scm_integer_sub_zz): Use mpz_sub instead of cloning bignum.

	Start to optimize scm_integer_sub_iz
	* libguile/integers.c (scm_integer_sub_iz): Avoid cloning bignum.

	Less pessimal scm_integer_sub_zi
	* libguile/integers.c (scm_integer_sub_zi): Only delegate to
	scm_integer_add_ii if y is negative.

	Optimize scm_integer_mul_zz.
	* libguile/integers.c (scm_integer_mul_zz): Optimize to avoid temporary
	allocations.

	Optimize scm_integer_mul_zi
	* libguile/integers.c (bignum_trim1):
	(bignum_negate_if): New helpers.
	(scm_integer_mul_zi): Use the mpn API to avoid temporary allocation.

2022-01-13  Andy Wingo  <wingo@pobox.com>

	Re-rewrite integer-expt in C
	Calling out to Scheme was a performance regression.

	* libguile/integers.h:
	* libguile/integers.c (scm_integer_expt_ii, scm_integer_expt_zi): New
	internal functions.
	* libguile/numbers.c (scm_integer_expt): Go back to C.  But, include
	fast cases for inums and doubles.
	* module/ice-9/boot-9.scm: Revert addition of integer-expt.

2022-01-13  Andy Wingo  <wingo@pobox.com>

	Fix bug when making mpz from 0
	* libguile/integers.c (make_bignum_0): New helper.
	(make_bignum_from_uint64):
	(ulong_to_bignum):
	(long_to_bignum): Call new helper as appropriate.

	take_mpz optimization
	* libguile/integers.c (take_mpz): Avoid making a bignum if the value is
	fixable.

	Bignums avoid both custom GMP allocator and finalizers
	* libguile/deprecated.c (make_bignum): Move here from numbers.c, to
	support scm_i_long2big etc.
	(scm_i_big2dbl):
	(scm_i_long2big):
	(scm_i_ulong2big):
	(scm_i_clonebig):
	(scm_i_normbig): Deprecate.
	(scm_install_gmp_memory_functions): Deprecate, happily!  SCM bignums now
	have digits allocated inline with the bignum itself, so they are
	completely transparent to the GC already.  The price is that if GMP ever
	allocates digits via the MPZ API, those digits then have to be copied
	back into managed memory.  But we avoid having to install finalizers and
	we avoid having to muck with GMP's allocator.
	* libguile/numbers.c (scm_from_mpz): Use scm_integer_from_mpz.
	(scm_init_numbers): Never muck with GMP's allocators.
	* doc/ref/guile-invoke.texi (Environment Variables): Remove note about
	GUILE_INSTALL_GMP_MEMORY_FUNCTIONS.
	* meta/build-env.in: No need to set GUILE_INSTALL_GMP_MEMORY_FUNCTIONS.

	scm_to_ipv6 uses scm_to_mpz
	* libguile/socket.c (scm_to_ipv6): Use scm_to_mpz.

	Finish srfi-60 port off old scm mpz API
	* libguile/srfi-60.c (scm_srfi60_rotate_bit_field)
	(scm_srfi60_reverse_bit_field, scm_srfi60_integer_to_list)
	(scm_srfi60_list_to_integer): Update.

	Start porting srfi-60 off the bad bignum interfaces
	* libguile/integers.h:
	* libguile/integers.c (scm_integer_scan1_i):
	(scm_integer_scan1_z): New internal functions.
	* libguile/srfi-60.c (scm_srfi60_log2_binary_factors): Use scan1
	functions.
	(scm_srfi60_copy_bit): Use integers lib.

	Avoid scm_i_mkbig outside numbers.c.
	* libguile/random.c (scm_c_random_bignum):
	* libguile/socket.c (scm_from_ipv6): Avoid scm_i_mkbig.
	* libguile/numbers.h:
	* libguile/numbers.c (scm_i_mkbig): Remove.

	Use scm_integer_to_double_z in numbers.c instead of big2dbl
	* libguile/numbers.c: Use internal function instead of big2dbl which we
	will deprecate.

	Simplify magnitude, angle
	* libguile/numbers.c (scm_i_inum2big): Remove.
	(scm_magnitude): Delegate to abs.
	(scm_angle): Simplify.

	Remove last non-admin SCM_I_BIG_MPZ uses in numbers.c
	* libguile/numbers.c (scm_magnitude, scm_angle): Use integers lib.

	Simplify scm_exact_integer_quotient
	* libguile/integers.h:
	* libguile/integers.c (scm_integer_exact_quotient_iz): New internal
	function.
	* libguile/numbers.c (scm_i_make_ratio): Simplify and enforce
	invariants.
	(scm_exact_integer_quotient): Use integer lib.

	divide2double refactor
	* libguile/integers.c (scm_integer_set_mpz_z): New internal function.
	(scm_integer_init_set_mpz_z): Rename from scm_integer_to_mpz_z.
	* libguile/integers.h:
	* libguile/numbers.c (scm_i_divide2double): Avoid SCM_I_BIG_MPZ.

	Remove dead bignum frexp code from numbers.c
	* libguile/numbers.c (scm_i_big2dbl_2exp): Remove unused function.

	Expose frexp from integers lib
	* libguile/integers.h:
	* libguile/integers.c (scm_integer_frexp_z): Expose internally.
	(scm_integer_to_double_z):
	(scm_integer_inexact_sqrt_z): Adapt uses.
	* libguile/numbers.c (log_of_exact_integer): Use exposed
	scm_integer_frexp_z.

	Refactor scm_sqrt in terms of integers.[ch]
	* libguile/integers.h:
	* libguile/integers.c (scm_is_integer_perfect_square_i):
	(scm_is_integer_perfect_square_z):
	(scm_integer_floor_sqrt_i):
	(scm_integer_floor_sqrt_z):
	(scm_integer_inexact_sqrt_i):
	(scm_integer_inexact_sqrt_z): New internal functions.
	* libguile/numbers.c (scm_sqrt): Reimplement.

	Reimplement exact-integer-sqrt with integers.[ch]
	* libguile/numbers.c (scm_exact_integer_sqrt): Call out.
	* libguile/integers.h:
	* libguile/integers.c (scm_integer_exact_sqrt_i):
	(scm_integer_exact_sqrt_z): New internal functions.

	scm_to_mpz uses integer lib
	* libguile/integers.h:
	* libguile/integers.c (scm_integer_to_mpz_z): New internal function.
	* libguile/numbers.c (scm_to_mpz): Use new function.

	Remove unused conv-{u,}integer.i.c
	* libguile/Makefile.am (noinst_HEADERS):
	* libguile/conv-integer.i.c:
	* libguile/conv-uinteger.i.c: Remove.

	Implement scm_{to,from}_wchar inline
	* libguile/numbers.c (scm_to_wchar, scm_from_wchar): Implement inline.

	Reimplement scm_{to,from}_{int64,uint64}
	* libguile/numbers.c (scm_to_int64, scm_from_int64, scm_to_uint64):
	(scm_from_uint64): Reimplement inline.

	Reimplement scm_{to,from}_{int32,uint32}
	* libguile/numbers.c (scm_to_int32, scm_from_int32, scm_to_uint32):
	(scm_from_uint32): Reimplement inline.
	* libguile/integers.c (make_bignum_2):
	(make_bignum_from_uint64):
	(negative_uint32_to_int32):
	(positive_uint32_to_int32):
	(bignum_to_int32):
	(bignum_to_uint32):
	(scm_integer_from_int32):
	(scm_integer_from_uint32):
	(scm_integer_to_int32_z):
	(scm_integer_to_uint32_z): Better int32 support for 32-bit machines.

	Reimplement scm_from_int8 etc
	* libguile/integers.c (make_bignum_from_uint64):
	(make_bignum_from_int64): New helpers.
	(scm_integer_from_int64):
	(scm_integer_from_uint64): New internal functions.
	* libguile/integers.h: Declare new internal functions.
	* libguile/numbers.c (range_error): Declare as noreturn.xo
	(inum_in_range): New helper.
	(scm_from_signed_integer):
	(scm_to_signed_integer):
	(scm_from_unsigned_integer):
	(scm_to_unsigned_integer):
	(scm_to_int8):
	(scm_from_int8):
	(scm_to_uint8):
	(scm_from_uint8):
	(scm_to_int16):
	(scm_from_int16):
	(scm_to_uint16):
	(scm_from_uint16): Implement manually.

	Reimplement scm_is_{un,}signed_integer for bignums
	* libguile/integers.c (negative_int64):
	(int64_magnitude):
	(negative_uint64_to_int64):
	(positive_uint64_to_int64):
	(bignum_to_int64):
	(bignum_to_uint64): New helpers.
	(scm_integer_to_int64_z):
	(scm_integer_to_uint64_z): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_is_signed_integer):
	(scm_is_unsigned_integer): Simplify bigint cases.

	Fix scm_integer_to_double_z to always round; clean ups
	* libguile/integers.c (scm_integer_to_double_z): Doubles that can't be
	exactly represented as integers should round.
	(bignum_frexp_z): New helper.
	(scm_integer_from_mpz, scm_integer_from_double): New internal functions.
	* libguile/numbers.h:
	* libguile/numbers.c (scm_i_bigcmp, scm_i_dbl2big, scm_i_dbl2num):
	Remove unused internal functions.
	(scm_inexact_to_exact): Rework to avoid scm_i_dbl2big.
	(scm_bigequal): Move here, from eq.c.
	(scm_integer_to_double_z): Use the new helper.
	(scm_i_big2dbl): Use scm_integer_to_double_z.

	Fix deprecated bit-count* when counting 0 bits
	* libguile/deprecated.c (scm_bit_count_star): Fix logic to count 0
	bits.

	Clean up scm_divide
	* libguile/integers.h:
	* libguile/integers.c (scm_is_integer_divisible_ii):
	(scm_is_integer_divisible_zi):
	(scm_is_integer_divisible_zz): New helpers.
	* libguile/numbers.c (invert, divide, complex_div): New helpers for
	scm_divide.
	(scm_divide): Adapt.

	Remove support for allowing exact numbers to be divided by zero
	* libguile/numbers.c: We require IEEE infinities and NaN so there is no
	case in which ALLOW_DIVIDE_BY_ZERO would not be defined.
	(scm_divide, scm_tan, scm_tanh, scm_log, scm_log10): Always throw on
	overflow for divide by exact zero, never throw for divide by inexact
	zero.

	Simplify scm_product, use integer lib
	* libguile/numbers.c (scm_product): Remove need for s_product defines.
	Call out to product, as appropriate.
	(product): New helper.
	* libguile/integers.h:
	* libguile/integers.c (scm_integer_mul_ii):
	(scm_integer_mul_zi):
	(scm_integer_mul_zz): New internal functions.

	Simplify scm_difference, use integer lib
	* libguile/numbers.c (scm_sum): Remove need for s_sum defines.
	(negate, difference): New helpers.
	(scm_difference): Call out to difference or negate, as appropriate.
	* libguile/integers.h:
	* libguile/integers.c (scm_integer_negate_i):
	(scm_integer_negate_z):
	(scm_integer_sub_ii):
	(scm_integer_sub_iz):
	(scm_integer_sub_zi):
	(scm_integer_sub_zz): New internal functions.

	Clean up scm_sum
	* libguile/integers.h:
	* libguile/integers.c (scm_integer_to_double_z):
	(scm_integer_add_ii, scm_integer_add_zi, scm_integer_add_zz): New
	internal functions.
	* libguile/numbers.c (sum): New helper for scm_sum.  Clean up to avoid
	repetition.  The dispatch is less optimal but the code is shorter and
	more maintainable; in any case if speed is important, the compiler needs
	to be involved.
	(scm_sum): Adapt.

	Simplify implementation of min, max
	* libguile/numbers.c (scm_max, scm_min): Lean more on scm_is_less_than.

	positive?, negative? use integer lib
	* libguile/numbers.c (scm_positive_p, scm_negative_p): Use integer lib.

	Clean up <, reimplement in terms of integer lib
	* libguile/numbers.c (scm_is_less_than, scm_is_greater_than):
	(scm_is_less_than_or_equal, scm_is_greater_than_or_equal): New internal
	functions.
	(scm_less_p, scm_gr_p, scm_leq_p, scm_geq_p): Use new helpers.  Dispatch
	to generics if operands aren't real -- a tightening relative to the
	previous check which was just for numbers.
	* libguile/integers.h:
	* libguile/integers.c (scm_is_integer_less_than_ir):
	(scm_is_integer_less_than_ri):
	(scm_is_integer_less_than_zz):
	(scm_is_integer_less_than_zr):
	(scm_is_integer_less_than_rz):
	(scm_is_integer_positive_z):
	(scm_is_integer_negative_z): New internal functions.

	Reimplement = on integer lib, clean up scm_num_eq_p
	* libguile/integers.h:
	* libguile/integers.c (scm_is_integer_equal_ir):
	(scm_is_integer_equal_ic):
	(scm_is_integer_equal_zz):
	(scm_is_integer_equal_zr):
	(scm_is_integer_equal_zc): New internal functions.
	* libguile/numbers.c (scm_num_eq_p): Rework to tail-recurse if we need
	to swap arguments, to reduce duplication, and use the new integer lib.

	Build scm_integer_p on scm_is_integer, not vice versa
	* libguile/numbers.c: Switch layering of scm_is_integer /
	scm_is_exact_integer and their SCM-valued counterparts.

	Simplify scm_bigprint
	* libguile/numbers.c (scm_bigprint): Just convert the number to a string
	and write that.  Adds a copy but if we optimize scm_integer_to_string_z
	then that will be fixed.

	Implement integer-to-string with new integer library
	* libguile/integers.c (scm_integer_to_string_i)
	(scm_integer_to_string_z): New internal functions.
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_number_to_string): Use new internal
	functions.

	Implement scm_integer_length with new integer library
	* libguile/integers.c (scm_integer_length_i)
	(scm_integer_length_z): New internal functions.
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_integer_length): Use new internal functions.

	Integer library takes bignums via opaque struct pointer
	* libguile/integers.h (scm_bignum): Declare opaque struct type and a
	function to cast SCM to this type.  Adapt all routines that take bignums
	to take a "struct scm_bignum *".
	* libguile/integers.c: Adapt.
	* libguile/numbers.c: Adapt all users.

	Implement scm_logcount with new integer library
	* libguile/integers.c (scm_integer_logcount_i)
	(scm_integer_logcount_z): New internal functions.
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_logcount): Use new internal functions.

	Implement scm_bit_extract with new integer library
	* libguile/integers.c (scm_integer_bit_extract_i)
	(scm_integer_bit_extract_z): New internal functions.
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_bit_extract): Use new internal functions.

	Implement scm_ash with new integer library
	* libguile/integers.c (scm_integer_lsh_iu, scm_integer_lsh_zu)
	(scm_integer_floor_rsh_iu, scm_integer_floor_rsh_zu)
	(scm_integer_round_rsh_iu, scm_integer_round_rsh_zu): New internal
	functions.
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_ash): Use new internal functions.

	Reimplement integer-expt in Scheme
	* libguile/numbers.c (integer_expt_var): New static variable.
	(init_integer_expt_var): New helper.
	(scm_integer_expt): Delegate to Scheme.
	* module/ice-9/boot-9.scm (integer-expt): Reimplement in Scheme.  Misses
	some optimizations for fractions but that is probably OK!

	Implement scm_modulo_expt with new integer library
	* libguile/integers.c (scm_integer_modulo_expt_nnn):
	(integer_init_mpz): New helper.
	* libguile/integers.h: Declare the new internal function.
	* libguile/numbers.c (scm_modulo_expt): Use new internal function.

	Implement scm_lognot with new integer library
	* libguile/integers.c (scm_integer_lognot_i, scm_integer_lognot_z):
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_lognot): Use new internal functions.

	Implement scm_logbit_p with new integer library
	* libguile/integers.c (scm_integer_logbit_ui, scm_integer_logbit_uz):
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_logbit_p): Use new internal functions.

	Implement scm_logtest with new integer library
	* libguile/integers.c (scm_integer_logtest_ii, scm_integer_logtest_zi)
	(scm_integer_logtest_zz): New internal functions.
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_logtest): Use new internal functions.

	Implement scm_logxor with new integer library
	* libguile/integers.c (scm_integer_logxor_ii, scm_integer_logxor_zi)
	(scm_integer_logxor_zz): New internal functions.
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_logxor): Use new internal functions.

	Implement scm_logior with new integer library
	* libguile/integers.c (scm_integer_logior_ii, scm_integer_logior_zi)
	(scm_integer_logior_zz): New internal functions.
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_logior): Use new internal functions.

	Implement scm_logand with new integer library
	* libguile/integers.c (scm_integer_logand_ii, scm_integer_logand_zi)
	(scm_integer_logand_zz): New internal functions.
	* libguile/integers.h: Declare the new internal functions.
	* libguile/numbers.c (scm_logand): Use new internal functions.

	Implement lcm with new integer lib
	* libguile/integers.c (scm_integer_lcm_ii)
	(scm_integer_lcm_zi, scm_integer_lcm_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_lcm): Use the new functions.

	Implement gcd with new integer lib
	* libguile/integers.c (scm_integer_gcd_ii)
	(scm_integer_gcd_zi, scm_integer_gcd_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_gcd): Use the new functions.

	Implement round-divide with new integer lib
	* libguile/integers.c (scm_integer_round_divide_ii)
	(scm_integer_round_divide_iz, scm_integer_round_divide_zi)
	(scm_integer_round_divide_zz): New internal functions.
	(integer_round_divide_zz): New helper.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_round_divide): Use the new functions.
	(scm_i_bigint_round_divide): Remove unused helper.

	Implement round-remainder with new integer lib
	* libguile/integers.c (scm_integer_round_remainder_ii)
	(scm_integer_round_remainder_iz, scm_integer_round_remainder_zi)
	(scm_integer_round_remainder_zz): New internal functions.
	(integer_round_remainder_zz): New helper.
	(long_sign, bignum_cmp_long): New helpers.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_round_remainder): Use the new functions.
	(scm_i_bigint_round_remainder): Remove unused helper.

	Implement round-quotient with new integer lib
	* libguile/integers.c (scm_integer_round_quotient_ii)
	(scm_integer_round_quotient_iz, scm_integer_round_quotient_zi)
	(scm_integer_round_quotient_zz): New internal functions.
	(integer_round_quotient_zz): New helper.
	(long_sign, bignum_cmp_long): New helpers.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_round_quotient): Use the new functions.
	(scm_i_bigint_round_quotient): Remove unused helper.

	Implement centered-divide with new integer lib
	* libguile/integers.c (scm_integer_centered_divide_ii)
	(scm_integer_centered_divide_iz, scm_integer_centered_divide_zi)
	(scm_integer_centered_divide_zz): New internal functions.
	(integer_centered_divide_zz): New helper.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_centered_divide): Use the new functions.
	(scm_i_bigint_centered_divide): Remove unused helper.

	Implement centered-remainder with new integer lib
	* libguile/integers.c (scm_integer_centered_remainder_ii)
	(scm_integer_centered_remainder_iz, scm_integer_centered_remainder_zi)
	(scm_integer_centered_remainder_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_centered_remainder): Use the new functions.
	(scm_i_bigint_centered_remainder): Remove helper.

	Implement centered-quotient with new integer lib
	* libguile/integers.c (scm_integer_centered_quotient_ii)
	(scm_integer_centered_quotient_iz, scm_integer_centered_quotient_zi)
	(scm_integer_centered_quotient_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_centered_quotient): Use the new functions.
	(scm_i_bigint_centered_quotient): Remove unused helper.

	Implement truncate-divide with new integer lib
	* libguile/integers.c (scm_integer_truncate_divide_ii)
	(scm_integer_truncate_divide_iz, scm_integer_truncate_divide_zi)
	(scm_integer_truncate_divide_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_truncate_divide): Use the new functions.

	Implement truncate-remainder with new integer lib
	* libguile/integers.c (scm_integer_truncate_remainder_ii)
	(scm_integer_truncate_remainder_iz, scm_integer_truncate_remainder_zi)
	(scm_integer_truncate_remainder_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_truncate_remainder): Use the new functions.

	Implement truncate-quotient with new integer lib
	* libguile/integers.c (scm_integer_truncate_quotient_ii)
	(scm_integer_truncate_quotient_iz, scm_integer_truncate_quotient_zi)
	(scm_integer_truncate_quotient_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_truncate_quotient): Use the new functions.

	Implement ceiling-divide with new integer lib
	* libguile/integers.c (scm_integer_ceiling_divide_ii)
	(scm_integer_ceiling_divide_iz, scm_integer_ceiling_divide_zi)
	(scm_integer_ceiling_divide_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_ceiling_divide): Use the new functions.

	Implement ceiling-remainder with new integer lib
	* libguile/integers.c (scm_integer_ceiling_remainder_ii)
	(scm_integer_ceiling_remainder_iz, scm_integer_ceiling_remainder_zi)
	(scm_integer_ceiling_remainder_zz): New internal functions.
	(bignum_is_positive): New helper.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_ceiling_remainder): Use the new functions.

	Implement ceiling-quotient with new integer lib
	* libguile/integers.c (scm_integer_ceiling_quotient_ii)
	(scm_integer_ceiling_quotient_iz, scm_integer_ceiling_quotient_zi)
	(scm_integer_ceiling_quotient_zz): New internal functions.
	(take_bignum_from_mpz): Change to also normalize the mpz, as all callers
	required.
	(long_sign, bignum_cmp_long): New helpers.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_ceiling_quotient): Use the new functions.

	Implement floor-divide with new integer lib
	* libguile/integers.c (scm_integer_floor_divide_ii)
	(scm_integer_floor_divide_iz, scm_integer_floor_divide_zi)
	(scm_integer_floor_divide_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_floor_divide): Use the new functions.

	Implement floor-remainder with new integer lib
	* libguile/integers.c (scm_integer_floor_remainder_ii)
	(scm_integer_floor_remainder_iz, scm_integer_floor_remainder_zi)
	(scm_integer_floor_remainder_zz): New internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_floor_remainder): Use the new functions.

	Implement floor-quotient with new integer lib
	* libguile/integers.c (scm_integer_floor_quotient_ii)
	(scm_integer_floor_quotient_iz, scm_integer_floor_quotient_zi)
	(scm_integer_floor_quotient_zz): New internal functions.
	(long_to_scm, ulong_to_scm, take_bignum_from_mpz): New helpers.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_floor_quotient): Use the new functions.

	Implement abs with new integer lib
	* libguile/integers.c (scm_integer_abs_i, scm_integer_abs_z): New
	internal functions.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_abs): Use the new functions.

	Implement odd? and even? with new integer lib
	* libguile/integers.c (scm_is_integer_odd_i):
	(scm_is_integer_odd_z): New internal functions.  Add a number of
	internal support routines.
	* libguile/integers.h: Declare internal functions.
	* libguile/numbers.c (scm_odd_p, scm_even_p): Use the new functions.

2022-01-13  Andy Wingo  <wingo@pobox.com>

	Add new integers.[ch]
	The goal is to factor out some fixnum/bignum code here from
	numbers.[ch].

	* libguile/Makefile.am: Add new files.
	* libguile/integers.c:
	* libguile/integers.h: New files

2022-01-13  Andy Wingo  <wingo@pobox.com>

	Avoid quadratic behavior in id-var-name
	* module/ice-9/psyntax.scm (id-var-name): Avoid list-ref.
	* module/ice-9/psyntax-pp.scm: Regenerate.

2022-01-11  Andy Wingo  <wingo@pobox.com>

	-Oresolve-free-vars pass gracefully handles failed autoloads.
	* module/language/tree-il/resolve-free-vars.scm (make-resolver):
	Gracefully handle failed autoloads.

2022-01-07  Andy Wingo  <wingo@pobox.com>

	Fix type confusion in heap-numbers-equal? calls from VM
	When heap-numbers-equal? is called from eqv?, we have already ensured
	that the both objects have the same heap type.  However when called by
	the VM, the precondition is just that both are heap numbers -- not
	necessarily of the same type.  Fix to add an additional check in
	heap-numbers-equal?.  Could cause crashers!

	* libguile/eq.c (scm_i_heap_numbers_equal_p): Add additional check.

2022-01-04  Daniel Llorens  <lloda@sarc.name>

	New function bitvector-copy (scm_bitvector_copy)
	* libguile/bitvectors.h:
	* libguile/bitvectors.c: As stated.
	* test-suite/tests/bitvectors.test: Tests.
	* doc/ref/api-data.texi: Update "Bit vectors" section.
	* NEWS: Update.

2021-12-13  Daniel Llorens  <lloda@sarc.name>

	Review REFFIXME
	H/t t20kdc on #guile.

2021-12-06  Daniel Llorens  <lloda@sarc.name>

	New function srfi-4-vector-type-size in (srfi srfi-4 gnu)
	This patch removes the undocumented function make-srfi-4-vector from
	(guile). That function is still exported from (srfi srfi-4 gnu).

	* libguile/srfi-4.h (scm_init_srfi_4): Split into scm_bootstrap_srfi_4()
	  and scm_init_srfi_4(), after the pattern of scm_init_bytevectors() and
	  scm_bootstrap_bytevectors().
	* libguile/init.c: Replace scm_init_srfi_4() call by scm_bootstrap_srfi_4().
	* module/srfi/srfi-4.scm: Load newly defined srfi-4 extension. This
	  provides undocumented make-srfi-4-vector.
	* module/srfi/srfi-4/gnu.scm: Export srfi-4-vector-type-size.
	* doc/ref/srfi-modules.texi: Document srfi-4-vector-type-size.

2021-12-01  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Support C99 complex types conditionally in (system foreign)
	496f69dba2fdf1720b40349932fcdecd444107c3 introduced C99 complex types in
	libguile/foreign.h and (system foreign). Since these types are provided
	conditionally in foreign.h based on autoconf tests they need to be used
	conditionally in (system foreign) based on their presence.

2021-11-25  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Mention package GNU Autopoint in README.
	* README: Mention GNU Autopoint. Needed when building from a Git checkout.

2021-11-22  Daniel Llorens  <lloda@sarc.name>

	Fix doc typo
	H/t to Damien Mattei in guile-devel.

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

	Add -Ooptimize-known-return-types at -O2
	* module/language/cps/optimize.scm (optimize-first-order-cps):
	* module/system/base/optimize.scm (available-optimizations): Add
	optimize-known-return-types at -O2.

	Add new pass to optimize away return value count checks
	* module/language/cps/return-types.scm: New file.
	* module/Makefile.am (SOURCES):
	* am/bootstrap.am (SOURCES): Add new file.
	* module/language/tree-il/compile-cps.scm (sanitize-meta): Strip
	  "noreturn" and "return-type" properties -- these should only be
	  computed by Guile.

	Allow callk to continue to kargs
	* module/language/cps/verify.scm (check-arities): If a callk continues
	to kargs, the caller knows the number of return values that the callee
	provides and no number-of-values check is needed.
	* module/language/cps/contification.scm (apply-contification): Allow
	contification of known-return-values calls.
	* module/language/cps/reify-primitives.scm (uniquify-receive)
	(reify-primitives): No need for uniquify-receive any more as receive
	shuffles are attached to the call, not the continuation.
	* module/language/cps/compile-bytecode.scm (compile-function): Add kargs
	case.

	Refactor send and receive shuffles in slot allocation
	* module/language/cps/slot-allocation.scm (lookup-send-parallel-moves):
	Rename from `lookup-parallel-moves'.
	(lookup-receive-parallel-moves): New function.  Now we attach "receive
	moves" to call and prompt conts instead of to their continuations.
	(compute-shuffles): Refactor to allow a continuation to have both send
	and receive shuffles.
	(compute-frame-size): Refactor for new shuffles mechanism
	(allocate-slots): Allow calls to proceed directly to kargs.

	Refactor compile-bytecode
	* module/language/cps/compile-bytecode.scm (compile-function): Treat
	$kreceive as a forwarding cont, and refactor the treatment of calls and
	$values.

2021-11-15  Daniel Llorens  <lloda@sarc.name>

	Support C99 complex types in (system foreign)
	* libguile/foreign.h (SCM_FOREIGN_TYPE_COMPLEX_FLOAT,
	  SCM_FOREIGN_TYPE_COMPLEX_DOUBLE): New enums.
	* module/system/foreign.scm (complex-float, complex-double): Export new types.
	  (make-c-struct, parse-c-struct): Support the new types.
	* libguile/foreign.c (complex-float, complex-double): Define new types.
	  (alignof, sizeof, pack, unpack): Support the new types.
	* test-suite/tests/foreign.test: Test.

2021-11-05  Daniel Llorens  <lloda@sarc.name>

	Fix brace style for bf9d30f3c3fd03cb37d604f1927e9ce5c699338b

2021-11-05  Daniel Llorens  <lloda@sarc.name>

	Avoid ash with arguments that might overflow in (language cps types)
	Fixes https://debbugs.gnu.org/50609

	* module/languages/cps/types.scm (ulsh): As stated.

2021-11-05  Daniel Llorens  <lloda@sarc.name>

	Limit the range of ash, round-ash count argument to INT32
	This avoids gmp aborting e.g. with (ash 1 (expt 2 37)). The new limit is
	such that (ash 1 (expt 30)) is accepted but (ash 1 (expt 31)) throws.

	Fixes https://bugs.gnu.org/48150

	* libguile/numbers.c (ash, round-ash): As stated.
	* test-suite/tests/numbers.test: Test a case known to make gmp abort before.

2021-11-05  Fabrice Fontaine  <fontaine.fabrice@gmail.com>

	module/system/base/target.scm: support riscv32
	Fix the following build failure on riscv32:

	system/base/target.scm:132:16: In procedure triplet-pointer-size:
	unknown CPU word size "riscv32"

	Fixes:
	 - http://autobuild.buildroot.org/results/6705630c1484239ec8b73d57ebc2e2570fbfc8f8

2021-11-03  d4ryus  <d4ryus@mailbox.org>

	Fix bounds check in recvfrom!
	Closes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45595.

	NB: Amended by the committer to allow an empty range.

	* libguile/socket.c: As stated.

2021-11-03  Arun Isaac  <arunisaac@systemreboot.net>

	Fix typos in SRFI docs
	https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50127

	* doc/ref/api-foreign.texi, doc/ref/srfi-modules.texi: Fix typos.

2021-11-03  Philipp Klaus Krause  <pkk@spth.de>

	Const qualify return of strerror
	Closes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43987

2021-11-03  Vineet Gupta  <vgupta@synopsys.com>

	Add support for arc

	NB: closes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48816

2021-11-02  Taylan Kammer  <taylan.kammer@gmail.com>

	Improve support for R6/R7 SRFI module name formats.
	Fixes <https://bugs.gnu.org/39601>.

	Partly fixes <https://bugs.gnu.org/40371>.

	It was already possible to import an SRFI module by referencing it
	as (srfi :n) which is automatically translated to (srfi srfi-n), but
	this conversion was only done during import.  After this change, it's
	also possible to define a library as (srfi :n) which is automatically
	translated to (srfi srfi-n) during definition.

	It was not possible at all to define or import SRFI module names in the
	R7RS format, (srfi n), where n is a non-negative exact integer.  It is
	now possible both to define and import them as such, realized through
	the same kind of conversion to a canonical (srfi srfi-n) name.

	* module/ice-9/r6rs-libraries.scm: Numerous changes.

2021-10-27  Daniel Llorens  <lloda@sarc.name>

	Update NEWS

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

	Update NEWS.

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

	sxml: Make parser thread-safe.
	Fixes <https://bugs.gnu.org/51264>.

	Lack of thread-safety would also affect the parser in (texinfo) because
	it uses 'next-token-of'.

	* module/sxml/upstream/input-parse.scm (input-parse:init-buffer): Always
	return a fresh buffer.

2021-10-21  Daniel Llorens  <lloda@sarc.name>

	Fix doc typo

2021-10-21  Daniel Llorens  <lloda@sarc.name>

	Provide xxvector-copy and xxvector-copy! for srfi-4 vectors
	These use the argument conventions of vector-copy!, string-copy!,
	etc. and not that of bytevector-copy! (which is from r6rs).

	* module/srfi/srfi-4/gnu.scm: As stated.
	* test-suite/tests/srfi-4.test: Tests.
	* doc/ref/srfi-modules.texi: Documentation.
	* libguile/bytevectors.c (bytevector-copy!): Add overlap note to
	  docstring.
	* libguile/vectors.c (vector-copy!): Reuse text for the overlap note.

2021-10-19  Timothy Sample  <samplet@ngyro.com>

	(ice-9 format): Fix scaling floats with leading zeros

2021-10-13  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Mention package GNU Gperf in README.
	* README: Mention GNU Gperf. Needed when building from a Git checkout.

2021-10-03  Andy Wingo  <wingo@pobox.com>

	Add primitive alias analysis to CSE
	* module/language/cps/effects-analysis.scm (compute-known-allocations):
	(compute-clobber-map): Add "conts" parameter, and use it to compute
	primcalls that access known allocations.  A write to a known allocation
	only clobbers a read to a known allocation if they are the same.
	* module/language/cps/cse.scm (eliminate-common-subexpressions-in-fun):
	Pass conts also to compute-clobber-map.

	Use more logtest in cse.scm
	* module/language/cps/effects-analysis.scm (causes-effect?):
	(effect-clobbers?): Use logtest.

2021-10-01  Andy Wingo  <wingo@pobox.com>

	Allow primcalls with multiple defs
	* module/language/cps/types.scm (infer-types): Allow multiple defs.

	Add ,optimize-cps REPL meta-command
	* module/system/repl/command.scm (*command-table*): Add optimize-cps /
	optx.
	(optimize-cps): Define meta-command.
	* module/system/repl/common.scm (optimize*): New helper.
	(repl-optimize): Use helper.
	(repl-optimize-cps): New public function.

	Add CPS pretty-printer
	* module/language/cps/dump.scm: New file.
	* module/Makefile.am (SOURCES): Add to build.

	Allow unchecked functions to have unboxed arguments
	* module/language/cps/utils.scm (compute-var-representations): Use
	'arg-representations from metadata for arg representations.
	* module/language/tree-il/compile-cps.scm (sanitize-meta):
	(convert): Make sure incoming terms have no arg representations.

	Move live variable computation routines to utils and graphs.
	* module/language/cps/graphs.scm (rename-keys, rename-intset)
	(rename-graph, compute-reverse-control-flow-order)
	(compute-live-variables): Move here from slot-allocation.
	* module/language/cps/utils.scm: Remove duplicate compute-idoms
	definition.
	(compute-defs-and-uses, compute-var-representations): Move here from
	slot-allocation.
	* module/language/cps/slot-allocation.scm: Move routines out to utils
	and graphs.

	Add frame-local-ref / frame-local-set! support for type 'ptr
	* libguile/frames.c (enum stack_item_representation):
	(scm_to_stack_item_representation):
	(scm_frame_local_ref):
	(scm_frame_local_set_x): Add support for "ptr" representations.

2021-09-30  Andy Wingo  <wingo@pobox.com>

	Hotfix to unify (x ...) patterns in match
	* module/ice-9/match.upstream.scm (match-gen-ellipsis): Instead of just
	binding the identifier when matching (x ...), go through match-one so
	that if the id is already bound, we unify instead.
	* test-suite/tests/match.test ("unify in list patterns"): Add test.
	* test-suite/tests/match.test.upstream: Add additional tests from
	upstream.

	See commit 05c546e38 in Chibi Scheme.  Thanks to Alex Shinn for help
	here!

2021-09-20  Ludovic Courtès  <ludo@gnu.org>

	Baseline compiler no longer swaps rsh/lsh when transforming ash calls.
	Reported by Marius Bakke <marius@gnu.org>
	at <https://issues.guix.gnu.org/50696>.

	Previously, the baseline compiler would incorrectly emit a right shift
	when for, say, (ash x 2), and a left shift for (ash x -2).

	* module/language/tree-il/compile-bytecode.scm (canonicalize): When Y is
	negative, emit 'rsh', not 'lsh'.
	* test-suite/tests/numbers.test ("ash at -O1"): New test.

2021-09-20  Ludovic Courtès  <ludo@gnu.org>

	Fix 'ash' primcall match clause in baseline compiler.
	Previously the pattern would only match when the two 'src' values were
	the same, which is not the case for example when running on the
	interpreter.

	* module/language/tree-il/compile-bytecode.scm (canonicalize): In 'ash
	primcall pattern, rename second 'src' to 'src*'.

2021-09-20  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix wrong @uref argument order.
	* doc/ref/sxml.texi (SXML): Fix @uref argument order.

	srfi-1: 'find-tail' passes 'check-arg' the right procedure name.
	* module/srfi/srfi-1.scm (find-tail): Pass 'find-tail' as the 3rd
	argument to 'check-arg'.

	(system repl command) autoloads the compiler, disassembler, and profiler.
	* module/system/repl/command.scm: Autoload (system base compile),
	(system vm disassembler), and (statprof).

2021-09-17  Daniel Llorens  <lloda@sarc.name>

	Revert shift of ndim in array tag from 3df3ba1a2c956bba122328e1fc4be614171a4f42
	To avoid breaking ABI.

	* libguile/arrays.h (SCM_I_ARRAY_DIM, scm_i_raw_array): As stated.
	* module/system/vm/assembler.scm: As stated.

2021-09-14  Daniel Llorens  <lloda@sarc.name>

	Fix typo in srfi-69 doc

2021-09-02  Aleix Conchillo Flaqué  <aconchillo@gmail.com>

	foreign-library: fix darwin detection
	* module/system/foreign-library.scm (system-library-extensions): fix
	darwin host detection. darwin host types have "-darwin" but not
	"-darwin-".

2021-08-17  Daniel Llorens  <lloda@sarc.name>

	Extend bytevector-fill! to handle a partial fill
	* libguile/bytevectors.c (bytevector-fill!): As stated.
	  (scm_bytevector_fill_x): Stub to avoid changing the C API.
	* doc/ref/api-data.texi: Documentation.
	* libguile/vectors.c (vector-fill!): Less confusing variable names.
	* test-suite/tests/bytevectors.test: Test partial fill cases for
	  bytevector-fill!.

	Refactor srfi-4 declarations

2021-08-16  Daniel Llorens  <lloda@sarc.name>

	Remove array contp flag
	This flag was set, but never used in Guile, and there was no documented
	API to access it.

	To check if an array is contiguous, use (array-contents <> #t).

	* libguile/arrays.h (scm_i_raw_array): New function.
	  SCM_I_ARRAY_CONTIGUOUS, SCM_SET_ARRAY_CONTIGUOUS_FLAG,
	  SCM_CLR_ARRAY_CONTIGUOUS_FLAG, SCM_I_ARRAY_CONTP: Remove.
	  scm_t_array_dim: Declare here, not in array-handle.h.
	  SCM_I_ARRAY_NDIM: Shift by one bit since the contp flag isn't there
	  anymore.
	* module/syste/vm/assembler.scm: Match removal of contp flag.
	* libguile/arrays.c (scm_i_make_array): Reuse scm_i_raw_array.
	  (scm_i_ra_set_contp): Remove.
	  (scm_transpose_array): Don't set or clear the contp flag.
	  (scm_make_shared_array): Don't set or clear the contp flag.
	  (scm_make_typed_array): Don't set the contp flag.
	* libguile/array-map.c (scm_i_array_rebase): Reuse scm_i_raw_array.

2021-08-16  Daniel Llorens  <lloda@sarc.name>

	Deprecate scm_from_contiguous_typed_array
	This was never documented and it's not used in Guile itself, either.

	Remove the 'simple vector' concept
	* Deprecate scm_is_simple_vector.
	* libguile/vectors.c (scm_vector_elements,
	  scm_vector_writable_elements): These functions take an array; reword
	  to make this clear.
	* libguile/print.h: Remove reference to 'simple vector'.
	* doc/ref/api-data.texi: Remove documentation for scm_is_simple_vector.
	  Remove references to 'simple vector'.
	  Fix documentation for scm_vector_elements,
	  scm_vector_writable_elements.
	* test-suite/tests/arrays.test:
	* test-suite/tests/vectors.test: Remove references to 'simple vector'.

	Update gnulib to 8f4538a53d64054ae2fc8b86c0f87c418c6176e6
	Includes gnulib:0c907f7da13232908f05c415b8cec56024071906 to fix #49930
	https://lists.gnu.org/archive/html/bug-guile/2021-08/msg00003.html.

2021-08-06  Daniel Llorens  <lloda@sarc.name>

	Add function vector-copy! to core
	This is up to 20%-30% faster than the previous versions in (scheme base) or
	(srfi srfi-43) that used vector-move-left!/vector-move-right!.

	* libguile/vectors.h:
	* libguile/vectors.c: As stated.
	* doc/ref/api-data.texi (vector-copy!): Document the new function.
	  (vector-fill!): Document optional arguments.
	  (vector-copy): Document optional arguments.
	* module/scheme/base.scm: Reuse core vector-copy!.
	* module/srfi/srfi-43.scm: Reuse core vector-copy!.

2021-08-06  Daniel Llorens  <lloda@sarc.name>

	Reuse core vector-fill! in (scheme base)
	module/scheme/base.scm: As stated.

	Extend core vector-copy to r7rs vector-copy
	* libguile/vectors.h: Declare scm_vector_copy_partial.
	* libguile/vectors.c (scm_vector_copy_partial): As stated.
	  (scm_vector_copy): Reuse scm_vector_copy_partial.
	* module/scheme/base.scm: Reuse core vector-copy.
	* module/srfi/srfi-43: Reuse core vector-copy.
	* test-suite/tests/vectors.test: Test vector-copy.

2021-08-06  Daniel Llorens  <lloda@sarc.name>

	Deprecate use of vector-move-left! and vector-move-right! on non-vector arrays
	These functions weren't advertised to work on non-vector arrays. They
	did try to, but only incorrectly. For example:

	  (define a (vector 1 2 3 4 5))
	  (define b (make-array 0 '(1 5)))
	  (vector-move-right! a 0 2 b 2)
	  b
	  => #1@1(0 0 1 2 0)

	instead of the correct result #1@1(0 1 2 0 0).

	* libguile/vectors.c (vector-move-left!, vector-move-right!): As stated.

2021-08-05  Daniel Llorens  <lloda@sarc.name>

	Deprecate using vector->list, vector-copy on arrays
	* libguile/vectors.c (vector-copy, vector->list): As stated. Provide
	  array free implementation for the supported case.

2021-08-03  Daniel Llorens  <lloda@sarc.name>

	Merge libguile/generalized-arrays.* into libguile/arrays.*
	* libguile/arrays.h:
	* libguile/arrays.c: As stated.
	* libguile/init.c: Remove call to scm_init_generalized_arrays().

	Elsewhere fix references to generalized-arrays.*.

2021-08-02  Maxime Devos  <maximedevos@telenet.be>

	ice-9/read: Parse #{}}# properly.
	This is a regression since Guile 3.0.2 and breaks compilation
	of a Guile library.

	* module/ice-9/read.scm
	  (%read)[read-parenthesized]: When SAW-BRACE? is #t but CH isn't
	  #\#, don't eat CH.
	* test-suite/tests/reader.test
	  ("#{}#): Add four test cases.

2021-07-11  Rob Browning  <rlb@defaultvalue.org>

	Fix crash on #nil in syntaxes
	In 3.0.7 (after 0cc799185576712d69f11fc794454f2f5447bef7 "Ensure
	that (syntax ()) results in ("), the use of #nil in syntax-rules
	expansions like this:

	  (define-syntax foo
	    (syntax-rules ()
	      ((_ x) (eq? #nil x))))

	  (foo #t)

	could cause a crash that looks like this:

	  ice-9/psyntax.scm:2795:12: In procedure syntax-violation:
	  Syntax error:
	  unknown location: unexpected syntax in form ()

	To fix it, add another special case (the commit mentioned above
	special-cased the empty list) to preserve #nil

	* module/ice-9/psyntax.scm (gen-syntax): Preserve #nil.
	* test-suite/tests/syntax.test: Test #nil in syntax expansions.

	Closes: 49305

2021-06-02  Daniel Llorens  <lloda@sarc.name>

	Fix else in init_bouncing_parens()

2021-05-27  Daniel Llorens  <lloda@sarc.name>

	Fix null dereference in readline initialization
	* guile-readline/readline.c (init_bouncing_parens): Check that the keymap is
	  valid before using it.

2021-05-24  Andy Wingo  <wingo@pobox.com>

	Fix bug in eq-constant? propagation in CSE if kf == kt
	* module/language/cps/cse.scm (compute-out-edges): Only propagate
	constant to successor if successor not kf.
	* test-suite/tests/compiler.test ("cse auxiliary definitions"):
	("closure conversion"): Refactor.
	("constant propagation"): New test.

	Fixes #48368.

2021-05-21  Daniel Llorens  <lloda@sarc.name>

	Fix bug in nftw function
	Fixes bug #44182. Thanks to Matija Obid for the report and RhodiumToad in

2021-05-21  Luis Felipe  <luis.felipe.la@protonmail.com>

	Fix typo in lambda documentation.
	In the part about lambda formals, change "arguments will converted into"
	to "arguments will BE converted into".

	* doc/ref/api-procedures.texi (Lambda: Basic Procedure Creation):
	  Fix typo.

2021-05-19  jakub-w  <jakub-w@riseup.net>

	Fixed style for 02439a124
	* guile-readline/readline.c (scm_filename_completion_function)

2021-05-19  Robin Green  <greenrd@greenrd.org>

	Fix trace-calls-to-procedure
	Fixes #43102 and duplicate #48412.

2021-05-19  Jakub Wojciech  <jakub-w@riseup.net>

	Fixed filename-completion-function for readline completion
	* guile-readline/readline.c (scm_filename_completion_function):
	  A completion function should return #f when there's no more
	  candidates.  Since the result of readline's
	  rl_filename_completion_function was never checked it was impossible
	  for it to work as intended and instead of #f it threw an error from
	  trying to convert NULL to an scm string.

2021-05-18  Maxime Devos  <maximedevos@telenet.be>

	Add ‘expt’ to the list of effect-free primitives.
	I find myself writing code like (- (expt 2 32) 1)
	lately. Let's allow constant-folding that.

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

2021-05-11  Andy Wingo  <wingo@pobox.com>

	Implement cross-module inlining
	* module/language/tree-il/optimize.scm (make-optimizer): Pass
	cross-module-inlining? to peval.
	* module/language/tree-il/peval.scm (peval): Add cross-module-inlining?
	kwarg.  Try to inline public module-ref.

	Add support for recording inlinable module exports
	* module/language/tree-il/inlinable-exports.scm: New module.
	* am/bootstrap.am:
	* module/Makefile.am:
	* module/language/tree-il/optimize.scm (make-optimizer):
	* module/system/base/optimize.scm (available-optimizations): Wire up new
	module.
	* module/ice-9/boot-9.scm (module): Add inlinable-exports field.
	(define-module*): Add #:inlinable-exports kwarg.

	Add pass to resolve free toplevel references in declarative modules
	* am/bootstrap.am (SOURCES):
	* module/Makefile.am (SOURCES):
	* module/language/tree-il/optimize.scm (make-optimizer): Wire up the new
	pass.
	* module/language/tree-il/resolve-free-vars.scm: New pass.
	* module/system/base/optimize.scm (available-optimizations): Enable new
	pass at -O1.

	Letrectify links module defs with uses
	* module/language/tree-il/letrectify.scm (letrectify): Inline "let"
	bindings inside residualized "letrec*" forms, to allow the dominator
	relationship to be reflected in the scope tree.  Also, detect
	"define-module*" invocations, and add these to the mod-vars set, so that
	residualized "module-ensure-local-variable!" primcalls can clearly
	denote their module without having to use "current-module".

	Bump objcode version
	* libguile/loader.h (SCM_OBJCODE_MINOR_VERSION):
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump, as
	we're going to start adding inlinable exports.

2021-05-10  Andy Wingo  <wingo@pobox.com>

	Bump version to 3.0.7
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.  Don't update libtool
	version, as the C library hasn't changed.  (Has that ever happened
	before??)

	Update NEWS
	* NEWS: Update.

	Update NEWS
	* NEWS: Update

2021-05-10  Leo Prikler  <leo.prikler@student.tugraz.at>

	bug#45131: [PATCH] Compile directly to target language if no joint is found.
	This enables the compilation from "manually" written Tree-IL to
	bytecode.  See also <https://bugs.gnu.org/45131>.

	* system/base/compile.scm (read-and-compile)[(joint #f)]<? eof-object?>:
	Join exps using the default joiner for to.
	<exp>: Compute compiler for to.
	* test-suite/test/compiler.test ("read-and-compile tree-il"): New test.

2021-05-10  Andy Wingo  <wingo@pobox.com>

	Minor tweak to truncate-bits
	* module/system/base/types/internal.scm (truncate-bits): Use bits-case
	in all cases.

2021-05-08  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS: Update.

2021-05-08  Ludovic Courtès  <ludo@gnu.org>

	'primitive-fork' closes and recreates the current thread's 'sleep_pipe'.
	Partly fixes <https://bugs.gnu.org/41948>.

	Previously, the child process could end up using the same 'sleep_pipe'
	as its parent, leading to a race condition handling signals.

	* libguile/posix.c (do_fork): New function.
	(scm_fork): Call 'do_fork' via 'scm_without_guile'.
	* test-suite/standalone/test-signal-fork: New test.
	* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.

2021-05-08  Andrew Whatson  <whatson@gmail.com>
	    Ludovic Courtès  <ludo@gnu.org>

	Close the finalization pipe before forking.
	Partly fixes <https://bugs.gnu.org/41948>.
	Reported by Mathieu Othacehe <othacehe@gnu.org>.

	Previously, after 'fork', the child process could end up sharing the
	finalization thread with its parent.

	* libguile/finalizers.c (finalization_pipe): Initialize.
	(reset_finalization_pipe): Factored out.
	(start_finalization_thread): Create the pipe immediately before
	launching the thread.  Ensure the pipe is cleaned up if thread creation
	fails.  Update the finalizer callback if thread creation succeeds.
	(stop_finalization_thread): Clean up the pipe after stopping the thread.
	(spawn_finalizer_thread): Remove finalizer callback logic.
	(scm_set_automatic_finalization_enabled): Remove pipe management.
	(scm_init_finalizer_thread): Remove pipe management.

2021-05-08  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS: Mention O_* constants.

2021-05-07  Maxime Devos  <maximedevos@telenet.be>

	Define `O_NOFOLLOW' and various other flags when supported.
	* libguile/filesys.c (scm_init_filesys): Define ‘O_IGNORE_CTTY’,
	  ‘O_NOLINK’, ‘O_NOFOLLOW’, ‘O_PATH’, ‘O_TMPFILE’, ‘O_SHLOCK’,
	  ‘O_EXLOCK’, ‘O_ASYNC’, ‘O_NOATIME’, ‘O_DIRECTORY’, ‘O_CLOEXEC’
	  and ‘O_DIRECT’ when available.

2021-05-07  Ludovic Courtès  <ludo@gnu.org>

	NEWS: Fix typos.
	* NEWS: Fix typos in Guile 3.0.0 bit about #:verify-certificate?.

2021-05-06  Andy Wingo  <wingo@pobox.com>

	Optimize truncate-bits
	* module/system/base/types/internal.scm (truncate-bits): Inline cases
	for 16, 32, and 64, to avoid allocating bignums for the boundary
	conditions.

2021-05-05  jakub-w  <jakub-w@riseup.net>

	[srfi-64] Fix a bug with test-end removing globally installed test-runner
	* testing.scm (%test-begin, %test-end): When (test-runner-current) is
	not set, create a new one like before but also add a finalizer that
	will remove it after the test is finished. Previously the test runner
	was getting unset unconditionally.

	See https://srfi-email.schemers.org/srfi-64/msg/16468240/

2021-05-02  Ludovic Courtès  <ludo@gnu.org>

	analyze: 'unbound-variable' warning handles re-exported bindings.
	Fixes <https://bugs.gnu.org/47031>.

	* module/language/tree-il/analyze.scm (make-use-before-definition-analysis)
	[resolve]: Add case for when NAME is re-exported by MOD.
	* test-suite/tests/tree-il.test ("warnings")["re-exported binding"]: New test.

2021-05-01  Andy Wingo  <wingo@pobox.com>

	Include config.h in mini-gmp.c, if present
	* libguile/mini-gmp.c: Add config.h include.  Handles the case in which
	gnulib provides some part of the standard library of mini-gmp, as is
	apparently the case on FreeBSD for example.  Thanks to RhodiumToad for
	the report and fix.

	Fix R7RS include-library-declarations and cond-expand in define-library
	* module/ice-9/r7rs-libraries.scm (define-library): Fix bug handling
	include-library-declarations and cond-expand subforms.  Thanks to Adam
	Nelson for the fix!  Fixes #40252.

	Fix bug if call-with-prompt tag not a lexical
	* module/language/tree-il/peval.scm (peval): peval could throw if the
	call-with-prompt operand wasn't a lexical.  Terrible!

2021-05-01  Andy Wingo  <wingo@pobox.com>

	Fix tree-il effects analysis for prompts
	* module/language/tree-il/effects.scm (make-effects-analyzer): The body
	of a prompt is an expression only for escape-only prompts, and the
	handler is always a lambda.  Fix bug where a prompt could be incorrectly
	marked effect-free.
	* test-suite/tests/tree-il.test ("optimize"): Add test for bug 48098.

	Fixes bug 48098.

2021-05-01  Andy Wingo  <wingo@pobox.com>

	Fix bug for read-syntax on ( . args)
	* module/ice-9/boot-9.scm: Capture syntax?.
	* module/ice-9/read.scm (read-syntax): Avoid re-annotating objects.
	* test-suite/tests/reader.test ("read-syntax"): Add test.

2021-04-29  Andy Wingo  <wingo@pobox.com>

	Fix syntax test
	* test-suite/tests/syntax.test ("expressions"): The source location
	alist is unordered.

	Fix syntax-violation, which was passing vectors instead of alists
	* module/ice-9/psyntax.scm (syntax-violation): Pass source as an alist.
	A sourcev would be better but it's incompatible.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	Fix compile-psyntax.scm -- canonicalize pass not needed
	* module/ice-9/compile-psyntax.scm: Remove use of canonicalization pass,
	as it's not needed.  Whoopdy!

2021-04-29  Ludovic Courtès  <ludo@gnu.org>

	bug#48096: [3.0.6] ‘syntax-error’ exceptions include vectors instead of source location properties
	Hi!

	In 3.0.6, a slight incompatibility crept in: ‘syntax-error’ exceptions
	include vectors like #("example.scm" 1 2) instead of good’ol source
	property alists.

	Here is a test case that reproduces the problem:

2021-04-29  Andy Wingo  <wingo@pobox.com>

	Fix line and column for read errors
	* module/ice-9/read.scm (%read): Add 1 to both line and column: the
	former to make 1-based user lines instead of 0-based Guile lines, and
	the latter because apparently that's how we always did it :)  Fixes

2021-04-29  Ludovic Courtès  <ludo@gnu.org>

	bug#48089: Guile 3.0.6 returns zero-indexed locations for ‘read-error’
	Ludovic Courtès <ludo@gnu.org> skribis:

	> Guile 3.0.6 returns zero-indexed (instead of one-indexed) source code
	> locations for ‘read-error’.  Here’s a 3.0.6/3.0.5 comparison:
	>
	> $ /gnu/store/r2nr74rwhpqg16y1lyi6l0jn3lwx4yyz-guile-3.0.6/bin/guile  <(echo '(')
	> ice-9/read.scm:126:4: In procedure lp:
	> /dev/fd/63:1:0: unexpected end of input while searching for: )
	> $ guile  <(echo '(')
	> ERROR: In procedure primitive-load:
	> In procedure scm_i_lreadparen: /dev/fd/63:2:1: end of file

	Here’s a test case waiting to succeed!  :-)

2021-04-28  Andy Wingo  <wingo@pobox.com>

	Fix duplicates handlers for interfaces that use interfaces
	* module/ice-9/boot-9.scm (duplicate-handlers): Use module-variable
	instead of module-local-variable in the warn-override-core, first, and
	last handlers.  Fixes #47084 mostly, though relative to pre-3.0 there is
	still a difference in that a module needs to explicitly declare which
	bindings are intended as replacements -- a binding being a replacement
	is a property of the module in 3.0, rather than the variable as was the
	case before 3.0.

2021-04-27  Andy Wingo  <wingo@pobox.com>

	Bump GUILE-VERSION
	* GUILE-VERSION (GUILE_EFFECTIVE_VERSION): Bump

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

	Update NEWS
	* NEWS: Update.

	Add GUILE_INSTALL_GMP_MEMORY_FUNCTIONS to NEWS; use at build-time
	* NEWS (GUILE_INSTALL_GMP_MEMORY_FUNCTIONS): Update
	* libguile/numbers.c: Add needed include.
	* meta/build-env.in (GUILE_INSTALL_GMP_MEMORY_FUNCTIONS): Set when
	building Guile.

2021-04-27  Daniel Llorens  <lloda@sarc.name>

	Remove build-aux/config.rpath
	This is generated by autogen.sh.

2021-04-27  Andy Wingo  <wingo@pobox.com>

	Fix closure-conversion bug for SCC with all free vars pruned
	* module/language/cps/closure-conversion.scm (convert-one): Fix bug when
	getting value of SCC whose free variables have been elided.  Thanks to
	abcdw for the report!
	* test-suite/tests/compiler.test ("cse auxiliary definitions"): Remove
	spurious newline.
	("closure conversion"): New test.

2021-04-26  Andy Wingo  <wingo@pobox.com>

	Allow users to force gmp to use libgc
	* doc/ref/guile-invoke.texi (Environment Variables): Document
	GUILE_INSTALL_GMP_MEMORY_FUNCTIONS.
	* libguile/numbers.c (scm_init_numbers): Use environment variable.

	Bump minor objcode version for new intrinsics
	* libguile/loader.h (SCM_OBJCODE_MINOR_VERSION): Bump.
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.

	Allow contification for $callk
	* module/language/cps/contification.scm (compute-first-class-functions):
	(compute-functions-called-by-label):
	(compute-functions):
	(compute-arities):
	(compute-contification-candidates):
	(compute-call-graph):
	(compute-contification):
	(apply-contification):
	(contify): Given that the frontend will produce $callk now, allow it to
	be contified if such callees are all called with the same continuation.

	CPS conversion calls module variables through trampolines
	* module/language/tree-il/compile-cps.scm (module-call-stubs):
	(module-call-label, convert, cps-convert/thunk): Arrange to call module
	variables through out-of-line trampolines with unchecked arity.  This
	should speed up compile time in large files and reduce code size on hot
	paths.

	Fix CPS optimizations to allow callk in front half
	* module/language/cps/closure-conversion.scm: Use standard
	compute-reachable-functions and intmap-select from utils to filter
	reachable functions, allowing us to pick up callk.  Adapt some uses to
	expect callk for calls.
	* module/language/cps/self-references.scm (resolve-self-references):
	Subst the proc, if it's there.
	* module/language/cps/split-rec.scm (compute-free-vars): Add a case for
	callk.

	Fix error when argument to < not a real
	* libguile/intrinsics.c (less_p): scm_nan_p raises an error if arg is
	not a real; guard.

	Simplify module variable lookup slow-path
	* libguile/intrinsics.h:
	* libguile/intrinsics.c (lookup_bound_public, lookup_bound_private): Two
	new intrinsics.
	(scm_bootstrap_intrinsics): Wire them up.
	* libguile/jit.c (compile_call_scm_from_scmn_scmn):
	(compile_call_scm_from_scmn_scmn_slow):
	(COMPILE_X8_S24__N32__N32__C32): Add JIT support for new instruction
	kind.
	* libguile/vm-engine.c (call-scm<-scmn-scmn): New instruction, takes
	arguments as non-immediate offsets, to avoid needless loads and register
	pressure.
	* module/language/cps/effects-analysis.scm: Add cases for new
	primcalls.
	* module/language/cps/compile-bytecode.scm (compile-function): Add new
	primcalls.
	* module/language/cps/reify-primitives.scm (cached-module-box): If the
	variable is bound, call lookup-bound-public / lookup-bound-private as
	appropriate instead of separately resolving the module, name, and doing
	the bound check.
	* module/language/tree-il/compile-bytecode.scm (emit-cached-module-box):
	Use new instructions.
	* module/system/vm/assembler.scm (define-scm<-scmn-scmn-intrinsic):
	(lookup-bound-public, lookup-bound-private): Add assembler support.

2021-04-25  Andy Wingo  <wingo@pobox.com>

	Fix cached-module-box cache keys
	* module/language/cps/reify-primitives.scm (cached-module-box): Include
	public? in cache key, so we don't accidentally alias private and
	exported names.  Also include bound?, to avoid a window in which thread
	A resolves and caches var V in preparation for setting it, but thread B
	sees V for ref before it was initialized.

	Fix bugs introduced when allowing $kfun -> $kargs
	* module/language/cps/dce.scm (compute-known-allocations):
	* module/language/cps/simplify.scm (eta-reduce): Allow the case-lambda
	without clauses.

2021-04-23  Andy Wingo  <wingo@pobox.com>

	Fix comments in cps/compile-bytecode
	* module/language/cps/compile-bytecode.scm (compile-function): Fix
	unfinished comments.

2021-04-21  Andy Wingo  <wingo@pobox.com>

	New pass: elide-arity-checks
	* module/language/cps/elide-arity-checks.scm: New file.  Elides argument
	count checks for known callers.
	* am/bootstrap.am (SOURCES):
	* module/Makefile.am (SOURCES): Add new file.
	* module/language/cps/optimize.scm (optimize-first-order-cps):
	* module/system/base/optimize.scm (available-optimizations): Add new
	pass.

	Allow $kargs as entry of $kfun
	* module/language/cps.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/types.scm: Allow $kargs to follow $kfun.  In that
	case, the function must be well-known and callers are responsible for
	calling with the appropriate arity.
	* module/language/cps/compile-bytecode.scm: Emit "unchecked-arity" for
	$kargs following $kfun.
	* module/system/vm/assembler.scm: Adapt.

	Mark some elisp runtime modules as non-declarative
	* module/language/elisp/runtime/function-slot.scm (language):
	* module/language/elisp/runtime/value-slot.scm (language):
	Non-declarative.

	Optimize letrec* binding order in fix-letrec
	* module/language/tree-il/fix-letrec.scm (reorder-bindings):
	(fix-letrec): Reorder definitions so that lambdas tend to stick
	together, to avoid "complex" expressions interposing in lambda SCCs.

2021-04-12  Jan (janneke) Nieuwenhuizen  <janneke@gnu.org>

	Compile fix for x86_64-MinGW.
	* libguile/posix-w32.h (start_child): Return pid_t.

2020-08-13  Jan (janneke) Nieuwenhuizen  <janneke@gnu.org>

	ice-9 ftw: Use 'absolute-file-name?' in 'nftw'.
	* module/ice-9/ftw.scm (abs?): Remove.
	(nftw): Use 'absolute-file-name?' instead.

2020-10-05  Jan (janneke) Nieuwenhuizen  <janneke@gnu.org>

	Document write-line.
	* libguile/rdelim.c (SCM_DEFINE): Use "procedure" rather than
	"function".
	* doc/ref/api-io.texi (Line/Delimited): Use it to document 'write-line'.

2021-04-08  Daniel Llorens  <lloda@sarc.name>

	Update gnulib to a3a946f670718d0dee5a7425ad5ac0a29fb46ea1
	This fixes https://lists.gnu.org/archive/html/guile-devel/2021-04/msg00009.html

2021-04-04  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Fix typos in examples.
	Thanks to Eugene Klimov.

2021-04-01  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Fix handling of parameter lists to elisp defun to allow nil.
	Thanks to Vasilij Schneidermann.

2021-03-19  David Thompson  <dthompson@vistahigherlearning.com>

	goops: Preserve all slot options in redefinable classes.
	* module/goops.scm (compute-slots): Fix <redefinable-class> slot
	transformation.
	* test-suite/tests/goops.test ("slot options on redefinable classes"):
	Add a test.

2021-03-19  Ludovic Courtès  <ludo@gnu.org>

	web: 'tls-wrap' returns an unbuffered custom port.
	This mirrors Guix commit b168acae2a01fd84075cc134a6140594a978fde5.

	* module/web/client.scm (tls-wrap)[unbuffered]: New procedure.
	Pass the result of 'make-custom-binary-input/output-port' to
	'unbuffered'.

2021-03-19  Ludovic Courtès  <ludo@gnu.org>

	web: 'tls-wrap' avoids intermediate buffer.
	This mirrors Guix commit 279d932b1ca7bfbb8657c41a84616dd0dfc6e0a8.

	* module/web/client.scm (tls-wrap)[read!]:  Read straight into BV
	instead of calling 'get-bytevector-some' and 'unget-bytevector'.

2021-03-18  Andy Wingo  <wingo@pobox.com>

	Update NEWS
	* NEWS: Updates.

2021-03-16  Andy Wingo  <wingo@pobox.com>

	Fix recent i18n tests
	* test-suite/tests/i18n.test ("text collation (French)"): Fix to
	actually pass locale arg.

2021-03-15  Andy Wingo  <wingo@pobox.com>

	Fix buffer overread in string-locale<?
	* libguile/i18n.c (compare_strings): In all cases, convert to a
	null-terminated string.  While we're doing that, might as well use
	utf-8.
	* test-suite/tests/i18n.test ("text collation (French)"): Add test.

	Thanks again to Rob Browning for the report.

2021-03-15  Andy Wingo  <wingo@pobox.com>

	Adapt test for string-locale-ci=?
	* test-suite/tests/i18n.test ("text collation (French)"): Punt on
	collating if utf8 locale unavailable.

2021-03-15  Andy Wingo  <wingo@pobox.com>

	Fix buffer overread in string-locale-ci=? and related functions
	* libguile/i18n.c (u32_locale_casecoll): Take lengths of incoming
	strings as parameters rather than assuming "nul" termination.
	(compare_u32_strings_ci): Pass string lengths as computed from the
	Scheme strings.
	* test-suite/tests/i18n.test ("text collation (English)"): Add a test
	case.

	Thanks a million to Rob Browning for the report.

2021-03-14  Mike Gran  <spk121@yahoo.com>

	Add JIT capability for MinGW
	* libguile/jit.c [__MING32__]: add windows.h on Win32
	  (struct code_arena) [__MINGW32__]: a HANDLE for Win32 mmap
	  (BIGENDIAN): rename to JIT_BIGENDIAN, to avoid collision with
	    Win32 BIGENDIAN constant. All users changed
	  (allocate_code_arena) [__MINGW32__]: add Win32 mmap allocator
	  (emit_code) [__MINGW32__]: add Win32 munmap
	* libguile/lightening/lightening/lightening.c: remove unnecessary mman.h

2021-03-13  Mike Gran  <spk121@yahoo.com>

	On Cygwin, 'lib' DLLs use 'cyg' prefix
	When using automake and libtool to build DLLs on Cygwin, libtool
	will rename libXXX to cygXXX. 'load-foreign-library' should
	emulate libltdl behavior and search for DLLs using that convention.

	* module/system/foreign-library.scm (lib->cyg): new helper function
	  (load-foreign-library): add rename-on-cygwin? option to rename
	    libraries using Cygwin semantics
	* test-suite/tests/foreign.test: new test section 'lib->cyg'
	* doc/ref/api-foreign.text: document new rename-on-cygwin? option
	    for load-foreign-library

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

	Don't force installation of GMP allocators in guile shell
	* libguile/guile.c (main): Don't override initial setting of
	scm_install_gmp_memory_functions.  Thanks to Andrew Whatson for the
	fix.

2021-03-12  Ricardo G. Herdt  <r.herdt@posteo.de>

	Fix hash-table-merge! bug.
	* module/srfi/srfi-69.scm : fold over second hash table.

2021-03-12  Andrew Whatson  <whatson@gmail.com>

	Fix suspendable implementation of 'get-bytevector-some!'
	* module/ice-9/suspendable-ports.scm (get-bytevector-some!): Fix
	  incorrect arguments to bytevector-copy!

	Add tests for get-bytevector-some!
	* test-suite/tests/r6rs-ports.test (get-bytevector-n! [short]): add
	  (get-bytevector-n! [long]): add

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

	Revert "Handle CRLF and Unicode line endings in read-line"
	This reverts commit 0f983e3db0c43ad7c89f57ea84f792ede373ba0c.

	After discussing with Mike we are going to punt the read-line changes
	for now.  Open the port in O_TEXT mode if you want to chomp the CR in
	CFLF sequences.

2021-03-12  Michael Gran  <spk121@yahoo.com>

	Add read-line and ftw changes to NEWS
	* NEWS: updated

2021-03-12  Mike Gran  <spk121@yahoo.com>

	Handle CRLF and Unicode line endings in read-line
	* libguile/rdelim.c (scm_read_line): handle CRLF, LS and PS
	* module/ice-9/suspendable-ports.scm (read-line): handle CRLF, LS, and PS
	* module/web/http.scm (read-header-line): take advantage of CRLF in read-line
	   (read-header): don't need to test for \return
	* test-suite/tests/rdelim.test: new tests for read-line CRLF, LS and PS
	* doc/ref/api-io.texi: update doc for read-line

2021-03-11  Michael Gran  <spk121@yahoo.com>

	ice-9 ftw: handle non-working inodes
	* module/ice-9/ftw.scm (visited?-proc): accept filename for string hash
	  (file-system-fold): use string hash if ino = 0
	  (ftw): use new visited?-proc
	* test-suite/tests/ftw.test (visited?-proc valid inodes): add filenames to visited?-proc calls
	  (visited?-proc broken inodes): new tests
	  (%top-srcdir): canonicalize-path

	ice-9 ftw: handle missing getuid and getgid
	* module/ice-9/ftw.scm (getuid-or-false, getgid-or-false): new macros
	  (stat-dir-readable?-proc): don't overwrite arguments
	  (ftw, nftw): use new macros
	* test-suite/tests/ftw.test (test-EACCES): don't presume getuid exists

	For MinGW use Windows filepaths in libpath.h
	* configure.ac (MINGW_LIBPATH): new automake conditional and test
	* libguile/Makefile.am (libpath.h) [MINGW_LIBPATH]: use Windows-style
	    paths

2021-03-11  Mike Gran  <spk121@yahoo.com>

	on MinGW, prefer winsock2.h over sys/select in iselect
	* libguile/iselect.h [__MINGW32__]: add winsock2 include

	Build standalone test libraries as unversioned
	* test-suite/standalone/Makefile.am (libtest_asmobs_la_LDFLAGS): avoid version
	    (libtest_ffi_la_LDFLAGS, libtest_extensions_la_LDFLAGS): avoid version

	Add windows stubs for dlopen, dlclose, dlsym, dlerror
	* libguile/dynl.c [__MING32__] (dlopen, dlsym, dlclose, dlerror): use windows stubs
	* libguile/posix-w32.c (dlopen_w32, dlsym_w32, dlclose_w32, dlerror_w32):
	    new procedures
	    (dlerror_str): new module-level variable
	    (DLERROR_LEN): new define
	* libguile/posix-w32.h: declare dlopen_w32, dlsym_w32, dlclose_w32, dlerror_w32.
	    Declare RTLD_NOW, RTLD_LAZY, RTLD_GLOBAL, RTLD_LOCAL

2021-03-10  Andy Wingo  <wingo@pobox.com>

	Add mkstemp; undocument mkstemp!
	* doc/ref/posix.texi (File System): Update to document mkstemp only.
	* libguile/filesys.c: Make a mkstemp that doesn't modify the input
	template.  Instead the caller has to get the file name from
	port-filename.
	(scm_mkstemp): Use the new mkstemp to implement mkstemp!.  Can't
	deprecate yet though as the replacement hasn't been there for long
	enough.
	* libguile/posix.c (scm_tempnam): Update to mention mkstemp instead.
	* module/system/base/compile.scm (call-with-output-file/atomic): Use
	mkstemp.
	* test-suite/tests/posix.test:
	* test-suite/tests/r6rs-files.test: Use mkstemp.
	* NEWS: Update.

2021-03-10  Mike Gran  <spk121@yahoo.com>

	On Win32, prefer winsock2 header for socket declarations
	* libguile/posix-w32.h: prefer lowercase windows.h for MinGW cross-builds
	* libguile/socket.c [HAVE_WINSOCK2_H]: use only winsock2.h for socket
	    declarations

2021-03-10  Michael Gran  <spk121@yahoo.com>

	remove 2nd attempt at invoking ComSpec when spawning child
	The start_child procedure is used to spawn a child process. If it fails
	to launch the given argv[0] as if it were a command, it has logic to
	retry using the ComSpec as a command interpreter, treating argv[0] as
	a batch file name. Usually, this fails because batch files would have
	been handled in the first pass if they were valid.  Also, this has
	the unfortunate side effect of spawning a shell awaiting user input.

	It is safer to remove this attempt.

	* libguile/posix-w32.c (start_child): remove fallback processing

2021-03-10  Michael Gran  <spk121@yahoo.com>

	disable popen 'no duplicates' test for MinGW
	This test, which seems quite complicated to fix, causes the MinGW build
	to hang. Disable it for now, but, come back to it later.

	* test-suite/tests/popen.test (mingw?): new constant
	  (no duplicate): disable for mingw, for now

2021-03-10  Michael Gran  <spk121@yahoo.com>

	Use lower-case windows.h
	On some linux cross-builds, Windows.h is windows.h. On MinGW
	case is irrelevant.

	* libguile/posix-w32.h: modified

2021-03-09  Linus  <bjornstam.linus@fastmail.se>

	Write a proper vector-map and vector-for-each for (rnrs base)
	* module/rnrs/base.scm (vector-map vector-for-each): Rewrite to not be
	slow.
	* NEWS: Update.

2021-03-09  Andy Wingo  <wingo@pobox.com>

	Document syntax-sourcev
	* NEWS: Add doc link.
	* doc/ref/api-macros.texi (Syntax Transformer Helpers): Document
	syntax-sourcev.
	* module/system/syntax.scm: Re-export syntax-sourcev.

	Document quote-syntax
	* NEWS: Update.
	* doc/ref/api-macros.texi (Syntax Case): Update.

	Update NEWS
	* NEWS: More words about mini-gmp.

2021-03-09  Michael Gran  <spk121@yahoo.com>

	Fix define error for mini-gmp
	* libguile/gen-scmconfig.c [!SCM_I_GSC_ENABLE_MINI_GMP]: define
	    SCM_ENABLE_MINI_GMP as zero, not undef

2021-03-08  Andy Wingo  <wingo@pobox.com>

	Update NEWS for --enable-mini-gmp
	* NEWS: Update.

	Only install libgc as GMP allocator with mini-gmp
	* libguile/numbers.c (scm_install_gmp_memory_functions): Default to 1
	only if mini-gmp is enabled.

	Don't expose mini-gmp to users
	* libguile.h: Don't import anything GMP-related.
	* libguile/numbers.h: Import GMP here instead.  If we are using
	mini-GMP, only import it when building Guile.
	(scm_to_mpz, scm_from_mpz): Don't define when mini-gmp is enabled.

2021-03-07  Andy Wingo  <wingo@pobox.com>

	More informative error message if GMP not found
	* configure.ac: Mention --enable-mini-gmp if GMP not found.

	Fix reading #!!#
	* module/ice-9/read.scm (%read): Fix reading #!!#.
	* test-suite/tests/reader.test ("reading"): Add some test cases.

2021-03-06  Michael Gran  <spk121@yahoo.com>

	tweak unknown hash object error in reader
	This makes it match the other species of unknown hash object error
	when reading number with radix.

	* module/ice-9/read.scm (read-sharp): modified

2021-03-06  Michael Gran  <spk121@yahoo.com>

	print token in error msg for unknown hash object
	* module/ice-9/read.scm (read-number-and-radix): modified

	Handle <eof> in reader's character escape sequences
	* module/ice-9/read.scm (read-r6rs-hex-escape, read-fixed-hex-escape):
	    modified

2021-03-05  Andy Wingo  <wingo@pobox.com>

	Fix reading "#;", "'", and similar premature-EOF situations
	* module/ice-9/read.scm (%read): Adjust how subexpressions are read to
	error on EOF.  Improve the error message.
	* test-suite/tests/reader.test ("#;"): Adapt expectation.

	Fix up source properties section in manual
	* doc/ref/api-debug.texi (Source Properties): Fix wordo, and adapt
	text.

	Fix reading of #true / #false
	* module/ice-9/read.scm (%read): Fix bad argument order to unread-char.

2021-03-04  Andy Wingo  <wingo@pobox.com>

	Update reference for GUILE_EXTENSIONS_PATH
	* NEWS: Update.
	* doc/ref/guile-invoke.texi (Environment Variables): Add entry.

	Update documentation to incorporate read-syntax
	* NEWS: Update a bit.
	* doc/ref/api-debug.texi (Source Properties): Mention read-syntax.
	* doc/ref/api-evaluation.texi (Annotated Scheme Read): New section.
	* doc/ref/api-macros.texi (Syntax Case): Update for source vectors.

	Syntax objects print with source locations
	* module/system/syntax.scm (print-syntax): Print source locations.

2021-03-04  Daniel Llorens  <lloda@sarc.name>

	Add docstring for array-shape

2021-03-04  Andy Wingo  <wingo@pobox.com>

	Fix reading improper curly-infix expressions
	* module/ice-9/read.scm (%read): A fix to last night's fix, to make
	srfi-105.test pass.

2021-03-03  Michael Gran  <spk121@yahoo.com>

	don't presume availability of gmp.pc
	This suggests moving the conditional that determines if mini-gmp is used
	into scmconfig.h.

	* configure.ac: replace PKG_CHECK_MODULES for gmp with AC_LIB_HAVE_LINKFLAGS
	    Remove ENABLE_MINI_GMP define.  Also don't run mpz_inits test for
	    --enable-mini-gmp.
	* libguile/gen-scmconfig.c (main) [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
	    with SCM_I_GSC_ENABLE_MINI_GMP
	* libguile/bytevectors.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
	    with SCM_ENABLE_MINI_GMP
	* libguile/init.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
	    with SCM_ENABLE_MINI_GMP
	* libguile/numbers.c: include scm.h
	    [SCM_ENABLE_MINI_GMP]: provide mpz_inits and mpz_clears
	    [ENABLE_MINI_GMP]: prefer SCM_ENABLE_MINI_GMP to ENABLE_MINI_GMP
	* libguile/numbers.h: include scm.h
	* libguile/random.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
	    with SCM_ENABLE_MINI_GMP
	* libguile/socket.c [ENABLE_MINI_GMP]: replace ENABLE_MINI_GMP
	    with SCM_ENABLE_MINI_GMP

2021-03-03  Andy Wingo  <wingo@pobox.com>

	Fix reading #c32 vectors
	* module/ice-9/read.scm (%read): Fix a wee typo.

	Fix some srfi-105 parsing errors
	* module/ice-9/read.scm (%read): Fix parsing errors.

	Fix length of \U hex escape in new reader
	* module/ice-9/read.scm (%read): \U escape is 6 digits long.

	Remove read extension support from primitive-read
	* libguile/read.c (scm_read_sharp_extension): Remove.
	(scm_read_sharp): Adapt.

	More read.c simplifications
	* libguile/read.c: Use "return EXPR" instead of "return (EXPR)".  Avoid
	passing around line and column info, as we don't use it any more.

	primitive-read handles only default reader options
	* libguile/read.c: Remove support for all non-default reader options.
	Also remove support for source positions.  The idea is that
	primitive-read should just be a stripped-down, easy-to-understand reader
	that is enough to bootstrap the C reader.  Probably more refactoring
	will follow.

	Scheme reader fully replaces C reader
	* libguile/read.h:
	* libguile/read.c (scm_primitive_read): New name for C reader.
	(scm_read): Call current value of "read" variable.
	(scm_init_read): Initialize "read" binding to "primitive-read".
	Replaced later in boot-9.

2021-03-03  Daniel Llorens  <lloda@sarc.name>

	Fix bug in new array reader
	* module/ice-9/read.scm (read-array): Return pair for dimension when len
	  is given; single number is lbnd for list->typed-array.
	* test-suite/tests/arrays.test: More test cases for the reader.

2021-03-03  Andy Wingo  <wingo@pobox.com>

	Read-in-scheme replaces boot "read" definition
	Instead of defining a separate module, given that "read" calls are quite
	all over the place, we're just going to replace the boot "read" binding
	with read.scm.  This way, we'll be able to remove support for reader
	options in the boot reader, as it will only ever be used for a finite
	set of files.

	* NEWS: Update.
	* module/Makefile.am (ice-9/boot-9.go): Depend on read.scm.
	(SOURCES):
	* am/bootstrap.am (SOURCES): Don't build a ice-9/read.go, as we include
	it.
	* module/ice-9/boot-9.scm (read-syntax): Define here, as "include" now
	uses it.
	(read-hash-procedures, read-hash-procedure, read-hash-extend): New
	procedures.  Will replace C variants.
	(read, read-syntax): Include read.scm to define these.
	* module/ice-9/psyntax-pp.scm (include): Regenerate.
	* module/ice-9/psyntax.scm (include): Use read-syntax, so we get better
	source information.
	* module/ice-9/read.scm (let*-values): New local definition, to avoid
	loading srfi-11.
	(%read): Use list->typed-array instead of u8-list->bytevector.
	* module/language/scheme/spec.scm: Remove (ice-9 read) import;
	read-syntax is there in the boot environment

2021-03-03  Andy Wingo  <wingo@pobox.com>

	Relax srfi-105 source expectations
	* test-suite/tests/srfi-105.test ("curly-infix"): For { EXPR }, allow
	the source to be at the { rather than at EXPR.

	Fix unterminated #!...!# error message in Scheme reader
	* module/ice-9/read.scm (%read): Tweak "unterminated block constant"
	error to be more compatible with C reader.

	Fix reading neoteric exprs in Scheme reader
	* module/ice-9/read.scm (%read): Call the inner reader, not the outer
	reader.

	Fix reader extensions in Scheme reader
	* module/ice-9/read.scm (%read): Fix invocation of hash procedure.

	Invalid charset at EOF does not cause decoding error
	* libguile/ports.c (peek_iconv_codepoint): If the input has no bytes,
	there's little point in raising a decoding error here.  Therefore remove
	the needless iconv acquisition, harmonising with suspendable-ports.
	* test-suite/tests/ports.test ("port-encoding"): Update test to include
	some input so that the exception gets raised.

	Remove textual-ports include from (ice-9 read)
	* module/ice-9/read.scm: We'll be loading this file early, so avoid
	extraneous deps.

2021-03-02  Michael Gran  <spk121@yahoo.com>

	improve autoconfigury for minigmp
	* configure.ac: add SCM_I_GSC_ENABLE_MINI_GMP var and rename
	    GUILE_MINI_GMP to ENABLE_MINI_GMP
	* libguile/bytevectors (GUILE_MINI_GMP): rename to ENABLE_MINI_GMP
	* libguile/gen-scmconfig.c: renamed GUILE_MINI_GMP to ENABLE_MINI_GMP.
	    rename GUILE_MINI_GMP to SCM_ENABLE_MINI_GMP
	* libguile/gen-scmconfig.h: add SCM_I_GSC_ENABLE_MINI_GMP
	* libguile/init.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP
	* libguile/numbers.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP
	* libguile/numbers.h: include scmconfig.h
	    rename GUILE_MINI_GMP to SCM_ENABLE_MINI_GMP
	* libguile/random.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP
	* libguile/socket.c [GUILE_MINI_GMP]: prefer ENABLE_MINI_GMP
	* libguile.h [GUILE_MINI_GMP]: prefer SCM_ENABLE_MINI_GMP

	Enable option to prefer mini-gmp over libgmp
	* configure.ac: rework gmp library detection. Add new flag.
	* libguile.h: modify gmp header inclusion
	* libguile/Makefile.am: add mini-gmp.[ch] files
	* libguile/bytevectors.c: add mini-gmp headers
	* libguile/gen-scmconfig.c: new #include variable GUILE_MINI_GMP
	* libguile/init.c: add mini-gmp header
	* libguile/mini-gmp.c: new file
	* libguile/mini-gmp.h: new file
	* libguile/numbers.c: add fallback for missing mpz_get_d_2exp
	* libguile/numbers.h: yse mini-gmp header
	* libguile/random.c: use mini-gmp header
	* libguile/socket.c: use mini-gmp header

2021-03-02  Daniel Llorens  <lloda@sarc.name>

	Fix another typo in routine reading arrays
	* module/ice-9/read.scm: As stated.
	* test-suite/tests/arrays.test: Test a fixed case.

2021-03-02  Andy Wingo  <wingo@pobox.com>

	Fix bug reading arrays with lengths
	* module/ice-9/read.scm (%read): Fix typo.

2021-03-01  Andy Wingo  <wingo@pobox.com>

	Update NEWS
	* NEWS: Start updating for new release.

2021-02-28  Andy Wingo  <wingo@pobox.com>

	Fix Scheme read without source positions
	* module/ice-9/read.scm (read): Fix annotate when positions are
	disabled.

2021-02-25  Andy Wingo  <wingo@pobox.com>

	Shunt syntax-sourcev to (system syntax internal)
	* module/ice-9/boot-9.scm: Add syntax-sourcev to hidden bindings.

	read-syntax uses vector source representation
	* module/ice-9/read.scm (read-syntax): Switch to sourcev format.

	Psyntax uses sourcev internally
	* module/ice-9/psyntax.scm: Use the vector representation of source
	properties internally.  We have to convert to alists when going to
	Tree-IL, but this will be in harmony with syntax objects once the reader
	switches to vectors too.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	Assembler writes vector source properties
	* module/system/vm/assembler.scm (intern-constant, link-data): Write the
	vector representation of source instead of the alist.  Saves a lot of
	heap size, object file size, and init time when serializing syntax
	objects with source.

	Add syntax-sourcev
	* libguile/syntax.c (sourcev_to_props, props_to_sourcev)
	(scm_syntax_source, scm_syntax_sourcev): Add alternate source
	representation for syntax objects.

	Optimize run-time init and relocation procedure
	* module/system/vm/assembler.scm (<asm>, make-assembler)
	(intern-constant, emit-init-constants): Instead of loading a dependent
	value each time it's needed in the relocation procedure, eagerly patch
	values when they are created.  Allows keeping values in registers, which
	decreases code size.

	Commit updates from newest autoconf
	* ABOUT-NLS:
	* build-aux/config.rpath: These files were overwritten by
	re-bootstrapping with the newest autoconf.  OK computer!

	Read Scheme via read-syntax
	* module/language/scheme/spec.scm: Use read-syntax.
	* test-suite/tests/dwarf.test: Adapt expected source locations.
	* am/bootstrap.am (SOURCES): Add ice-9/read.

	Fix read-syntax on vectors and arrays
	* module/ice-9/read.scm (%read): Strip annotations from reading
	the array elements.

	Ensure that (syntax ()) results in ()
	* module/ice-9/psyntax.scm: Add a special case for ().  There are
	already special cases for pairs, vectors, etc; the issue is that with
	read-syntax, the () might be come into psyntax as an annotated syntax
	object, which here we would want to strip, to preserve the invariant to
	psyntax users that all lists are unwrapped.

2021-02-24  Andy Wingo  <wingo@pobox.com>

	Fix module scoping for datum->syntax with no identifier
	* module/ice-9/psyntax.scm: With the new behavior of datum->syntax which
	allows #f for the lexical context, we have the question of what module
	to attach to these newly created syntax objects.  In that case we'll
	mark down #f as the module, indicating that we know nothing.  We have to
	extend a number of other cases to default to the expander's idea of the
	current module, if a syntax object has no module scope.

	Also, change datum->syntax to attach the empty wrap, not the top wrap.
	Attaching the top wrap leads to multiply applying the top mark, as you
	recurse into subexpressions.

2021-02-24  Andy Wingo  <wingo@pobox.com>

	Remove top-marked? optimization from psyntax
	* module/ice-9/psyntax.scm (strip): It used to be that terms in the
	source program could have a "top" mark, and when stripping marks we'd
	stop recursing when we see an expression with the top mark.  This had
	the good effect that source programs could contain quoted syntax
	objects, or quoted objects with shared structure -- in theory anyway.
	In practice the compiler didn't support objects with shared structure.
	Anyway when we switch to "read-syntax", quoted expressions can contain
	syntax objects introduced by the reader, which naturally we would want
	to strip away in a (quote FOO) form.  Therefore we remove the
	top-marked? optimization.

	Add quote-syntax
	* module/ice-9/psyntax.scm (quote-syntax): New core form.  Usually the
	  expander will unwrap all syntax objects from the input term.  However
	  sometimes you want to preserve a syntax object, as a datum.  That's
	  when you want quote-syntax.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/ice-9/local-eval.scm (identifier-syntax-from-box): Use
	  quote-syntax instead of our datum->syntax trick, which relied on
	  psyntax's special treatment of the top mark.

2021-02-21  Andy Wingo  <wingo@pobox.com>

	Implement read-syntax
	* doc/ref/api-macros.texi (Syntax Case): Update documentation for
	  datum->syntax.
	* module/ice-9/psyntax.scm (datum->syntax): Use #:source keyword for
	  source location info instead of an optional, and allow an alist.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/ice-9/read.scm (%read, read): Refactor to allow read and
	  read-syntax to share an implementation.
	  (read-syntax): New function.

	Document datum->syntax extensions
	* doc/ref/api-macros.texi (Syntax Case): Document that template-id can
	  be false, and document srcloc.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/ice-9/psyntax.scm (syntax?): Allow the lexical context to be
	  null.  Allow srcloc to be a source properties alist.  Inspired by
	  Racket.

	Adapt uses of make-syntax to preserve syntax
	* module/ice-9/psyntax.scm (datum->syntax): Add an additional optional
	  argument, to allow callers to provide source annotation information.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	psyntax preserves source via syntax objects
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/ice-9/psyntax.scm (wrap, source-wrap): Preserve source via
	  syntax objects.

2021-02-20  Andy Wingo  <wingo@pobox.com>

	Syntax objects have "source" field
	* libguile/syntax.c (scm_make_syntax): Add optional "source" argument.
	  Note that this function is internal.
	  (scm_syntax_source): New function, replacing definition in boot-9.scm.
	* libguile/syntax.h: Add new declarations.
	* module/ice-9/psyntax-pp.scm:
	* module/ice-9/psyntax.scm (source-annotation): For syntax objects, the
	  source annotation comes direct from the syntax object.
	* module/system/vm/assembler.scm (link-data, intern-constant): Write
	  5-word syntax objects.

2021-02-17  Andy Wingo  <wingo@pobox.com>

	Use lists instead of string ports to accumulate results
	* module/ice-9/read.scm (read): Use lists, like read-delimited does.
	  About 30% faster.

	Fix read.scm bugs related to nonstandard reader options
	* module/ice-9/read.scm (compute-reader-options): Fix handling of reader
	  options, inline and otherwise.

	Improve read error reporting
	* module/ice-9/read.scm (read): Issue properly formatted read-errors, as
	  users expect.

	Scheme read respects "positions" reader option
	* module/ice-9/read.scm (read): Don't add source positions if the option
	  is off.

	More read micro-optimizations
	* module/ice-9/read.scm (read): Use R5RS read-char, peek-char,
	  write-char rather than (ice-9 textual-ports) wrappers, because the
	  latter are expressed in terms of the former.

	Micro-optimization to delimiter?
	* module/ice-9/read.scm (read): Make sure we hit the "case"
	  optimization.

	Re-use string output port within read
	* module/ice-9/read.scm (read): Just have one string output port during
	  the read.

2021-02-14  Andy Wingo  <wingo@pobox.com>

	Fix (ice-9 read) for #\"
	* module/ice-9/read.scm (read): Fix #\ followed by a delimiter.

	Fix (ice-9 read) for #!r6rs
	* module/ice-9/read.scm (read): Fix read-directive.

2021-02-13  Andy Wingo  <wingo@pobox.com>

	Add "read" implementation in Scheme
	* module/Makefile.am (SOURCES): Add ice-9/read.
	* module/ice-9/read.scm: New file.  The idea is to move the compiler to
	  use this "read", after proving that it does the same as C.  Then we
	  can switch to read-syntax that returns syntax objects with source
	  locations, allowing us to annotate any datum.

2021-02-06  Ludovic Courtès  <ludo@gnu.org>

	build: Use 'AM_GNU_GETTEXT_VERSION'.
	* configure.ac: Add 'AM_GNU_GETTEXT_VERSION', as required by Autoconf 2.70.

2021-02-04  Michael Gran  <spk121@yahoo.com>

	the mkdtemp tests don't clean up the directories created
	The tests erroneously try to rmdir the template names, not the
	names of the directories created.

	* test-suite/tests/filesys.test ("mkdtemp"): clean up temp directories,
	    and not their templates

2021-02-03  Andy Wingo  <wingo@pobox.com>

	Optimize eof-object?
	* module/language/cps/types.scm (constant-type): Add case for EOF.
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect+exception-free-primitives*): Add case for eof-object?.
	  (eof-object?): Expand to eq? on the-eof-object.

	Replace libltdl with raw dlopen, dlsym
	* NEWS: Update.
	* am/bootstrap.am (SOURCES):
	* module/Makefile.am (SOURCES): Add system/foreign-library.scm.
	* configure.ac: Replace ltdl check with -ldl check.
	* libguile/dynl.c: Rewrite to just expose core dlopen / dlsym / etc to a
	  helper Scheme module.
	  (scm_dynamic_link, scm_dynamic_pointer, scm_dynamic_function)
	  (scm_dynamic_object_p, scm_dynamic_call): Rewrite in terms of (system
	  foreign-library).
	* libguile/extensions.c (load_extension): Avoid scm_dynamic_call.
	* module/system/foreign-library.scm: New file.
	* module/oop/goops.scm (<dynamic-object>): Hackily export
	  <foreign-library> instead of a class here.
	* doc/ref/api-foreign.texi (Foreign Function Interface): Rewrite to only
	  document the new interfaces.  Eventually we will deprecate
	  dynamic-link and friends.
	* doc/ref/guile.texi (API Reference): Move Foreign Objects after Foreign
	  Function Interface.  Seems there should be some closer relationship
	  but this will do for now.
	* doc/ref/tour.texi (Putting Extensions into Modules):
	* doc/ref/libguile-parallel.texi (Parallel Installations): Update for
	  rename of Modules and Extensions to Foreign Extensions.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_dynamic_unlink): Deprecate.
	* libguile/guile.c: Remove ltdl include.
	* test-suite/tests/foreign.test: Update tests to use new API, and update
	  error expectations.

2021-01-23  Mike Gran  <spk121@yahoo.com>

	strptime test shouldn't presume that initial whitespace is ignored
	As far as I can tell, ignoring initial whitespace is not required by POSIX.

	* test-suite/tests/time.test (strptime tests):

2021-01-23  Mike Gran  <spk121@yahoo.com>

	don't test crypt if not present
	* test-suite/tests/posix.test (crypt):  throw unsupported if crypt not presetnt

	socket test should not throw unresolved outside of a test
	* test-suite/tests/00-socket.test: don't throw at top level

2021-01-23  Michael Gran  <spk121@yahoo.com>

	add test for setsockopt
	* test-suite/tests/00-socket.test (setsockopt AF_INET): new test

2021-01-22  Michael Gran  <spk121@yahoo.com>

	getsockopt may return garbage for parameters < sizeof(int)
	Uninitialized variable.

	* libguile/socket.c (scm_getsockopt): zeroize arguments before use

2021-01-22  Michael Gran  <spk121@yahoo.com>

	socket test should not throw unresolved outside of a test
	* test-suite/tests/00-socket.test: don't throw unresolved outside of a
	    test

	avoid a ports test when fcntl is not provided
	* test-suite/tests/ports.test (non blocking I/O): disable test when fcntl
	    is not provided

	standalone tests require libgnu on DLL-based platforms
	* test-suite/standalone/Makefile.am (test_conversion_LDADD): add libgnu
	  (test_scm_to_latin1_string_LDADD): add libgnu
	  (test_scm_values_LDADD): add libgnu
	  (test_scm_c_bind_keyword_arguments): add libgnu
	  (test_srfi_4_LDADD): add libgnu
	  (libtest_extensions_la_LIBADD): add libgnu
	  (test_with_guile_module_LDADD): add libgnu
	  (test_scm_with_guile_LDADD): add libgnu
	  (test_scm_spawn_thread_LDADD): add libgnu
	  (test_pthread_create_LDADD): add libgnu
	  (test_pthread_create_secondary_LDADD): add libgnu
	  (test_smob_mark_LDADD): add libgnu
	  (test_smob_mark_race_LDADD): add libgnu

2021-01-22  Michael Gran  <spk121@yahoo.com>

	skip version test if git-version-gen can't compute version from git
	This might occur due to a shallow git clone.

	* test-suite/tests/version.test: throw unsupported if version is unknown

2021-01-22  Michael Gran  <spk121@yahoo.com>

	in null threads, don't define sigmask stub when pthread_sigmask does not exist
	* libguile/gen-scmconfig.c (main) [HAVE_PTHREAD_SIGMASK]: new output
	    define SCM_HAVE_PTHREAD_SIGMASK
	* libguile/null-threads.h (scm_i_pthread_sigmask) [SCM_HAVE_PTHREAD_SIGMASK]:
	    make inline function conditional on existence of pthread_sigmask

	Need Guile and Windows types for the declarations posix-w32
	* libguile/posix-w32.h: include scm.h and windows.h

	missing includes for list.h
	* libguile/loader.c: include list.h
	* libguile/stime.c: include list.h

2021-01-22  Michael Gran  <spk121@yahoo.com>

	test-foreign-object-c should link libgnu
	For MinGW, the foreign object test requires stubs provided by libgnu

	* test-suite/standalone/Makefile.am (test_foreign_object_c_LDADD): add libgnu

2021-01-22  Michael Gran  <spk121@yahoo.com>

	for dynamic-link tests, mingw needs to link to msvcrt
	* test-suite/standalone/test-ffi: link msvcrt for mingw
	* test-suite/standalone/test-foreign-object-scm: link msvcrt for mingw

	in command line encoding test don't presume extant UTF-8 locale
	* test-suite/standalone/test-command-line-encoding: abort if
	    locale is not UTF-8

	skip compile test when pause not available
	* test-suite/standalone/test-guild-compile: abort if pause
	    does not exist

	for socket test, don't presume TMP is usable
	* test-suite/tests/00-socket.test: don't abort when unable to change
	    into tmpdir

2021-01-21  Michael Gran  <spk121@yahoo.com>

	encoding test tries to delete a file that is not closed
	On Windows, deleting a file on an open port does not succeed

	* test-suite/tests/ports.test ("%default-port-encoding, wrong encoding"):
	  ensure port is closed before deleting

2021-01-21  Michael Gran  <spk121@yahoo.com>

	Use mkdtemp to simplify repl server test
	* test-suite/tests/00-repl-server.test (make-tempdir): removed
	  (call-with-repl-server): use mkdtemp instead of make-tempdir

	Replace mutating mkdtemp! with non-mutating mkdtemp
	* doc/ref/posix.texi: replace mkdtemp! and scm_mkdtemp_x documentation
	    with documentation for mkdtemp and scm_mkdtemp
	* libguile/filesys.c (scm_mkdtemp_x): procedure mkdtemp! removed
	    (scm_mkdtemp): new procedure mkdtemp
	* libguile/filesys.h: Remove declaration for scm_mkdtemp_x.  New declaration
	    scm_mkdtemp.
	* test-suite/tests/filesys.test: Remove mkdtemp! tests.  Add tests
	    for mkdtemp.

2021-01-21  Andy Wingo  <wingo@pobox.com>

	Replace stftime gnulib module with nstrftime
	* lib/Makefile.am: Update to replace deprecated strftime module.

2021-01-20  Andy Wingo  <wingo@pobox.com>

	Update environ_locale_charset gnulib patch
	* gnulib-local/lib/localcharset.c.diff: Update to apply to current
	  gnulib.  Lots of code duplication now, but oh well.
	* lib/localcharset.c (environ_locale_charset): Update.
	* lib/iconv_open-solaris.h:
	* lib/iconv_open-osf.h:
	* lib/iconv_open-irix.h:
	* lib/iconv_open-hpux.h:
	* lib/iconv_open-aix.h: Regenerate with gperf 3.1.

	Update Gnulib to v0.1-4379-g2ef5a9b4b
	Also bump required autoconf version to 2.64, as required by Gnulib.

2021-01-20  Michael Gran  <spk121@yahoo.com>

	Fix incorrect docstring of mkdtemp!
	* libguile/filesys.c (scm_mkdtemp_x): fix docstring

2021-01-19  Michael Gran  <spk121@yahoo.com>

	New procedure mkdtemp! to create unique temporary directory
	* configure.ac (AC_CHECK_FUNCS): add mkdtemp! test
	* doc/ref/posix.texi: document mkdtemp!
	* libguile/filesys.c (scm_mkdtemp_x): new function
	* libguile/filesys.h: new declaration for scm_mkdtemp_x
	* test-suite/tests/filesys.test: add tests for mkdtemp!

	Adapted from a patch by Rob Browning.

2021-01-18  Michael Gran  <spk121@yahoo.com>

	Move declaration for scm_mkstemp to filesys.h
	The underlying function was moved to filesys.c in
	073167ef7b803067bcc8be19925fac1a48577bd8 but the declaration didn't follow

	* libguile/filesys.h: add declaration for scm_mkstemp
	* libguile/posix.h: remove declaration for scm_mkstemp

2021-01-17  Rob Browning  <rlb@defaultvalue.org>

	Fix "display" typo in make-thread and begin-thread docs
	* doc/ref/api-scheduling.texi (make-thread, begin-thread): fix "display"
	  typo.

2021-01-17  Rob Browning  <rlb@defaultvalue.org>

	scm_i_make_transcoded_port: fix mode for input/output ports
	* libguile/r6rs-ports.c (scm_i_make_transcoded_ports): make sure to
	  include SCM_RDNG for input/output ports.

	Thanks to Göran Weinholt for reporting the problem.

	Closes: 41045

2021-01-17  Rob Browning  <rlb@defaultvalue.org>

	(scheme base) member: return #f, not (), for no match
	* module/scheme/base.scm (member): Match the r7rs requirement, as assoc
	  already does.

	Thanks to Erik Dominikus for reporting the problem.

	Closes: 43304

2021-01-17  Asher Gordon  <AsDaGo at>

	Replace a line which was accidentally removed.
	The line, part of the sentence above it in a comment, was accidentally
	removed in commit b8d757732fae7c396d58327185f94e5d90846445 "Rationalize
	include order in C files".

	* libguile/guile.c: restore missing line.

	[rlb@defaultvalue.org: augment commit message; add THANKS]

	Closes: 42331

2021-01-17  Rob Browning  <rlb@defaultvalue.org>

	doc: Fix composition describing scm_reverse_list_to_string
	* libguile/srfi-13.c (scm_reverse_list_to_string): Replace string->list
	  with list->string in the composition explaning how it works.  Thanks
	  to Andrey Ivanov for reporting the problem.

	Closes: 34457

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

	Document new interfaces
	* NEWS: Update.
	* doc/ref/api-io.texi (Bytevector Ports): Add docs.

	Document call-with-port
	* doc/ref/api-io.texi (Ports): Add docs.
	* doc/ref/r6rs.texi (rnrs io ports): Remove docs.

	Finish call-with-port cleanup
	* module/rnrs/io/ports.scm (call-with-port): Remove local definition.
	* module/system/repl/server.scm (system): Call-with-port is imported
	  via (ice-9 ports).

	Add call-with-input-bytevector, call-with-output-bytevector
	* module/ice-9/binary-ports.scm (call-with-input-bytevector):
	  (call-with-output-bytevector): New functions.
	* module/ice-9/iconv.scm: Remove superfluous copies of
	  call-with-output-string* and call-with-output-bytevector*, now that
	  the former closes the port and the latter exists.
	  (call-with-encoded-output-string): Adapt.
	* module/web/uri.scm: Use (ice-9 iconv) instead of local
	  bytevector/string conversion procedures.

	Close accumulating output ports after use
	* module/ice-9/ports.scm (call-with-port): New procedure, from r7rs.
	  (call-with-input-file, call-with-output-file): Refactor to use
	  call-with-port.
	  (call-with-output-string): Close the string after normal exit.
	* module/scheme/base.scm (scheme): Re-export call-with-port from base.

2021-01-07  Andy Wingo  <wingo@pobox.com>

	Bump copyright years for user-visible copyright messages
	* module/ice-9/command-line.scm (version-etc):
	* module/scripts/compile.scm (show-version):
	* module/system/repl/common.scm (*version*): Bump to 2021.

	Bump version to 3.0.5
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.

	Update NEWS
	* NEWS: Update.

	Merge remote-tracking branch 'lightening/main'

2021-01-07  Andy Wingo  <wingo@pobox.com>

	Merge branch 'fix-shortening' into 'master'
	Fix jmp-shortening on x86 when target within instruction.

	See merge request wingo/lightening!12

2021-01-07  Andy Wingo  <wingo@igalia.com>

	Fix jmp-shortening on x64 when target within instruction.
	* lightening/x86.c (jit_try_shorten): If the address is within the
	  last instruction, don't shorten.  If the intstruction is a jump, we
	  could elide it entirely in some cases, but we don't know if the user
	  captured the PC before calling jit_patch_here.  Better to leave this
	  to the user.

	Thanks to Helmut Eller for the bug report and test case in
	https://gitlab.com/wingo/lightening/-/issues/17.

2021-01-07  Andy Wingo  <wingo@pobox.com>

	New warnings: -Wuse-before-definition, -Wnon-idempotent-definition
	* module/ice-9/boot-9.scm (%auto-compilation-options): Add
	  use-before-definition and non-idempotent-definition.
	* module/language/tree-il/analyze.scm (<use-before-def-info>): New
	  analysis info.
	  (make-use-before-definition-analysis): New function.
	  (goops-toplevel-definition): Move down.
	  (unbound-variable-analysis, macro-use-before-definition): Remove, as
	  they are subsumed by use-before-def.  There are some deprecated
	  bindings though.
	  (make-analyzer): Rework to allow for use-before-def analysis to handle
	  multiple
	* module/system/base/message.scm (%warning-types): Add handlers for the
	  new warning types.
	* test-suite/tests/tree-il.test: Add tests.
	* doc/ref/api-evaluation.texi (Compilation): Update.

2020-09-10  Andy Wingo  <wingo@pobox.com>

	Fix source location bug for neoteric exprs introduced by refactoring
	* libguile/read.c (scm_read_expression): Ungetc after capturing the
	  column.

	Move copy-tree to (ice-9 copy-tree); deprecate main binding
	* doc/ref/api-data.texi (List Constructors):
	* doc/ref/api-utility.texi (Copying): Update docs to mention module.
	* libguile.h: Remove trees.h inclusion.
	* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Remove trees.c,
	  trees.h, and related files.
	* libguile/init.c (scm_i_init_guile): Remove trees.h and the
	  scm_init_trees call.
	* libguile/trees.c:
	* libguile/trees.h: Remove.
	* module/Makefile.am (SOURCES): Add ice-9/copy-tree.scm.
	* module/ice-9/copy-tree.scm: New file.
	* module/ice-9/deprecated.scm (copy-tree*): Export as copy-tree,
	  proxying to (ice-9 copy-tree).
	* module/system/repl/common.scm:
	* module/web/client.scm:
	* test-suite/tests/elisp.test:
	* test-suite/tests/srfi-1.test:
	* module/oop/goops/save.scm: Use (ice-9 copy-tree).
	* test-suite/Makefile.am (SCM_TESTS): Add copy-tree.test.
	* test-suite/tests/copy-tree.test: New file; test pulled from
	  eval.test.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_copy_tree): Deprecate.

2020-09-05  Andy Wingo  <wingo@pobox.com>

	Update NEWS
	* NEWS: Update.
	* doc/ref/api-evaluation.texi (Scheme Read): Remove copy option.

2020-09-03  Andy Wingo  <wingo@pobox.com>

	Clean up srcprops implementation
	* libguile/deprecated.c (scm_sym_copy, scm_make_srcprops): Deprecate.
	* libguile/deprecated.h (scm_tc16_srcprops)
	  (SCM_SOURCE_PROPERTY_FLAG_BREAK): Deprecate.
	* libguile/private-options.h (SCM_COPY_SOURCE_P): Remove.
	* libguile/read.c (struct t_read_opts, scm_read_options): Remove useless
	  copy read option.
	  (maybe_annotate_source): Change line and column to be tagged, and
	  subtract off lookahead here.  Change all callers.
	  (READ_OPTION_COPY_SOURCE_P): Remove, renumbering other options.
	  (init_read_options): Remove copy option.
	* libguile/srcprop.c: Change to put filename inline in source
	  properties.  Update private implementation.
	* libguile/srcprop.h (SCM_PROCTRACEP): Remove.  Unusable given that
	  scm_sym_trace was undefined.

2020-08-27  Andy Wingo  <wingo@pobox.com>

	Tweak to initial heap size selection
	* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE): Bump a bit farther (2 MB on
	  64-bit, 1 MB on 32-bit) as we now expand to this size instead of
	  expanding by this amount.
	  (scm_storage_prehistory): Expand to the initial heap size instead of
	  expanding by the size.

	Bump DEFAULT_INITIAL_HEAP_SIZE
	* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE): Bump to 1.6 MB on 64-bit
	  targets, or 800 kB on 32-bit targets, to account for increased
	  footprint.  Prevents useless early GC.
	  (scm_storage_prehistory): Remove unused code to dynamically change the
	  free space divisor.

2020-08-26  Andy Wingo  <wingo@pobox.com>

	Bump objcode minor version to 4
	* libguile/loader.h (SCM_OBJCODE_MINOR_VERSION): Accept up to version 4.
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Produce
	  version 4.

	CSE computes online map of constant values, uses it to fold branches
	* module/language/cps/cse.scm (intset-intersect*): New helper.  Use it
	  to replace manual uses.
	  (lset-unionq, meet-constants, adjoin-constant, set-constants): New
	  helpers.
	  (compute-consts): New function, to compute constants at each label,
	  using not only definitions but flow.
	  (<analysis>): Add consts to analysis.
	  (elide-predecessor, prune-branch, forward-branch, compute-out-edges)
	  (propagate-analysis, eliminate-common-subexpressions-in-fun): Plumb
	  consts through the algorithm.
	  (fold-branch): Fold an eq-constant? using the flow-determined constant
	  info.  Finally allows compile-bytecode to fold to switch statements!
	* module/language/cps/optimize.scm (optimize-first-order-cps): Move
	  branch chain optimization before the final CSE/DCE pass.

2020-08-24  Ludovic Courtès  <ludo@gnu.org>

	meta: Increment serial number in 'guile.m4'.
	* meta/guile.m4: Bump "serial", for all the changes made since commit
	5ad3881631c078d29e6b5676e8ab55759ee5bb85 (2010).

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

	Add new pass to optimize branch chains to table dispatch
	* module/language/cps/switch.scm: New pass.

	* module/Makefile.am (SOURCES):
	* am/bootstrap.am (SOURCES): Add switch.scm.

	* module/system/base/optimize.scm (available-optimizations):
	* module/language/cps/optimize.scm (optimize-first-order-cps): Run
	  switch optimization at level 2.

	* libguile/hash.c (JENKINS_LOOKUP3_HASHWORD2): Add note regarding
	  cross-compilation.

	* module/language/cps/graphs.scm (intmap-select): New definition.
	* module/language/cps/utils.scm (compute-singly-referenced-labels): Move
	  here, from various places.  Doesn't take a body intset argument.

	* module/language/cps/contification.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/simplify.scm: Use compute-singly-referenced-labels
	  from utils.

	* module/language/cps/effects-analysis.scm (annotation->memory-kind*):
	  (annotation->memory-kind): Add symbol annotation cases.

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

	Add $switch CPS term kind
	* module/language/cps.scm ($switch): New term.
	* doc/ref/compiler.texi (CPS in Guile): Add documentation.

	* module/language/cps.scm (build-term, parse-cps, unparse-cps)
	* module/language/cps/closure-conversion.scm (compute-non-operator-uses)
	  (compute-singly-referenced-labels, rewrite-shared-closure-calls)
	  (compute-free-vars, convert-one)
	* module/language/cps/compile-bytecode.scm (compile-function)
	* module/language/cps/contification.scm (compute-singly-referenced-labels)
	  (compute-contification-candidates, apply-contification)
	* module/language/cps/cse.scm (compute-truthy-expressions)
	  (forward-cont, term-successors, eliminate-common-subexpressions-in-fun)
	* module/language/cps/dce.scm (compute-known-allocations)
	  (compute-live-code, process-eliminations)
	* module/language/cps/devirtualize-integers.scm (compute-use-counts)
	  (peel-trace)
	* module/language/cps/effects-analysis.scm (compute-effects)
	* module/language/cps/licm.scm (hoist-one, hoist-in-loop)
	* module/language/cps/loop-instrumentation.scm (compute-loop-headers)
	* module/language/cps/peel-loops.scm (rename-cont)
	* module/language/cps/renumber.scm (sort-labels-locally, renumber)
	* module/language/cps/rotate-loops.scm (rotate-loop)
	  (rotate-loops-in-function)
	* module/language/cps/self-references.scm (resolve-self-references)
	* module/language/cps/simplify.scm (compute-singly-referenced-vars)
	  (eta-reduce, compute-singly-referenced-labels, beta-reduce)
	* module/language/cps/slot-allocation.scm (compute-defs-and-uses)
	  (add-prompt-control-flow-edges, compute-var-representations)
	* module/language/cps/specialize-numbers.scm (compute-significant-bits)
	* module/language/cps/split-rec.scm (compute-free-vars)
	* module/language/cps/type-fold.scm (local-type-fold)
	* module/language/cps/types.scm (successor-count, infer-types)
	* module/language/cps/utils.scm (compute-function-body)
	  (compute-successors, compute-predecessors)
	* module/language/cps/verify.scm (compute-available-definitions)
	  (check-valid-var-uses, check-arities): Add support for new term.

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

	Fold eqv? to eq? on exact integers according to target fixnum range
	* module/language/tree-il/peval.scm (peval): Fix folding to only reduce
	  to eq? for values within both host and target range.

	Fix JIT compilation for jtable
	* libguile/jit.c (compile_jtable): Fix bounds check for index.

2020-08-05  Daniel Llorens  <lloda@sarc.name>

	Fix bug #42713: srfi-64: Reset test-runner-current if done
	Reported by Jérémy Korwin-Zmijowski
	(https://lists.gnu.org/archive/html/bug-guile/2020-08/msg00010.html).

	Fix from
	https://github.com/scheme-requests-for-implementation/srfi-64/commit/7cf4c010398850b45f5a6939bb73f747605a0513:

	Apply fix from Per Bothner.

	In Per's words:

	  * testing.scm (%test-end): Reset test-runner-current if done.
	  This fixes bug "Loading test source file multiple time without having
	  report incrementing" reported to srfi-64 mailing list.

	  * srfi-64-test.scm: Update due to recent srfi-64 implementation change.

2020-08-03  Andy Wingo  <wingo@pobox.com>

	CPS compiler reduces eq? on constant to eq-constant?
	* module/language/cps/compile-bytecode.scm (compile-function): Expect
	  eq-constant? instead of eq-null?, etc.
	* module/language/cps/effects-analysis.scm: Likewise.
	* module/language/cps/reify-primitives.scm (reify-primitives): For
	  eq-constant?, reify a $const unless the constant is an immediate whose
	  encoding fits in 16 bits.
	* module/language/cps/type-fold.scm (materialize-constant): Helper to
	  make a constant from a type, min, and max.
	  (fold-eq-constant?): New helper.
	  (eq-constant?): New folder.
	  (undefined?): Define specifically.
	  (define-nullish-predicate-folder): Renamd from
	  define-special-immediate-predicate-folder.  Use only for null?, false,
	  and nil?.
	  (*branch-reducers*): New mechanism.  Reduce eq? to eq-constant? if
	  possible.
	  (local-type-fold): Refactor to use materialize-constant, and to allow
	  reducing branches.
	* module/language/cps/types.scm (constant-type): Return three values
	  instead of a type entry.
	  (constant-type-entry): New function that returns a type entry.  Adapt
	  callers.
	  (infer-constant-comparison): New helper.
	  (eq-constant?): New inferrer.
	  (undefined?): New inferrer.
	* module/language/tree-il/compile-bytecode.scm (eq-constant?): Fix
	  truncate-bits signed arg.
	  (define-immediate-type-predicate): Adapt to visit-immediate-tags
	  change.
	* module/language/tree-il/compile-cps.scm (convert): Convert eq? to
	  constant to eq-constant?.  Advantaged is that it gets fixnums and
	  chars in addition to special immediates.
	* module/language/tree-il/cps-primitives.scm (define-immediate-type-predicate):
	  Adapt to allow #f as pred.
	* module/system/base/types/internal.scm (immediate-tags): Use #f as pred
	  for false, nil, etc.
	  (immediate-bits->scm): Adapt.
	* module/system/vm/assembler.scm (emit-eq-null?, emit-eq-nil?)
	  (emit-eq-false?, emit-eq-true?, emit-unspecified?, emit-eof-object?):
	  Remove specialized emitters.
	* module/system/vm/assembler.scm (define-immediate-tag=?-macro-assembler):
	  Allow for pred to be #f.
	* module/system/vm/disassembler.scm (define-immediate-tag-annotation):
	  Adapt to pred being #f.

	Baseline compiler emits eq-immediate? as appropriate
	* module/language/tree-il/compile-bytecode.scm (eq?): Define
	  eq-immediate? as immediate emitter.
	  (canonicalize): Don't fuss so much about eq?; only if commutation is
	  needed.  (Perhaps a more generic commutation pass is needed.)
	  (compile-closure): Add support for emit/immediate for branches.

	Rework the way immediate encodings are calculated.
	* module/system/base/types/internal.scm (scm->immediate-bits):
	  (immediate-bits->scm, sign-extend, truncate-bits): New public
	  routines.
	* module/system/vm/assembler.scm (immediate-bits): Reimplement in terms
	  of scm->immediate-bits and similar.
	  (X8_S8_I16, X8_S8_ZI16): Rework operand encodings.
	  (load-constant): Use truncate-bits to determine which cases apply.

	Add eq-immediate? instruction
	* libguile/jit.c (compile_eq_immediate, compile_eq_immediate_slow): Add
	  JIT compiler.
	* libguile/vm-engine.c (eq_immediate): New instruction.
	* doc/ref/vm.texi (Comparison Instructions): Document.
	* module/system/vm/assembler.scm (encode-X8_S8_ZI16!/shuffle): New
	  shuffler.
	* module/system/vm/disassembler.scm (code-annotation): Add eq-immediate?
	  case.

2020-07-30  Andy Wingo  <wingo@pobox.com>

	Add sign-extending make-immediate instruction
	* doc/ref/vm.texi (Instruction Set, Constant Instructions): Document new
	  instruction.
	* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): New first
	  word kind with zi16 operand.
	* libguile/jit.c (compile_make_immediate, compile_make_immediate_slow):
	  New compilers.
	  (COMPILE_X8_S8_ZI16): New operand kind.
	* libguile/vm-engine.c (make-immediate): New instruction.
	* module/language/bytecode.scm:
	* module/system/vm/assembler.scm (encode-X8_S8_ZI16<-/shuffle):
	  (signed-bits, load-constant): Support the new instruction kind.
	* module/system/vm/disassembler.scm (disassemblers)
	  (sign-extended-immediate, code-annotation): Support for zi16
	  operands.

	Improve code generation for eq? on immediates
	* module/language/tree-il/compile-bytecode.scm (canonicalize):
	* module/language/tree-il/compile-cps.scm (canonicalize): Specialize
	  eq-false? and similar predicates.

	Merge https://gitlab.com/wingo/lightening master branch

2020-07-30  Andy Wingo  <wingo@pobox.com>

	Merge branch 'word-spills' into 'master'
	Spill whole words to stack, even for uint8_t args

	Closes #15

	See merge request wingo/lightening!11

2020-07-30  Andy Wingo  <wingo@igalia.com>

	Spill whole words to stack, even for uint8_t args
	* lightening/lightening.c (abi_gpr_to_mem): Write whole words when
	  spilling GPRs to the stack.  Always correct given that all Lightening
	  operations that write GPRs write the whole register, and the current
	  ABI targets allow writing the extra words.  Closes #15.

2020-07-30  Andy Wingo  <wingo@pobox.com>

	Update use of jit_begin_data API
	* libguile/jit.c (compile_jtable): Pass computed jump table size.

	Merge https://gitlab.com/wingo/lightening master branch

2020-07-30  Andy Wingo  <wingo@pobox.com>

	Merge branch 'word-align-literal-pools' into 'master'
	Literal pools have word-alignment, not u64-alignment

	See merge request wingo/lightening!10

2020-07-30  Andy Wingo  <wingo@igalia.com>

	Literal pools have word-alignment, not u64-alignment
	Prevents useless over-alignment for ARM.

	* lightening/lightening.c (struct jit_literal_pool_entry): Value is a
	  uintptr_t.
	  (emit_uintptr): New helper.
	  (emit_abs_reloc): Use new helper.
	  (patch_pending_literal): Value is a uintptr_t.
	  (emit_literal_pool): Adapt to literal entry being uintptr_t.

2020-07-30  Andy Wingo  <wingo@pobox.com>

	Merge branch 'size-data' into 'master'
	Allow jit_begin_data to declare max data size

	See merge request wingo/lightening!9

2020-07-30  Andy Wingo  <wingo@igalia.com>

	Allow jit_begin_data to declare max data size
	* lightening.h:
	* lightening/lightening.c (jit_begin_data): Add max data size
	  parameter.  If nonzero, can allow the JIT to avoid prematurely
	  emitting a constant pool.
	  (jit_end_data): Allow pending literals.
	* tests/jmp_table.c (run_test): Use new API.

2020-07-30  Andy Wingo  <wingo@pobox.com>

	Add JIT implementation for jtable
	* libguile/jit.c (compile_jtable): Implement.

	Merge https://gitlab.com/wingo/lightening master branch

2020-07-30  Andy Wingo  <wingo@pobox.com>

	Merge branch 'table-switch' into 'master'
	Add support for emitting inline data and table switches

	See merge request wingo/lightening!6

2020-07-30  Andy Wingo  <wingo@igalia.com>

	Add support for emitting inline data and table switches
	* lightening.h:
	* lightening/lightening.c (jit_begin_data, jit_end_data)
	  (jit_emit_u8, jit_emit_u16, jit_emit_u32, jit_emit_u64): Add new raw
	  data-emitting primitives, bracketed by begin/end so that we can flush
	  constant pools first, if needed.
	* lightening/lightening.c (struct jit_state): Add new emitting_data
	  flag.
	  (jit_begin, jit_reset, jit_end): Handle the new flag.
	  (emit_abs_reloc): Move here, from x86.c.
	* lightening/x86.c (emit_abs_reloc): Remove.
	  (jit_try_shorten): Don't shorten if loc == start; could be raw data.
	* tests/jmp_table.c: New test.

2020-07-30  Andy Wingo  <wingo@pobox.com>

	Merge branch 'fix-tail-call-test' into 'master'
	Ensure tail caller and callee in jmpi test have compatible ABI

	See merge request wingo/lightening!8

2020-07-30  Andy Wingo  <wingo@igalia.com>

	Ensure tail caller and callee in jmpi test have compatible ABI
	* tests/jmpi.c: Emit the tail callee using the JIT, to ensure that it
	  saves and restores registers in the same way as the caller.  Fixes
	  #16.

2020-07-30  Andy Wingo  <wingo@pobox.com>

	Merge branch 'fix-aarch64-veneers' into 'master'
	Fix patch_veneer on aarch64

	See merge request wingo/lightening!7

2020-07-30  Andy Wingo  <wingo@igalia.com>

	Fix patch_veneer on aarch64
	* lightening/aarch64.c (patch_veneer): Fix absolutely bogus patch_veneer
	  implementation.

2020-07-23  Andy Wingo  <wingo@pobox.com>

	Add jtable instruction
	* doc/ref/vm.texi (Instruction Set): Document new v32-x8-l24 instruction
	  kind.
	  (Branch Instructions): Document jtable.
	* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Add
	  V32_X8_L24.
	* libguile/jit.c (compile_jtable, compile_jtable_slow):
	  (COMPILE_X8_S24__V32_X8_L24, analyze): Add stub JIT compiler
	  implementation.
	* libguile/vm-engine.c (jtable): New instruction.
	* module/language/bytecode.scm (instruction-arity): Deprecate.
	* module/system/vm/assembler.scm (encoder, assembler): Add V32_X8_L24
	  case.
	* module/system/vm/disassembler.scm (u32-ref, s32-ref): Move definitions
	  to expansion-time only.
	  (define-op-handlers): New definition, replacing visit-opcodes.
	  (disassemblers, jump-parsers, stack-effect-parsers, clobber-parsers):
	  Rework in terms of define-op-handlers.  Default case becomes #f, and
	  add support for jtable.
	  (disassemble-one, instruction-relative-jump-targets)
	  (instruction-stack-size-after, instruction-slot-clobbers): Inline
	  default case in the lookup procedure, not copied in the handler
	  vector.
	  (compute-labels): Add jtable case.
	  (instruction-lengths-vector, instruction-length): Rework to allow
	  variable-length instructions, and mark jtable as being
	  variable-length.
	  (instruction-has-fallthrough?): Add jtable to the no-fallthrough
	  set.

2020-06-24  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS: Update.

	GNU Guile 3.0.4 (SONAME fix).
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	(LIBGUILE_INTERFACE_CURRENT): Increment.
	(LIBGUILE_INTERFACE_REVISION): Reset.
	(LIBGUILE_INTERFACE_AGE): Increment.  This accounts for commit, which
	adds a new symbol to the ABI.

2020-06-24  Ludovic Courtès  <ludo@gnu.org>

	Revert "GNU Guile 3.0.3."
	This change suggested an ABI incompatibility that's not there for normal
	builds:

	  https://lists.gnu.org/archive/html/guile-user/2020-06/msg00059.html

	Reported by Chris Vine.

	This reverts commit 5d052c87bd8f0fd894e67f0bebd4fa6f6160d83c.

2020-06-21  Ludovic Courtès  <ludo@gnu.org>

	GNU Guile 3.0.3.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	(LIBGUILE_INTERFACE_CURRENT): Increment.
	(LIBGUILE_INTERFACE_REVISION, LIBGUILE_INTERFACE_AGE): Reset.
	This accounts for commit b517a91ba4aaccf920a81eb8bf71ca090a9b457c and
	similar, which remove C functions in '--disable-deprecated' builds.

	Update NEWS.
	* NEWS: Update.

	Update NEWS.
	* NEWS: Update.

	Merge upstream 'lightening'
	* libguile/lightening: Merge from https://gitlab.com/wingo/lightening,
	commit 24ef197b1269f8371b1f4a412caa6d2b99d66839.

2020-06-20  Dale P. Smith  <dalepsmith@gmail.com>
	    Ludovic Courtès  <ludo@gnu.org>

	Add 'movi' test.
	This is a followup to 1bb909a44d2303f88bb05125fc6742e97f80cd1d.  It
	reproduces the bug that 1bb909a44d2303f88bb05125fc6742e97f80cd1d fixes
	on ARMv7.

	* tests/movi.c: New file.

2020-06-20  Ludovic Courtès  <ludo@gnu.org>

	tests: Remove 'glibc' from the 'guix environment' command line.
	* tests/Makefile (CC_IA32, CC_AARCH64, CC_ARMv7): Remove 'glibc' from
	the 'guix environment' command line since it's redundant with
	'gcc-toolchain'.

2020-06-20  Ludovic Courtès  <ludo@gnu.org>

	tests: Make 'TARGETS' overridable.
	This allows users to run "make TARGETS=armv7", for instance.

	* tests/Makefile (TARGETS): Make it overridable.

2020-06-20  Andrew Gierth  <andrew@tao11.riddles.org.uk>

	Fix ARMv7 THUMB encoding for immediates.
	* lightening/arm-cpu.c (encode_thumb_immediate): Fix return value in
	third case.

2020-06-19  Ludovic Courtès  <ludo@gnu.org>

	popen: Correct 'pipeline' docstring.
	* module/ice-9/popen.scm (pipeline): Change docstring for correct
	Texinfo syntax and to use commas instead of em dashes, as in the manual.

	popen: 'open-process' returns unbuffered ports.
	* module/ice-9/popen.scm (open-process)[unbuffered, fdes-pair]: New
	procedures.
	Use them.  Return unbuffered ports.
	* test-suite/tests/popen.test ("open-pipe*"): New test prefix.

2020-06-19  Andy Wingo  <wingo@pobox.com>

	Merge upstream 'lightening'
	* libguile/lightening: Merge from https://gitlab.com/wingo/lightening.

2020-06-19  Andy Wingo  <wingo@igalia.com>

	Fix unused variable warning for no-literal-pool targets
	* lightening/lightening.c (jit_patch_there): Conditionally define
	  flags.

2020-06-19  Andy Wingo  <wingo@pobox.com>

	Merge upstream 'lightening'
	* libguile/lightening: Merge from https://gitlab.com/wingo/lightening.

2020-06-19  Andy Wingo  <wingo@pobox.com>

	Merge branch 'fix-literal-pool-reset' into 'master'
	Fix zeroing of literal pool entries

	See merge request wingo/lightening!5

2020-06-19  Andy Wingo  <wingo@igalia.com>

	Fix zeroing of literal pool entries
	* lightening/lightening.c (reset_literal_pool): Zero before setting size
	  to 0.  Thanks to Dale Smith for pointing this out!

2020-06-19  Andy Wingo  <wingo@pobox.com>

	Merge branch 'fix-rotate-by-zero' into 'master'
	Fix undefined behavior in ARMv7 assembler

	See merge request wingo/lightening!4

2020-06-19  Andy Wingo  <wingo@igalia.com>

	Fix undefined behavior in ARMv7 assembler
	* lightening/arm-cpu.c (rotate_left): Fix the case of rotating by zero,
	  which produced undefined behavior.  Many thanks to Andrew
	  Gierth (andrew at tao11 riddles org uk) for the debugging and the
	  fix.

2020-06-19  Ludovic Courtès  <ludo@gnu.org>

	Tree-IL-to-CPS compiler delays calls to 'target-most-positive-fixnum'.
	Fixes a bug whereby, for example, "guild compile --target=i686-linux-gnu"
	running on x86_64 would generate invalid code for 'bytevector-u32-native-set!'
	because 'target-most-positive-fixnum' was called from the top-level
	when (language tree-il compile-cps) was loaded.

	Consequently, the .go files under prebuilt/ would be invalid, leading to
	build failures on 32-bit platforms.

	This issue became apparent with cb8cabe85f535542ac4fcb165d89722500e42653.

	* module/language/tree-il/compile-cps.scm (bytevector-ref-converter)[tag]:
	Turn into a lambda so that 'target-most-positive-fixnum' is called in
	the right context.
	(bytevector-set-converter)[integer-unboxer]: Likewise.

2020-06-18  Ludovic Courtès  <ludo@gnu.org>

	web: Accept URI host names consisting only of hex digits.
	Fixes <https://bugs.gnu.org/40582>.
	Reported by Julien Lepiller <julien@lepiller.eu>.

	Previously, a host part consisting of hex digits would be mistaken as an
	IPv6 address and rejected by 'valid-host?'.

	* module/web/uri.scm (ipv6-regexp): Add colon.
	* test-suite/tests/web-uri.test ("string->uri")["xyz://abc/x/y/z"]: New
	test.
	* NEWS: Update.

2020-06-18  Arun Isaac  <arunisaac@systemreboot.net>

	doc: Mention (ice-9 time) module path.
	* doc/ref/scheme-using.texi (Profile Commands): Mention (ice-9 time)
	module path.

	doc: Document default delimiter of string-join.
	* doc/ref/api-data.texi (String Constructors): Document default
	delimiter of the string-join function.
	* libguile/srfi-13.c (scm_string_join): Adjust docstring accordingly.

	doc: Improve content-range HTTP header documentation.
	* doc/ref/web.texi (HTTP Headers): Improve punctuation in content-range
	HTTP header documentation.

	doc: Fix minor typo in the HTTP headers documentation.
	* doc/ref/web.texi (HTTP Headers): Fix minor typo.

2020-06-18  Ludovic Courtès  <ludo@gnu.org>

	texinfo: Add basic support for @w{...}.
	* module/texinfo.scm (texi-command-specs): Add 'w'.
	(space-significant?): Add it.
	* module/texinfo/html.scm (tag-replacements): Add 'w'.
	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add test.

2020-06-18  Ricardo G. Herdt  <r.herdt@posteo.de>

	doc: Add missing canonicalize-path documentation.
	The documentation is copied over from libguile/filesys.c. I just added
	"(absolute)" to the text to help users finding it, since this term is
	more common in other languages.

	* doc/ref/posix.texi (File System): Document it.

2020-06-18  Jan (janneke) Nieuwenhuizen  <janneke@gnu.org>
	    Ludovic Courtès  <ludo@gnu.org>

	read: Use "invalid" rather than "illegal".
	* libguile/read.c (scm_read_string_like_syntax): All characters are
	permitted by law; some aren't valid in certain contexts.
	* test-suite/tests/reader.test: Replace occurrences of "illegal" by
	"invalid".
	* test-suite/tests/strings.test: Likewise.

2020-06-17  Ludovic Courtès  <ludo@gnu.org>

	srfi-1: Rewrite 'assoc' in Scheme.
	* libguile/srfi-1.c (scm_srfi1_assoc): Remove.
	* libguile/srfi-1.h (scm_srfi1_assoc): Likewise.
	* module/srfi/srfi-1.scm (assoc): New procedure.

	srfi-1: Rewrite 'find-tail' in Scheme.
	* libguile/srfi-1.c (scm_srfi1_find_tail): Remove.
	* libguile/srfi-1.h (scm_srfi1_find_tail): Likewise.
	* module/srfi/srfi-1.scm (find-tail): New procedure.

2020-06-17  Ludovic Courtès  <ludo@gnu.org>

	srfi-1: Rewrite 'find' in Scheme.
	This halves the wall-clock time of:

	  guile -c '(use-modules (srfi srfi-1)) (define lst (make-list 100000000 1)) (find zero? lst)'

	and yields an 18% speedup on:

	  guile -c '(use-modules (srfi srfi-1)) (define lst (make-list 100000000 1)) (find (lambda (x) (= 2 x)) lst)'

	* libguile/srfi-1.c (scm_srfi1_find): Remove.
	* libguile/srfi-1.h (scm_srfi1_find): Likewise.
	* module/srfi/srfi-1.scm (find): New procedure.
	* doc/ref/srfi-modules.texi (SRFI-1 Searching): Adjust docstring.

2020-06-15  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS: Update.

	doc: Remove copy/pasted sentence.
	* doc/ref/api-io.texi (I/O Extensions): Remove sentence pasted from
	'read' when explaining 'write' method.

2020-06-12  Andy Wingo  <wingo@pobox.com>

	Update lightening
	* libguile/lightening: Merge gitlab.com/wingo/lightening/ from
	  3260f7deebf4148f7c268e9a56cdab7a221e3da5.

	Make CSE more robust
	* module/language/cps/cse.scm (eliminate-common-subexpressions-in-fun):
	  I think it's possible to get an orphan loop, with predecessors
	  after successors in the original RPO.  Handle that here.

2020-06-11  Andy Wingo  <wingo@pobox.com>

	Merge branch 'arm-fix' into 'master'
	Fix armv7 with the ARM instruction set

	Closes #12

	See merge request wingo/lightening!3

2020-06-04  Ludovic Courtès  <ludo@gnu.org>

	tests: Avoid dependency on util-linux for 'rev'.
	* test-suite/tests/popen.test ("open-process", "pipeline"): Use 'tr'
	instead of 'rev' to avoid an extra dependency on util-linux.

2020-06-04  Andy Wingo  <wingo@pobox.com>

	Statprof reports primitive names
	* module/statprof.scm (program-debug-info-printable): Remove unused
	  function.
	  (addr->printable): If the addr is a primitive, extract its name.

2020-06-01  Andy Wingo  <wingo@pobox.com>

	Change -O1 compiler to use baseline and also resolve primitives
	* bootstrap/Makefile.am (GUILE_OPTIMIZATIONS): Change to just -O1.
	* module/language/tree-il/spec.scm (choose-compiler): Use CPS for -O2
	  and higher.
	* module/system/base/optimize.scm (available-optimizations): CPS for -O2
	  and higher, but -Oresolve-primitives now at -O1 also.

2020-05-31  Andy Wingo  <wingo@pobox.com>

	Fix bug where private bindings would never be sealed
	* module/language/tree-il/optimize.scm (make-optimizer): Fix plumbing of
	-Oseal-private-bindings / -O3.

2020-05-29  Andy Wingo  <wingo@pobox.com>

	Fix typo causing performance problems!!!
	* module/language/cps/cse.scm (eliminate-common-subexpressions-in-fun):
	  Amazingly this typo causes Guile to be 10% slower or so.  Fixed!

	CSE forward-propagates changes to CFG
	* module/language/cps/cse.scm (propagate-analysis): New helper.
	  (eliminate-common-subexpressions-in-fun): Recompute avail and bool set
	  in response to simplifications in predecessor CFG.  Allows much better
	  compilation of pattern-matching idioms!

	CSE forwards branch predecessors where the branch folds
	* module/language/cps/cse.scm (forward-cont, forward-branch)
	  (compute-avail-and-bool-edge): New helpers.
	  (add-equivalent-expression!): Allow idempotent adds; can happen now
	  when revisiting a cont after changes to its predecessors.
	  (fold-branch): New helper.
	  (eliminate-common-subexpressions-in-fun): Allow for reductions to
	  branch predecessors.  In that case, revisit the branch, as the CFG
	  will have changed.

	CSE refactor
	* module/language/cps/cse.scm (eliminate-common-subexpressions-in-fun):
	  Separate the paths for handling expressions and branches.

	Use intmaps in CSE equivalent expression table
	* module/language/cps/cse.scm (make-equivalent-expression-table)
	  (intmap-select, add-equivalent-expression!)
	  (lookup-equivalent-expressions): New helpers.
	  (eliminate-common-subexpressions-in-fun): Adapt.

	Eager graph pruning in CSE
	* module/language/cps/cse.scm (elide-predecessor, prune-branch)
	  (prune-successors, term-successors): New helpers.
	  (eliminate-common-subexpressions-in-fun): When we modify the CFG,
	  update the analysis.  Also, thread the substs map through CSE so that
	  closures in high-level CPS can take advantage of eliminated variables.
	  (fold-renumbered-functions): Take multiple seeds.
	  (eliminate-common-subexpressions): Thread var substs map through CSE.

	Add indentation rule for let/ec
	* .dir-locals.el: Add rule.

	Macro fix to CPS build-term
	* module/language/cps.scm (build-term): Match on $branch and $throw as
	  literals.

	Thread flow analysis through CSE pass
	* module/language/cps/cse.scm (<analysis>): New data type, grouping
	  available expression analysis, predecessor map, etc.
	  (eliminate-common-subexpressions-in-fun): Instead of having a static
	  analysis, thread it through the CSE pass so that we can update the CFG
	  as we go.

	CSE eliminates expressions at continuations
	* module/language/cps/cse.scm (compute-available-expressions): Take a
	  clobber map instead of an effects map.
	  (compute-singly-referenced): Remove unused function.
	  (eliminate-common-subexpressions-in-fun): Keep a preds map.  Use it
	  add entries to the equiv-set and var-substs at expression
	  continuations instead of at the expression terms themselves.

	Refactor CSE to analyze and transform in a single pass
	* module/language/cps/cse.scm (compute-truthy-expressions): Operate on a
	  single function.
	  (eliminate-common-subexpressions-in-fun): Instead of computing a set
	  of labels to eliminate, go ahead and do the elimination as we go.
	  (fold-renumbered-functions): Can just use a single seed now.
	  (eliminate-common-subexpressions): Simplify to just fold over
	  functions, building up renamed output as we go.

	Refactor CSE to take advantage of RPO numbering
	* module/language/cps/cse.scm (fold-renumbered-functions): New helper.
	  (compute-equivalent-expressions): Use new helper.
	  (compute-equivalent-expressions-in-fun): Lift to top-level.
	  (eliminate-common-subexpressions): Adapt.

	Renumber before CSE
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	  Assume renumbered program.
	  (eliminate-common-subexpressions): Renumber.  Will allow optimizations
	  later.

2020-05-28  Daniel Llorens  <lloda@sarc.name>

	Fix cast enabling SCM_DEBUG_TYPING_STRICTNESS 2

2020-05-28  Andy Wingo  <wingo@pobox.com>

	Slight optimization to invert-bijectiono
	* module/language/cps/graphs.scm (invert-bijection): Use a transient
	  intmap.

	Fix truthy expression analysis in CSE
	* module/language/cps/cse.scm (compute-truthy-expressions): The "meet"
	  function here is union, not intersection.

2020-05-27  Ludovic Courtès  <ludo@gnu.org>

	web: 'http-get' & co. now honor #:verify-certificate?.
	Previously they would always assume #:verify-certificate? #t,
	unless #:port was given.

	Fixes <https://bugs.gnu.org/40486>.
	Reported by Jan Synacek <jsynacek@redhat.com>.

	* module/web/client.scm (define-http-verb): Pass #:verify-certificate?
	to 'open-socket-for-uri'.

2020-05-27  Eric Bavier  <bavier@member.fsf.org>

	doc: Fix a few typos in vm section.
	* doc/ref/vm.texi: Fix some grammar and typos.

2020-05-27  Jan Synacek  <jsynacek@redhat.com>

	doc: Fix typos in the manual.
	* doc/ref/api-control.texi:
	* doc/ref/r6rs.texi:
	* doc/ref/sxml.texi: Fix typos.

2020-05-27  Ludovic Courtès  <ludo@gnu.org>

	doc: Rephrase documentation of 'thunk?'.
	Fixes <https://bugs.gnu.org/41353>.
	Reported by Jan Synacek <jsynacek@redhat.com>.

	* doc/ref/api-procedures.texi (Procedure Properties): Rephrase
	documentation of 'thunk?'.
	* libguile/procs.c (scm_thunk_p): Likewise.

2020-05-27  Ludovic Courtès  <ludo@gnu.org>

	doc: Reword unclear sentence about programs.
	Fixes <https://bugs.gnu.org/41352>.
	Reported by Jan Synacek <jsynacek@redhat.com>.

	* doc/ref/api-procedures.texi (Compiled Procedures): Clarify wording.

2020-05-27  Mathieu Lirzin  <mthl@gnu.org>

	GUILE_PKG bails out when 'pkg-config' is missing
	* meta/guile.m4 (GUILE_PKG): Ensure that 'pkg-config' is available. Use
	AC_REQUIRE for PKG_PROG_PKG_CONFIG to avoid unnecessary invocations.

2020-05-27  Alex Sassmannshausen  <alex@komputilo.eu>
	    Ludovic Courtès  <ludo@gnu.org>

	doc: Add reference to Guile Hall in the manual.
	* doc/ref/scheme-using.texi (Distributing Guile Code): New node.

2020-05-22  Ludovic Courtès  <ludo@gnu.org>

	doc: '@' is not equivalent to autoloading.
	* doc/ref/api-modules.texi (Creating Guile Modules): Remove paragraph
	about '@' as an alternative to #:autoload.

2020-05-22  Ludovic Courtès  <ludo@gnu.org>

	doc: #:autoload does not pull in all the module bindings.
	Reported by Jan Nieuwenhuizen <janneke@gnu.org>.
	This is a followup to cb14fd214365e50b6b1655616ae74d0228933bbd.

	* doc/ref/api-modules.texi (Creating Guile Modules): Remove bit that
	says all the bindings of an autoloaded module become available.

2020-05-18  Christopher Baines  <mail@cbaines.net>

	http: Support CONNECT and PATCH HTTP methods.
	PATCH is described by RFC 5789 and CONNECT is described by RFC 7231.

	* module/web/http.scm (parse-http-method): Support CONNECT and PATCH.

2020-05-18  Linus Björnstam  <linus@Linuss-iMac.local>

	doc: Fix documentation for srfi-171.
	* doc/ref/srfi-modules.texi (SRFI-171): Fix broken documentation.

2020-05-17  Andy Wingo  <wingo@pobox.com>

	Update match's no-matching-pattern code to use "throw"
	* module/ice-9/match.upstream.scm (match-next): Use throw, so that CPS
	  can see that there's no fallthrough.
	* module/ice-9/match.scm: Add a note about what to do in 3.1 to remove
	  the old "error" definition.

2020-05-17  Ludovic Courtès  <ludo@gnu.org>

	'peval' test uses (language tree-il peval).
	Fixes an unbound variable error introduced in
	2c07a32ad85d6fce8a0e09bb457e7ff1885b4615.

	* test-suite/tests/peval.test: Use (language tree-il peval).
	(peval): Remove.

2020-05-16  Ludovic Courtès  <ludo@gnu.org>

	doc: Tweak 'pipeline' documentation.
	* doc/ref/posix.texi (Pipes): Adjust markup.  Simplify example.

	Use 'pass-if-equal' for 'pipeline' tests.
	* test-suite/tests/popen.test ("open-process", "piped-process")
	("piped-process: with output", "pipeline"): Use 'pass-if-equal'.

2020-05-16  Rutger van Beusekom  <rutger.van.beusekom@verum.com>

	popen: Add 'pipeline' procedure.
	* libguile/posix.c (scm_open_process): Remove.
	(scm_piped_process): Add to replace open_process.
	* module/ice-9/popen.scm (pipe->fdes): Add to convert pipe pair to fdes pair.
	(open-process): Add open-process for backwards compatibility.
	(pipeline): Add to implement a pipeline using piped-process.
	* doc/ref/posix.texi (Pipes): Document it.
	* test-suite/tests/popen.test ("open-process")
	("piped-process", "piped-process: with output")
	("pipeline"): New tests.

2020-05-14  Andy Wingo  <wingo@pobox.com>

	Tree-IL lowerer only loads needed optimizations
	* module/language/tree-il/optimize.scm (make-optimizer): New procedure,
	  to compute an optimizer given options, lazily loading optimization
	  modules.
	  (optimize): Use make-optimizer.
	  (make-lowerer): Use make-optimizer, so as to only load needed
	  optimizations.  Speeds up bootstrap times.

	Fix ,optimize to be independent of tree-il
	* module/system/repl/common.scm (repl-default-options): Add
	  optimization-level and warning-level REPL options.
	  (repl-optimization-level, repl-warning-level): New accessors,
	  defaulting to the default level parameters.
	  (repl-expand): Take target language as keyword argument rather than
	  hard-coding tree-il.
	  (repl-optimize): Take target language as keyword argument.  Use REPL
	  optimization and warning levels.  Use generic lowering interface.

2020-05-13  Andy Wingo  <wingo@pobox.com>

	More robust reduction of equal? and eqv?
	* module/language/tree-il/primitives.scm (expand-eq): Just expand out to
	  binary comparisons.  Also expand eq?, which was missing.  Leave
	  strength reduction to peval.
	  (character-comparison-expander): Move down, as it depends on <, <=,
	  and so on.
	* module/language/tree-il/peval.scm (peval): Robustly reduce equal? and
	  eqv?.
	* test-suite/tests/peval.test ("partial evaluation"): Expect fixnum
	  comparison to reduce to eq?.
	  ("eqv?", "equal?"): A new battery of tests.
	* test-suite/tests/tree-il.test ("primitives"): Remove reduction tests.

	Add with-lexicals helper; fix bug in (equal? #t (foo) #t)
	* module/language/tree-il.scm (with-lexicals): New public helper.
	* .dir-locals.el (with-lexicals): Add indentation rule.
	* module/language/tree-il/compile-bytecode.scm (canonicalize): Use
	  with-lexicals.
	* module/language/tree-il/compile-cps.scm (canonicalize): Use
	  with-lexicals from tree-il.
	* module/language/tree-il/primitives.scm (chained-comparison-expander):
	  Remove duplicate expander definitions for <, <=, and so on.
	* module/language/tree-il/primitives.scm (maybe-simplify-to-eq): Avoid
	  inadvertent code duplication by using with-lexicals.
	  (expand-chained-comparisons): Likewise.
	  (call-with-prompt): Simplify to use with-lexicals.

	Another minor module compile order tweak
	* module/Makefile.am (SOURCES): Put Tree-IL compiler early too, so that
	  subsequent compilations can benefit from CPS speedups.

	Bump objcode minor version
	* libguile/loader.h (SCM_OBJCODE_MINOR_VERSION):
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump, so
	  that compiled files from Guile 3.0.3 will error when loaded on 3.0.2.

	Minor module/Makefile order tweak
	* module/Makefile.am (ice-9/psyntax-pp.go): Add GUILE_OPTIMIZATIONS
	  argument.
	  (SOURCES): Reorder a bit for speed when bootstrapping.

	Fix optimizers after language lowerer refactor
	* module/language/cps/optimize.scm (define-optimizer):
	  (optimize-higher-order-cps, optimize-first-order-cps):
	  (make-cps-lowerer):
	* module/language/tree-il/optimize.scm (optimize, make-lowerer): In an
	  embarrassing bug, after parsing optimization arguments, we were
	  aconsing them instead of the expected cons*.  This meant the bootstrap
	  was running all Tree-IL optimizations!  Change to have optimizers not
	  have defaults and use alists after parsing.

	Punt more CPS compiler until later in bootstrap
	* am/bootstrap.am (SOURCES): Punt CPS compiler until later.

	Slight optimization to baseline compiler
	* module/language/tree-il/compile-bytecode.scm (compile-closure):
	  for-value-at and for-values-at take indexes instead of environments to
	  denote destination.

2020-05-12  Ludovic Courtès  <ludo@gnu.org>

	Zero the initial file port revealed count.
	Fixes <https://bugs.gnu.org/41204>.
	Reported by Caleb Ristvedt <caleb.ristvedt@cune.org>.

	Until now, Guile would leak the file descriptors of all the file ports
	not explicitly closed.

	* libguile/fports.c (scm_i_fdes_to_port): Initialize fp->revealed.
	* test-suite/tests/ports.test ("initial revealed count")
	("non-revealed port is closed"): New tests.
	("close-port & revealed port"): Check (port-revealed port).
	("revealed port fdes not closed"): Likewise.

2020-05-12  Ludovic Courtès  <ludo@gnu.org>

	tests: Don't use a guardian when testing for GC'd ports.
	This is a followup to 1008ea315483d1fb41b2a8c10680e511238836d0.

	* test-suite/tests/ports.test ("non-revealed port is closed"): Don't use
	a guardian.

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

	Update NEWS for baseline compiler
	* NEWS: Update.

	Update documentation on <language>
	* doc/ref/compiler.texi (Compiler Tower): Update.

	Clean up NEWS for bitvectors.
	* NEWS: Cleanups.

	Whoops, fix bug in tree-il choose-compiler
	* module/language/tree-il/spec.scm (choose-compiler): Fix spelling of
	  "compile-cps" :)

	Punt CPS compiler to end of bootstrap
	* am/bootstrap.am (SOURCES): Compile the CPS compiler last.

	Delay loading CPS unless CPS compiler used
	* module/language/tree-il/spec.scm: Remove #:compilers declaration;
	  instead rely on choose-compiler.
	  (choose-compiler): Load compilers on demand.
	* module/system/base/compile.scm (find-language-joint): Use next-pass
	  instead of lookup-compilation-order, to avoid loading unused
	  compilers.
	  (read-and-compile): Adapt to find-language-joint change.
	  (compute-compiler): Export.
	* module/scripts/compile.scm (compile): Use compute-compiler to load
	  compiler modules.

2020-05-11  Andy Wingo  <wingo@pobox.com>

	Baseline FIXME's are done :)
	* module/language/tree-il/compile-bytecode.scm: Remove FIXME comments.

	Baseline compiler emits source locations
	* module/language/tree-il/compile-bytecode.scm (compile-closure): Emit
	  source annotations where we have them.

	Baseline O(1) access to frame-base env
	* module/language/tree-il/compile-bytecode.scm (compile-closure): No
	  need to search for frame-base.

	Slight tweaks to bootstrap order
	* am/bootstrap.am (SOURCES): Compile boot-9 and compile-bytecode
	  earlier.  Put intmap, intset, graphs, and vlist until later.

	Emit handle-interrupts in baseline compiler
	* module/language/tree-il/compile-bytecode.scm (compile-closure): Handle
	  interrupts before calls, returns, and tail calls.

	Avoid having "guild compile" load optimizers
	* module/language/cps/optimize.scm (cps-optimizations):
	* module/language/tree-il/optimize.scm (tree-il-optimizations):
	* module/system/base/optimize.scm (available-optimizations): Invert the
	  dependency tree to hold the names and default optimization levels in a
	  central place instead of in the optimizers.  It moves definitions
	  farther from uses, but it avoids us having to load the CPS optimizer
	  if we don't need it, which improves bootstrap times.

	Switch to baseline compiler for bootstrap/
	* bootstrap/Makefile.am (GUILE_OPTIMIZATIONS): Add -Ono-cps so that we
	  use the baseline compiler when bootstrapping.

	Fix shuffling assembler for new primcalls
	* module/system/vm/assembler.scm (encode-X8_S8_C8_S8-C32!/shuffle): New
	  shuffling assembler.

	Improve tail recursion in compiler
	* module/language/tree-il/compile-bytecode.scm (compile-closure): Make
	  it so that for-tail is actually tail-recursive.  Likewise improve tail
	  recursion for the other helpers.

	Reload FP if needed in bind-rest also
	* libguile/jit.c (compile_bind_rest): Reload FP if needed

	Fix module capture for closures in <fix>
	* module/language/tree-il/compile-bytecode.scm (compile-closure):
	  Capture closures for <fix> if needed.

	Fix JIT asserts with different code generated by baseline
	* libguile/jit.c (UNREACHABLE): New register state.
	  (unreachable): New predicate.
	  (ASSERT_HAS_REGISTER_STATE): Succeed when unreachable.
	  (compile_throw, compile_throw_value, compile_throw_value_and_data):
	  Set unreachable flag.
	  (compile_receive_values): Reload FP if needed.

	Fix "cons" compilation in baseline compiler in some cases
	* module/language/tree-il/compile-bytecode.scm (emit-cons): Fix for case
	  where car is dst but cdr isn't.

	Baseline compiler: add pop-fluid primitive.
	* module/language/tree-il/compile-bytecode.scm (pop-fluid): New
	  primitive.

	Fix baseline compilation error for make-struct/simple
	* module/language/tree-il/compile-bytecode.scm (compile-closure):
	  $allocate-struct takes an SCM.

	Fix baseline miscompilation of <
	* module/language/tree-il/compile-bytecode.scm: Fix < miscompilation.

	guilec can be parameterized by GUILE_OPTIMIZATIONS, defaults to -O2
	* am/guilec (GUILE_OPTIMIZATIONS): New var.

	Fix free var computation in baseline compiler for lexical set!
	* module/language/tree-il/compile-bytecode.scm (split-closures): Adjoin
	  lexical being set to free vars.

	Declare #:cps? as an available optimization
	* module/language/tree-il/optimize.scm (tree-il-optimizations): Add
	  #:cps?, on by default from -O1.  This enables "guild compile -O2
	  -Ono-cps foo.scm".

	Fix "fail" helper in guild compile
	* module/scripts/compile.scm (fail): Users expect this to be a format
	  string, so adapt.
	  (compile): Fix use that passed multiple strings.

	Test suite compile-and-eval tests run -O0 and -O2
	* test-suite/test-suite/lib.scm (c&e): Test -O0 and -O2.

	Fix baseline canonicalization of reifying prompts
	* module/language/tree-il/compile-bytecode.scm (canonicalize): Fix arg
	  order to make-prompt.

	Fix compilation of prompt in tail context
	* module/language/tree-il/compile-bytecode.scm (compile-closure):
	  Compile body of prompt in values-at context at the frame base, not the
	  current env.

	Fix kw initializer bug in baseline compiler
	* module/language/tree-il/compile-bytecode.scm (compile-closure): The
	  first sym has index 1, not 0, because of the closure.

	Use lookup, lookup-bound in baseline compiler
	* module/language/tree-il/compile-bytecode.scm (emit-box-set!): Fix to
	  reference by SCM, not word.
	  (emit-box-ref): New helper.
	  (emit-cached-module-box, emit-cached-toplevel-box, emit-toplevel-box):
	  Add bound? arg.  Before these could produce #f instead of a variable,
	  and unbound variable errors weren't any good as they didn't have the
	  variable name.
	  (compile-closure): Use more box-ref and box-set!.  Pass bound? arg to
	  the helpers.

	Top-level lookups raise exceptions in run-time
	* module/language/cps/reify-primitives.scm (reify-lookup):
	* module/language/tree-il/compile-cps.scm (toplevel-box): Instead of
	  checking that the result of module-variable is a variable, and
	  possibly checking that it's bound, we just call intrinsics that throw
	  exceptions if the variable isn't bound.  This reduces useless inlining
	  that can't inform CPS optimizations, as they are tangled in diamond
	  control flow.

	Add new lookup, lookup-bound intrinsics
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/intrinsics.c (lookup, lookup_bound):
	* libguile/intrinsics.c (scm_bootstrap_intrinsics): New intrinsics.
	* module/language/cps/reify-primitives.scm (reify-primitives):
	* module/language/cps/effects-analysis.scm (current-module):
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/system/vm/assembler.scm: Add compiler support.

2020-05-11  Andy Wingo  <wingo@pobox.com>

	Rename "lookup" intrinsic to "module-variable"
	It can return #f, unlike scm_(module_)?lookup.

	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/intrinsics.c (module_variable, scm_bootstrap_intrinsics):
	  Rename.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm (current-module):
	* module/language/cps/reify-primitives.scm (reify-lookup)
	  (compute-known-primitives):
	* module/language/tree-il/compile-bytecode.scm (emit-cached-module-box)
	  (emit-cached-toplevel-box, emit-toplevel-box):
	* module/language/tree-il/compile-cps.scm (toplevel-box):
	* module/system/vm/assembler.scm (module-variable): Adapt users.

2020-05-09  Andy Wingo  <wingo@pobox.com>

	Fix baseline compiler bugs
	* module/language/tree-il/compile-bytecode.scm (compile-closure): Fix
	  FP-relative computation for "receive" target.  Fix value-at syntax in
	  conditional.

	Fix parens in .dir-locals.el
	* .dir-locals.el (c-mode): Fix parens.  Doh!

2020-05-08  Andy Wingo  <wingo@pobox.com>

	Wire up the baseline compiler to -O0
	* module/language/tree-il/spec.scm (join): Use match rather than
	  pmatch.
	  (tree-il): Declare compiler to bytecode.
	  (choose-compiler): New implementation.  Note, the baseline compiler
	  probably doesn't even work!!!

	Add compiler chooser implementation; fix bugs with previous commit
	* module/system/base/compile.scm (next-pass): Invoke the language's
	  compiler chooser if there is more than one compiler.
	  (compute-compiler): Ensure from and to are languages.
	* module/system/base/language.scm (<language>): Add compiler-chooser
	  field.
	* module/language/brainfuck/spec.scm (choose-compiler, brainfuck):
	  Define a compiler chooser.

	Sketch of how to choose different compiler based on -O0
	* module/system/base/compile.scm (next-pass, compute-compiler): Allow
	  optimization level to determine pass order.

	Define new "lowering" phase in compiler
	* module/language/cps/compile-bytecode.scm (compile-bytecode):
	* module/language/tree-il/compile-bytecode.scm (compile-bytecode):
	* module/language/tree-il/compile-cps.scm (compile-cps): Rely on
	  compiler to lower incoming term already.
	* module/language/tree-il/optimize.scm (make-lowerer): New procedure.
	* module/system/base/compile.scm (compute-lowerer): New procedure,
	  replaceing add-default-optimizations.
	  (compute-compiler): Lower before running compiler.
	* module/system/base/language.scm (<language>): Change
	  optimizations-for-level field to "lowerer".
	* module/scripts/compile.scm (%options, compile): Parse -O0, -O1 and so
	  on to #:optimization-level instead of expanding to all the
	  optimization flags.
	* module/language/cps/optimize.scm (lower-cps): Move here from
	  compile-bytecode.scm.
	  (make-cps-lowerer): New function.
	* module/language/cps/spec.scm (cps): Declare lowerer.

	Warning and optimization levels always small integers
	* module/language/tree-il/analyze.scm (make-analyzer): Expect an int for
	  optimization level.
	* module/scripts/compile.scm (%options, show-warning-help): No more
	  -Wnone / Wall; use -W0 or -W9 instead.
	* module/system/base/compile.scm (level-validator): Validate small int.
	  (compute-analyzer, add-default-optimizations): Likewise.
	* test-suite/tests/optargs.test (without-compiler-warnings):
	* test-suite/tests/tree-il.test (call-with-warnings): Parameterize level
	  to 0, not #f.
	* bootstrap/Makefile.am (GUILE_WARNINGS): Use -W0, not -Wnone.

	Wire up simplified warning levels in "guild compile"
	* am/guilec (GUILE_WARNINGS):
	* am/bootstrap.am (GUILE_WARNINGS): Explictly default to -W1.
	* bootstrap/Makefile.am (GUILE_WARNINGS): Set to -Wnone, as the meaning
	  of "no -W flags" has changed to be effectively -W1.
	* module/scripts/compile.scm (%options): Adapt to parse -Wnone, -W2, and
	  so on.
	  (parse-args): Default to (default-warning-level).
	  (show-warning-help): Add more warning help.
	  (compile): Pass #:warning-level.

	Add language-specific analysis pass to compiler infrastructure
	* module/system/base/compile.scm (compute-analyzer): Compute analyzer to
	  run on expressions before the compiler runs.
	  (add-default-optimizations): Flesh out; still a stub.a
	  (read-and-compile, compile, compile-and-load, compile-file): Default
	  warning and optimization levels.
	  (default-warning-level): New parameter, defaulting to 1.
	  (default-optimization-level): New parameter, defaulting to 2.
	  Currently unused.
	* module/system/base/language.scm (<language>): Add
	  optimizations-for-level and analyzer fields.
	* module/language/tree-il/compile-bytecode.scm (compile-bytecode):
	* module/language/tree-il/compile-cps.scm (optimize-tree-il): No need to
	  run warnings passes here; compilers infrastructure will run them.
	* module/language/tree-il/spec.scm (tree-il): Define make-analyzer as
	  analyzer.
	* module/language/tree-il/analyze.scm (make-analyzer): New exported
	  procedure.
	  (%warning-passes): New private variable.
	* .dir-locals.el: Add with-test-prefix/c&e indent mode.
	* test-suite/tests/cross-compilation.test:
	* test-suite/tests/optargs.test:
	* test-suite/tests/tree-il.test: Adjust to disable default warnings.

	Add #:optimization-level, #:warning-level compile keyword args
	* module/system/base/compile.scm (compile-file, compile-and-load)
	  (read-and-compile, compile): New #:optimization-level, #:warning-level
	  keyword args.
	  (compute-analyzer, add-default-optimizations, compute-compiler): Add
	  infra for pass-specific optimizations for a level.  Not yet wired up.

2020-05-08  Andy Wingo  <wingo@pobox.com>

	Rework compile-fold
	Instead of returning a list of passes, returns a closure that does it
	all.

	* module/system/base/compile.scm (compute-compiler): New function.
	  (read-and-compile, compile): Use compile-compiler.

2020-05-08  Andy Wingo  <wingo@pobox.com>

	Use more `match' in (system base compile)
	* module/system/base/compile.scm (validate-options): New helper.
	  (compile-file, compile-and-load, compile): Call the new helper.
	  (compile-passes, compile-fold, find-language-joint):
	  (default-language-joiner, decompile-passes, decompile-fold): Use more
	  "match".

2020-05-07  Andy Wingo  <wingo@pobox.com>

	Slight (system base compile) refactor
	* module/system/base/compile.scm (call-once): Use when instead of if.

	Remove compilation order cache
	* module/system/base/language.scm (define-language): Remove
	  invalidate-compilation-cache! call.
	  (invalidate-compilation-cache!): Deprecate.
	  (*decompilation-cache*, *compilation-cache*): Remove.
	  (lookup-compilation-order, lookup-decompilation-order): Don't use a
	  cache.
	  (*current-language*): Only define this when deprecation is enabled.

2020-05-05  Andy Wingo  <wingo@pobox.com>

	Update (system base compile) header
	* module/system/base/compile.scm (system): Clean up imports.

2020-05-04  Andy Wingo  <wingo@pobox.com>

	Fix prompt compilation
	* module/language/tree-il/compile-bytecode.scm (compile-closure): Fix
	  emit-prompt invocation.

	Fix baseline compilation of let-values and prompt
	* module/language/tree-il/compile-bytecode.scm (compile-closure): Fix
	  fold invocation for visit-values-handler.

	Fix baseline compilation of conditionals
	* module/language/tree-il/compile-bytecode.scm (canonicalize): Don't add
	  an extra false? around predicates.
	  (compile-closure): Fix predicate comparison instructions.

	Avoid shuffle-down for tail calls
	* module/language/tree-il/compile-bytecode.scm (compile-closure): We can
	  emit the precise move sequence and just do a reset-frame once, so go
	  ahead and do that.

	Debugging names in baseline compiler; emit/immediate? fixes
	* module/language/tree-il/compile-bytecode.scm (compile-closure):
	  Provide names for locals, including the closure.  Fix emission of
	  primitives with immediate args.

	Add baseline compiler
	* module/language/tree-il/compile-bytecode.scm: New file.
	* module/Makefile.am (SOURCES):
	* am/bootstrap.am (SOURCES): Add new file.

	Export emit-shuffle-down for baseline compiler
	* module/system/vm/assembler.scm (emit-shuffle-down): Export.

	Remove unused (language tree-il canonicalize)
	* module/language/tree-il/canonicalize.scm: Remove.
	* module/Makefile.am (SOURCES):
	* am/bootstrap.am (SOURCES): Update.

	Ensure <prompt> handler is values handler
	* module/language/tree-il/primitives.scm (call-with-prompt): Only pass
	  "values handlers" as handler: lambdas with only req and rest args, and
	  only one clause.
	* module/language/tree-il/compile-cps.scm (canonicalize): Remove
	  eta-conversion pass here.
	* test-suite/tests/peval.test ("partial evaluation"): Adapt test.

2020-04-29  Andy Wingo  <wingo@pobox.com>

	Add intrinsics for a baseline compiler
	Since there's no optimization in the baseline compiler, there's no sense
	in instruction explosion.

	* libguile/intrinsics.h:
	* libguile/intrinsics.c ($car, $cdr, $set-car!, $set-cdr!,
	  $variable-ref, $variable-set!, $vector-length, $vector-ref,
	  $vector-set!, $vector-ref/immediate, $vector-set!, $allocate-struct,
	  $struct-vtable, $struct-ref, $struct-set!  $struct-ref/immediate,
	  $struct-set!): New intrinsics.
	* libguile/jit.c (compile_call_scm_scm, compile_call_scm_scm_slow)
	  (compile_call_scm_scm_scm, compile_call_scm_scm_scm_slow)
	  (compile_call_scm_uimm_scm, compile_call_scm_uimm_scm_slow): New
	  code generators.
	* libguile/vm-engine.c (call-scm-scm, call-scm-scm-scm,
	  call-scm-uimm-scm): New instructions.
	* module/system/vm/assembler.scm (emit-null?, emit-false?, emit-nil?):
	  Export these.  Also export emitters for the new intrinsics.
	  (define-scm-scm-intrinsic, define-scm-uimm-scm-intrinsic)
	  (define-scm-scm-scm-intrinsic): New helpers.
	* doc/ref/vm.texi (Intrinsic Call Instructions): Add new instructions.

2020-04-29  Andy Wingo  <wingo@pobox.com>

	Remove unused analyze-lexicals function
	* module/language/tree-il/analyze.scm (analyze-lexicals): Remove unused
	  function; a holdover from GLIL days.

	Deprecate scm_bitvector, scm_make_bitvector, scm_bitvector_p
	* doc/ref/api-data.texi (Bit Vectors): Update.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c:
	* libguile/deprecated.c:
	* libguile/deprecated.h: Deprecate scm_bitvector, scm_make_bitvector,
	  and scm_bitvector_p.
	* libguile/read.c (scm_read_guile_bit_vector): Use scm_list_to_bitvector
	  instead of scm_bitvector.

	Prefer C-like interfaces for scm_c_bitvector_{set,clear}_bits_x
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (scm_c_bitvector_set_bits_x)
	  (scm_c_bitvector_clear_bits_x): Expose only C-like interfaces.  No
	  need to have a SCM_UNDEFINED return.
	* libguile/deprecated.c (scm_bit_set_star_x): Adapt.
	* doc/ref/api-data.texi (Bit Vectors): Update.

2020-04-29  Andy Wingo  <wingo@pobox.com>

	Deprecate useless C bitvector interface
	C should use scm_c_bitvector_length, not scm_bitvector_length.

	* doc/ref/api-data.texi (Bit Vectors): Reorganize a bit to put typed C
	  interfaces in their own section.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (bitvector-length, bitvector-count): Make
	  SCM-flavored C interface private.
	  (scm_c_bitvector_count): New function.
	* libguile/deprecated.c (scm_bitvector_length): Deprecate.
	  (scm_bit_count): Adapt to changes.

2020-04-29  Andy Wingo  <wingo@pobox.com>

	bitvector-count-bits replaces bit-count*
	* NEWS: Add entry.
	* doc/ref/api-data.texi (Bit Vectors): Update.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (scm_c_bitvector_count_bits): New function.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_bit_count_star): Deprecate.
	* module/ice-9/sandbox.scm (bitvector-bindings): Replace bit-count* with
	  bitvector-count-bits.
	* test-suite/tests/bitvectors.test: Update.

2020-04-26  Ludovic Courtès  <ludo@gnu.org>

	'finalization_thread_proc' sets errno before calling 'perror'.
	* libguile/finalizers.c (finalization_thread_proc): Set 'errno' before
	calling 'perror'.

2020-04-26  Matt Wette  <mwette@alumni.caltech.edu>

	doc: Fix typo.
	* doc/ref/tour.texi (Reporting Bugs): Fix typo.

2020-04-18  Andy Wingo  <wingo@pobox.com>

	bitvector-flip-all-bits! replaces bit-invert!
	* NEWS: Add entry.
	* doc/ref/api-data.texi (Bit Vectors): Update.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (scm_c_bitvector_flip_all_bits_x): New function.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_bit_invert_x): Deprecate.
	* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
	  bit-invert! with bitvector-flip-all-bits!.
	* module/system/vm/frame.scm (available-bindings): Use the new
	  interface.
	* test-suite/tests/bitvectors.test: Update.

2020-04-15  Andy Wingo  <wingo@pobox.com>

	bitvector-set-all-bits! / bitvector-clear-all-bits! replace bitvector-fill!
	* NEWS: Add entry.
	* doc/ref/api-data.texi (Bit Vectors): Update.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (scm_c_bitvector_set_all_bits_x)
	  (scm_c_bitvector_clear_all_bits_x): New functions.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_bitvector_fill_x): Deprecate.
	* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
	  bitvector-fill! with bitvector-set-all-bits! /
	  bitvector-clear-all-bits!.
	* module/system/vm/disassembler.scm (static-opcode-set): Use
	  bitvector-set-bit!.
	* module/system/vm/frame.scm (available-bindings): Use the new
	  interfaces.
	* test-suite/tests/bitvectors.test: Update.

2020-04-14  Andy Wingo  <wingo@pobox.com>

	bitvector-set-bit! / bitvector-clear-bit! replace bitvector-set!
	* NEWS: Add entry.
	* doc/ref/api-data.texi (Bit Vectors): Update.
	* libguile/array-handle.h (bitvector_set_x, scm_array_get_handle): Adapt
	  to bitvector changes.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (scm_c_bitvector_set_bit_x)
	  (scm_c_bitvector_clear_bit_x): New functions.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_bitvector_set_x): Deprecate.
	* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
	  bitvector-set! with bitvector-set-bit! / bitvector-clear-bit!.
	* module/system/vm/disassembler.scm (static-opcode-set): Use
	  bitvector-set-bit!.
	* module/system/vm/frame.scm (compute-defs-by-slot, available-bindings):
	  Use bitvector-set-bit!.
	* test-suite/tests/bitvectors.test: Update.

2020-04-14  Andy Wingo  <wingo@pobox.com>

	bitvector-bit-set? / bitvector-bit-clear? replace bitvector-ref
	This is an opportunity to make a new interface that can be more
	efficient in 3.0 (because no generic array support), easier to read (no
	need for 'not'), and more consistent with other bitvector interfaces.

	* NEWS: Add entry.
	* doc/ref/api-data.texi (Bit Vectors): Update.
	* libguile/array-handle.h (bitvector_ref, scm_array_get_handle): Adapt
	  to bitvector changes.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (scm_c_bitvector_bit_is_set)
	  (scm_c_bitvector_bit_is_clear): New functions.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_bitvector_ref): Deprecate.
	* module/ice-9/sandbox.scm (bitvector-bindings): Replace
	  bitvector-ref with bitvector-bit-set? / bitvector-bit-clear?.
	* module/system/vm/disassembler.scm (instruction-has-fallthrough): Use
	  bitvector-bit-clear?.
	* test-suite/tests/bitvectors.test: Update.

2020-04-13  Andy Wingo  <wingo@pobox.com>

	Replace bit-set*! with bitvector-set-bits! / bitvector-clear-bits!
	The old name was wonky and hard to read: you almost always pass a
	literal as the value to set, so better to make separate functions.

	* NEWS: Add entry.
	* doc/ref/api-data.texi (Bit Vectors): Update.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (scm_bitvector_set_bits_x)
	  (scm_bitvector_clear_bits_x): New functions.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_bit_set_star_x): Deprecate.
	* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
	  bit-set*! with bitvector-set-bits! / bitvector-clear-bits!.
	* module/system/vm/frame.scm (available-bindings, compute-killv): Use
	  bitvector-set-bits! and bitvector-clear-bits!.
	* test-suite/tests/bitvectors.test: Update.

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

	Replace bit-position with bitvector-position
	The old name was wonky and had bad argument order.

	* NEWS: Add entry.
	* doc/ref/api-data.texi (Bit Vectors): Update.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (scm_bitvector_position): New function.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_bit_position): Deprecate.
	* module/ice-9/sandbox.scm (bitvector-bindings): Replace bit-position
	  with bitvector-position.
	* module/language/cps/intset.scm (bitvector->intset): Use
	  bitvector-position.
	* module/system/vm/frame.scm (available-bindings): Use
	  bitvector-position.
	* test-suite/tests/bitvectors.test ("bitvector-position"): Add test.

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

	Replace bit-count with bitvector-count
	The old name was wonky and had bad argument order.

	* NEWS: Add entry.
	* doc/ref/api-data.texi (Bit Vectors): Update.
	* libguile/bitvectors.h:
	* libguile/bitvectors.c (VALIDATE_BITVECTOR): New helper.
	  (scm_bitvector_count): New function.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_bit_count): Deprecate.
	* module/ice-9/sandbox.scm (bitvector-bindings): Replace bit-count with
	  bitvector-count.
	* module/srfi/srfi-60.scm: No need to #:replace bit-count.
	* module/system/vm/frame.scm (available-bindings): Use bitvector-count.
	* test-suite/tests/bitvectors.test ("bitvector-count"): Add test.

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

	Deprecate bitvector-ref on array slices
	* NEWS: Update.
	* doc/ref/api-data.texi (Bit Vectors): Update documentation on bit-set*!
	  and bit-count*.
	* libguile/bitvectors.c: Add a to-do list.
	  (scm_c_bitvector_ref, scm_c_bitvector_set_x, scm_bitvector_fill_x)
	  (scm_bitvector_to_list, scm_bit_count, scm_bit_position):
	  Issue deprecation warnings when used on array slices.
	  (scm_list_to_bitvector): Simplify.
	  (scm_bit_set_star_x, scm_bit_count_star): Deprecate arrays as target
	  bitvectors, and also use of u32vector as selection vector.
	* libguile/bitvectors.h:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_istr2bve): Deprecate.
	* test-suite/tests/bitvectors.test ("bit-count*"): Remove test of u32
	  selectors.

2020-04-09  Daniel Llorens  <lloda@sarc.name>

	Add #:declarative? #f to (srfi srfi-64)
	This is needed for test-log-to-file to work.

2020-04-09  Icecream95  <ixn@keemail.me>

	Add CI jobs for ARM in both instruction sets

2020-04-09  Icecream95  <ixn@keemail.me>

	Convert BLI to BLXI for jumps to ARM code
	With this, Guile builds and runs in both ARM and Thumb mode.

	Closes: #12

2020-04-09  Icecream95  <ixn@keemail.me>

	Always emit veneers for non-bl jumps to ARM code
	It is unlikely for any ARM code to be close enough to not have needed
	a veneer, but it is possible, especially if running in a program with
	another JIT library.

	Remove T2_BLXI

	Use bx instead of mov for jumps on ARM

	Stop setting the thumb bit except on jumps to veneers
	Thanks to the previous commit, the jump targets should all be correct.

	Return a function pointer from jit_address
	This will allow supporting ARM code on armv7 without having to change
	any users of Lightening.

	Use an rsh of 0 for jumps on ARM
	This will allow supporting jumping to ARM (as opposed to Thumb) code.

	Add a test for local forward and backward jumps

2020-04-06  Icecream95  <ixn@keemail.me>

	Add separate functions for veneer patching

	Add flag bits to the jit_reloc_kind enum

2020-03-28  Matt Wette  <mwette@alumni.caltech.edu>

	doc: Improve tree-il 'lambda-case' description.
	* doc/ref/compiler.texi (Tree-IL): for description of lambda-case
	argument 'kw' added "or @code{#f} if there are no keyword arguments".

2020-03-27  Ludovic Courtès  <ludo@gnu.org>

	GNU Guile 3.0.2.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	(LIBGUILE_INTERFACE_REVISION): Increment.

	Update NEWS.
	* NEWS: Update.

2020-03-26  Mike Gran  <spk121@yahoo.com>

	Update SRFI-14 tables to Unicode 13.0.0
	* libguile/srfi-14.i.c (cs_lower_case_ranges, cs_upper_case_ranges)
	  (cs_letter_ranges, cs_digit_ranges, cs_letter_plus_digit_ranges)
	  (cs_graphic_ranges, cs_printing_ranges, cs_punctuation_ranges)
	  (cs_symbol_ranges, cs_designated_ranges): updated to Unicode 13

2020-03-25  Arun Isaac  <arunisaac@systemreboot.net>

	doc: Replace square brackets with round brackets.
	* doc/ref/sxml-match.texi: Replace all square brackets with round
	brackets in order to be consistent with the rest of the documentation.

2020-03-25  Linus Björnstam  <linus.bjornstam@fastmail.se>

	Add SRFI-171 to guile
	This adds SRFI-171 (transducers) to guile.

	The two guile-specific additions are powerful transducers which can be
	used to generalize transducers like tsegment. They are hard to get
	right, but powerful and useful enough to warrant inclusion.

	 * doc/ref/srfi-modules.texi: added srfi-171 section
	 * module/Makefile.am (SOURCES):
	 * module/srfi/srfi-171.scm:
	 * module/srfi/srfi-171/meta.scm: Add SRFI-171
	 * module/srfi/srfi-171/gnu.scm: Add 2 guile-specific extensions.
	 * test-suite/Makefile.am (SCM_TESTS):
	 * test-suite/tests/srfi-171.test: Add tests.

2020-03-23  Ludovic Courtès  <ludo@gnu.org>

	'sort-labels-locally' uses a transient intset.
	* module/language/cps/renumber.scm (sort-labels-locally): Use a
	transient intset.

	'resize_set' no longer allocates in a loop.
	* libguile/weak-set.c (resize_set): Call 'scm_gc_malloc_pointerless'
	outside the loop.

2020-03-23  Ludovic Courtès  <ludo@gnu.org>

	Ensure weak sets are occasionally vacuumed.
	Just like in dc8dda77e0c937abae42a76ea88c6e7995adbd9a, this ensures weak
	sets are vacuumed in a timely fashion.  It also works around the fact
	that 'vacuum_all_weak_tables' isn't getting called more than a couple of
	times, for some reason.

	Partly fixes <https://bugs.gnu.org/40194>.

	* libguile/weak-set.c (weak_set_add_x): When 'set->items > set->upper',
	call 'vacuum_weak_set'.

2020-03-23  Ludovic Courtès  <ludo@gnu.org>

	Avoid double initialization in 'vector-copy'.
	* libguile/vectors.c (make_vector): New function.
	(scm_c_make_vector): Use it instead of 'scm_words'.
	(scm_vector_copy): Use it instead of 'scm_c_make_vector'.

2020-03-23  Andy Wingo  <wingo@pobox.com>

	Fix fixpoint computation in compute-significant-bits
	* module/language/cps/specialize-numbers.scm (preserve-eq?): New
	  helper.
	  (sigbits-union): Use the new helper.  Fixes bugs.gnu.org/38486.
	  Thanks to Zack Marvel for the bug report and Matt Wette for tracking
	  it down.

2020-03-22  Matt Wette  <mwette@alumni.caltech.edu>

	Deprecate 'tmpnam' and add '--disable-tmpnam' configure option.
	* configure.ac: Add '--disable-tmpnam'.
	* libguile/posix.c (tmpnam): Conditionalize on 'SCM_ENABLE_DEPRECATED'
	and 'ENABLE_TMPNAM'.  Call 'scm_c_issue_deprecation_warning'.

2020-03-22  Isaac Jurado  <diptongo@gmail.com>
	    Ludovic Courtès  <ludo@gnu.org>

	Interpret dynamic library name as literal file name first.
	Fixes <https://bugs.gnu.org/21076>.

	* libguile/dynl.c (sysdep_dyn_link): Try plain lt_dlopen first, to
	  interpret fname as a literal path.
	* doc/ref/api-foreign.texi: Update explanation to describe the new
	  behavior.

2020-03-21  Ludovic Courtès  <ludo@gnu.org>

	tests: Skip web server test when thread support is missing.
	* test-suite/tests/web-server.test ("GET with keep-alive"): Throw
	'unresolved when not (provided? 'threads).

2020-03-21  Matt Wette  <matt.wette@gmail.com>

	Fix compilation --without-threads.
	Fixes <https://bugs.gnu.org/40075>.
	Reported by Thomas Klausner <tk@giga.or.at>.

	* libguile/null-threads.h: Include "libguile/scm.h".
	* libguile/null-threads.c: Include "libguile/scmconfig.h".

2020-03-17  Ludovic Courtès  <ludo@gnu.org>

	Fix race condition between 'abort-to-prompt' and stack marking.
	Fixes <https://bugs.gnu.org/28211>.

	* libguile/vm.c (scm_i_vm_emergency_abort, abort_to_prompt): Move
	'vp->fp' assignment above 'sp[nargs]' assignments.

2020-03-17  Ludovic Courtès  <ludo@gnu.org>

	gdb: Avoid accessing values that are optimized out.
	* libguile/libguile-3.0-gdb.scm (vm-frame-function-name)[ip-in-symbol?]:
	Do not access SYM's value when it's optimized out.

	gdb: Adjust 'find-vp' for Guile 3.0.
	* libguile/libguile-3.0-gdb.scm (find-vp): Adjust for Guile 3.0.

	gdb: Use <stdint.h> types.
	* libguile/libguile-3.0-gdb.scm (vm-frame): Look up stdint.h types
	instead of now-deprecated "scm_t_" types.

2020-03-17  Ludovic Courtès  <ludo@gnu.org>

	gdb: Delay type lookups.
	This avoids errors while loading the file when types are not in scope.

	* libguile/libguile-3.0-gdb.scm (%gdb-memory-backend)[void*]: Turn into
	a promise and adjust user accordingly.
	(ip-type, fp-type, sp-type, uint-type): Remove.
	(vm-frame)[ip-type, uint-type]: New variables.

2020-03-13  Mike Gran  <spk121@yahoo.com>

	Add C API for hook procedures to libguile.h
	* libguile.h: add hooks.h

2020-03-11  Jan Synacek  <jsynacek@redhat.com>

	doc: Fix typo in api-debug.texi.
	* doc/ref/api-debug.texi (Debugging): Fix typo.

2020-03-09  Ludovic Courtès  <ludo@gnu.org>

	Fix incorrect allocation size in 'make-vtable-vtable'.
	Fixes <https://bugs.gnu.org/39266>.
	Thanks to <https://rr-project.org/> for its help!

	* libguile/struct.c (set_vtable_access_fields): Fix first argument to
	'scm_gc_malloc_pointerless'.

2020-03-08  Ludovic Courtès  <ludo@gnu.org>

	GNU Guile 3.0.1.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	(LIBGUILE_INTERFACE_CURRENT): Increment.
	(LIBGUILE_INTERFACE_REVISION): Reset.
	(LIBGUILE_INTERFACE_AGE): Increment.  This accounts for commit
	228ae549ca651d9e9e7a7b02d282d0408bd6c9e6, which adds new symbols to the ABI.

	Update NEWS.
	* NEWS: Update.

2020-03-07  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS: Update.

2020-03-07  Ludovic Courtès  <ludo@gnu.org>

	README mentions development dependencies.
	Reported by Jean-Christophe Helary <jean.christophe.helary@traduction-libre.org>.

	* README: Mention packages needed when building from Git.

2020-03-07  Ludovic Courtès  <ludo@gnu.org>

	README no longer says it's a prerelease.
	Reported by Jean-Christophe Helary <jean.christophe.helary@traduction-libre.org>.

	* README: Remove mention of a prerelease.

2020-03-07  Nguyễn Thái Ngọc Duy  <pclouds@gmail.com>

	Accept .sld as scheme extensions in r7rs
	This is similar to 0bb980f12 (New function: install-r6rs!, 2019-09-25)
	which accepts .sls extension for r6rs. In r7rs, most portable libraries
	use .sld.

	* module/ice-9/boot-9.scm (install-r7rs!): Update %load-extensions.

2020-03-07  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS: Update.

2020-03-07  Ludovic Courtès  <ludo@gnu.org>

	Actually run '00-repl-server.test'.
	This is a followup to ddcab06f20525d975503d8d9611e02021fb0dff1.  Until
	now the tests would always be marked as unresolved because TMPDIR was
	removed before the client and server had been started.

	* test-suite/tests/00-repl-server.test (call-with-repl-server): Remove
	initial call to 'rmdir'.  Add calls to 'delete-file' and 'rmdir' in the
	unwind handler.

2020-03-07  Ludovic Courtès  <ludo@gnu.org>

	psyntax: Preserve source location information for top-level references.
	Fixes <https://bugs.gnu.org/38388>.

	* module/ice-9/psyntax.scm (expand-expr): In 'build-global-reference'
	call, pass S when (source-annotation (car e)) returns #f.
	* module/ice-9/psyntax-pp.scm: Regenerate.

2020-03-06  Ludovic Courtès  <ludo@gnu.org>

	web: Client treats TLS "premature termination" error as EOF.
	Fixes <https://bugs.gnu.org/39800>.
	Reported by <franco.rcr@gmail.com>.

	* module/web/client.scm (tls-wrap)[read!]: Catch 'gnutls-error around
	'get-bytevector-some' call.

2020-03-06  Ludovic Courtès  <ludo@gnu.org>

	Remove extra 'error' call in 'make-record-type'.
	* module/ice-9/boot-9.scm (make-record-type)[computed-fields]: Remove
	extra 'error' call.

2020-03-06  Ludovic Courtès  <ludo@gnu.org>

	Fix expansion of 'error' primitive with a non-constant argument.
	Fixes <https://bugs.gnu.org/39509>.
	Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>.

	* module/language/tree-il/primitives.scm (error): Remove extra "?"
	argument when the first argument is not a constant.
	* test-suite/tests/tree-il.test ("primitives")["error"]: New test
	prefix.

2020-03-06  Ludovic Courtès  <ludo@gnu.org>

	Add 'hash' test for keywords.
	This is a followup to 8b3cad618314f02ad3921fa104f17ca0f721dfcb.

	* test-suite/tests/hash.test ("hash")["keyword"]: New test prefix.

2020-03-06  Ludovic Courtès  <ludo@gnu.org>

	'hash' behaves like 'hashq' for tc7s without an 'equal?' implementation.
	Fixes <https://bugs.gnu.org/39634>.

	* libguile/hash.c (scm_raw_ihash): Add cases for scm_tc7 values that
	were not explicitly listed.

2020-03-05  Ludovic Courtès  <ludo@gnu.org>

	psyntax: 'include' no longer rejects relative file names.
	Fixes a regression introduced in commit
	fd2ffc649c2d08639c2ac41c25e4ebdbeb4b151d whereby including a relative
	file name would result in:

	  ice-9/psyntax.scm:3254:24: attempt to include relative file name but could not determine base dir

	* module/ice-9/psyntax.scm (call-with-include-port)[syntax-dirname]:
	Lookup 'filename (symbol), not filename (identifier).
	* module/ice-9/psyntax-pp.scm: Regenerate.

2020-03-03  Andy Wingo  <wingo@pobox.com>

	GUILE_PKG finds guile-3.0
	* meta/guile.m4 (GUILE_PKG): Drop 1.8 from default versions to look for,
	  and add 3.0.

2020-02-26  Andy Wingo  <wingo@pobox.com>

	Add support for perf map creation
	* libguile/jit.c (create_perf_map_once, create_perf_map, perf_map): New
	  locals.
	  (compute_mcode): Add an entry to perf_map for emitted JIT code.

2020-02-21  Rob Browning  <rlb@defaultvalue.org>

	Implement hashing for keywords, i.e. (hash #:x ...)
	Add keyword handling to (hash ...).  Previously it would just return the
	same value for all keywords.

	* libguile/hash.c (scm_raw_ihash): Add scm_tc7_keyword case.

	* libguile/keywords.h (SCM_I_KEYWORD_HASH): New macro.

2020-02-19  Andy Wingo  <wingo@pobox.com>

	Fix bug restoring a JIT continuation from the interpreter
	* libguile/vm.c (push_interrupt_frame, compose_continuation): In places
	  where we push on synthetic frames before possibly going back to mcode,
	  make sure that the return mcode will trampoline back to the
	  interpreter.  Fixes compose-continuation from the interpreter to
	  partial continuations with mcode.

	Better debugging in jit.c
	* libguile/jit.c (emit_direct_tail_call): Assert self-tail call has
	  mcode.
	  (opcodes_seen, bitvector_ref, bitvector_set, compile1): Make the
	  opcodes_seen set more compact, and log all instruction emissions at
	  level 3.
	  (compute_mcode): Don't overwrite mcode if compilation fails.

2020-02-18  Andy Wingo  <wingo@igalia.com>

	Switch CI to use Debian stable

2020-02-17  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2020-02-17  Andy Wingo  <wingo@igalia.com>

	Ensure 32 bytes of stack are reserved on 64-bit Windows targets
	* lightening/x86.c (reset_abi_arg_iterator): Reserve 32 stack bytes on
	  64-bit Windows systems, in accordance with ABI.  Thanks a million to
	  Charles Stanhope for the patch and to Mike Gran for testing!

2020-02-12  Andy Wingo  <wingo@pobox.com>

	Add type checkers for lsh/immediate and rsh/immediate
	* module/language/cps/types.scm (lsh/immediate, rsh/immediate): New type
	  checkers.

	Fold (logior 0 INT) to INT
	* module/language/cps/type-fold.scm (logior): Integer-valued operands
	  to (logior 0 EXPR) should fold to EXPR.

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

	Reintroduce 'SCM_MEMORY_ERROR' in terms of 'scm_report_out_of_memory'.
	Suggested by Dale P. Smith <dsmich@roadrunner.com>.

	* libguile/deprecated.h (SCM_MEMORY_ERROR): New macro.
	* doc/ref/api-control.texi (Dynamic Wind): Use 'scm_report_out_of_memory'.

2020-02-10  Ludovic Courtès  <ludo@gnu.org>

	Remove traces of 'scm_memory_error'.
	'scm_memory_error' was deprecated in 2014 in commit
	c2247b782a9234bb9aedee5204c30daf1d01a510 and removed in 2017 in commit
	c248ea10beb2afa4c113dbc6dc707bed5dbfc92e.  This is a followup.

	* libguile/error.h (SCM_MEMORY_ERROR): Remove.
	* doc/guile-api.alist: Remove 'scm_memory_error'.
	* doc/ref/api-control.texi (Handling Errors): Likewise.
	(Dynamic Wind): Use 'scm_misc_error' instead of 'scm_memory_error'.

2020-02-08  John Paul Adrian Glaubitz  <glaubitz@physik.fu-berlin.de>

	Fix build on ia64.
	* libguile/continuations.c (capture_auxiliary_stack): Fix
	  logic in preprocessor code when checking for ia64 host;
	  fix dereferencing of ctx variable.
	* libguile/threads.h (struct scm_thread): Add missing member
	  SCM_STACKITEM *auxiliary_stack_base.

	Fix build on platforms where the stack grows upwards.
	 * libguile/continuations.c (scm_dynthrow): Fix missing mra
	   parameter to grow_stack for SCM_STACK_GROWS_UP.

2020-02-08  Ludovic Courtès  <ludo@gnu.org>

	Handle GMP allocations through libgc and remove bignum finalizers.
	This significantly speeds up loads that create lots of bignums, like
	(language cps slot-allocation) for files with many top-level
	definitions.  Compiling such a file is typically 2.5 times faster.

	See <https://lists.gnu.org/archive/html/guile-devel/2020-02/msg00023.html>.

	* libguile/numbers.c (custom_gmp_malloc): Use
	'scm_gc_malloc_pointerless' instead of 'scm_malloc'.
	(custom_gmp_realloc): Use 'scm_gc_realloc'.
	(custom_gmp_free): Remove call to 'free'.
	(make_bignum): Use 'scm_gc_malloc' instead of 'scm_gc_malloc_pointerless'.
	Call 'scm_i_set_finalizer' only when SCM_INSTALL_GMP_MEMORY_FUNCTIONS is
	false.

2020-02-08  Ludovic Courtès  <ludo@gnu.org>

	Remove duplicate procedure in slot-allocation.scm.
	* module/language/cps/slot-allocation.scm (add-live-slot)
	(kill-dead-slot, compute-slot): Move higher up in the file.
	(compute-shuffles): Remove duplicate 'add-live-slot' procedure.

2020-01-29  Ludovic Courtès  <ludo@gnu.org>

	texinfo: Properly render @acronym in plain text.
	Fixes <https://bugs.gnu.org/37846>.
	Reported by Christopher Baines <mail@cbaines.net>.

	* module/texinfo/plain-text.scm (acronym): New procedure.
	(tag-handlers): Change 'acro' handle to ACRONYM, and add 'acronym'
	handler.
	* test-suite/tests/texinfo.plain-text.test ("stexi->plain-text")
	["acronym", "recursive acronym"]: New tests.

2020-01-29  Ludovic Courtès  <ludo@gnu.org>

	texinfo: Add '*line-width*' fluid to control line wrapping.
	* module/texinfo/plain-text.scm (*line-width*): New variable.
	(wrap*): Honor it.
	* doc/ref/texinfo.texi (texinfo plain-text): Document it.
	* test-suite/tests/texinfo.plain-text.test: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add it.

2020-01-28  Daniel Llorens  <lloda@sarc.name>

	Fix check for rl_get_keymap
	This lets Guile build on OS X (tested on 10.14) with the system-provided
	libreadline.

	* acinclude.m4 (GUILE_READLINE): Check for rl_get_keymap_name instead of
	  rl_get_keymap. The system provided libreadline is an alias to libedit,
	  which has _keymap but not _keymap_name, and Guile uses both.
	* guile-readline/readline.c: Adjust the include guard.

2020-01-27  Daniel Llorens  <lloda@sarc.name>

	Add missing include for strncmp()

2020-01-24  Daniel Llorens  <lloda@sarc.name>

	Clarify open-input-pipe example in doc

2020-01-24  Rob Browning  <rlb@defaultvalue.org>

	00-repl-server.test: don't use fixed path for socket
	* test-suite/tests/00-repl-server.test (make-tempdir): Add.
	(call-with-repl-server): Store socket in a make-tempdir dir.

2020-01-23  Ludovic Courtès  <ludo@gnu.org>

	statprof: Ensure 'call-thunk' is not inlined.
	Previously, 'make-stack' calls with the inner and outer cuts arguments
	would always return #f because 'call-thunk' wouldn't appear on the
	stack.

	* module/statprof.scm <top level>: Add self-assignment to 'call-thunk'.

2020-01-21  Ludovic Courtès  <ludo@gnu.org>

	rnrs: Export '&assertion' from (rnrs conditions).
	Fixes <https://bugs.gnu.org/39210>
	Reported by Ricardo Wurmus <rekado@elephly.net>.

	* module/rnrs/conditions.scm (rnrs): Import '&assertion-failure' as
	'&assertion', not '&assertion-violation'.

2020-01-21  Ludovic Courtès  <ludo@gnu.org>

	build: Actually install libguile-3.0-gdb.scm.
	Reported by brandelune on #guile.

	* libguile/libguile-2.2-gdb.scm: Rename to...
	* libguile/libguile-3.0-gdb.scm: ... this.
	* libguile/Makefile.am (install-data-hook): Replace hard-coded "2.2"
	with @GUILE_EFFECTIVE_VERSION@.

2020-01-20  Ludovic Courtès  <ludo@gnu.org>

	use2dot: Fix incorrect #:autoload binding set leading to unbound variables.
	* module/scripts/use2dot.scm: Load (ice-9 getopt-long) with #:use-module
	rather than #:autoload.  With the previous #:autoload spec, 'option-ref'
	would be unbound due to the new autoload semantics.

	frisk: Fix incorrect #:autoload binding set leading to unbound variables.
	* module/scripts/frisk.scm: Load (ice-9 getopt-long) with #:use-module
	rather than #:autoload.  With the previous #:autoload spec, 'option-ref'
	would be unbound due to the new autoload semantics.

2020-01-20  Ludovic Courtès  <ludo@gnu.org>

	repl: Add missing bindings in #:autoload spec.
	Fixes <https://bugs.gnu.org/39196>.
	Reported by Matt Wette <matt.wette@gmail.com>.

	* module/system/repl/command.scm: Augment #:autoload set of bindings.

2020-01-20  shack@muto.ca  <shack@muto.ca>

	doc: Use gender-neutral language in Preface
	* doc/ref/preface.texi: Avoid gendered pronoun.

2020-01-20  Ludovic Courtès  <ludo@gnu.org>

	Make 'scm_sym_lambda', 'scm_sym_quote', etc. public again.
	Fixes <https://bugs.gnu.org/39183>.

	These symbols had been inadvertently removed from libguile, even though
	they were intended to be public (as they were in 2.2).

	* libguile/expand.c: Include "memoize.h".

2020-01-18  Ludovic Courtès  <ludo@gnu.org>

	exceptions: Export constructor and predicate for '&quit-exception'.
	* module/ice-9/exceptions.scm: Re-export '&quit-exception' and export
	'make-quit-exception' and 'quit-exception?'.
	(quit-exception?): New procedure.

2020-01-15  Andy Wingo  <wingo@pobox.com>

	Fix version computation for v3.0
	* configure.ac: Fix git-version-gen invocation.

	Prepare 3.0 versioning
	* GUILE-VERSION (GUILE_MAJOR_VERSION, GUILE_MINOR_VERSION)
	  (GUILE_MICRO_VERSION): Bump for 3.0.
	  (LIBGUILE_INTERFACE_CURRENT, LIBGUILE_INTERFACE_REVISION): Bump for
	  new stable series.

	Update release.org
	* doc/release.org: Update for 3.0

	Disable eta-expansion in letrectification
	* module/language/tree-il/letrectify.scm: Disable eta-expansion, as we
	  now do that after peval.

	Add eta-expansion pass after peval
	* am/bootstrap.am (SOURCES):
	* module/Makefile.am (SOURCES): Add eta-expand.scm.
	* module/language/tree-il/eta-expand.scm: New file.
	* module/language/tree-il/optimize.scm (optimize)
	  (tree-il-optimizations): Add eta-expansion at level 2.

2020-01-14  Andy Wingo  <wingo@pobox.com>

	Declarative variables optimization limits eta-expansion
	* module/language/tree-il/letrectify.scm (compute-procedures-without-identity):
	  (letrectify): Only eta-expand lambda references that appear outside
	  the operator position more than once.  This should restore peoples'
	  expectations that (eqv? f f) without penalizing optimization.

	Update REPL copyright year to 2020
	* module/system/repl/common.scm (*version*): Update.

2020-01-13  Andy Wingo  <wingo@pobox.com>

	Wording tweak to history.texi
	* doc/ref/history.texi (A Scheme of Many Maintainers): Fix wording.

	Mention Mark Weaver in Guile history section
	* doc/ref/history.texi (A Scheme of Many Maintainers): Credit to Mark
	  for co-maintaining Guile for more than 5 years.  Thanks!!

	Update NEWS
	* NEWS: Fold incremental alpha entries into a cumulative 3.0.0 entry.

2020-01-13  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS (Changes in alpha 2.9.x): Add (web client) news.

	web: Update comment regarding the 'tls-wrap' port wrapper.
	* module/web/client.scm (tls-wrap): Update comment.

2020-01-13  Ludovic Courtès  <ludo@gnu.org>

	web: 'open-socket-for-uri' can verify the server's X.509 certificate.
	This is largely based on Guix commit
	bc3c41ce36349ed4ec758c70b48a7059e363043a and subsequent changes to that
	code.

	* module/web/client.scm (x509-certificate-directory): New variable.
	(set-certificate-credentials-x509-trust-file!*)
	(make-credendials-with-ca-trust-files, peer-certificate)
	(assert-valid-server-certificate, print-tls-certificate-error): New
	procedures.
	<top level>: Add call to 'set-exception-printer!'.
	(tls-wrap): Add #:verify-certificate? parameter.  When it is true, call
	'make-credendials-with-ca-trust-files', pass it to
	'set-session-credentials!', and call 'assert-valid-server-certificate'.
	(open-socket-for-uri): Add #:verify-certificate? parameter and pass it
	to 'tls-wrap'.
	(http-request): Add #:verify-certificate? parameter and pass it to
	'open-socket-for-uri'.
	(define-http-verb): Add #:verify-certificate? parameter and pass it to
	'http-request'.
	* doc/ref/web.texi (Web Client): Update documentation of
	'open-socket-for-uri' and 'http-request'.  Document
	'x509-certificate-directory'.

2020-01-13  Ludovic Courtès  <ludo@gnu.org>

	web: Continue handshake upon TLS warning alerts.
	This is a backport of Guix commit 7b9ac883ea62a816afbfa747c1377dc273c15c20.

	* module/web/client.scm (tls-wrap): Catch 'gnutls-error' around
	'handshake'.  Upon ERROR/WARNING-ALERT-RECEIVED, print a message and
	call 'handshake'.

2020-01-13  Ludovic Courtès  <ludo@gnu.org>
	    Sou Bunnbu (宋文武)  <iyzsong@gmail.com>

	web: Add 'current-https-proxy' and honor $https_proxy.
	* module/web/client.scm (current-https-proxy): New variable.
	(setup-http-tunnel): New procedure.
	(open-socket-for-uri): Move 'http-proxy', 'uri', and 'addresses' inside
	'open-socket'.  Remove 'with-https-proxy' macro.  Add call to
	'setup-http-tunnel'.  Honor 'current-https-proxy' in 'open-socket'.
	* doc/ref/web.texi (Web Client): Document 'current-https-proxy'.
	* doc/ref/guile.texi: Update copyright years.

	Based on Guix commit 9bc8175cfa6b23c31f6c43531377d266456e430e.

2020-01-13  Ludovic Courtès  <ludo@gnu.org>

	web: Adjust (gnutls) loading to new module autoload semantics.
	Prior to commit cb14fd214365e50b6b1655616ae74d0228933bbd (Guile 2.9.7),
	autoloading a module would give you access to all its bindings.  In
	future versions, autoloading a module gives access only to the listed
	bindings, as per #:select (see <https://bugs.gnu.org/38895>).

	This commit adjusts autoloads to the new semantics, fixing a regression
	introduced in cb14fd214365e50b6b1655616ae74d0228933bbd.

	* module/web/client.scm <top level>: Remove 'module-autoload!' call.
	(gnutls-module, ensure-gnutls): Remove.
	(load-gnutls): New procedure.
	(tls-wrap): Call it instead of 'ensure-gnutls'.  Replace reference to
	GNUTLS-MODULE by a call to 'resolve-interface'.

2020-01-13  Andy Wingo  <wingo@pobox.com>

	Bump manual year, and fix NEWS typo
	* NEWS: Fix a typo.
	* doc/ref/guile.texi: Bump copyright year.

	GNU Guile 2.9.9 (beta).
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to 2.9.9.

	Bump user-visible copyright years to 2020
	* module/ice-9/command-line.scm (version-etc):
	* module/scripts/compile.scm (show-version): Bump to 2020.

	Bump objcode minor version in preparation for new stable series
	* libguile/loader.h (SCM_OBJCODE_MINIMUM_MINOR_VERSION):
	  (SCM_OBJCODE_MINOR_VERSION):
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.

2020-01-12  Tim Gesthuizen  <tim.gesthuizen@yahoo.de>

	srfi-11: Do not expose variables to later clauses
	The current implementation of srfi-11s let-values allows later clauses
	to access and modify variables bound in earlier clauses when the clause
	is not a proper list.

	* module/srfi/srfi-11.scm (let-values): Fix switched variable names.
	* test-suite/tests/srfi-11.test (let-values): Add test checking that the
	  variable cannot be changed in later clauses.

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

	Update NEWS
	* NEWS: Update.

2020-01-12  Rob Browning  <rlb@defaultvalue.org>

	Respect thread local fluid defaults
	Previously (fluid-ref (make-thread-local-fluid #t)) would return #f via
	scm_fluid_ref because the internal scm_hashq_ref would return #f when
	the fluid had not been set, and that was interpreted as an actual value
	for the fluid.

	Instead, just pass the fluid default as the default for the hash table
	lookups so that we don't need a second step to determine if the fluid
	was set.

	Thanks to Andrew Gierth for tracking down the problem.

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

	Fix typos in previous commit.
	* module/ice-9/boot-9.scm (record-modifier):
	* module/rnrs/records/procedural.scm (make-record-type-descriptor): Fix
	  typos.

	Optionally allow duplicate field names in core records
	* NEWS: Update.
	* doc/ref/api-data.texi (Records): Update docs.
	* module/ice-9/boot-9.scm (make-record-type): Add
	  #:allow-duplicate-field-names? keyword argument.
	  (record-accessor, record-modifier): Allow passing indexes to identify
	  fields.
	* module/rnrs/records/procedural.scm (make-record-type-descriptor):
	  Allow duplicate field names.  Fixes #38611.

	Fix peval bug that ignored excess args
	* module/language/tree-il/peval.scm (peval): Fix arity check for type
	  confusion (empty value of "rest" in this context was (), not #f).  The
	  effect was that we'd silently allow extra arguments to inlined calls.
	  Thanks to Christopher Lam for the report!  Fixes #38617.
	* test-suite/tests/peval.test ("partial evaluation"): Add a test.

	Support R7RS define-library
	* module/Makefile.am (ice-9/boot-9.go, NOCOMP_SOURCES): Add
	  r7rs-libraries.
	* module/ice-9/boot-9.scm ("ice-9/r7rs-libraries"): Include file.
	* module/ice-9/psyntax.scm (call-with-include-port): New definition.
	  (include): Use call-with-include-port.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/ice-9/r7rs-libraries.scm: New file.
	* module/scheme/base.scm (r7:include, r7:include-ci): Fix mistaken use
	  of core "include".  Use include-ci from core.
	  (features): Remove features that are already part of core.
	* NEWS: Update.

2020-01-11  Andy Wingo  <wingo@pobox.com>

	Add NEWS entries
	* NEWS: Add a couple entries.

	Fix bug in closure conversion
	* module/language/cps/closure-conversion.scm (convert-one):
	  Strongly-connected components of letrec bindings that do not share a
	  closure may include member functions that have a single free variable,
	  or even no free variables as a result of free variable pruning.
	  Handle this case instead of erroring out.  Thanks to Stefan Israelsson
	  Tampe for the report.

2020-01-11  Andy Wingo  <wingo@igalia.com>

	Fix build on 32-bit systems with JIT support
	* libguile/intrinsics.h: Add s64->f64 intrinsic, for 32-bit targets.
	* libguile/jit.c (compile_s64_to_f64): Call the intrinsic for 32-bit
	  targets.

2020-01-10  Andy Wingo  <wingo@pobox.com>

	Update NEWS with details on guard and autoloads.
	* NEWS: Update.

	Re-implement `guard'
	* module/ice-9/exceptions.scm (guard): Add guard definition that
	  re-propagates from original continuation, runs consequents in tail
	  position in guard continuation, and doesn't rewind the stack.
	* module/srfi/srfi-34.scm:
	* module/rnrs/exceptions.scm (guard): Re-export from (ice-9
	  exceptions).

2020-01-06  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2020-01-06  Andy Wingo  <wingo@igalia.com>

	Fix mips32r6 bug
	See also:

	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925129
	http://hades.mech.northwestern.edu/images/1/16/MIPS32_Architecture_Volume_II-A_Instruction_Set.pdf
	https://lists.gnu.org/archive/html/lightning/2019-08/msg00010.html
	https://lists.gnu.org/archive/html/guile-devel/2019-08/msg00030.html

	* lightening/mips-cpu.c: Fix encoding of LR.  Thanks to Bruno Haible.

2020-01-06  Andy Wingo  <wingo@pobox.com>

	Mention WebAssembly in status section
	* doc/ref/history.texi (Status): Add mention of WebAssembly.

	Update compiler.texi and history.texi
	* doc/ref/compiler.texi (Extending the Compiler):
	* doc/ref/history.texi (A Timeline of Selected Guile Releases):
	  (Status): Update.  Thanks to Mikael Djurfeldt for the bug report.

2020-01-06  Daniel Llorens  <lloda@sarc.name>

	New function string-replace-substring in (ice-9 string-fun)
	By A. Wingo in
	https://lists.gnu.org/archive/html/guile-devel/2014-03/msg00058.html.

	* module/ice-9/string-fun.scm (string-replace-substring): As stated.
	* doc/ref/api-data.texi: Document the new function.
	* test-suite/tests/strings.test: Test.

2020-01-03  Daniel Llorens  <lloda@sarc.name>

	Extend core vector-fill! to handle a range
	With this patch, these two lines

	  (vector-fill! vec fill)
	  (vector-fill! vec fill 0 end)

	run at the same speed; before, the second one was much slower.

	This patch also makes it an error to call vector-fill! with a non-vector
	array. The previous implementation did not work correctly in this case.

	* libguile/vectors.c (SCM_VALIDATE_MUTABLE_VECTOR): Better error message.
	  (vector-fill!): Handle optional arguments start, end. Do not attempt
	    to handle non-vector arrays. Rename the C binding to
	    scm_vector_fill_partial_x.
	  (scm_vector_fill_x): Reuse scm_vector_fill_partial_x.
	* module/srfi/srfi-43.scm (vector-fill!): Remove & re-export the core
	  version instead.

2020-01-03  Daniel Llorens  <lloda@sarc.name>

	Provide SCM_DEFINE_STATIC
	From guile-gnome:plain/glib/gnome/gobject/private.h.

	* libguile/gsubr.h (SCM_DEFINE_STATIC): As stated.

2020-01-02  Andy Wingo  <wingo@pobox.com>

	GNU Guile 2.9.8 (beta).
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.

	Update NEWS
	* NEWS: Update for 2.9.8.

	Fix abort_to_prompt bug if dynwind leave thunk expands the stack
	* libguile/vm.c (scm_i_vm_emergency_abort, abort_to_prompt): Unwinding
	  the dynwind stack can run dynwind leave thunks, which may expand the
	  stack, which may invalidate previously calculated SP / FP values.
	  (Re)calculate SP/FP after unwinding, to avoid writing to unmapped
	  memory.  Fixes compile errors seen on Ubuntu and some other ports.

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

	srfi-35: Generate a unique binding for the constructor.
	Previously we'd get warnings like:

	  t.scm:11:0: warning: shadows previous definition of `unused-constructor-51900bdce47d50c' at /tmp/t.scm:6:0

	whenever 'define-condition-type' appeared more than once in a source
	file.

	* module/srfi/srfi-35.scm (define-condition-type): Rewrite as
	'syntax-case' and generate UNUSED-CONSTRUCTOR as a function of TYPE.

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

	srfi-35: Replace '&error'.
	* module/srfi/srfi-35.scm: Move '&error' to new #:re-export-and-replace
	clause.

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

	GNU Guile 2.9.7.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.
	* NEWS: Update.

	Avoid throwing exceptions during early boot if stdin is closed
	* libguile/fports.c (scm_i_fdes_is_valid): New internal helper.
	  (scm_i_fdes_to_port): Use new helper.
	* libguile/fports.h: Declare new helper.
	* libguile/init.c (scm_standard_stream_to_port): Refactor to use
	  scm_i_fdes_is_valid.

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

	Update NEWS
	* NEWS: Fold 2.9.6 NEWS into 3.0 NEWS.  Add NEWS for 2.9.7.

	Document JIT environment variables
	* doc/ref/guile-invoke.texi (Environment Variables): Remove
	  GUILE_STACK_SIZE which is no longer needed, and document some JIT
	  debugging environment variables.
	* doc/ref/vm.texi (Why a VM?, Just-In-Time Native Code): Update and link
	  to environment variables documentation.

	Merge remote-tracking branch 'origin/stable-2.2'

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

	Move less? slow path out of line
	* libguile/jit.c (compile_less, compile_less_slow): Move slow path out
	  of line.

	Add fixnum fast-path for =
	* libguile/jit.c (compile_numerically_equal): Add fixnum fast-path.
	  (compile_numerically_equal_slow): New slow path.

	Move allocate-pointerless-words/immediate slow path out of line
	* libguile/jit.c (compile_allocate_pointerless_words_immediate)
	  (compile_allocate_pointerless_words_immediate_slow): Move slow path
	  out of line.

	Move allocate-words/immediate slow path out of line
	* libguile/jit.c (compile_allocate_words_immediate)
	  (compile_allocate_words_immediate_slow): Move slow path out of line.

	Move assert-nargs-le slow path out of line
	* libguile/jit.c (compile_assert_nargs_le)
	  (compile_assert_nargs_le_slow): Move slow path out of line.

	Add out-of-line slow path for abort
	* libguile/jit.c (compile_abort, compile_abort_slow): Move interpreter
	  fallback to slow path.

	Add out-of-line slow path for compose-continuation
	* libguile/jit.c (compile_compose_continuation)
	  (compile_compose_continuation_slow): Move interpreter fallback to slow
	  path.

	Add subr-call out-of-line slow path
	* libguile/jit.c (emit_branch_if_heap_object_has_tc7): New helper.
	  (compile_subr_call, compile_subr_call_slow): Add a slow path for the
	  values case.

	Move alloc-frame slow path out of line
	* libguile/jit.c (compile_alloc_frame, compile_alloc_frame_slow): Move
	  slow path out of line.
	  (emit_alloc_frame_for_sp_fast, emit_alloc_frame_for_sp_slow): New
	  helpers.
	  (emit_alloc_frame): Refactor to use the new helpers.
	  (compile_push, compile_push_slow): Use the new helpers.
	  (compile_assert_nargs_ee_locals, compile_assert_nargs_ee_locals_slow):
	  Split off a slow path.

	Move assert-nargs-ge slow path out of line
	* libguile/jit.c (compile_assert_nargs_ge)
	  (compile_assert_nargs_ge_slow): Move slow path out of line.

	Move assert-nargs-ee slow path out of line
	* libguile/jit.c (compile_assert_nargs_ee)
	  (compile_assert_nargs_ee_slow): Move slow path out of line.

	Move receive-values slow path out of line
	* libguile/jit.c (compile_receive_values, compile_receive_values_slow):
	  Move slow path out of line.

	Move receive slow path out of line
	* libguile/jit.c (compile_receive, compile_receive_slow): Move slow path
	  out of line.

	Move handle-interrupts slow path out of line
	* libguile/jit.c (compile_handle_interrupts)
	  (compile_handle_interrupts_slow): Move slow path out of line.

	Move add, sub slow paths out of line
	* libguile/jit.c (compile_call_scm_from_scm_sc)
	  (compile_call_scm_from_scm_scm_slow): Move non-fixnum path out of
	  line.

	Move add/immediate, sub/immediate slow paths out of line
	* libguile/jit.c (compile_call_scm_from_scm_uimm)
	  (compile_call_scm_from_scm_uimm_slow): Move non-fixnum path out of
	  line.

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

	Add infrastructure for out-of-line JIT compilation of slow paths
	* libguile/jit.c (struct pending_reloc): Rename target_vcode_offset
	  field to target_label_offset.
	  (inline_label_offset, slow_label_offset): New helpers.
	  (emit_direct_tail_call): Use inline_label_offset helper.
	  (add_pending_reloc): Factor out of add_inter_instruction_patch.
	  (add_inter_instruction_patch): Use inline_label_offset helper.
	  (add_slow_path_patch): New helper.
	  (continue_after_slow_path): New helper.

	  Add slow path compilers for all instructions.

	  (compile_slow_path): New helper.
	  (compile): Compile slow paths after main code.
	  (compute_mcode): Allocate twice as many labels.

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

	Remove vm->sp_min_since_gc
	* libguile/jit.c (emit_alloc_frame_for_sp):
	* libguile/vm-engine.c (ALLOC_FRAME, RESET_FRAME):
	* libguile/vm.c (vm_increase_sp, scm_i_vm_prepare_stack):
	  (return_unused_stack_to_os, vm_expand_stack, alloc_frame):
	  (scm_call_with_stack_overflow_handler):
	* libguile/vm.h (struct scm_vm): Remove sp_min_since_gc handling.  It
	  was a very minor optimization when it was centralized in vm.c, but now
	  with JIT it's causing too much duplicate code generation.

	Reduce quo, rem, mod for power-of-two divisors
	* module/language/cps/type-fold.scm (power-of-two?): New helper.
	  (quo, rem, mod): New reducers for when the denominator is a power of
	  two.

	Allow for inexact integers in quo, rem, and so on
	* module/language/cps/types.scm (&integer): New helper definition.
	  (quo, rem, mod): Fix to allow inexact integer results :(
	  (even?): Allow inexact integer arguments.

2019-12-09  Ludovic Courtès  <ludo@gnu.org>

	Fix non-deterministic crash in 'finalization_thread_proc'.
	Fixes <https://bugs.gnu.org/37757>.
	Reported by Jesse Gibbons <jgibbons2357@gmail.com>.

	* libguile/finalizers.c (finalization_thread_proc): Do not enter the
	"switch (data.byte)" condition when data.n <= 0.

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

	Fix JIT tier-up from within loops for already-JIT-compiled functions
	* libguile/jit.c (scm_jit_compute_mcode): If a caller wants mcode for a
	  loop but the function already has mcode, instead of punting, just
	  compile again.

2019-12-06  Andy Wingo  <wingo@pobox.com>

	Fix resolve-r6rs-interface to propagate replacement flags
	* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface): Fix to
	  propagate module-replacements correctly for custom interfaces.

2019-12-06  Daniel Llorens  <lloda@sarc.name>

	Single definition of (iota)
	* module/ice-9/boot-9.scm (iota): Fix to be SRFI-1 compatible.
	* module/srfi/srfi-1.scm: Re-export iota.

2019-12-06  Andy Wingo  <wingo@pobox.com>

	GNU Guile 2.9.6 (beta)
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to 2.9.6.

	Update NEWS for Guile 2.9.6
	* NEWS: Update, folding in old NEWS entries.

	Effects analysis treats the fixed parts of objects specially
	* module/language/cps/effects-analysis.scm (&header): New memory kind,
	  for the fixed parts of objects.  Distinguishing init-only memory
	  allows us to determine that vector-set! doesn't stomple
	  vector-length.
	  (annotation->memory-kind*): New helper, mapping references to fixed
	  offsets to &header.  Use for scm-ref/immediate et al.

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

	Allocations and raw mutating operations restrict to mutable types
	* module/language/cps/types.scm (annotation->mutable-type): New helper.
	  (allocate-words, allocate-words/immediate): Define objects of mutable
	  type.
	  (scm-set!/tag, scm-set!, scm-set!/immediate, word-set!)
	  (word-set!/immediate): Restrict to mutable types.

	Propagate replacement flag for autoload interfaces
	* module/ice-9/boot-9.scm (make-autoload-interface): Propagate replaced
	  binding flags to autoload interface.

2019-12-02  Andy Wingo  <wingo@pobox.com>

	Add --r6rs and --r7rs options to "guild compile"
	* module/scripts/compile.scm (%options, compile): Add --r6rs and --r7rs
	  options.
	* doc/ref/api-evaluation.texi (Compilation): Add docs.

	Add guile-3, r6rs, r7rs cond-expand features
	* module/ice-9/boot-9.scm (%cond-expand-features): Add new features.
	* doc/ref/srfi-modules.texi (SRFI-0): Document new features.

2019-11-29  Andy Wingo  <wingo@pobox.com>

	Associate #:replace info with modules, not variables
	* doc/ref/api-modules.texi (Creating Guile Modules): Document
	  #:re-export-and-replace.
	* module/ice-9/boot-9.scm (module-replacements): New module field.
	  (make-module, make-autoload-interface): Initialize replacements to an
	  empty hash table.
	  (resolve-interface): Propagate replacement info when making custom
	  interfaces.
	  (define-module): Parse a #:re-export-and-replace keyword arg.
	  (define-module*): Handle #:re-export-and-replace.
	  (module-export!, module-re-export!): Add a keyword arg to indicate
	  whether to replace or not.
	  (module-replace!): Call module-export! with #:replace? #t.
	  (duplicate-handlers): Update replace duplicate handler to look for
	  replacement info on the interfaces.
	* module/srfi/srfi-18.scm (srfi):
	* module/srfi/srfi-34.scm (srfi): Update to #:re-export-and-replace
	  raise-continuable as raise.

2019-11-27  Andy Wingo  <wingo@pobox.com>

	Fix range inference on division in unreachable code
	* module/language/cps/types.scm (div-result-range): It is possible for a
	  max value to be less than a minimum.  In this bug from zig:

	    (define (benchmark x)
	      (let loop ((count 0)
	                 (sum 0))
	        (if (= count 10)
	            (exact->inexact (/ sum 10)))
	        (loop (+ count 1) x)))

	  Here the first iteration gets peeled, and thus the first "if" can't be
	  true, because "count" is zero.  However on the true branch of the if,
	  range inference produces bogus ranges -- notably, the variable bound
	  to 10 is inferred to have a min of 10 and a max of 0.  This is fine,
	  because it's unreachable; but that then infects the division, because
	  the same variable bound to 10 is used there, resulting in division by
	  zero.

2019-11-27  Andy Wingo  <wingo@pobox.com>

	Fix frame-call-representation for callees without closures
	* module/system/vm/assembler.scm (<arity>): Add new "has-closure?"
	  flag.
	  (begin-kw-arity, pack-arity-flags, write-arities): Write
	  "elided-closure?" flag into binary.  A negative flag for compat
	  reasons.
	* module/system/vm/debug.scm (elided-closure?, arity-has-closure?): Add
	  arity-has-closure? accessor.
	* module/system/vm/frame.scm (frame-call-representation): Count from 0
	  for callees with elided closures.

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

	Fix range inference for right-shifts
	* module/language/cps/types.scm (compute-ash-range): Fix rsh range
	  inference, broken during refactoring.  Fixes
	  https://bugs.gnu.org/38369.

2019-11-25  Andy Wingo  <wingo@pobox.com>

	Fix port-position documentation
	* doc/ref/r6rs.texi (rnrs io ports): Update the translation for
	  port-position.

	Fix stack overflow if printing a pre-boot error throws an error
	* libguile/throw.c (scm_throw): Fall back to fprintf if all is lost.

2019-11-22  Andy Wingo  <wingo@pobox.com>

	GNU Guile 2.9.5.
	* GUILE-VERSION: Bump to 2.9.5.

	Fix texinfo in r7rs.texi
	* doc/ref/r7rs.texi (R7RS Standard Libraries): Fix syntax.

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

	Install exception converters and printers from boot-9
	* doc/ref/intro.texi (Guile and Scheme): Fix a date.
	* module/ice-9/boot-9.scm: Load (ice-9 exceptions).

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

	ports: 'scm_port_poll' honors "w" flags.
	Fixes <https://bugs.gnu.org/36709>.
	Reported by Mark H Weaver <mhw@netris.org>.

	* libguile/ports.c (scm_port_poll): Replace second POLLIN by POLLOUT.

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

	Add NEWS for R7RS
	* NEWS: Support R7RS.

	Add R7RS documentation and --r7rs command-line option
	* doc/ref/Makefile.am: Add r7rs.texi.
	* doc/ref/guile-invoke.texi (Command-line Options): Document --r7rs.
	* doc/ref/guile.texi (Guile Modules): Link to R7RS.
	* doc/ref/intro.texi (Guile and Scheme): Update for R7RS support.
	* doc/ref/r7rs.texi: New file.
	* doc/ref/scheme-intro.texi (Guile Scheme): Update for R7RS.
	* module/ice-9/command-line.scm (*usage*, compile-shell-switches): Add
	  --r7rs option.

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

	Add R7RS xfails due to a restriction in hungry-eol-escapes (#38239)
	* test-suite/tests/r7rs.test ("https://bugs.gnu.org/38239"): Add more
	  xfails.

	Add R7RS xfails due to Guile's ( . 42) syntax extension
	* test-suite/tests/r7rs.test ("https://bugs.gnu.org/38238"): Add new
	  xfails.

	Add R7RS xfails due to https://bugs.gnu.org/38237 (i/o exn types)
	* test-suite/tests/r7rs.test ("https://bugs.gnu.org/38237"): Add more
	  expected failures.

	Add R7RS XFAILs due to https://bugs.gnu.org/38236 (datum labels)
	* test-suite/tests/r7rs.test (failing-test-with-exception): New form.
	  ("https://bugs.gnu.org/38236"): Mark a couple more xfails.

	Add expected failure for R7RS test due to https://bugs.gnu.org/38235
	* test-suite/tests/r7rs.test (failing-test): New form.
	  ("https://bugs.gnu.org/38235"): New failing test.

	Add r7rs test
	* test-suite/tests/r7rs.test: New file, based on tests from Chibi
	  Scheme, by Alex Shinn.  There are a few failing tests that a followup
	  will fix.

	Add install-r7rs!, like install-r6rs!
	* module/ice-9/boot-9.scm (install-r7rs!): New function.

	Add initial implementation of R7RS modules
	* module/Makefile.am (SOURCES): Add new files.
	* module/scheme/base.scm:
	* module/scheme/case-lambda.scm:
	* module/scheme/char.scm:
	* module/scheme/complex.scm:
	* module/scheme/cxr.scm:
	* module/scheme/eval.scm:
	* module/scheme/file.scm:
	* module/scheme/inexact.scm:
	* module/scheme/lazy.scm:
	* module/scheme/load.scm:
	* module/scheme/process-context.scm:
	* module/scheme/r5rs.scm:
	* module/scheme/read.scm:
	* module/scheme/repl.scm:
	* module/scheme/time.scm:
	* module/scheme/write.scm: New files.  Thanks to Göran Weinholt for
	  akku-scm and OKUMURA Yuki for yuni, off of which some of these files
	  were based.

	Allow equality between arrays of vu8 and u8
	* libguile/array-map.c (scm_array_equal_p): Treat vu8 and u8 arrays as
	  equivalent.

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

	Update NEWS for records and exceptions work
	* NEWS: Update.
	* doc/ref/api-data.texi (Records): Fix a typo.

	SRFI-18 uses core exceptions
	* module/ice-9/boot-9.scm (exception-kind, exception-args): Export.
	* module/ice-9/exceptions.scm (exception-kind, exception-args):
	  Re-export.
	* module/srfi/srfi-18.scm: Rewrite exception support in terms of core
	  exceptions, not SRFI-34/35.
	* test-suite/tests/srfi-18.test: Since Guile doesn't expose the current
	  exception handler as such, SRFI-18 captures it using delimited
	  continuations.  This means that we can't compare the result
	  of (current-exception-handler) with the installed handler using eq?,
	  even though the procedures are indeed equivalent.  So, instead test
	  handler behavior.

2019-11-13  Andy Wingo  <wingo@pobox.com>

	Update documentation for with-exception-handler et al
	* doc/ref/api-control.texi (Prompt Primitives): Reference the newer
	  exception facilities.
	  (Exceptions): Rewrite to use the new exception primitives.
	  (Exception Terminology): Remove superfluous section.
	  (Exception Objects): New section.
	  (Raising and Handling Exceptions): New section.
	  (Throw and Catch): New section, coalescing the previous catch,
	  with-throw-handler, and throw sections.
	  (Exceptions and C): New section, for miscellaneous procedures.
	  (Handling Errors): Mention the transitional period regarding exception
	  handling.
	* doc/ref/api-debug.texi (Catching Exceptions): Rewrite to use newer
	  exception facilities.
	  (Capturing Stacks): Remove, as it's not really recommendable any
	  more.
	  (Pre-Unwind Debugging): Rewrite to use the new primitives.
	  (Standard Error Handling): Add note about transitional status.
	  (Stack Overflow): Reference new exception section.
	* doc/ref/api-scheduling.texi (Mutexes and Condition Variables):
	  Reference new exception section.
	* doc/ref/r6rs.texi (rnrs exceptions, rnrs conditions): Update to
	  mention compatibility with SRFI-34/35 and to relate to core
	  exceptions.
	* doc/ref/srfi-modules.texi (SRFI-34): Document.

	Rebase throw/catch on top of raise-exception/with-exception-handler
	* libguile/exceptions.c:
	* libguile/exceptions.h: New files.
	* libguile.h: Add exceptions.h.
	* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Add exceptions.c and
	  exceptions.h.
	* libguile/init.c (scm_i_init_guile): Initialize exceptions.
	* libguile/threads.c (scm_spawn_thread): Use new names for
	  scm_i_make_catch_handler and scm_c_make_thunk.
	* libguile/throw.c: Rewrite to be implemented in terms of
	  with-exception-handler / raise-exception.
	* libguile/throw.h: Use data types from exceptions.h.  Move
	  scm_report_stack_overflow and scm_report_out_of_memory to
	  exceptions.[ch].
	* module/ice-9/boot-9.scm (&error, &programming-error)
	  (&non-continuable, make-exception-from-throw, raise-exception)
	  (with-exception-handler): New top-level definitions.
	  (throw, catch, with-throw-handler): Rewrite in terms of
	  with-exception-handler and raise-exception.
	: New top-level definitions.
	* module/ice-9/exceptions.scm: Adapt to re-export &error,
	  &programming-error, &non-continuable, raise-exception, and
	  with-exception-handler from boot-9.
	  (make-quit-exception, guile-quit-exception-converter): New exception
	  converters.
	  (make-exception-from-throw): Override core binding.
	* test-suite/tests/eval.test ("inner trim with prompt tag"): Adapt to
	  "with-exception-handler" being the procedure on the stack.
	  ("outer trim with prompt tag"): Likewise.
	* test-suite/tests/exceptions.test (throw-test): Use pass-if-equal.
	* module/srfi/srfi-34.scm: Reimplement in terms of core exceptions, and
	  make "guard" actually re-raise continuations with the original "raise"
	  continuation.

2019-11-07  Andy Wingo  <wingo@pobox.com>

	Remove boot "catch" definition.
	* libguile/throw.c (scm_init_throw): Remove boot definition of "catch".

	Move exceptions with key and args to core
	* module/ice-9/boot-9.scm (&exception-with-key-and-args)
	  (&quit-exception): New definitions.
	* module/ice-9/exceptions.scm (make-guile-exception):
	  (guile-exception?, guile-exception-key, guile-exception-args): Update
	  definitions.

	Move the core of exception objects into core
	* module/ice-9/boot-9.scm (&exception, &compound-exception)
	  (simple-exceptions, make-exception, exception?, exception-type?)
	  (make-exception-type, exception-predicate, exception-accessor): Move
	  these definitions into core, from (ice-9 exceptions).
	* module/ice-9/exceptions.scm: Re-export definitions from core.

	Move exception-handling routines after records in boot-9
	* module/ice-9/boot-9.scm: Move down definitions of catch, throw, and so
	  on until they are after records.

	Move false-if-exception down in boot-9
	* module/ice-9/boot-9.scm (false-if-exception): Move down.

2019-11-05  Andy Wingo  <wingo@pobox.com>

	Move adapter between "throw" and "raise" exceptions into core
	* module/ice-9/exceptions.scm (&guile):
	  (default-guile-exception-converter):
	  (guile-common-exceptions):
	  (convert-guile-exception):
	  (&raise-object-wrapper):
	  (make-raise-object-wrapper):
	  (raise-object-wrapper?):
	  (raise-object-wrapper-obj):
	  (raise-object-wrapper-continuation):
	  (raise-exception):
	  (raise-continuable):
	  (with-exception-handler):
	  (exception-printer):
	  (format-exception):
	  (format-simple-exception):
	  (%exception):
	  (guile-syntax-error-converter):
	  (guile-lexical-error-converter):
	  (guile-assertion-failure-converter):
	  (guile-undefined-variable-error-converter):
	  (guile-implementation-restriction-converter):
	  (guile-external-error-converter):
	  (guile-system-error-converter):
	  (guile-exception-converters):
	  (set-guile-exception-converter!): Move here, from (rnrs exceptions).
	* module/rnrs/exceptions.scm: Re-export bindings from (ice-9
	  exceptions).

2019-11-04  Andy Wingo  <wingo@pobox.com>

	Rebase SRFI-35 on top of (ice-9 exceptions)
	* module/ice-9/exceptions.scm (exception-type?): New export.
	* module/srfi/srfi-35.scm: Rewrite in terms of (ice-9 exceptions).

2019-11-03  Andy Wingo  <wingo@pobox.com>

	Add (ice-9 exceptions) module
	* module/ice-9/exceptions.scm: New file, derived from (rnrs
	  conditions).  Perhaps unadvisedly, in this file I've renamed a number
	  of the identifiers.  I have never found that the R6RS identifiers made
	  sense to me.  For now this is an internal module that R6RS and SRFI-35
	  will be based on.
	* module/Makefile.am (SOURCES): Add the new file.
	* module/rnrs/conditions.scm (rnrs): Export renamed identifiers
	  from (ice-9 exceptions).

	Add `record-type-has-parent?'.
	* module/ice-9/boot-9.scm (record-type-has-parent?): New function.
	* module/srfi/srfi-35.scm (condition-type?): Use it.

2019-10-30  Andy Wingo  <wingo@pobox.com>

	Remove circularity in r6rs by rebasing conditions on core records
	* module/rnrs/conditions.scm: Use core record facilities to define the
	  base condition types, define-condition-type, and the standard
	  condition hierarchy.
	  (simple-condition?): Rename from condition-internal?.
	* module/rnrs/exceptions.scm: Move `raise' definition here, out from the
	  procedural records layer.
	  (format-simple-condition): Reimplement in a simpler way, hopefully
	  producing the same output.
	* module/rnrs/records/procedural.scm:
	* module/rnrs/records/inspection.scm: Import the exceptions and
	  conditions modules, and use the normal raise function.

2019-10-29  Andy Wingo  <wingo@pobox.com>

	Rebase R6RS records on top of core records
	* module/ice-9/boot-9.scm (record-type-uid): New accessor.
	  (make-record-type): Record UID in record type properties.
	* module/rnrs/conditions.scm (define-condition-type): Fix invalid
	  invocation of make-record-type.
	* module/rnrs/records/inspection.scm: Rewrite to use core record
	  inspection facilities.
	* module/rnrs/records/procedural.scm: Rewrite to use core
	  make-record-type.  Incidentally the result is that instances of
	  derived R6RS record types are now flat instead of nested.
	* test-suite/tests/r6rs-records-procedural.test
	  ("make-record-type-descriptor"): Relax a couple condition type checks,
	  while we redo the exception system.

	Add record-type-parent definition.
	* module/ice-9/boot-9.scm (record-type-parent): New definition.

2019-10-28  Andy Wingo  <wingo@pobox.com>

	Add support for immutable fields in core records
	* module/ice-9/boot-9.scm (make-record-type): Allow (mutable NAME)
	  or (immutable NAME) as a field name, and record field mutability in a
	  bitfield.
	  (record-modifier): Throw an error if the field isn't mutable.
	* test-suite/tests/records.test ("records"): Add tests.
	* doc/ref/api-data.texi (Records): Update.

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

	Rename final? record type flag; add support for opaque?
	* module/ice-9/boot-9.scm (record-type-extensible?): Rename from
	  record-type-final?, with the opposite sense.
	  (record-type-opaque?): New accessor.
	  (make-record-type): Change #:final? to #:extensible?, with the
	  opposite meaning.  Add #:opaque? arg.
	* test-suite/tests/records.test ("records"): Add opaque tests; update
	  extensible tests.
	* doc/ref/api-data.texi (Records): Update.
	* module/srfi/srfi-35.scm (&condition, make-condition-type): Update for
	  make-record-type API change.

	Guile `make-record-type' supports non-generative definition
	* module/ice-9/boot-9.scm (prefab-record-types): New definition.
	  (make-record-type): Add #:uid keyword.
	* test-suite/tests/records.test ("records"): Add tests.
	* doc/ref/api-data.texi (Records): Document #:uid

	Change record type "flags" field to "properties"
	* module/ice-9/boot-9.scm (record-type-properties): Rename from
	  record-type-flags.
	  (record-type-final?): New accessor.
	  (make-record-type):
	  (define-record-type):
	* test-suite/tests/records.test ("records"): Adapt.

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

	Fix one remaining use of make-record-type with string type name
	* test-suite/tests/gc.test ("weak-values versus records"): Fix to pass a
	  symbol.

	Rebase srfi-35 conditions on top of make-record-type
	* module/srfi/srfi-35.scm: Import (ice-9 match), and remove now-unused
	  srfi-1 import.
	  (print-condition): Print more like records, as appears to be the
	  intention.
	  (&condition): Define using make-record-type.  Adapt all callers.
	  Also, compound conditions are now a disjoint type, handled specially
	  by condition-ref, condition?, and so on.
	* test-suite/tests/srfi-35.test (v3): Fix an error in which a
	  subcondition was initialized without initializers for all of its
	  fields.

	make-record-type does more validation on the fields
	* module/ice-9/boot-9.scm (make-record-type): Validate that the fields
	  are a unique list of symbols.  Deprecate passing a string as a type
	  name.
	* module/system/base/syntax.scm (define-record): Update to pass a symbol
	  as a type name.
	* test-suite/tests/records.test (rtd-foo, rtd-fŏŏ, "records"): Adapt to
	  make record types with symbol names.

	SRFI-9 uses make-record-type
	* module/srfi/srfi-9.scm (%define-record-type): Use make-record-type,
	  instead of rolling our own vtable.  Shouldn't have any perf impact.

2019-10-22  Andy Wingo  <wingo@pobox.com>

	Record accessors respect subtyping
	* module/ice-9/boot-9.scm (make-record-type): Don't allow subtyping of
	  final types.
	  (%record-type-error): Remove helper.
	  (record-accessor, record-modifier): Use computed record type
	  predicate, to allow for subtyping.
	  (define-record-type): Adapt to %record-type-error going away; these
	  types are final so no accessor adaptation is needed.
	* test-suite/tests/records.test: Add tests.
	* doc/ref/api-data.texi (Records): Update.

	Allow records to be subtyped
	* module/ice-9/boot-9.scm (record-type-vtable): Add slots for "flags"
	  and a parent vector.
	  (record-type-name, record-type-fields): Move up in the file.
	  (record-type-constructor, record-type-flags, record-type-parents): New
	  accessors.
	  (make-record-type): Take #:final? and #:parent keyword arguments.
	  (record-constructor): Delegate to record-type-constructor.
	  (record-predicate): For non-final types --types that can be extended
	  by subtyping -- implement an O(1) type predicate.
	  (define-record-type): Initialize the new fields.
	* module/srfi/srfi-9.scm (%define-record-type): Initialize flags and
	  parent fields.

	Fix deprecated 1-arg `make-module' in tests
	* test-suite/tests/modules.test ("circular imports"): Use nullary
	  make-module.

	Deprecate two-arg `record-constructor'
	* module/ice-9/boot-9.scm (record-constructor): Deprecate the two-arg
	  form.

	Re-implement (ice-9 gap-buffer) records in terms of srfi-9
	* module/ice-9/gap-buffer.scm (gap-buffer): Use srfi-9.

2019-10-21  Andy Wingo  <wingo@pobox.com>

	Remove (ice-9 channel)
	* module/ice-9/channel.scm: Remove.  This file has had a bug since
	  2.0 or so that prevented loading the module; I can only conclude that
	  it hasn't worked for years.
	* module/Makefile.am (SOURCES): Remove ice-9/channel.scm.

	Refactor PEG records
	* module/ice-9/peg/using-parsers.scm (prec): Use SRFI-9 to define PEG
	  record types.
	  (peg:start, peg:end, peg:string, peg:tree, peg:substring): Implement
	  in a more efficient way.

2019-09-27  Andy Wingo  <wingo@pobox.com>

	Extend `import' to allow R7RS-style srfi references
	* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface): Allow for
	  srfis to be accessed via (srfi 42 foo) in addition to (srfi :42 foo).

	(ice-9 safe-r5rs) fixes for bound aux syntax
	* module/ice-9/safe-r5rs.scm: Define local versions of `case' and `cond'
	  that assume aux syntax is unbound.  If this doesn't work, we can
	  switch to exporting aux syntax.
	* module/ice-9/top-repl.scm (top-repl): Don't add (ice-9 r5rs) to the
	  REPL environment.

	(ice-9 null) also exports aux syntax, syntax-rules
	* module/ice-9/null.scm: Add more syntactic exports.

	Deprecate passing a non-zero size to make-module
	* module/ice-9/boot-9.scm (make-module): Issue a deprecation warning if
	  users pass a non-zero size.
	  (nested-define-module!, make-modules-in, beautify-user-module!)
	  (resolve-interface, make-autoload-interface, %cond-expand-table):
	* module/ice-9/popen.scm (port/pid-table):
	* module/ice-9/session.scm (make-fold-modules):
	* module/language/ecmascript/function.scm (*program-wrappers*):
	* module/scripts/api-diff.scm (read-api-alist-file):
	* module/srfi/srfi-10.scm (reader-ctors): Update callers.  Also remove
	  some make-hash-table sizes.

	(ice-9 null) also re-exports core aux syntax
	* module/ice-9/null.scm: Re-export _, else, =>, and the ellipsis.

	Avoid mutating arguments to resolve-interface
	* module/ice-9/boot-9.scm (resolve-interface): This function used to
	  mutate the #:hide argument, which results in terrorism if the value is
	  a literal.

2019-09-27  Andy Wingo  <wingo@pobox.com>

	Remove "vm" tests
	These tests are no longer useful.

	* configure.ac:
	* test-suite/Makefile.am: Remove mentions.
	* test-suite/vm/Makefile.am:
	* test-suite/vm/run-vm-tests.scm:
	* test-suite/vm/t-basic-contructs.scm:
	* test-suite/vm/t-call-cc.scm:
	* test-suite/vm/t-catch.scm:
	* test-suite/vm/t-closure.scm:
	* test-suite/vm/t-closure2.scm:
	* test-suite/vm/t-closure3.scm:
	* test-suite/vm/t-closure4.scm:
	* test-suite/vm/t-do-loop.scm:
	* test-suite/vm/t-global-bindings.scm:
	* test-suite/vm/t-literal-integers.scm:
	* test-suite/vm/t-macros.scm:
	* test-suite/vm/t-macros2.scm:
	* test-suite/vm/t-map.scm:
	* test-suite/vm/t-match.scm:
	* test-suite/vm/t-mutual-toplevel-defines.scm:
	* test-suite/vm/t-or.scm:
	* test-suite/vm/t-proc-with-setter.scm:
	* test-suite/vm/t-quasiquote.scm:
	* test-suite/vm/t-records.scm:
	* test-suite/vm/t-values.scm: Remove.

2019-09-27  Andy Wingo  <wingo@pobox.com>

	Adapt ftw.test for pending test-suite changes
	* test-suite/tests/ftw.test ("file-system-fold"): Check "standalone"
	  instead of "vm".

	Fix doc syntax error
	* doc/ref/r6rs.texi (R6RS Incompatibilities): Fix syntax error.

	Better R6RS compatibility
	* module/ice-9/boot-9.scm (install-r6rs!): Also enable
	  `hungry-eol-escapes'.
	* doc/ref/r6rs.texi (R6RS Incompatibilities): Document lack of unicode
	  escapes in symbols.

2019-09-25  Andy Wingo  <wingo@pobox.com>

	Add --r6rs NEWS
	* NEWS: Add --r6rs news.

	Add --r6rs command-line option
	* doc/ref/guile-invoke.texi (Command-line Options): Document --r6rs.
	* doc/ref/r6rs.texi (R6RS Incompatibilities): Mention that --r6rs calls
	  install-r6rs!.
	* module/ice-9/command-line.scm (*usage*, compile-shell-switches):
	  Implement --r6rs.

	New function: install-r6rs!
	* doc/ref/r6rs.texi (R6RS Incompatibilities): Document install-r6rs!.
	* module/ice-9/boot-9.scm (install-r6rs!): New function.

2019-09-19  Andy Wingo  <wingo@pobox.com>

	Update NEWS for 2.9.5
	* NEWS: Update.

	Add documentation for else, =>, _, ... aux syntax
	* doc/ref/api-macros.texi (Syntax Rules): Document aux syntax.

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

	Define top-level bindings for aux syntax: else, =>, _, ...
	* module/ice-9/boot-9.scm (else, =>, ..., _): New definitions.  These
	  are specified by the r6rs and the r7rs.
	* module/ice-9/sandbox.scm (core-bindings): Include the aux syntax
	  definitions.
	* module/rnrs/base.scm:
	* module/rnrs.scm: Re-export aux syntax.

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

	Use "G_" as the conventional alias for gettext
	Since the change in 2.2 noted in the NEWS as "Fix literal matching for
	module-bound literals", defining `_' makes `syntax-rules' and `match'
	fail to recognize `_' as the catch-all literal.  This change adapts the
	recommendations to current practice in 2.2, as users have had to adapt
	to this change.

	* doc/ref/api-i18n.texi (Gettext Support): Update documentation.
	* module/language/tree-il/analyze.scm (proc-ref?, gettext?): G_ is the
	  conventional abbreviation, not _.
	* test-suite/tests/tree-il.test: Adapt.
	* module/ice-9/command-line.scm: Use G_ instead of _.

2019-09-01  Andy Wingo  <wingo@pobox.com>

	Optimize fixnum or s64 -> f64 conversions
	* libguile/intrinsics.c (scm_bootstrap_intrinsics):
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add "inexact"
	  intrinsic.
	* libguile/jit.c (compile_s64_to_f64): New compiler.
	* libguile/vm-engine.c (s64->f64): New instruction.
	* module/language/cps/effects-analysis.scm (heap-numbers-equal?):
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/specialize-numbers.scm (fixnum->f64):
	  (specialize-operations):
	* module/language/cps/type-fold.scm (scm->f64, inexact):
	* module/language/cps/types.scm (inexact, s64->f64):
	* module/language/tree-il/cps-primitives.scm (exact->inexact):
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect-free-primitives*):
	* module/system/vm/assembler.scm: Recognize exact->inexact as a
	  primitive, and optimize it.  Add compiler support for new "inexact"
	  and "s64->f64" primcalls.

2019-08-29  Daniel Llorens  <lloda@sarc.name>

	Have disassemble-file accept an optional output port
	* module/system/vm/disassembler.scm (disassemble-file): As stated.

2019-08-28  Andy Wingo  <wingo@pobox.com>

	At optimization level -O3, seal declarative module-private bindings
	* module/language/tree-il/letrectify.scm (compute-private-toplevels):
	  New function; computes the subset of declarative bindings that are
	  private to a module.  If the module exports a macro, all bindings are
	  public, as we have no way to know what binding might be exported.
	 (letrectify): Add #:seal-private-bindings? keyword arg.  If true, avoid
	  making boxes for private definitions.
	* module/language/tree-il/optimize.scm (optimize): Add
	  -Oseal-private-bindings, enabled at -O3.

	Emit warning when using "load" in declarative modules
	* module/ice-9/boot-9.scm (load): Emit a warning at compile-time when
	  using "load" from a declarative module.

	Fix bug in CSE auxiliary definitions
	* module/language/cps/cse.scm (compute-equivalent-subexpressions): When
	  CSE sees a definition like `(cons a b)', it will also record an
	  "auxiliary definition" for `(car x)', where x is the variable defined
	  by the cons, whereby calling `(car x)' can reduce to `a' if there is
	  no intervening effect that clobbers the definitions.  However, when
	  the successor of the cons is a control-flow join, then any variables
	  defined there have multiple definitions.  It's incorrect to add the
	  aux definition in that case.
	* test-suite/tests/compiler.test ("cse auxiliary definitions"): New
	  test.

2019-08-26  Andy Wingo  <wingo@pobox.com>

	Compiler allocates boxed flonums in unmarked space
	This fixes a bug whereby the compiler would sometimes allocate floats in
	marked space.

	* libguile/gc-inline.h (scm_inline_gc_malloc_pointerless_words): New
	  internal helper.
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/intrinsics.c (allocate_pointerless_words):
	  (allocate_pointerless_words_with_freelist): New intrinsics.
	* libguile/jit.c (compile_allocate_pointerless_words):
	  (compile_allocate_pointerless_words_immediate): New compilers.
	* libguile/vm-engine.c (allocate_pointerless_words)
	  (allocate_pointerless_words_immediate): New opcodes.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm (param):
	* module/language/cps/reify-primitives.scm (reify-primitives):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	* module/language/cps/types.scm (allocate-words):
	(allocate-words/immediate):
	* module/system/vm/assembler.scm (system): Add support for the new
	  opcodes.

2019-08-25  Andy Wingo  <wingo@pobox.com>

	GNU Guile 2.9.4 (alpha).
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.

	Fix out-of-memory test for top-level inlining
	* test-suite/standalone/test-out-of-memory: Prevent the test harness
	  from being inlined.  If the test harness is inlined, it might cause
	  the optimizer to omit the allocations being tested!

	Fix fatan2 intrinsic initialization
	* libguile/intrinsics.c (scm_bootstrap_intrinsics): Fix fatan2
	  initialization.

	Further NEWS tweaks
	* NEWS: Clarify wording.

	Update documentation for mixed definitions and expressions
	* NEWS: Update.
	* doc/ref/api-binding.texi (Internal Definitions): Update to mention
	  that mixed definitions and expressions are allowed.
	* doc/ref/scheme-ideas.texi (Creating a Procedure):
	  (Lambda Alternatives): Update documentation to avoid implying that
	  bodies are only expressions.

2019-08-25  Andy Wingo  <wingo@pobox.com>

	Allow mixed local definitions and expressions
	This change to the expander allows mixed local definitions and
	expressions.  The expansion turns:

	  (let () (a) (define (b) 42) (b) (b))

	into:

	  (let ()
	    (letrec* ((t0 (begin (a) (if #f #f)))
	              (b (lambda () 42)))
	      (b)))

	Which is to say, expressions that precede definitions are expanded as
	definitions of a temporary via (begin EXP (if #f #f)).

	* module/ice-9/psyntax.scm (expand-body): Allow mixed definitions and
	  expressions.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* test-suite/tests/syntax.test: Add a couple tests and update for new
	  error messages.

2019-08-25  Andy Wingo  <wingo@pobox.com>

	Letrectify only on -O2; update docs
	* doc/ref/api-evaluation.texi (Compilation): Document the -O options.
	* doc/ref/api-modules.texi (Using Guile Modules): @@ docs refer to
	  declarative modules.
	  (Creating Guile Modules): Use when for 1-armed if.
	  (Declarative Modules): Make implications of declarative bindings more
	  explicit, and explicitly document ways to disable the optimization.
	* module/language/tree-il/optimize.scm (tree-il-optimizations): Punt
	  letrectification to -O2.

2019-08-24  Andy Wingo  <wingo@pobox.com>

	Revert "Revert scm_c_make_char rename"
	My reversion of Mark's commit was in error; the supposed ABI change was
	never released.

	This reverts commit 3925a64682be333af2e8d15e8173f06d3272f4e4.

2019-08-24  Andy Wingo  <wingo@pobox.com>

	Unbox floor/ceiling and trigonometric functions where possible
	* libguile/intrinsics.c (scm_atan1): New intrinsic, wrapping scm_atan.
	  (scm_bootstrap_intrinsics): Add new intrinsics.
	* libguile/intrinsics.h (scm_t_f64_from_f64_f64_intrinsic): New
	  intrinsic type.
	  (SCM_FOR_ALL_VM_INTRINSICS): Add intrinsics for floor, ceiling, sin,
	  cos, tan, asin, acos, atan, and their unboxed counterparts.
	* libguile/jit.c (sp_f64_operand): New helper.
	  (compile_call_f64_from_f64, compile_call_f64_from_f64_f64): Call out
	  to intrinsics.
	* libguile/vm-engine.c (call-f64<-f64-f64): New opcode.
	* module/language/cps/effects-analysis.scm: Add new intrinsics.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add new intrinsics.
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  Add 'f64 slot types for the new unboxed intrinsics.
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Support unboxing the new intrinsics.
	* module/language/cps/types.scm: Define type inferrers for the new
	  intrinsics.
	* module/language/tree-il/cps-primitives.scm: Define CPS translations
	  for the new intrinsics.
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect-free-primitives*, atan): Define primitive resolvers.
	* module/system/vm/assembler.scm: Export assemblers for the new
	  intrinsics.
	  (define-f64<-f64-f64-intrinsic): New helper.

2019-08-19  Andy Wingo  <wingo@pobox.com>

	Fix the jitless fix
	* libguile/vm.c (capture_continuation): Use #if, not #ifdef, to test the
	  condition.

	Disable some JIT compilation code when JIT configured out
	* libguile/vm.c (vm_recompute_disable_mcode, capture_continuation):
	  Disable logic if JIT not configured.

2019-08-18  Andy Wingo  <wingo@pobox.com>

	Define missing shuffling assembler for string-set! et al
	* module/system/vm/assembler.scm (encode-X8_S8_S8_S8-C32!/shuffle):
	  Define shuffling assembler for this instruction type.

	Fix coverage test for top-level binding optimization
	* test-suite/tests/coverage.test ("line-execution-counts"): Fix
	  expectations for tail-call test.

	Skip tests that don't work under letrectification
	* test-suite/tests/srfi-64-test.scm: Skip a couple of tests that have
	  unspecified result due to eq? being unspecified on procedures.
	* module/language/tree-il/letrectify.scm (letrectify): Add a comment.

	Enable letrectification
	* module/language/tree-il/optimize.scm: Enable letrectification at -O1
	  and higher.

2019-08-18  Andy Wingo  <wingo@pobox.com>

	Add notion of declarative modules
	* doc/ref/api-modules.texi (Declarative Modules): New subsection.
	* module/ice-9/boot-9.scm (module): Change eval-closure slot, which was
	  deprecated and unused, to be a "declarative?" slot, indicating that
	  definitions from the module are declarative.
	  (user-modules-declarative?): New parameter.
	  (make-fresh-user-module): Set declarative according to parameter.
	  (define-module*, define-module): Add #:declarative? keyword argument,
	  defaulting to the value of user-modules-declarative? parameter when
	  the module was expanded.
	  (guile-user): This module is not declarative.

	* module/language/tree-il/letrectify.scm (compute-declarative-toplevels):
	  Use the new declarative? module flag.

2019-08-18  Andy Wingo  <wingo@pobox.com>

	Add letrectify tree-il pass
	* module/language/tree-il/letrectify.scm: New pass, not wired up yet.
	  Adds lexical definitions for declarative top-level definitions, for
	  better inlining and contification within a compilation unit.
	* am/bootstrap.am:
	* module/Makefile.am: Add to build.

	Add primitive support for working with module variables
	* module/language/tree-il/compile-cps.scm (%box-ref, %box-set!): New
	  expanders.
	  (box-ref, box-set!): Expand in terms of %box-ref, %box-set!.
	* module/language/tree-il/cps-primitives.scm (%variable-ref):
	(%variable-set!, module-ensure-local-variable!): New primitives.
	* module/language/tree-il/effects.scm (make-effects-analyzer):
	  Understand effects of new primitives.
	* module/language/tree-il/primitives.scm (define!):
	(module-define!): Define expanders.

	Simplify the define-primitive-expander macro
	* module/language/tree-il/primitives.scm (primitive-expander):
	(define-primitive-expander!): New helpers.
	(define-primitive-expander): Rewrite in terms of syntax-case.
	(error, make-vector, eqv?, equal?, call-with-prompt)
	(abort-to-prompt*, abort-to-prompt): Use new helper.

2019-08-18  Andy Wingo  <wingo@pobox.com>

	Add "mod" field to tree-il toplevel ref, set, define
	Add "mod" field to <toplevel-ref>, <toplevel-set>, and
	<toplevel-define>, indicating the expander's idea of what the current
	module is when a toplevel variable is accessed or created.  This will
	help in later optimizations.

	* libguile/expand.c (TOPLEVEL_REF, TOPLEVEL_SET, TOPLEVEL_DEFINE)
	  (expand, expand_define, expand_set_x, convert_assignment):
	* libguile/expand.h (SCM_EXPANDED_TOPLEVEL_REF_FIELD_NAMES):
	(SCM_MAKE_EXPANDED_TOPLEVEL_REF, SCM_EXPANDED_TOPLEVEL_SET_FIELD_NAMES):
	(SCM_MAKE_EXPANDED_TOPLEVEL_SET, SCM_EXPANDED_TOPLEVEL_DEFINE_FIELD_NAMES):
	(SCM_MAKE_EXPANDED_TOPLEVEL_DEFINE):
	* module/ice-9/compile-psyntax.scm (translate-literal-syntax-objects):
	* module/ice-9/psyntax-pp.scm:
	* module/ice-9/psyntax.scm:
	* module/language/tree-il.scm:
	* module/language/tree-il.scm (parse-tree-il, make-tree-il-folder):
	(pre-post-order):
	* module/language/tree-il/analyze.scm (goops-toplevel-definition):
	(macro-use-before-definition-analysis, proc-ref?, format-analysis):
	* module/language/tree-il/compile-cps.scm (convert):
	* module/language/tree-il/debug.scm (verify-tree-il):
	* module/language/tree-il/effects.scm (make-effects-analyzer):
	* module/language/tree-il/fix-letrec.scm (free-variables):
	* module/language/tree-il/peval.scm (peval):
	* test-suite/tests/tree-il.test: Adapt uses.

2019-08-18  Andy Wingo  <wingo@pobox.com>

	Fix bug in which codegen accessed data beyond end of stack
	* module/language/cps/compile-bytecode.scm (compile-function): When
	  shuffling return values, we need to reset the frame after any "extra"
	  values are read and before any "extra" values may be set.

2019-08-13  Andy Wingo  <wingo@pobox.com>

	More format refactorings.
	* module/ice-9/format.scm (format): Refactor naming of some local
	  variables.  Assigned variables get a % sigil before them.  Also, avoid
	  the mutable-error dance.

	More format refactors
	* module/ice-9/format.scm (format): Flatten all internal definitions,
	  except format-work.

	More format refactors
	* module/ice-9/format.scm (format): Use internal defines rather than
	  letrec, to prevent things from creeping rightwards so much.

	Refactor `format' to use when/unless conventionally
	* module/ice-9/format.scm (format): Update to make one-armed ifs use
	  when/unless.

	Update peval tests for fix-letrec
	* module/language/tree-il/fix-letrec.scm (fix-scc): Initial binding of
	  letrec values is unspecified, not false.
	* test-suite/tests/peval.test (pass-if-peval): Fix letrec before
	  pevalling.  Update tests.  A couple got better, no regressions.

	Update NEWS.
	* NEWS: Update.

	Run fix-letrec before peval
	* module/language/tree-il/optimize.scm (optimize): Change to run
	  fix-letrec before peval.  Also, run it unconditionally, so that later
	  passes don't have to deal with letrec.
	* module/language/tree-il/peval.scm (build-var-table, peval): Remove
	  letrec cases.

	Implement "Fixing Letrec (reloaded)"
	* module/language/tree-il/fix-letrec.scm: Update algorithm to use
	  approach from "Fixing Letrec (reloaded)", which sorts mutually
	  recursive bindings by using Tarjan's algorithm to partition the
	  bindings into strongly-connected components.  The result is that users
	  can use letrec* or internal definitions and get a result that is as
	  efficient as manual placement of let / letrec.

	Split graph utilities out of (language cps utils)
	* module/language/cps/graphs.scm: New file.
	* module/language/cps/utils.scm: Re-export functions from graphs.scm.
	* am/bootstrap.am:
	* module/Makefile.am: Add to build.

2019-08-04  Andy Wingo  <wingo@pobox.com>

	Add support for optimized unboxed abs and sqrt
	Some components of this have been wired up for a while; this commit
	finishes the compiler, runtime, and JIT support.

	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/intrinsics.c (scm_bootstrap_intrinsics): Declare the new
	  intrinsics.
	* libguile/jit.c (compile_call_f64_from_f64): Define code generators for
	  the new intrinsics.
	* libguile/vm-engine.c (call-f64<-f64): New instruction.
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	* module/language/tree-il/cps-primitives.scm (abs):
	* module/system/vm/assembler.scm (system, define-f64<-f64-intrinsic):
	  (sqrt, abs, fsqrt, fabs):
	* module/language/cps/types.scm (fsqrt, fabs): Add new f64<-f64
	  primitives.

2019-08-03  Andy Wingo  <wingo@pobox.com>

	GNU Guile 2.9.3 (alpha).
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.

	Fix some compiler warnings on 64-bit builds

2019-08-02  Andy Wingo  <wingo@pobox.com>

	Fix calls to handle-interrupts trampoline on ARMv7
	* libguile/jit.c (initialize_jit): Keep handle_interrupts_trampoline as
	  an address, not a function pointer.

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Revert scm_c_make_char rename
	This was, I think, an unintentional ABI change.
	Reverts 579dd2da449be194a95d41a27317a453c1aa0568.

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

	Merge from stable-2.2

2019-07-29  Andy Wingo  <wingo@pobox.com>

	Update NEWS for 2.9.3
	* NEWS: Update.

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

	build: Do not record LDFLAGS in .pc file.
	Fixes <https://bugs.gnu.org/36339>.
	Reported by Cyprien Nicolas <cyprien@nicolas.tf>.

	* configure.ac (GUILE_LIBS): Remove $LDFLAGS.

2019-06-30  Ludovic Courtès  <ludo@gnu.org>

	Bump version for Guile 2.2.6.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	(LIBGUILE_INTERFACE_REVISION): Increment.

	Update NEWS.
	* NEWS: Update.

	REPL server: Avoid deprecated '_IOFBF'.
	* module/system/repl/server.scm (drain-input-and-close): Use 'block
	instead of _IOFBF.

2019-06-30  Ludovic Courtès  <ludo@gnu.org>

	'strftime' and 'strptime' honor the locale encoding.
	Fixes <https://bugs.gnu.org/35920>.
	Reported by Christopher Lam <christopher.lck@gmail.com>.

	* libguile/stime.c (scm_strftime): Use 'scm_to_locale_stringn' instead
	of 'scm_to_utf8_stringn'.
	(scm_strptime): Likewise, and use 'scm_string_length' instead of
	'u8_strnlen'.
	* test-suite/tests/time.test ("strftime")["strftime passes wide
	characters"]: Wrap body in 'with-locale'.
	["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New tests.
	("strptime")["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New
	tests.

2019-06-30  Ludovic Courtès  <ludo@gnu.org>

	doc: Document optional parameter of 'stat'.
	Fixes <https://bugs.gnu.org/34860>.
	Reported by Tim Gesthuizen <tim.gesthuizen@yahoo.de>.

	* doc/ref/posix.texi (File System): Document 'exception_on_error'
	parameter of 'stat'.

2019-06-30  Ludovic Courtès  <ludo@gnu.org>

	tests: Add (web server) test.
	* test-suite/tests/web-server.test: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add it.

2019-06-30  Ludovic Courtès  <ludo@gnu.org>

	ports: Export 'current-load-port'.
	This binding was forgotten when (ice-9 ports) was introduced in
	44b3342c4d5ebd4bbf21c7c7608a5f1a53ba0eb4.  Thus it has always been
	missing in Guile 2.2.

	* module/ice-9/ports.scm: Export 'current-load-port'.

2019-06-24  Mark H Weaver  <mhw@netris.org>

	Revert "web: Add support for HTTP header continuation lines."
	Fixes <https://bugs.gnu.org/36350>.

	This reverts commit 73cde5ed7218a090ecee888870908af5445796f0.

2019-06-24  Paul Morris  <paul@paulwmorris.com>

	doc: Fix argument list in match-lambda docs
	* doc/ref/match.texi: Fix argument list for match-lambda.

2019-06-24  Arun Isaac  <arunisaac@systemreboot.net>

	doc: Fix minor typo in the HTTP headers documentation.
	* doc/ref/web.texi (HTTP Headers): Fix minor typo.

2019-06-24  Ludovic Courtès  <ludo@gnu.org>

	Remove references to 'inet-ntoa' and 'inet-aton'.
	These procedures were removed in Guile 2.2 by commit
	fc7bd367ab4b5027a7f80686b1e229c62e43c90b (May 2011).

	* libguile/socket.h (scm_inet_aton, scm_inet_ntoa): Remove.
	* module/system/repl/server.scm (make-tcp-server-socket): Use
	'inet-pton' instead of 'inet-aton'.
	* doc/ref/web.texi (HTTP): Likewise in 'declare-header!' example.
	* doc/ref/posix.texi (Network Address Conversion): Remove documentation
	of 'inet-ntoa' and 'inet-aton'.

2019-06-20  Andy Wingo  <wingo@pobox.com>

	Add an inlined jit fast-path for allocate-words/immediate
	* libguile/intrinsics.c (allocate_words_with_freelist)
	  (scm_bootstrap_intrinsics):
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): New intrinsic.
	* libguile/jit.c (compile_allocate_words_immediate): Add fast-path.
	  A marginal improvement.

	Inline freelist vectors into scm_thread
	* libguile/gc-inline.h:
	* libguile/threads.h (SCM_INLINE_GC_GRANULE_WORDS)
	  (SCM_INLINE_GC_GRANULE_BYTES, SCM_INLINE_GC_FREELIST_COUNT): Move
	  definitions here, from gc-inline.h.
	  (struct scm_thread): Inline freelist vectors.
	* libguile/threads.c (thread_mark): Update marker for pointerless
	  freelists.
	  (on_thread_exit): Clear individual freelist entries, instead of the
	  vector as a whole.
	  (guilify_self_2): No need to alloc freelist vectors.

	Rearrange scm_thread for better locality
	* libguile/threads.h (struct scm_thread): Move async-related bits up, so
	  that the VM can access them easier.  Likewise for freelists (which we
	  will inline soon).

	Fix compilation on GCC 5.5
	* libguile/jit.c (OLD_FP_FOR_RETURN_TRAMPOLINE): Initialize static const
	  var from CPP define instead of T0.
	  (compile_return_values, emit_return_to_interpreter_trampoline): Adapt
	  to upper-casing.

2019-06-20  Ludovic Courtès  <ludo@gnu.org>

	Bump version for Guile 2.2.5.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	(LIBGUILE_INTERFACE_CURRENT): Increment.
	(LIBGUILE_INTERFACE_AGE): Increment.
	(LIBGUILE_INTERFACE_REVISION): Reset.

	Copy terminating zero in 'scm_cat_path'.
	* libguile/script.c (scm_cat_path): Pass N + 1, not N, to 'strncat'.
	Reported by GCC 9.1.0.

	srfi-14: Fix possible buffer overrun in '%char-set-dump'.
	* libguile/srfi-14.c (scm_sys_char_set_dump): Change array size from 9
	to 11 as suggested by GCC 9.1.0.

2019-06-20  Andy Wingo  <wingo@pobox.com>

	Use call/return instructions for non-tail calls
	This change speeds up the indirect branches at return sites by taking
	advantage of the CPU's return address stack.

	* libguile/jit.c (emit_push_frame): Don't store the mra; we do that via
	  a trampoline.
	  (emit_handle_interrupts_trampoline): Take MRA from link register
	  instead of T0.
	  (compile_call, compile_call_label): Compute MRA via the new
	  jmpi_with_link lightening instruction.
	  (compile_return_values): Return to caller via ret instead of jmp.
	  (compile_handle_interrupts): Jump to handle-interrupts trampoline via
	  jmpi_with_link, to provide the MRA.
	  (initialize_jit): Bless the trampolines so that they are valid
	  operands to BX on ARM.

2019-06-20  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-06-20  Andy Wingo  <wingo@igalia.com>

	push/pop of link register does not affect stack size on x86
	* lightening/x86-cpu.c (pop_link_register, push_link_register): Don't
	  record stack size changes here.

2019-06-20  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-06-20  Andy Wingo  <wingo@igalia.com>

	Add jmpi_with_link instruction
	The existing calli / callr interface is for ABI calls.  Sometimes though
	you want to call some of your own code, just to get the current return
	address.  ARM's branch-and-link instructions are ideal for this but they
	don't exist on x86; there we emulate them by adding corresponding
	pop_link_register / push_link_register instructions that are no-ops on
	ARM.

	* lightening.h (FOR_EACH_INSTRUCTION): Add jit_jmpi_with_link,
	  pop_link_register, push_link_register.
	* lightening/arm-cpu.c:
	* lightening/x86-cpu.c:
	* lightening/aarch64-cpu.c (jmpi_with_link, push_link_register)
	  (pop_link_register): Add implementations.
	* lightening/arm.h:
	* lightening/aarch64.h:
	* lightening/x86.h (JIT_LR): New definition.
	* tests/link-register.c: New test.

2019-06-19  Mark H Weaver  <mhw@netris.org>

	NEWS: Add information to remaining news items.
	* NEWS: Update.

2019-06-18  Mark H Weaver  <mhw@netris.org>

	NEWS: Fix typo.
	* NEWS: Fix typo.

	NEWS: More tweaks.
	* NEWS: Update.

	NEWS: Add more details.
	* NEWS: Update text.

2019-06-18  Andy Wingo  <wingo@pobox.com>

	Speed up returns in JIT
	This patch is a bit unfortunate, in the sense that it exposes some of
	the JIT guts to the rest of the VM.  Code needs to treat "machine return
	addresses" as valid if non-NULL (as before) and also not equal to a
	tier-down trampoline.  This is because tier-down at a return needs the
	old frame pointer to load the "virtual return address", and the way this
	patch works is that it passes the vra in a well-known register.  It's a
	custom calling convention for a certain kind of return.

	* libguile/jit.h (scm_jit_return_to_interpreter_trampoline): New
	  internal global.
	* libguile/jit.c: (scm_jit_clear_mcode_return_addresses): Move here,
	  from vm.c.  Instead of zeroing return addresses, set them to the
	  return-to-interpreter trampoline.
	* libguile/vm-engine.c (return-values): Don't enter mcode if the mra is
	  scm_jit_return_to_interpreter_trampoline.
	* libguile/vm.c (capture_continuation): Treat the tier-down trampoline
	  as NULL.

2019-06-18  Andy Wingo  <wingo@pobox.com>

	jit: Direct tail calls assert that target can have mcode
	* libguile/jit.c (emit_direct_tail_call): Assert that the callee label
	  starts with an instrument-entry.

2019-06-18  Mark H Weaver  <mhw@netris.org>

	NEWS: Add more text.
	* NEWS: Update.

	NEWS: Add first draft of 2.2.5 changes.
	* NEWS: Add draft updates.

	THANKS: Christopher Allan Webber -> Christopher Lemmer Webber.
	* THANKS: Update name and re-sort.

	Update THANKS.
	* THANKS: Thank Christopher Allan Webber, Christopher Baines, and
	Timothy Sample for contributions.  Thank Andrea Azzarone, Михаил
	Бахтерев, Jonathan Brielmaier, Josh Datko, Massimiliano Gubinelli, Arun
	Isaac, Shea Levy, Chris Marusich, Jan Smydke, Tom de Vries, Jeffrey
	Walton, and Zefram for fixes.  Move Michael Talbot-Wilson and Michael
	Tuexen to their proper place to fix the sorting.

2019-06-18  Christopher Baines  <mail@cbaines.net>

	stexi->shtml: Add support for @i, @math, @tie and @dots.
	* module/texinfo/html.scm (tag-replacements): Add support for @i
	and @math.  The tags used come from the texinfo documentation.
	(rules): Convert @tie and @dots to the appropriate HTML entities.

2019-06-18  Mark H Weaver  <mhw@netris.org>

	Avoid regexp ranges in HTTP inter-protocol exploitation check.
	* module/system/repl/server.scm (permissive-http-request-line?): Avoid
	character ranges in regexp.

	web: Add support for HTTP header continuation lines.
	* module/web/http.scm (spaces-and-tabs, space-or-tab?): New variables.
	(read-header-line): After reading a header, if a space or tab follows,
	read the continuation lines and join them.
	* test-suite/tests/web-http.test: Add test.

	Rename 'scm_c_make_char' to 'scm_i_make_char'.
	* libguile/chars.c, libguile/chars.h, libguile/ports.c,
	libguile/print.c, libguile/read.c, libguile/srfi-13.c,
	libguile/strings.c, libguile/vm-engine.c: Rename 'scm_c_make_char' to
	'scm_i_make_char'.

	Make 'get-bytevector-n!' suspendable.
	* module/ice-9/suspendable-ports.scm (get-bytevector-n!): New procedure.
	(get-bytevector-n): Rewrite in terms of 'get-bytevector-n!'.
	(port-bindings): Add 'get-bytevector-n!'.

	SRFI-19: Rename 'tai-epoch-in-jd' to 'utc-epoch-in-jd'.
	* module/srfi/srfi-19.scm: Rename 'tai-epoch-in-jd' to
	'utc-epoch-in-jd', to reflect its actual meaning and usage.

2019-06-18  Mark H Weaver  <mhw@netris.org>

	fport_seek: Eliminate a fruitless use of 'off_t_or_off64_t'.
	This is a followup to commit 91ba73b397fcc2a36ae7e434522a924c7a8887d0.

	* libguile/fports.c (fport_seek): Use 'lseek' instead of
	'lseek_or_lseek64', and use 'scm_t_off' uniformly.  That's the type used
	in the function signature, and there's no benefit to using a wider type
	internally.  Remove the overflow check, which is no longer needed.

2019-06-18  Mark H Weaver  <mhw@netris.org>

	Fix documentation of R6RS 'binary-port?' to reflect reality.
	* doc/ref/r6rs.texi (rnrs io ports): Improve the descriptions of
	'binary-port?' and 'textual-port?'.
	* module/rnrs/io/ports.scm (binary-port?, textual-port?): Update the
	docstrings.

2019-06-18  Mark H Weaver  <mhw@netris.org>

	open-process: Fix dup(2) and execvp(2) error handling.
	Previously, in the case where OUT is 0, or ERR is 0 or 1,
	e.g. when (current-error-port) points to STDOUT, the code in
	'start_child' to relocate OUT/ERR out of the way to another file
	descriptor had multiple bugs:

	(1) It neglected to close the original file descriptor.

	(2) It checked 'errno' without first checking the return value of
	    dup(2).  This doesn't work because dup(2) leaves 'errno' unchanged
	    if there's no error.

	(3) In case 'errno' contained EINTR, the retry code failed because
	    OUT (or ERR) was overwritten by the result of the previous failed
	    dup(2) call.

	This commit fixes these problems, as well as another problem with
	'execvp' error reporting.

	* libguile/posix.c (renumber_file_descriptor): New static helper
	function.
	(start_child): Use 'renumber_file_descriptor'.  If 'execvp' fails, write
	the error message to file descriptor 2.  Previously, we wrote the error
	message to ERR, which was the old file descriptor before being relocated
	to 2.

2019-06-18  Mark H Weaver  <mhw@netris.org>

	Refresh a stale comment.
	* libguile/numbers.h: In a comment, update the count of number subtypes.

	scm_mkstrport: Optimize the POS -> BYTE_POS conversion.
	* libguile/strports.c (scm_mkstrport): Use 'scm_c_string_utf8_length' to
	avoid the conversion to UTF-8.

	Make 'get-bytevector-some' and 'get-bytevector-some!' suspendable.
	* module/ice-9/suspendable-ports.scm (get-bytevector-some)
	(get-bytevector-some!): New procedures.
	(port-bindings): Add them.

	open-pipe*: Improve performance of OPEN_BOTH mode.
	* module/ice-9/popen.scm (make-rw-port): Re-implement using R6RS
	custom binary input/output ports.

	Add get-bytevector-some!.
	* libguile/r6rs-ports.c (scm_get_bytevector_some_x): New procedure.
	* libguile/r6rs-ports.h (scm_get_bytevector_some_x): Add prototype.
	(scm_unget_bytevector): Move prototype next to 'scm_get_bytevector_some_x'.
	* module/ice-9/binary-ports.scm: Export 'get-bytevector-some!'.
	* doc/ref/api-io.texi (Binary I/O): Document it.

2019-06-18  Mark H Weaver  <mhw@netris.org>

	scm_to_stringn: Avoid passing NULL to c_strcasecmp.
	Reported by Massimiliano Gubinelli <m.gubinelli@gmail.com> in
	<https://lists.gnu.org/archive/html/guile-user/2019-05/msg00070.html>.

	* libguile/strings.c (scm_to_stringn): Check for (encoding == NULL)
	before passing it to 'c_strcasecmp'.  Eliminate redundant 'enc'
	variable.

2019-06-18  Mark H Weaver  <mhw@netris.org>

	time.test: Use 'pass-if-equal' in more tests.
	* test-suite/tests/time.test ("strftime"): Change some uses of 'pass-if'
	to instead use 'pass-if-equal'.

	Fix typo in tags.h comment.
	* libguile/tags.h: Fix typo in comment.

	Save and restore errno in the signal handler.
	* libguile/scmsigs.c (take_signal): Save and restore errno.

	Improve overflow checks in bytevector, string, and I/O operations.
	* libguile/bytevectors.c (INTEGER_ACCESSOR_PROLOGUE)
	(scm_bytevector_copy_x, bytevector_large_set): Rewrite checks to reliably
	detect overflows.
	(make_bytevector): Constrain the bytevector length to avoid later
	overflows during allocation.
	(make_bytevector_from_buffer): Fix indentation.
	(scm_bytevector_length): Use 'scm_from_size_t' to convert a 'size_t',
	not 'scm_from_uint'.
	* libguile/fports.c (fport_seek): Check for overflow before the implicit
	conversion of the return value.
	* libguile/guardians.c (guardian_print): Use 'scm_from_ulong' to convert
	an 'unsigned long', not 'scm_from_uint'.
	* libguile/ports.c (scm_unread_string): Change a variable to type 'size_t'.
	(scm_seek, scm_truncate_file): Use 'scm_t_off' instead of
	'off_t_or_off64_t' to avoid implicit type conversions that could
	overflow, because 'ptob->seek' and 'ptob->truncate' use 'scm_t_off'.
	* libguile/r6rs-ports.c (bytevector_input_port_seek)
	(custom_binary_port_seek, bytevector_output_port_seek): Rewrite offset
	calculations to reliably detect overflows.  Use 'scm_from_off_t' to
	convert a 'scm_t_off', not 'scm_from_long' nor 'scm_from_int'.
	(scm_get_bytevector_n_x, scm_get_bytevector_all, scm_unget_bytevector)
	(bytevector_output_port_write): Rewrite checks to reliably detect
	overflows.  Use 'size_t' where appropriate.
	(bytevector_output_port_buffer_grow): Rewrite size calculations to
	reliably detect overflows.  Minor change in the calculation of the new
	size: now it is max(min_size, 2*current_size), whereas previously it
	would multiply current_size by the smallest power of 2 needed to surpass
	min_size.
	* libguile/strings.c (make_stringbuf): Constrain the stringbuf length to
	avoid later overflows during allocation.
	(scm_string_append): Change overflow check to use INT_ADD_OVERFLOW.
	* libguile/strports.c (string_port_write): Rewrite size calculations to
	reliably detect overflows.
	(string_port_seek): Rewrite offset calculations to reliably detect
	overflows.  Use 'scm_from_off_t' to convert a 'scm_t_off', not
	'scm_from_long'.
	(string_port_truncate): Use 'scm_from_off_t' to convert a 'scm_t_off',
	not 'scm_from_off_t_or_off64_t'.
	* libguile/vectors.c (scm_c_make_vector): Change a variable to type
	'size_t'.

2019-06-11  Andy Wingo  <wingo@pobox.com>

	Fix intmap-intersect edge case
	* module/language/cps/intmap.scm (intmap-intersect): If intersection of
	  same-level intmaps is empty, return empty intmap.

2019-06-07  Andy Wingo  <wingo@pobox.com>

	Fix RTL tests for recent arity change
	* test-suite/tests/rtl.test: Fix tests.

	Enable closure elision.
	* module/language/cps/closure-conversion.scm (convert-one): Elide
	  closures when possible.

	Add support no closure in $callk
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/contification.scm (compute-contification-candidates):
	* module/language/cps/cse.scm (apply-cse):
	* module/language/cps/dce.scm (compute-live-code):
	* module/language/cps/devirtualize-integers.scm (compute-use-counts):
	* module/language/cps/peel-loops.scm (rename-cont):
	* module/language/cps/renumber.scm (renumber):
	* module/language/cps/rotate-loops.scm (rotate-loop):
	* module/language/cps/simplify.scm (compute-singly-referenced-vars):
	(beta-reduce):
	* module/language/cps/slot-allocation.scm (compute-defs-and-uses):
	(compute-lazy-vars):
	(compute-shuffles):
	(compute-frame-size):
	(allocate-lazy-vars):
	(allocate-slots):
	* module/language/cps/specialize-numbers.scm (compute-significant-bits):
	* module/language/cps/verify.scm (check-valid-var-uses): Allow for the
	  $callk proc to be #f.
	* module/language/cps/compile-bytecode.scm (compile-function): Reset
	  frame to appropriate size.

	Add compiler support for eliding closure bindings
	* module/language/cps/closure-conversion.scm (compute-elidable-closures):
	  New function.
	  (convert-one, convert-closures): Add ability to set "self" variable of
	  $kfun to $f, hopefully avoiding passing that argument in some cases.
	* module/language/cps/compile-bytecode.scm (compile-function): Pass the
	  has-closure? bit on through to the assembler.
	* module/system/vm/assembler.scm (begin-standard-arity)
	  (begin-opt-arity, begin-kw-arity): Only reserve space for the closure
	  as appropriate.
	* module/language/cps/slot-allocation.scm (allocate-args)
	  (compute-defs-and-uses, compute-needs-slot)
	  (compute-var-representations): Allow for closure slot allocation
	  differences.
	* module/language/cps/cse.scm (compute-defs):
	* module/language/cps/dce.scm (compute-live-code):
	* module/language/cps/renumber.scm (renumber, compute-renaming):
	(allocate-args):
	* module/language/cps/specialize-numbers.scm (compute-significant-bits):
	(compute-defs):
	* module/language/cps/split-rec.scm (compute-free-vars):
	* module/language/cps/types.scm (infer-types):
	* module/language/cps/utils.scm (compute-max-label-and-var):
	* module/language/cps/verify.scm (check-distinct-vars):
	(compute-available-definitions): Allow closure to be #f.

2019-06-06  Andy Wingo  <wingo@pobox.com>

	VM does not initialize stack frames
	* libguile/jit.c (compile_alloc_frame): Stop initializing locals.
	  (compile_bind_rest): Use emit_alloc_frame.
	* libguile/vm-engine.c (assert_nargs_ee_locals, allocate_frame): Don't
	  initialize locals.
	  (bind_rest): Don't initialize locals, and assert that the locals count
	  has a minimum.

2019-06-06  Andy Wingo  <wingo@pobox.com>

	Allow for bind-optionals without alloc-frame
	This reduces subr trampoline instruction count for subrs with optional
	args.

	* libguile/gsubr.c (get_subr_stub_code): Insert bind-optionals
	  instructions.
	  (primitive_call_ip): Handle bind-optionals.
	* libguile/programs.c (try_parse_arity): Handle bind-optionals.
	* libguile/jit.c (struct scm_jit_state)
	  (compile_call, compile_call_label, compile_tail_call)
	  (compile_tail_call_label, compile_receive), compile_receive_values)
	  (compile_shuffle_down, compile_return_values, compile_subr_call)
	  (compile_foreign_call, compile_continuation_call)
	  (compile_compose_continuation, compile_abort, compile_assert_nargs_ee)
	  (compile_assert_nargs_ge, compile_assert_nargs_le)
	  (compile_alloc_frame, compile_reset_frame, compile_push)
	  (compile_pop, compile_drop, compile_expand_apply_argument)
	  (compile_bind_kwargs, compile_bind_rest, compile_bind_optionals)
	  (compile, compute_mcode): Separately track min and max frame sizes.

2019-06-06  Andy Wingo  <wingo@pobox.com>

	Add bind-optionals instruction
	* doc/ref/vm.texi (Function Prologue Instructions): Document new
	  instruction.
	* libguile/jit.c (compile_bind_optionals): New compiler.
	* libguile/vm-engine.c (VM_NAME): New interpreter.
	* module/system/vm/assembler.scm (opt-prelude): Emit bind-optionals as
	  appropriate.
	* module/system/vm/disassembler.scm (define-stack-effect-parser)
	  (code-annotation): Handle bind-optionals.

	Avoid saving IP for <? fast-path
	* libguile/jit.c (compile_less): Only save IP on slow-path.

2019-06-04  Timothy Sample  <samplet@ngyro.com>

	Make URI handling locale independent.
	Fixes <https://bugs.gnu.org/35785>.

	* module/web/uri.scm (digits, hex-digits, letters): New variables.
	(ipv4-regexp, ipv6-regexp, domain-label-regexp, top-label-regexp,
	userinfo-pat, host-pat, ipv6-host-pat, port-pat, scheme-pat): Explicitly
	list each character instead of using character ranges.
	* test-suite/tests/web-uri.test: Add corresponding tests.

2019-06-04  Ludovic Courtès  <ludo@gnu.org>

	'basename' correctly handles "/" and "//".
	* libguile/filesys.c (scm_basename): Special-case "/" and "//".
	* test-suite/tests/filesys.test ("basename"): New test prefix.

2019-05-27  Andy Wingo  <wingo@pobox.com>

	Remove check for instrument-entry
	* libguile/jit.c (emit_indirect_tail_call): If everything starts with
	  instrument-entry, and thus has a vcode pointer, no need to emit a
	  dynamic check.

	Dynamically assert functions start with instrument-entry
	* libguile/jit.c (emit_indirect_tail_call): Add dynamic assertion.

	Reapply atomics inlining
	This patch reapplies 230a5559764679d75e3e8941e97a268a2b2e6a53 and
	e8d34258beab2799951e16d21d547299d4659364, but fixing a misplaced
	comma (!).

	Revert "Inline the atomic intrinsics"
	This reverts commit 230a5559764679d75e3e8941e97a268a2b2e6a53.

	Revert "Fix atomics usage in handle-interrupts JIT."
	This reverts commit e8d34258beab2799951e16d21d547299d4659364.

	Merge remote-tracking branch 'lightening/master'

2019-05-27  Andy Wingo  <wingo@igalia.com>

	Add breakpoint instruction

2019-05-27  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-27  Andy Wingo  <wingo@igalia.com>

	Fix accidental change to ARMv7 ldr

2019-05-27  Andy Wingo  <wingo@pobox.com>

	Fix atomics usage in handle-interrupts JIT.
	* libguile/jit.c (compile_handle_interrupts): Use atomics in
	  handle-interrupts.

	Inline the atomic intrinsics
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/intrinsics.c (scm_bootstrap_intrinsics): Remove the atomic
	  intrinsics, as the JIT no longer needs them.
	* libguile/vm-engine.c (VM_NAME): Inline the intrinsics.

	Use new atomic instructions from lightening
	* libguile/jit.c (compile_atomic_scm_ref_immediate):
	(compile_atomic_scm_set_immediate):
	(compile_atomic_scm_swap_immediate):
	(compile_atomic_scm_compare_and_swap_immediate): Use lightening
	instructions.

	Merge remote-tracking branch 'lightening/master'

2019-05-27  Andy Wingo  <wingo@igalia.com>

	Add atomic operations
	These operations emit the same code that GCC does for corresponding
	operations under the sequential consistency memory model.  It would be
	possible to relax to acquire/release or something in the future.

	Correctly handle overflow when emitting literal pools

2019-05-25  Andy Wingo  <wingo@pobox.com>

	Switch to use atomic_compare_exchange_strong
	* libguile/atomics-internal.h (scm_atomic_compare_and_swap_scm): Change
	  to use same API as atomic-box-compare-and-swap!.
	* libguile/intrinsics.c (atomic_compare_and_swap_scm): Remove loop, as
	  we're using the strong variant now.
	* libguile/async.c (scm_i_async_pop, scm_i_async_push): Adapt to new API
	  of scm_atomic_compare_and_swap_scm.

2019-05-23  Andy Wingo  <wingo@pobox.com>

	Bump version to 2.9.2
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.

	Reference Lightening instead of GNU Lightning
	* doc/ref/vm.texi (Just-In-Time Native Code): Update with link to
	  Lightening.

	Merge until 65d98d8fd from 'stable-2.2'
	This marks stable-2.2 as merged up to 65d98d8fd, though the merge was
	done via cherry-picks.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Update iconv.m4 from gnulib.
	* m4/iconv.m4: Update from gnulib-v0.1-2176-ga79f2a287.

	Strings, i18n: Limit the use of alloca to approximately 8 kilobytes.
	* libguile/i18n.c (SCM_MAX_ALLOCA): New macro.
	(SCM_STRING_TO_U32_BUF): Accept an additional variable to remember
	whether we used malloc to allocate the buffer.  Use malloc if the
	allocation size is greater than SCM_MAX_ALLOCA.
	(SCM_CLEANUP_U32_BUF): New macro.
	(compare_u32_strings, compare_u32_strings_ci, str_to_case): Adapt.
	* libguile/strings.c (SCM_MAX_ALLOCA): New macro.
	(normalize_str, unistring_escapes_to_r6rs_escapes): Use malloc if the
	allocation size is greater than SCM_MAX_ALLOCA.
	* test-suite/tests/i18n.test, test-suite/tests/strings.test: Add tests.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	put-u8: Always write a single byte, regardless of the port encoding.
	Previously, 'put-u8' used textual I/O to write a single character,
	relying on the usual practice of setting the port encoding to ISO-8859-1
	for binary ports.

	* libguile/r6rs-ports.c (scm_put_u8): Use 'scm_c_write', not 'scm_putc'.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Optimize fixnum exact integer square roots.
	* libguile/numbers.c (scm_exact_integer_sqrt, scm_sqrt)
	(exact_integer_is_perfect_square, exact_integer_floor_square_root):
	Where it is trivial to do so, use GMP's low-level mpn functions to
	avoid heap allocation.

	Avoid 'with-latin1-locale' in binary I/O tests.
	* test-suite/tests/r6rs-ports.test ("put-bytevector [2 args]")
	("put-bytevector [3 args]", "put-bytevector [4 args]"): Set the default
	port encoding instead of setting the locale.

	Fix indentation in scm_sum.

	Fix typo in comment.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Add 'scm_c_make_char' and use it where appropriate.
	This reverts the change to SCM_MAKE_CHAR made in the previous commit
	63818453ad226cd3c2d1fd8ade12e3d7c1d43c05, which used an arithmetic trick
	to avoid evaluating its argument more than once.

	Here, we restore the previous implementation of SCM_MAKE_CHAR, which
	evaluates its argument twice.  Instead, we introduce a new inlinable
	function 'scm_c_make_char' and replace uses of SCM_MAKE_CHAR with calls
	to 'scm_c_make_char' where appropriate.

	* libguile/chars.h (scm_c_make_char): New inline function.
	* libguile/inline.c: Include chars.h.
	* libguile/srfi-13.c (REF_IN_CHARSET, scm_string_any, scm_string_every)
	(scm_string_trim, scm_string_trim_right, scm_string_trim_both)
	(scm_string_index, scm_string_index_right, scm_string_skip)
	(scm_string_skip_right, scm_string_count, string_titlecase_x)
	(string_reverse_x, scm_string_fold, scm_string_fold_right)
	(scm_string_for_each, scm_string_filter, scm_string_delete):
	Use 'scm_c_make_char' instead of 'SCM_MAKE_CHAR' in cases where the
	argument calls a function.
	* libguile/chars.c (scm_char_upcase, scm_char_downcase, scm_char_titlecase),
	libguile/ports.c (scm_port_decode_char),
	libguile/print.c (scm_simple_format),
	libguile/read.c (scm_read_character),
	libguile/strings.c (scm_string_ref, scm_c_string_ref),

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Reimplement SCM_MAKE_CHAR to evaluate its argument only once.
	The motivation for this change is that SCM_MAKE_CHAR is sometimes passed
	an expression that involves a procedure call that is not always trivial.
	In other cases, the results are not guaranteed to be the same both
	times, which could lead to the creation of invalid SCM objects.

	* libguile/chars.h (SCM_MAKE_CHAR): Reimplement.

2019-05-23  Andrea Azzarone  <andrea.azzarone@canonical.com>

	Fix gc.test "after-gc-hook gets called" failures.
	* libguile/scmsigs.c (signal_delivery_thread): Call scm_async_tick to
	give any pending asyncs a chance to run before we block indefinitely
	waiting for a signal to arrive.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Update user-visible copyright years.
	* doc/ref/guile.texi: Update years in copyright notice.
	* module/ice-9/command-line.scm (version-etc): Update 'copyright-year'.
	* module/system/repl/common.scm (*version*): Update copyright years.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Avoid passing NULL to 'memcpy' and 'memcmp'.
	Reported by Jeffrey Walton <noloader@gmail.com> in
	<https://lists.gnu.org/archive/html/guile-devel/2019-03/msg00001.html>.

	Note that C11 section 7.1.4 (Use of library functions) states that:
	"unless explicitly stated otherwise in the detailed descriptions [of
	library functions] that follow: If an argument to a function has an
	invalid value (such as ... a null pointer ...) ..., the behavior is
	undefined."  Note that 'strxfrm' is an example of a standard C function
	that explicitly states otherwise, allowing NULL to be passed in the
	first argument if the size argument is zero, but no similar allowance is
	specified for 'memcpy' or 'memcmp'.

	* libguile/bytevectors.c (scm_uniform_array_to_bytevector): Call memcpy
	only if 'byte_len' is non-zero.
	* libguile/srfi-14.c (charsets_equal): Call memcmp only if the number of
	ranges is non-zero.
	* libguile/stime.c (setzone): Pass 1-character buffer to
	'scm_to_locale_stringbuf', instead of NULL.
	* libguile/strings.c (scm_to_locale_stringbuf): Call memcpy only if the
	number of bytes to copy is non-zero.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Fix typo in comment.
	* module/ice-9/boot-9.scm: Fix typo.

2019-05-23  Michael Gran  <spk121@yahoo.com>

	Disable test for current value of setitimer on Cygwin
	* test-suite/tests/signals.test ("current itimers are 0"): throws unresolved
	    for cygwin

	Make locale monetary conversion tests be less strict on terminal whitespace
	* test-suite/tests/i18n.test (monetary-amount->locale-string): modified

2019-05-23  Michael Gran  <spk121@yahoo.com>

	Handle newlib C library's langinfo constant names
	The newlib C library (used in Cygwin) has alternative names for
	nl_langinfo GNU extensions

	* configure.ac (_NL_NUMERIC_GROUPING): new test
	* libguile/i18n.c (INT_CURR_SYMBOL, MON_DECIMAL_POINT, MON_THOUSANDS_SEP)
	   (MON_GROUPING, POSITIVE_SIGN, NEGATIVE_SIGN, GROUPING, INT_FRAC_DIGITS)
	   (FRAC_DIGITS, P_CS_PRECEDES, P_SEP_BY_SPACE, N_CS_PRECEDES, N_SEP_BY_SPACE)
	   (P_SIGN_POSN, N_SIGN_POSN, INT_P_CS_PRECEDES, INT_P_SEP_BY_SPACE)
	   (INT_N_CS_PRECEDES, INT_N_SEP_BY_SPACE, INT_P_SIGN_POSN, INT_N_SIGN_POSN)
	   [HAVE_DECL__NL_NUMERIC_GROUPING]: map to newlib C constants, when present

2019-05-23  Michael Gran  <spk121@yahoo.com>

	Add a fallback value for the locale-monetary-decimal-point
	* module/ice-9/i18n.scm (locale-monetary-decimal-point): use "." as fallback

2019-05-23  Mike Gran  <spk121@yahoo.com>

	Fix binary output on files created by mkstemp!
	Some operating systems require a O_BINARY flag.

	* libguile/filesys.c (scm_i_mkstemp): Don't mask out O_BINARY flag
	* test-suite/tests/posix.test ("binary mode honored"): new test

2019-05-23  Mike Gran  <spk121@yahoo.com>

	Avoid leaking a file descriptor in test-unwind
	* test-suite/standalone/test-unwind.c (check_ports): explicitly close temp file

	Fix strftime compile with null threads
	* libguile/stime.c (scm_strftime): use correct pthread lock function

	Remove redefinition of when & unless in snarf-check-and-output-texi
	* module/scripts/snarf-check-and-output-texi.scm (when, unless): removed

	Don't mutate read-only string in ports test
	* test-suite/tests/ports.test ("valid wide mode string"): modified

2019-05-23  Ludovic Courtès  <ludo@gnu.org>

	Do not warn the user when 'madvise' returns ENOSYS.
	* libguile/vm.c (return_unused_stack_to_os): Avoid 'perror' calls when
	'madvise' returns ENOSYS.

2019-05-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix tests for SRFI-19 date->string ~N

	Support ~N in SRFI-19 string->date
	* module/srfi/srfi-19.scm (fractional-integer-reader,
	  make-fractional-integer-reader): From reference implementation.
	  (reader-directives): Handle #\N, from reference implementation.
	* test-suite/tests/srfi-19: Add tests for string->date ~N.
	* doc/ref/srfi-modules.texi (string->date): Add line for ~N.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Update (ice-9 match) to include selected bug fixes from upstream.
	Fixes <https://bugs.gnu.org/22925> and other bugs.

	* module/ice-9/match.upstream.scm: Apply selected fixes from the
	upstream match.scm in Chibi-Scheme.
	* test-suite/tests/match.test.upstream: Add more tests from upstream.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Fix spelling of ellipsis in (ice-9 match).
	* module/ice-9/match.upstream.scm: Change several occurrences
	of 'ellipse' and 'ellipses' to 'ellipsis', to more closely match
	match.scm from Chibi-Scheme.

2019-05-23  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Documentation fixes
	* doc/ref/api-control:
	* doc/ref/compiler.texi: Language fixes
	* doc/ref/compiler ($kfun): Renamed argument clauses -> clause.

	Bootstrap optimization
	* bootstrap/Makefile.am: Build both eval.go and psyntax-pp.go before
	  the rest of the .go files so that they are handled by a fast macro
	  expander. This saves time for a parallel build.

	Add texinfo dependency to README
	* README: Add texinfo dependency.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Minor refactor of leap second table lookups.
	* module/srfi/srfi-19.scm (leap-second-delta): Replace with ...
	(utc->tai): ... this.
	(leap-second-neg-delta): Replace with ...
	(tai->utc): ... this.
	(current-time-tai, priv:time-tai->time-utc!, priv:time-utc->time-tai!)
	(time-tai->julian-day, time-monotonic->julian-day): Adapt accordingly.

	SRFI-19: time-utc->date: Support non-integer nanoseconds values.
	* module/srfi/srfi-19.scm (time-utc->date): Use 'floor-remainder'
	instead of 'modulo'.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Check for incompatible types in time comparisons.
	Fixes <https://bugs.gnu.org/26163>.
	Reported by Zefram <zefram@fysh.org>.

	* module/srfi/srfi-19.scm (time-compare-check): New procedure.
	(time=?): Use 'time-compare-check' to check the arguments and raise an
	error in case of mismatched types.  Previously, mismatched types would
	cause time=? to return #f.
	(time>?, time<?, time>=?, time<=?, time-difference!): Use
	'time-compare-check' to check the arguments.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Fix normalization of seconds and nanoseconds in time records.
	Fixes <https://bugs.gnu.org/26162>.
	Reported by Zefram <zefram@fysh.org>.

	* module/srfi/srfi-19.scm (time-normalize!): Rewrite.
	* test-suite/tests/srfi-19.test: Add tests.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Add a few more tests.
	This is a followup to commit a58c7abd72648f77e4ede5f62a2c4e7969bb7f95.

	* test-suite/tests/srfi-19.test: Add tests for large positive years.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Fix handling of negative years and negative julian days.
	Fixes <https://bugs.gnu.org/21906>.
	Mitigates <https://bugs.gnu.org/21903> and <https://bugs.gnu.org/21904>.
	Reported by: Zefram <zefram@fysh.org>.

	* module/srfi/srfi-19.scm (encode-julian-day-number)
	(decode-julian-day-number, date-week-number): Use 'floor-quotient'
	instead of 'quotient', and 'floor' instead of 'truncate', where
	appropriate.
	(time-utc->date): Ensure that the 'nanoseconds' field of the returned
	date is non-negative.
	(leap-year): Handle negative years properly, and reformulate the
	computation.
	(week-day): Handle negative years properly.  Use 'floor-quotient'
	instead of 'quotient' where appropriate.
	(directives): In the handler for '~Y' format escapes, improve the
	handling of years outside of the range 0-9999.
	(read-directives): Add a FIXME comment to fix the '~Y' reader to handle
	years outside of the range 0-9999.
	* test-suite/tests/srfi-19.test: Import (srfi srfi-1).  Use Guile's
	modern keyword notation in the 'define-module' form.  Add more tests.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Fix TAI->UTC conversions, leap second handling, etc.
	Fixes <https://bugs.gnu.org/21911>.
	Fixes <https://bugs.gnu.org/22034>.
	Fixes <https://bugs.gnu.org/21902>.
	Partially fixes <https://bugs.gnu.org/21904>.
	Reported by Zefram <zefram@fysh.org>.

	* doc/ref/srfi-modules.texi (SRFI-19 Introduction): Fix the definitions
	of Julian Day and Modified Julian Day.  Give the correct full names of
	UTC and TAI.
	* module/srfi/srfi-19.scm: Import (srfi srfi-1).  Use modern Guile
	keyword syntax in the 'define-module' form.
	(leap-second-neg-delta): New procedure, derived from a similar procedure
	in the latest upstream SRFI-19 reference implementation.
	(priv:time-tai->time-utc!, time-tai->julian-day)
	(time-monotonic->julian-day): Use 'leap-second-neg-delta'.
	(local-tz-offset): Fix comment.
	(leap-second?): Remove.
	(tai-before-leap-second?): New procedure, derived from upstream SRFI-19.
	(time-utc->date): Use 'define*' to handle the optional argument.  Remove
	the leap second handling, following upstream SRFI-19.
	(time-tai->date): Rewrite in terms of 'time-utc->date'.  Add special
	leap second handling, following upstream SRFI-19.
	(time-monotonic->date): Rewrite in terms of 'time-tai->date'.
	(date->time-tai, date->time-monotonic): Add special leap second
	handling, following upstream SRFI-19.
	(directives): In the entry for the "~Y" escape in 'date->string', pad
	the year field to 4 characters, following upstream SRFI-19.
	* test-suite/tests/srfi-19.test: Add tests.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	scm_seed_to_random_state: Support wide string arguments.
	Partially fixes <https://bugs.gnu.org/33044>.
	Reported by Tom de Vries <tdevries@suse.de>.

	* libguile/random.c (scm_seed_to_random_state): Use 'scm_to_utf8_string'
	(or 'scm_to_latin1_string' for a narrow string, for compatibility) to
	convert the string into raw bytes for use by 'scm_c_make_rstate'.  Make
	sure the length in bytes fits within an 'int'.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Fix typo in strings.h.
	* libguile/strings.h: In a comment, add the missing "i_" in
	"scm_i_is_narrow_string".

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Add tests for type inferencing for 'nil?' and 'null?' predicates.
	These tests come from a fix for <https://bugs.gnu.org/33036>, which was
	fixed already in the 2.9.x branch.

	* test-suite/tests/compiler.test: Add tests.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Use 'scm_from_utf8_{string,symbol,keyword}' for C string literals.
	Partial fix for <https://bugs.gnu.org/33044>.
	Reported by Tom de Vries <tdevries@suse.de>.

	Fix several instances of the mistake of using 'scm_from_locale_*' for C
	strings that originally came from a C string literal.  Change several
	uses of 'scm_from_latin1_*' as well, to promote the practice of writing
	code that works for arbitrary C string literals.

	Also add missing years to the copyright notices of changed files, based
	on the git history.

	* libguile/debug-malloc.c, libguile/deprecation.c, libguile/error.c,
	libguile/eval.c, libguile/expand.c, libguile/extensions.c,
	libguile/filesys.c, libguile/init.c, libguile/load.c,
	libguile/modules.c, libguile/pairs.c, libguile/posix.c,
	libguile/print.c, libguile/random.c, libguile/read.c,
	libguile/regex-posix.c, libguile/snarf.h, libguile/srfi-13.c,
	libguile/stacks.c, libguile/stime.c, libguile/strports.c,
	libguile/values.c: Use 'scm_from_utf8_*' where appropriate.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Fix typos, indentation and error reporting in SRFI-19.
	* module/srfi/srfi-19.scm: Fix typos in comments, indentation, and pass
	the correct 'caller' name to 'time-error' in several places.

	Update SRFI-19 leap second table.
	* module/srfi/srfi-19.scm (leap-second-table): Update to include the
	leap second on 1 January 2017.

2019-05-23  Chris Marusich  <cmmarusich@gmail.com>

	Clarify the manual's "Processes" section.
	* doc/ref/posix.texi (Processes): Use the phrase "integer status value"
	consistently, and add a cross-reference to the section of the glibc
	manual that explains what it is.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	In 'ash' and 'round-ash', handle right shift count of LONG_MIN.
	Fixes <https://bugs.gnu.org/21901>.
	Reported by Zefram <zefram@fysh.org>.

	* libguile/numbers.c: Add another top-level 'verify' to ensure that
	LONG_MIN is not a fixnum.
	(scm_ash, scm_round_ash): Ensure that when the shift count is LONG_MIN,
	it is not handled via the normal code path, to avoid signed overflow
	when the shift count is negated.
	* test-suite/tests/numbers.test: Add tests.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Fix 'round-ash' of negative integers by huge right shift counts.
	This is a followup to commit 011aec7e240ef987931548d90c53e6692c85d01c.

	When rounding, right shifting a negative integer by a huge shift count
	results in 0, not -1.

	* libguile/numbers.c: Add top-level 'verify' to ensure that the
	assumptions in 'scm_ash' and 'scm_round_ash' are valid.
	(scm_round_ash): In the case that handles huge right shifts, require
	that the shift count _exceeds_ the integer length, and return 0 instead
	of -1.
	* test-suite/tests/numbers.test: Adjust tests accordingly.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Gracefully handle huge shift counts in 'ash' and 'round-ash'.
	Fixes <https://bugs.gnu.org/32644>.
	Reported by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.

	The need for this arose because the type inferrer for 'ursh' sometimes
	passes (- 1 (expt 2 64)) as the second argument to 'ash'.

	* libguile/numbers.c (scm_ash, scm_round_ash): Gracefully handle several
	cases where the shift count does not fit in a C 'long'.
	* test-suite/tests/numbers.test: Add tests.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Fix list validation of *list->bytevector procedures.
	Fixes <https://bugs.gnu.org/32938>.
	Reported by Josh Datko <jbd@cryptotronix.com>.

	* libguile/validate.h (SCM_VALIDATE_LIST_COPYLEN)
	(SCM_VALIDATE_NONEMPTYLIST_COPYLEN): Use '!=' instead of '>=' to
	validate the result of 'scm_ilength' after it has been stored in
	the user variable 'cvar'.
	* test-suite/tests/bytevectors.test: Add tests.  Use '#:use-module'
	instead of ':use-module' in 'define-module' form.

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Improve the documentation for 'nil?'.
	* libguile/boolean.c (scm_nil_p): Improve docstring.
	* doc/ref/api-languages.texi (Nil): Add documentation for 'nil?', along
	with a description of how Elisp interprets Scheme booleans and
	end-of-list.

2019-05-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix 32/64 bit bug in INTEGER_ACCESSOR_PROLOGUE

2019-05-23  Mark H Weaver  <mhw@netris.org>

	Fix 'atomic-box-compare-and-swap!'.
	Fixes <https://bugs.gnu.org/32786>.

	'scm_atomic_compare_and_swap_scm' is a thin wrapper around
	'atomic_compare_exchange_weak' (where available), and therefore it may
	spuriously fail on some platforms, leaving the atomic object unchanged
	even when the observed value is equal to the expected value.  Since
	'scm_atomic_compare_and_swap_scm' returns both a boolean result and the
	observed value, the caller is able to detect spurious failures when
	using that API.

	'atomic-box-compare-and-swap!' presents a simpler API, returning only
	the observed value.  The documentation advises callers to assume that
	the exchange succeeded if the observed value is 'eq?' to the expected
	value.  It's therefore not possible to report spurious failures with
	this API.

	'atomic-box-compare-and-swap!' uses 'scm_atomic_compare_and_swap_scm',
	and prior to this commit would simply ignore the boolean result and
	return the observed value.  In case of spurious failures, the caller
	would legitimately conclude that the exchange had succeeded.

	With this commit, 'atomic-box-compare-and-swap!' now retries in case of
	spurious failures.

	* libguile/atomic.c (scm_atomic_box_compare_and_swap_x): If
	'scm_atomic_compare_and_swap_scm' returns false and the observed value
	is equal to 'expected', then try again.
	* libguile/intrinsics.c (atomic_compare_and_swap_scm): Ditto.

2019-05-23  Ludovic Courtès  <ludo@gnu.org>

	Define AT_SYMLINK_NOFOLLOW et al.
	* libguile/posix.c (scm_init_posix): Define AT_SYMLINK_NOFOLLOW,
	AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, and AT_EMPTY_PATH when available.
	(scm_utime): Mention AT_SYMLINK_NOFOLLOW.
	* doc/ref/posix.texi (File System): Update accordingly.
	* test-suite/tests/posix.test ("utime")["AT_SYMLINK_NOFOLLOW"]: New test.

	time: Use #: for 'define-module' clauses.
	* module/ice-9/time.scm: Use #: instead of : in 'define-module' form.

	time: Support expressions that return any number of values.
	* module/ice-9/time.scm (time-proc): Call PROC with 'call-with-values';
	return all its values.

	time: Use 'syntax-rules' instead of 'define-macro'.
	* module/ice-9/time.scm (time): Rewrite using 'define-syntax-rule'.

2019-05-23  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-23  Andy Wingo  <wingo@igalia.com>

	Add includable automake file

2019-05-23  Andy Wingo  <wingo@pobox.com>

	Update NEWS
	* NEWS: Add 2.9.2 information.

	Mark a couple functions as maybe-unused.
	* libguile/jit.c (fp_scm_operand, sp_slot_operand): Maybe unused.

2019-05-22  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-22  Andy Wingo  <wingo@igalia.com>

	Silence "unused" warnings

2019-05-22  Andy Wingo  <wingo@pobox.com>

	Enable JIT on aarch64 and armv7
	* acinclude.m4 (GUILE_ENABLE_JIT): For MIPS, PPC, sparc, ia64, hppa,
	  s390, and alpha: mark JIT as unavailable.  Only architectures left are
	  x86-64, i686, aarch64, and armv7.  If JIT is available, enable it by
	  default; previously only x86-64 and i686 were supported.

	Merge remote-tracking branch 'lightening/master'

2019-05-22  Andy Wingo  <wingo@igalia.com>

	Allow add_pending_literal to return false
	This avoids invalidating offsets for the reloc.

2019-05-21  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-21  Andy Wingo  <wingo@igalia.com>

	Avoid recursive pool emit for aarch64; add another overflow check

2019-05-21  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-21  Andy Wingo  <wingo@igalia.com>

	AArch64 fix

2019-05-21  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-21  Andy Wingo  <wingo@igalia.com>

	Various fixes for as-needed emission of literal pool

2019-05-21  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-21  Andy Wingo  <wingo@igalia.com>

	Fix literal pool emission on armv7

2019-05-21  Andy Wingo  <wingo@pobox.com>

	Bless enter_mcode as a function pointer
	* libguile/jit.c (initialize_jit): Bless enter_mcode, to allow ARMv7
	  interworking.

	Merge remote-tracking branch 'lightening/master'

2019-05-21  Andy Wingo  <wingo@igalia.com>

	Expose API to bless function pointers
	On ARMv7, we need to set the low bit to indicate that we're in
	thumb-land.

2019-05-21  Andy Wingo  <wingo@pobox.com>

	Allow jit_end to fail
	* libguile/jit.c (emit_code): Emitting a constant table might cause us
	  to fail.

	Merge remote-tracking branch 'lightening/master'

2019-05-21  Andy Wingo  <wingo@igalia.com>

	Fix typo in previous commit, doh

2019-05-21  Andy Wingo  <wingo@pobox.com>

	Fix allocator passed to lightening
	* libguile/jit.c (jit_alloc_fn): On targets that need a dynamically
	  allocated literal pool, we will need to trace that pool, so pass a
	  pointerful malloc.  Fixes JIT on AArch64.

	Merge remote-tracking branch 'lightening/master'

2019-05-21  Andy Wingo  <wingo@igalia.com>

	Clear literal pool more thoroughly

2019-05-21  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-21  Andy Wingo  <wingo@igalia.com>

	Clear missing bit from literal pool

2019-05-21  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-21  Andy Wingo  <wingo@igalia.com>

	Avoid using x18 on AArch64

2019-05-20  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-20  Andy Wingo  <wingo@igalia.com>

	Fix bounds checking on negative ldr offsets for aarch64

2019-05-20  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'lightening/master'

2019-05-20  Andy Wingo  <wingo@igalia.com>

	Update README

	Fix CI on ARMv7

	Attempt to get CI working on ARMv7

	Add ARMv7 testing to CI

	ARMv7 backend passing all tests!

	ARMv7 backend compiling without warnings

2019-05-19  Andy Wingo  <wingo@igalia.com>

	Beginnings of VFP port to lightening

	Port of arm-cpu.c to current lightening

2019-05-17  Andy Wingo  <wingo@igalia.com>

	Beginnings of ARMv7 backend

	Remove unused jit_{gpr,fpr}_is_callee_save

	Remove software floating-point ARMv7 support;  ARMv7 test env

2019-05-16  Andy Wingo  <wingo@igalia.com>

	Update README and guix invocations in test suite

	Attempt to fix CI on Debian for AArch64

	Attempt to fix CI on Debian

	Attempt to fix CI on Debian

	Attempt to fix CI on Debian

	Attempt to fix CI on Debian

	Attempt to fix CI on Debian

	Fix YAML for CI

	Fix dpkg --add-architecture invocation

	Add support for aarch64 in CI

	Remove jit_nop
	Instead, jit_align will call nop() internally.  You can't nop 3 bytes on
	most architectures.

	Aarch64 backend avoids needless temporary register allocation

	Fix a couple bugs related to aarch64 literal pools

	Fix enter/leave JIT ABI

	Fix compilation on aarch64

2019-05-15  Andy Wingo  <wingo@igalia.com>

	Fix GPR temporary selection

	Allow a backend to have multiple temporary registers

	Rework register saving to avoid push/pop
	Push and pop are not well supported on AArch64, so we might as well just
	bump the stack pointer once and fill in by offset.

2019-05-14  Andy Wingo  <wingo@igalia.com>

	Refactor to add support for constant tables, shifted relocs

	First pass at aarch64 assembler port

2019-05-14  Mark H Weaver  <mhw@netris.org>

	Update iconv.m4 from gnulib.
	* m4/iconv.m4: Update from gnulib-v0.1-2176-ga79f2a287.

2019-05-10  Andy Wingo  <wingo@igalia.com>

	Refactor some bits from x86 to lightening

2019-05-09  Andy Wingo  <wingo@igalia.com>

	Refactor to move temp register acquire to core

2019-05-08  Andy Wingo  <wingo@pobox.com>

	Fix eta-reduction of prompts
	* module/language/cps/simplify.scm (eta-reduce): Fix renaming of labels
	  referenced by prompts.  Thanks a million to Stefan Israelsson Tampe
	  for the report and the fix!  Fixes #33652.

	Merge from upstream lightening

2019-05-08  Andy Wingo  <wingo@igalia.com>

	Remove Sparc support
	Sadly, this is a dead architecture, without an official Debian port.
	Rest in peace!

	Remove hppa support
	This is a dead architecture without an official Debian port.

	Remove alpha support
	This is a dead architecture without an official Debian port.

	Remove ia64 (itanium) support
	This is a dead architecture without an official Debian port.

2019-05-07  Mark H Weaver  <mhw@netris.org>

	Strings, i18n: Limit the use of alloca to approximately 8 kilobytes.
	* libguile/i18n.c (SCM_MAX_ALLOCA): New macro.
	(SCM_STRING_TO_U32_BUF): Accept an additional variable to remember
	whether we used malloc to allocate the buffer.  Use malloc if the
	allocation size is greater than SCM_MAX_ALLOCA.
	(SCM_CLEANUP_U32_BUF): New macro.
	(compare_u32_strings, compare_u32_strings_ci, str_to_case): Adapt.
	* libguile/strings.c (SCM_MAX_ALLOCA): New macro.
	(normalize_str, unistring_escapes_to_r6rs_escapes): Use malloc if the
	allocation size is greater than SCM_MAX_ALLOCA.
	* test-suite/tests/i18n.test, test-suite/tests/strings.test: Add tests.

2019-05-07  Mark H Weaver  <mhw@netris.org>

	put-u8: Always write a single byte, regardless of the port encoding.
	Previously, 'put-u8' used textual I/O to write a single character,
	relying on the usual practice of setting the port encoding to ISO-8859-1
	for binary ports.

	* libguile/r6rs-ports.c (scm_put_u8): Use 'scm_c_write', not 'scm_putc'.

2019-05-07  Mark H Weaver  <mhw@netris.org>

	Optimize fixnum exact integer square roots.
	* libguile/numbers.c (scm_exact_integer_sqrt, scm_sqrt)
	(exact_integer_is_perfect_square, exact_integer_floor_square_root):
	Where it is trivial to do so, use GMP's low-level mpn functions to
	avoid heap allocation.

	Avoid 'with-latin1-locale' in binary I/O tests.
	* test-suite/tests/r6rs-ports.test ("put-bytevector [2 args]")
	("put-bytevector [3 args]", "put-bytevector [4 args]"): Set the default
	port encoding instead of setting the locale.

	Fix indentation in scm_sum.

	Fix typo in comment.

2019-05-07  Mark H Weaver  <mhw@netris.org>

	Add 'scm_c_make_char' and use it where appropriate.
	This reverts the change to SCM_MAKE_CHAR made in the previous commit
	63818453ad226cd3c2d1fd8ade12e3d7c1d43c05, which used an arithmetic trick
	to avoid evaluating its argument more than once.

	Here, we restore the previous implementation of SCM_MAKE_CHAR, which
	evaluates its argument twice.  Instead, we introduce a new inlinable
	function 'scm_c_make_char' and replace uses of SCM_MAKE_CHAR with calls
	to 'scm_c_make_char' where appropriate.

	* libguile/chars.h (scm_c_make_char): New inline function.
	* libguile/inline.c: Include chars.h.
	* libguile/srfi-13.c (REF_IN_CHARSET, scm_string_any, scm_string_every)
	(scm_string_trim, scm_string_trim_right, scm_string_trim_both)
	(scm_string_index, scm_string_index_right, scm_string_skip)
	(scm_string_skip_right, scm_string_count, string_titlecase_x)
	(string_reverse_x, scm_string_fold, scm_string_fold_right)
	(scm_string_for_each, scm_string_filter, scm_string_delete):
	Use 'scm_c_make_char' instead of 'SCM_MAKE_CHAR' in cases where the
	argument calls a function.
	* libguile/chars.c (scm_char_upcase, scm_char_downcase, scm_char_titlecase),
	libguile/ports.c (scm_port_decode_char),
	libguile/print.c (scm_simple_format),
	libguile/read.c (scm_read_character),
	libguile/strings.c (scm_string_ref, scm_c_string_ref),
	libguile/vm-engine.c ("string-ref"): Ditto.

2019-04-29  Andy Wingo  <wingo@pobox.com>

	Merge from upstream lightening

2019-04-29  Andy Wingo  <wingo@igalia.com>

	Attempt to pop x87 stack

2019-04-29  Andy Wingo  <wingo@pobox.com>

	Merge from upstream lightening

2019-04-29  Andy Wingo  <wingo@igalia.com>

	Stack alignment is 16 even on x86-32

2019-04-29  Andy Wingo  <wingo@pobox.com>

	Fix u64-ref JIT on 32-bit
	* libguile/jit.c (compile_u64_ref): Fix 32-bit load path; endianness was
	  reversed.

2019-04-28  Andy Wingo  <wingo@pobox.com>

	Fix unneeded stack alignment.
	* libguile/jit.c (emit_entry_trampoline): Remove unneeded alignment.

	Merge from upstream lightening

2019-04-28  Andy Wingo  <wingo@igalia.com>

	Fix byte stores on x86-32
	Also on x86-32, use RBX as the tmp register, as it is byte-addressable.

2019-04-28  Andy Wingo  <wingo@pobox.com>

	Merge from upstream lightening

2019-04-28  Andy Wingo  <wingo@igalia.com>

	Unget temp xpr after mem->mem addend fixup

2019-04-28  Andy Wingo  <wingo@pobox.com>

	Fix errors in 32-bit JIT support
	* libguile/jit.c (compile_ursh_immediate):
	(compile_ulsh_immediate): Fix immediate/register variant calling.
	Happily a benefit of lightening, as type safety did this for us.
	(DEFINE_CLOBBER_RECORDING_EMITTER_R_R_2): Pass JIT state.

	Enable JIT on 32-bit x86
	* acinclude.m4 (GUILE_ENABLE_JIT): Turn on JIT for 32-bit x86.

	Adapt to lightening changes
	* libguile/jit.c (emit_entry_trampoline): Use
	  jit_{enter,leave}_jit_abi.
	  (compile_allocate_words_immediate): Use JIT_OPERAND_ABI_WORD.

	Align stack before entering JIT code
	* libguile/jit.c (emit_entry_trampoline): Ensure stack is aligned when
	  going into JIT code.

	Merge from upstream lightening

2019-04-28  Andy Wingo  <wingo@igalia.com>

	Stack alignment takes saved return address into account

2019-04-28  Andy Wingo  <wingo@pobox.com>

	Merge branch 'x86-32-ci' into 'master'
	Add 32-bit x86 to CI

	See merge request wingo/lightening!1

2019-04-28  Andy Wingo  <wingo@igalia.com>

	Add x86-32 tests to default test target

	Mark test files as precious to prevent them from being deleted by make

2019-04-27  Andy Wingo  <wingo@igalia.com>

	Add test for JIT callee with many args

	Add {enter,leave}_jit_abi calls in tests
	This saves and restores RBP on x86-32.

	Fix ABI of arg to extr_d_f test

	Fix jit_leave_jit_abi to pop correct registers
	Also relax stack alignment on 32-bit x86

2019-04-26  Andy Wingo  <wingo@igalia.com>

	Small bug fixes for ia32

	Add facility to enter and leave JIT ABI
	This allows us to save and restore callee-save temporaries, i.e. RBP on
	32-bit x86.  Otherwise it's a disaster shuffling stack arguments using
	temporaries.

	Remove most __X64_32 code
	The x32 ABI (i.e., amd64 with 32-bit pointers) is mostly a C language
	question.  From a JIT perspective it mostly looks just like amd64.  We
	can fix any differences in a followup, but x32 is also a pretty dead
	ABI, so I feel OK with this.

	Simplify 64/32 concerns in x86-cpu.c
	* lightening/x86-cpu.c (il): Take a uint64_t.  It's only called this
	  way.
	(imovi): Remove some x64_32 conditions; they seem bogus.

	Make jit_cpu private

	Fix 32-bit movi_d
	* lightening/x86-sse.c (movi_d): Fix combining of low and high double
	  halves.

	Fix compile warnings for 32-bit tests

	Use jit_word_t for register-sized values instead of intmax_t

	Fix lightening to compile on 32-bit x86

	Account for saved return address when locating args
	Also, fix alignment to be in bytes rather than bits.  Oops!

	Inline some internal definitions into backend-specific files

2019-04-26  Andy Wingo  <wingo@pobox.com>

	Ensure stack alignment in JIT code.
	* libguile/jit.c (emit_entry_trampoline): Explicitly align stack.

	Merge from upstream Lightening

2019-04-26  Andy Wingo  <wingo@igalia.com>

	Implement reloc shortening, and remove unused functionality

	Remove unused jit_epilog definition

2019-04-26  Andy Wingo  <wingo@pobox.com>

	Fix backtraces with call-with-values during bootstrap
	* libguile/programs.c (scm_i_program_name): Use scm_i_primitive_name for
	  primitives.  No functional change though.
	* libguile/vm.c (DEFINE_BUILTIN): Mark builtins as primitives.

2019-04-26  Andy Wingo  <wingo@igalia.com>

	Make jit_align_stack and jit_shrink_stack public

	Track frame size to more reliably align stack before calls

	Move jit_move_operands etc to common lightening.c file

2019-04-25  Andy Wingo  <wingo@pobox.com>

	Adapt to changes in upstream lightening
	* libguile/jit.c (emit_entry_trampoline): Adapt to change in callee-save
	  predicates.

	Merge from upstream lightening

2019-04-25  Andy Wingo  <wingo@igalia.com>

	Simplify register representation even more
	The register structures just contain the regno.  Since the only flag is
	the callee-save flag, we can punt that to a separate per-backend,
	per-target predicate.

	Simplify register representation again
	There's only one flag, "callee-save".  Also the regno range is limited
	to 0-63 inclusive, to allow for cheap register sets as uint64_t values.

2019-04-25  Andy Wingo  <wingo@pobox.com>

	Lower default JIT threshold as JIT is cheaper now
	* libguile/jit.c (default_jit_threshold): Lower from 50000 to 1000.

	Re-enable fixnum less-than JIT fast-path
	* libguile/jit.c (compile_less): Re-enable fast-path for fixnums, now
	  that the JIT library works :)

	Merge from upstream lightening

2019-04-25  Andy Wingo  <wingo@igalia.com>

	Align stack on 64-bit targets for calls

2019-04-25  Andy Wingo  <wingo@pobox.com>

	Merge from upstream lightening

2019-04-25  Andy Wingo  <wingo@igalia.com>

	Renumber x86 registers
	Now that there's no hazard to using a register used for passing
	arguments, renumber to give JIT_R/JIT_F/JIT_V names to all registers.

	Choose a temp register that's not used for passing arguments.  Our
	previous choice was an argument register (doh!) which made function
	calls with many arguments fail.

2019-04-25  Andy Wingo  <wingo@igalia.com>

	Simplify register representation
	Instead of JIT_R0 being a wrapped index into a table which then gives
	the regno and class, just have JIT_R0 be the wrapped regno and class.

2019-04-24  Andy Wingo  <wingo@pobox.com>

	Merge from upstream lightening

2019-04-24  Andy Wingo  <wingo@igalia.com>

	Fix apply_addend bug
	* lightening/x86.c (jit_move_operands): Fix bug when calling
	  apply_addend.

2019-04-24  Andy Wingo  <wingo@pobox.com>

	Fix a JIT bug
	* libguile/jit.c (compile): Reset frame size as well when restarting
	  compilation.  Fixes JIT errors.

	Adapt to new lightening call API
	* libguile/jit.c: Operands have their ABI in them.  We can now have
	  addends on GPR and MEM operands, which can improve register
	  allocation.  Use new jit_calli_3, etc helper APIs.

	Merge from upstream lightening

2019-04-24  Andy Wingo  <wingo@igalia.com>

	Add support for operand addends
	This can allow for better register allocation around calls for field
	locations.

	Add proper parallel-moves solver
	Add parallel assignment serializer from Guile, originating in the Caml
	paper by Rideau et al.

2019-04-22  Andy Wingo  <wingo@pobox.com>

	Merge from upstream lightening

2019-04-22  Andy Wingo  <wingo@igalia.com>

	Simplify API for loading call arguments

2019-04-17  Mark H Weaver  <mhw@netris.org>

	Reimplement SCM_MAKE_CHAR to evaluate its argument only once.
	The motivation for this change is that SCM_MAKE_CHAR is sometimes passed
	an expression that involves a procedure call that is not always trivial.
	In other cases, the results are not guaranteed to be the same both
	times, which could lead to the creation of invalid SCM objects.

	* libguile/chars.h (SCM_MAKE_CHAR): Reimplement.

2019-04-16  Andrea Azzarone  <andrea.azzarone@canonical.com>

	Fix gc.test "after-gc-hook gets called" failures.
	* libguile/scmsigs.c (signal_delivery_thread): Call scm_async_tick to
	give any pending asyncs a chance to run before we block indefinitely
	waiting for a signal to arrive.

2019-04-16  Mark H Weaver  <mhw@netris.org>

	Update user-visible copyright years.
	* doc/ref/guile.texi: Update years in copyright notice.
	* module/ice-9/command-line.scm (version-etc): Update 'copyright-year'.
	* module/system/repl/common.scm (*version*): Update copyright years.

2019-04-16  Mark H Weaver  <mhw@netris.org>

	Avoid passing NULL to 'memcpy' and 'memcmp'.
	Reported by Jeffrey Walton <noloader@gmail.com> in
	<https://lists.gnu.org/archive/html/guile-devel/2019-03/msg00001.html>.

	Note that C11 section 7.1.4 (Use of library functions) states that:
	"unless explicitly stated otherwise in the detailed descriptions [of
	library functions] that follow: If an argument to a function has an
	invalid value (such as ... a null pointer ...) ..., the behavior is
	undefined."  Note that 'strxfrm' is an example of a standard C function
	that explicitly states otherwise, allowing NULL to be passed in the
	first argument if the size argument is zero, but no similar allowance is
	specified for 'memcpy' or 'memcmp'.

	* libguile/bytevectors.c (scm_uniform_array_to_bytevector): Call memcpy
	only if 'byte_len' is non-zero.
	* libguile/srfi-14.c (charsets_equal): Call memcmp only if the number of
	ranges is non-zero.
	* libguile/stime.c (setzone): Pass 1-character buffer to
	'scm_to_locale_stringbuf', instead of NULL.
	* libguile/strings.c (scm_to_locale_stringbuf): Call memcpy only if the
	number of bytes to copy is non-zero.

2019-04-16  Mark H Weaver  <mhw@netris.org>

	Remove vestigial comment in tags.h.
	* libguile/tags.h: Remove a vestigial comment which seems to have been
	separated from its associated code long ago.

2019-04-05  Andy Wingo  <wingo@igalia.com>

	Fix lightening name

	Add support for "make test-ia32" in tests/

	Allow test suite to test multiple targets.
	* tests/Makefile: Allow for testing multiple targets.

2019-04-04  Andy Wingo  <wingo@pobox.com>

	Merge from upstream Lightening

2019-04-04  Andy Wingo  <wingo@igalia.com>

	Support spilling args to stack

2019-04-04  Andy Wingo  <wingo@pobox.com>

	Fix compilation of call-scm<-u64
	* libguile/jit.c (compile_call_scm_from_u64): Fix to take operands from
	  the right place.

	Fix arena expansion logic
	* libguile/jit.c (compile): Fix logic to clear old labels.

	JIT fixes for arena overflow
	* libguile/jit.c (compute_mcode): Move analysis outside the code
	emitter, as it doesn't need to re-run on overflow.
	(compile): Clear labels before emitting, as they may have changed if we
	overflowed.

	Minor JIT cleanups
	* libguile/jit.c (fp_scm_operand): Fix assertion about register state.
	(compile_call_scm_sz_u32): Fix ABI declaration for immediate.
	Some whitespace cleanups as well.

	Merge from upstream Lightening

	More various JIT fixen
	* libguile/jit.c (prepare_jit_state): Remove unused function.
	(initialize_thread_jit_state): Since the lightening state is allocated
	using GC memory, trace the JIT state.
	(compute_mcode): Avoid double-compile.

2019-04-04  Andy Wingo  <wingo@igalia.com>

	Support immediate arguments

2019-04-04  Andy Wingo  <wingo@pobox.com>

	Merge from upstream Lightening

	Fix some aspects of instruction mcode addresses
	* libguile/jit.c (struct scm_jit_state): Remove entry_mcode member.
	(add_inter_instruction_patch): Fix off-by-one.
	(compile): Reset reloc_idx when restarting a compile.  All instructions
	record their addresses.

2019-04-04  Andy Wingo  <wingo@igalia.com>

	Add assert for jit_address

2019-04-04  Andy Wingo  <wingo@pobox.com>

	Fix JIT bugs
	* libguile/jit.c (compile): Fix reloc fixup.
	(compute_mcode): Correctly compute entry mcode.

	Merge from upstream Lightening

	Fix jit_gpr_is_callee_save usage
	* libguile/jit.c (emit_entry_trampoline): Fix invocations for
	  jit_gpr_is_callee_save.

2019-04-04  Andy Wingo  <wingo@igalia.com>

	Fix reloc for jmpi and calli

2019-04-04  Andy Wingo  <wingo@pobox.com>

	Merge from upstream Lightening

2019-04-04  Andy Wingo  <wingo@igalia.com>

	Fix implementation of jit_{gpr,fpr}_is_callee_save

2019-04-04  Andy Wingo  <wingo@pobox.com>

	jit: Fix inter-instruction relocs.
	* libguile/jit.c (struct pending_reloc, emit_entry_trampoline)
	(add_inter_instruction_patch, compile, compute_mcode): Fix
	inter-instruction relocs.

2019-04-03  Andy Wingo  <wingo@pobox.com>

	Fix jit.c compilation
	* libguile/jit.c: Finish adaptation for lightening.  Still crashes
	  though.

	Remove -Wdeclaration-after-statement
	* configure.ac (HOST_CC): Now that we have C99, there's no need to warn
	  on mixed statements and declarations.

	Merge from upstream lightening

2019-04-03  Andy Wingo  <wingo@igalia.com>

	Add jit_same_{gprs,fprs} helpers

2019-04-03  Andy Wingo  <wingo@pobox.com>

	Checkpoint for lightning to lightening conversion

	Merge from upstream Lightening

2019-04-03  Andy Wingo  <wingo@igalia.com>

	Fix jit_reset to be useful

	Allow users to pass custom allocators

2019-04-03  Andy Wingo  <wingo@pobox.com>

	Adapt to lightning -> lightening name change
	* libguile/jit.c: Include lightening.h.
	* libguile/Makefile.am: Adapt.

	Merge in changes from upstream lightening

2019-04-03  Andy Wingo  <wingo@igalia.com>

	Change headers and files to be named "lightening" instead of "jit"
	This improves integration with other projects.  Like for example Guile
	already has files named jit.c and jit.h; it's easier to manage if
	lightening uses its own file names.

2019-04-03  Andy Wingo  <wingo@pobox.com>

	Add subdir-objects option to libguile makefile.
	* libguile/Makefile.am (AUTOMAKE_OPTIONS): Add subdir-objects, to allow
	  for having two files named "jit.c".

	Replace GNU Lightning with Lightening

2019-04-03  Andy Wingo  <wingo@igalia.com>

	Clean up stack after calls

	Provide some type safety for jit_gpr_t and jit_fpr_t

	Implement arg shuffling for jit_call{i,r}

	get_temp_{gpr,xpr} returns a jit_{gpr,fpr}_t

2019-04-02  Mark H Weaver  <mhw@netris.org>

	Fix typo in comment.
	* module/ice-9/boot-9.scm: Fix typo.

2019-03-26  Andy Wingo  <wingo@igalia.com>

	Remove old tests

	Add movi_[df] tests

	Add int->float tests

	Add float/double cast inst tests

	Add truncr_[df]_[li] tests

	Add abs/sqrt tests

	Add push/pop test

	Add some nop and jmp tests, and fix a hazard with jmpi/calli

	Add sub-and-branch-on-overflow tests

	Add add-and-branch-on-overflow tests

	Add flag-checking test-and-branch tests

	Add unordered float compare-and-branch tests

	Add anti-float comparison tests

	Add int/int reg/imm compare-and-branch tests

	Add floating-point reg/reg compare-and-branch tests

	Add more integer reg/reg branch-and-compare tests

	Add bltr test
	Also rework how relocs are represented.

	Fix stxi_d bug
	Also present in upstream; reported.

	Tweak test build to run faster, and adapt CI

2019-03-26  Andy Wingo  <wingo@pobox.com>

	Add .gitlab-ci.yml

2019-03-26  Andy Wingo  <wingo@igalia.com>

	Add stxi tests

	Add stxr tests

	Add sti tests

	Add str tests

	Add ldxi tests

	Add ldxr tests

	Add ldi tests

	Add ldr tests

	Add bswap tests, and fix missing breaks in jit_load_args

	Add extr tests

	Add mov_addr test

	Rework naming of test suite files

	Add comr/negr tests

	Add lsh/rsh tests

	Add bitops tests

	Add remr tests

	Add more div tests

2019-03-25  Andy Wingo  <wingo@igalia.com>

	Tests for some div operations

	Add more tests

	Add new tests

	Add note about current status

	Flesh out README

	Convert tests to jit_load_args

	Better loading of args to registers; add tests

	Add "addi" test

	Implementation of new design
	Documentation to come, as tests get added and things settle down.

2019-02-24  Michael Gran  <spk121@yahoo.com>

	Disable test for current value of setitimer on Cygwin
	* test-suite/tests/signals.test ("current itimers are 0"): throws unresolved
	    for cygwin

	Make locale monetary conversion tests be less strict on terminal whitespace
	* test-suite/tests/i18n.test (monetary-amount->locale-string): modified

2019-02-24  Michael Gran  <spk121@yahoo.com>

	Handle newlib C library's langinfo constant names
	The newlib C library (used in Cygwin) has alternative names for
	nl_langinfo GNU extensions

	* configure.ac (_NL_NUMERIC_GROUPING): new test
	* libguile/i18n.c (INT_CURR_SYMBOL, MON_DECIMAL_POINT, MON_THOUSANDS_SEP)
	   (MON_GROUPING, POSITIVE_SIGN, NEGATIVE_SIGN, GROUPING, INT_FRAC_DIGITS)
	   (FRAC_DIGITS, P_CS_PRECEDES, P_SEP_BY_SPACE, N_CS_PRECEDES, N_SEP_BY_SPACE)
	   (P_SIGN_POSN, N_SIGN_POSN, INT_P_CS_PRECEDES, INT_P_SEP_BY_SPACE)
	   (INT_N_CS_PRECEDES, INT_N_SEP_BY_SPACE, INT_P_SIGN_POSN, INT_N_SIGN_POSN)
	   [HAVE_DECL__NL_NUMERIC_GROUPING]: map to newlib C constants, when present

2019-02-24  Michael Gran  <spk121@yahoo.com>

	Add a fallback value for the locale-monetary-decimal-point
	* module/ice-9/i18n.scm (locale-monetary-decimal-point): use "." as fallback

2019-02-22  Andy Wingo  <wingo@igalia.com>

	Fix race when expanding syntax-parameterize and define-syntax-parameter
	* module/ice-9/psyntax.scm (put-global-definition-hook)
	  (get-global-definition-hook): Inline into uses.
	  (make-binding): Change format of lexically defined or rebound syntax
	  parameters to just be the transformer, not a list of the transformer.
	  (resolve-identifier, expand-install-global, expand-body)
	  (syntax-parameterize): Adapt to use the variable object (box) holding
	  the top-level syntax parameter as the "key" for lookups into the
	  lexical environment, instead of a fresh object associated with the
	  syntax transformer.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	Fixes #27476, a horrible race when one thread is expanding a
	syntax-parameterize form including uses, and another thread is expanding
	the corresponding define-syntax-parameter.  See
	https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27476#102.

2019-02-22  Andy Wingo  <wingo@pobox.com>

	Fix race when expanding syntax-parameterize and define-syntax-parameter
	* libguile/macros.c (scm_i_make_primitive_macro): Give primitive macros
	  a primitive-macro macro-type.
	* module/ice-9/psyntax.scm (put-global-definition-hook)
	  (get-global-definition-hook): Inline into uses.
	  (make-binding): Change format of lexically defined or rebound syntax
	  parameters to just be the transformer, not a list of the transformer.
	  (resolve-identifier, expand-install-global, expand-body)
	  (syntax-parameterize): Adapt to use the variable object (box) holding
	  the top-level syntax parameter as the "key" for lookups into the
	  lexical environment, instead of a fresh object associated with the
	  syntax transformer.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	Fixes #27476, a horrible race when one thread is expanding a
	syntax-parameterize form including uses, and another thread is expanding
	the corresponding define-syntax-parameter.  See
	https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27476#102.

2019-02-22  Andy Wingo  <wingo@pobox.com>

	Fix linker.test
	* test-suite/tests/linker.test (link-elf-with-one-main-section): Adapt
	  to change in c9e052be495de408e834018f5cc0401874f06c7d.

2019-02-21  Andy Wingo  <wingo@pobox.com>

	Fix crypt-on-glibc test error
	* test-suite/tests/posix.test ("crypt"): Allow for the given salt being
	  valid.  Thanks to Jonathan Brielmaier for the report and debugging!

2019-02-10  Mike Gran  <spk121@yahoo.com>

	Fix binary output on files created by mkstemp!
	Some operating systems require a O_BINARY flag.

	* libguile/filesys.c (scm_i_mkstemp): Don't mask out O_BINARY flag
	* test-suite/tests/posix.test ("binary mode honored"): new test

2019-02-10  Mike Gran  <spk121@yahoo.com>

	Avoid leaking a file descriptor in test-unwind
	* test-suite/standalone/test-unwind.c (check_ports): explicitly close temp file

	Fix strftime compile with null threads
	* libguile/stime.c (scm_strftime): use correct pthread lock function

2019-02-09  Mike Gran  <spk121@yahoo.com>

	Remove redefinition of when & unless in snarf-check-and-output-texi
	* module/scripts/snarf-check-and-output-texi.scm (when, unless): removed

	Don't mutate read-only string in ports test
	* test-suite/tests/ports.test ("valid wide mode string"): modified

2019-02-01  Andy Wingo  <wingo@pobox.com>

	Fix crypt-on-glibc test error
	* test-suite/tests/posix.test ("crypt"): Allow for the given salt being
	  valid.  Thanks to Jonathan Brielmaier for the report and debugging!

2018-12-16  Ludovic Courtès  <ludo@gnu.org>

	Do not warn the user when 'madvise' returns ENOSYS.
	* libguile/vm.c (return_unused_stack_to_os): Avoid 'perror' calls when
	'madvise' returns ENOSYS.

2018-12-12  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix tests for SRFI-19 date->string ~N

2018-12-11  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Support ~N in SRFI-19 string->date
	* module/srfi/srfi-19.scm (fractional-integer-reader,
	  make-fractional-integer-reader): From reference implementation.
	  (reader-directives): Handle #\N, from reference implementation.
	* test-suite/tests/srfi-19: Add tests for string->date ~N.
	* doc/ref/srfi-modules.texi (string->date): Add line for ~N.

2018-11-12  Mark H Weaver  <mhw@netris.org>

	Update (ice-9 match) to include selected bug fixes from upstream.
	Fixes <https://bugs.gnu.org/22925> and other bugs.

	* module/ice-9/match.upstream.scm: Apply selected fixes from the
	upstream match.scm in Chibi-Scheme.
	* test-suite/tests/match.test.upstream: Add more tests from upstream.

2018-11-12  Mark H Weaver  <mhw@netris.org>

	Fix spelling of ellipsis in (ice-9 match).
	* module/ice-9/match.upstream.scm: Change several occurrences
	of 'ellipse' and 'ellipses' to 'ellipsis', to more closely match
	match.scm from Chibi-Scheme.

2018-11-04  Andy Wingo  <wingo@igalia.com>

	Beginnings of port of x86 to new design

	Make _rvs array static-const

	Inline private.h into jit.c

2018-10-31  Andy Wingo  <wingo@igalia.com>

	Remove needless PUBLIC/HIDDEN definitions

	Really finish stdint conversion

	Update gitignore

	Finish conversion to stdint types

	"extern"-related cleanup, and further implementation

	Trim unneded bits from jit.c

2018-10-31  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Documentation fixes
	* doc/ref/api-control:
	* doc/ref/compiler.texi: Language fixes
	* doc/ref/compiler ($kfun): Renamed argument clauses -> clause.

2018-10-31  Andy Wingo  <wingo@igalia.com>

	Update call/receive machinery
	Update calls and receives to take their arguments all at once, for more
	efficient shuffling.

2018-10-30  Andy Wingo  <wingo@igalia.com>

	Add endian.h

	Replace jit_int32_t, etc with stdint types

	Create beginning of stripped-down lightning interface
	This file is the beginning of a lightened lightning.

	Remove unneeded bits of lightning

	Simplify file names

	Remove -sz.c files
	The new form of this library will not need them.

	Rename lightning.c to jit.c

	Rename include to jit.h, move all files to jit/
	This change is in anticipation of making this lightning fork into an
	include-only library.

	Remove autotools

	Remove bits of .gitignore no longer needed

	Remove TODO

	Archive lightning ChangeLog

	Move lightning.texi up to root, and remove Makefile.am

	Inline body.texi and version.texi into lightning.texi

	Remove example .c files from documentation

2018-10-30  Andy Wingo  <wingo@pobox.com>

	Strip "get-jit-size" feature from lightning.
	* libguile/lightning/Makefile.am:
	* libguile/lightning/configure.ac:
	* libguile/lightning/size.c: Remove devel-only "get-jit-size" feature.

2018-10-30  Andy Wingo  <wingo@igalia.com>

	Update .gitignore

	Update version.texi

2018-10-29  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Another language fix
	* doc/ref/vm.texi: Fix bad sentence.

	Language fix
	* doc/ref/vm.texi: Fix bad sentence.

2018-10-28  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Bootstrap optimization
	* bootstrap/Makefile.am: Build both eval.go and psyntax-pp.go before
	  the rest of the .go files so that they are handled by a fast macro
	  expander. This saves time for a parallel build.

2018-10-25  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Add texinfo dependency to README
	* README: Add texinfo dependency.

2018-10-24  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Minor refactor of leap second table lookups.
	* module/srfi/srfi-19.scm (leap-second-delta): Replace with ...
	(utc->tai): ... this.
	(leap-second-neg-delta): Replace with ...
	(tai->utc): ... this.
	(current-time-tai, priv:time-tai->time-utc!, priv:time-utc->time-tai!)
	(time-tai->julian-day, time-monotonic->julian-day): Adapt accordingly.

	SRFI-19: time-utc->date: Support non-integer nanoseconds values.
	* module/srfi/srfi-19.scm (time-utc->date): Use 'floor-remainder'
	instead of 'modulo'.

2018-10-22  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Check for incompatible types in time comparisons.
	Fixes <https://bugs.gnu.org/26163>.
	Reported by Zefram <zefram@fysh.org>.

	* module/srfi/srfi-19.scm (time-compare-check): New procedure.
	(time=?): Use 'time-compare-check' to check the arguments and raise an
	error in case of mismatched types.  Previously, mismatched types would
	cause time=? to return #f.
	(time>?, time<?, time>=?, time<=?, time-difference!): Use
	'time-compare-check' to check the arguments.

2018-10-22  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Fix normalization of seconds and nanoseconds in time records.
	Fixes <https://bugs.gnu.org/26162>.
	Reported by Zefram <zefram@fysh.org>.

	* module/srfi/srfi-19.scm (time-normalize!): Rewrite.
	* test-suite/tests/srfi-19.test: Add tests.

2018-10-21  Mikael Djurfeldt  <mikael@djurfeldt.com>

	Spelling fixes
	* doc/ref/data-rep.texi: Spelling
	* doc/ref/vm.texi: Spelling

2018-10-21  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Add a few more tests.
	This is a followup to commit a58c7abd72648f77e4ede5f62a2c4e7969bb7f95.

	* test-suite/tests/srfi-19.test: Add tests for large positive years.

2018-10-21  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Fix handling of negative years and negative julian days.
	Fixes <https://bugs.gnu.org/21906>.
	Mitigates <https://bugs.gnu.org/21903> and <https://bugs.gnu.org/21904>.
	Reported by: Zefram <zefram@fysh.org>.

	* module/srfi/srfi-19.scm (encode-julian-day-number)
	(decode-julian-day-number, date-week-number): Use 'floor-quotient'
	instead of 'quotient', and 'floor' instead of 'truncate', where
	appropriate.
	(time-utc->date): Ensure that the 'nanoseconds' field of the returned
	date is non-negative.
	(leap-year): Handle negative years properly, and reformulate the
	computation.
	(week-day): Handle negative years properly.  Use 'floor-quotient'
	instead of 'quotient' where appropriate.
	(directives): In the handler for '~Y' format escapes, improve the
	handling of years outside of the range 0-9999.
	(read-directives): Add a FIXME comment to fix the '~Y' reader to handle
	years outside of the range 0-9999.
	* test-suite/tests/srfi-19.test: Import (srfi srfi-1).  Use Guile's
	modern keyword notation in the 'define-module' form.  Add more tests.

2018-10-20  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Fix TAI->UTC conversions, leap second handling, etc.
	Fixes <https://bugs.gnu.org/21911>.
	Fixes <https://bugs.gnu.org/22034>.
	Fixes <https://bugs.gnu.org/21902>.
	Partially fixes <https://bugs.gnu.org/21904>.
	Reported by Zefram <zefram@fysh.org>.

	* doc/ref/srfi-modules.texi (SRFI-19 Introduction): Fix the definitions
	of Julian Day and Modified Julian Day.  Give the correct full names of
	UTC and TAI.
	* module/srfi/srfi-19.scm: Import (srfi srfi-1).  Use modern Guile
	keyword syntax in the 'define-module' form.
	(leap-second-neg-delta): New procedure, derived from a similar procedure
	in the latest upstream SRFI-19 reference implementation.
	(priv:time-tai->time-utc!, time-tai->julian-day)
	(time-monotonic->julian-day): Use 'leap-second-neg-delta'.
	(local-tz-offset): Fix comment.
	(leap-second?): Remove.
	(tai-before-leap-second?): New procedure, derived from upstream SRFI-19.
	(time-utc->date): Use 'define*' to handle the optional argument.  Remove
	the leap second handling, following upstream SRFI-19.
	(time-tai->date): Rewrite in terms of 'time-utc->date'.  Add special
	leap second handling, following upstream SRFI-19.
	(time-monotonic->date): Rewrite in terms of 'time-tai->date'.
	(date->time-tai, date->time-monotonic): Add special leap second
	handling, following upstream SRFI-19.
	(directives): In the entry for the "~Y" escape in 'date->string', pad
	the year field to 4 characters, following upstream SRFI-19.
	* test-suite/tests/srfi-19.test: Add tests.

2018-10-20  Mark H Weaver  <mhw@netris.org>

	scm_seed_to_random_state: Support wide string arguments.
	Partially fixes <https://bugs.gnu.org/33044>.
	Reported by Tom de Vries <tdevries@suse.de>.

	* libguile/random.c (scm_seed_to_random_state): Use 'scm_to_utf8_string'
	(or 'scm_to_latin1_string' for a narrow string, for compatibility) to
	convert the string into raw bytes for use by 'scm_c_make_rstate'.  Make
	sure the length in bytes fits within an 'int'.

2018-10-20  Mark H Weaver  <mhw@netris.org>

	Fix typo in strings.h.
	* libguile/strings.h: In a comment, add the missing "i_" in
	"scm_i_is_narrow_string".

2018-10-20  Mark H Weaver  <mhw@netris.org>

	Fix type inferencing for 'nil?' and 'null?' predicates.
	Fixes <https://bugs.gnu.org/33036>.
	Reported by <calcium@disroot.org>.

	* module/language/cps/types.scm (define-simple-type-inferrer):
	Apply (logand (&type val) <>) uniformly.  Previously, this was done only
	in the false branch.  Rename local variable to 'type*', to allow the
	macro operand 'type' to be an arbitrary expression.
	(*type-inferrers*)<null?>: Add &nil to the set of possible types.
	(*type-inferrers*)<nil?>: Add &false and &null to the set the possible
	types.
	* module/language/cps/type-fold.scm (*branch-folders*)<null?>: Add &nil
	to the set of possible types.
	(*branch-folders*)<nil?>: Add &false and &null to the set the possible
	types.
	* test-suite/tests/compiler.test: Add tests.

2018-10-18  Mark H Weaver  <mhw@netris.org>

	Use 'scm_from_utf8_{string,symbol,keyword}' for C string literals.
	Partial fix for <https://bugs.gnu.org/33044>.
	Reported by Tom de Vries <tdevries@suse.de>.

	Fix several instances of the mistake of using 'scm_from_locale_*' for C
	strings that originally came from a C string literal.  Change several
	uses of 'scm_from_latin1_*' as well, to promote the practice of writing
	code that works for arbitrary C string literals.

	Also add missing years to the copyright notices of changed files, based
	on the git history.

	* libguile/debug-malloc.c, libguile/deprecation.c, libguile/error.c,
	libguile/eval.c, libguile/expand.c, libguile/extensions.c,
	libguile/filesys.c, libguile/init.c, libguile/load.c,
	libguile/modules.c, libguile/pairs.c, libguile/posix.c,
	libguile/print.c, libguile/random.c, libguile/read.c,
	libguile/regex-posix.c, libguile/snarf.h, libguile/srfi-13.c,
	libguile/stacks.c, libguile/stime.c, libguile/strports.c,
	libguile/values.c: Use 'scm_from_utf8_*' where appropriate.

2018-10-16  Mark H Weaver  <mhw@netris.org>

	Fix typos, indentation and error reporting in SRFI-19.
	* module/srfi/srfi-19.scm: Fix typos in comments, indentation, and pass
	the correct 'caller' name to 'time-error' in several places.

	Update SRFI-19 leap second table.
	* module/srfi/srfi-19.scm (leap-second-table): Update to include the
	leap second on 1 January 2017.

2018-10-14  Chris Marusich  <cmmarusich@gmail.com>

	Clarify the manual's "Processes" section.
	* doc/ref/posix.texi (Processes): Use the phrase "integer status value"
	consistently, and add a cross-reference to the section of the glibc
	manual that explains what it is.

2018-10-14  Mark H Weaver  <mhw@netris.org>

	In 'ash' and 'round-ash', handle right shift count of LONG_MIN.
	Fixes <https://bugs.gnu.org/21901>.
	Reported by Zefram <zefram@fysh.org>.

	* libguile/numbers.c: Add another top-level 'verify' to ensure that
	LONG_MIN is not a fixnum.
	(scm_ash, scm_round_ash): Ensure that when the shift count is LONG_MIN,
	it is not handled via the normal code path, to avoid signed overflow
	when the shift count is negated.
	* test-suite/tests/numbers.test: Add tests.

2018-10-14  Mark H Weaver  <mhw@netris.org>

	Fix 'round-ash' of negative integers by huge right shift counts.
	This is a followup to commit 011aec7e240ef987931548d90c53e6692c85d01c.

	When rounding, right shifting a negative integer by a huge shift count
	results in 0, not -1.

	* libguile/numbers.c: Add top-level 'verify' to ensure that the
	assumptions in 'scm_ash' and 'scm_round_ash' are valid.
	(scm_round_ash): In the case that handles huge right shifts, require
	that the shift count _exceeds_ the integer length, and return 0 instead
	of -1.
	* test-suite/tests/numbers.test: Adjust tests accordingly.

2018-10-14  Mark H Weaver  <mhw@netris.org>

	Gracefully handle huge shift counts in 'ash' and 'round-ash'.
	Fixes <https://bugs.gnu.org/32644>.
	Reported by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.

	The need for this arose because the type inferrer for 'ursh' sometimes
	passes (- 1 (expt 2 64)) as the second argument to 'ash'.

	* libguile/numbers.c (scm_ash, scm_round_ash): Gracefully handle several
	cases where the shift count does not fit in a C 'long'.
	* test-suite/tests/numbers.test: Add tests.

2018-10-14  Mark H Weaver  <mhw@netris.org>

	Fix list validation of *list->bytevector procedures.
	Fixes <https://bugs.gnu.org/32938>.
	Reported by Josh Datko <jbd@cryptotronix.com>.

	* libguile/validate.h (SCM_VALIDATE_LIST_COPYLEN)
	(SCM_VALIDATE_NONEMPTYLIST_COPYLEN): Use '!=' instead of '>=' to
	validate the result of 'scm_ilength' after it has been stored in
	the user variable 'cvar'.
	* test-suite/tests/bytevectors.test: Add tests.  Use '#:use-module'
	instead of ':use-module' in 'define-module' form.

2018-10-14  Mark H Weaver  <mhw@netris.org>

	Improve the documentation for 'nil?'.
	* libguile/boolean.c (scm_nil_p): Improve docstring.
	* doc/ref/api-languages.texi (Nil): Add documentation for 'nil?', along
	with a description of how Elisp interprets Scheme booleans and
	end-of-list.

2018-10-10  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix 32/64 bit bug in INTEGER_ACCESSOR_PROLOGUE

2018-10-10  Andy Wingo  <wingo@pobox.com>

	GNU Guile 2.9.1
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to 2.9.1.

	Fix GUILE_ENABLE_JIT after latest change
	* acinclude.m4: Fix syntax.

	Bump prerelease version numbering to 2.9.x
	* GUILE-VERSION (GUILE_MINOR_VERSION): Bump to 9.
	* NEWS: Update expected version numbers.
	* configure.ac: Update pattern.

	Only enable JIT by default on x86-64
	* acinclude.m4: Disable JIT by default on not-x86-64.  Although I got
	  JIT mostly working on 32-bit x86, I got nondeterministic segfaults
	  deep in lightning, on that platform; perhaps indicating a bug in the
	  optimizer.  After a day of poking and not solving the problem, I think
	  that I don't want the complexity of Lightning's node representation,
	  especially on platforms that get less testing.  In the future we'll
	  use the lightning backends without the node layer.
	* NEWS: Update.

2018-10-09  Andy Wingo  <wingo@igalia.com>

	Fix JIT of 64-bit comparisons on 32-bit architectures
	* libguile/jit.c (compile_u64_imm_less): Compare high word using
	  not-equal, to avoid a signedness compare.
	(compile_s64_imm_less, compile_imm_s64_less): Fix the not-less cases.

	Better ursh/ulsh/srsh JIT on 32-bit platforms
	* libguile/jit.c (compile_ursh_immediate, compile_ulsh_immediate)
	(compile_srsh_immediate): Special-case shifts by 32 bits on 32-bit
	platforms.  Avoids shifting by 0.

	Fix JIT register state tracking for use of SP or FP as temp
	* libguile/jit.c (record_gpr_clobber): If we clobber SP or FP, clear the
	  appropriate register state bits.  Only exercised for 32-bit targets in
	  practice!
	  (emit_alloc_frame, emit_push_frame): Fix a couple places where we were
	  failing to track the register state correctly.
	  (compile_umul): Remove a needless register state flush, nowthat
	  qmulr_u has a wrapper that tracks this for us.

2018-10-08  Andy Wingo  <wingo@igalia.com>

	Fix JIT compilation on 32-bit targets
	* libguile/jit.c: Fix compilation on 32-bit targets.  Still not working
	  however.

2018-10-08  Andy Wingo  <wingo@pobox.com>

	Fix linker bug that could fail to find the shstrtab
	* module/system/vm/linker.scm (<linker-object>): Add name field.  This
	  allows the linker to find sections by name, notably before having
	  found the .shstrtab section.  As there can be multiple sections with
	  type SHT_STRTAB, this fixes a bug whereby we could use a section
	  name (a strtab index) into an unrelated strtab.  In the past this
	  worked because with ASCII identifiers there won't be an exception,
	  although it is possible to accidentally mistake a shared string tail;
	  but with UTF-8 identifiers, it's possible for a string table index to
	  point in the middle of a codepoint, which is likely not valid UTF-8
	  and would raise a bug.  Keeping an additional section name field fixes
	  this bug.  Adapt all callers to pass a name argument to
	  make-linker-object.
	  (find-shstrndx): Update to look at the name field.
	* module/system/vm/assembler.scm (make-object): Pass name to
	  make-linker-object.

	Thanks to Daniel Llorens for the test case.

2018-10-07  Andy Wingo  <wingo@pobox.com>

	Fix guile-config for Guile 3.0
	* meta/guile-config.in (guile-module): Use pkg-config for effective
	  version.

	Fix -Wunused-function error for x86 not on sun
	* libguile/lightning/lib/jit_x86-x87.c (_fstcwm): Surround definition
	  with ifdef(sun).

	Fix unused local warning in vm-engine.c
	* libguile/vm-engine.c (return-values): Remove needless frame_size=3
	  local var.

	Fix lightning build with jit_names.c
	* libguile/lightning/lightning.am (lightning_extra_files): Move
	  jit_names.c here.

	Revert "Remove jit_names.c."
	This reverts commit b74e1f0de322e74930b46b826b0492638eb521b1.

	Remove jit_names.c.
	* libguile/lightning/lib/jit_names.c: Remove unused file.
	* libguile/lightning/lightning.am (lightning_c_files): Remove
	  jit_names.c.
	* libguile/lightning/lib/jit_print.c: Remove jit_names.c inclusion.

	Fix GCC warning with %char-set-dump.
	* libguile/srfi-14.c (scm_sys_char_set_dump): Silence an erroneous
	  -Wformat-overflow warning based on an incorrect range inference by
	  increasing output buffer size.

	Deprecate scm_find_executable
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_find_executable): Deprecate.  Use strdup
	  instead of weird scm_cat_path function.
	* libguile/script.h:
	* libguile/script.c: Remove old decls.

	Remove unimplemented decl in script.h
	* libguile/script.h (scm_find_impl_file): Remove unimplemented decl.

	Comment out some unused definitions
	* libguile/jit.c: Comment out unused var decls.

	Fix use of uninstalled header by installed headers
	* libguile/Makefile.am (libpath.h): Remove definition of
	  SCM_EFFECTIVE_VERSION, which is defined in version.h.
	* libguile/extensions.h: Remove libpath.h inclusion, as it's not
	  installed.
	* libguile/atomic.c:
	* libguile/bytevectors.c:
	* libguile/control.c:
	* libguile/fdes-finalizers.c:
	* libguile/foreign-object.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/goops.c:
	* libguile/i18n.c:
	* libguile/instructions.c:
	* libguile/intrinsics.c:
	* libguile/ioext.c:
	* libguile/load.c:
	* libguile/loader.c:
	* libguile/poll.c:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/programs.c:
	* libguile/r6rs-ports.c:
	* libguile/srfi-1.c:
	* libguile/srfi-60.c:
	* libguile/threads.c:
	* libguile/unicode.c:
	* libguile/vm.c:
	* libguile/weak-vector.c: Include version.h for the
	  SCM_EFFECTIVE_VERSION definition.

	Update NEWS
	* NEWS: Update.

	Minor additional manual updates
	* doc/ref/api-debug.texi (VM Hooks): Update for changes in VM hook API.
	* doc/ref/guile.texi: Update copyright years.
	* doc/ref/preface.texi (Contributors): Update.

	Add manual section on JIT compiler
	* doc/ref/vm.texi (Just-In-Time Native Code): New section.
	* doc/ref/compiler.texi (Extending the Compiler): Update.

2018-10-06  Mark H Weaver  <mhw@netris.org>

	Fix 'atomic-box-compare-and-swap!'.
	Fixes <https://bugs.gnu.org/32786>.

	'scm_atomic_compare_and_swap_scm' is a thin wrapper around
	'atomic_compare_exchange_weak' (where available), and therefore it may
	spuriously fail on some platforms, leaving the atomic object unchanged
	even when the observed value is equal to the expected value.  Since
	'scm_atomic_compare_and_swap_scm' returns both a boolean result and the
	observed value, the caller is able to detect spurious failures when
	using that API.

	'atomic-box-compare-and-swap!' presents a simpler API, returning only
	the observed value.  The documentation advises callers to assume that
	the exchange succeeded if the observed value is 'eq?' to the expected
	value.  It's therefore not possible to report spurious failures with
	this API.

	'atomic-box-compare-and-swap!' uses 'scm_atomic_compare_and_swap_scm',
	and prior to this commit would simply ignore the boolean result and
	return the observed value.  In case of spurious failures, the caller
	would legitimately conclude that the exchange had succeeded.

	With this commit, 'atomic-box-compare-and-swap!' now retries in case of
	spurious failures.

	* libguile/atomic.c (scm_atomic_box_compare_and_swap_x): If
	'scm_atomic_compare_and_swap_scm' returns false and the observed value
	is equal to 'expected', then try again.
	* libguile/vm-engine.c (atomic-box-compare-and-swap!): Ditto.

2018-10-04  Andy Wingo  <wingo@pobox.com>

	Fix f32-set! JIT compilation
	* libguile/jit.c (compile_f32_set): Fix to write an f32, not a f64.

2018-10-03  Andy Wingo  <wingo@pobox.com>

	Update compiler.texi
	* doc/ref/compiler.texi: Update for compiler changes in Guile 3.

	Rename $closure to $const-fun
	* module/language/cps.scm ($const-fun): Rename from $closure, as we
	  always use this now with nfree == 0.
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/devirtualize-integers.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/licm.scm:
	* module/language/cps/peel-loops.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/rotate-loops.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/specialize-numbers.scm:
	* module/language/cps/types.scm:
	* module/language/cps/utils.scm:
	* module/language/cps/verify.scm: Adapt users.

2018-09-30  Andy Wingo  <wingo@pobox.com>

	Finish updating vm.texi
	* doc/ref/compiler.texi (Bytecode): Update macro-assembler instructions,
	  and move most of them to the instruction set reference.
	* doc/ref/vm.texi (A Virtual Machine for Guile, VM Programs): Minor
	  fixes.
	(Instruction Set): Update for Guile 3 instruction set.
	* libguile/vm-engine.c (vm_engine): Update a few instruction
	  docstrings.

2018-09-28  Andy Wingo  <wingo@pobox.com>

	Update "Variables and the VM"
	* doc/ref/vm.texi (Variables and the VM): Update.

	Update "Stack Layout"
	* doc/ref/vm.texi (Stack Layout): Update.

	Update "VM Concepts"
	* doc/ref/vm.texi (VM Concepts): Update.

	Update "Why a VM?"
	* doc/ref/vm.texi (Why a VM?): Update.

	Update "A Virtual Machine for Guile"
	* doc/ref/vm.texi (A Virtual Machine for Guile): Update.

2018-09-27  Andy Wingo  <wingo@pobox.com>

	Update data representation chapter in the manual
	* doc/ref/data-rep.texi (The SCM Type in Guile): Refer to scm.h.
	(Relationship Between SCM and scm_t_bits): Better title-case.
	(Immediate Objects): Better title-case.  Prefer "heap object" over
	"cell".
	(Non-Immediate Objects): Better title-case.  Deprecate the concept of
	cells.
	(Allocating Heap Objects): Rename from Allocating Cells.
	(Heap Object Type Information): Rename from Heap Cell Type Information.
	(Accessing Heap Object Fields): Rename from Accessing Cell Entries.
	* doc/ref/vm.texi: Update references.

	Update Conservative GC section of manual
	* doc/ref/data-rep.texi (Conservative GC): Update notes with more
	  details.

2018-09-25  Andy Wingo  <wingo@pobox.com>

	Update history.texi.
	* doc/ref/history.texi (A Timeline of Selected Guile Releases)
	(Status): Update.

2018-09-23  Ludovic Courtès  <ludo@gnu.org>

	Define AT_SYMLINK_NOFOLLOW et al.
	* libguile/posix.c (scm_init_posix): Define AT_SYMLINK_NOFOLLOW,
	AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, and AT_EMPTY_PATH when available.
	(scm_utime): Mention AT_SYMLINK_NOFOLLOW.
	* doc/ref/posix.texi (File System): Update accordingly.
	* test-suite/tests/posix.test ("utime")["AT_SYMLINK_NOFOLLOW"]: New test.

	time: Use #: for 'define-module' clauses.
	* module/ice-9/time.scm: Use #: instead of : in 'define-module' form.

	time: Support expressions that return any number of values.
	* module/ice-9/time.scm (time-proc): Call PROC with 'call-with-values';
	return all its values.

	time: Use 'syntax-rules' instead of 'define-macro'.
	* module/ice-9/time.scm (time): Rewrite using 'define-syntax-rule'.

2018-09-22  Andy Wingo  <wingo@pobox.com>

	Update comments in vm-engine.c
	* libguile/jit.c (compile_s64_numerically_equal): Remove as this
	instruction was removed in previous refactoring.
	(compile_atomic_scm_set_immediate), compile_atomic_scm_ref_immediate):
	Adapt to change in C name of these instructions.
	* libguile/vm-engine.c: Add comments for all instructions.

	Fix case where running abort hook could trash registers
	* libguile/vm-engine.c (abort): If the abort doesn't need to longjmp and
	  the abort hook was enabled, cache registers first to avoid restoring
	  a bad IP to the VM.

2018-09-20  Andy Wingo  <wingo@pobox.com>

	Configure uses 2.3.x tags for version
	* configure.ac: Only pick 2.3.x tags for the version.  Will need to bump
	  when we do 3.0.

	Renumber instructions and bump objcode version
	* libguile/loader.h (SCM_OBJCODE_MINIMUM_MINOR_VERSION):
	  (SCM_OBJCODE_MINOR_VERSION): Bump version.
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.
	* libguile/vm-engine.c: Rearrange opcodes to be contiguous and in a
	  somewhat sensible order.

2018-09-17  Andy Wingo  <wingo@pobox.com>

	Fix --disable-jit compilation
	* libguile/jit.c: Wrap the whole thing in ENABLE_JIT.
	* libguile/threads.c (on_thread_exit):
	* libguile/vm.c (scm_call_n):
	* libguile/init.c (scm_i_init_guile):
	* libguile/vm-engine.c (VM_NAME): Wrap calls into jit.c with ENABLE_JIT.
	* configure.ac: Move up AC_CANONICAL_TARGET, as autoconf was complaining
	  about it coming after AC_ARG_PROGRAM.
	* acinclude.m4 (GUILE_ENABLE_JIT): Fix to honor --enable-jit arg.

2018-09-15  Andy Wingo  <wingo@pobox.com>

	Turn on automatic JIT compilation by default
	* libguile/jit.c (default_jit_threshold): New static const variable.
	(scm_sys_jit_compile): Remove.
	(scm_init_jit): Rename GUILE_JIT_COUNTER_THRESHOLD to
	GUILE_JIT_THRESHOLD, and default to default_jit_threshold.  Remove
	%jit-compile definition.

	Fix emergency aborts to not expand the stack
	* libguile/vm.c (scm_i_vm_emergency_abort): New helper: an abort that
	  doesn't allocate, not even stack.
	* libguile/throw.c (abort_to_prompt): Use scm_i_vm_emergency_abort.
	* libguile/vm.h: Declare helper.

2018-09-14  Andy Wingo  <wingo@pobox.com>

	Fix scm_make_foreign_object_n.
	* libguile/foreign-object.c (scm_make_foreign_object_n): Fix computation
	  of slot count; broken in 34b9f22ca.

	Deoptimize to VM when hooks are enabled
	* libguile/vm.c (vm_clear_mcode_return_addresses): New helper.
	(vm_recompute_disable_mcode): Force a thread to deoptimize if hooks
	become enabled.
	(scm_call_n): Don't enter mcode if it's disabled.  Also check the right
	flag for when to run the abort hook (the abort_hook_enabled flag).
	* libguile/vm-engine.c (instrument-entry, instrument-loop)
	(return-values, abort, compose-continuation): Don't enter mcode if mcode
	is disabled for this thread.

	Hook refactors
	* libguile/vm.h (SCM_VM_NUM_HOOKS): Remove hook enumeration.
	(struct scm_vm): Re-arrange members to be more dense and to use common
	cache lines for commonly-used members.  Declare hooks and their enabled
	flags by name.
	* libguile/vm-engine.c (RUN_HOOK): Refer to hooks by name.
	* libguile/vm.c (FOR_EACH_HOOK): New helper.
	(vm_hook_compute_enabled, vm_recompute_disable_mcode): New routines to
	recompute when hooks are enabled, and whether to disable mcode because
	hooks are active.
	(set_vm_trace_level): New helper.
	(invoke_hook): Take hook to invoke by value.
	(DEFINE_INVOKE_HOOK): Refactor to use named hooks.
	(scm_i_vm_prepare_stack): Init named hooks.
	(VM_ADD_HOOK, VM_REMOVE_HOOK): Refactor to use named hooks, and also
	recompute global disable_mcode flag.
	(scm_set_vm_trace_level_x, scm_c_set_vm_engine_x): Use internal helper.

	Micro-optimization of scm_vm placement in scm_thread
	* libguile/threads.h (struct scm_thread): Move the embedded "struct
	  scm_vm" earlier in the scm_thread.  Since the VM (and the JIT) access
	  VM data (SP, FP, etc) through the thread pointer, this allows more
	  accesses to be encoded in shorter instruction sequences.

	Remove hook intrinsics: hooks are just for the VM
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Remove VM hook
	  intrinsics, now that we're going to rely on the interpreter for
	  stepping and breakpoints.
	* libguile/jit.c (struct scm_jit_state): Remove "hooks_enabled" member,
	  now that we won't JIT.  Remove all code related to calling hooks.
	* libguile/vm-engine.c (RUN_HOOK): Call hooks directly instead of
	  through intrinsics.  Use precise per-hook enable flags.
	* libguile/vm.c (DEFINE_INVOKE_HOOK): New helper.  Use to define the
	  hook invokers.

	VM manages hook sets itself
	* libguile/vm.h (SCM_VM_ABORT_HOOK): Rename from
	  SCM_VM_ABORT_CONTINUATION_HOOK.
	* libguile/vm-engine.c (ABORT_HOOK):
	* libguile/vm.c (invoke_abort_hook): Adapt to SCM_VM_ABORT_HOOK name
	change.
	(reset_vm_hook_enabled): New helper.
	(VM_ADD_HOOK, VM_REMOVE_HOOK): New helper macros, replacing
	VM_DEFINE_HOOK.
	(scm_vm_add_abort_hook_x, scm_vm_remove_abort_hook_x)
	(scm_vm_add_apply_hook_x, scm_vm_remove_apply_hook_x)
	(scm_vm_add_return_hook_x, scm_vm_remove_return_hook_x)
	(scm_vm_add_next_hook_x, scm_vm_remove_next_hook_x): New functions,
	replacing direct access to the hooks.  Allows us to know in a more
	fine-grained way when to enable hooks.
	(scm_set_vm_trace_level_x): Use reset_vm_hook_enabled to update the
	individual hook_enabled flags.
	* module/statprof.scm:
	* module/system/vm/coverage.scm:
	* module/system/vm/traps.scm:
	* module/system/vm/vm.scm: Adapt VM hook users to the new API.

2018-09-10  Andy Wingo  <wingo@pobox.com>

	Fix JIT compilation of intrinsics that return doubles
	* libguile/jit.c (emit_retval_d): New helper.
	(compile_call_f64_from_scm): Take the f64 result from the correct
	registers.

	Fix positional-arguments<=? compilation
	* libguile/jit.c (compile_check_positional_arguments): Fix.

2018-09-07  Andy Wingo  <wingo@pobox.com>

	Fix compilation of compare-and-swap
	* libguile/jit.c (compile_atomic_scm_compare_and_swap_immediate): Call
	  the right intrinsic.

	Refactor handling of lightning state
	* libguile/jit.c (prepare_jit_state, reset_jit_state): New helpers.
	(emit_code): Prevent emission of auxiliary data.
	(compile_handle_interrupts): Assume the handle_interrupts_trampoline is
	compiled eagerly.
	(initialize_thread_jit_state): New helper.
	(initialize_jit): Refactor.  Emit handle-interrupts code here.
	(compute_mcode): Adapt to initialize_jit refactorings.
	(scm_jit_state_free): Nothing to do.

	Fix compilation of handle-interrupts
	* libguile/jit.c (compile_handle_interrupts): Fix check for blocked
	  interrupts.

	Use custom JIT code allocator
	* libguile/jit.c (struct code_arena): New data type.
	(struct scm_jit_state): Add code arena member.
	(allocate_code_arena): New helper.
	(emit_code): New helper.  Emits code into a thread-local code arena.
	(compute_mcode): Allow for failure to JIT.
	(scm_jit_compute_mcode): Stop automatic JIT compilation on resource
	exhaustion.

2018-09-05  Andy Wingo  <wingo@pobox.com>

	Revert "<?" fast path for now
	* libguile/jit.c (compile_less): Revert fast path; causing errors in
	  benchmarks.

	Add JIT fast paths for inum arithmetic
	* libguile/jit.c (compile_call_scm_from_scm_scm): Add fast paths for
	  inum add and sub.
	  (compile_call_scm_from_scm_uimm): Add fast paths for inum
	  add/immediate and sub/immediate.
	  (compile_less): Add fast path for inum compare.

	Fix JIT compilation of [positional-]arguments<=?
	* libguile/jit.c (compile_check_arguments)
	  (compile_check_positional_arguments): Fix these functions.  The
	  compiler uses "jge" as a "compare result not NONE", but the VM
	  instructions set NONE on greater-than, not greater-than-or-equal.
	  Sad!

	Improve JIT cleanup a bit
	* libguile/jit.c (initialize_jit): Improve cleanup a bit.

2018-09-03  Andy Wingo  <wingo@pobox.com>

	Fix nonlocal abort to compiled continuation
	* libguile/vm.c (scm_call_n): Fix failure to reset vm.registers after a
	  nonlocal abort to a compiled continuation.

2018-09-02  Andy Wingo  <wingo@pobox.com>

	Improve compute_mcode allocation logic
	* libguile/jit.c (compute_mcode): Move up some assertions before using
	  them to allocate.

	Fix a memory leak in JIT
	* libguile/jit.c (compute_mcode): Fix memory leak.  Ultimate fix will be
	  to use arena allocation, but that will come later.

	Fix assertion error running compile-file with threshold 0
	* libguile/jit.c (emit_alloc_frame_for_sp): Don't require that FP be in
	  a register, but if it was and we call out, do restore it.

	Add ability to tier up from within loops
	* libguile/jit.c (struct scm_jit_state): Add entry and entry_label
	  members.
	(analyze): Assert entry is jump target.
	(compile): Record indirect entry label.
	(compute_mcode): Record entry IP, and return entry mcode.
	(scm_sys_jit_compile, scm_jit_compute_mcode): Adapt to compute_mcode
	change.  Support hot-loop transfer.

	JIT counter tweaks
	* libguile/vm-engine.c (instrument-entry, instrument-loop): Make the
	  counter check >=, so that we can set the threshold to 0 and still get
	  compilation.
	* libguile/jit.h (enum scm_jit_counter_value): Make the increments
	  event.

	Add configurable JIT logging levels
	* libguile/jit.c (jit_log_level): New local.
	(_LOG, INFO, DEBUG, LOG): New macros.
	(compile1):
	(compute_mcode):
	(scm_jit_enter_mcode): Use new logging macros.

	Prevent Lightning from stompling our registers
	* libguile/jit.c (emit_exit): Add uses of SP and FP.

2018-09-01  Andy Wingo  <wingo@pobox.com>

	Add ability to stop JIT after N compilations.
	* libguile/jit.c (jit_stop_after, jit_pause_when_stopping): New locals.
	  (scm_jit_compute_mcode): Add ability to stop after N compilations.
	  (scm_jit_enter_mcode): Comment out printfs for the time being.
	  (scm_init_jit): Init locals from environment variables.

	Minor 32-bit untag-fixnum optimization
	* libguile/jit.c (compile_untag_fixnum): Minor optimization in 32-bit
	  case.

	Fix compilation of compile_eq
	* libguile/jit.c (compile_eq): Compare to register, not immediate.

2018-08-31  Andy Wingo  <wingo@pobox.com>

	More JIT debugging
	* libguile/jit.c (compile1): Add debug for when instructions are first
	  compiled.  Will be removed when all is working.
	  (compute_mcode): Add debugging about what code is compiled.
	  (scm_sys_jit_compile): Remove per-instruction output.
	  (scm_jit_compute_mcode): Actually compile JIT code.  Use
	  GUILE_JIT_COUNTER_THRESHOLD to control when JIT happens.

	JIT threshold controlled by environment variable
	* libguile/jit.c (scm_jit_counter_threshold): Make a static variable
	  instead of a compile-time constant.
	  (scm_init_jit): Init scm_jit_counter_threshold from
	  GUILE_JIT_COUNTER_THRESHOLD environment variable.  Default is -1
	  indicating "never JIT".
	* libguile/vm-engine.c (instrument-entry, instrument-loop): Adapt to new
	  variable.

	Minor optimization in compile_alloc_frame
	* libguile/jit.c (compile_alloc_frame): Remove useless FP reload.

2018-08-29  Andy Wingo  <wingo@pobox.com>

	Fix bind-kwargs JIT compilation
	* libguile/jit.c (COMPILE_X8_C24__C8_C24__X8_C24__N32): Fix unpacking of
	  N32 arg.

	Fix JIT compilation of composable continuations
	* libguile/control.c (compose_continuation_code): Fix offset of code
	  end.
	* libguile/jit.c (compile_compose_continuation): Fix test for mcode not
	  null.

	Fix jit function data for goto_continuation_code
	* libguile/continuations.c (goto_continuation_code): Fix offset of end
	  of code.

	Fix JIT compilation of shuffle-down
	* libguile/jit.c (compile_shuffle_down): Fix compilation.

	Fix JIT compilation of call-with-prompt
	* libguile/jit.c (compile_prompt): Actually push the MRA arg.
	  (analyze): Mark call continuations as entries, as both FP and SP are
	  set then, and also mark prompt handlers as entries (and blocks).

	Fix miscompilation for "abort" opcode
	* libguile/jit.c (compile_abort): Fix miscompilation.

	Add fast paths to intrinsics
	* libguile/intrinsics.c (add_immediate, sub_immediate, less_p)
	  (numerically_equal_p): Add fast paths.  Makes one test locally go from
	  .77s interpreted to .60s.
	  (scm_to_uint64_truncate): Add a likelihood annotation.

	Maybe enter JIT when returning from interpreted functions
	* libguile/jit.c (scm_jit_compute_mcode): Minor optimization.
	* libguile/vm-engine.c (return-values): Maybe return to JIT code.

	JIT tracks register clobbers
	* libguile/jit.c (struct scm_jit_state): Add beginnings of a little
	  local register allocator.
	  (reset_register_state): New helper.
	  (clear_scratch_register_state): Use new helper.
	  (record_gpr_clobber, record_fpr_clobber): New helpers, used when there
	  may be cached variables in registers, called when registers are
	  written.
	  (set_sp_cache_gpr, set_sp_cache_fpr): New helpers, called when results
	  are written to the stack.
	  (emit_retval, emit_movi, emit_ldxi, DEFINE_CLOBBER_RECORDING_EMITTER_R)
	  (DEFINE_CLOBBER_RECORDING_EMITTER_P, DEFINE_CLOBBER_RECORDING_EMITTER_R_I)
	  (DEFINE_CLOBBER_RECORDING_EMITTER_R_R): New wrappers for Lightning API
	  that also records register clobbers.  Update callers.
	  (save_reloadable_register_state): New helper.
	  (restore_reloadable_register_state): Rename from
	  ensure_register_state.

2018-08-28  Andy Wingo  <wingo@pobox.com>

	JIT: Store FP in register during procedure prolog/epilog
	* libguile/jit.c (scm_jit_state): Add op_attrs array, for a pre-pass,
	  and store state of what's in registers.
	  (SP, FP): Reassign to scratch registers, as in general these need to
	  be reloaded anyway after callouts.
	  (die, DIE, ASSERT, UNREACHABLE): Add better invariant-testing.
	  (clear_register_state, clear_scratch_register_state)
	  (set_register_state, has_register_state, ASSERT_HAS_REGISTER_STATE):
	  Add machinery to track state of SP and FP.  Can eventually track
	  scratch register assignments as well.  Adapt code to use these.
	  (compile_atomic_ref_scm_immediate): Compile to a vanilla load on x86.
	  (compile_handle_interrupts): Analogous atomic-ref changes here.
	  (analyze): New helper, a simple once-through pre-pass to identify
	  branch targets.
	  (compile): Only generate labels for branch targets.  Reset register
	  state at branch targets.
	  (compute_mcode): Initialize j->op_attrs appropriately.

2018-08-26  Andy Wingo  <wingo@pobox.com>

	Bug-fix for alloc-frame and stack moving
	* libguile/jit.c (emit_push_frame): Simplification; we never need to
	  store old_fp and new_fp at once.
	  (compile_alloc_frame): Fix to not keep a pointer into the stack across
	  a stack expansion.

	Minor JIT refactor
	* libguile/jit.c (emit_alloc_frame_for_sp): Remove unused "fp" arg.
	  Adapt callers.

2018-08-25  Andy Wingo  <wingo@pobox.com>

	Fuse comparisons and branches in JIT
	* libguile/jit.c (emit_load_compare_result)
	  (emit_store_compare_result): Remove these.
	  (emit_branch_if_frame_locals_count_not_eq): New helper.
	  (fuse_conditional_branch): New helper.
	* libguile/jit.c (compile_u64_numerically_equal)
	  (compile_u64_less, compile_s64_less, compile_f64_numerically_equal)
	  (compile_f64_less, compile_numerically_equal, compile_less)
	  (compile_check_arguments, compile_check_positional_arguments):
	  (compile_immediate_tag_equals, compile_heap_tag_equals)
	  (compile_eq, compile_heap_numbers_equal)
	  (compile_s64_imm_numerically_equal, compile_u64_imm_less)
	  (compile_imm_u64_less, compile_s64_imm_less, compile_imm_s64_less):
	  Fuse conditional branches, to avoid going through compare-result.
	  (compile_jl, compile_je, compile_jnl, compile_jne, compile_jge)
	  (compile_jnge): Abort, since they shouldn't be reachable.

	JIT refactor
	* libguile/jit.c (struct scm_jit_state): Store next ip, so that
	  compilers can fuse opcodes.
	  (op_lengths): New static variable.
	  (emit_direct_tail_call): Add a fast case for self-recursion.
	  (compile1): Move IP advancement out of the specific arity compilers;
	  instead precompute a "next_ip", that can be incremented.

2018-08-24  Andy Wingo  <wingo@pobox.com>

	Fix again the unknown-filling of alloc-frame
	* libguile/jit.c (compile_alloc_frame): Yet another fix, because I am an
	  idiot.

	Fix JIT compilation of bind-rest
	* libguile/jit.c (compile_bind_rest): Fix.

	Fix fp-ref, fp-set! helpers in jit for signedness
	* libguile/jit.c (emit_fp_ref_scm, emit_fp_set_scm): Fix signedless of
	  offsets.

	Fix bug in compile-alloc-frame
	* libguile/jit.c (compile_alloc_frame): Fix alloc-frame filling in of
	  undefined values for when previous frame size was unknown.

	Clear frame size after subr-call, return-values
	* libguile/jit.c (compile_return_values, compile_subr_call): Clear frame
	  size.

	Fix r12 register spec for lightning with sysv x86-64 ABI
	* libguile/lightning/lib/jit_x86.c (_rvs): Mark R12 as callee-save.

2018-08-23  Andy Wingo  <wingo@pobox.com>

	32-bit fix for emit_run_hook
	* libguile/jit.c (emit_run_hook): Use sign-extending load, as unsigned
	  load doesn't exist on 32-bit targets.

	Minor refactors to jit.c
	* libguile/jit.c (emit_direct_tail_call): Add FIXME.
	  (emit_mov): Simplify implementation.
	  (emit_branch_if_frame_locals_count_less_than):
	  (emit_branch_if_frame_locals_count_eq):
	  (emit_branch_if_frame_locals_count_greater_than):
	  (emit_load_fp_slot):
	  (emit_branch_if_immediate):
	  (emit_load_heap_object_word):
	  (emit_load_heap_object_tc):
	  (emit_branch_if_heap_object_has_tc):
	  (emit_branch_if_heap_object_not_tc):
	  (emit_branch_if_heap_object_not_tc7):
	  (emit_entry_trampoline):
	  (emit_handle_interrupts_trampoline):
	  (initialize_handle_interrupts_trampoline):
	  (emit_free_variable_ref): Move later in the file.

	Fix load width of get-ip-relative-addr
	* libguile/jit.c (emit_get_ip_relative_addr): Fix load width.

	Fix in-tree builds
	* libguile/Makefile.am (AM_CPPFLAGS): Use -iquote for $(builddir)
	  instead of -I, to avoid having in-tree builds find libguile/poll.h for
	  <poll.h>.

	Optimizations to subr-call
	* libguile/jit.c (compile_subr_call): Optimizations.

	Comments in the JIT
	* libguile/jit.c: Add some overview comments.

2018-08-21  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Add $(builddir) to include path in libguile/Makefile.am

2018-08-20  Andy Wingo  <wingo@pobox.com>

	Add support for labels, and fix a bug in uadd/imm and usub/imm.
	* libguile/jit.c (add_inter_instruction_patch, compile, compute_mcode):
	  Add support for labels.
	  (compile_uadd_immediate, compile_usub_immediate): Fix cases where we
	  were adding the wrong operand as an immediate.

	Add out-of-line handle-interrupts trampoline stub
	* libguile/jit.c (emit_handle_interrupts_trampoline)
	  (initialize_handle_interrupts_trampoline)
	  (compile_handle_interrupts): Handle most of the slow case of
	  handle-interrupts out-of-line, to avoid code bloat.

	Tweak to instrument-entry
	* libguile/vm-engine.c (instrument-entry): Eagerly check if data->mcode
	  is already set, and in that case just jump directly without checking
	  the counter.

	Fix frame popping in JIT
	* libguile/jit.c (emit_entry_trampoline): Don't bother hackily trying to
	  save registers; the "jit_frame" call handles that.
	  (compile_return_values, compile_return_from_interrupt): Fix bug when
	  computing previous FP: no need to add frame_overhead_slots.
	  (emit_load_prev_fp_offset, emit_store_prev_fp_offset): Rename from
	  emit_load_prev_frame_size, emit_store_prev_frame_size.
	  (emit_push_frame): Adapt to emit_store_prev_frame_size.  Don't
	  subtract off the frame_overhead_slots.
	  (scm_jit_enter_mcode): Comment out a printf for the time being.

	JIT compilation tweaks
	* libguile/jit.c (emit_alloc_frame_for_sp, compile_current_thread): Fix
	  some ldxr/ldxi stxr/stxi confusions.
	  (compile_alloc_frame): Omit if the frame size is already correct.
	  (compile, compute_mcode, scm_sys_jit_compile, scm_jit_enter_mcode):
	  Add a bit more debugging.

	Fix bounds on compiler-emitted JIT metadata
	* module/system/vm/assembler.scm (link-data): Fix relocation addend for
	  JIT data bounds.  I never get this right!

	Fix default code allocator in Lightning
	* libguile/lightning/lib/lightning.c (_jit_emit): The default code
	  allocator will simply mmap a code buffer, try to emit into that
	  buffer, and if it fails, try again with a larger buffer.  However the
	  buffer size starts at 0, for some reason.  Why?  I can't see the
	  reason.  Change the default to 4096.  In the future we will need to
	  implement our own allocator anyway so that we can pack multiple JIT
	  runs in one page.

	Manual JIT interface via %jit-compile
	* libguile/init.c (scm_i_init_guile): Call scm_init_jit ().
	* libguile/jit.c (enter_mcode, exit_mcode): New static members; code
	  pointers for the JIT trampoline.
	  (emit_exit): New helper.  The Lightning tramp/frame mechanism that we
	  use needs to exit via a jmp instead of a return.  Adapt callers of
	  jit_ret.
	  (emit_entry_trampoline): Use the "frame" mechanism to enter the JIT.
	  (compile1): Add missing "break" after case statements.  Oops!
	  (compile): Add prolog and "tramp" to compiled functions.
	  (initialize_jit): New local routine to init the JIT on demand.
	  (compute_mcode): New helper, to compile a function.
	  (scm_sys_jit_compile): New function, exported to Scheme as
	  %jit-compile.
	  (scm_jit_compute_mcode): Return the existing mcode if the function is
	  at the start.
	  (scm_jit_enter_mcode): Call the enter_mcode trampoline.
	* libguile/jit.h (struct scm_jit_state): Declare, so we can make
	  pointers to it.
	* libguile/threads.h (struct scm_thread): Add jit_state member.
	* libguile/threads.c (on_thread_exit): Free the jit state.

2018-08-19  Andy Wingo  <wingo@pobox.com>

	First implementation of a template JIT
	* libguile/jit.c: Implement most of a JIT.  Untested and still needs to
	  be wired up.

	Expose scm_vm_builtin_ref internally
	* libguile/vm-builtins.h:
	* libguile/vm.c (scm_vm_builtin_ref): Expose internally.

	Add internal function mapping subr index to function
	* libguile/gsubr.h:
	* libguile/gsubr.c (scm_subr_function_by_index): New internal function.
	  (scm_subr_function): Use new function.

2018-08-17  Andy Wingo  <wingo@pobox.com>

	Add instrumentation to VM builtins
	* libguile/intrinsics.h: Add "intrinsic" for handle-interrupts code.
	  Unlike the other intrinsics, this one isn't a function.
	* libguile/programs.c (try_parse_arity): Add cases for instructions used
	  in VM builtins.
	  (scm_primitive_call_ip): Return #f if call-ip not found.
	* libguile/vm-engine.c (handle-interrupts): Get code from intrinsics.
	* libguile/vm.c
	* libguile/vm.c (instrumented_code, define_vm_builtins): Add
	  instrumentation to the builtins, so that they can be JIT-compiled.
	  (INIT_BUILTIN): Remove min-arity setting; the fallback min-arity
	  interpreter should figure it out.
	  (scm_bootstrap_vm): Call the new define_vm_builtins function.
	* libguile/gsubr.c (primitive_call_ip): Return 0 if call IP not found.
	  (primitive_subr_idx): Interpret call ip == 0 as not-a-subr.
	* module/system/vm/program.scm (program-arguments-alist): Allow a #f
	  call-ip.

2018-08-13  Andy Wingo  <wingo@pobox.com>

	Define intrinsics for atomic ops
	* libguile/intrinsics.h:
	* libguile/intrinsics.c (atomic_ref_scm, atomic_set_scm):
	  (atomic_swap_scm, atomic_compare_and_swap_scm): New intrinsics, given
	  that lightning doesn't know atomics.
	  (scm_bootstrap_intrinsics): Init new intrinsics.
	* libguile/vm-engine.c (atomic-scm-ref/immediate)
	  (atomic-scm-set!/immediate, atomic-scm-swap!/immediate)
	  (atomic-scm-compare-and-swap!/immediate): Use intrinsics, to be like
	  the JIT.

	64-bit intrinsic args and return values passed indirectly on 32-bit
	* libguile/intrinsics.h (INDIRECT_INT64_INTRINSICS): New definition.  If
	  true, int64 args and return values are passed by reference.  Here to
	  make JIT easier.
	* libguile/intrinsics.c (indirect_scm_to_int64, indirect_scm_to_uint64):
	  (indirect_scm_to_uint64_truncate, indirect_scm_from_int64):
	  (indirect_scm_from_uint64, indirect_lsh, indirect_rsh): New indirect
	  variants.
	  (scm_bootstrap_intrinsics): Use indirect variants as appropriate.
	* libguile/vm-engine.c: Update to call indirect intrinsics if
	  appropriate.

	Avoid needless 64-bit args on 32-bit machines for some intrinsics
	* libguile/intrinsics.h:
	* libguile/intrinsics.c (string_set_x): Change to take size_t and u32 as
	  args.
	  (allocate_words): Change to take size_t as arg.
	* libguile/vm.c (expand_apply_argument): Rename from rest_arg_length,
	  and also handle the stack manipulation.
	* libguile/vm-engine.c (expand-apply-argument): Update for intrinsic
	  change.
	  (call-scm-sz-u32): Rename from call-scm-u64-u64, as it matches its
	  uses and will compile better on 32-bit systems.
	* module/system/vm/assembler.scm (define-scm-sz-u32-intrinsic):
	  (string-set!): Update for new instrinsic call inst.
	* libguile/jit.c (compile_call_scm_sz_u32): Adapt.

	Update error-wrong-num-args intrinsic prototype
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/intrinsics.c (error_wrong_num_args): Take the thread as an
	  arg, instead of the ostensible callee.
	* libguile/vm-engine.c: Update callers of wrong-num-args intrinsic to
	  pass a thread instead.

	Adapt JIT calling convention; continuations take mra from stack
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Update prototype of
	  capture-continuation.
	* libguile/jit.h:
	* libguile/jit.c (scm_jit_enter_mcode): Return void, not the vra.
	  Instead, we expect the code to set vp->ip for the vra.
	* libguile/vm-engine.c (instrument-entry, instrument-loop)
	  (return-values, abort): Adapt scm_jit_enter_mcode calling convention.
	  (capture-continuation): No need to pass an mra; the intrinsic will
	  read it from the stack.
	* libguile/vm.c (capture_continuation): Remove mra arg, as we take mra
	  from the continuation.
	  (scm_call_n): Adapt to scm_jit_enter_mcode change.

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

	Continuations capture machine code address
	* libguile/continuations.c (scm_i_continuation_to_frame): Adapt to vra
	  field renaming.
	  (scm_i_reinstate_continuation, grow_stack, copy_stack_and_call)
	  (scm_dynthrow): Take mra of continuation.  Set on the vp before the
	  longjmp.
	* libguile/continuations.h: Update scm_i_reinstate_continuation
	  prototype.
	* libguile/dynstack.h:
	* libguile/control.c (scm_suspendable_continuation_p):
	* libguile/dynstack.c (PROMPT_WORDS, PROMPT_VRA, PROMPT_MRA):
	  (PROMPT_JMPBUF, scm_dynstack_push_prompt, scm_dynstack_find_prompt)
	  (scm_dynstack_wind_prompt): Store both virtual and machine return
	  addresses on the dynstack, for prompts.
	* libguile/eval.c (eval): Pass NULL for mra.
	* libguile/intrinsics.c (push_prompt): Add mra arg, and pass it to the
	  dynstack.
	* libguile/intrinsics.h: Update prototypes so that continuation-related
	  intrinsics can save and restore the MRA.
	* libguile/jit.h:
	* libguile/jit.c: Return VRA when JIT code needs to tier down.
	* libguile/stacks.c (find_prompt, scm_make_stack)
	* libguile/throw.c (catch): Adapt find-prompt calls.
	* libguile/vm-engine.c (instrument-entry, instrument-loop): Add logic to
	  continue with vcode after the mcode finishes.
	  (compose-continuation, capture-continuation, abort, prompt): Add logic
	  to pass NULL as captured MRA, but continue with mcode from new
	  continuations, if appropriate.
	* libguile/vm.c (scm_i_vm_cont_to_frame, capture_stack)
	  (scm_i_capture_current_stack, reinstate_continuation_x)
	  (capture_continuation, compose_continuation_inner, compose_continuation)
	  (capture_delimited_continuation, abort_to_prompt): Adapt to plumb
	  around machine code continuations.
	  (scm_call_n): Check "mra_after_abort" field for machine code
	  continuation, if any.
	* libguile/vm.h (struct scm_vm): Add "mra_after_abort" field.
	  (struct scm_vm_cont): Rename "ra" field to "vra" and add "mra" field.

2018-08-11  Andy Wingo  <wingo@pobox.com>

	Rework foreign-call trampoline
	* libguile/foreign.c (scm_i_foreign_call): Rename back from
	  foreign_call.  Need a new trampoline that's easier to call from JIT,
	  until we actually rewrite the FFI in terms of the JIT.
	  (scm_register_foreign): Remove foreign_call intrinsic init.
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Foreign-call
	  intrinsic sets return directly on stack.
	* libguile/vm-engine.c (foreign-call): Adapt to new intrinsic behavior.
	* libguile/vm.c (foreign_call, scm_bootstrap_vm): Add new intrinsic
	  wrapper.

	Invoke VM hooks through intrinsics
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Make intrinsics for
	  the VM hooks.
	* libguile/vm-engine.c (RUN_HOOK): Run hooks through the intrinsics
	  table.
	* libguile/vm.c (invoke_apply_hook, invoke_return_hook):
	  (invoke_next_hook, invoke_abort_hook): Rename, remove NOINLINE
	  attribute (as we call them through the intrinsics table).
	  (scm_bootstrap_vm): Init new intrinsics.

	Add unpack-values-object intrinsic
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add
	  unpack-values-object.
	* libguile/vm-engine.c (subr-call): If the object is a values object,
	  call out to unpack-values-object.  This is to avoid reifying
	  allocate-frame code in each jitted subr.
	* libguile/vm.c (unpack_values_object, scm_bootstrap_vm): Define new
	  intrinsic.

2018-08-08  Andy Wingo  <wingo@pobox.com>

	Change call/cc inst to capture-continuation
	* libguile/jit.c (compile_capture_continuation): Rename from call_cc now
	  that the call is elsewhere.
	* libguile/vm-engine.c (call, tail-call): Remove needless SYNC_IP before
	  get-callee-vcode; the intrinsic can sync the ip if needed from the
	  frame.
	  (capture-continuation): Rename from call/cc, and leave the call itself
	  to tail-call.
	* libguile/vm.c (vm_builtin_call_with_current_continuation_code): Update
	  to put the continuation in a local and then tail call.
	  (get_callee_vcode): Sync vp->ip if we error.

	Rework program->ip mapping in VM to always call intrinsic
	* libguile/intrinsics.h:
	* libguile/vm.c (get_callee_vcode): Rename from apply_non_program, and
	  instead return the IP for the callee of a frame.
	  (scm_call_n, scm_bootstrap_vm): Adapt to get_callee_vcode change.
	* libguile/vm-engine.c (call, tail-call, call/cc): Use
	  get_callee_vcode unconditionally.  JIT will do this to avoid so much
	  code generation for calls.

	Minor optimization in RESET_FRAME
	* libguile/vm-engine.c (RESET_FRAME): Remove update of sp_min_since_gc.

2018-08-07  Andy Wingo  <wingo@pobox.com>

	Add missing include to adapt to recent merge from master
	* libguile/r6rs-ports.c: Add syscalls.h include for scm_from_off_t.

	Merge branch 'master' into lightning
	This includes a manual cherry-pick of relevant stable-2.2 commits up to
	4c91de3e45e7c98d5b7c484509fe5c59bd70f9fd.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	Fix R6RS call-with-{input,output}-file to open textual ports.
	Fixes <https://bugs.gnu.org/32329>.
	Reported and diagnosed by Göran Weinholt <goran@weinholt.se>.

	* module/rnrs/io/simple.scm (call-with-input-file)
	(call-with-output-file): Use 'open-{input,output}-file' to open the port
	in textual mode.  Previously 'open-file-{input,output}-port' was used,
	which opened the port in binary mode.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	srfi-19: Remove unused procedure.
	* module/srfi/srfi-19.scm (date->broken-down-time): Remove.

	Add -Wshadowed-toplevel.
	* module/language/tree-il/analyze.scm (shadowed-toplevel-analysis): New
	variable.
	* module/language/tree-il/compile-cps.scm (%warning-passes): Add it.
	* module/system/base/message.scm (%warning-types): Add it.
	* test-suite/tests/tree-il.test ("warnings")["shadowed-toplevel"]: New
	test prefix.
	* module/ice-9/boot-9.scm (%auto-compilation-options): Add it.
	* doc/ref/api-evaluation.texi (Compilation): Add 'shadowed-toplevel' and
	'macro-use-before-definition'.

	r6rs-ports: 'put-bytevector' accepts 64-bit integers.
	* libguile/r6rs-ports.c (scm_put_bytevector): Use 'size_t' for c_start,
	c_count, and c_len.

	compile: Update copyright year.
	* module/scripts/compile.scm (show-version): Update copyright year.

	compile: Improve error message.
	* module/scripts/compile.scm (parse-args): Add missing newline in
	"unrecognized option" message.

	compile: Add '-x' flag.
	* module/scripts/compile.scm (%options, compile): Add '-x'.
	* doc/ref/api-evaluation.texi (Compilation): Document it.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	r6rs-ports: Accept 'port-position' values greater than 2^32.
	Reported by Ricardo Wurmus <rekado@elephly.net>.
	Fixes <https://bugs.gnu.org/32161>.

	* libguile/r6rs-ports.c (custom_binary_port_seek): Use 'scm_to_off_t'
	instead of 'scm_to_int'.
	* test-suite/tests/r6rs-ports.test ("8.2.7 Input Ports")["custom binary
	input port position, long offset"]: New test.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	Make srfi-71 visible through 'cond-expand'.
	This is a followup to commit eb90831ce81bcb85ae96d27011ebe71955cdf75d.

	* module/srfi/srfi-71.scm: Add missing 'cond-expand-provide'.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	Update release docs.
	* doc/release.org: Update web site instructions.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	build: Really build srfi/srfi-71.scm.
	Commit eb90831ce81bcb85ae96d27011ebe71955cdf75d added it to the wrong
	makefile.

	* module/Makefile.am (SOURCES): Add srfi/srfi-71.scm.
	* module/srfi/Makefile.am: Remove.  It's a leftover from the 2009 build
	system rework in commit 3bb299b3f0d5b31957a6447d095ed723268019be.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS: Update.

	Update copyright years in '--version' and the manual.
	* module/ice-9/command-line.scm (version-etc): Change #:copyright-year
	to 2018.
	* doc/ref/guile.texi: Add 2017 and 2018 to the copyright years.
	* configure.ac (GUILE_CONFIGURE_COPYRIGHT): Add 2018.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	Serialize accesses to submodule hash tables.
	Fixes <https://bugs.gnu.org/30602>.

	Previously, when compiling files in parallel like Guix does, threads
	would be concurrently inserting, rehashing, and reading the submodule
	hash table of module ().  Thus, some threads would sometimes see an
	inconsistent state, leading to errors such as:

	  Module named (system repl debug) does not exist

	* module/ice-9/boot-9.scm (call-with-module-autoload-lock): Move higher
	in the file.
	(module-name): Use it around call to 'nested-define-module!'.
	(resolve-module): Wrap the whole thing in 'call-with-module-autoload-lock'.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	vm: Fix stack-marking bug in multi-threaded programs.
	Fixes <https://bugs.gnu.org/28211>.

	* libguile/vm-engine.c (call, call_label, handle_interrupts): Add
	'new_fp' variable; set the dynamic link and return address of the frame
	at NEW_FP before setting 'vp->fp'.  This fixes a bug whereby, in a
	multi-threaded context, the stack-marking code could run after vp->fp
	has been set but before its dynamic link has been set, leading the
	stack-walking code in 'scm_i_vm_mark_stack' to exit early on.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	linker: Don't rely on out-of-range bv-ref exceptions.
	* module/system/vm/linker.scm (find-shstrndx): Check whether NAME is
	lower than the length of BV; remove 'false-if-exception' around
	'string-table-ref' call.

	GDB support: Add 'guile-backtrace' command.
	* libguile/libguile-2.2-gdb.scm <top level>: Add 'register-command!' call.

	GDB support: Add note about (gdb frame-filters).
	* libguile/libguile-2.2-gdb.scm <top level>: Add comment.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	GDB support: Fix 'display-vm-frames'.
	Previously 'vm-frame-older' would fail to traverse the chain of frames.

	* libguile/libguile-2.2-gdb.scm (uint-type): New variable
	(vm-frame): Fix "saved ip" and "saved fp" computation.  The latter had
	been broken roughly since commit
	72353de77d0a06f158d8af66a2540015658e2574.
	(vm-frame-older): Return #f when IP is zero, not when FP is zero.
	(vm-frame-function-name): Wrap 'vm-frame-program-debug-info' in
	'false-if-exception'

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	types: Recognize 'scm_t_port_type' and decode port type name.
	* module/system/base/types.scm (read-c-string, inferior-port-type): New
	procedures.
	(inferior-port): Use 'inferior-port-type' to determine the port type.
	(cell->object): Rename 'flags+type' to 'flags' in the '%tc7-port' case.
	* test-suite/tests/types.test ("opaque objects"): Adjust port testse.
	(test-inferior-ports): New macro.
	("ports"): New test prefix.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	vm: Fix another typo.
	Fix typo introduced in efc33cd1497c00c5ebf961e834efc1d85f3e28ac.

	* libguile/vm.c (return_unused_stack_to_os): Remove extra 'while'.

2018-08-07  Arun Isaac  <arunisaac@systemreboot.net>

	web: Export http-request.
	* module/web/client.scm (request): Rename to http-request, add a
	docstring, and export it.
	(http-get, http-head, http-post, http-put, http-delete, http-trace,
	http-options): Update docstring.
	* doc/ref/web.texi (Web Client): Document http-request.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	Add 'scm_to_stringn' shortcut when converting to UTF-8.
	* libguile/strings.c (scm_to_stringn): Call 'scm_to_utf8_stringn' when
	ENCODING == "UTF-8".

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	Module import obarrays are accessed in a critical section.
	Fixes <https://bugs.gnu.org/31879>.

	* libguile/modules.c (import_obarray_mutex): New variable.
	(resolve_duplicate_binding, module_imported_variable): Acquire it before
	accessing an obarray.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	tests: Adjust i18n.test to 'fr_FR.utf8' locale in glibc 2.27.
	* test-suite/tests/i18n.test (french-number-string=?): New procedure.
	("number->locale-string")["French"]("integer", "negative integer")
	("fraction", "fraction, 1 digit"): Use it.
	("format ~h")["French"]("12345.678"): Likewise.
	("monetary-amount->locale-string")["French"]("integer", "fraction"):
	Check for both SPACE and NO-BREAK SPACE.

2018-08-07  Arun Isaac  <arunisaac@systemreboot.net>

	doc: Document (ice-9 match) macros.
	* doc/ref/match.texi: Document match-lambda, match-lambda*, match-let,
	  match-let* and match-letrec.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix typo.
	Fixes <https://bugs.gnu.org/30941>.
	Reported by Fis Trivial <ybbs.daans@hotmail.com>.

	* doc/ref/libguile-foreign-objects.texi (Defining Foreign Object Types):
	Remove extraneous 'image_type' in example.

2018-08-07  Jan Smydke  <jan.smydke@gmail.com>

	get-bytevector-n and get-bytevector-n! can now read more than 4 GB
	* libguile/r6rs-ports.c (scm_get_bytevector_n, scm_get_bytevector_n_x):
	Turn 'c_count' and related variables into a 'size_t', and use
	'scm_to_size_t' instead of 'scm_to_uint'.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	vm: Fix typo when checking for 'madvise' error code.
	* libguile/vm.c (return_unused_stack_to_os): Check for EAGAIN, not -EAGAIN.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	Make module autoloading thread-safe.
	Fixes <https://bugs.gnu.org/31878>.

	* module/ice-9/boot-9.scm (call-with-module-autoload-lock): New procedure.
	(try-module-autoload): Wrap body in 'call-with-module-autoload-lock'.
	* module/ice-9/threads.scm: Set (@ (guile) call-with-module-autoload-lock).

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

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

2018-08-07  Christopher Allan Webber  <cwebber@dustycloud.org>

	Add SRFI 71: Extended LET-syntax for multiple values.
	* module/srfi/srfi-71.scm: New file.
	* module/srfi/Makefile.am: Add it.
	* doc/ref/srfi-modules.texi: Document it.
	* NEWS: Update.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	Add copyright header for (language elisp falias), and fix typo.
	* module/language/elisp/falias.scm: Add copyright header.
	* module/language/elisp/spec.scm: Fix typo in header.

	elisp: Fix cross-compilation support.
	* module/system/base/target.scm (with-native-target): New exported
	procedure.
	* module/language/elisp/spec.scm: In the top-level body expression, call
	'compile-and-load' within 'with-native-target' to compile native code.
	* module/language/elisp/compile-tree-il.scm
	(eval-when-compile, defmacro): Compile native code.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	Fix error reporting in 'load-thunk-from-memory'.
	Previously 'load-thunk-from-memory' would often throw to 'system-error'
	based on a stale value in 'errno', leading to incorrect error messages.

	* libguile/loader.c (load_thunk_from_memory): Set 'errno' to 0 before
	jumping to cleanup in the ABORT preprocessor macro, and also in the case
	when 'process_dynamic_segment' reports an error.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	goops: Fix 'instance?' to work on objects that aren't structs.
	Fixes <https://bugs.gnu.org/31606>
	Reported by Tommi Höynälänmaa <tommi.hoynalanmaa@gmail.com>

	* module/oop/goops.scm (instance?): Check that OBJ is a struct
	before applying 'struct-vtable' to it.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	Avoid inexact arithmetic in the type inferrer for 'sqrt'.
	* module/language/cps/types.scm: Use 'exact-integer-sqrt' and avoid
	inexact arithmetic in the range analysis of the type inferrer for
	'sqrt'.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	Fix type inference for bitwise logical operators.
	Fixes <https://bugs.gnu.org/31474> and related bugs.
	Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

	* module/language/cps/types.scm (next-power-of-two): Remove procedure.
	(non-negative?, lognot*, saturate+, saturate-, logand-bounds)
	(logsub-bounds, logior-bounds, logxor-bounds): New procedures.  Use them
	to improve and fix bugs in the range analysis of the type inferrers for
	'logand', 'logsub', 'logior', 'ulogior', 'logxor', 'ulogxor', and
	'lognot'.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	Fix typo in comment within numbers.c

2018-08-07  Arun Isaac  <arunisaac@systemreboot.net>

	Fix minor typo in the PEG documentation.
	* doc/ref/api-peg.texi (PEG Internals): Fix minor typo.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	Fix a few typos in the manual.
	Fixes <https://bugs.gnu.org/30276>.
	Reported by Matt Wette <matt.wette@gmail.com>.

	* doc/ref/api-macros.texi (Macro Expansion)
	doc/ref/vm.texi (Procedure Call and Return Instructions): Fix typos.

2018-08-07  Mark H Weaver  <mhw@netris.org>

	Fix eta-conversion edge cases in peval.
	Fixes <https://bugs.gnu.org/29520>.
	Reported by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.

	* module/language/tree-il/peval.scm (peval)[lift-applied-lambda]: Before
	performing eta-conversion, check that the variable(s) passed to the
	inner 'apply' are not referenced from the inner lambda, and that the
	number of required arguments would not be reduced by the conversion.

2018-08-07  Shea Levy  <shea@shealevy.com>

	Recognize RISC-V compilation targets.
	* module/system/base/target.scm (cpu-endianness): Add case for "riscv" variants.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	srfi-18: 'thread-sleep!' timeout-as-a-number is relative.
	This is a followup to <https://bugs.gnu.org/29704>.

	* module/srfi/srfi-18.scm (thread-sleep!): When TIMEOUT is a number,
	keep it as-is.
	* test-suite/tests/srfi-18.test ("thread sleep with number"): Pass 0 as
	the timeout.
	("thread sleeps fractions of a second"): Pass 0.5 as the timeout.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	srfi-18: When timeout is a number, it's a relative number of seconds.
	Fixes <https://bugs.gnu.org/29704>.
	Reported by David Beswick <dlbeswick@gmail.com>.

	* module/srfi/srfi-18.scm (timeout->absolute-time): New procedure.
	(mutex-lock!): Use it in 'thread:lock-mutex' call.
	(mutex-unlock!): Use it.
	* test-suite/tests/srfi-18.test ("mutex-lock! returns false on timeout")
	("mutex-lock! returns true when lock obtained within timeout")
	("recursive lock waits")
	("mutex unlock is false when condition times out"): Adjust cases where
	the 'timeout' parameter is a number so that it's a relative number.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix typo about SRFI-4 syntax.
	Reported by Matt Wette <matt.wette@gmail.com>.
	Fixes <https://bugs.gnu.org/29910>.

	* doc/ref/api-data.texi (Array Syntax): Fix typo.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	build: Use 'sed' invocation compatible with BSD sed.
	Fixes <https://bugs.gnu.org/30011>.
	Reported by ilove zfs <ilovezfs@icloud.com>.

	* libguile/Makefile.am (INSTANTIATE): Move '-i' first.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	'select' returns empty sets upon EINTR and EAGAIN.
	Fixes <https://bugs.gnu.org/30368>.

	* libguile/filesys.c (scm_select): Clear READ_SET, WRITE_SET, and
	EXCEPT_SET when RV < 0.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	Revert "Honor '%fresh-auto-compile'."
	This reverts commit 83d4c4d622b406ec0bc9d8139ec8182fa72b5720,
	which came from a misunderstanding.

	No tabs in C code.
	* .dir-locals.el (c-mode): Set 'indent-tabs-mode' to nil in C.

	Make sure the return value of 'scm_crypt' is always initialized.
	* libguile/posix.c (scm_crypt): Always initialize 'ret'; error out even
	when ERR is zero.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	compile: Load language modules upfront.
	Fixes a bug whereby "guild compile --target=arm-linux-gnueabihf
	--from=elisp ... language/elisp/boot.el" would fail with an exception
	from 'load-thunk-from-memory' while trying to load (language elisp spec)
	from the guile-being-compiled instead of using that of the
	guile-for-build.

	The problem did not manifest with --from=scheme because (language scheme
	spec) happened to be already loaded before we had changed %load-path.

	* module/scripts/compile.scm (compile): Add calls to 'lookup-language'.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	'load-thunk-from-memory' reports the correct error.
	Previously 'load-thunk-from-memory' would often throw to 'system-error'
	when passed an incorrect ELF file, leading to incorrect error messages.

	* libguile/loader.c (load_thunk_from_memory): Reset 'errno' when
	'check_elf_header' returns non-NULL.
	* test-suite/tests/vm.test: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add it.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	Fix 'crypt' deadlock upon error.
	* libguile/posix.c (scm_crypt): Take 'scm_i_misc_mutex' right before
	calling 'crypt'.  Move 'SCM_SYSERROR' call after 'scm_dynwind_end'.
	* test-suite/tests/posix.test ("crypt"): New test prefix.

2018-08-07  Ludovic Courtès  <ludo@gnu.org>

	doc: Update LALR URL.
	Reported by Chris Vine <vine35792468@gmail.com>.

	* doc/ref/api-lalr.texi (LALR(1) Parsing): Update URL.

2018-08-07  Andy Wingo  <wingo@igalia.com>

	Update NEWS for 2.2.3
	* NEWS: Update.

2018-08-07  Andy Wingo  <wingo@pobox.com>

	VM hooks take no values
	* libguile/vm-engine.c (RUN_HOOK0, RUN_HOOK1): Remove.
	  (RUN_HOOK): Take hook name.
	  (APPLY_HOOK, RETURN_HOOK, NEXT_HOOK, ABORT_CONTINUATION_HOOK): Use
	  RUN_HOOK.
	* libguile/vm.c (vm_dispatch_hook): Remove value count arg; hooks no
	  longer receive values (e.g. the return hook now uses
	  frame-return-values).
	  (vm_dispatch_abort_hook): Remove value count, which was bogus because
	  the active frame was the continuation which might contain other
	  locals, potentially unboxed, not the implicit return-values frame.  In
	  the future we could push on an implicit return-values frame instead.
	* module/system/vm/traps.scm (trap-in-procedure, trap-frame-finish):
	  (trap-in-dynamic-extent, trap-calls-to-procedure): Adapt abort hooks
	  to not take values.  They weren't being used anyway!

2018-08-06  Andy Wingo  <wingo@pobox.com>

	Remove push continuation hook; return hook runs before FP pop
	* libguile/frames.c (scm_frame_return_values): New function, for use
	  when a frame is at "return-values".
	  (scm_init_frames_builtins): Register frame-return-values.
	* libguile/vm-engine.c (RETURN_HOOK): Rename from POP_CONTINUATION_HOOK.
	  (call, call-label): Remove PUSH_CONTINUATION_HOOK; it's unneeded, as
	  you can always check the FP from an apply hook.
	  (return-values): Run return hook before popping frame.
	* libguile/vm.c (vm_dispatch_return_hook): Rename from
	  vm_dispatch_pop_continuation_hook.  Remove push continuation hook.
	  (scm_vm_return_hook):
	* libguile/vm.h (SCM_VM_PUSH_CONTINUATION_HOOK): Remove.
	  (SCM_VM_RETURN_HOOK): Rename from SCM_VM_POP_CONTINUATION_HOOK.
	* module/system/vm/frame.scm (frame-return-values): Export.
	* module/system/vm/trace.scm (print-return, trace-calls-to-procedure)
	  (trace-calls-in-procedure): Adapt to not receiving values as
	  arguments.
	* module/system/vm/traps.scm (trap-in-procedure, trap-frame-finish):
	  Adapt to return hook coming from returning frame.
	  (program-sources-by-line): Update to use match instead of pmatch.
	* module/system/vm/traps.scm (trap-in-dynamic-extent)
	  (trap-calls-to-procedure): Adapt to return hook not receiving values.
	* module/system/vm/vm.scm: Remove push continuation hook and rename
	  return hook.

	Consolidate apply hook to instrument-entry instruction
	* libguile/vm.c (scm_call_n):
	* libguile/vm-engine.c: Move apply hook to "instrument-entry"
	  instruction.

	Add instrument-entry to continuations
	* libguile/continuations.c (goto_continuation_code):
	* libguile/control.c (compose_continuation_code): Add JIT
	  instrumentation.  Unlike foreign or subr routines, we leave these as
	  closures; it doesn't make sense to JIT for any particular
	  continuation.

	Alloc foreign procedures using primitive mechanism
	* libguile/foreign.c (get_foreign_stub_code): Use
	  scm_i_alloc_primitive_code_with_instrumentation.  This will allow FFI
	  procedures to be JITted, and allow us to move the apply hook to
	  instrument-entry.

	Minor updates for Scheme runtime (statprof, backtraces)
	* module/system/vm/frame.scm: Add a comment about a case that we need to
	  handle in the future.
	* module/statprof.scm (statprof-proc-call-data): Always use the program
	  code as the key, even for primitives.

	Fix bugs with primitive code allocator; expose internally
	* lib/Makefile.am: Explicitly add flexmember.  Already included though.
	* libguile/gsubr.c (alloc_subr_idx, record_subr_name): Factor out an
	  "expected subr count" variable.
	  (alloc_chunk, alloc): Rework so that when the arena grows, old code is
	  still recognized as primitive.
	  (scm_i_alloc_primitive_code_with_instrumentation): Fix bug whereby the
	  JIT function data was initialized at a bogus address, because we were
	  adding to a uint32_t* instead of a char*.  Make internally public.
	  (is_primitive_code): Recognize all allocated code as primitive.
	  (alloc_subr_code): Adapt to
	  scm_i_alloc_primitive_code_with_instrumentation rename.
	  (primitive_subr_idx): If the call IP isn't a subr-call, return a
	  sentinel value.
	  (scm_i_primitive_name, scm_subr_function): Allow for primitives that
	  aren't subrs.
	* libguile/gsubr.h: Decalre
	  scm_i_alloc_primitive_code_with_instrumentation.

2018-08-02  Mark H Weaver  <mhw@netris.org>

	Fix R6RS call-with-{input,output}-file to open textual ports.
	Fixes <https://bugs.gnu.org/32329>.
	Reported and diagnosed by Göran Weinholt <goran@weinholt.se>.

	* module/rnrs/io/simple.scm (call-with-input-file)
	(call-with-output-file): Use 'open-{input,output}-file' to open the port
	in textual mode.  Previously 'open-file-{input,output}-port' was used,
	which opened the port in binary mode.

2018-07-29  Andy Wingo  <wingo@pobox.com>

	Revert "Add support for reading ELF symbol table from C"
	This reverts commit e95f15c932650783f34253e396216c66050905f0.  It's no
	longer needed given the current JIT strategy.

	Rewrite subr implementation
	* libguile/gsubr.c: Reimplement to store subr names and procedures in a
	  side table, and to allocate fresh vcode for each subr.  This allows
	  JIT of subrs, moves to a uniform all-code-starts-with-instrument-entry
	  regime, and also allows statprof to distinguish between subrs based on
	  IP.
	* libguile/gsubr.h (SCM_SUBRF, SCM_SUBR_NAME): Call out to functions,
	  now that these are in a side table.
	  (scm_subr_function, scm_subr_name): New exports.
	  (scm_i_primitive_name): New internal function, for looking up a
	  primitive name based on IP.
	  (scm_apply_subr): Take the subr index.
	* libguile/vm-engine.c (subr-call):
	* libguile/jit.c (compile_subr_call): Adapt to take index as arg.
	* module/statprof.scm (sample-stack-procs, count-call):
	  (stack-samples->procedure-data): Update to always record IP in stack
	  samples and call counts.
	* module/system/vm/frame.scm (frame-procedure-name): Simplify.
	  (frame-instruction-pointer-or-primitive-procedure-name): Removed.
	* libguile/programs.h:
	* libguile/programs.c (scm_primitive_code_name): New function.
	* module/system/vm/program.scm (primitive-code-name): New export.

	Fix function bound offsets of JIT data to be signed
	* libguile/jit.h (struct scm_jit_function_data): Start and end offsets
	  are signed.

	Emit instrument-entry before programs
	* module/system/vm/assembler.scm (<jit-data>, <meta>): Rework to have
	  <meta> create the <jit-data> in the end-program, so that jit-data
	  isn't mutable.  Record start and end PC values relative to '.rtl-text
	  so that we don't need any more linker symbols.
	  (emit-instrument-entry*, emit-instrument-loop*, begin-program):
	  (end-program): Adapt.
	  (begin-kw-arity): Include the initial instrument-entry in the first
	  arity.
	  (link-data, link-constants): Write the init routine before interning
	  constants so that we correctly emit the jit-data for the init
	  routine.
	* libguile/programs.c (try_parse_arity): Skip over a
	  scm_op_instrument_entry, if any.

	Emit instrument-loop in loops.
	* am/bootstrap.am (SOURCES):
	* module/Makefile.am (SOURCES): Handle renamve of handle-interrupts.scm
	  to loop-instrumentation.scm.
	* libguile/jit.h (SCM_JIT_COUNTER_ENTRY_INCREMENT): Rename from
	  SCM_JIT_COUNTER_CALL_INCREMENT.
	* libguile/vm-engine.c (instrument-entry): Rename from instrument-call.
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  handle-interrupts code before calls and returns.  Compile the
	  "instrument-loop" primcall to an "instrument-loop" instruction and a
	  "handle-interrupts" instruction.
	  (lower-cps): Adapt to add-loop-instrumentation name change.
	* module/language/cps/loop-instrumentation.scm: Rename from
	  handle-interrupts.scm and just add "instrument-loop" primcalls in
	  loops.  The compiler will add handle-interrupts primcalls as
	  appropriate.
	* module/system/vm/assembler.scm (<jit-data>): New data type, for
	  emitting embedded JIT data.
	  (<meta>): Add field for current JIT data.
	  (make-meta): Initialize current JIT data.
	  (emit-instrument-entry*, emit-instrument-loop*): New instruction
	  emitters that reference the current JIT data.
	  (end-program): Now that all labels are known, arrange to serialize the
	  JIT data.
	  (link-data): Reserve space for JIT data, and add relocs to initialize
	  the "start" / "end" fields.

	Add instrument-call, instrument-loop VM instructions
	* libguile/jit.h (struct scm_jit_function_data)
	  (enum scm_jit_counter_value): New data types.
	* libguile/jit.c (scm_jit_compute_mcode, scm_jit_enter_mcode): New
	  function stubs.  Adapt label/offset compilers to take pointers.
	* libguile/vm-engine.c (instrument-call, instrument-loop): New
	  instructions.
	* libguile/vm.c: Add jit.h include.
	* module/system/vm/assembler.scm (emit-instrument-call)
	  (emit-instrument-loop): New exports.

2018-07-24  Ludovic Courtès  <ludo@gnu.org>

	srfi-19: Remove unused procedure.
	* module/srfi/srfi-19.scm (date->broken-down-time): Remove.

	Add -Wshadowed-toplevel.
	* module/language/tree-il/analyze.scm (shadowed-toplevel-analysis): New
	variable.
	* module/language/tree-il/compile-cps.scm (%warning-passes): Add it.
	* module/system/base/message.scm (%warning-types): Add it.
	* test-suite/tests/tree-il.test ("warnings")["shadowed-toplevel"]: New
	test prefix.
	* module/ice-9/boot-9.scm (%auto-compilation-options): Add it.
	* doc/ref/api-evaluation.texi (Compilation): Add 'shadowed-toplevel' and
	'macro-use-before-definition'.

2018-07-23  Andy Wingo  <wingo@pobox.com>

	Update frames.h comments.
	* libguile/frames.h: Update to match reality.

2018-07-20  Ludovic Courtès  <ludo@gnu.org>

	r6rs-ports: 'put-bytevector' accepts 64-bit integers.
	* libguile/r6rs-ports.c (scm_put_bytevector): Use 'size_t' for c_start,
	c_count, and c_len.

2018-07-20  Andy Wingo  <wingo@pobox.com>

	Multiple-value returns now start from slot 0, not slot 1
	This should reduce frame sizes.

	* libguile/vm-engine.c (halt): Adapt to multiple-values change.  Also
	  adapt to not having the boot closure on the stack.
	  (receive, receive-values, subr-call, foreign-call): Adapt to expect
	  values one slot down.
	  (prompt): Capture one less word for the values return.
	* libguile/vm.c (vm_dispatch_pop_continuation_hook):
	  (vm_dispatch_abort_hook): Adapt for where to expect values.
	  (vm_builtin_values_code): Add a call to shuffle-down before
	  returning.  This is more overhead than what existed before, but the
	  hope is that the savings elsewhere pay off.
	  (vm_builtin_values_code): Adapt to different values location.
	  (reinstate_continuation_x, compose_continuation): Adapt to place
	  resume args at right position.
	  (capture_delimited_continuation): Remove unused sp and ip arguments.
	  (abort_to_prompt): Adapt to capture_delimited_continuation change.
	  (scm_call_n): Adapt to not reserve space for the boot closure.
	* module/language/cps/compile-bytecode.scm (compile-function): When
	  returning values, adapt reset-frame call for return calling convention
	  change.  Adapt truncating or rest returns to expect values in the
	  right place.
	* module/language/cps/slot-allocation.scm (compute-shuffles):
	  (allocate-lazy-vars, allocate-slots): Allocate values from the "proc
	  slot", not proc-slot + 1.
	* module/system/vm/assembler.scm (emit-init-constants): Reset the frame
	  before returning so that the return value is in the right place.
	* test-suite/tests/rtl.test: Update for return convention change.
	* libguile/foreign.c (get_foreign_stub_code): Update for return calling
	  convention change.

2018-07-20  Andy Wingo  <wingo@pobox.com>

	Fix stale stack frame clearing for frame size change
	* libguile/vm-engine.c (return-values): Clear all 3 stack slots.  Not
	  sure this is necessary though!

	Rework VM approach to shuffling unknown numbers of args
	* libguile/vm-engine.c (shuffle-down, expand-apply-argument): New
	  instructions.
	  (tail-call, tail-call-label, return-values): Don't reset the frame.
	  The compiler should reset the frame appropriately.
	  (tail-call/shuffle, tail-apply): Remove unused instructions.
	* libguile/vm.c (vm_builtin_apply_code): Use new shuffle-down and
	  expand-apply-argument opcodes.
	  (vm_builtin_call_with_values_code): Replace tail-call/shuffle with
	  shuffle-down then tail-call.
	* libguile/jit.c (compile_shuffle_down, compile_expand_apply_argument):
	  Add compiler stubs
	  (COMPILE_X8_F12_F12): New definition.
	  (compile_tail_call_shuffle, compile_tail_apply): Remove unused
	  compilers.
	* module/language/cps/compile-bytecode.scm (compile-function): Emit
	  reset-frame before tail calls and returns.
	* module/system/vm/assembler.scm (system): Remove unbound "emit-return"
	  export.
	* module/system/vm/disassembler.scm (code-annotation)
	  (instruction-has-fallthrough?, define-stack-effect-parser): Adapt for
	  opcode changes.

	Reserve frame word for machine return address
	* libguile/frames.h: Add machine return address to diagram.
	  (SCM_FRAME_MACHINE_RETURN_ADDRESS):
	  (SCM_FRAME_SET_MACHINE_RETURN_ADDRESS): New macros.
	  (SCM_FRAME_PREVIOUS_SP):
	  (SCM_FRAME_DYNAMIC_LINK):
	  (SCM_FRAME_SET_DYNAMIC_LINK): Adapt for new frame size.
	* libguile/vm-engine.c (halt): Set frame size to 3.
	  (call, call-label): Set mRA to 0.
	* libguile/vm.c (push_interrupt_frame, reinstate_continuation_x):
	  (scm_call_n): Set frame size to 3.  In push_interrupt_frame, init the
	  mRA of the frame.
	  (vm_builtin_call_with_values_code, vm_handle_interrupt_code): Allocate
	  larger frames.
	* module/language/cps/slot-allocation.scm (allocate-slots): Frame size
	  is 3.
	* module/system/vm/disassembler.scm (define-clobber-parser): Bump frame
	  size.

	Prepare for frames having separate virtual and machine return addrs
	* libguile/frames.c (scm_frame_return_address): Use
	  SCM_FRAME_VIRTUAL_RETURN_ADDRESS.
	  (scm_c_frame_previous): Likewise.
	* libguile/frames.h: Update diagram for new names.
	  (union scm_vm_stack_element): Rename "as_ip" to "as_vcode", and
	  add "as_mcode" for machine code pointers.
	  (SCM_FRAME_VIRTUAL_RETURN_ADDRESS)
	  (SCM_FRAME_SET_VIRTUAL_RETURN_ADDRESS): Rename to these, from
	  SCM_FRAME_RETURN_ADDRESS and SCM_FRAME_SET_RETURN_ADDRESS.
	* libguile/vm-engine.c (halt, call, call-label, return-values)
	  (return-from-interrupt): Adapt to renamings.  Make "halt" have frame
	  size as a parameter.
	* libguile/vm.c (scm_i_vm_mark_stack): Adapt to renaming.
	  (push_interrupt_frame): Take mRA as additional argument.  In future we
	  will set it as frame mRA.
	  (capture_continuation): Adapt to renaming.
	  (scm_call_n): Adapt to renaming and make frame size adjustable.
	  (push_interrupt_frame, reinstate_continuation_x): Make frame size
	  adjustable.
	* module/language/cps/slot-allocation.scm (allocate-slots): Make frame
	  size adjustable.
	* libguile/intrinsics.h (scm_t_thread_mra_intrinsic): New type; use for
	  push_interrupt_frame.
	  (scm_t_thread_u8_scm_sp_vra_intrinsic): Rename from the same but was
	  "ra" instead of "vra", and change type to uint32_t*.
	* module/system/vm/disassembler.scm (define-clobber-parser):
	  Parameterize clobber set for calls by frame size.

	Add support for reading ELF symbol table from C
	* libguile/loader.c (scm_i_program_address_range): New function.
	  Currently unused, will wire up once we correct the compiler to emit
	  symbols whose values are relative to the base addr.  Will be used by
	  JIT so it needs to be fast.
	  (register_elf): Rework to be less verbose, and record symtab/strtab.
	  (struct mapped_elf_image): Add symtab and strtab members.
	  (load_thunk_from_memory, process_dynamic_segment): Parse out DT_SYMTAB
	  and DT_STRTAB.
	  (Elf_Sym): New definition.

	Make JIT compiler skeleton more terse
	* libguile/jit.c (scm_jit_state): Add "ip" member so we don't have to be
	  passing it around all the time.  Rename use variables to "j" from
	  "state".

	Merge 'master' into 'lightning'

2018-07-19  Ludovic Courtès  <ludo@gnu.org>

	compile: Update copyright year.
	* module/scripts/compile.scm (show-version): Update copyright year.

	compile: Improve error message.
	* module/scripts/compile.scm (parse-args): Add missing newline in
	"unrecognized option" message.

	compile: Add '-x' flag.
	* module/scripts/compile.scm (%options, compile): Add '-x'.
	* doc/ref/api-evaluation.texi (Compilation): Document it.

2018-07-19  Ludovic Courtès  <ludo@gnu.org>

	r6rs-ports: Accept 'port-position' values greater than 2^32.
	Reported by Ricardo Wurmus <rekado@elephly.net>.
	Fixes <https://bugs.gnu.org/32161>.

	* libguile/r6rs-ports.c (custom_binary_port_seek): Use 'scm_to_off_t'
	instead of 'scm_to_int'.
	* test-suite/tests/r6rs-ports.test ("8.2.7 Input Ports")["custom binary
	input port position, long offset"]: New test.

2018-07-16  Andy Wingo  <wingo@pobox.com>

	Fix errors introduced when giving multiple-values objects a tc7
	* libguile/values.c (scm_c_value_ref): Fix a case in which a request for
	  the 0th value of a zero-valued object would return the object instead
	  of erroring.
	* libguile/vm-engine.c (halt): Fix construction of a multiple-valued
	  return (off-by-one error).  Fixes a crash introduced in
	  4a2d78b4d463cd29226f3eee776dcad9f64e6152.

2018-07-05  Mark H Weaver  <mhw@netris.org>

	Make srfi-71 visible through 'cond-expand'.
	This is a followup to commit eb90831ce81bcb85ae96d27011ebe71955cdf75d.

	* module/srfi/srfi-71.scm: Add missing 'cond-expand-provide'.

2018-07-03  Andy Wingo  <wingo@pobox.com>

	Begin structure for template JIT compiler
	* libguile/jit.c: Begin to wire up compilers for the VM opcodes.
	  Currently all that's there is a parser for each opcode's operands.

	Fix bad opcode in VM
	* libguile/vm-engine.c (VM_NAME): Fix accidentally reused number 180.
	  Both values were invalid opcodes though.

	Minor change to VM DSL
	* libguile/instructions.c (DOP1, DOP2, DOP3, DOP4, DOP5): New parts of
	  the DSL, equivalent to e.g. OP1(x) | OP_DST.  Will allow other
	  definitions of OP* that use token pasting.
	* libguile/vm-engine.c: Adapt to use new DOP descriptors.

	Fix compile warnings in jit_print.c
	* libguile/lightning/lib/jit_print.c (_jit_print_node): Fix a couple
	  printf format warnings by adding casts.

	Remove -Wswitch-enum from compile flags
	* configure.ac (POTENTIAL_GCC_CFLAGS): Remove -Wswitch-enum, which
	  requires that switch statements mention all enumerated values, even if
	  there is a default clause.  Note that -Wall enables -Wswitch, which is
	  the same except it's silent if there's a default clause.  The reason
	  is that lightning has a number of switches like this.

2018-07-02  Andy Wingo  <wingo@pobox.com>

	Wire up lightning into libguile build
	* libguile/Makefile.am (AM_CPPFLAGS):
	  (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): If ENABLE_JIT, build
	  lightning.
	  (EXTRA_DIST): Add lightning files.
	* libguile/lightning/lightning.am (lightning_extra_files): Add COPYING
	  and related files to the dist.
	* libguile/jit.c:
	* libguile/jit.h: New files.

2018-07-02  Ludovic Courtès  <ludo@gnu.org>

	Update release docs.
	* doc/release.org: Update web site instructions.

2018-07-02  Andy Wingo  <wingo@pobox.com>

	Wire JIT availability check into Guile configure
	* acinclude.m4 (GUILE_ENABLE_JIT): Add missing AC_CANONICAL_TARGET.
	* configure.ac: Add check if JIT is available.

	Add GUILE_ENABLE_JIT macro
	* acinclude.m4 (GUILE_ENABLE_JIT): New macro.
	* libguile/lightning/configure.ac: Remove now-unused file.

2018-07-01  Ludovic Courtès  <ludo@gnu.org>

	Bump version for Guile 2.2.4.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	(LIBGUILE_INTERFACE_REVISION): Increment.

2018-07-01  Ludovic Courtès  <ludo@gnu.org>

	build: Really build srfi/srfi-71.scm.
	Commit eb90831ce81bcb85ae96d27011ebe71955cdf75d added it to the wrong
	makefile.

	* module/Makefile.am (SOURCES): Add srfi/srfi-71.scm.
	* module/srfi/Makefile.am: Remove.  It's a leftover from the 2009 build
	system rework in commit 3bb299b3f0d5b31957a6447d095ed723268019be.

2018-07-01  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS: Update.

	Update copyright years in '--version' and the manual.
	* module/ice-9/command-line.scm (version-etc): Change #:copyright-year
	to 2018.
	* doc/ref/guile.texi: Add 2017 and 2018 to the copyright years.
	* configure.ac (GUILE_CONFIGURE_COPYRIGHT): Add 2018.

2018-07-01  Andy Wingo  <wingo@pobox.com>

	Remove unused AM_CONDITIONAL statements from lightning configure
	* libguile/lightning/configure.ac: Remove more unused definitions.

	Remove unused configure-time checks for x87, thumb, and sof float
	* libguile/lightning/configure.ac: Remove unused checks.

	Remove lightning configure snippet related to libdl
	* libguile/lightning/configure.ac: Remove checks for how to add libdl,
	  as embedder will handle this.

	Always enable assertions in embedded lightning
	* libguile/lightning/configure.ac: Remove --enable-assertions option;
	  always enable assertions.
	* libguile/lightning/lib/jit_memory.c:
	* libguile/lightning/lib/jit_note.c:
	* libguile/lightning/lib/jit_print.c:
	* libguile/lightning/lib/jit_rewind.c:
	* libguile/lightning/lib/jit_size.c:
	* libguile/lightning/lib/lightning.c: Define DEBUG to 1.

2018-07-01  Ludovic Courtès  <ludo@gnu.org>

	Serialize accesses to submodule hash tables.
	Fixes <https://bugs.gnu.org/30602>.

	Previously, when compiling files in parallel like Guix does, threads
	would be concurrently inserting, rehashing, and reading the submodule
	hash table of module ().  Thus, some threads would sometimes see an
	inconsistent state, leading to errors such as:

	  Module named (system repl debug) does not exist

	* module/ice-9/boot-9.scm (call-with-module-autoload-lock): Move higher
	in the file.
	(module-name): Use it around call to 'nested-define-module!'.
	(resolve-module): Wrap the whole thing in 'call-with-module-autoload-lock'.

2018-07-01  Andy Wingo  <wingo@pobox.com>

	Remove special cflags for obsolete Lightning targets
	* libguile/lightning/configure.ac: Remove compiler flags specializations
	  for ia64 on HPUX, MIPS on Irix, and Alpha on OSF.

	Refactor deps for built libpath.h
	* libguile/Makefile.am (BUILT_INCLUDES): Move libpath.h here, from
	  BUILT_SOURCES, so that .x files depend on it.  Thanks to Dale Smith
	  for the report.

	Remove disassembler support from lightning
	* libguile/lightning/configure.ac: Remove checks for libiberty, BFD, and
	  so on.
	* libguile/lightning/lib/jit_disasm.c: Remove.
	* libguile/lightning/lib/lightning.c: Define DISASSEMBLER and
	  DEVEL_DISASSEMBLER to 0.
	  (init_jit, finish_jit): Delete calls into jit_disasm.
	* libguile/lightning/lib/jit_memory.c:
	* libguile/lightning/lib/jit_note.c:
	* libguile/lightning/lib/jit_print.c:
	* libguile/lightning/lib/jit_rewind.c:
	* libguile/lightning/lib/jit_size.c: Define DISASSEMBLER to 0.
	* libguile/lightning/lightning.am (lightning_c_files): Remove
	  jit_disasm.c.

2018-06-30  Andy Wingo  <wingo@pobox.com>

	Further lightning integration work
	* libguile/lightning/configure.ac: Start trimming down for inclusion in
	  configure.ac.  Remove check for getopt things; we don't include bits
	  of lightning that use getopt. Remove check for stdint, as we will have
	  it.
	* libguile/lightning/include/lightning.h: Unconditionally include
	  stdint.h.

	Remove some more of the lightning build machinery
	* libguile/lightning/Makefile.am:
	* libguile/lightning/lib/Makefile.am: Remove.
	* libguile/lightning/lightning.am: Add all the C and H files here.
	* libguile/lightning/configure.ac: Remove AC_OUTPUT clause.

	Remove empty lightning m4 directory
	* libguile/lightning/Makefile.am:
	* libguile/lightning/configure.ac:
	* libguile/lightning/m4/.gitkeep.

	Remove lightning pkg-config file.
	* libguile/lightning/lightning.pc.in: Remove.
	* libguile/lightning/configure.ac:
	* libguile/lightning/Makefile.am: Adapt.

	Beginnings of build integration of lightning and guile
	* libguile/lightning/lightning.am: New file.  libguile will include
	  this. Contents initially from include/Makefile.am and
	  include/lightning/Makefile.am.
	* libguile/lightning/include/Makefile.am:
	* libguile/lightning/include/lightning/Makefile.am: Remove.
	* libguile/lightning/configure.ac: Remove output of include Makefiles.

	Finish removing get-jit-size
	* libguile/lightning/include/lightning/jit_private.h:
	* libguile/lightning/lib/Makefile.am:
	* libguile/lightning/lib/jit_ia64.c (_emit_code):
	* libguile/lightning/lib/jit_size.c (jit_init_size, jit_finish_size):
	* libguile/lightning/lib/lightning.c (_jit_regarg_set, _jit_regarg_clr):
	  (_jit_realize, _jit_emit): Remove case where GET_JIT_SIZE is set.

	Remove lightning unit tests
	* libguile/lightning/configure.ac:
	* libguile/lightning/Makefile.am:
	* libguile/lightning/check: Remove unit tests.  If there is a problem
	  with lightning on this target, users should check if the upstream tests
	  pass.  Otherwise we will find errors via the Guile test suite.

	Remove documentation from embedded GNU lightning
	* libguile/lightning/Makefile.am:
	* libguile/lightning/configure.ac:
	* libguile/lightning/doc: Remove documentation.  JIT hackers should use
	  upstream's documentation.

	Strip "get-jit-size" feature from lightning.
	* libguile/lightning/Makefile.am:
	* libguile/lightning/configure.ac:
	* libguile/lightning/size.c: Remove devel-only "get-jit-size" feature.

2018-06-30  Andy Wingo  <wingo@pobox.com>

	Merge GNU lightning to libguile/lightning
	* libguile/lightning/: New directory, made by the following commands:

	  git remote add lightning https://git.savannah.gnu.org/git/lightning.git
	  git merge -s ours --no-commit --allow-unrelated-histories lightning/master
	  git read-tree --prefix=libguile/lightning/ -u lightning/master

	  In theory we will be able to update via:

	  git merge -s subtree lightning/master

2018-06-29  Ludovic Courtès  <ludo@gnu.org>

	vm: Fix stack-marking bug in multi-threaded programs.
	Fixes <https://bugs.gnu.org/28211>.

	* libguile/vm-engine.c (call, call_label, handle_interrupts): Add
	'new_fp' variable; set the dynamic link and return address of the frame
	at NEW_FP before setting 'vp->fp'.  This fixes a bug whereby, in a
	multi-threaded context, the stack-marking code could run after vp->fp
	has been set but before its dynamic link has been set, leading the
	stack-walking code in 'scm_i_vm_mark_stack' to exit early on.

2018-06-28  Ludovic Courtès  <ludo@gnu.org>

	linker: Don't rely on out-of-range bv-ref exceptions.
	* module/system/vm/linker.scm (find-shstrndx): Check whether NAME is
	lower than the length of BV; remove 'false-if-exception' around
	'string-table-ref' call.

2018-06-27  Andy Wingo  <wingo@pobox.com>

	Revert "Refactor hook dispatch in VM"
	This reverts commit 593e2db1dd835b29c6c87a46df6cd8ede5f33c4b.  The goto
	strategy works for hooks that run just before a "next"; it doesn't work
	for ones that run at the beginning of opcodes.

	Refactor hook dispatch in VM
	* libguile/vm-engine.c (GOTO_HOOK, HOOK_HANDLER): Split hooks that don't
	  take args into a "goto" side and a "target" side.  The idea is to just
	  reify the hook call at one place in the binary, since the VM
	  continuation is fully in the registers.
	  (APPLY_HOOK, PUSH_CONTINUATION_HOOK, NEXT_HOOK)
	  (ABORT_CONTINUATION_HOOK): Reimplement in terms of goto hooks.
	  (POP_CONTINUATION_HOOK): This one is still old-style.
	  (CONTINUE): New helper definition.
	  (call, call-label): Move the push-continuation hooks up a bit, so it's
	  clear they don't depend on intermediate opcode state.
	  (vm_engine): Reify hook handlers for apply, etc.

	Microoptimizations to hook dispatch
	* libguile/vm.c (vm_dispatch_hook): Add a check that we're in the debug
	  engine and the trace level is positive.  Allows us to do cheaper
	  checks for when to dispatch hooks.
	  (scm_call_n): Just check if trace level is nonzero.
	* libguile/vm-engine.c (RUN_HOOK): Likewise just check if trace level is
	  nonzero.

	Minor optimizations to debug hook dispatch
	* libguile/vm.c (scm_call_n): Only call hooks if the engine supports
	  it.
	  (vm_dispatch_abort_hook, vm_dispatch_next_hook)
	  (vm_dispatch_pop_continuation_hook, vm_dispatch_push_continuation_hook)
	  (vm_dispatch_apply_hook, vm_dispatch_hook): Take a thread as arg
	  instead of VM, because that will probably already be in a register in
	  the VM.  Given that all values are taken relative to the SP, no
	  need to pass that either.
	* libguile/vm-engine.c (RUN_HOOK0, RUN_HOOK1): Update appropriately.

	Remove "resume" arg from vm engine
	* libguile/vm-engine.c (vm_engine): Remove "resume" argument; scm_call_n
	  will handle the differences.
	* libguile/vm.c (scm_call_n): Inline handling of what to do in normal
	  and resume cases.  Remove resume argument to vm_engine.

	Intrinsics take registers from thread
	* libguile/continuations.c (scm_i_make_continuation): Remove registers
	  argument; instead get from thread.
	* libguile/vm-engine.c (vm_engine): Adapt VM engine to not receive a
	  registers argument, and thus to not pass it to intrinsics either.
	* libguile/intrinsics.h:
	* libguile/intrinsics.c (push_prompt):
	* libguile/vm.c (capture_continuation, compose_continuation)
	  (abort_to_prompt): Refactor these intrinsics to not take a registers
	  argument; it's not necessary.
	  (scm_call_n): Don't pass registers argument.

	Minor scm_thread refactoring
	* libguile/threads.h (scm_thread): Move stack base to be closer to
	  related fields, and add a comment for why it's there.

	Refactor handling of active VM registers
	* libguile/threads.h (scm_thread): Remove unused jmp_buf regs member.
	* libguile/vm.h (struct scm_vm): Rename resumable_prompt_cookie to just
	  "registers"; we know it's a jmp_buf pointer.
	* libguile/vm.c (scm_call_n):
	* libguile/throw.c (catch):
	* libguile/eval.c (eval):
	* libguile/control.c (scm_suspendable_continuation_p): Adapt to cookie
	  renaming.

	Use CALL_INTRINSICS helper in VM
	* libguile/vm-engine.c (CALL_INTRINSIC): New helper macro.
	  (ALLOC_FRAME, vm_engine): Use CALL_INTRINSIC when we need to call
	  intrinsics.  GCC still doesn't allocate intrinsics to a register
	  though!

	bind-rest inst uses cons-rest intrinsic
	* libguile/vm-engine.c (bind-rest): Use cons-rest intrinsic to build the
	  rest list.

	Intrinsic for "prompt"
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/intrinsics.c (push_prompt, scm_bootstrap_intrinsics): New
	  intrinsic.
	* libguile/vm-engine.c (prompt): Use push-prompt intrinsic.

	Remove dedicated current-module instruction.
	* libguile/vm-engine.c (current-module): Remove instruction.

	Compile current-module as intrinsic call
	* libguile/fluids.c (scm_i_fluid_ref): New internal function.
	  (scm_fluid_ref): Use scm_i_fluid_ref.
	* libguile/intrinsics.h:
	* libguile/intrinsics.c (current_module): New intrinsic.
	* libguile/modules.c (scm_i_current_module): New internal function.
	  (scm_current_module): Use new internal function.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add current-module as an intrinsic primitive.
	* module/system/vm/assembler.scm (define-scm<-thread-intrinsic):
	  (current-module): Arrange to compile to intrinsic call.

	allocate-words intrinsic
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/intrinsics.c (allocate_words, scm_bootstrap_intrinsics): New
	  intrinsic.
	* libguile/vm-engine.c (allocate-words, allocate-words/immediate): Use
	  new intrinsic.

	Inline handling of non-program apply
	* libguile/vm.c (vm_apply_non_program_code): Remove, now unneeded.
	* libguile/vm-engine.c (vm_engine, call, tail-call, tail-call/shuffle)
	  (tail-apply, call/cc): Inline handling of non-programs, as will be the
	  case with JIT code.

	Apply-non-program is an intrinsic
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add
	  apply-non-program intrinsic.
	* libguile/vm-engine.c (apply-non-program): Replace impl with call to
	  intrinsic.
	* libguile/vm.c (vm_error_wrong_type_apply): Inline into
	  apply_non_program intrinsic.
	  (apply_non_program): New intrinsic.
	  (scm_bootstrap_vm): Wire it up.

	Remove mention of vm-error from test suite
	* test-suite/test-suite/lib.scm (exception:vm-error): Remove.
	* test-suite/tests/strings.test: Remove override of
	  exception:wrong-type-arg; not needed since a while ago.

	Add intrinsics for error conditions (wrong num args etc)
	* libguile/intrinsics.c (error_wrong_num_args, error_no_values)
	  (error_not_enough_values, error_wrong_number_of_values): New
	  intrinsics.
	* libguile/intrinsics.h: Add new intrinsics.
	* libguile/vm-engine.c: Signal errors using the new intrinsics.
	* libguile/vm.c (vm_error): Remove, now that it's unused.
	  (vm_error_bad_instruction): Abort instead of throwing an exception.
	  If we get a bad instruction, nothing good will ever happen!
	  (compose_continuation): Use wrong-type-arg for unrewindable
	  continuations.
	  (scm_bootstrap_vm): No need to make "vm-run" or "vm-error" symbols.

2018-06-26  Andy Wingo  <wingo@pobox.com>

	VM throw uses intrinsics
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add intrinsics for
	  throw, throw/value, and throw/value+data.
	* libguile/intrinsics.c (throw_, throw_with_value):
	  (throw_with_value_and_data): And here they are.
	* libguile/vm-engine.c (throw, throw/value, throw/value+data): Use
	  intrinsics.
	* libguile/vm.c: Remove vm_throw et al.

	Allow abort_to_prompt to avoid a longjmp
	* libguile/vm-engine.c (abort):
	* libguile/vm.c (abort_to_prompt): Allow fallthrough if longjmp isn't
	  needed.

	Optimize abort-to-prompt to avoid alloca
	* libguile/vm.c (capture_delimited_continuation): Adapt to caller not
	  truncating vp->sp to vp->fp before calling.
	  (abort_to_prompt): Inline vm_abort and avoid the alloca.

	Refactors to abort-to-prompt implementation
	* libguile/control.c (scm_abort_to_prompt_star)
	* libguile/throw.c (abort_to_prompt): Pass prompt tag and argv in one
	  array.
	* libguile/vm.c (scm_i_vm_abort): Reimplement as a call into the VM's
	  abort_to_prompt builtin.
	  (vm_abort): New helper, a copy of scm_i_vm_abort.  Will allow us to
	  avoid some arg shuffling when aborting from the VM.
	* libguile/vm.h: Remove setjmp include and simplify scm_i_vm_abort
	  decl.

	abort-to-prompt uses an intrinsic
	* libguile/control.h:
	* libguile/control.c (scm_i_make_composable_continuation): Rename from
	  make_partial_continuation and expose internally.
	  (scm_abort_to_prompt_star): Adapt to scm_i_vm_abort name change.
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Define
	  abort_to_prompt intrinsic.
	* libguile/throw.c (abort_to_prompt): Adapt to scm_i_vm_abort name
	  change.
	* libguile/vm-engine.c (abort): Use abort_to_prompt intrinsic.
	* libguile/vm.c (capture_delimited_continuation): Move here from
	  control.c where it was named reify_partial_continuation.
	  (scm_i_vm_abort): Move from control.c where it was named
	  scm_c_abort (and only exposed internally).
	  (abort_to_prompt): New intrinsic, replacing vm_abort.
	* libguile/vm.h: Add setjmp include and scm_i_vm_abort decl.

	Add rest-arg-length intrinsic.
	* libguile/intrinsics.h:
	* libguile/vm.c (rest_arg_length): New intrinsic.
	  (vm_error_apply_to_non_list): Remove now-unused error proc.
	* libguile/vm-engine.c (tail-apply): Use new intrinsic.

	compose-continuation uses an intrinsic
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add
	  compose-continuation intrinsic.
	* libguile/vm-engine.c (compose-continuation): Call compose-continuation
	  intrinsic.
	* libguile/vm.c (compose_continuation_inner, compose_continuation): Move
	  down and rename from vm_reinstate_partial_continuation, and make into
	  a form that works as an intrinsic.

	Add intrinsic for call/cc
	* libguile/intrinsics.h: Add "capture-continuation" intrinsic.
	* libguile/vm-engine.c (call/cc): Rework to use capture_continuation
	  intrinsic.
	* libguile/vm.c (capture_continuation): New intrinsic.

	Rename scm_i_thread to scm_thread
	* libguile/scm.h (struct scm_thread, scm_thread): Rename from
	  scm_i_thread.
	* libguile/deprecated.h (scm_i_thread): Add deprecated typedef.
	* libguile/threads.h: Adapt to renaming.
	* libguile/intrinsics.h:
	* libguile/scmsigs.h:
	* libguile/cache-internal.h: Remove threads.h includes; unnecessary with
	  the forward decl.
	* libguile/continuations.h:
	* libguile/gc-inline.h:
	* libguile/async.h: Adapt scm_thread type name change.
	* libguile/async.c:
	* libguile/continuations.c:
	* libguile/control.c:
	* libguile/dynstack.c:
	* libguile/dynwind.c:
	* libguile/eval.c:
	* libguile/finalizers.c:
	* libguile/fluids.c:
	* libguile/gc.c:
	* libguile/intrinsics.c:
	* libguile/load.c:
	* libguile/memoize.c:
	* libguile/print.c:
	* libguile/read.c:
	* libguile/scmsigs.c:
	* libguile/script.c:
	* libguile/stackchk.c:
	* libguile/stacks.c:
	* libguile/symbols.c:
	* libguile/threads.c:
	* libguile/throw.c:
	* libguile/vm-engine.c:
	* libguile/vm.c: Adapt to type name change, and add additional includes
	  as needed.

	Refactor continuation capture in VM
	* libguile/continuations.h:
	* libguile/continuations.c (scm_i_make_continuation): Refactor to expect
	  registers to already be captured.
	* libguile/scm.h (scm_i_thread): Add forward decl.
	* libguile/threads.h (struct scm_i_thread): Just fill in the struct
	  type.
	* libguile/vm-engine.c (call/cc); Use the registers already captured
	  before entering the VM.

	Foreign-call intrinsic boxes errno
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/foreign.c (foreign_call):
	* libguile/vm-engine.c (foreign-call): Change foreign-call intrinsic to
	  handle boxing of errno.

	Reinstating undelimited continuations uses intrinsic
	* libguile/continuations.h (scm_t_contregs): Remove "struct vm*" member;
	  unneeded.
	* libguile/continuations.c (scm_i_make_continuation): No need to store
	  continuation->vp.
	  (scm_i_contregs): New internal function, replaces scm_i_contregs_vp
	  and scm_i_contregs_vm_cont.
	  (scm_i_check_continuation): Remove; moved to vm.c.
	  (scm_i_reinstate_continuation): Add an abort(), to satisfy
	  SCM_NORETURN.
	* libguile/intrinsics.h: Add new "reinstate-continuation!" intrinsic.
	* libguile/vm-engine.c (continuation-call): Use new
	  reinstate-continuation! intrinsic.
	* libguile/vm.c (vm_return_to_continuation_inner): Move later in the
	  file.
	  (reinstate_continuation_x): New intrinsic.
	  (scm_bootstrap_vm): Init new intrinsic.

	Most header files use forward decl for union scm_vm_stack_element
	* libguile.h: Add includes for frames.h and vm.h.  Probably need to
	  revisit these includes.
	* libguile/scm.h (struct scm_frame, union scm_vm_stack_element)
	  (struct scm_vm): Add forward declarations.
	* libguile/vm.h: Remove frames.h include.
	* libguile/foreign.h:
	* libguile/gsubr.h: Remove forward decls of union scm_vm_stack_element.
	* libguile/control.c:
	* libguile/eval.c:
	* libguile/print.c: Add frames.h includes.
	* libguile/threads.h: Remove continuations.h.
	* libguile/vm.c: Add continuations.h.
	* libguile/control.h: Swap vm.h include for scm.h include.
	* libguile/continuations.h: Add programs.h include for SCM_PROGRAM_P.

	Add intrinsic for foreign-call
	* libguile/Makefile.am (noinst_HEADERS, modinclude_HEADERS): Change to
	  not install intrinsics.h.
	* libguile/intrinsics.h: Add an error if BUILDING_LIBGUILE isn't set, to
	  catch any stray bad inclusions.  Add intrinsic for foreign-call.
	* libguile/foreign.c (foreign_call): Rename from scm_i_foreign_call, and
	  set as the foreign-call intrinsic.
	* libguile/vm-engine.c (foreign-call): Use the intrinsic.  In the future
	  we'll want to totally revamp the FFI, if we know that a JIT is
	  available!

2018-06-25  Andy Wingo  <wingo@pobox.com>

	Give multiple-values objects a tc7
	* libguile/scm.h (scm_tc7_values): New tc7.  Never seen by Scheme, so we
	  don't need to update it anywhere else.
	* libguile/values.h (scm_is_values): New public static inline function.
	  (scm_i_nvalues, scm_i_value_ref): New private static inline
	  functions.
	  (SCM_VALUESP): Use scm_is_value.
	  (scm_values_2, scm_values_3): New functions.
	  (scm_values_vtable): Remove; values objects are not structs any more.
	* libguile/values.c (scm_i_extract_values_2): Adapt to new values
	  representation.
	  (print_values): Remove now-unused function.
	  (scm_c_nvalues): Use scm_i_nvalues.
	  (scm_c_value_ref): Use scm_i_value_ref.
	  (scm_values, scm_c_values): Make the new-style objects, which store
	  their values inline.
	  (scm_values_2, scm_values_3): New helpers, to avoid consing little
	  useless lists.
	* libguile/vm-engine.c (halt, subr-call)
	* libguile/eval.c (eval): Adapt to new values representation.
	* libguile/i18n.c (scm_locale_string_to_integer)
	  (scm_locale_string_to_integer)
	* libguile/numbers.c (scm_i_floor_divide, scm_i_ceiling_divide)
	  (scm_i_truncate_divide, scm_i_centered_divide, scm_i_round_divide)
	  (scm_i_exact_integer_sqrt)
	* libguile/r6rs-ports.c (make_bytevector_output_port)
	* libguile/srfi-1.c (scm_srfi1_partition, scm_srfi1_partition_x)
	* libguile/srfi-14.c (scm_char_set_diff_plus_intersection)
	  (scm_char_set_diff_plus_intersection_x)
	* libguile/posix.c (scm_getrlimit, scm_open_process): Adapt to use
	  scm_values_2 or scm_values_3.
	* libguile/print.c (iprin1): Add printer for values objects.

	Add push-interrupt-frame VM intrinsic
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add
	  push-interrupt-frame.
	* libguile/vm.c (push_interrupt_frame): New intrinsic.  Goal is to
	  reduce the amount of inline code the JIT will generate for handling
	  interrupts.
	* libguile/vm-engine.c (handle-interrupts): Call out to the
	  push_interrupt_frame intrinsic in the slow case.

	Move VM keyword argument parsing to happen via an intrinsic
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add new intrinsics
	  for binding keyword arguments.
	* libguile/vm-engine.c (bind_kwargs): Call intrinsics.
	* libguile/vm.c (vm_error_kwargs_missing_value)
	  (vm_error_kwargs_invalid_keyword)
	  (vm_error_kwargs_unrecognized_keyword): Remove unused error cases.
	  (frame_locals_count, alloc_frame): New helper.
	  (compute_kwargs_npositional, bind_kwargs, cons_rest): New intrinsics.
	  (scm_bootstrap_vm): Define intrinsics.

	expand_stack intrinsic takes thread
	* libguile/intrinsics.h (scm_t_thread_sp_intrinsic): Change to take
	  thread instead of vp.
	  (SCM_FOR_ALL_VM_INTRINSICS): Change expand_stack to expect thread, not
	  vp.
	* libguile/vm-engine.c (ALLOC_FRAME): Call expand_stack with thread.
	* libguile/vm.c (thread_expand_stack, scm_bootstrap_vm): Adapt.

	Fix intrinsics copyright line and include guards
	* libguile/intrinsics.h: Fix include guard comment and copyright line.

	VM gets VP from thread
	* libguile/vm.c (scm_t_vm_engine, scm_call_n): Remove "vp" argument.
	* libguile/vm-engine.c (VP): New macro, to get VP from thread.  Replace
	  all uses of vp with this.

	Eagerly initialize thread VM; remove scm_the_vm
	* libguile/threads.c (thread_mark): Unconditionally call
	  scm_i_vm_mark_stack.
	  (guilify_self_1): Eagerly prepare the thread stack, before entering
	  Guile mode.  It's only a page of mmap, after all.
	* libguile/vm.c (scm_i_vm_prepare_stack): Rename from init_vm.
	  (thread_vm, scm_the_vm): Remove.
	  (VM_DEFINE_HOOK, scm_vm_trace_level, scm_set_vm_trace_level_x)
	  (scm_vm_engine, scm_c_set_vm_engine_x, scm_i_capture_current_stack)
	  (scm_call_n, scm_call_with_stack_overflow_handler): Adapt to get VM
	  from thread.
	  (scm_i_vm_free_stack): Memset the whole thing to 0 when we're done.
	* libguile/control.c (scm_abort_to_prompt_star)
	* libguile/eval.c (eval):
	* libguile/throw.c (catch, abort_to_prompt): Get VM from thread.

2018-06-24  Ludovic Courtès  <ludo@gnu.org>

	GDB support: Add 'guile-backtrace' command.
	* libguile/libguile-2.2-gdb.scm <top level>: Add 'register-command!' call.

	GDB support: Add note about (gdb frame-filters).
	* libguile/libguile-2.2-gdb.scm <top level>: Add comment.

2018-06-24  Ludovic Courtès  <ludo@gnu.org>

	GDB support: Fix 'display-vm-frames'.
	Previously 'vm-frame-older' would fail to traverse the chain of frames.

	* libguile/libguile-2.2-gdb.scm (uint-type): New variable
	(vm-frame): Fix "saved ip" and "saved fp" computation.  The latter had
	been broken roughly since commit
	72353de77d0a06f158d8af66a2540015658e2574.
	(vm-frame-older): Return #f when IP is zero, not when FP is zero.
	(vm-frame-function-name): Wrap 'vm-frame-program-debug-info' in
	'false-if-exception'

2018-06-24  Ludovic Courtès  <ludo@gnu.org>

	types: Recognize 'scm_t_port_type' and decode port type name.
	* module/system/base/types.scm (read-c-string, inferior-port-type): New
	procedures.
	(inferior-port): Use 'inferior-port-type' to determine the port type.
	(cell->object): Rename 'flags+type' to 'flags' in the '%tc7-port' case.
	* test-suite/tests/types.test ("opaque objects"): Adjust port testse.
	(test-inferior-ports): New macro.
	("ports"): New test prefix.

2018-06-24  Ludovic Courtès  <ludo@gnu.org>

	vm: Fix another typo.
	Fix typo introduced in efc33cd1497c00c5ebf961e834efc1d85f3e28ac.

	* libguile/vm.c (return_unused_stack_to_os): Remove extra 'while'.

2018-06-24  Andy Wingo  <wingo@pobox.com>

	Inline struct scm_vm into struct scm_i_thread
	* libguile/threads.h (scm_i_thread): Inline struct scm_vm into struct
	  scm_i_thread, as these exist in a one-to-one relationship.
	* libguile/threads.c (guilify_self_1, thread_mark, on_thread_exit):
	* libguile/control.c (scm_suspendable_continuation_p):
	* libguile/vm.c (init_vm, thread_vm): Adapt users.

	Add __scm.h placeholder
	* libguile/__scm.h: Add file, mistakenly removed in a previous commit.

2018-06-23  Arun Isaac  <arunisaac@systemreboot.net>

	web: Export http-request.
	* module/web/client.scm (request): Rename to http-request, add a
	docstring, and export it.
	(http-get, http-head, http-post, http-put, http-delete, http-trace,
	http-options): Update docstring.
	* doc/ref/web.texi (Web Client): Document http-request.

2018-06-21  Andy Wingo  <wingo@pobox.com>

	Deprecate scm_t_uint8 and similar typedefs
	* libguile/deprecated.h (SCM_DEPRECATED_TYPE): New helper define;
	  removed after.
	  (scm_t_int8, scm_t_uint8, scm_t_int16, scm_t_uint16)
	  (scm_t_int32, scm_t_uint32, scm_t_intmax, scm_t_uintmax)
	  (scm_t_intptr, scm_t_uintptr, scm_t_int64 scm_t_uint64)
	  (scm_t_ptrdiff): Deprecate these types.  Even on Guile 2.2 people
	  should use the stdint types.

	Use ptrdiff_t instead of scm_t_ptrdiff
	* libguile/continuations.h:
	* libguile/control.c:
	* libguile/control.h:
	* libguile/dynstack.c:
	* libguile/dynstack.h:
	* libguile/eval.c:
	* libguile/foreign.c:
	* libguile/frames.h:
	* libguile/gen-scmconfig.c:
	* libguile/gsubr.c:
	* libguile/gsubr.h:
	* libguile/loader.c:
	* libguile/numbers.h:
	* libguile/stacks.c:
	* libguile/throw.c:
	* libguile/vm-engine.c:
	* libguile/vm.c:
	* libguile/vm.h: Use ptrdiff_t from stddef.h.

	Replace uses of scm_t_int8, scm_t_uintmax, etc with stdint types
	* libguile/bitvectors.c:
	* libguile/bitvectors.h:
	* libguile/bytevectors.c:
	* libguile/bytevectors.h:
	* libguile/chars.c:
	* libguile/continuations.c:
	* libguile/control.c:
	* libguile/conv-integer.i.c:
	* libguile/conv-uinteger.i.c:
	* libguile/dynstack.c:
	* libguile/dynstack.h:
	* libguile/foreign.c:
	* libguile/frames.c:
	* libguile/frames.h:
	* libguile/gc-inline.h:
	* libguile/gc.h:
	* libguile/gsubr.c:
	* libguile/gsubr.h:
	* libguile/hash.c:
	* libguile/i18n.c:
	* libguile/instructions.c:
	* libguile/intrinsics.c:
	* libguile/intrinsics.h:
	* libguile/loader.c:
	* libguile/loader.h:
	* libguile/numbers.c:
	* libguile/numbers.h:
	* libguile/pairs.c:
	* libguile/ports-internal.h:
	* libguile/ports.c:
	* libguile/ports.h:
	* libguile/posix.c:
	* libguile/print.c:
	* libguile/print.h:
	* libguile/programs.c:
	* libguile/programs.h:
	* libguile/r6rs-ports.c:
	* libguile/random.c:
	* libguile/random.h:
	* libguile/scm.h:
	* libguile/socket.c:
	* libguile/srfi-4.c:
	* libguile/srfi-4.h:
	* libguile/stacks.c:
	* libguile/stime.c:
	* libguile/strings.c:
	* libguile/struct.c:
	* libguile/struct.h:
	* libguile/symbols.c:
	* libguile/threads.c:
	* libguile/threads.h:
	* libguile/uniform.c:
	* libguile/vm-engine.c:
	* libguile/vm.c:
	* libguile/vm.h:
	* libguile/vports.c:
	* test-suite/standalone/test-conversion.c:
	* test-suite/standalone/test-ffi-lib.c:
	* test-suite/standalone/test-scm-take-u8vector.c:
	* test-suite/standalone/test-srfi-4.c: Replace e.g. scm_t_uint8 with
	  uint8_t.

	Start to use C99 stdint in gen-scmconfig
	* configure.ac: Remove checks for stdint.h; we require C99 so it must be
	  there; and in any case for our purposes we use gnulib, so it will be
	  there.  No need to check for inttypes.h.  No need to check for what
	  type maps to e.g. uint32_t either.
	* libguile/deprecated.h (SCM_HAVE_T_INT64, SCM_HAVE_T_UINT64): Deprecate
	  these, as they are always 1.
	  (SCM_HAVE_ARRAYS): Likewise deprecate; it's always 1.
	* libguile/gen-scmconfig.c: Always include stdint.h and stddef.h, and
	  make it so that scmconfig.h also includes these.  Use C99 types.
	* libguile/gen-scmconfig.h.in: Remove configure-substed vars that are no
	  longer defined.

2018-06-20  Andy Wingo  <wingo@pobox.com>

	Update license notices in all C files
	Update to newest recommended license notices from the FSF.  Everything
	stays LGPLv3+ except guile-readline which is GPLv3+.

	libguile header files have uniform format for copyright declarations

	Remove (C) from copyright statements
	As the FSF advises, 'There is no legal significance to using the
	three-character sequence “(C)”, but it does no harm.'  It does take up
	space though!  For that reason, we remove it here from our C files.

	Make .c copyright headers uniform

	Rationalize include order in C files
	Include config.h first, then system includes, then libguile includes, in
	alphabetical order, then the include for the file in question.

	Make libguile header inclusion consistent within libguile c files
	Change from '#include "libguile/foo.h"' and '#include <libguile/foo.h>'
	to '#include "foo.h"'.

	Rationalize guile-readline includes
	* guile-readline/readline.c: Rationalize header include order.

	Rename __scm.h to scm.h
	* libguile/scm.h: Rename.  Update all includers.

	Inline tags.h into __scm.h
	* libguile/__scm.h: Inline tags.h, and reformat comments.  Before, these
	  files used to include each other!
	* libguile.h:
	* libguile/atomic.h:
	* libguile/boolean.c:
	* libguile/eq.h:
	* libguile/gc-malloc.c:
	* libguile/gc.c:
	* libguile/pairs.c:
	* libguile/pairs.h:
	* libguile/ports.h:
	* libguile/print.c:
	* libguile/snarf.h:
	* libguile/tags.h: Remove tags.h includes.

	Minor __scm.h reformatting
	* libguile/__scm.h: Reorder header and use GNU syntax for comments.

	Move SCM_ARG1, etc definitions to error.h
	* libguile/__scm.h:
	* libguile/error.h (SCM_ARGn, SCM_ARG1, SCM_ARG2, SCM_ARG3, SCM_ARG4)
	  (SCM_ARG5 SCM_ARG6 SCM_ARG7): Move here.

	Move SCM_TICK definition to __scm.h.
	* libguile/__scm.h:
	* libguile/async.h (SCM_TICK): Move here.

	Remove crufty support for 16-bit architectures.
	* libguile/__scm.h: Remove cases for 16-bit architectures (!).

	Deprecate pre-stdint.h limit macros
	* libguile/__scm.h:
	* libguile/deprecated.h:
	  (SCM_T_UINT8_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT16_MAX)
	  (SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT32_MAX, SCM_T_INT32_MIN)
	  (SCM_T_INT32_MAX, SCM_T_UINT64_MAX, SCM_T_INT64_MIN, SCM_T_INT64_MAX)
	  (SCM_T_UINTMAX_MAX, SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX)
	  (SCM_T_UINTPTR_MAX, SCM_T_INTPTR_MIN, SCM_T_INTPTR_MAX): Deprecate.

	Fix missing includes in tests.
	* test-suite/standalone/test-scm-c-read.c:
	* test-suite/standalone/test-scm-to-latin1-string.c: Add <string.h>.

	Use stdint.h limit macros
	* libguile/__scm.h: Include <stdint.h>, now that we rely on C99.
	  (SCM_T_UINT8_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT16_MAX)
	  (SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT32_MAX, SCM_T_INT32_MIN)
	  (SCM_T_INT32_MAX, SCM_T_UINT64_MAX, SCM_T_INT64_MIN, SCM_T_INT64_MAX)
	  (SCM_T_UINTMAX_MAX, SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX)
	  (SCM_T_UINTPTR_MAX, SCM_T_INTPTR_MIN, SCM_T_INTPTR_MAX): Define in
	  terms of equivalent stdint.h definitions.
	* libguile/gen-scmconfig.c:
	* libguile/instructions.c:
	* libguile/numbers.c:
	* libguile/random.c:
	* libguile/tags.h:
	* test-suite/standalone/test-conversion.c: Adapt to use C99 names.

	Fix include in test-ffi-lib
	* test-suite/standalone/test-ffi-lib.c: Add missing <string.h> include.

	Move SCM_C_INLINE_KEYWORD definition to inline.h
	* libguile/__scm.h:
	* libguile/inline.h (SCM_C_INLINE_KEYWORD): Move this definition here.

	Remove unneeded memmove.c and strerror.c files
	* libguile/memmove.c:
	* libguile/strerror.c: Remove; these must be present for C99.
	* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  Remove files.

2018-06-20  Andy Wingo  <wingo@pobox.com>

	Remove Emacs local variables comments in Guile source
	The .dir-locals.el file in the repository is sufficient for Emacs
	users.

	* libguile/__scm.h:
	* libguile/alist.c:
	* libguile/alist.h:
	* libguile/array-handle.c:
	* libguile/array-handle.h:
	* libguile/array-map.c:
	* libguile/array-map.h:
	* libguile/arrays.c:
	* libguile/arrays.h:
	* libguile/async.c:
	* libguile/async.h:
	* libguile/backtrace.c:
	* libguile/backtrace.h:
	* libguile/bitvectors.c:
	* libguile/bitvectors.h:
	* libguile/boolean.c:
	* libguile/boolean.h:
	* libguile/chars.c:
	* libguile/chars.h:
	* libguile/chooks.c:
	* libguile/chooks.h:
	* libguile/continuations.c:
	* libguile/continuations.h:
	* libguile/control.c:
	* libguile/conv-integer.i.c:
	* libguile/debug-malloc.h:
	* libguile/debug.c:
	* libguile/debug.h:
	* libguile/deprecation.c:
	* libguile/deprecation.h:
	* libguile/dynl.c:
	* libguile/dynl.h:
	* libguile/dynstack.c:
	* libguile/dynstack.h:
	* libguile/dynwind.c:
	* libguile/dynwind.h:
	* libguile/eq.c:
	* libguile/eq.h:
	* libguile/error.c:
	* libguile/error.h:
	* libguile/eval.c:
	* libguile/eval.h:
	* libguile/evalext.c:
	* libguile/evalext.h:
	* libguile/expand.c:
	* libguile/expand.h:
	* libguile/extensions.c:
	* libguile/extensions.h:
	* libguile/feature.c:
	* libguile/feature.h:
	* libguile/filesys.c:
	* libguile/filesys.h:
	* libguile/fluids.c:
	* libguile/fluids.h:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/fports.h:
	* libguile/frames.c:
	* libguile/frames.h:
	* libguile/gc-inline.h:
	* libguile/gc.c:
	* libguile/gc.h:
	* libguile/generalized-arrays.c:
	* libguile/generalized-arrays.h:
	* libguile/generalized-vectors.c:
	* libguile/generalized-vectors.h:
	* libguile/gettext.c:
	* libguile/gettext.h:
	* libguile/goops.c:
	* libguile/goops.h:
	* libguile/gsubr.c:
	* libguile/gsubr.h:
	* libguile/guardians.c:
	* libguile/guardians.h:
	* libguile/guile.c:
	* libguile/hash.c:
	* libguile/hash.h:
	* libguile/hashtab.c:
	* libguile/hashtab.h:
	* libguile/hooks.c:
	* libguile/hooks.h:
	* libguile/i18n.c:
	* libguile/i18n.h:
	* libguile/init.c:
	* libguile/init.h:
	* libguile/instructions.c:
	* libguile/instructions.h:
	* libguile/intrinsics.c:
	* libguile/intrinsics.h:
	* libguile/ioext.c:
	* libguile/ioext.h:
	* libguile/iselect.h:
	* libguile/keywords.c:
	* libguile/keywords.h:
	* libguile/list.c:
	* libguile/list.h:
	* libguile/load.c:
	* libguile/load.h:
	* libguile/loader.c:
	* libguile/loader.h:
	* libguile/macros.c:
	* libguile/macros.h:
	* libguile/mallocs.c:
	* libguile/mallocs.h:
	* libguile/memmove.c:
	* libguile/memoize.c:
	* libguile/memoize.h:
	* libguile/modules.c:
	* libguile/modules.h:
	* libguile/net_db.c:
	* libguile/net_db.h:
	* libguile/null-threads.c:
	* libguile/null-threads.h:
	* libguile/numbers.c:
	* libguile/numbers.h:
	* libguile/objprop.c:
	* libguile/objprop.h:
	* libguile/options.c:
	* libguile/options.h:
	* libguile/pairs.c:
	* libguile/pairs.h:
	* libguile/poll.c:
	* libguile/poll.h:
	* libguile/ports.c:
	* libguile/ports.h:
	* libguile/posix.c:
	* libguile/posix.h:
	* libguile/print.c:
	* libguile/print.h:
	* libguile/procprop.c:
	* libguile/procprop.h:
	* libguile/procs.c:
	* libguile/procs.h:
	* libguile/programs.c:
	* libguile/programs.h:
	* libguile/promises.c:
	* libguile/promises.h:
	* libguile/pthread-threads.h:
	* libguile/random.c:
	* libguile/random.h:
	* libguile/rdelim.c:
	* libguile/rdelim.h:
	* libguile/read.c:
	* libguile/read.h:
	* libguile/regex-posix.c:
	* libguile/regex-posix.h:
	* libguile/rw.c:
	* libguile/rw.h:
	* libguile/scmsigs.c:
	* libguile/scmsigs.h:
	* libguile/script.c:
	* libguile/script.h:
	* libguile/simpos.c:
	* libguile/simpos.h:
	* libguile/smob.c:
	* libguile/smob.h:
	* libguile/snarf.h:
	* libguile/socket.c:
	* libguile/socket.h:
	* libguile/sort.c:
	* libguile/sort.h:
	* libguile/srcprop.c:
	* libguile/srcprop.h:
	* libguile/stackchk.c:
	* libguile/stackchk.h:
	* libguile/stacks.c:
	* libguile/stacks.h:
	* libguile/stime.c:
	* libguile/stime.h:
	* libguile/strerror.c:
	* libguile/strings.c:
	* libguile/strings.h:
	* libguile/strorder.c:
	* libguile/strorder.h:
	* libguile/strports.c:
	* libguile/strports.h:
	* libguile/struct.c:
	* libguile/struct.h:
	* libguile/symbols.c:
	* libguile/symbols.h:
	* libguile/syntax.c:
	* libguile/syscalls.h:
	* libguile/tags.h:
	* libguile/threads.c:
	* libguile/threads.h:
	* libguile/throw.c:
	* libguile/throw.h:
	* libguile/trees.h:
	* libguile/unicode.c:
	* libguile/unicode.h:
	* libguile/uniform.c:
	* libguile/uniform.h:
	* libguile/values.c:
	* libguile/values.h:
	* libguile/variable.c:
	* libguile/variable.h:
	* libguile/vectors.c:
	* libguile/vectors.h:
	* libguile/version.c:
	* libguile/vm-engine.c:
	* libguile/vm-expand.h:
	* libguile/vm.c:
	* libguile/vm.h:
	* libguile/vports.c:
	* libguile/vports.h:
	* libguile/weak-list.h:
	* libguile/weak-set.c:
	* libguile/weak-set.h:
	* libguile/weak-table.c:
	* libguile/weak-table.h:
	* libguile/weak-vector.c:
	* libguile/weak-vector.h: Remove needless trailing comments.

2018-06-20  Andy Wingo  <wingo@pobox.com>

	Remove useless "classes: h_files" from Guile headers.
	* libguile/__scm.h:
	* libguile/alist.h:
	* libguile/array-handle.h:
	* libguile/array-map.h:
	* libguile/arrays.h:
	* libguile/async.h:
	* libguile/backtrace.h:
	* libguile/bitvectors.h:
	* libguile/boolean.h:
	* libguile/chars.h:
	* libguile/chooks.h:
	* libguile/continuations.h:
	* libguile/debug-malloc.h:
	* libguile/debug.h:
	* libguile/deprecation.h:
	* libguile/dynl.h:
	* libguile/dynstack.h:
	* libguile/dynwind.h:
	* libguile/eq.h:
	* libguile/error.h:
	* libguile/eval.h:
	* libguile/evalext.h:
	* libguile/expand.h:
	* libguile/extensions.h:
	* libguile/feature.h:
	* libguile/filesys.h:
	* libguile/fluids.h:
	* libguile/fports.h:
	* libguile/gc-inline.h:
	* libguile/gc.h:
	* libguile/generalized-arrays.h:
	* libguile/generalized-vectors.h:
	* libguile/gettext.h:
	* libguile/goops.h:
	* libguile/gsubr.h:
	* libguile/guardians.h:
	* libguile/hash.h:
	* libguile/hashtab.h:
	* libguile/hooks.h:
	* libguile/i18n.h:
	* libguile/init.h:
	* libguile/inline.h:
	* libguile/ioext.h:
	* libguile/iselect.h:
	* libguile/keywords.h:
	* libguile/list.h:
	* libguile/load.h:
	* libguile/macros.h:
	* libguile/mallocs.c:
	* libguile/mallocs.h:
	* libguile/memoize.h:
	* libguile/modules.h:
	* libguile/net_db.h:
	* libguile/null-threads.h:
	* libguile/numbers.h:
	* libguile/objprop.h:
	* libguile/options.h:
	* libguile/pairs.h:
	* libguile/poll.h:
	* libguile/ports.h:
	* libguile/posix-w32.h:
	* libguile/posix.h:
	* libguile/print.h:
	* libguile/procprop.h:
	* libguile/procs.h:
	* libguile/promises.h:
	* libguile/pthread-threads.h:
	* libguile/random.h:
	* libguile/rdelim.h:
	* libguile/read.h:
	* libguile/regex-posix.h:
	* libguile/rw.h:
	* libguile/scmsigs.h:
	* libguile/script.h:
	* libguile/simpos.h:
	* libguile/smob.h:
	* libguile/snarf.h:
	* libguile/socket.h:
	* libguile/sort.h:
	* libguile/srcprop.h:
	* libguile/stackchk.h:
	* libguile/stacks.h:
	* libguile/stime.h:
	* libguile/strings.h:
	* libguile/strorder.h:
	* libguile/strports.h:
	* libguile/struct.h:
	* libguile/symbols.h:
	* libguile/syscalls.h:
	* libguile/tags.h:
	* libguile/threads.h:
	* libguile/throw.h:
	* libguile/trees.h:
	* libguile/unicode.h:
	* libguile/uniform.h:
	* libguile/values.h:
	* libguile/variable.h:
	* libguile/vectors.h:
	* libguile/vports.h:
	* libguile/weak-list.h:
	* libguile/weak-set.h:
	* libguile/weak-table.h:
	* libguile/weak-vector.h: Remove "classes: h_files".  Reformat
	  copyrights if needed.

	Remove _scm.h
	* libguile/_scm.h: Remove.  An internal header, never installed.
	* libguile/__scm.h: Remove horrible documentation.
	* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  Remove _scm.h.
	* libguile/alist.c:
	* libguile/array-handle.c:
	* libguile/array-map.c:
	* libguile/arrays.c:
	* libguile/async.c:
	* libguile/atomic.c:
	* libguile/backtrace.c:
	* libguile/bitvectors.c:
	* libguile/boolean.c:
	* libguile/bytevectors.c:
	* libguile/chars.c:
	* libguile/continuations.c:
	* libguile/control.c:
	* libguile/debug-malloc.c:
	* libguile/debug.c:
	* libguile/deprecated.c:
	* libguile/deprecation.c:
	* libguile/dynl.c:
	* libguile/dynstack.c:
	* libguile/dynwind.c:
	* libguile/eq.c:
	* libguile/error.c:
	* libguile/eval.c:
	* libguile/evalext.c:
	* libguile/expand.c:
	* libguile/extensions.c:
	* libguile/fdes-finalizers.c:
	* libguile/feature.c:
	* libguile/filesys.c:
	* libguile/finalizers.c:
	* libguile/fluids.c:
	* libguile/foreign-object.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/gc-malloc.c:
	* libguile/gc.c:
	* libguile/gen-scmconfig.c:
	* libguile/generalized-arrays.c:
	* libguile/generalized-vectors.c:
	* libguile/gettext.c:
	* libguile/goops.c:
	* libguile/gsubr.c:
	* libguile/guardians.c:
	* libguile/hash.c:
	* libguile/hashtab.c:
	* libguile/hooks.c:
	* libguile/i18n.c:
	* libguile/init.c:
	* libguile/instructions.c:
	* libguile/intrinsics.c:
	* libguile/ioext.c:
	* libguile/keywords.c:
	* libguile/list.c:
	* libguile/load.c:
	* libguile/loader.c:
	* libguile/macros.c:
	* libguile/mallocs.c:
	* libguile/memoize.c:
	* libguile/modules.c:
	* libguile/net_db.c:
	* libguile/null-threads.c:
	* libguile/numbers.c:
	* libguile/objprop.c:
	* libguile/options.c:
	* libguile/pairs.c:
	* libguile/poll.c:
	* libguile/ports-internal.h:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/print.c:
	* libguile/procprop.c:
	* libguile/procs.c:
	* libguile/programs.c:
	* libguile/promises.c:
	* libguile/r6rs-ports.c:
	* libguile/random.c:
	* libguile/rdelim.c:
	* libguile/read.c:
	* libguile/regex-posix.c:
	* libguile/rw.c:
	* libguile/scmsigs.c:
	* libguile/script.c:
	* libguile/simpos.c:
	* libguile/smob.c:
	* libguile/socket.c:
	* libguile/sort.c:
	* libguile/srcprop.c:
	* libguile/srfi-1.c:
	* libguile/srfi-13.c:
	* libguile/srfi-14.c:
	* libguile/srfi-4.c:
	* libguile/srfi-60.c:
	* libguile/stackchk.c:
	* libguile/stacks.c:
	* libguile/stime.c:
	* libguile/strings.c:
	* libguile/strorder.c:
	* libguile/strports.c:
	* libguile/struct.c:
	* libguile/symbols.c:
	* libguile/syntax.c:
	* libguile/threads.c:
	* libguile/throw.c:
	* libguile/trees.c:
	* libguile/unicode.c:
	* libguile/uniform.c:
	* libguile/values.c:
	* libguile/variable.c:
	* libguile/vectors.c:
	* libguile/version.c:
	* libguile/vm.c:
	* libguile/vports.c:
	* libguile/weak-set.c:
	* libguile/weak-table.c:
	* libguile/weak-vector.c: Remove _scm.h includes.

	Devolve strings.h
	* libguile/_scm.h: Remove strings.h.
	* libguile/array-handle.c:
	* libguile/boolean.c:
	* libguile/generalized-vectors.c:
	* libguile/loader.c:
	* libguile/unicode.c: Add strings.h.
	* libguile/symbols.h: Add strings.h, which was missing from the previous
	  symbols.h devolution.

	Devolve programs.h from _scm.h.
	* libguile/_scm.h: Remove programs.h.
	* libguile/strings.h: Add gc.h.

	Devolve foreign.h from _scm.h
	* libguile/_scm.h: Remove foreign.h.
	* libguile/eq.c:
	* libguile/goops.c:
	* libguile/hash.c:
	* libguile/init.c:
	* libguile/print.c:
	* libguile/vm.c: Add foreign.h.

	Devolve symbols.h from _scm.h
	* libguile/_scm.h: Remove symbols.h.
	* libguile/array-handle.c:
	* libguile/array-map.c:
	* libguile/backtrace.c:
	* libguile/bytevectors.c:
	* libguile/chars.c:
	* libguile/continuations.c:
	* libguile/error.c:
	* libguile/eval.c:
	* libguile/evalext.c:
	* libguile/expand.c:
	* libguile/feature.c:
	* libguile/filesys.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/gc.c:
	* libguile/goops.c:
	* libguile/gsubr.c:
	* libguile/i18n.c:
	* libguile/instructions.c:
	* libguile/intrinsics.c:
	* libguile/keywords.c:
	* libguile/load.c:
	* libguile/macros.c:
	* libguile/memoize.c:
	* libguile/modules.c:
	* libguile/net_db.c:
	* libguile/options.c:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/print.c:
	* libguile/procprop.c:
	* libguile/procs.c:
	* libguile/r6rs-ports.c:
	* libguile/random.c:
	* libguile/read.c:
	* libguile/socket.c:
	* libguile/srcprop.c:
	* libguile/srfi-13.c:
	* libguile/srfi-14.c:
	* libguile/stacks.c:
	* libguile/strings.c:
	* libguile/strports.c:
	* libguile/struct.c:
	* libguile/threads.c:
	* libguile/throw.c:
	* libguile/vm.c: Add symbols.h.

	Remove modules.h from _scm.h.
	* libguile/_scm.h: Remove modules.h.
	* libguile/arrays.c:
	* libguile/backtrace.c:
	* libguile/feature.c:
	* libguile/filesys.c:
	* libguile/foreign-object.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/gc.c:
	* libguile/gsubr.c:
	* libguile/i18n.c:
	* libguile/intrinsics.c:
	* libguile/macros.c:
	* libguile/numbers.c:
	* libguile/poll.c:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/random.c:
	* libguile/read.c:
	* libguile/regex-posix.c:
	* libguile/scmsigs.c:
	* libguile/script.c:
	* libguile/socket.c:
	* libguile/srcprop.c:
	* libguile/srfi-14.c:
	* libguile/srfi-4.c:
	* libguile/stime.c:
	* libguile/struct.c:
	* libguile/syntax.c:
	* libguile/threads.c:
	* libguile/throw.c: Add modules.h.

	Devolve threads.h from _scm.h.
	* libguile/__scm.h (scm_print_state, scm_t_dynstack): Add forward
	  declarations.
	* libguile/_scm.h: Remove threads.h.
	* libguile/atomic.c:
	* libguile/bitvectors.h:
	* libguile/bytevectors.c:
	* libguile/continuations.h:
	* libguile/control.c:
	* libguile/deprecation.c:
	* libguile/dynl.c:
	* libguile/dynstack.h:
	* libguile/dynwind.c:
	* libguile/extensions.c:
	* libguile/fdes-finalizers.c:
	* libguile/foreign-object.c:
	* libguile/frames.c:
	* libguile/guardians.c:
	* libguile/hashtab.c:
	* libguile/list.c:
	* libguile/loader.c:
	* libguile/macros.c:
	* libguile/memoize.c:
	* libguile/net_db.c:
	* libguile/pairs.c:
	* libguile/procprop.c:
	* libguile/rdelim.c:
	* libguile/simpos.c:
	* libguile/srfi-14.c:
	* libguile/srfi-60.c:
	* libguile/strings.c:
	* libguile/strports.c:
	* libguile/syntax.c:
	* libguile/syntax.h:
	* libguile/unicode.c:
	* libguile/variable.c:
	* libguile/vectors.c:
	* libguile/weak-set.c:
	* libguile/weak-set.h:
	* libguile/weak-table.c:
	* libguile/weak-table.h:
	* libguile/weak-vector.c: Add threads.h as appropriate, or possible
	  other headers that threads.h pulled in.

	Define scm_t_wchar in one place
	* libguile/__scm.h (scm_t_wchar): Move definition here, closer to
	  scm_t_int32 definition (pulled in by scmconfig.h).
	* libguile/numbers.h:
	* libguile/chars.h: Remove weird maybe-definitions.

	Shuffle around inline C function implementation
	* libguile/__scm.h:
	* libguile/inline.h (SCM_C_EXTERN_INLINE, SCM_CAN_INLINE, SCM_INLINE)
	  (SCM_INLINE_IMPLEMENTATION): Move definitions here, from __scm.h.
	* libguile/strings.h (scm_is_string): Move implementation here, from
	  inline.h.
	* libguile/inline.c: Add strings.h include.
	* libguile/_scm.h: Remove inline.h include.
	* libguile/array-handle.h:
	* libguile/gc.h:
	* libguile/pairs.h:
	* libguile/smob.h: Add inline.h includes.

	Devolve variable.h from _scm.h.
	* libguile/_scm.h: Remove variable.h.
	* libguile/backtrace.c:
	* libguile/debug.c:
	* libguile/dynstack.c:
	* libguile/dynwind.c:
	* libguile/eval.c:
	* libguile/evalext.c:
	* libguile/expand.c:
	* libguile/feature.c:
	* libguile/fluids.c:
	* libguile/foreign-object.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/goops.c:
	* libguile/i18n.c:
	* libguile/load.c:
	* libguile/macros.c:
	* libguile/memoize.c:
	* libguile/ports.c:
	* libguile/print.c:
	* libguile/programs.c:
	* libguile/random.c:
	* libguile/read.c:
	* libguile/scmsigs.c:
	* libguile/srfi-4.c:
	* libguile/strports.c:
	* libguile/syntax.c:
	* libguile/threads.c:
	* libguile/throw.c: Add variable.h.

	Remove snarf.h from _scm.h
	* libguile/_scm.h: Remove snarf.h.

	Simplify SCM_IMMUTABLE_CELL macros
	* libguile/snarf.h (SCM_IMMUTABLE_CELL):
	  (SCM_IMMUTABLE_DOUBLE_CELL): Simplify these macros and avoid pulling
	  in gc.h.

	Devolve smob snarfers
	* libguile/snarf.h:
	* libguile/smob.h (SCM_SMOB, SCM_GLOBAL_SMOB)
	  (SCM_SMOB_MARK, SCM_GLOBAL_SMOB_MARK)
	  (SCM_SMOB_FREE, SCM_GLOBAL_SMOB_FREE)
	  (SCM_SMOB_PRINT, SCM_GLOBAL_SMOB_PRINT)
	  (SCM_SMOB_EQUALP, SCM_GLOBAL_SMOB_EQUALP)
	  (SCM_SMOB_APPLY, SCM_GLOBAL_SMOB_APPLY): Move these definitions here.

	Remove mutex snarfers
	* libguile/snarf.h (SCM_MUTEX, SCM_GLOBAL_MUTEX, SCM_REC_MUTEX)
	  (SCM_GLOBAL_REC_MUTEX): Remove snarfers that referred to data-types
	  that don't exist.

	Devolve variable snarfers
	* libguile/snarf.h:
	* libguile/variable.h (SCM_VARIABLE, SCM_GLOBAL_VARIABLE):
	  (SCM_VARIABLE_INIT, SCM_GLOBAL_VARIABLE_INIT): Move here.

	Devolve keyword-snarfing macros
	* libguile/snarf.h:
	* libguile/keywords.h (SCM_KEYWORD, SCM_GLOBAL_KEYWORD): Move here.

	Move string-related snarfers to strings.h
	* libguile/snarf.h:
	* libguile/strings.h (SCM_IMMUTABLE_STRINGBUF, SCM_IMMUTABLE_STRING):
	  Move here.

	Deprecate SCM_STATIC_DOUBLE_CELL snarf macro
	* libguile/snarf.h:
	* libguile/deprecated.h (SCM_STATIC_DOUBLE_CELL): Deprecate this unused
	  macro.

	Move subr snarfing macros to gsubr.h.
	* libguile/snarf.h: Remove gsubr include and subr snarfers.
	* libguile/gsubr.h (SCM_DEFINE_GSUBR, SCM_DEFINE, SCM_PRIMITIVE_GENERIC):
	  (SCM_DEFINE_PUBLIC, SCM_PROC, SCM_REGISTER_PROC, SCM_GPROC): Move
	  here.
	* libguile/alist.c:
	* libguile/array-map.c:
	* libguile/arrays.c:
	* libguile/async.c:
	* libguile/atomic.c:
	* libguile/backtrace.c:
	* libguile/bitvectors.c:
	* libguile/boolean.c:
	* libguile/bytevectors.c:
	* libguile/chars.c:
	* libguile/continuations.c:
	* libguile/control.c:
	* libguile/debug-malloc.c:
	* libguile/debug.c:
	* libguile/deprecation.c:
	* libguile/dynl.c:
	* libguile/eq.c:
	* libguile/error.c:
	* libguile/error.h:
	* libguile/eval.c:
	* libguile/evalext.c:
	* libguile/expand.c:
	* libguile/extensions.c:
	* libguile/fdes-finalizers.c:
	* libguile/feature.c:
	* libguile/filesys.c:
	* libguile/finalizers.c:
	* libguile/fluids.c:
	* libguile/foreign-object.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/gc.c:
	* libguile/generalized-arrays.c:
	* libguile/generalized-vectors.c:
	* libguile/gettext.c:
	* libguile/guardians.c:
	* libguile/hash.c:
	* libguile/hashtab.c:
	* libguile/hooks.c:
	* libguile/i18n.c:
	* libguile/instructions.c:
	* libguile/intrinsics.c:
	* libguile/ioext.c:
	* libguile/keywords.c:
	* libguile/list.c:
	* libguile/load.c:
	* libguile/loader.c:
	* libguile/macros.c:
	* libguile/memoize.c:
	* libguile/modules.c:
	* libguile/net_db.c:
	* libguile/numbers.c:
	* libguile/objprop.c:
	* libguile/pairs.c:
	* libguile/poll.c:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/print.c:
	* libguile/procs.c:
	* libguile/programs.c:
	* libguile/promises.c:
	* libguile/r6rs-ports.c:
	* libguile/random.c:
	* libguile/rdelim.c:
	* libguile/read.c:
	* libguile/regex-posix.c:
	* libguile/rw.c:
	* libguile/scmsigs.c:
	* libguile/simpos.c:
	* libguile/smob.c:
	* libguile/socket.c:
	* libguile/sort.c:
	* libguile/srcprop.c:
	* libguile/srfi-1.c:
	* libguile/srfi-13.c:
	* libguile/srfi-14.c:
	* libguile/srfi-4.c:
	* libguile/srfi-60.c:
	* libguile/stackchk.c:
	* libguile/stacks.c:
	* libguile/stime.c:
	* libguile/strings.c:
	* libguile/strorder.c:
	* libguile/strports.c:
	* libguile/struct.c:
	* libguile/symbols.c:
	* libguile/syntax.c:
	* libguile/threads.c:
	* libguile/throw.c:
	* libguile/trees.c:
	* libguile/unicode.c:
	* libguile/values.c:
	* libguile/variable.c:
	* libguile/vectors.c:
	* libguile/version.c:
	* libguile/vm.c:
	* libguile/vports.c:
	* libguile/weak-table.c:
	* libguile/weak-vector.c: Add gsubr includes.

	Move symbol snarfers to symbols.h
	* libguile/snarf.h:
	* libguile/symbols.h (SCM_SYMBOL, SCM_GLOBAL_SYMBOL): Move here.

	Move scm_tc7_pointer snarfer out to foreign.h
	* libguile/snarf.h:
	* libguile/foreign.h (SCM_IMMUTABLE_POINTER): Move here, from snarf.h.

2018-06-19  Ludovic Courtès  <ludo@gnu.org>

	Add 'scm_to_stringn' shortcut when converting to UTF-8.
	* libguile/strings.c (scm_to_stringn): Call 'scm_to_utf8_stringn' when
	ENCODING == "UTF-8".

2018-06-19  Andy Wingo  <wingo@pobox.com>

	Devolve numbers.h from _scm.h.
	* libguile/_scm.h: Remove numbers.h.
	* libguile/array-handle.c:
	* libguile/array-map.c:
	* libguile/arrays.c:
	* libguile/backtrace.c:
	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/chars.c:
	* libguile/continuations.c:
	* libguile/debug-malloc.c:
	* libguile/error.c:
	* libguile/eval.c:
	* libguile/filesys.c:
	* libguile/foreign-object.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/gc.c:
	* libguile/generalized-arrays.c:
	* libguile/gettext.c:
	* libguile/goops.c:
	* libguile/gsubr.c:
	* libguile/guardians.c:
	* libguile/hash.c:
	* libguile/hashtab.c:
	* libguile/hooks.c:
	* libguile/i18n.c:
	* libguile/instructions.c:
	* libguile/intrinsics.c:
	* libguile/ioext.c:
	* libguile/list.c:
	* libguile/memoize.c:
	* libguile/net_db.c:
	* libguile/options.c:
	* libguile/ports.c:
	* libguile/posix-w32.c:
	* libguile/posix.c:
	* libguile/procprop.c:
	* libguile/programs.c:
	* libguile/r6rs-ports.c:
	* libguile/random.c:
	* libguile/rdelim.c:
	* libguile/read.c:
	* libguile/regex-posix.c:
	* libguile/rw.c:
	* libguile/scmsigs.c:
	* libguile/simpos.c:
	* libguile/smob.c:
	* libguile/socket.c:
	* libguile/srcprop.c:
	* libguile/srfi-13.c:
	* libguile/srfi-14.c:
	* libguile/srfi-4.c:
	* libguile/stackchk.c:
	* libguile/stacks.c:
	* libguile/stime.c:
	* libguile/strings.c:
	* libguile/struct.c:
	* libguile/symbols.c:
	* libguile/threads.c:
	* libguile/throw.c:
	* libguile/vectors.c:
	* libguile/version.c:
	* libguile/vm.c:
	* libguile/vports.c:
	* libguile/weak-table.c: Add numbers.h.

	Remove error.h from inline.h
	* libguile/inline.h: Remove error.h.

	Remove numbers.h from inline.h
	* libguile/inline.h: Remove libguile/numbers.h.
	* libguile/inline.c: Alter include order to work around a weird failure.

	Remove ports.h from inline.h
	* libguile/inline.h: Remove ports.h.
	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/foreign.c:
	* libguile/frames.c:
	* libguile/goops.h:
	* libguile/programs.c:
	* libguile/smob.c:
	* libguile/srfi-14.c:
	* libguile/vm.c: Add ports.h.

	Remove <unistd.h> from ports.h
	* libguile/ports.h: Remove <unistd.h>

	Remove <stdio.h> from ports.h
	* libguile/ports.h: Remove <stdio.h>.
	* libguile/finalizers.c:
	* libguile/guile.c:
	* libguile/memoize.c:
	* libguile/srfi-14.c:
	* libguile/vm.c: Add <stdio.h>.
	* libguile/struct.c: Add <stdarg.h>.

	Remove <string.h> include from ports.h.
	* libguile/ports.h: Remove <string.h>.
	* libguile/array-handle.c:
	* libguile/array-map.c:
	* libguile/chars.c:
	* libguile/hash.c:
	* libguile/memoize.c:
	* libguile/ports-internal.h:
	* libguile/regex-posix.c:
	* libguile/srfi-4.c:
	* libguile/unicode.c:
	* libguile/weak-set.c:
	* libguile/weak-vector.c: Add string.h.

	Devolve vectors.h include from ports.h
	* libguile/ports.h: Remove vectors.h include.
	* libguile/array-handle.c:
	* libguile/expand.c:
	* libguile/memoize.c:
	* libguile/poll.c:
	* libguile/ports-internal.h:
	* libguile/srfi-1.c:
	* libguile/vm.c:
	* libguile/weak-vector.c: Add vectors.h includes.

	Remove threads.h include from ports.h

	Move struct.h include out of ports.h
	* libguile/ports.h: Remove struct.h include.
	* libguile/expand.h:
	* libguile/hash.c:
	* libguile/procs.c: Add struct.h includes.

	Remove bytevectors.h include form ports.h
	* libguile/ports.h: Remove bytevectors.h include.
	* libguile/array-handle.c:
	* libguile/loader.c:
	* libguile/ports-internal.h:
	* libguile/socket.c: Add bytevectors.h include.

	Move array-handle.h include out from inline.h
	* libguile/inline.h: Remove array-handle.h include.
	* libguile/srfi-4.h:
	* libguile/uniform.h:
	* libguile/vectors.h: Add array-handle.h includes.

	Remove threads.h from inline.h

	Remove gc.h from inline.h

	Devolve procs.h include from _scm.h.
	* libguile/_scm.h: Remove procs.h include.
	* libguile/arrays.c:
	* libguile/foreign-object.c:
	* libguile/ports.c:
	* libguile/promises.c:
	* libguile/r6rs-ports.c:
	* libguile/scmsigs.c:
	* libguile/srfi-1.c:
	* libguile/srfi-13.c:
	* libguile/srfi-14.c:
	* libguile/strports.c:
	* libguile/weak-table.c: Add procs includes.

	Move gsubr.h include to snarf.h
	* libguile/_scm.h:
	* libguile/snarf.h: Move gsubr.h include here, from _scm.h.

2018-06-18  Andy Wingo  <wingo@pobox.com>

	Devolve gc.h
	* libguile/_scm.h: Remove gc.h.
	* libguile/arrays.h:
	* libguile/bytevectors.h:
	* libguile/foreign.h:
	* libguile/fports.h:
	* libguile/frames.h:
	* libguile/hashtab.h:
	* libguile/modules.h:
	* libguile/numbers.h:
	* libguile/print.h:
	* libguile/programs.h:
	* libguile/smob.h:
	* libguile/snarf.h:
	* libguile/strports.h:
	* libguile/struct.h:
	* libguile/symbols.h:
	* libguile/variable.h:
	* libguile/vectors.h:
	* libguile/vm.h: Add gc.h to users of scm_cell_* interfaces.  Not really
	  visible right now given that e.g. numbers.h is already included in
	  _scm.h.

	Devolve pairs.h
	* libguile/_scm.h: Remove pairs.h.
	* libguile/alist.c:
	* libguile/array-handle.c:
	* libguile/array-map.c:
	* libguile/arrays.c:
	* libguile/async.c:
	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/chars.c:
	* libguile/continuations.c:
	* libguile/control.c:
	* libguile/debug.c:
	* libguile/deprecation.c:
	* libguile/dynwind.c:
	* libguile/eq.c:
	* libguile/eval.c:
	* libguile/evalext.c:
	* libguile/expand.c:
	* libguile/fdes-finalizers.c:
	* libguile/feature.c:
	* libguile/filesys.c:
	* libguile/fluids.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/gc.c:
	* libguile/generalized-arrays.c:
	* libguile/goops.c:
	* libguile/guardians.c:
	* libguile/hash.c:
	* libguile/hashtab.c:
	* libguile/hooks.c:
	* libguile/i18n.c:
	* libguile/instructions.c:
	* libguile/ioext.c:
	* libguile/keywords.c:
	* libguile/list.c:
	* libguile/load.c:
	* libguile/loader.c:
	* libguile/memoize.c:
	* libguile/modules.c:
	* libguile/net_db.c:
	* libguile/numbers.c:
	* libguile/objprop.c:
	* libguile/options.c:
	* libguile/ports-internal.h:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/print.c:
	* libguile/print.h:
	* libguile/procprop.c:
	* libguile/programs.c:
	* libguile/random.c:
	* libguile/rdelim.c:
	* libguile/read.c:
	* libguile/regex-posix.c:
	* libguile/scmsigs.c:
	* libguile/script.c:
	* libguile/socket.c:
	* libguile/sort.c:
	* libguile/srcprop.c:
	* libguile/srfi-1.c:
	* libguile/srfi-13.c:
	* libguile/srfi-14.c:
	* libguile/srfi-60.c:
	* libguile/stacks.c:
	* libguile/stime.c:
	* libguile/strings.c:
	* libguile/strorder.c:
	* libguile/struct.c:
	* libguile/symbols.c:
	* libguile/threads.c:
	* libguile/throw.c:
	* libguile/trees.c:
	* libguile/values.c:
	* libguile/vectors.c:
	* libguile/vm.c:
	* libguile/weak-list.h:
	* libguile/weak-set.c:
	* libguile/weak-table.c:
	* libguile/weak-vector.c: Add pairs.h.

	Devolve boolean.h include.
	* libguile/_scm.h: Remove boolean.h include.
	* libguile/alist.c:
	* libguile/array-map.c:
	* libguile/arrays.c:
	* libguile/backtrace.c:
	* libguile/bitvectors.c:
	* libguile/chars.c:
	* libguile/continuations.c:
	* libguile/dynwind.c:
	* libguile/eq.c:
	* libguile/eval.c:
	* libguile/expand.c:
	* libguile/fdes-finalizers.c:
	* libguile/filesys.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/generalized-arrays.h:
	* libguile/goops.c:
	* libguile/goops.h:
	* libguile/guardians.c:
	* libguile/hooks.c:
	* libguile/i18n.c:
	* libguile/intrinsics.c:
	* libguile/list.c:
	* libguile/load.c:
	* libguile/loader.c:
	* libguile/macros.c:
	* libguile/memoize.c:
	* libguile/modules.c:
	* libguile/net_db.c:
	* libguile/numbers.c:
	* libguile/options.c:
	* libguile/ports.c:
	* libguile/print.c:
	* libguile/procprop.c:
	* libguile/procs.h:
	* libguile/programs.c:
	* libguile/r6rs-ports.c:
	* libguile/read.c:
	* libguile/scmsigs.c:
	* libguile/sort.c:
	* libguile/srcprop.h:
	* libguile/srfi-1.c:
	* libguile/srfi-13.c:
	* libguile/srfi-14.c:
	* libguile/srfi-14.h:
	* libguile/srfi-4.c:
	* libguile/stacks.c:
	* libguile/stime.c:
	* libguile/strorder.c:
	* libguile/struct.c:
	* libguile/struct.h:
	* libguile/symbols.c:
	* libguile/threads.c:
	* libguile/throw.c:
	* libguile/vports.c: Add boolean.h includes.

2018-06-18  Ludovic Courtès  <ludo@gnu.org>

	Module import obarrays are accessed in a critical section.
	Fixes <https://bugs.gnu.org/31879>.

	* libguile/modules.c (import_obarray_mutex): New variable.
	(resolve_duplicate_binding, module_imported_variable): Acquire it before
	accessing an obarray.

2018-06-18  Ludovic Courtès  <ludo@gnu.org>

	tests: Adjust i18n.test to 'fr_FR.utf8' locale in glibc 2.27.
	* test-suite/tests/i18n.test (french-number-string=?): New procedure.
	("number->locale-string")["French"]("integer", "negative integer")
	("fraction", "fraction, 1 digit"): Use it.
	("format ~h")["French"]("12345.678"): Likewise.
	("monetary-amount->locale-string")["French"]("integer", "fraction"):
	Check for both SPACE and NO-BREAK SPACE.

2018-06-18  Arun Isaac  <arunisaac@systemreboot.net>

	doc: Document (ice-9 match) macros.
	* doc/ref/match.texi: Document match-lambda, match-lambda*, match-let,
	  match-let* and match-letrec.

2018-06-18  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix typo.
	Fixes <https://bugs.gnu.org/30941>.
	Reported by Fis Trivial <ybbs.daans@hotmail.com>.

	* doc/ref/libguile-foreign-objects.texi (Defining Foreign Object Types):
	Remove extraneous 'image_type' in example.

2018-06-18  Jan Smydke  <jan.smydke@gmail.com>

	get-bytevector-n and get-bytevector-n! can now read more than 4 GB
	* libguile/r6rs-ports.c (scm_get_bytevector_n, scm_get_bytevector_n_x):
	Turn 'c_count' and related variables into a 'size_t', and use
	'scm_to_size_t' instead of 'scm_to_uint'.

2018-06-18  Ludovic Courtès  <ludo@gnu.org>

	vm: Fix typo when checking for 'madvise' error code.
	* libguile/vm.c (return_unused_stack_to_os): Check for EAGAIN, not -EAGAIN.

2018-06-18  Ludovic Courtès  <ludo@gnu.org>

	Make module autoloading thread-safe.
	Fixes <https://bugs.gnu.org/31878>.

	* module/ice-9/boot-9.scm (call-with-module-autoload-lock): New procedure.
	(try-module-autoload): Wrap body in 'call-with-module-autoload-lock'.
	* module/ice-9/threads.scm: Set (@ (guile) call-with-module-autoload-lock).

2018-06-18  Ludovic Courtès  <ludo@gnu.org>

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

2018-06-18  Christopher Allan Webber  <cwebber@dustycloud.org>

	Add SRFI 71: Extended LET-syntax for multiple values.
	* module/srfi/srfi-71.scm: New file.
	* module/srfi/Makefile.am: Add it.
	* doc/ref/srfi-modules.texi: Document it.
	* NEWS: Update.

2018-06-18  Andy Wingo  <wingo@pobox.com>

	Remove list.h from _scm.h
	* libguile/_scm.h: Remove list.h include.  Add appropriate includes to
	  relevant callers.

	Deprecate libguile/validate.h
	* libguile/validate.h: Replace contents with a #warning.

	Remove includes of validate.h.
	* guile-readline/readline.c:
	* libguile/alist.c:
	* libguile/array-map.c:
	* libguile/arrays.c:
	* libguile/async.c:
	* libguile/atomic.c:
	* libguile/backtrace.c:
	* libguile/boolean.c:
	* libguile/bytevectors.c:
	* libguile/chars.c:
	* libguile/continuations.c:
	* libguile/debug.c:
	* libguile/dynl.c:
	* libguile/eq.c:
	* libguile/error.c:
	* libguile/eval.c:
	* libguile/evalext.c:
	* libguile/expand.c:
	* libguile/feature.c:
	* libguile/filesys.c:
	* libguile/fluids.c:
	* libguile/fports.c:
	* libguile/gc-malloc.c:
	* libguile/gc.c:
	* libguile/goops.c:
	* libguile/goops.h:
	* libguile/guardians.c:
	* libguile/hash.c:
	* libguile/hashtab.c:
	* libguile/hashtab.h:
	* libguile/hooks.c:
	* libguile/i18n.c:
	* libguile/ioext.c:
	* libguile/keywords.c:
	* libguile/list.c:
	* libguile/load.c:
	* libguile/macros.c:
	* libguile/memoize.c:
	* libguile/modules.h:
	* libguile/net_db.c:
	* libguile/numbers.c:
	* libguile/pairs.c:
	* libguile/poll.c:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/print.c:
	* libguile/procprop.c:
	* libguile/procs.c:
	* libguile/promises.c:
	* libguile/r6rs-ports.c:
	* libguile/random.c:
	* libguile/rdelim.c:
	* libguile/read.c:
	* libguile/regex-posix.c:
	* libguile/rw.c:
	* libguile/scmsigs.c:
	* libguile/script.c:
	* libguile/simpos.c:
	* libguile/socket.c:
	* libguile/sort.c:
	* libguile/srcprop.c:
	* libguile/srfi-1.c:
	* libguile/srfi-4.c:
	* libguile/srfi-60.c:
	* libguile/stacks.c:
	* libguile/stime.c:
	* libguile/strings.c:
	* libguile/strorder.c:
	* libguile/strports.c:
	* libguile/struct.c:
	* libguile/symbols.c:
	* libguile/syntax.c:
	* libguile/threads.c:
	* libguile/throw.c:
	* libguile/trees.c:
	* libguile/unicode.c:
	* libguile/values.c:
	* libguile/variable.c:
	* libguile/vectors.c:
	* libguile/vports.c:
	* libguile/weak-set.c:
	* libguile/weak-table.c:
	* libguile/weak-vector.c:
	* libguile.h: Remove validate.h include.

2018-06-18  Andy Wingo  <wingo@pobox.com>

	Devolve more validate macros
	* libguile.h: Add chooks.h.
	* libguile/Makefile.am: Add chooks.h and chooks.c.
	* libguile/chooks.c:
	* libguile/chooks.h: New files, for the C implementation of hooks.
	  Broken out to avoid cycles in gc.h includes.
	* libguile/gc.h:
	* libguile/gc.c (scm_i_gc_admin_mutex, scm_i_sweep_mutex): Remove unused
	  mutexes.  Include chooks instead of hooks in the main header.
	* libguile/deprecated.h (scm_gc_running_p): Deprecate this macro always
	  defined to 0.
	  (SCM_VALIDATE_VECTOR_OR_DVECTOR): Deprecate this weird one too.
	* libguile/array-map.c: Add procs.h include.
	* libguile/threads.h:
	* libguile/vm.c:
	* libguile/r6rs-ports.c: Add smob.h include.
	* libguile/atomic.h (SCM_VALIDATE_ATOMIC_BOX): Devolve.
	* libguile/deprecation.c (scm_c_issue_deprecation_warning): Remove use
	  of scm_gc_running_p.
	* libguile/error.c (scm_error_scm): Remove use of scm_gc_running_p.
	* libguile/filesys.h (SCM_VALIDATE_DIR)
	* libguile/fluids.h (SCM_VALIDATE_FLUID)
	* libguile/fports.h (SCM_VALIDATE_FPORT, SCM_VALIDATE_OPFPORT)
	* libguile/generalized-arrays.h (SCM_VALIDATE_ARRAY)
	* libguile/hooks.h (SCM_VALIDATE_HOOK)
	* libguile/keywords.h (SCM_VALIDATE_KEYWORD)
	* libguile/ports.h (SCM_VALIDATE_PORT, SCM_VALIDATE_INPUT_PORT)
	  (SCM_VALIDATE_OUTPUT_PORT, SCM_VALIDATE_OPINPORT)
	  (SCM_VALIDATE_OPENPORT, SCM_VALIDATE_OPPORT, SCM_VALIDATE_OPOUTPORT)
	* libguile/procs.h (SCM_VALIDATE_PROC)
	* libguile/random.h (SCM_VALIDATE_RSTATE)
	* libguile/regex-posix.h (SCM_VALIDATE_RGXP)
	* libguile/stacks.h (SCM_VALIDATE_STACK, SCM_VALIDATE_FRAME)
	* libguile/strports.h (SCM_VALIDATE_OPOUTSTRPORT)
	* libguile/struct.h (SCM_VALIDATE_STRUCT SCM_VALIDATE_VTABLE)
	* libguile/symbols.h (SCM_VALIDATE_SYMBOL)
	* libguile/variable.h (SCM_VALIDATE_VARIABLE)
	* libguile/vectors.h (SCM_VALIDATE_VECTOR SCM_VALIDATE_VECTOR_LEN):
	  Devolve.
	* libguile/validate.h: It's empty now!

	hooks squish

2018-06-18  Andy Wingo  <wingo@pobox.com>

	More validate.h devolution
	* libguile/validate.h:
	* libguile/alist.h (SCM_VALIDATE_ALISTCELL, SCM_VALIDATE_ALISTCELL_COPYSCM)
	* libguile/bytevectors.h (SCM_VALIDATE_BYTEVECTOR)
	* libguile/chars.h (SCM_VALIDATE_CHAR, SCM_VALIDATE_CHAR_COPY):
	* libguile/print.h (SCM_VALIDATE_OPORT_VALUE, SCM_VALIDATE_PRINTSTATE):
	* libguile/procs.h (SCM_VALIDATE_THUNK)
	* libguile/smob.h (SCM_VALIDATE_SMOB)
	* libguile/strings.h (SCM_VALIDATE_STRING): Devolve these macros from
	  validate.h.

2018-06-17  Andy Wingo  <wingo@pobox.com>

	Move pair, null, nil, and boolean validators out of validate.h
	* libguile/validate.h:
	* libguile/boolean.h (SCM_VALIDATE_BOOL, SCM_VALIDATE_BOOL_COPY):
	* libguile/pairs.h (SCM_VALIDATE_NULL, SCM_VALIDATE_NULL_OR_NIL):
	  (SCM_VALIDATE_CONS, SCM_VALIDATE_MUTABLE_PAIR)
	  (SCM_VALIDATE_NULLORCONS): Move these macros.

	Remove public SCM_VALIDATE_NIM
	* libguile/random.c (scm_random): Remove needless use of
	  SCM_VALIDATE_NIM.
	* libguile/srcprop.c (SCM_VALIDATE_NIM): Move definition here, as this
	  file is its only use.
	* libguile/validate.h (SCM_VALIDATE_NIM): Remove.  This was public but
	  unlikely to be used in the wild.

	Move list validators to list.h
	* libguile/validate.h:
	* libguile/list.h (SCM_VALIDATE_REST_ARGUMENT, SCM_VALIDATE_LIST)
	  SCM_VALIDATE_NONEMPTYLIST, SCM_VALIDATE_LIST_COPYLEN)
	  SCM_VALIDATE_NONEMPTYLIST_COPYLEN): Move here from validate.h.

	Remove unused macros
	* libguile/validate.h (SCM_MUST_MALLOC_TYPE, SCM_MUST_MALLOC_TYPE_NUM)
	  (SCM_MUST_MALLOC): Remove unused macros.  scm_must_malloc was removed
	  in Guile 2.0.

	Move more number validators to numbers.h.
	* libguile/validate.h:
	* libguile/numbers.h (SCM_OUT_OF_RANGE, SCM_ASSERT_RANGE)
	  SCM_VALIDATE_REAL, SCM_VALIDATE_NUMBER, SCM_VALIDATE_USHORT_COPY)
	  SCM_VALIDATE_SHORT_COPY, SCM_VALIDATE_UINT_COPY)
	  SCM_VALIDATE_INT_COPY, SCM_VALIDATE_ULONG_COPY)
	  SCM_VALIDATE_LONG_COPY, SCM_VALIDATE_SIZE_COPY)
	  SCM_VALIDATE_FLOAT_COPY, SCM_VALIDATE_DOUBLE_COPY)
	  SCM_VALIDATE_DOUBLE_DEF_COPY): Move here, from validate.h.

	Move number validators to numbers.h.
	* libguile/validate.h:
	* libguile/numbers.h (SCM_NUM2SIZE, SCM_NUM2SIZE_DEF, SCM_NUM2PTRDIFF)
	  SCM_NUM2PTRDIFF_DEF, SCM_NUM2SHORT, SCM_NUM2SHORT_DEF, SCM_NUM2USHORT)
	  SCM_NUM2USHORT_DEF, SCM_NUM2INT, SCM_NUM2INT_DEF, SCM_NUM2UINT)
	  SCM_NUM2UINT_DEF, SCM_NUM2ULONG, SCM_NUM2ULONG_DEF, SCM_NUM2LONG)
	  SCM_NUM2LONG_DEF, SCM_NUM2LONG_LONG, SCM_NUM2LONG_LONG_DEF)
	  SCM_NUM2ULONG_LONG, SCM_NUM2ULONG_LONG_DEF, SCM_NUM2FLOAT)
	  SCM_NUM2DOUBLE): Move these here, from validate.h.

	Move core validate macros to error.h
	* libguile/error.h (SCM_MAKE_VALIDATE, (SCM_I_MAKE_VALIDATE_MSG2)
	  (SCM_MAKE_VALIDATE_MSG, SCM_SYSERROR, SCM_MEMORY_ERROR)
	  (SCM_SYSERROR_MSG, SCM_MISC_ERROR, SCM_WRONG_NUM_ARGS)
	  (SCM_WRONG_TYPE_ARG): Move here, from validate.h.
	* libguile/validate.h: Include error.h.

	Remove _scm.h print.h include
	* libguile/_scm.h: Remove unneeded print.h include.

	Remove error.h include from _scm.h.
	* libguile/pairs.h: Add missing error.h include.
	* libguile/_scm.h: Remove error.h include.

	Require C99 to build Guile
	* configure.ac: Refactor check to require C99, not just try to get C99.

	Assume that if we have GCC, we have GCC >= 3.0.
	* libguile/__scm.h (SCM_GNUC_PREREQ): Remove this definition.  Assume
	  that if we have GCC, that we have GCC >= 3.0 (from 2002).  Adapt uses
	  to use simply "#ifdef __GNUC__".
	* libguile/deprecated.h (SCM_GNUC_PREREQ): Add deprecated definition.

	Remove alignof.h inclusion from _scm.h
	* libguile/_scm.h: Remove unneeded alignof.h inclusion.

	Remove _scm.h verify.h inclusion
	* libguile/_scm.h: Remove unneeded verify.h inclusion.

	Remove errno.h include from _scm.h.
	* libguile/_scm.h: Remove errno.h include.
	* libguile/bytevectors.c:
	* libguile/debug.c:
	* libguile/finalizers.c:
	* libguile/loader.c:
	* libguile/poll.c:
	* libguile/strings.c:
	* libguile/threads.c:
	* libguile/vm.c: Add errno.h include.  Sort includes as needed.

	Remove _scm.h inclusion of config.h
	* libguile/_scm.h: Remove inclusion of config.h.  All includers already
	  include config.h.
	* libguile/syscalls.h: Remove config.h inclusion here too.

	Inline definition of SIZEOF_SCM_T_BITS
	* libguile/_scm.h (SIZEOF_SCM_T_BITS): Remove definition.
	* libguile/conv-integer.i.c (SCM_TO_TYPE_PROTO, SCM_FROM_TYPE_PROTO):
	* libguile/conv-uinteger.i.c (SCM_FROM_TYPE_PROTO):
	* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE):
	* libguile/hashtab.c:
	* libguile/loader.c:
	* libguile/socket.c:
	* libguile/vm-engine.c (VM_NAME): Use SIZEOF_UINTPTR_T instead of
	  SIZEOF_SCM_T_BITS.

	Refactor regarding internal detection of ia64
	* libguile/_scm.h: Remove hack to define __ia64__.
	* libguile/continuations.c (capture_auxiliary_stack): Use __ia64 or
	  __ia64__ to detect itanium.

	Remove _scm hack to undefine HAVE_STRUCT_TIMESPEC
	* libguile/_scm.h (HAVE_STRUCT_TIMESPEC): Remove hack to undefine this
	  variable, which is never defined in Guile's build.

	More _scm.h refactoring
	* libguile/foreign.c (ROUND_UP): Copy here.
	* libguile/vm.c (SCM_NOINLINE): Move here, to the only file that uses
	  it.
	  (ROUND_UP): Copy here.
	* libguile/_scm.h (ROUND_UP, SCM_NOINLINE): Remove.  Centralizing
	  private definitions isn't bad, but _scm.h also includes a bunch of
	  Guile API as well, and the include itself is poorly named.

	Move syscall-related private defines to their own header
	* libguile/syscalls.h: New private header.
	* libguile/Makefile.am
	  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): Add syscalls.h.
	* libguile/_scm.h: Remove SCM_SYSCALL and all the bits relating to
	  e.g. stat versus stat64.
	* libguile/filesys.c:
	* libguile/fports.c:
	* libguile/i18n.c:
	* libguile/ioext.c:
	* libguile/poll.c:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/rw.c:
	* libguile/scmsigs.c:
	* libguile/script.c:
	* libguile/socket.c:
	* libguile/strports.c: Include syscalls.h.

	Refactor handling of auxiliary stacks and setjmp/longjmp
	* libguile/__scm.h (scm_i_jmp_buf): Remove definition, which was a shim
	  for ia64.  Instead, always use setjmp/longjmp and jmp_buf.
	* libguile/_scm.h (SCM_I_SETJMP, SCM_I_LONGJMP): Remove; instead use
	  setjmp and longjmp.
	* libguile/continuations.c (capture_auxiliary_stack):
	  (restore_auxiliary_stack): New helpers.
	  (scm_i_make_continuation): Use capture_auxiliary_stack.
	  (copy_stack_and_call): Use restore_auxiliary_stack.  No need to stash
	  the aux stack on the thread, either.
	* libguile/continuations.h (scm_t_contregs): Use
	  SCM_HAVE_AUXILIARY_STACK to flag when to have an auxiliary_stack
	  member.
	* libguile/control.h:
	* libguile/control.c (reify_partial_continuation, scm_c_abort):
	  (scm_suspendable_continuation_p): Adapt to use setjmp/longjmp
	  directly.
	* libguile/deprecated.h: Add deprecated scm_i_jmp_buf define.
	* libguile/dynstack.h:
	* libguile/dynstack.c (PROMPT_JMPBUF):
	  (scm_dynstack_push_prompt, scm_dynstack_find_prompt):
	  (scm_dynstack_wind_prompt): Adapt to jmp_buf type.
	* libguile/eval.c (eval): Use jmp_buf and setjmp directly.
	* libguile/gc-malloc.c: No need for ia64-specific things.
	* libguile/gc.c: No need for ia64-specific things.
	* libguile/gc.h: No need to declare scm_ia64_ar_bsp.
	* libguile/init.c: Remove typedef of setjmp_type for Cray, unused.
	* libguile/threads.c (guilify_self_1): No more pending_rbs_continuation
	  in scm_i_thread, and register_backing_store_base is handled by libgc.
	  (scm_ia64_ar_bsp): Remove definitions; inlined into continuations.c's
	  capture_auxiliary_stack.
	* libguile/threads.h (scm_i_thread): jmpbuf member is plain jmp_buf.
	* libguile/throw.c (catch): Just use jmp_buf and setjmp.
	* libguile/vm-engine.c (VM_NAME): Adapt prototype to take jmp_buf
	  pointer.
	* libguile/vm.c (vm_abort): Adapt jmp_buf types.
	  (scm_call_n): Use setjmp.

	Add configure check for auxiliary stacks
	* configure.ac: Add a check for struct GC_stack_base.reg_base, which is
	  a proxy for checking for the only aspect of ia64 that we care about.
	* libguile/gen-scmconfig.c:
	* libguile/gen-scmconfig.h.in: Arrange to define
	  SCM_HAVE_AUXILIARY_STACK.

	Remove unused getters for register backing store base
	* libguile/gc.h:
	* libguile/threads.c: Remove unused implementations of
	  scm_ia64_register_backing_store_base, as libgc does this for us.

	Remove #ifdef cases for VMS and Cray.
	* libguile/__scm.h:
	* libguile/_scm.h:
	* libguile/feature.c (scm_init_feature): Remove VMS and Cray cases.

	Move "min" and "max" macros out of _scm.h
	* libguile/_scm.h: Remove definitions of min and max macros.
	* libguile/array-map.c (MAX):
	* libguile/foreign.c (MAX):
	* libguile/numbers.c (MIN):
	* libguile/quicksort.i.c (MIN):
	* libguile/socket.c (MAX):
	* libguile/strports.c (MAX): Inline definitions into callers.  We're
	  going to remove _scm.h, which will pay off this duplication.

	Simplify definition of SCM_SYSCALL.
	* libguile/_scm.h (SCM_SYSCALL): Simplify definition.

	Move some definitions out of _scm.h
	* libguile/_scm.h:
	* libguile/loader.h (SCM_OBJCODE_ENDIANNESS):
	  (SCM_OBJCODE_WORD_SIZE, SCM_OBJCODE_MAJOR_VERSION):
	  (SCM_OBJCODE_MINOR_VERSION, SCM_OBJCODE_MAJOR_VERSION_STRING):
	  (SCM_OBJCODE_MINOR_VERSION_STRING):
	  (SCM_OBJCODE_VERSION_STRING, SCM_OBJCODE_MACHINE_VERSION_STRING): Move
	  definitions to loader.h.

2018-06-14  Andy Wingo  <wingo@pobox.com>

	Fix libguile subcomponent headers not to include <libguile.h>
	* libguile/bytevectors.h: Include uniform.h, for use in the macros.
	* libguile/extensions.h: Include libpath.h, for the
	  SCM_EFFECTIVE_VERSION, which is almost always used with these
	  routines.
	* libguile/frames.h:
	* libguile/instructions.h:
	* libguile/intrinsics.h:
	* libguile/loader.h:
	* libguile/programs.h:
	* libguile/vm.h: Include <libguile/__scm.h> instead of <libguile.h>.
	  Cuts a circular include, but also precipitates a lot of maintenance in
	  the .c files.

	* libguile/*.c: Update C files to add needed all needed includes that
	  before were getting automatically pulled in by the indirect inclusion
	  of libguile.h.

2018-06-11  Andy Wingo  <wingo@pobox.com>

	Call out to expand_stack through new VM intrinsic
	* libguile/intrinsics.h (scm_t_vp_sp_intrinsic): New type.
	  (SCM_FOR_ALL_VM_INTRINSICS): Add expand-stack.
	* libguile/vm-engine.c (ALLOC_FRAME): Call through the intrinsics.
	* libguile/vm.c (scm_bootstrap_vm): Initialize the expand-stack
	  intrinsic.

	Remove unused vm_error_unbound
	* libguile/vm.c: Remove unused function.

2018-06-11  Mark H Weaver  <mhw@netris.org>

	Add copyright header for (language elisp falias), and fix typo.
	* module/language/elisp/falias.scm: Add copyright header.
	* module/language/elisp/spec.scm: Fix typo in header.

	elisp: Fix cross-compilation support.
	* module/system/base/target.scm (with-native-target): New exported
	procedure.
	* module/language/elisp/spec.scm: In the top-level body expression, call
	'compile-and-load' within 'with-native-target' to compile native code.
	* module/language/elisp/compile-tree-il.scm
	(eval-when-compile, defmacro): Compile native code.

2018-06-11  Mark H Weaver  <mhw@netris.org>

	Fix error reporting in 'load-thunk-from-memory'.
	Previously 'load-thunk-from-memory' would often throw to 'system-error'
	based on a stale value in 'errno', leading to incorrect error messages.

	* libguile/loader.c (load_thunk_from_memory): Set 'errno' to 0 before
	jumping to cleanup in the ABORT preprocessor macro, and also in the case
	when 'process_dynamic_segment' reports an error.

2018-06-11  Mark H Weaver  <mhw@netris.org>

	goops: Fix 'instance?' to work on objects that aren't structs.
	Fixes <https://bugs.gnu.org/31606>
	Reported by Tommi Höynälänmaa <tommi.hoynalanmaa@gmail.com>

	* module/oop/goops.scm (instance?): Check that OBJ is a struct
	before applying 'struct-vtable' to it.

2018-06-11  Mark H Weaver  <mhw@netris.org>

	Avoid inexact arithmetic in the type inferrer for 'sqrt'.
	* module/language/cps/types.scm: Use 'exact-integer-sqrt' and avoid
	inexact arithmetic in the range analysis of the type inferrer for
	'sqrt'.

2018-06-11  Mark H Weaver  <mhw@netris.org>

	Fix type inference for bitwise logical operators.
	Fixes <https://bugs.gnu.org/31474> and related bugs.
	Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

	* module/language/cps/types.scm (next-power-of-two): Remove procedure.
	(non-negative?, lognot*, saturate+, saturate-, logand-bounds)
	(logsub-bounds, logior-bounds, logxor-bounds): New procedures.  Use them
	to improve and fix bugs in the range analysis of the type inferrers for
	'logand', 'logsub', 'logior', 'ulogior', 'logxor', 'ulogxor', and
	'lognot'.

2018-06-11  Mark H Weaver  <mhw@netris.org>

	Revert "Minor CSE run-time optimization"
	Fixes <https://bugs.gnu.org/30020>.
	Reported by David Thompson <dthompson2@worcester.edu>.

	This reverts commit d4883307ca64a7028b9a6cd072974437306c19d3.

2018-06-11  Mark H Weaver  <mhw@netris.org>

	Fix typo in comment within numbers.c

2018-05-14  Andy Wingo  <wingo@pobox.com>

	Remove unused macro in vm-engine
	* libguile/vm-engine.c (VARIABLE_BOUNDP): Remove.

	Remove implementations of now-unused toplevel-box et al instructions
	* libguile/vm-engine.c (resolve, define!, toplevel-box, module-box):
	  Remove implementations.

	Use intrinsics for top-level refs outside captured scopes
	* module/language/tree-il/compile-cps.scm (toplevel-box): Reify
	  intrinsic calls for top-level references outside captured scopes.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Update set of macro-instructions.

	Compile "define!" via intrinsic
	* libguile/intrinsics.c (scm_bootstrap_intrinsics):
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add new define!
	  intrinsic.
	* module/language/cps/compile-bytecode.scm (compile-function): Adapt
	  compilation for define! to take two arguments.
	* module/language/cps/effects-analysis.scm (current-module): Update
	  define! for two arguments.
	* module/language/tree-il/compile-cps.scm (convert): When reifying
	  "define", grab the current module.
	* module/system/vm/assembler.scm (define!): Define assembler as
	  intrinsic.

	Remove backend support for cached-module-box et al.
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  unused assemblers for cached-module-box, cached-toplevel-box, and
	  cache-current-module!.
	* module/language/cps/effects-analysis.scm (&cache): New memory kind.
	  (cache-current-module!): Set &cache memory, not &box.
	  (resolve-module, lookup-module, cache-ref, cache-set!): Add effect
	  annotations.
	* module/system/vm/assembler.scm (emit-cache-current-module!)
	  (emit-cached-toplevel-box, emit-cached-module-box): Remove
	  assemblers.
	* module/system/vm/disassembler.scm (code-annotation, fold-code-range):
	  Remove special cases for toplevel-box and module-box.
	* module/system/xref.scm (program-callee-rev-vars): Add a FIXME for the
	  future.

	Instruction explosion for cache-current-module, cached-toplevel-box
	* module/language/cps/reify-primitives.scm (primitive-ref): When
	  reifying xoprimitives, explode cached-module-box references.
	  (cache-current-module!, cached-toplevel-box): Do instruction
	  explosion.

	Instruction explosion for cached-module-box
	* module/language/cps/reify-primitives.scm (reify-lookup):
	  (reify-resolve-module): New helpers.
	  (cached-module-box): Explode.

	Add cache-ref, cache-set! macro-instructions
	* module/system/vm/assembler.scm (<cache-cell>): Remove "scope" member.
	  Just be an opaque key comparable with equal?.
	  (intern-cache-cell): Remove scope arg.
	  (intern-module-cache-cell): Remove; callers use intern-cache-cell now.
	  (cache-current-module!, cached-toplevel-box, cached-module-box): Create
	  cache keys that by construction won't collide between types.
	  (cache-ref, cache-set!): Add new macro assemblers.
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/compile-bytecode.scm: Add cases for new macro
	  instructions.

	Add intrinsics for module operations
	* libguile/intrinsics.c (scm_bootstrap_intrinsics):
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* module/system/vm/assembler.scm (resolve-module, lookup): New intrinsics.
	* module/language/cps/compile-bytecode: Add cases for primcalls
	  corresponding to new intrinsics.

	Add scm_maybe_resolve_module
	* libguile/modules.c (scm_maybe_resolve_module): New API function, like
	  resolve-module but not ensuring that the module is created.
	  (scm_public_variable, scm_private_variable): Adapt to call
	  scm_maybe_resolve_module.
	* libguile/modules.h (scm_maybe_resolve_module): Declare new API.

2018-05-13  Andy Wingo  <wingo@pobox.com>

	Mark call-scm<-scm-u64 as defining a result
	* libguile/vm-engine.c (call-scm<-scm-u64): Add OP_DST.

2018-05-09  Andy Wingo  <wingo@pobox.com>

	VM syncs IP in pop-fluid
	* libguile/vm-engine.c (pop-fluid): Sync IP before popping, as setting a
	  fluid may allocate.

2018-05-08  Andy Wingo  <wingo@pobox.com>

	Remove unused macros in VM
	* libguile/vm-engine.c (ARGS1, ARGS2, RETURN, RETURN_EXP)
	  (UNPACK_16_8): Remove.

	VM calls =? through intrinsic
	* libguile/intrinsics.c (numerically_equal_p): New intrinsic.
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Declare new
	  intrinsic.
	* libguile/vm-engine.c (=?): Call through intrinsic.

	VM calls "<?" through intrinsic.
	* libguile/intrinsics.c (less_p): New intrinsic.
	  (scm_bootstrap_intrinsics): Wire up intrinsic.
	* libguile/intrinsics.h: Declare new intrinsic.
	* libguile/vm-engine.c (less_p): Call through intrinsic.

	VM calls out to heap-numbers-equal? through intrinsics
	* libguile/numbers.h:
	* libguile/eq.c (scm_i_heap_numbers_equal_p): Change to return boolean
	  directly instead of tagged Scheme value.
	  (scm_eqv_p): Adapt caller of scm_i_heap_numbers_equal_p.
	* libguile/intrinsics.c (scm_bootstrap_intrinsics):
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Declare
	  heap-numbers-equal? intrinsic.
	* libguile/vm-engine.c (heap-numbers-equal?): Call out through the
	  intrinsics table.

2018-05-01  Andy Wingo  <wingo@pobox.com>

	Remove implementation of lsh, rsh instructions
	* libguile/vm-engine.c: Remove implementation of now-gone instructions.

	lsh, rsh etc are intrinsics
	* libguile/intrinsics.c (lsh, rsh, lsh_immediate, rsh_immediate): New
	  intrinsics.
	  (scm_bootstrap_intrinsics): Wire up the intrinsics.
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add new
	  intrinsics.
	* libguile/vm-engine.c (call-scm<-scm-u64): New intrinsic caller.
	  (lsh, rsh, lsh/immediate, rsh/immediate): Disable.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add new intrinsics.
	* module/system/vm/assembler.scm: Adapt assemblers for new intrinsics.

2018-04-29  Andy Wingo  <wingo@pobox.com>

	Remove old VM ops for fluid-ref et al
	* libguile/vm-engine.c (wind, unwind, push_fluid, pop_fluid)
	  (fluid_ref, push_dynamic_state, pop_dynamic_state): Remove now-unused
	  implementations.

	push and pop dynamic state via intrinsics
	* libguile/intrinsics.c (push_dynamic_state, pop_dynamic_state): New
	  intrinsics.
	  (scm_bootstrap_intrinsics): Add new intrinsics.
	* libguile/intrinsics.h: Declare new intrinsics.
	* libguile/vm-engine.c (call-thread-scm): New intrinsic caller.
	  (push-dynamic-state, pop-dynamic-state): Disable.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add new intrinsics.
	* module/system/vm/assembler.scm (push-dynamic-state)
	  (pop-dynamic-state): Emit as intrinsics.

	Intrinsics for dynamic state instructions
	* libguile/intrinsics.c (wind, unwind, push_fluid, pop_fluid)
	  (fluid_ref): New intrinsics.
	  (scm_bootstrap_intrinsics): Wire them up.
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Declare new
	  intrinsics.
	* libguile/vm-engine.c (wind, unwind, push_fluid, pop_fluid)
	  (fluid_ref): Disable these instructions.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add new intrinsics.
	* module/system/vm/assembler.scm (wind, unwind, push_fluid, pop_fluid)
	  (fluid_ref): Assemble as intrinsics.

	Add support for dynamic-state-related intrinsics
	* libguile/vm-engine.c (call-thread, call-thread-scm-scm)
	  (call-scm<-thread-scm): New intrinsics.
	* module/system/vm/assembler.scm (define-thread-scm-scm-intrinsic)
	  (define-thread-intrinsic, define-scm<-thread-scm-intrinsic): New
	  helpers.
	  (encode-X8_S12_S12-C32!/shuffle): New shuffler.
	* libguile/intrinsics.h: Add new intrinsic types.

	Fix width of operands to intrinsic call instructions
	* libguile/vm-engine.c (call-scm<-scm, etc): The operands were getting
	  unpacked into 8-bit locals, which were too small.  Fix to use 16-bit
	  locals.

2018-04-25  Paulo Andrade  <pcpa@gnu.org>

	Correct typo and values in jit_sparc-sz.c

2018-04-20  Paulo Andrade  <pcpa@gnu.org>

	HPPA: Correct wrong regarg_p check
	  If argument registers are in incremental order in the global _rvs
	vector, the check if a register argument is reversed.
	  Adapted from a regression found in sparc 64.

2018-04-20  Paulo Andrade  <pcpa@gnu.org>

	Build and pass all tests on 32 and 64 bit sparc
		* include/lightning/jit_private.h: Add new register classes to
		flag float registers and double only registers, required for sparc64
		where only low 32 bit fpr registers can be used for single precision
		operations.
		Add new 128 bit jit_regset_t type for sparc64 register set.

		* include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
		lib/jit_sparc-sz.c, lib/jit_sparc.c: Update for 64 bits sparc.

		* lib/lightning.c: Update for new jit_regset_t required for sparc64.

2018-04-13  Andy Wingo  <wingo@pobox.com>

	Remove unused macros in vm-engine
	* libguile/vm-engine.c: Remove unused CPP macros.

	Remove implementation of atomic box ops
	* libguile/vm-engine.c (VM_VALIDATE, VM_VALIDATE_ATOMIC_BOX): Remove
	  now-unused definitions.  Remove implementations of atomic-box-ref et
	  al.
	* libguile/vm.c (vm_error_not_a_atomic_box): Remove.

	Explode atomic box ops to new atomic instructions
	* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Add C8_S24
	  word type.
	* libguile/vm-engine.c (UNPACK_8_24): New helper.
	  (atomic-scm-ref/immediate, atomic-scm-set!/immediate)
	  (atomic-swap-scm!/immediate, atomic-scm-compare-and-swap!/immediate):
	  New instructions.
	  (make-atomic-box, atomic-box-ref, atomic-box-set!, atomic-box-swap!)
	  (atomic-box-compare-and-swap!): Disable these ops.
	* module/language/bytecode.scm (compute-instruction-arity): Add C8_S24
	  support.
	* module/system/vm/assembler.scm: Add C8_S24 support.  Export assemblers
	  for new opcodes.
	* module/system/vm/disassembler.scm (disassembler): Support C8_S24.
	* module/language/cps/compile-bytecode.scm (compile-function): Replace
	  old atomic-box assemblers with the new instructions.
	* module/language/cps/effects-analysis.scm (annotation->memory-kind):
	* module/language/cps/types.scm (annotation->type): Add cases for atomic
	  boxes.  Mark as all memory kinds because atomic ops serialize memory
	  accesses.
	* module/language/tree-il/compile-cps.scm (make-atomic-box):
	  (ensure-atomic-box, atomic-box-ref, atomic-box-set!):
	  (atomic-box-swap!, atomic-box-compare-and-swap!): Explode these ops to
	  more basic instructions.
	* module/system/base/types/internal.scm (%tc7-atomic-box): Add forgotten
	  export.

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

	Remove implementation of logsub VM op
	* libguile/vm-engine.c (logsub): Remove implementation.

	logsub is intrinsic
	* libguile/intrinsics.h:
	* libguile/intrinsics.c (logsub): New intrinsic.
	  (scm_bootstrap_intrinsics): Init new intrinsic.
	* libguile/vm-engine.c (logsub): Disable.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add logsub.
	* module/system/vm/assembler.scm: Update logsub intrinsic assembler.

	Remove implementations of obsolete s64->scm, u64->scm insts
	* libguile/vm-engine.c (s64->scm, u64->scm): Remove implementation.

	u64->scm, s64->scm intrinsics
	* libguile/intrinsics.h (u64->scm, s64->scm): New intrinsics.
	* libguile/intrinsics.c (scm_bootstrap_intrinsics): Initialize new
	  intrinsics.
	* libguile/vm-engine.c (call-scm<-u64, call-scm<-s64): New intrinsic
	  callers.
	  (u64->scm, s64->scm): Disable instructions.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add new intrinsics as macro-instructions.
	* module/system/vm/assembler.scm (define-scm<-u64-intrinsic):
	  (define-scm<-s64-intrinsic, u64->scm, s64->scm): Wire up new
	  intrinsics.

	Remove scm->u64, etc implementations
	* libguile/vm-engine.c: Remove implementations of now-obsolete bytecodes.

	scm->u64, scm->s64, scm->u64/truncate intrinsics
	* libguile/intrinsics.c (scm_to_uint64_truncate): New intrinsic.
	  (scm_bootstrap_intrinsics): Init new intrinsics.
	* libguile/intrinsics.h: Add scm->u64, scm->u64/truncate, and scm->s64
	  as intrinsics, with their corresponding types.
	* libguile/vm-engine.c (call-u64<-scm, call-s64<-scm): New intrinsic
	  calling ops.
	  (scm->u64, scm->s64, scm->u64/truncate): Disable opcodes.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add intrinsics as new macroinstructions.
	* module/system/vm/assembler.scm: Declare new intrinsic assemblers.

2018-04-10  Andy Wingo  <wingo@pobox.com>

	Remove scm->f64, f64->scm implementations
	* libguile/vm-engine.c: Remove now-unused f64->scm, scm->f64 impls.

	Disable f64->scm instruction
	* libguile/vm-engine.c (f64->scm): Disable instruction.
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  f64->scm case.
	* module/system/vm/assembler.scm: Remove emit-f64->scm export.

	Instruction explosion for f64->scm
	* module/language/cps/reify-primitives.scm (reify-primitives): Reify
	  f64->scm via low-level operations.

	Add reifier for fadd/immediate.
	* module/language/cps/reify-primitives.scm (fadd/immediate): Add
	  missing reify procedure.

	Slim heap-allocated flonums
	* libguile/numbers.h (struct scm_t_double, struct scm_t_complex): Avoid
	  adding an extra padding word on systems with 8-byte pointers.
	* module/system/base/types.scm (cell->object): Update to compute correct
	  offset of embedded double.

	Add scm->f64 intrinsic
	* libguile/vm-engine.c (call-f64<-scm): New intrinsic kind.
	  (scm->f64): Disable instruction.
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
	* libguile/intrinsics.c (scm_bootstrap_intrinsics):
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	* module/system/vm/assembler.scm (define-f64<-scm-intrinsic): Add scm->f64.

	Remove load-typed-array, make-array opcodes
	* libguile/vm-engine.c (load-typed-array, make-array): Remove these
	  apparently unused opcodes.  Yay!

	Remove class-of opcode
	* libguile/vm-engine.c (class-of): Remove unused opcode.

	Class-of is intrinsic
	* libguile/vm-engine.c (class-of): Disable.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add class-of as macro-instruction.
	* libguile/intrinsics.c (scm_bootstrap_intrinsics): Add class-of.
	* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add class-of.
	* module/system/vm/assembler.scm (class-of): Define as intrinsic.

	Add string->number etc as macro instructions to reify-primitives
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add string->number, etc.  Missed from two commits ago.

	Remove string->number, etc opcodes
	* libguile/vm-engine.c (string->number, string->symbol)
	  (symbol->keyword): Remove unused instructions.

	string->number, etc intrinsics
	* libguile/intrinsics.c (string_to_number): New helper.
	  (scm_bootstrap_intrinsics): Init new intrinsics.
	* libguile/intrinsics.h (string->number, string->symbol)
	  (symbol->keyword): Add new intrinsics.
	* libguile/vm-engine.c (call-scm<-scm): New intrinsic dispatcher.
	  (string->number, string->symbol, symbol->keyword): Disable these
	  instructions.
	* module/system/vm/assembler.scm (encode-X8_S12_S12-C32<-/shuffle):
	  (define-scm<-scm-intrinsic): Enable scm<-scm intrinsics.
	  (string->number, string->symbol, symbol->keyword): New intrinsic
	  assemblers.

	Remove unused make-closure opcode.
	* libguile/vm-engine.c (make-closure): Remove opcode.

	Add $code CPS expression type
	* module/language/cps.scm ($code): New CPS type, for labels as values.
	  Add cases to all CPS type dispatches.  $closure now indicates only
	  statically allocated closures.
	* module/language/cps/closure-conversion.scm (convert-one): Only reify
	  $closure for statically allocated procedures.  Otherwise allocate an
	  object using low-level primitives.
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  make-closure case.
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  $code produces a u64 value.
	* module/system/vm/assembler.scm: Remove make-closure export.
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/devirtualize-integers.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/licm.scm:
	* module/language/cps/peel-loops.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/rotate-loops.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/specialize-numbers.scm:
	* module/language/cps/types.scm:
	* module/language/cps/utils.scm:
	* module/language/cps/verify.scm: Add cases for $code.

	Add load-label instruction
	* libguile/vm-engine.c (load-label): New instruction.
	* module/system/vm/assembler.scm: Add emit-load-label.
	* module/system/vm/disassembler.scm (code-annotation):
	  (fold-code-range): Add load-label support.

	Remove dead code in CPS converter
	* module/language/tree-il/compile-cps.scm: Remove dead primcall
	  expanders.

	Remove char->integer from VM
	* libguile/vm-engine.c (VM_VALIDATE_CHAR, VM_VALIDATE_STRING)
	  (VM_VALIDATE_INDEX): Remove now-unused helpers.
	  (vm_engine): Fix position of intrinsics declaration.
	  (char->integer): Remove unused opcode.
	* libguile/vm.c (vm_error_not_a_char, vm_error_not_a_string)
	  (vm_error_out_of_range_uint64): Remove unused decls.

	Instruction explosion for char->integer
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/types.scm:
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  char->integer cases.
	* module/system/vm/assembler.scm: Remove emit-char->integer export.
	* module/language/tree-il/compile-cps.scm (char->integer): Define
	  instruction exploder.

	Remove integer->char op
	* libguile/vm-engine.c (integer->char): Remove unused op.
	* module/language/cps/types.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  integer->char cases.
	* module/system/vm/assembler.scm: Remove emit-integer->char.

	Instruction explosion for integer->char
	* module/language/tree-il/compile-cps.scm (integer->char): Instruction
	  explosion!

	Remove string-set! VM op
	* libguile/vm-engine.c (string-set!): Remove now-unused VM op.

	Explode "string-set!"
	* module/language/cps/effects-analysis.scm (string-ref): Remove effects
	  declaration, given that the primitive is exploded now.
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Add string-set!.
	* libguile/vm-engine.c (string-set!): Disable opcode.
	* module/language/cps/types.scm (string-ref, string-set!): Remove type
	  checker and inferrers for string-ref and string-set!, as both are
	  exploded.  In the case of string-set! there are still type-check
	  effects in the intrinsic call but they can't be elided by the checker,
	  as we don't track when strings are read-only.
	* module/language/tree-il/compile-cps.scm (ensure-char): New helper.
	  (string-set!): New primcall exploded converter.

	Add string-set! intrinsic
	* libguile/intrinsics.c (string_set_x): New intrinsic.
	  (scm_bootstrap_intrinsics): Initialize intrinsic.
	* libguile/intrinsics.h: Add string-set! intrinsic.
	* libguile/vm-engine.c (call-scm-u64-u64): New intrinsic trampoline.
	* module/system/vm/assembler.scm (encode-X8_S8_S8_S8-C32!/shuffle): New
	  shuffling encoder.
	  (define-scm-u64-u64-intrinsic): New helper.

2018-04-09  Andy Wingo  <wingo@pobox.com>

	Remove now-unused string-length, string-ref
	* libguile/vm-engine.c (string-length, string-ref): Remove
	  instructions.
	* module/system/vm/assembler.scm: Remove assembler exports as well.

	Lower string-ref in CPS conversion
	* module/language/cps/effects-analysis.scm (annotation->memory-kind):
	* module/language/cps/types.scm (annotation->type): Hackily consider
	  stringbuf memory to be string memory.
	* module/language/tree-il/compile-cps.scm (string-ref): Add horrible
	  lowering conversion for string-ref.

2018-04-08  Andy Wingo  <wingo@pobox.com>

	Add VM ops needed for string-ref
	* libguile/vm-engine.c (tail-pointer-ref/immediate, tag-char)
	  (untag-char): New instructions.
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  support for new instructions.
	* module/language/cps/cse.scm (compute-equivalent-subexpressions): CSE
	  cases for tag-char / untag-char.
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/types.scm: Add cases for new primcalls.
	* module/language/cps/reify-primitives.scm (reify-primitives): Update
	  comment.
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  Add cases for untag-char, tail-pointer-ref/immediate.
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Add untag-char case, and add FIXME comment for tag-char.
	* module/system/vm/assembler.scm: Export new assemblers.

	CPS conversion lowers string-length
	* module/language/cps/types.scm (annotation->type):
	* module/language/cps/effects-analysis.scm (annotation->memory-kind):
	  Add case for string memory kinds.  Remove special type and effect
	  inferrers for string-length.
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  Remove string-length.
	* module/language/tree-il/compile-cps.scm (ensure-string): New helper.
	  (string-length): Add custom converter.

2018-03-31  Andy Wingo  <wingo@pobox.com>

	Remove specific instructions for add, etc from VM
	* module/language/cps/reify-primitives.scm (compute-known-primitives):
	  Treat add, sub, and so on as known primitives.
	* libguile/vm-engine.c: Remove code for now-unused instructions.

2018-03-30  Andy Wingo  <wingo@pobox.com>

	Compile some generic arithmetic to intrinsic calls
	* libguile/intrinsics.h: Rename intrinsic types added in previous
	  commit.
	* libguile/vm-engine.c (call-scm<-scm-scm, call-scm<-scm-uimm): New
	  instructions.
	* libguile/vm.c: Include intrinsics.h.
	* module/language/bytecode.scm
	* module/language/bytecode.scm (*intrinsic-codes*, *intrinsic-names*):
	  New internal definitions.
	  (intrinsic-name->index, intrinsic-index->name): New exported
	  definitions.
	* module/system/vm/assembler.scm (encode-X8_S8_S8_S8-C32<-/shuffle):
	  (encode-X8_S8_S8_C8-C32<-/shuffle): New shuffling encoders.
	  (shuffling-encoder-name): Add case for new shuffling encoders.
	  (define-scm<-scm-scm-intrinsic, define-scm<-scm-uimm-intrinsic): New
	  helpers.  Define encoders for "add", etc.

	Add instrinsics to runtime
	* libguile/intrinsics.c:
	* libguile/intrinsics.h: New files.
	* libguile/Makefile.am:
	* libguile/init.c: Add new files to build.

2018-03-16  Arun Isaac  <arunisaac@systemreboot.net>

	Fix minor typo in the PEG documentation.
	* doc/ref/api-peg.texi (PEG Internals): Fix minor typo.

2018-03-16  Mark H Weaver  <mhw@netris.org>

	Fix a few typos in the manual.
	Fixes <https://bugs.gnu.org/30276>.
	Reported by Matt Wette <matt.wette@gmail.com>.

	* doc/ref/api-macros.texi (Macro Expansion)
	doc/ref/vm.texi (Procedure Call and Return Instructions): Fix typos.

2018-03-16  Mark H Weaver  <mhw@netris.org>

	Fix eta-conversion edge cases in peval.
	Fixes <https://bugs.gnu.org/29520>.
	Reported by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.

	* module/language/tree-il/peval.scm (peval)[lift-applied-lambda]: Before
	performing eta-conversion, check that the variable(s) passed to the
	inner 'apply' are not referenced from the inner lambda, and that the
	number of required arguments would not be reduced by the conversion.

2018-03-16  Shea Levy  <shea@shealevy.com>

	Recognize RISC-V compilation targets.
	* module/system/base/target.scm (cpu-endianness): Add case for "riscv" variants.

2018-02-26  Paulo Andrade  <pcpa@gnu.org>

	Build and pass all test cases on Alpha Linux
		* check/lightning.c, include/lightning.h: Add the new jit_va_push
		interface. That should be called when passing a va_list to a C
		function. This is required because on Alpha a va_list is passed
		by value, and lightning does not know about data types, so, cannot
		understand it is pushing a va_list as argument.

		* lib/jit_names.c, lib/lightning.c: Minor changes for the new
		jit_code_va_push.

		* check/cva_list.c: Update only test case using jit_va_push, to
		pass a va_list to a C function.

		doc/body.texi: Better documentation of the varargs interface.

		* jit_alpha.c, jit_alpha-cpu.c: Update to properly push a
		C va_list and correctly calculate varargs offset.

		* lib/jit_aarch64-sz.c, lib/jit_aarch64.c, lib/jit_alpha-sz.c,
		lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
		lib/jit_ia64-sz.c, lib/jit_ia64.c, lib/jit_mips-sz.c, lib/jit_mips.c,
		lib/jit_ppc-sz.c, lib/jit_ppc.c, lib/jit_s390-sz.c, lib/jit_s390.c,
		lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-sz.c, lib/jit_x86.c:
		Update for the new jit_va_push interface.

2018-02-22  Paulo Andrade  <pcpa@gnu.org>

	Always set t12 to address of called function
		* lib/jit_alpha-cpu.c: Always set t12 to the address of the
		current function, to properly work on all systems. Previously
		the shortcut did only work on Tru64. For Linux and glibc the
		change is required.

	Correct logic error with jit_live in jit_retr
		* lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
		lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c:
		Correct wrong logic in usage of jit_live in jit_retr. The
		problem is that if a temporary is required during epilog,
		the return register might be allocated, so, jit_live must always
		be used.

2018-02-16  Ludovic Courtès  <ludo@gnu.org>

	srfi-18: 'thread-sleep!' timeout-as-a-number is relative.
	This is a followup to <https://bugs.gnu.org/29704>.

	* module/srfi/srfi-18.scm (thread-sleep!): When TIMEOUT is a number,
	keep it as-is.
	* test-suite/tests/srfi-18.test ("thread sleep with number"): Pass 0 as
	the timeout.
	("thread sleeps fractions of a second"): Pass 0.5 as the timeout.

2018-02-16  Ludovic Courtès  <ludo@gnu.org>

	srfi-18: When timeout is a number, it's a relative number of seconds.
	Fixes <https://bugs.gnu.org/29704>.
	Reported by David Beswick <dlbeswick@gmail.com>.

	* module/srfi/srfi-18.scm (timeout->absolute-time): New procedure.
	(mutex-lock!): Use it in 'thread:lock-mutex' call.
	(mutex-unlock!): Use it.
	* test-suite/tests/srfi-18.test ("mutex-lock! returns false on timeout")
	("mutex-lock! returns true when lock obtained within timeout")
	("recursive lock waits")
	("mutex unlock is false when condition times out"): Adjust cases where
	the 'timeout' parameter is a number so that it's a relative number.

2018-02-16  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix typo about SRFI-4 syntax.
	Reported by Matt Wette <matt.wette@gmail.com>.
	Fixes <https://bugs.gnu.org/29910>.

	* doc/ref/api-data.texi (Array Syntax): Fix typo.

2018-02-16  Ludovic Courtès  <ludo@gnu.org>

	build: Use 'sed' invocation compatible with BSD sed.
	Fixes <https://bugs.gnu.org/30011>.
	Reported by ilove zfs <ilovezfs@icloud.com>.

	* libguile/Makefile.am (INSTANTIATE): Move '-i' first.

2018-02-16  Ludovic Courtès  <ludo@gnu.org>

	'select' returns empty sets upon EINTR and EAGAIN.
	Fixes <https://bugs.gnu.org/30368>.

	* libguile/filesys.c (scm_select): Clear READ_SET, WRITE_SET, and
	EXCEPT_SET when RV < 0.

2018-01-31  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add extra argument to jit_update to prevent recursion on branches
		* lib/lightning.c: Avoid deep recursions when computing live
		register ranges.

	Correct issues with 32 bit big endian mips abis
		* lib/jit_mips-cpu.c: Correct frame size and varargs
		initialization for the n32 abi.
		* lib/jit_mips.c, lib/jit_mips-fpu.c: Correct 32 bit abis
		in big-endian.

2018-01-26  Andy Wingo  <wingo@pobox.com>

	Sync IP before allocating closures
	* libguile/vm-engine.c (vm_engine): Sync IP before allocating closures.

2018-01-22  Andy Wingo  <wingo@pobox.com>

	Use make-struct/simple in tree-il
	* module/language/tree-il.scm (borrow-core-vtables): Use
	  make-struct/simple.

	Use make-struct/simple in psyntax
	* module/ice-9/psyntax.scm (define-expansion-constructors): Use
	  make-struct/simple, so we can inline allocations.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	Remove unneeded assembly shuffle routines.
	* module/system/vm/assembler.scm (encode-X8_S12_S12-X8_C24!/shuffle)
	  (encode-X8_S12_S12-X8_C24<-/shuffle): Remove now-unneeded shufflers.

	Remove free-ref, free-set!
	* libguile/vm-engine.c (free-ref, free-set!): Remove ops.
	* module/language/cps/effects-analysis.scm:
	* module/system/vm/assembler.scm:
	* module/system/vm/disassembler.scm (code-annotation):
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  support for free-ref / free-set!.

	Remove VM struct-ref, etc instructions
	* libguile/vm-engine.c (VM_VALIDATE_STRUCT)
	  (VM_VALIDATE_BOXED_STRUCT_FIELD, VM_VALIDATE_UNBOXED_STRUCT_FIELD)
	  (struct-ref, struct-set!, struct-vtable, allocate-struct)
	  (allocate-struct/immediate, struct-ref/immediate)
	  (struct-set!/immediate): Remove these opcodes.
	* libguile/vm.c: Remove error cases for struct ops.

	Remove optimizer and backend support for struct ops
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/cps/types.scm:
	* module/language/tree-il/cps-primitives.scm:
	* module/system/vm/assembler.scm: Remove support for struct-ref,
	  struct-set!, allocate-struct, struct-vtable CPS primcalls and bytecode
	  instructions.

	Lower "make-struct/simple" to CPS
	* module/language/tree-il/cps-primitives.scm (struct-init!): Add
	  primitive, just used in internal translations.
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*primitive-constructors*): Recognize "make-struct/simple" instead of
	  allocate-struct.
	* module/language/tree-il/compile-cps.scm (ensure-vtable): New helper.
	  (allocate-struct, struct-init!): New lowerers.
	  (convert): Add struct-init! case.
	  (canonicalize): Convert make-struct/simple like vector.

2018-01-21  Andy Wingo  <wingo@pobox.com>

	Introduce make-struct/simple
	* libguile/struct.h:
	* libguile/struct.c (scm_make_struct_simple): New function.
	* module/ice-9/boot-9.scm (make-record-type): Recast in terms of
	  make-struct/simple.
	* module/ice-9/eval.scm (primitive-eval): Remove allocate-struct case.
	* module/srfi/srfi-9.scm (%%set-fields, %define-record-type): Use
	  make-struct/simple.

2018-01-19  Andy Wingo  <wingo@pobox.com>

	Instruction explosion for struct-ref, struct-set!
	* module/language/cps/effects-analysis.scm (&memory-kind-mask): Add
	  &bitmask, for the bitmask in vtables.
	  (annotation->memory-kind): Add 'bitmask case.
	* module/language/tree-il/compile-cps.scm (ensure-struct-index-in-range):
	  (prepare-struct-scm-access): New helpers.
	  (struct-ref/immediate, struct-set!/immediate): New exploded lowering
	  routines.
	  (struct-ref, struct-set!): New lowering routines that just do a call.
	  (canonicalize): Remove struct-ref hack; lowering procedures will
	  handle it.
	* module/language/tree-il/cps-primitives.scm (bytevector-length): Define
	  struct-set! as returning a value.

2018-01-16  Andy Wingo  <wingo@pobox.com>

	Remove bytevector instructions from the VM.
	* libguile/vm-engine.c: Remove bv-u8-ref et al, along with bv-length.
	* libguile/vm.c (vm_error_not_a_bytevector)
	  (vm_error_not_a_mutable_bytevector, vm_error_out_of_range_int64):
	  Remove unused procedures.

	Remove optimizer and backend support for bv-u8-ref et al
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/types.scm:
	* module/system/vm/assembler.scm: Remove optimizer and backend support
	  for bv- ops.

	Instruction explosion for bv-length
	* module/language/tree-il/compile-cps.scm (ensure-vector):
	  (prepare-bytevector-access): Add assumptions on lengths.
	  (bv-length): New lowerer.

	Add assume-u64 and assume-s64 dataflow restrictions
	* module/language/cps/effects-analysis.scm::
	* module/language/cps/reify-primitives.scm (reify-primitives):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/types.scm (assume-u64, assume-s64): Add primitives
	  that assume the range of a u64 or s64 value is within certain bounds.
	  This is useful when extracting e.g. a length from a 64-bit word when
	  you know the length is less than 2**48.

	Instruction explosion for bytevector setters
	* module/language/cps/compile-bytecode.scm (compile-function): Fix
	  emitters for u64-set! et al.
	* module/language/tree-il/compile-cps.scm (bytevector-set-converter):
	  New helper.  Lower bytevector setters to pointer ops.

2018-01-15  Ludovic Courtès  <ludo@gnu.org>

	Revert "Honor '%fresh-auto-compile'."
	This reverts commit 83d4c4d622b406ec0bc9d8139ec8182fa72b5720,
	which came from a misunderstanding.

2018-01-15  Andy Wingo  <wingo@pobox.com>

	Add f32-ref, f64-ref lowering procs
	* module/language/tree-il/compile-cps.scm (bytevector-ref-converter):
	  Take kind as tag, not boolean.  Support floats.  Adapt and add
	  lowerers for float-ref procedures.

	Instruction explosion for integer bytevector ref procedures
	* module/language/cps/compile-bytecode.scm (compile-function): Fix
	  emitters for u16-ref et al.
	* module/language/tree-il/compile-cps.scm (bytevector-ref-converter):
	  (define-bytevector-ref-converter, define-bytevector-ref-converters):
	  New helpers.  Use to define lowerers for bv-s32-ref et al.

2018-01-14  Andy Wingo  <wingo@pobox.com>

	Custom bv-u8-ref lowering procedure
	* module/language/tree-il/compile-cps.scm (untag-bytevector-index):
	  (ensure-bytevector, prepare-bytevector-access): New helpers.
	  (bv-u8-ref): New lowerer.
	* module/language/cps/types.scm (annotation->type):
	* module/language/cps/effects-analysis.scm (annotation->memory-kind):
	  Support bytevectors.

2018-01-14  Andy Wingo  <wingo@pobox.com>

	Rename gc-pointer-ref to pointer-ref
	The pointer dereferencing instructions will keep the pointer alive by
	referencing a containing object.

	* module/language/cps/compile-bytecode.scm:
	* libguile/vm-engine.c:
	* module/language/cps/cse.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/cps/types.scm:
	* module/system/vm/assembler.scm:
	* module/system/vm/debug.scm: Rename instructions.

2018-01-14  Andy Wingo  <wingo@pobox.com>

	Add raw u8-ref, etc instructions
	* libguile/vm-engine.c (PTR_REF, PTR_SET): New helper macros.
	  (u8-ref, u16-ref, u32-ref, u64-ref, s8-ref, s16-ref, s32-ref, s64-ref)
	  (u8-set!, u16-set!, u32-set!, u64-set!, s8-set!, s16-set!, s32-set!, s64-set!)
	  (f32-ref, f64-ref, f32-set!, f64-set!): New instructions.
	* module/system/vm/assembler.scm:
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/types.scm: Add optimizer and backend support for
	  the new instructions.

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

	No tabs in C code.
	* .dir-locals.el (c-mode): Set 'indent-tabs-mode' to nil in C.

2018-01-10  Andy Wingo  <wingo@pobox.com>

	Add optimizer and backend support for gc-pointer-ref
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/reify-primitives.scm (reify-primitives):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	* module/language/cps/types.scm (gc-pointer-ref/immediate):
	  (gc-pointer-set!/immediate):
	* module/system/vm/assembler.scm: Add support for pointer-ref.

	Add support for raw gc-managed pointer locals
	* libguile/vm-engine.c (gc-pointer-ref/immediate)
	  (gc-pointer-set!/immediate): New instructions.
	  (SP_REF_PTR, SP_SET_PTR): New helper definitions.
	* libguile/vm.c (SLOT_DESC_LIVE_GC): Rename from SLOT_DESC_LIVE_SCM, as
	  it can indicate GC-protected raw pointers also.
	  (scm_i_vm_mark_stack): Adapt.
	* module/system/vm/assembler.scm (write-arities):
	* module/system/vm/debug.scm (arity-definitions): Add gcptr
	  representation.  This is a binary-incompatible change!

	Instruction explosion for struct-vtable
	* module/language/tree-il/compile-cps.scm (ensure-struct): New helper.xo
	  (struct-vtable): New lowering procedure.
	* module/language/cps/types.scm (annotation->type): Add struct.
	  (scm-ref/tag, scm-set!/tag): Fix to get type from annotation.
	* module/language/cps/effects-analysis.scm (annotation->memory-kind):
	  Add struct.

2018-01-10  Ludovic Courtès  <ludo@gnu.org>

	Make sure the return value of 'scm_crypt' is always initialized.
	* libguile/posix.c (scm_crypt): Always initialize 'ret'; error out even
	when ERR is zero.

2018-01-10  Andy Wingo  <wingo@pobox.com>

	Remove box instructions
	* libguile/vm-engine.c (box, box-ref, box-set!): Remove these
	  instructions.
	* module/system/vm/assembler.scm: Remove assemblers for box-ref et al.
	* libguile/vm.c (vm_error_not_a_variable): Remove unused function.

	Lower box, box-ref, box-set! primcalls
	* module/language/tree-il/compile-cps.scm (box, ensure-box):
	  (box-ref, box-set!): Lower box primcalls.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/dce.scm (compute-live-code):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/types.scm: Remove special support for boxes.  What
	  a pleasure!

	Remove obsolete rtl tests
	* test-suite/tests/rtl.test (accum, cached-toplevel-ref)
	  (cached-toplevel-set!, cached-module-ref, cached-module-set!): Remove
	  tests that use box instructions.  These tests have done their time and
	  now aren't of much value.

2018-01-08  Andy Wingo  <wingo@pobox.com>

	Save VM compare result before calling out to hooks
	* libguile/vm.c (vm_dispatch_hook): Save the compare result before
	  calling out to the hook.  This only really matters for the "next"
	  hook, which can be called between a compare and its corresponding
	  branch instruction.

	Sync IP before allocating closures
	* libguile/vm-engine.c (vm_engine): Sync IP before allocating closures.

2018-01-07  Andy Wingo  <wingo@pobox.com>

	Improve make-vector compilation for known big sizes
	* module/language/tree-il/compile-cps.scm
	  (emit-initializations-as-loop): New helper.
	  (make-vector): Use new helper.
	  (make-vector/immediate): Emit a loop if the number of words is greater
	  than or equal to 32.  An arbitrary limit that could be adjusted later.

	Better compilation of vector constructors and initializers
	* module/language/tree-il/cps-primitives.scm (allocate-vector)
	  (vector-init!): Declare these primitives which later go away when
	  lowering to CPS.
	* module/language/tree-il/compile-cps.scm (vector-init!): New
	  converter.
	  (allocate-vector): New converter.

	Remove pair-related instructions
	* libguile/vm-engine.c (VM_VALIDATE_PAIR, VM_VALIDATE_MUTABLE_PAIR):
	  Remove these now-unused definitions.
	  (VM_VALIDATE_VECTOR, VM_VALIDATE_MUTABLE_VECTOR): Likewise.
	  (cons, car, cdr, set-car!, set-cdr!): Remove instructions.
	* libguile/vm.c (vm_error_not_a_pair, vm_error_not_a_mutable_pair):
	  Remove unused error cases.

	Remove special optimizer and backend support for pairs
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/dce.scm (compute-live-code):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/types.scm: Remove support for cons, car, etc
	  primcalls.
	* module/language/cps/effects-analysis.scm (&car, &cdr): Remove
	  undefined exports.
	* module/system/vm/assembler.scm: Remove emit-cons, etc exports.

	Expand pair-related primcalls
	* module/language/tree-il/compile-cps.scm (ensure-pair): New helper.
	  (cons, car, cdr, set-car!, set-cdr!): New expanders.
	* module/language/cps/closure-conversion.scm (convert-one):
	* module/language/cps/contification.scm (apply-contification): Emit
	  lower-level instructions for making pairs.

	Minor compile-cps refactor for cons
	* module/language/tree-il/compile-cps.scm (build-list): Pass cons
	  through an expander.

	Compiler frontend support for vector mutability checks
	* module/language/tree-il/compile-cps.scm (ensure-vector):
	  (prepare-vector-access, prepare-vector-access/immediate):
	  (vector-length, vector-ref, vector-ref/immediate):
	  (vector-set!, vector-set!/immediate): Use mutable-vector? predicate
	  for write access.

	Re-add compiler backend support for immutable vectors
	* module/language/cps/compile-bytecode.scm (compile-function): Add cases
	  for mutable-vector? and immutable-vector?.
	* module/system/vm/assembler.scm: Export emit-mutable-vector? and
	  emit-immutable-vector?.

	CPS type analysis support for mutable vs immutable vectors
	* module/language/cps/types.scm (&mutable-vector, &vector): Separate
	  type bits.
	  (&vector): New union type.
	  (constant-type): Constant vectors are immutable.
	* module/language/cps/type-fold.scm (mutable-vector?)
	  (immutable-vector?): New folders.
	  (vector?): Add union folder.

	Fix bug in struct-ref effects analysis
	* module/language/cps/effects-analysis.scm (struct-ref): Fix bug in
	  struct-ref effects analysis.

	Add CPS compilation support for mutable-vector?
	* module/system/base/types/internal.scm (heap-tags): Add
	  immutable-vector? and mutable-vector?.
	* module/language/tree-il/cps-primitives.scm:
	* module/system/vm/disassembler.scm: Bump copyright lines.

	Remove now-unused make-vector et al instructions
	* libguile/vm-engine.c (make-vector, make-vector/immediate)
	  (vector-ref, vector-ref/immediate, vector-set!)
	  (vector-set!/immediate): Remove these now-unused instructions.
	* libguile/vm.c (vm_error_not_a_vector, vm_error_not_a_mutable_vector):
	  Remove.

	Remove "ash" instruction.
	* libguile/vm-engine.c (ash): Remove instruction, which hasn't been
	  emitted for a long time.
	* module/system/vm/assembler.scm (emit-ash): Remove export.

	CPS pass now expects exploded vector primitives
	* module/language/cps/closure-conversion.scm (convert-one): Reify
	  make-vector inline, without field initialization.
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/dce.scm (compute-live-code):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/reify-primitives.scm (reify-primitives):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	* module/language/cps/types.scm:
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  cases for make-vector, vector-ref, etc.
	* module/system/vm/assembler.scm: Remove make-vector, vector-ref etc
	  exports.

	Mark word-ref and word-ref/immediate as producing U64 values
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  Mark word-ref and word-ref/immediate as producing U64 values.

	Instruction explosion for /immediate variants of vector prims
	* module/language/tree-il/compile-cps.scm
	  (prepare-vector-access/immediate): New helper.
	* module/language/tree-il/compile-cps.scm (vector-ref/immediate):
	  (vector-set!/immediate, make-vector/immediate): New expanders.

	Instruction explosion for make-vector
	* module/language/tree-il/compile-cps.scm (untag-fixnum-in-imm-range):
	  New helper.
	  (make-vector): New custom expander.  Gnarly; to refactor.

	Fix primitive reification for scm-set! / word-set!.
	* module/language/cps/reify-primitives.scm (reify-primitives): Fix for
	  scm-set! and word-set!.

	Minor optimization in loop peeling
	* module/language/cps/peel-loops.scm (compute-out-vars): Fold over the
	  body of the loop, not the body of the function.  A small
	  optimization.

	Make integer devirtualization less eager
	* module/language/cps/devirtualize-integers.scm (bailout?): Factor out.
	  (peel-trace): Adapt to call external bailout? predicate.
	  (peel-traces-in-function): Don't peel traces whose alternate is a
	  bailout.

	Bug-fix to devirtualize-integers pass
	* module/language/cps/devirtualize-integers.scm (peel-trace): Only
	  terminate a trace at a branch if the set of live vars is empty.

2018-01-05  Andy Wingo  <wingo@pobox.com>

	Fix specialization of the allocate-words family of instructions
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Fix specialization of allocate-words and friends.

	Fix verify.scm for call-thunk/no-inline
	* module/language/cps/verify.scm (check-arities): Allow
	  call-thunk/no-inline to continue to $kreceive.

	Add resolve-primitives pass back to bootstrap
	* bootstrap/Makefile.am (GUILE_OPTIMIZATIONS): Blah, add
	  -Oresolve-primitives.

	Improve compilation of make-vector without init
	* module/language/tree-il/primitives.scm (*primitive-expand-table*): Add
	  expansion for one-argument make-vector.

	Allow peval to gnaw on string->symbol, symbol->string
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect-free-primitives*): Add string->symbol and symbol->string.

	Instruction explosion for vector-{length,ref,set!}
	* module/language/tree-il/compile-cps.scm (ensure-vector)
	  (untag-fixnum-index-in-range, compute-vector-access-pos)
	  (prepare-vector-access): New helpers.
	  (vector-length, vector-ref, vector-set!): New expanders.

	Allow peeling loops with bailouts
	* module/language/cps/peel-loops.scm (compute-bailouts)
	  (add-renamed-bailout, peel-loop, peel-loops-in-function): Allow
	  peeling of loops with bailouts.

	Prevent LICM of memory accesses guarded by effect-free predicates
	* module/language/cps/licm.scm (loop-invariant?): Read or write effects
	  can be guarded by effect-free branches; prevent hoisting of these
	  expressions if the term isn't always reachable.

	Disable resolve-primitives pass below -O2
	* module/language/tree-il/optimize.scm (optimize): Disable
	  resolve-primitives below -O2.  This is because compile-cps is going to
	  start expanding all primcalls it sees.

	Add (system base optimize) module
	* module/system/base/optimize.scm: New module.
	* module/Makefile.am (SOURCES):
	* am/bootstrap.am (SOURCES): Add new module.
	* module/language/tree-il/optimize.scm (tree-il-optimizations): Rename
	  from tree-il-default-optimization-options.  Directly specify the
	  optimization level at which a pass should be enabled.
	* module/language/cps/optimize.scm (cps-optimizations): Likewise, rename
	  from cps-default-optimization-options.
	* module/scripts/compile.scm (%options, show-optimization-help): Adapt
	  to use new module.

2018-01-03  Andy Wingo  <wingo@pobox.com>

	$primcall always continues to $kargs
	* module/language/cps/devirtualize-integers.scm (peel-trace): Update
	  comment.
	* module/language/cps/contification.scm (apply-contification): Update to
	  never contify a return of $primcall to $kreceive.
	* module/language/cps/verify.scm (check-arities): Require that primcalls
	  continue to $kargs.

	Simplify prompt slot allocation now that bailouts can't continue
	* module/language/cps/slot-allocation.scm (add-prompt-control-flow-edges):
	  Simplify now that bailouts don't continue.

	$throw is a new kind of CPS term
	* module/language/cps.scm ($throw): New term type that doesn't have a
	  continuation.  Adapt all callers.  Remove now-unneeded
	  "prune-bailouts" pass.

	Fix add-prompt-control-flow-edges for terms with no continuation
	* module/language/cps/slot-allocation.scm (add-prompt-control-flow-edges):
	  Allow for terms that don't continue, and add them to the minimal
	  prompt control flow edges set.

	$prompt is now its own kind of CPS term.
	* module/language/cps.scm ($prompt): Rework to be its own term kind.
	  Now $continue always continues to a single continuation.  Adapt
	  callers.

	Variable renaming in type-fold.scm
	* module/language/cps/type-fold.scm: Rename "name" variables that
	  indicate primcalls to "op".

	Fix sandbox
	* module/ice-9/sandbox.scm (eval-in-sandbox): Remove use of
	  deprecated-and-now-removed allow-legacy-syntax-objects? parameter.

	$branch is now a distinct CPS term type
	* module/language/cps.scm ($branch): Refactor to be its own CPS term
	  type, not relying on $continue to specify a continuation (which before
	  was only for the false case) or a source location.  Update allllllll
	  callers.

2017-12-27  Andy Wingo  <wingo@pobox.com>

	Re-add support for logbit?
	* module/language/cps/type-fold.scm (logbit?): Adapt for logbit?
	  continuing to $kargs.
	* module/language/tree-il/cps-primitives.scm (logbit?): Declare this CPS
	  primitive.

	Unknown primcalls convert as calls
	* module/language/cps/reify-primitives.scm (reify-primitives): Remove
	  case where $prim could continue to $kreceive; this isn't possible.
	  However when reifying an unknown primcall, always add a $kreceive, as
	  the continuation has to be $kargs.
	* module/language/tree-il/compile-cps.scm (convert): Unknown primcalls
	  convert as calls.  With this change, all primcalls should continue to
	  $kargs, with the exception of 'throw.

	Remove inline-constructors pass
	* module/language/cps/constructors.scm: Remove pass, as "list" and
	  "vector" are now inlined by CPS conversion, and nothing in the
	  optimizer reifies "list" or "vector" primcalls.
	* module/language/cps/optimize.scm (optimize-higher-order-cps)
	  (cps-default-optimization-options):
	* am/bootstrap.am:
	* module/Makefile.am: Remove references to inline-constructors pass.

	Contification also inlines "elide-values" pass
	* module/language/cps/contification.scm (apply-contification): Inline
	  returns to the corresponding $kargs.
	* module/language/cps/licm.scm (loop-invariant?): Remove handling of
	  "values" primcall, as this doesn't exist any more.

	CPS conversion avoids residualizing unknown primcalls
	* module/language/tree-il/compile-cps.scm: Avoid residualizing "apply"
	  or "abort-to-prompt" primcalls; instead, these are just calls to
	  $prim.

	Inline "elide-values" optimization into CPS conversion
	* module/language/tree-il/compile-cps.scm (adapt-arity, convert): Avoid
	  reifying "values" primcalls unless necessary.  Effectively inlines the
	  "elide-values" optimization into CPS conversion.
	* module/language/cps/elide-values.scm: Remove, as it's now unneeded.
	* module/language/cps/optimize.scm (optimize-higher-order-cps):
	* module/Makefile.am:
	* am/bootstrap.am: Remove elide-values references.

	CPS conversion expands "list"
	* module/language/tree-il/compile-cps.scm (build-list): New helper.
	  (convert, canonicalize): Canonicalize "list" earlier.  Allow sinking
	  of any initializer that can't capture the continuation, not just in
	  cases where all initializers have this property.  Reify a cons chain
	  internally as appropriate.

	Refactor lowering of Tree-IL primcalls to CPS
	* module/language/tree-il/cps-primitives.scm: New file,
	  replacing (language cps primitives).  Lists known primitives and their
	  relation to Tree-IL explicitly, instead of assuming that any Tree-IL
	  primcall that shares a name with a bytecode instruction is a CPS
	  primcall.
	* module/language/cps/verify.scm: Remove use of (language cps
	  primitives) and primcall arity checking.  Would be nice to add this
	  back at some point.
	* module/language/tree-il/compile-cps.scm (convert): Refactor to use new
	  tree-il-primitive->cps-primitive+nargs+nvalues helper.
	* module/Makefile.am:
	* am/bootstrap.am: Adapt.

	Flesh out compile-bytecode for all heap objects
	* module/language/cps/compile-bytecode.scm (compile-function): Organize
	  emitters and flesh out with more heap type tag predicates.  Remove
	  now-needless (language cps primitives) import.

	Refactor list->seq to make return arity apparent
	* module/language/tree-il.scm (list->seq): Change to let tail of seq
	  indicate number of values.

	Refactor reify-primitives pass
	* module/language/cps/reify-primitives.scm (*ephemeral-reifiers*)
	  (define-ephemeral, define-binary-signed-ephemeral)
	  (define-binary-signed-ephemeral/imm, compute-known-primitives):
	  (*known-primitives*, known-primitive?): New definitions.
	  (reify-primitives): Extract reification of "ephemeral primitives".

	Remove compile-bytecode cases for ephemeral primitives
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  cases for tag-fixnum/unlikely, etc.

	Reify-primitives removes "/unlikely" ephemeral instructions
	* module/language/cps/reify-primitives.scm (reify-primitives): Remove
	  tag-fixnum/unlikely, etc.

2017-12-27  Andy Wingo  <wingo@pobox.com>

	Refactor boxing/unboxing primcall args/results
	This will allow individual primcall converters to define ad-hoc
	conversion routines.

	* module/language/tree-il/compile-cps.scm (convert-primcall/default)
	  (convert-indexed-getter, convert-indexed-setter)
	  (convert-indexed-getter/tag, convert-indexed-setter/untag)
	  (convert-scm-u64->scm-primcall, convert-scm-u64-scm-primcall)
	  (convert-scm-u64->f64-primcall, convert-scm-u64-f64-primcall)
	  (convert-scm-u64->u64-primcall, convert-scm-u64-u64-primcall)
	  (convert-scm-u64->s64-primcall, convert-scm-u64-s64-primcall)
	  (convert-*->u64-primcall, convert-scm->u64-primcall)
	  (convert-u64->scm-primcall): Define some primcall converter helpers.
	  (*primcall-converters*, define-primcall-converter)
	  (define-primcall-converters): Define converters for a number of
	  primcalls.
	  (convert-primcall*, convert-primcall): Interface to primcall
	  converters.
	  (convert): Pass most primcalls through convert-primcall, unless we
	  know already that they don't need instruction explosion or
	  boxing/unboxing.

2017-12-27  Andy Wingo  <wingo@pobox.com>

	Fix mismatch between CPS and Scheme "complex?" predicate
	* module/system/base/types/internal.scm (heap-tags): Rename complex and
	  fraction predicates to "compnum?" and "fracnum?", as they aren't the
	  same as the Scheme predicates "complex?" and "fraction?".

	Fix stack effect/clobber parsing for calls
	* module/system/vm/disassembler.scm (define-stack-effect-parser)
	  (define-clobber-parser):
	* module/system/vm/frame.scm (compute-frame-sizes, compute-killv):
	  Fix bug introduced in dd8bf6a98cfd852c4a6981337eb0df11dd427415 whereby
	  a call would clobber all locals, leaving the backtrace much less
	  useful than it should be.

2017-12-22  Ludovic Courtès  <ludo@gnu.org>

	compile: Load language modules upfront.
	Fixes a bug whereby "guild compile --target=arm-linux-gnueabihf
	--from=elisp ... language/elisp/boot.el" would fail with an exception
	from 'load-thunk-from-memory' while trying to load (language elisp spec)
	from the guile-being-compiled instead of using that of the
	guile-for-build.

	The problem did not manifest with --from=scheme because (language scheme
	spec) happened to be already loaded before we had changed %load-path.

	* module/scripts/compile.scm (compile): Add calls to 'lookup-language'.

2017-12-22  Ludovic Courtès  <ludo@gnu.org>

	'load-thunk-from-memory' reports the correct error.
	Previously 'load-thunk-from-memory' would often throw to 'system-error'
	when passed an incorrect ELF file, leading to incorrect error messages.

	* libguile/loader.c (load_thunk_from_memory): Reset 'errno' when
	'check_elf_header' returns non-NULL.
	* test-suite/tests/vm.test: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add it.

2017-12-22  Ludovic Courtès  <ludo@gnu.org>

	Fix 'crypt' deadlock upon error.
	* libguile/posix.c (scm_crypt): Take 'scm_i_misc_mutex' right before
	calling 'crypt'.  Move 'SCM_SYSERROR' call after 'scm_dynwind_end'.
	* test-suite/tests/posix.test ("crypt"): New test prefix.

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

	doc: Update LALR URL.
	Reported by Chris Vine <vine35792468@gmail.com>.

	* doc/ref/api-lalr.texi (LALR(1) Parsing): Update URL.

2017-12-06  Andy Wingo  <wingo@pobox.com>

	Use unchecked scm-ref/set in closure conversion
	* module/language/cps/closure-conversion.scm (convert-one): Use
	  unchecked initializers and accessors.

	Support closure annotations to scm-ref et al
	* module/language/cps/effects-analysis.scm (annotation->memory-kind):
	* module/language/cps/types.scm (annotation->type): Add pairs and
	  closures.

	Fix DCE over primcall setters with params
	* module/language/cps/dce.scm (compute-live-code): The primcall-param
	  refactor made it so that a vector-set! to a dead vector would
	  needlessly mark the vector as live.  This commit fixes it and adds
	  scm-set!, etc.

	Assignment conversion uses unchecked memory accessors
	* module/language/cps/effects-analysis.scm (annotation->memory-kind):
	  Add box type annotation.
	* module/language/cps/reify-primitives.scm (primitive-ref): Reify
	  scm-ref/immediate instead of box-ref.
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Remove needless and unbound -> literal.
	* module/language/cps/types.scm (annotation->type): Add box type.
	* module/language/tree-il/compile-cps.scm (convert): Reify
	  scm-ref/immediate / scm-set!/immediate instead of box-ref / box-set!.

	Re-mark "throw" et al as not having fallthrough
	* module/system/vm/disassembler.scm (instruction-has-fallthrough?):
	  Re-add throw, etc.
	* module/system/vm/frame.scm (compute-frame-sizes, compute-killv): Allow
	  for unreachable code.

	CPS conversion residualizes undefined? predicate
	* module/language/tree-il/compile-cps.scm (init-default-value): Use
	  undefined? predicate instead of reifying an unbound value in the CPS
	  term.
	* module/language/cps/compile-bytecode.scm (compile-function): Add cases
	  for the special immediate predicates.  Evidently we aren't emitting
	  these yet!

	Add scm-ref, etc instructions for generic heap object field access
	* libguile/vm-engine.c (allocate-words, allocate-words/immediate)
	  (scm-ref, scm-set!, scm-ref/tag, scm-set!/tag, scm-ref/immediate)
	  (scm-set!/immediate): New instructions for generic access to fields in
	  heap objects.
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/reify-primitives.scm (reify-primitives):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	* module/language/cps/types.scm (allocate-words)
	  (allocate-words/immediate, scm-ref, scm-ref/immediate, scm-ref/tag)
	  (scm-set!/tag, scm-set!, scm-set!/immediate, word-ref)
	  (word-ref/immediate, word-set!, word-set!/immediate):
	* module/system/vm/assembler.scm:
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  support for the new instructions.

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

	Bailouts can continue directly to tail
	* module/language/cps/compile-bytecode.scm (compile-function): Allow a
	  'throw primcall in tail position.
	* module/language/cps/prune-bailouts.scm (prune-bailouts): Continue
	  directly to the nearest tail continuation, so we don't cause
	  unreachable handle-interrupts / return 0 instructions to be emitted.
	* module/language/cps/reify-primitives.scm (reify-clause): Residualized
	  'throw primcall continues directly to tail.
	* module/language/cps/verify.scm (check-arities): Relax check for
	  'throw.

2017-12-02  Andy Wingo  <wingo@pobox.com>

	Fix NaN handling in <= and >=
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  support for emitting <= via < and jge / jnge.
	* module/language/cps/effects-analysis.scm: Declare effects for <= and
	  f64-<=.
	* module/language/cps/primitives.scm (*comparisons*): Add <=, f64-<=.
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Specialize <= to < for integer comparisons.  Specialize to f64-<= for
	  f64 ops.
	* module/language/cps/type-fold.scm (<=): Add folder.
	* module/language/cps/types.scm (infer-<=): Add inferrer.
	* module/language/tree-il/compile-cps.scm (canonicalize): Canonicalize
	  <= and >= to <=, so that nans are handled correctly.

	Integer comparison folding refactors
	* module/language/cps/type-fold.scm (compare-exact-ranges): Rename from
	  compare-integer-ranges.
	  (<, u64-<, s64-<, =, u64-=, s64-=): Separate the generic and unboxed
	  implementations.

	Refactor number specialization to reduce duplication
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Factor out specialize-primcall and specialize-branch operations.

	Mark throw, throw/value, etc as having fallthrough
	* module/system/vm/disassembler.scm (instruction-has-fallthrough?): Mark
	  throw and so on as having fallthrough.  Doing otherwise breaks
	  backtraces.

2017-12-02  Andy Wingo  <wingo@igalia.com>

	Avoid generating arity-adapting zero-value conts where possible
	* module/language/tree-il/compile-cps.scm (adapt-arity, convert): Avoid
	  generating arity-adapting continuations for nullary continuations.

	Avoid generating arity-adapting continuations if not needed
	* module/language/tree-il/compile-cps.scm (adapt-arity): Allow k to be
	  $kargs for the 1-valued case.
	  (convert): For single-valued continuations where the definition is
	  clearly single-valued, avoid making a needless $kreceive and extra
	  "rest" binding that will just be filled with () and have to be
	  eliminated later.

2017-12-01  Andy Wingo  <wingo@igalia.com>

	Bump version for Guile 2.2.3.
	* GUILE-VERSION (GUILE_MICRO_VERSION, LIBGUILE_INTERFACE_CURRENT)
	  (LIBGUILE_INTERFACE_AGE): Increment.

	Update NEWS for 2.2.3
	* NEWS: Update.

	Avoid generating arity-adapting zero-value conts where possible
	* module/language/tree-il/compile-cps.scm (adapt-arity, convert): Avoid
	  generating arity-adapting continuations for nullary continuations.

2017-11-30  Andy Wingo  <wingo@igalia.com>

	Avoid generating arity-adapting continuations if not needed
	* module/language/tree-il/compile-cps.scm (adapt-arity): Allow k to be
	  $kargs for the 1-valued case.
	  (convert): For single-valued continuations where the definition is
	  clearly single-valued, avoid making a needless $kreceive and extra
	  "rest" binding that will just be filled with () and have to be
	  eliminated later.

2017-11-30  Andy Wingo  <wingo@pobox.com>

	-O1 disables call precoloring
	* module/language/cps/compile-bytecode.scm (compile-function)
	  (emit-bytecode):
	* module/language/cps/slot-allocation.scm (allocate-slots):
	* module/language/cps/optimize.scm (cps-default-optimization-options):
	  Allow the "lazy vars" optimization, a form of slot precoloring, to be
	  disabled.  It will be disabled at -O0 or -O1, to speed compilation
	  times.

	Allow integer devirtualization to be disabled
	* module/language/cps/optimize.scm (optimize-higher-order-cps)
	  (cps-default-optimization-options): Add #:devirtualize-integers?.

	-O1 disables call precoloring
	* module/language/cps/compile-bytecode.scm (compile-function)
	  (emit-bytecode):
	* module/language/cps/slot-allocation.scm (allocate-slots):
	* module/language/cps/optimize.scm (cps-default-optimization-options):
	  Allow the "lazy vars" optimization, a form of slot precoloring, to be
	  disabled.  It will be disabled at -O0 or -O1, to speed compilation
	  times.

	Improve CSE complexity
	* module/language/cps/cse.scm (compute-available-expressions):
	  (compute-equivalent-subexpressions): Improve algorithmic complexity of
	  CSE by pre-computing the labels whose reads are clobbered by a label's
	  writes.

	Add compute-clobber-map to effect analysis
	* module/language/cps/effects-analysis.scm (compute-clobber-map): New
	  public function.

	Minor CSE run-time optimization
	* module/language/cps/cse.scm (compute-equivalent-subexpressions): Minor
	  optimization to reduce the size of equivalent expression keys, and to
	  avoid some work if an expression has no key.

	Improve CSE complexity
	* module/language/cps/cse.scm (compute-available-expressions):
	  (compute-equivalent-subexpressions): Improve algorithmic complexity of
	  CSE by pre-computing the labels whose reads are clobbered by a label's
	  writes.

	Add compute-clobber-map to effect analysis
	* module/language/cps/effects-analysis.scm (compute-clobber-map): New
	  public function.

	Minor CSE run-time optimization
	* module/language/cps/cse.scm (compute-equivalent-subexpressions): Minor
	  optimization to reduce the size of equivalent expression keys, and to
	  avoid some work if an expression has no key.

2017-11-29  Andy Wingo  <wingo@pobox.com>

	Merge until 8e2314c46dc3aa98574d380a2c7cb782da643913 from stable-2.2

	Merge until 83d4c4d622b406ec0bc9d8139ec8182fa72b5720 from stable-2.2

	Merge until 2fe9a852fb3c6aaeef5dc9d12df3a9150eeb232a from stable-2.2

	Merge until 81d2e352663bc5f80734312fec90f250b1fbe2e4 from stable-2.2

	Merge until dc8dda77e0c937abae42a76ea88c6e7995adbd9a from stable-2.2

	Merge until badcbd0fe955e0477ae98ed743b3f274d6e6f22d from stable-2.2
	Manually resolve conflicts in random.c.

	Merge until e0bcda4ad940c4e15679cc2b229838b33acdd36c from stable-2.2

	Simplify live variable computation for graphs without loops
	* module/language/cps/slot-allocation.scm
	  (compute-reverse-control-flow-order): For graphs without back-edges,
	  use a simplified computation of reverse control flow order.

	Add nullary intmap and intset folders
	* module/language/cps/intmap.scm (intmap-fold, intmap-fold-right):
	* module/language/cps/intset.scm (intset-fold, intset-fold-right): Add
	  nullary folders.

	Fix logand type inference
	* module/language/cps/types.scm (logand): We were computing the wrong
	  ranges when either argument was negative; a terrible bug!
	  (logsub): Also fix range when A is negative and B is non-negative.
	  (ulogand): Tighten up range.

	Simplify live variable computation for graphs without loops
	* module/language/cps/slot-allocation.scm
	  (compute-reverse-control-flow-order): For graphs without back-edges,
	  use a simplified computation of reverse control flow order.

	Add nullary intmap and intset folders
	* module/language/cps/intmap.scm (intmap-fold, intmap-fold-right):
	* module/language/cps/intset.scm (intset-fold, intset-fold-right): Add
	  nullary folders.

2017-11-28  Andy Wingo  <wingo@pobox.com>

	Enable lsh/immediate, rsh/immediate specialization
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Fix typo in match syntax preventing us from optimizing the immediate
	  variants of lsh and rsh, and typo also in specialize-unop argument
	  order.

	Tighten up untag-fixnum range
	* module/language/cps/types.scm (untag-fixnum): Tighten up range.

	Fix arity of slsh/immediate inferrer
	* module/language/cps/types.scm (slsh/immediate): Fix arity.

2017-11-27  Andy Wingo  <wingo@pobox.com>

	Add fabricated expressions for u64-s64 conversion
	* module/language/cps/cse.scm (compute-equivalent-subexpressions): Add
	  cases for u64->s64 and s64->u64.

	Refactor aux definition fabrication in CSE pass
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	  Define a little language for creating aux definitions.

2017-11-24  Andy Wingo  <wingo@pobox.com>

	Optimize check-urange in assembler.scm
	* module/system/vm/assembler.scm (check-urange): Hoist exact-integer?
	  check so that the side effect is entirely in this function and not in
	  `logand'.  Allows devirtualize-integers to peel off a nice straight
	  trace.

2017-11-24  Andy Wingo  <wingo@pobox.com>

	DCE of branches punches through dead terms
	* module/language/cps/dce.scm (compute-live-code): DCE removes
	  effect-free branches where both continuations are the same.  This
	  change makes it so that we compare the next *live* continuations.
	  This allows DCE to remove chains of dead branches, not just the last
	  one, improving compilation e.g. of

	    (unless (and (exact-integer? x) (<= 10 x 20)) (error "foo" x))

	  so that the bignum trace goes away entirely.

2017-11-24  Andy Wingo  <wingo@pobox.com>

	Refactor to finish the primcalls-take-parameters work
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  helper to look up constants now that primcalls can take parameters.
	* module/language/cps/devirtualize-integers.scm (peel-trace): Remove
	  extra argument to expression-effects.
	* module/language/cps/effects-analysis.scm (constant?, indexed-field):
	  Remove unused definitions.
	  (expression-effects): Remove "constants" argument; constants come from
	  primcall params.
	  (compute-effects): Don't compute a constants table.
	* module/language/cps/slot-allocation.scm ($allocation): Remove
	  "constant-values" field.
	  (lookup-constant-value, lookup-maybe-constant-value): Remove; unused.
	  (allocate-slots): Don't create a constants table.
	* module/language/cps/specialize-primcalls.scm
	  (compute-defining-expressions, compute-constant-values): Move these
	  definitions here, which were previously in utils.scm
	* module/language/cps/utils.scm: Remove moved definitions.

	Add integer devirtualization pass.
	* module/language/cps/devirtualize-integers.scm: New pass.
	* module/language/cps/optimize.scm:
	* module/Makefile.am:
	* am/bootstrap.am: Add new pass.

	Better unboxing for logand over s64 values
	* module/language/cps/specialize-numbers.scm (specialize-operations): Do
	  a better job unboxing logand if we know the result is a u64, even if
	  arguments are s64.

	Better type folding for = on exact numbers
	* module/language/cps/type-fold.scm (=): Fold to #f if values are exact
	  but of different types.
	  (s64-=): Add missing alias.

	Declare bignum? as effect-free
	* module/language/cps/effects-analysis.scm (bignum?): Mark as
	  effect-free.

	Minor refactoring to type inference on < and =
	* module/language/cps/types.scm (infer-=): Factor out of
	  `define-=-inferrer'.
	  (define-<-inferrer): Remove unused definition.
	  (=, u64-=, s64-=): Use infer-=.

	Fix inference of generic < on NaN values
	* module/language/cps/types.scm (<): Don't infer anything if either
	  number could be a flonum.

	Improve type and range inference on bignums
	* module/language/cps/types.scm (bignum?): New predicate inferrer.
	  (infer-integer-<, <, u64-<, s64-<): Factor out how integer comparisons
	  are done.  Improve inference over bignums.
	  (define-<-inferrer): Remove unused definition.
	  (s64-=): Define inferrer; omitted before because of a typo.
	  (define-binary-result!, abs): Fix up fixnum/bignum bits; before, we
	  would lose some cases where fixnums could become bignums and vice
	  versa.
	  (define-unary-result!): Remove unused helper.
	* module/language/cps/types.scm (bignum?): New folder.

	Add &exact-number helper definition
	* module/language/cps/types.scm (&exact-number): New union type.
	  (rational?, exact?):
	* module/language/cps/type-fold.scm (mul/immediate): Use the new
	  definition.

	Add exact-integer? as interesting Tree-IL effect-free primitive
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect-free-primitives*, *effect+exception-free-primitives*): Detect
	  use of exact-integer?.
	* module/language/tree-il/compile-cps.scm (canonicalize): Compile
	  exact-integer? to a fixnum?-or-bignum? check.

	Remove thunk?, integer? simple predicate inferrers
	* module/language/cps/types.scm (thunk?, integer?): Remove predicates;
	  they were inferring incorrectly.  I don't think they were being used
	  though (these primcalls don't reach here).

	Add support for bignum? CPS primitive.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/primitives.scm (*heap-type-predicates*): Add
	  support for bignum? CPS primitive.

	intmap-remove returns empty-intmap if appropriate
	* module/language/cps/intmap.scm (intmap-remove): Return empty-intmap if
	  the result is indeed empty.

	DCE eliminates effect-free branches to the same continuation
	* module/language/cps/dce.scm (compute-live-code): Eliminate some
	  branches.

	Fix type check elision for branches
	* module/language/cps/type-checks.scm (elide-type-checks): Fix bug where
	  we were matching against a list instead of a record.  Doh!

	Minor compile-cps refactor
	* module/language/tree-il/compile-cps.scm (canonicalize): Refactor to
	  make with-lexicals helper available to the whole function.

	Remove effects-analysis exports that were undefined
	* module/language/cps/effects-analysis.scm (exclude-effects)
	  (effect-free?, constant?): Remove undefined exports.

	Specialize fixnum and s64 phis
	* module/language/cps/specialize-numbers.scm
	  (compute-specializable-fixnum-vars, compute-specializable-s64-vars):
	* module/language/cps/specialize-numbers.scm (compute-specializable-phis):
	  (apply-specialization): Re-enable specialization of fixnum phis and
	  also s64 phis.

	Fix unboxed immediate range comparison type inference
	* module/language/cps/types.scm (imm-u64-<, imm-s64-<): Fix minimum
	  computations.

	Fix logand type inference
	* module/language/cps/types.scm (logand): We were computing the wrong
	  ranges when either argument was negative; a terrible bug!
	  (logsub): Also fix range when A is negative and B is non-negative.
	  (ulogand): Tighten up range.

2017-11-22  Ludovic Courtès  <ludo@gnu.org>

	ltdl wrappers now use a recursive mutex.
	Fixes <https://bugs.gnu.org/29275>.
	Reported by noxdafox <noxdafox@gmail.com>.

	* libguile/dynl.c (scm_init_dynamic_linking): Add call to
	'scm_i_pthread_mutex_init'.

2017-11-22  Matt Wette  <matt.wette@gmail.com>
	    Ludovic Courtès  <ludo@gnu.org>

	foreign: Add 'uintptr_t' and 'intptr_t'.
	* libguile/foreign.c (scm_uintptr_t, scm_intptr_t): New variables.
	(scm_init_foreign): Define them.
	* module/system/foreign.scm: Export 'intptr_t' and 'uintptr_t'.
	* doc/ref/api-foreign.texi (Foreign Types): Document them.

2017-11-22  Maxim Cournoyer  <maxim.cournoyer@gmail.com>

	scripts: help: Fix reference to the "Using Guile Tools" node.
	Fixes <https://bugs.gnu.org/28835>.

	* module/scripts/help.scm (list-commands): Fix reference to the "Using
	Guile Tools" node.

2017-11-22  Sergei Trofimovich  <slyfox@gentoo.org>

	ia64: Fix crash in thread context switch.
	Fixes <https://bugs.gnu.org/29151> and <https://bugs.gentoo.org/613986>.

	Backtrace looks like that:

	  Program terminated with signal SIGSEGV, Segmentation fault.
	  #0  0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372
	  372                   t->pending_rbs_continuation->backing_store,
	  [Current thread is 1 (Thread 0x2000000000049340 (LWP 8190))]
	  (gdb) bt
	  #0  0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372
	  #1  0x2000000000148e00 in scm_c_abort (vm=0x60000000000edea0, tag=0x6000000000795ba0, n=0, argv=0x60000fffff7f0ce0, cookie=-1) at control.c:239
	  #2  0x2000000000149070 in scm_at_abort (tag=0x6000000000795ba0, args=0x304) at control.c:258
	  (gdb) print t
	  $2 = (scm_i_thread *) 0x6000000000068000
	  (gdb) print t->pending_rbs_continuation
	  $3 = (scm_t_contregs *) 0xffeb

	The problem here is the value of 't->pending_rbs_continuation' pointer.
	It's supposed to poin to a register stack pointer or be NULL if not yet
	backed up.

	The problem is it is never initialized to NULL at creation time and
	contained garbage on stack. Sometimes people are lucky and have zeros
	on stack and guile works. But sometimes there is something and guile
	crashes.

	The fix is trivial: initialize 'pending_rbs_continuation = NULL'
	at thread registration time (the same way other threads are registered).

	Reported-by: Matt Turner

	* libguile/threads.c (guilify_self_1): Initialize pending_rbs_continuation
	to avoid crash on ia64.

2017-11-22  Arun Isaac  <arunisaac@systemreboot.net>

	Mention (ice-9 peg) module path.
	* doc/ref/api-peg.texi (PEG Parsing): Mention (ice-9 peg) module path.

	Convert `close' ref to xref.
	* doc/ref/api-io.texi (Ports): Convert `close' ref to xref.

2017-11-22  Ludovic Courtès  <ludo@gnu.org>

	Honor '%fresh-auto-compile'.
	Fixes <https://bugs.gnu.org/29226>.

	* libguile/load.c (scm_primitive_load_path): Set 'compiled_thunk' to
	SCM_BOOL_F when *scm_loc_fresh_auto_compile is true.
	* module/ice-9/boot-9.scm (load-in-vicinity)[load-absolute]: Call
	'pre-compiled' only when %FRESH-AUTO-COMPILE is false.

2017-11-20  Andy Wingo  <wingo@pobox.com>

	Revert "Slot allocation allows s64/u64 representations of same var"
	This reverts commit a88614fb17ed7a3c7d891907414222fc8a9ccd24.

	Fix u64/s64 typesafety around fixnum (un)tagging
	* module/language/cps/type-fold.scm (u64->scm, scm->u64): Fix
	  type-safety by adding casts.
	* module/language/tree-il/compile-cps.scm (convert, canonicalize):
	  Simplify rsh and lsh compilation by not trying to avoid scm->u64 in
	  the early stages of the compiler.

	Separate u64 and s64 type inferrers now that ops are monomorphic
	* module/language/cps/types.scm: Remove some more needless type checker
	  definitions.
	  (u64-imm-=, u64-imm-<, imm-u64-<): Separate from the s64 definitions.
	  (s64-imm-=, s64-imm-<, imm-s64-<): New definitions.

	Fix s64->scm reducer
	* module/language/cps/type-fold.scm (s64->scm): Fix reducer.

	Specialize-numbers reifies instructions that type-check
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Before, this pass would reify e.g. uadd for an addition of s64 values
	  if it could prove that the result would be within the s64 range.  But
	  this is really confusing if later we want to do range analysis over
	  the result.  Additionally it would sometimes reify diamond control
	  patterns that weren't really amenable to CSE.  So instead we now reify
	  instructions that can pass type checks, like "sadd" instead of
	  "uadd".

	Better support for unboxed signed arithmetic
	* module/language/cps/primitives.scm (*macro-instruction-arities*):
	  Declare new u64->s64, s64->u64, sadd, ssub, smul, sadd/immediate,
	  ssub/immediate, smul/immediate, slsh, and slsh/immediate primcalls
	  that don't have corresponding VM instructions.
	* module/language/cps/effects-analysis.scm: The new instructions are
	  effect-free.
	* module/language/cps/reify-primitives.scm (wrap-unary, wrap-binary):
	  (wrap-binary/exp, reify-primitives): Add horrible code that turns
	  e.g. sadd into a series of s64->u64, uadd, and then u64->s64.  This
	  way we keep our ability to do range inference on unboxed signed
	  arithmetic, but we still bottom out to the same instructions for both
	  unboxed signed and unboxed unsigned arithmetic.
	* module/language/cps/types.scm: Add type inferrers for new
	  instructions.  Remove type checkers for some effect-free primitives.
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  pseudo-emitter for u64->s64 and s64->u64 no-ops.

	Revert specialization of fixnum phi variables
	* module/language/cps/specialize-numbers.scm
	  (compute-specializable-fixnum-vars, compute-specializable-phis)
	  (apply-specialization): Don't specialize phis as fixnums.  Need to try
	  again with some proper range analysis, as a variable defined with
	  tag-fixnum can indicate either a u64 or a s64.

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

	Destroy the mutex associated with a dirstream.
	This is a followup to 187655cedb42cc4b01088179649b02295cd35260.

	* libguile/filesys.c (scm_dir_free): Add call to
	'scm_i_pthread_mutex_destroy'.

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

	'readdir' no longer deadlocks upon error.
	If 'readdir' returned an error, we'd call SCM_SYSERROR, which would try
	to acquire 'scm_i_misc_mutex' and sit there forever because it was
	already taken.

	Reported at <https://bugs.gnu.org/29335>.

	* libguile/filesys.c (scm_opendir): Allocate storage for a mutex and
	store it as the third word of the SMOB.
	(scm_readdir): Use that mutex instead of 'scm_i_misc_mutex'.  Fixes the
	deadlock upon error.
	(scm_rewindir): Lock the mutex around the 'rewinddir' call.

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

	ursh, ursh/immediate, etc only residualized if count < 64
	* module/language/cps/reify-primitives.scm (reify-primitives): Remove
	  cases for ursh/immediate etc, as these should all be within range, by
	  construction.
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Only reify ursh/immediate, etc if the shift count is less than 64.
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Remove specialization cases for ursh/immediate etc; this is the domain
	  of specialize-numbers.
	* module/language/cps/types.scm (ursh, srsh, ulsh): Limit arguments to
	  be less than 63.
	  (ulsh/immediate): Assume parameter is in range.

	Compiler specializes comparisons to immediate integers
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm (load-const/unlikely):
	* module/language/cps/types.scm (load-const/unlikely):
	* module/language/cps/primitives.scm (*macro-instruction-arities*): Add
	  new primcall, load-const/unlikely.
	* module/language/cps/specialize-numbers.scm: Rework comparison
	  specialization.  Add support for specializing comparisons against
	  integer immediates.

	Add support for comparisons against integer immediates
	* libguile/vm-engine.c (s64-imm=?, u64-imm<?, imm-u64<?, s64-imm<?)
	  (imm-s64<?): New instructions.
	* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Add new
	  X8_S12_Z12 word type used by the new S64/immediate instructions.  A
	  Z12 is a 12-bit signed integer immediate.
	* module/system/vm/assembler.scm: Export new instructions, and add
	  X8_S12_Z12 support.  Also, add missing shufflers for X8_S12_C12.
	* module/language/bytecode.scm (compute-instruction-arity):
	* module/system/vm/disassembler.scm (unpack-s12, disassembler): Add
	  support for X8_S12_Z12.
	* module/language/cps/types.scm (define-predicate-inferrer/param): New
	  helper.
	  (u64-=, u64-<, s64-<): Remove type checkers; this procedure does not
	  cause &type-check.
	  (u64-imm=?, s64-imm=?, u64-imm<?, imm-u64<?, s64-imm<?, imm-s64<?):
	  New type inferrers.
	* module/language/cps/type-fold.scm (define-unary-branch-folder*): New
	  helper.
	  (u64-imm=?, s64-imm=?, u64-imm<?, imm-u64<?, s64-imm<?, imm-s64<?):
	  New branch folders.
	* module/language/cps/reify-primitives.scm (reify-primitives): Reify
	  constants for new immediate branching primcalls if values out of
	  range.
	* module/language/cps/effects-analysis.scm: Add support for new
	  primcalls.
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  support for new primcalls and instructions.  Compile u64-imm-= to
	  s64-imm=?.

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

	Don't fold comparisons that might contain a NaN.
	* module/language/cps/type-fold.scm (compare-integer-ranges): Rename
	  from compare-ranges, as we can't compare ranges that might include a
	  NaN.
	  (<, =): Update uses.

2017-11-13  Andy Wingo  <wingo@pobox.com>

	Better untagging of fixnums
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  support for tag-fixnum/unlikely.
	* module/language/cps/cse.scm (compute-equivalent-subexpressions): Add
	  equivalent subexpressions for tag-fixnum.
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/primitives.scm (*macro-instruction-arities*): Add
	  tag-fixnum/unlikely.
	* module/language/cps/specialize-numbers.scm (specialize-u64-unop)
	  (specialize-u64-binop, specialize-u64-shift)
	  (specialize-u64-comparison): Make the arg unboxers and result boxers
	  into keyword arguments.
	  (specialize-s64-unop): New helper.
	  (specialize-fixnum-comparison, specialize-fixnum-scm-comparison)
	  (specialize-scm-fixnum-comparison): Rename from
	  specialize-s64-comparison et al.  Perhaps this should be expanded
	  again to include the whole s64 range, once we start to expand scm->s64
	  et al.
	  (specialize-operations): Specialize arithmetic, etc on signed
	  operands and results.  Use less powerful unboxing/boxing ops if
	  possible -- e.g. tag-fixnum instead of u64->scm.  Prefer fixnum
	  comparisons over u64 comparisons.
	  (compute-specializable-fixnum-vars): New helper.
	  (compute-specializable-phis): Specialize fixnum phis as well.
	  (specialize-primcalls): Specialize untag-fixnum of a constant to
	  load-s64.
	* module/language/cps/type-fold.scm (u64->scm, s64->scm):
	  (scm->s64, scm->u64): Reduce to fixnum ops where possible.
	* module/language/cps/types.scm: Remove type checkers for ops that don't
	  throw type errors.  Alias tag-fixnum/unlikely to tag-fixnum.

	Better range inference
	* module/language/cps/types.scm (&fx32-min, &fx32-max, &fx64-min)
	  (&fx64-max): New internal definitions.
	* module/language/cps/types.scm (type-entry-saturating-union): Add more
	  stops as we saturate ranges towards infinity.

	Slot allocation allows s64/u64 representations of same var
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  If an optimization pass decided to e.g. use untag-fixnum for one
	  definition of a variable and e.g. vector-length for the other, assume
	  that their values are compatible.  We don't know at this point whether
	  the values are meant to be s64 (e.g. because vector-length is a subset
	  of the s64 range) or u64 (e.g. because although we're calling
	  untag-fixnum on the value, actually we now that the value is
	  non-negative, or actually we just want the unsigned bits).  Anyway we
	  default to u64.  In the future we can perhasps be more precise.

2017-11-13  Andy Wingo  <wingo@pobox.com>

	Add srsh, srsh/immediate instructions
	* libguile/vm-engine.c (srsh, srsh/immediate): New instructions.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/reify-primitives.scm (reify-primitives):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	* module/language/cps/types.scm (srsh, srsh/immediate):
	* module/system/vm/assembler.scm: Add support for new instructions.

	* module/language/cps/types.scm (ulsh, ursh): Remove type checkers, as
	  these are effect-free.  Limit range of ursh count.

2017-11-11  Andy Wingo  <wingo@pobox.com>

	Specialize rsh/lsh, not ash
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Replace "ash" specializer with "rsh"/"lsh" specializer.

	Add missing lsh/immediate, rsh/immediate type inferrers
	* module/language/cps/types.scm (lsh/immediate, rsh/immediate): Add
	  missing type inferrers.

	Type folding has "macro reduction" phase
	* module/language/cps/type-fold.scm (*primcall-macro-reducers*):
	  (define-primcall-macro-reducer, define-unary-primcall-macro-reducer):
	  (define-binary-primcall-macro-reducer): New facility, for reductions
	  on which reductions should run.  Define macro reducers for mul, lsh,
	  and rsh.  Move mul reducer to be a mul/immediate reducer.
	  (logbit?): Use target fixnum range.
	  (local-type-fold): Adapt to call macro reducers first.
	* module/language/cps/reify-primitives.scm (reify-primitives): Reify
	  mul/immediate back to mul.

	Convert "ash" to "lsh"/"rsh" when lowering to CPS
	* module/language/cps/effects-analysis.scm: Remove case for "ash".
	* module/language/cps/types.scm (ash): Remove.
	* module/language/tree-il/compile-cps.scm (convert, canonicalize):
	  Convert "ash" to "lsh"/"rsh" early on.
	* module/system/base/target.scm (target-fixnum?): New procedure.

	Compiler uses target fixnum range
	* module/system/base/target.scm (target-most-negative-fixnum):
	  (target-most-positive-fixnum): New definitions.
	* module/language/cps/types.scm (constant-type, define-exact-integer!)
	  (&min/fixnum, &max/fixnum): Use new definitions.
	  (&max/vector): Use target-max-vector-length.

	Add tag-fixnum instruction
	* libguile/vm-engine.c (tag-fixnum): New instruction.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/types.scm (&min/fixnum, &max/fixnum, tag-fixnum):
	* module/system/vm/assembler.scm: Add support for the new instruction.

	Use immediate primcalls when unfolding constructors
	* module/language/cps/constructors.scm (inline-vector): Use immediate
	  primcalls.

	Closure conversion uses immediate variants of vector instructions
	* module/language/cps/closure-conversion.scm (convert-one): Use
	  immediate variants of vector instructions.

	Specialize comparisons to SCM as s64
	* module/language/cps/specialize-numbers.scm (specialize-s64-comparison)
	  (specialize-s64-scm-comparison, specialize-scm-s64-comparison): New
	  helpers.
	  (specialize-scm-u64-comparison, specialize-u64-scm-comparison):
	  Remove.  Comparing SCM as s64 is better as fixnums are a subset of
	  s64, not u64.
	  (specialize-operations): Prefer s64 comparisons when we can't
	  specialize both arguments; this at least inlines the fixnum case.

	Canonicalize <=, >=, and > primcalls to <
	* module/language/tree-il/compile-cps.scm (canonicalize): Convert <=,
	  >=, and > primcalls to <.
	* module/language/cps/primitives.scm (*comparisons*):
	* module/language/cps/effects-analysis.scm: Remove superfluous
	  primcalls.
	* module/language/cps/specialize-numbers.scm
	  (specialize-u64-scm-comparison): Only emit < primcalls for ordered
	  comparisons.
	  (specialize-scm-u64-comparison): New helper.
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Remove support for >=, <=, and the like.
	* module/language/cps/type-fold.scm: Remove folders for <= and so on.
	* module/language/cps/types.scm (define-=-inferrer, define-<-inferrer):
	  New helpers; use them for all = and < variants.  Remove checkers and
	  inferrers for <= and the like.
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  unnecessary cases.

	Refactor numeric comparison bytecode emission
	* module/language/cps/compile-bytecode.scm (compile-function): Refactor.

	Fix effects analysis bug introduced with primcall param
	* module/language/cps/effects-analysis.scm (primitive-effects): Fix
	  swapped name and param.  Embarrassing!

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

	http: Fix typo in proxy handling in 'write-request-line'.
	Reported by Mark H Weaver <mhw@netris.org>
	at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00190.html>.

	* module/web/http.scm (write-request-line): Fix more typos introduced in
	96b994b6f815747ce2548123cc996d8132bd4781.

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

	http: Fix typo in proxy handling in 'write-request-line'.
	Reported by Konrad Hinsen <konrad.hinsen@fastmail.net>
	at <https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00070.html>.

	* module/web/http.scm (write-request-line): Move 'string-index' first in
	'cond' clause.  Fixes a regression introduced in
	96b994b6f815747ce2548123cc996d8132bd4781.

2017-11-09  Ludovic Courtès  <ludo@gnu.org>

	Print exception location only once.
	Fixes a regression introduced in commit
	39090e677eed54761e0952f2575ddef1504545d3.

	* module/ice-9/boot-9.scm (exception-printers)[print-exception]: Remove
	extraneous 'print-location' call.

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

	Allow GDB support to be used with GDB-linked-against-Guile-2.0.
	* libguile/Makefile.am (INSTANTIATE): New variable.
	(install-data-hook): Use it.
	* libguile/libguile-2.2-gdb.scm: Autoload (system vm debug).
	Augment %load-path and %load-compiled-path, and reload (system base
	types).
	* module/system/base/types.scm: Remove #:hide to be 2.0-compatible.
	Use (system syntax internal) conditionally when on 2.2.

2017-11-05  Andy Wingo  <wingo@pobox.com>

	Add new "throw" VM ops
	* libguile/throw.h (scm_ithrow, scm_throw): Mark as SCM_NORETURN.
	* libguile/throw.c (scm_throw, scm_ithrow): Adapt to not return.
	* libguile/vm-engine.c (throw, throw/value, throw/value+data): New
	  instructions.
	* libguile/vm.c (vm_throw, vm_throw_with_value)
	  (vm_throw_with_value_and_data): New helpers.
	* module/language/cps/compile-bytecode.scm (compile-function): Add cases
	  for new instructions.
	* module/language/cps/prune-bailouts.scm (prune-bailouts): More simple,
	  now that there are no $kreceives in play.
	* module/language/cps/reify-primitives.scm (reify-clause): Update
	  reification of no-clause functions to use new throw op.
	* module/language/tree-il/compile-cps.scm (convert): Convert invocations
	  of the variable-arity 'throw primitive from Tree-IL to the new
	  fixed-arity CPS instructions.
	* module/system/vm/assembler.scm (emit-throw/value*)
	  (emit-throw/value+data*, emit-throw): Export new instructions.
	* module/system/vm/disassembler.scm (code-annotation): Add annotation.

	error, scm-error primcalls expand to `throw'
	* module/language/tree-il/primitives.scm (scm-error, error): Expand
	  into `throw'.
	* module/language/tree-il/peval.scm (peval): Reify "throw" for dynwind
	  error.
	* module/language/tree-il/compile-cps.scm (canonicalize): Reify "throw"
	  for call-with-prompt error.
	* module/language/cps/prune-bailouts.scm (prune-bailouts): Don't expect
	  "error" or "scm-error" here.

	Add lsh, rsh instructions
	* libguile/vm-engine.c (lsh, rsh, lsh/immediate, rsh/immediate): New
	  instructions taking unboxed bit counts.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/specialize-numbers.scm (specialize-f64-unop):
	  (specialize-u64-unop): Add ability to specialize add/immediate, etc,
	  and add lsh/immediate as well.
	  (specialize-u64-binop, specialize-u64-shift): Move rsh/lsh
	  specialization to its own procedure, given that the bit count is
	  already unboxed.
	  (specialize-operations): Adapt to support more /immediate
	  instructions.
	* module/language/cps/type-fold.scm (mul): Reify an lsh/immediate
	  instead of an ash.
	* module/language/cps/types.scm (compute-ash-range): Add type inferrers
	  for lsh, rsh, and their immediate variants.
	* module/system/vm/assembler.scm: Export emit-lsh and so on.
	* module/language/tree-il/compile-cps.scm (convert): Convert "ash" on
	  immediates to rsh/immediate or lsh/immediate.

	Earlier conversion to /imm primcalls
	* module/language/tree-il/compile-cps.scm (convert): Convert to /imm
	  variants of primcalls early on, to decrease complexity of later
	  passes.

	Specialize primcalls more aggressively
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Don't restrict /imm params to encodeable immediates; specialize any
	  imm.  Rely on reify-primitives to undo the transformation if needed.

	(system base types) uses target's idea of max size_t
	* module/system/base/target.scm (target-max-size-t):
	  (target-max-size-t/scm, target-max-vector-length): New public
	  functions.
	* module/language/cps/types.scm (type-entry-saturating-union): Remove
	  restriction of polymorphic types to be within max-size-t; this could
	  incorrectly apply constraints on numeric values.
	  (&max/size, &max/scm-size): Use target-max-size-t.
	  (*max-size-t*): Remove; replace uses with (target-max-size-t).

	Tweak optimization order
	* module/language/cps/optimize.scm (optimize-first-order-cps): Move up
	  the simplify-primcalls pass, to allow DCE to take away unneeded
	  constants.  An incremental step

	reify-primitives reifies constants for out-of-range imm params
	* module/language/cps/reify-primitives.scm (reify-primitives): Add pass
	  to re-reify constant arguments for primcalls with immediate parameters
	  that can't be encoded as bytecode.

	Remaining /immediate instructions take primcall imm param
	* module/language/cps/compile-bytecode.scm (compile-function): Update
	  add/immediate, etc.
	* module/language/cps/slot-allocation.scm (compute-needs-slot):
	  Simplify.
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Rework for add/immediate, etc.
	* module/language/cps/types.scm (define-unary-result!)
	  (define-binary-result!): Take types as params instead of variables, so
	  we can share this code with /imm variants.
	  (add/immediate, sub/immediate, uadd/immediate, usub/immediate)
	  (umul/immediate, ulsh/immediate, ursh/immediate): Update type
	  inferrers.

	builtin-ref takes immediate parameter
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/reify-primitives.scm (builtin-ref):
	* module/language/cps/slot-allocation.scm (compute-needs-slot):
	  Builtin-ref uses immediate parameter.

	Immediate parameter for struct-ref et al
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/slot-allocation.scm (compute-needs-slot):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	* module/language/cps/types.scm (allocate-struct/immediate)
	  (struct-ref/immediate, struct-set!/immediate): Immediate struct
	  constructor and accessor use immediate primcall parameters.

	Immediate variants of vector-ref, etc use immediate param
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/slot-allocation.scm (compute-needs-slot):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	* module/language/cps/types.scm (make-vector/immediate):
	  (vector-ref/immediate, vector-set!/immediate): Use immediate primcall
	  param.

	free-ref, free-set take immediate parameters
	* module/language/cps/closure-conversion.scm (convert-one):
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm (define-primitive-effects*)
	  (expression-effects, primitive-effects): Only fall back to passing
	  constant table if the immediate parameter is false.  Adapt closure
	  effects analysis.
	* module/language/cps/slot-allocation.scm (compute-needs-slot): Remove
	  special cases for free-ref/free-set!.

	load-f64, etc take immediate parameters
	* module/language/cps/compile-bytecode.scm (compile-function): Make
	  load-f64, load-s64, and load-u64 take an immediate parameter instead
	  of a CPS value.
	* module/language/cps/effects-analysis.scm: Remove CPS argument from
	  immediate load instructions.
	* module/language/cps/slot-allocation.scm (compute-needs-slot): Remove
	  special case for load-64 etc.
	* module/language/cps/specialize-numbers.scm
	  (specialize-u64-scm-comparison): Adapt.
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Adapt.
	* module/language/cps/types.scm (define-type-inferrer*): Also take param
	  argument.
	  (define-type-inferrer, define-predicate-inferrer): Adapt.
	  (define-type-inferrer/param): New helper.
	  (load-f64, load-s64, load-u64): Adapt inferrers to pass on value from
	  param.
	* module/language/cps/utils.scm (compute-constant-values): Adapt.

	cache-current-module, etc use immediate primcall parameters
	* module/language/bytecode.scm (*macro-instruction-arities*):
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm (current-module):
	* module/language/cps/primitives.scm (*macro-instruction-arities*):
	* module/language/cps/prune-top-level-scopes.scm (compute-used-scopes):
	  (prune-top-level-scopes):
	* module/language/cps/reify-primitives.scm (module-box):
	* module/language/cps/slot-allocation.scm (compute-needs-slot):
	* module/language/tree-il/compile-cps.scm (toplevel-box):
	  (module-box, capture-toplevel-scope): Move the primcalls that deal
	  with top-level references to use immediate parameters.

	$primcall has a "param" member
	* module/language/cps.scm ($primcall): Add "param" member, which will be
	  a constant parameter to the primcall.  The idea is that constants used
	  by primcalls as immediates don't need to participate in optimizations
	  in any way -- they should not participate in CSE, have the same
	  lifetime as the primcall so not part of DCE either, and don't need
	  slot allocation.  Indirecting them through a named $const binding is
	  complication for no benefit.  This change should eventually improve
	  compilation time and memory usage, once we fully take advantage of it,
	  as the number of labels and variables will go down.
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/handle-interrupts.scm:
	* module/language/cps/licm.scm:
	* module/language/cps/peel-loops.scm:
	* module/language/cps/prune-bailouts.scm:
	* module/language/cps/prune-top-level-scopes.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/rotate-loops.scm:
	* module/language/cps/self-references.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/specialize-numbers.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/cps/split-rec.scm:
	* module/language/cps/type-checks.scm:
	* module/language/cps/type-fold.scm:
	* module/language/cps/types.scm:
	* module/language/cps/utils.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Adapt all users.

2017-11-01  Andy Wingo  <wingo@pobox.com>

	More robust vacuuming of in-use weak tables
	* libguile/weak-table.c (scm_t_weak_table); Add last_gc_no member.
	* libguile/weak-table.c (vacuum_weak_table): Only vacuum if we haven't
	  done so since the last GC.
	  (scm_c_weak_table_ref, scm_c_weak_table_put_x, scm_c_weak_table_remove_x)
	  (scm_c_weak_table_fold): Vacuum the weak table if needed.
	  (scm_weak_table_clear_x): Update last_gc_no flag, as no more vacuuming
	  will be needed.

	Refactor weak table to use bitmaps for weak entries

2017-11-01  Andy Wingo  <wingo@pobox.com>

	Weak tables are now bucket-and-chain tables
	This change should make weak tables work better with libgc, as the weak
	components that need mark functions are smaller, so they don't overflow
	the mark queue.  Also this prevents the need to move disappearing
	links.

	* libguile/weak-table.c (scm_t_weak_entry): Change to be a hash table
	  chain entry.
	  (struct weak_entry_data, do_read_weak_entry, read_weak_entry): Read
	  out the key and value directly.
	  (GC_move_disappearing_link, move_disappearing_links, move_weak_entry):
	  Remove.
	  (scm_t_weak_table): Rename "entries" member to "buckets", and "size" to
	  "n_buckets".
	  (hash_to_index, entry_distance, rob_from_rich, give_to_poor): Remove.
	  (mark_weak_key_entry, mark_weak_value_entry): Mark a single link, and
	  the next link.
	  (mark_doubly_weak_entry): New kind.
	  (allocate_entry): Allocate a single entry.
	  (add_entry): New helper.
	  (resize_table): Reimplement more like normal hash tables.
	  (vacuum_weak_table): Adapt to new implementation.
	  (weak_table_ref, weak_table_put_x, weak_table_remove_x): Adapt.
	  (make_weak_table): Adapt.
	  (scm_weak_table_clear_x): Actually unregister the links to prevent a
	  memory leak.
	  (scm_c_weak_table_fold): Collect items in an alist, then fold outside
	  the lock.
	  (scm_weak_table_prehistory): Initialize doubly_weak_gc_kind.

2017-10-31  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Remove scm_generalized_vector_get_handle
	This was deprecated in 2.0.9 (118ff892be199f0af359d1b027645d4783a364ec).

	* libguile/bitvectors.c (scm_bitvector_writable_elements): Replace
	  scm_generalized_vector_get_handle.
	  Remove unnecessary #includes.
	* libguile/vectors.c (scm_vector_writable_elements): Replace
	  scm_generalized_vector_get_handle.
	  Remove unnecessary #includes.
	* libguile/random.c (scm_random_normal_vector_x): Replace
	  scm_generalized_vector_get_handle.
	* libguile/generalized-vectors.h, libguile/generalized-vectors.c
	  (scm_generalized_vector_get_handle): Remove.
	  Remove unnecessary #includes.
	* NEWS: Add removal notice.

2017-10-31  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Support general arrays in random:hollow-sphere!
	* libguile/random.c (vector_scale_x, vector_sum_squares): Handle general
	  rank-1 #t or 'f64 arrays.
	* test-suite/tests/random.test: Add tests for random:hollow-sphere!.

	Fix bitvectors and non-zero lower bound arrays in truncated-print
	* module/ice-9/arrays.scm (array-print-prefix): New private function.
	* libguile/arrays.c (scm_i_print_array): Reuse (array-print-prefix) from
	  (ice-9 arrays). Make sure to release the array handle.
	* module/ice-9/pretty-print.scm (truncated-print): Support
	  bitvectors.
	  Don't try to guess the array prefix but call array-print-prefix from
	  (ice-9 arrays) instead.
	  Fix call to print-sequence to support non-zero lower bound arrays.
	* test-suite/tests/arrays.test: Test that arrays print properly.
	* test-suite/tests/print.test: Test truncated-print with bitvectors,
	  non-zero lower bound arrays.

	Support non-zero lower bounds in array-slice-for-each
	* libguile/array-handle.c (scm_array_handle_writable_elements): Fix
	  error message.
	* libguile/array-map.c (scm_array_slice_for_each): Support non-zero
	  lower bounds. Fix error messages.
	* test-suite/tests/array-map.test: Test scm_array_slice_for_each with
	  non-zero lower bound argument.

	Fix sort, sort! for arrays with nonzero lower bound
	* module/ice-9/arrays.scm (array-copy): New function, export.
	* module/Makefile.am: Install (ice-9 arrays).
	* doc/ref/api-data.texi: Add documentation for (ice-9 arrays).
	* libguile/quicksort.i.c: Use signed bounds throughout.
	* libguile/sort.c (scm_restricted_vector_sort_x): Fix error calls. Fix
	  calls to quicksort.
	* test-suite/tests/sort.test: Actually test that the sorted results
	  match the original data. Test cases for non-zero base index arrays for
	  sort, sort!, and stable-sort!.

	Remove documentation on uniform-vector-read!, uniform-vector-write
	* NEWS: Add specific removal notice.
	* doc/ref/api-data.texi: Remove documentation on uniform-vector-read!,
	  uniform-vector-write.

	Replace uniform-vector-read benchmark with bytevector-io benchmark
	* benchmark-suite/benchmarks/uniform-vector-read.bm:
	  Remove; uniform-vector-read! and uniform-vector-write were deprecated
	  in 2.0 and are have been removed in 2.1.
	* benchmark-suite/benchmarks/bytevector-io.bm: New benchmark.
	* benchmark-suite/Makefile.am: Run the new benchmark.

	Allow scm_XXX_writable_elements on empty vectors, even if immutable
	* libguile/array-handle.c (initialize_vector_handle): Set both element
	  pointers to NULL if the vector is empty.
	* libguile/array-map.c (racp): Ignore immutability if destination is
	  empty.
	* test-suite/tests/sort.test: Check empty/mutable/immutable vectors with
	  sort!.
	* test-suite/tests/array-map.test: Check array-copy! with
	  empty/immutable destination.

2017-10-30  Andy Wingo  <wingo@pobox.com>

	Remove old branching instructions from VM
	* libguile/vm-engine.c: Remove old branching instructions.

	RTL test uses new instructions
	* test-suite/tests/rtl.test ("loop"): Update to use new instructions.

	Simplify special immediate predicate inferrer.
	* module/language/cps/types.scm
	  (define-special-immediate-predicate-inferrer): Simplify.

	Remove disassembler support for old-style jump instructions
	* module/system/vm/disassembler.scm (code-annotation, compute-labels)
	  (instruction-has-fallthrough?, define-jump-parser): Remove
	  disassembler support for old-style jump instructions.

	Emit new instructions in function preludes
	* module/system/vm/assembler.scm (standard-prelude, opt-prelude):
	  (kw-prelude): Emit new instructions in function preludes.  Now all
	  branches are via the new instructions.  Remove exports for old
	  branches.

	Fix argument type of arguments<=? instruction
	* libguile/vm-engine.c (arguments<=?): Take an immediate argument.

	Remove assembler exports for old-style predicates and branches
	* module/system/vm/assembler.scm: Remove emit-br, emit-br-if-true, etc,
	  as these all now use new-style instructions.

	Lower logtest branches to instead be 'zero? logand'
	* module/language/cps/compile-bytecode.scm (compile-function): Rename
	  the binary* helper back to binary, update uses, and remove logtest
	  branch as we no longer put logtest in test context.
	* module/language/cps/primitives.scm (*comparisons*): Remove logtest.
	* module/language/cps/type-fold.scm: Remove logtest folder.
	  (logbit?): Fold to logand.
	* module/language/cps/types.scm (logtest): Update to be a type inferrer
	  and not a predicate inferrer.
	* module/language/tree-il/peval.scm (peval): Transform logtest and
	  logbit? to (zero? (logand _ _)).

2017-10-29  Andy Wingo  <wingo@pobox.com>

	Remove compiler support for u64-scm comparisons
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/primitives.scm (*comparisons*):
	* module/language/cps/type-fold.scm:
	* module/language/cps/types.scm: Remove compiler support for u64-scm
	  comparisons, as this is now inlined.

	Inline u64/scm comparisons
	* module/language/cps/specialize-numbers.scm
	  (specialize-u64-scm-comparison): Inline comparisons against fixnums.

	Add hacks around lack of allocation sinking
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/primitives.scm (*macro-instruction-arities*):
	* module/language/cps/specialize-numbers.scm (compute-specializable-vars):
	* module/language/cps/types.scm: Add new variants of u64->scm and
	  s64->scm that can't be replaced by CSE's auxiliary definitions, so we
	  can sink unlikely allocations to side branches.  This is a hack until
	  we can get allocation sinking working

	Add untag-fixnum instruction
	* libguile/vm-engine.c (untag-fixnum): New instruction.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/system/vm/assembler.scm (untag-fixnum):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/types.scm (untag-fixnum): Add compiler support for
	  untag-fixnum.

	Add compiler support for fixnum? primcall predicate
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/type-fold.scm (fixnum?):
	* module/language/cps/types.scm (fixnum?):
	* module/system/vm/assembler.scm (system): Add cases for fixnum?
	  primcall predicate.

	Add compiler support for s64 comparisons.
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  emitters for s64 comparisons.
	* module/language/cps/effects-analysis.scm: Add entries.
	* module/language/cps/primitives.scm (*comparisons*):
	* module/language/cps/type-fold.scm (s64-<, s64-<=, s64-=, s64->=)
	  (s64->): Add folders.
	* module/language/cps/types.scm (s64-<, s64-<=, s64-=, s64->=, s64->):
	  Add type checkers and inferrers.

	Lower eqv? and equal? to new instructions.
	* libguile/numbers.h:
	* libguile/eq.c (scm_i_heap_numbers_equal_p): New helper, factored out
	  of scm_eqv_p.
	  (scm_eqv_p): Use new helper.
	* libguile/vm-engine.c (heap-numbers-equal?): New op.
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  support for heap-number? and heap-numbers-equal?.  Remove case for
	  eqv?.
	* module/language/cps/effects-analysis.scm: Add heap-numbers-equal?.
	* module/language/cps/primitives.scm (*comparisons*): Add
	  heap-numbers-equal?.
	* module/language/cps/type-fold.scm (heap-numbers-equal?): Update.
	* module/language/cps/types.scm (heap-numbers-equal?): Update.
	* module/language/tree-il/compile-cps.scm (canonicalize): Completely
	  inline eqv?, and partially inline equal?.
	* module/system/vm/assembler.scm (system): Export emit-heap-numbers-equal?.

	Add missing compiler support for heap-object? primcall et al.
	* module/language/cps/effects-analysis.scm: Reorder effect-free
	  primitives.  Add immediate predicates and heap-number?.
	* module/language/cps/primitives.scm (*heap-type-predicates*): Add
	  heap-number?.
	* module/language/cps/type-fold.scm (heap-number?): New folder.
	* module/language/cps/types.scm (heap-number?): New inferrer.

	Simplify lowering of branching primcalls to CPS
	* module/language/tree-il/compile-cps.scm (canonicalize, convert):
	  Simplify handling of branching primcalls so that `convert' only ever
	  sees branching primcalls in a test context.

	Rename "number" tag to "heap-number"
	* module/system/base/types/internal.scm (heap-tags): Rename number to
	  heap-number.
	* module/system/vm/assembler.scm: Adapt for emit-heap-number?.
	* module/system/base/types.scm (%tc7-heap-number): Rename from
	  %tc7-number.

	Minor optimization compiling 'and'
	* module/language/tree-il/compile-cps.scm (convert): Fold test of
	  constants directly to their branches without reifying booleans, to
	  simplify "and" chains early.

	Use new instructions for f64 comparisons
	* module/language/cps/compile-bytecode.scm (compile-function): Use new
	  instructions for f64 comparisons.

	Use new instructions for u64 comparisons.
	* module/language/cps/compile-bytecode.scm (compile-function): Compile
	  new instructions for u64 comparisons.

	Use new instructions for less-than, etc
	* module/language/cps/compile-bytecode.scm (compile-function): Use new
	  instructions for generic numeric comparisons (< <= = >= >).

	Emit new eq? instruction
	* module/language/cps/compile-bytecode.scm (compile-function): Emit
	  new-style eq? instruction.

	Simplify $branch to always take a $primcall
	* module/language/tree-il/compile-cps.scm (convert): Lower (if foo A B)
	  to (if (false? foo) B A).
	* module/language/cps/specialize-numbers.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/peel-loops.scm:
	* module/language/cps/rotate-loops.scm:
	* module/language/cps/self-references.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/split-rec.scm:
	* module/language/cps/type-fold.scm:
	* module/language/cps/types.scm:
	* module/language/cps/verify.scm: Adapt.
	* module/language/cps/compile-bytecode.scm: Add support for new-style
	  false? instruction for false? primcall.

	Use new instructions for null?, nil?
	* module/language/cps/compile-bytecode.scm (compile-function): Use new
	  instructions for branches on null? and nil?.

	Emit char? instead of br-if-char
	* module/language/cps/compile-bytecode.scm (compile-function): Use new
	  instructions for char? test.

	Emit new instructions for heap object type tests
	* module/language/cps/compile-bytecode.scm (compile-function): Compile
	  heap object tests to use the new instructions.

	Heap type predicates preceded by heap-object?
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  support for heap-object? in test context.
	* module/language/cps/primitives.scm (*immediate-predicates*):
	  (*heap-type-predicates*, *comparisons*): New sets of predicates for
	  which the VM has branching operations.
	  (heap-type-predicate?): New predicate.
	  (*branching-primcall-arities*): Make a hash table.
	  (branching-primitive?, prim-arity): Adapt
	  to *branching-primcall-arities* being a hash table.
	* module/language/cps/type-fold.scm (heap-object?): Add folder.
	* module/language/tree-il/compile-cps.scm (convert): Precede heap type
	  checks with a heap-object? guard.

	Use tag visitors to generate assemblers, disassembly annotations
	* module/system/vm/disassembler.scm (immediate-tag-annotations)
	  (heap-tag-annotations): Generate using tag visitors.
	* module/system/vm/assembler.scm
	  (define-immediate-tag=?-macro-assembler)
	  (define-heap-tag=?-macro-assembler): New helpers.  Use these to
	  generate immediate-tag=? and heap-tag=? macro assemblers.

	Refactor (system base types internal) to use more macros
	* module/system/base/types/internal.scm (visit-immediate-tags)
	  (visit-heap-tags): New helpers.
	* module/system/base/types/internal.scm (define-tags, define-tag): New
	  helpers.
	  (immediate-tags, heap-tags): Use define-tags to define all of the tag
	  values.  For consistency some names are changed:
	  (%tc2-fixnum): Renamed from %tc2-inum.
	  (%tc8-flag): Removed.
	  (%tc16-null): Renamed from %tc16-eol.
	  (%tc7-weak-vector): Renamed from %tc7-wvect.
	  (%tc7-hash-table): Renamed from %tc7-hashtable.
	  (%tc7-flonum): Renamed from %tc7-real.
	  (visit-heap-tags, visit-immediate-tags): New exports.
	* module/system/base/types.scm (cell->object): Adapt to renamings.
	  (match-bit-pattern): Add a case to match immediate SCM bits
	  literally.
	  (scm->object): Adapt to use the special immediate values directly.
	* module/system/vm/disassembler.scm (immediate-tag-annotations):
	  (heap-tag-annotations): Adapt to new names.

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

	Model all special immediates under one type bit (with range)
	* module/language/cps/types.scm (&special-immediate): Model all special
	  immediates (iflags) under this type bit.  This makes type analysis
	  less precise on these values as we have to use ranges instead of sets
	  to represent the values, but it frees up bits for other purposes,
	  allowing us to totally model all types in Guile.
	  (&eof): New &special-immediate value.
	  (&other-heap-object): New type bit.
	  Adapt inferrers.
	* module/language/cps/type-fold.scm
	  (define-special-immediate-predicate-folder): New helper, used for
	  iflag comparisons.
	  (local-type-fold): Adapt scalar-value for &special-immediate change.
	  Delegate branch on $values to a primcall to `false?'.

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

	Type inference distinguishes &fixnum and &bignum types
	This will allow heap-object? / inum? predicates to do something useful.

	* module/language/cps/types.scm (&fixnum, &bignum): Split &exact-integer
	  into these types.  Keep &exact-integer as a union type.
	  (type<=?): New helper.
	  (constant-type): Return &fixnum or &bignum as appropriate.
	  (define-exact-integer!): New helper, tries to make exact integer
	  results be &fixnum if they are within range.  Adapt users.
	  (restricted-comparison-ranges, define-binary-result!): Use type<=?
	  instead of = for &exact-integer.
	* module/language/cps/type-fold.scm (logtest, mul, logbit?): Use
	  type<=?.
	* module/language/cps/specialize-numbers.scm (inferred-sigbits):
	  (specialize-operations): Use type<=?.

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

	Allow garbage collection of revealed file ports.
	Reported at <https://bugs.gnu.org/28784>.
	Discussed at
	<https://lists.gnu.org/archive/html/guile-devel/2017-10/msg00003.html>.

	* libguile/fports.c (revealed_ports, revealed_lock): Remove.
	(scm_revealed_count): Just return 'SCM_REVEALED (port)'.
	(scm_set_port_revealed_x, scm_adjust_port_revealed_x): Remove
	REVEALED_PORTS manipulation.
	(fport_close): Do nothing when SCM_REVEALED (port) > 0.
	* libguile/fports.h (scm_t_fport): Adjust comment; make 'revealed'
	unsigned.
	* libguile/ports.c (do_close): Call 'close_port' instead of
	'scm_close_port'.
	(scm_close_port): Rename to...
	(close_port): ... this.  Add 'explicit' parameter.  Clear 'revealed'
	field when PORT is a file port and EXPLICIT is true.
	(scm_close_port): Call 'close_port'.
	* test-suite/tests/ports.test ("close-port & revealed port")
	("revealed port fdes not closed"): New tests.

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

	'frame-matcher' doesn't crash when the last IP is unknown.
	This fixes a bug when using ",break":

	  system/vm/traps.scm:127:31: system/vm/traps.scm:127:31: In procedure <: Wrong type: #f

	* module/system/vm/traps.scm (frame-matcher): Check whether END is
	true.

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

	First step towards emitting new instructions: "j" instead of "br"
	* module/language/cps/compile-bytecode.scm (compile-function): Emit "j"
	  instructions instead of "br".

	Add assembler and disassembler support for new instructions
	* module/system/vm/assembler.scm: Export assemblers for the new
	  instructions.
	* module/system/vm/disassembler.scm (immediate-tag-annotations)
	  (heap-tag-annotations, code-annotation): Add support for disassembling
	  the new instructions, with good annotations.
	  (compute-labels, instruction-has-fallthrough?, define-jump-parser):
	  Add support for new branching instructions.

	Add (system base types internal).
	* module/system/base/types/internal.scm: New file, extracted
	  from (system base types).
	* module/system/base/types.scm: Use (system base types internal) and
	  adapt to %tc1-pair, %tc2-inum, and %tc3-heap-object name changes.
	* module/Makefile.am (SOURCES):
	* am/bootstrap.am (SOURCES): Add new file.

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

	Add new-style test and branch instructions
	* libguile/vm-engine.c (UNPACK_16_16): New definition.
	  (u64=?, u64<?, s64=?, s64<?, f64=?, f64<?, =?, <?, arguments<?)
	  (positional-arguments<=?, immediate-tag=?, heap-tag=?, eq?): New
	  comparison instructions.
	  (j, jl, je, jnl, jne, jge, jnge): New branch instructions.

	Add support for C16_C16 instruction words
	* module/language/bytecode.scm (compute-instruction-arity):
	* module/system/vm/assembler.scm (pack-u16-u16, expand):
	* module/system/vm/disassembler.scm (disassembler):
	* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Add C16_C16.

2017-09-26  Andy Wingo  <wingo@pobox.com>

	Struct vtables store bitmask of unboxed fields
	* libguile/struct.h (scm_vtable_index_unboxed_fields): Allocate slot for
	  bitmask of which fields are unboxed.
	  (SCM_VTABLE_FLAG_SIMPLE, SCM_VTABLE_FLAG_SIMPLE_RW): Remove flags.
	  Renumber other flags.
	  (SCM_VTABLE_SIZE, SCM_STRUCT_SIZE): New helpers; long overdue.
	  (SCM_VTABLE_UNBOXED_FIELDS, SCM_VTABLE_FIELD_IS_UNBOXED):
	  (SCM_STRUCT_FIELD_IS_UNBOXED): New macros.
	* libguile/struct.c (set_vtable_access_fields): Rename from
	  set_vtable_layout_flags, and initialize the unboxed flags bitmask
	  instead of computing vtable flags.
	  (scm_struct_init, scm_c_make_structv, scm_allocate_struct): Simplify.
	  (scm_i_make_vtable_vtable): Adapt.
	  (scm_i_struct_equalp, scm_struct_ref, scm_struct_set_x)
	  (scm_struct_ref_unboxed, scm_struct_set_x_unboxed): Simplify.
	* libguile/vm-engine.c (VM_VALIDATE_BOXED_STRUCT_FIELD):
	  (VM_VALIDATE_UNBOXED_STRUCT_FIELD): Adapt definitions.
	  (struct-ref, struct-set!, struct-ref/immediate)
	  (struct-set!/immediate): Simplify definitions.
	* libguile/hash.c (scm_i_struct_hash): Simplify.
	* libguile/goops.c (scm_sys_clear_fields_x): Simplify.
	* libguile/foreign-object.c (scm_make_foreign_object_n):
	  (scm_foreign_object_unsigned_ref, scm_foreign_object_unsigned_set_x):
	  Simplify.

	Add new vtable reserved unboxed field
	* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT)
	  (scm_vtable_index_reserved_6): Add a reserved field.
	* module/oop/goops.scm (fold-class-slots, unboxed-slot?): Reserve a new
	  unboxed field.

2017-09-25  Andy Wingo  <wingo@pobox.com>

	Fix GOOPS class redefinition type error.
	* module/oop/goops.scm (allocate-instance): Fix error introduced in
	  recent merge.

	Remove unboxed case from vm struct accessors
	* libguile/vm.c (vm_error_boxed_struct_field):
	  (vm_error_unboxed_struct_field): New helpers.
	* libguile/vm-engine.c (VM_VALIDATE_BOXED_STRUCT_FIELD):
	  (VM_VALIDATE_UNBOXED_STRUCT_FIELD): New helpers.
	  (struct-ref, struct-set!, struct-ref/immediate)
	  (struct-set!/immediate): Remove unboxed case.

	Merge 'stable-2.2'
	Resolve conflicts by removing capability of struct-ref / struct-set! to
	access unboxed slots.

	Add struct-ref/unboxed, struct-set!/unboxed
	* NEWS: Add news entry.
	* doc/ref/api-data.texi (Vtables, Structure Basics): Update
	  documentation.
	* libguile/struct.c (scm_i_struct_equalp): Avoid using struct-ref on
	  unboxed fields.
	  (scm_struct_ref, scm_struct_set_x_unboxed): Issue deprecation warning
	  when accessing unboxed fields.
	  (scm_struct_ref_unboxed, scm_struct_set_x_unboxed): New functions.
	* libguile/struct.h (scm_struct_ref_unboxed, scm_struct_set_x_unboxed):
	  New functions.
	* module/oop/goops.scm (class-add-flags!, class-clear-flags!):
	  (class-has-flags?, <class>, %allocate-instance, <slot>):
	  (compute-get-n-set, unboxed-get, unboxed-set, unboxed-slot?):
	  (allocate-slots, %prep-layout!, make-standard-class, initialize):
	  Adapt to access unboxed nfields and flags fields via the new
	  accessors.

2017-09-23  Andy Wingo  <wingo@pobox.com>

	Inline struct-ref etc definitions in the VM.
	* libguile/vm-engine.c (struct-ref, struct-set!, struct-ref/immediate)
	  (struct-set!/immediate): Inline definitions.  Still a ways to go
	  before no function calls though.

	Replace "pr" struct fields with "pw" fields
	* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Layout is a "pr" field.
	* module/ice-9/boot-9.scm (record-type-vtable): Record vtable fields are
	  writable.
	  (<parameter>): "pw" fields.
	* module/oop/goops.scm (<class>, %compute-layout): <read-only> fields
	  are "pw" underneath.
	* module/rnrs/records/procedural.scm (record-type-vtable)
	  (record-constructor-vtable, make-record-type-descriptor): Use "pw"
	  fields in vtables.
	* module/srfi/srfi-35.scm (%condition-type-vtable)
	  (struct-layout-for-condition): "pw" fields in vtables.
	* test-suite/tests/goops.test:
	* test-suite/tests/structs.test: Use "pw" fields only.
	* benchmark-suite/benchmarks/structs.bm: Update for make-struct/no-tail,
	  to use pw fields, and also to remove useless tests that the compiler
	  would optimize away.
	* doc/ref/api-data.texi (Vtables): Add a note about the now-vestigial
	  permissions character and update documentation.
	  (Structure Basics, Meta-Vtables): Update examples.
	* libguile/hash.c (scm_i_struct_hash): Remove code that would handle
	  opaque/self fields.
	* libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use "pw" fields.
	* libguile/struct.c (scm_struct_init): Simplify check for hidden
	  fields.
	* libguile/values.c (scm_init_values): Field is "pw".

	Fix bootstrap slot permissions for <class>
	* module/oop/goops.scm: Fix bootstrap slot computation to preserve slot
	  permissions.

	Remove opaque slots
	* libguile/struct.c (scm_make_struct_layout): Remove support for opaque
	  slots.
	  (set_vtable_layout_flags): Remove opaque slots, and make the "switch"
	  total.
	  (scm_is_valid_vtable_layout): Remove opaque slots.
	  (scm_struct_ref, scm_struct_set_x): Remove case for opaque slots.

	Merge 'stable-2.2'

	GOOPS slot access protected via slot accessors, not struct perms
	* module/oop/goops.scm (opaque-slot?, read-only-slot?): New helpers.
	  (allocate-slots): Protect opaque and read-only slots by wrapping the
	  slot accessors instead of relying on struct permissions.
	  (%compute-layout): Remove opaque-slot case.

	Merge 'stable-2.2'

	Deprecate opaque struct fields
	* NEWS: Add entry.
	* doc/ref/api-data.texi (Vtables, Structure Basics): Remove mention of
	  opaque field protection.
	* libguile/struct.c (scm_make_struct_layout, scm_make_struct_no_tail):
	  Remove discussion of opaque fields.
	  (set_vtable_layout_flags): Issue a deprecation warning when opaque
	  fields are used.

2017-09-22  Andy Wingo  <wingo@pobox.com>

	Remove <int-slot>, <float-slot>, <double-slot>
	* module/oop/goops.scm (<int-slot>, <float-slot>, <double-slot>): Remove
	  slot classes that never did anything.

	Merge from stable-2.2

	Remove needless static variables from goops.c
	* libguile/goops.c: Remove many static SCM variables that were not
	  used on the C level, like class_protected for <protected-slot> and so
	  on.

	Remove SCM_UNBOUND
	* libguile/tags.h (SCM_UNBOUND_BITS, SCM_UNBOUND): Remove, as these were
	  only for GOOPS and they are no longer used by GOOPS.

	Remove support for tail arrays and self slots
	* libguile/struct.c (scm_make_struct): Remove support for tail arrays
	  and self slots.
	  (set_vtable_layout_flags): Always initialize the nfields member.
	  (scm_is_valid_vtable_layout): Remove support for tail arrays and self
	  slots.
	  (scm_i_struct_inherit_vtable_magic): No need to issue deprecation
	  warning for self slots, as they are no longer supported.
	  (scm_struct_init): Remove support for tail arrays and self slots.
	  (scm_c_make_structv): Throw an exception if n_tail is not 0.
	  (scm_allocate_struct): Adapt to scm_struct_init change.
	  (scm_i_make_vtable_vtable): Initialize slots manually, to avoid
	  relying on an already-initialized nfields member.
	  (scm_struct_ref, scm_struct_set_x): Simplify.
	* module/oop/goops.scm: As we now rely on nfields being valid, when
	  recalculating slots during boot we need to avoid resetting nfields of
	  <class>, even temporarily, as that would prevent any further access to
	  <class>!

	Merge stable-2.2 into master
	This commit resolves conflicts by removing the deprecated make-struct.

	Fix up make-struct-layout and make-struct/no-tail docstrings
	* libguile/struct.c (scm_make_struct_layout, scm_make_struct_no_tail):
	  Fix up docstrings for self and tail deprecation.

	Deprecate struct "self" slots
	* libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use a normal slot instead
	  of a self slot.
	* libguile/print.c (make_print_state): Initialize "handle" slot
	  manually.
	* libguile/struct.c (issue_deprecation_warning_for_self_slots): New
	  helper, called when making vtables to issue deprecation warnings for
	  "self" slots.  Avoids warning for the "self" slot that's part of the
	  fixed vtable slots.
	  (scm_i_struct_inherit_vtable_magic): Call
	  issue_deprecation_warning_for_self_slots.
	* doc/ref/api-data.texi (Vtables, Structure Basics): Remove references
	  to self slots.
	* NEWS: Add entry.

	Remove unused code in struct.c
	* libguile/struct.c (scm_make_struct_layout, scm_struct-ref)
	  (scm_struct_set_x): Remove commented-out support for signed and double
	  raw fields.

	Deprecate make-struct
	* libguile/struct.c: Replace uses of scm_make_struct with
	  scm_make_struct_no_tail or scm_c_make_struct.
	  (scm_make_struct_no_tail): Move this function to C instead of Scheme
	  to be able to deprecate scm_make_struct.
	* libguile/struct.h (scm_make_struct_no_tail): New public declaration.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_make_struct): Deprecate.
	* libguile/print.c:
	* libguile/procs.c:
	* libguile/stacks.c: Replace uses of scm_make_struct with
	  scm_make_struct_no_tail.
	* test-suite/tests/coverage.test:
	* test-suite/tests/structs.test: Use make-struct/no-tail instead of
	  make-struct.
	* NEWS: Add entry.

2017-09-20  Andy Wingo  <wingo@pobox.com>

	Remove references to tail arrays in the documentation
	* doc/ref/api-data.texi (Vtables, Structure Basics): Update to remove
	  references to tail arrays, in preparation for deprecation.

	Use make-struct/no-tail instead of make-struct
	* module/ice-9/boot-9.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/elisp/falias.scm:
	* module/language/tree-il.scm:
	* module/language/tree-il/primitives.scm:
	* module/rnrs/records/procedural.scm:
	* module/srfi/srfi-35.scm:
	* module/system/base/syntax.scm: Change uses of make-struct to
	  make-struct/no-tail.

	psyntax generates calls to make-struct/no-tail
	* module/ice-9/psyntax.scm (define-expansion-constructors): Expand to
	  make-struct/no-tail.
	* module/ice-9/psyntax-pp.scm: Regenerate.

2017-09-14  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	GNU lightning 2.1.2 release

	Correct binutils version detection

	GNU lightning 2.1.1 release

	Update copyright year

2017-09-14  Andy Wingo  <wingo@pobox.com>

	Document class redefinition change
	* doc/ref/goops.texi (Redefinable Classes): New subsection.
	  (Default Class Redefinition Behaviour)
	  (Changing the Class of an Instance): Update for class redefinition
	  change.
	* NEWS: Add 2.3.0 section.

	Remove "redefined" class slot
	* module/oop/goops.scm (fold-class-slots): Remove "redefined" field from
	  class objects.  Redefinable classes are now handled in a layer on top
	  of GOOPS core.

	remove self field of vtables
	* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT, scm_vtable_index_self):
	  Remove "self" field.  Renumber the other fields.
	* module/oop/goops.scm (<self-slot>): Remove.
	  (fold-class-slots): Adapt for "self" slot removal.  Adapt all users.
	  (class-redefinition): Now that there is no "self" slot to update, use
	  %modify-instance instead of %modify-class.
	* libguile/goops.c (class_self): Remove.
	  (scm_sys_modify_class): Remove.
	* libguile/goops.h (scm_sys_modify_class): Remove.
	* module/rnrs/records/procedural.scm: Import vtable-offset-user.
	  Renumber rtd indexes using vtable-offset-user.
	* module/srfi/srfi-35.scm (%condition-type-vtable): Remove mention of
	  vtable fields.
	* module/system/base/types.scm (address->inferior-struct): Adapt for
	  different vtable field layout.

	Remove indirection in structs
	* libguile/gc.c (scm_storage_prehistory): Register struct displacement
	  here.
	* libguile/goops.c (scm_sys_modify_instance): Fix the format of a
	  comment.
	* libguile/modules.c (scm_post_boot_init_modules): Update for new format
	  of struct vtable references.
	* libguile/struct.c (scm_i_alloc_struct): Update to include slots
	  directly, instead of being indirected by an embedded pointer.
	  (scm_c_make_structv, scm_allocate_struct, scm_i_make_vtable_vtable):
	  Adapt to pass vtable bits as argument to scm_i_alloc_struct, not
	  vtable data bits.
	  (scm_init_struct): Remove two-word displacement from libgc.
	* libguile/struct.h: Update comment.
	  (SCM_STRUCT_SLOTS, SCM_STRUCT_DATA): Update definitions.
	  (SCM_STRUCT_VTABLE_DATA, SCM_STRUCT_VTABLE_SLOTS): Remove.
	  (SCM_STRUCT_VTABLE, SCM_STRUCT_LAYOUT, SCM_STRUCT_PRINTER)
	  (SCM_STRUCT_FINALIZER, SCM_STRUCT_VTABLE_FLAGS)
	  (SCM_STRUCT_VTABLE_FLAG_IS_SET): Simplify definitions.
	* module/system/base/types.scm (cell->object, address->inferior-struct):
	  Adapt to struct representation change.

	Implement class redefinition on top of fixed structs
	* libguile/struct.h: Steal another flag for GOOPS.
	* libguile/goops.h (SCM_VTABLE_FLAG_GOOPS_INDIRECT)
	  (SCM_VTABLE_FLAG_GOOPS_NEEDS_MIGRATION): New flags.
	  (SCM_CLASSF_GOOPS_VALID, SCM_CLASSF_GOOPS_OR_VALID): Remove obsolete
	  definitions.
	  (SCM_IS_A_P): Use the scm_class_of function.
	* libguile/goops.c (var_class_of_obsolete_indirect_instance): Rename
	  from var_migrate_instance.
	  (scm_is_generic, scm_is_method, scm_sys_init_layout_x): Use
	  scm_class_of instead of the SCM_CLASS_OF macro.
	  (get_indirect_slots): New helper.
	  (scm_class_of): This patch moves us in a direction where we won't be
	  able to separately address a struct's data and its identity.
	  Therefore to check whether a class needs migration, we check an
	  embedded pointer from a slot instead of the vtable data.
	  (scm_sys_struct_data): Remove this temporary function.
	  (scm_sys_modify_instance): Update to swap slot values instead of the
	  data pointers themselves.
	  (scm_sys_modify_class): Use scm_sys_modify_instance.
	  (scm_sys_goops_loaded): Capture class-of-obsolete-indirect-instance
	  instead of migrate-instance.
	  (scm_init_goops_builtins): Don't export the "valid" flag any more;
	  export instead the "indirect" and "needs-migration" flags.
	* libguile/foreign-object.c (scm_assert_foreign_object_type): Add a
	  FIXME.
	* libguile/vm-engine.c (class-of): Take away fast path for the time
	  being.
	* module/oop/goops.scm (class-has-indirect-instances?)
	  (indirect-slots-need-migration?): New helpers.
	  (<class>, <slot>, %class-slot-definition, initialize): Remove use of
	  vtable-flag-goops-valid.
	  (define-class): Always push redefined values through
	  `class-redefinition'.
	  (<redefinable-class>): New public definition.  Use it as a metaclass
	  for redefinable classes.  Provide a compute-slots function that
	  declares the indirect slots mechanism.  Add the "indirect" flag to
	  instances of <redefinable-class>.  Create indirect-slots objects for
	  instances of those classes as part of their allocate-instance.
	  (change-object-class, class-of-obsolete-indirect-instance): Update for
	  new representation change.
	* test-suite/tests/goops.test ("object update"): Add #:metaclass
	  <redefinable-class> to all redefinable classes.  For the "hell" test,
	  make the new classes with class-direct-slots, not class-slots; this
	  was an error in the test.

	Change name of "static" flag indicating static slot allocation
	* libguile/goops.h (SCM_VTABLE_FLAG_GOOPS_STATIC_SLOT_ALLOCATION):
	  Rename from SCM_VTABLE_FLAG_GOOPS_STATIC.
	* libguile/goops.c (scm_init_goops_builtins): Adapt.
	* module/oop/goops.scm (class-has-statically-allocated-slots?):
	  (initialize): Adapt.

	GOOPS instance migration implemented in Scheme
	* libguile/goops.c (scm_class_of): Call out directly to the GOOPS-local
	  `migrate-instance' if an instance needs to migrate.
	  (scm_sys_struct_data): New internal temporary function used by the
	  Scheme `migrate-instance'.  Exorcise the evil one from the old C
	  implementation.
	* libguile/goops.h (scm_change_object_class): Remove function used only
	  internally in GOOPS.
	* module/oop/goops.scm (migrate-instance): Implement the
	  hell/purgatory/etc logic in Scheme instead of C.

2017-09-13  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Adapt for binutils 2.29
		* configure.ac: Add check for binutils 2.29 prototype to the
		disassembler function.
		* lib/jit_disasm.c: Adapt for binutils 2.29 change.

2017-07-31  Mark H Weaver  <mhw@netris.org>

	put-bytevector, unget-bytevector: Allow start == bytevector length.
	* libguile/r6rs-ports.c (scm_put_bytevector, scm_unget_bytevector): When
	three arguments (port bv start) are provided, allow start to be equal to
	the length of the bytevector, resulting in a zero-length write.

2017-06-15  Ludovic Courtès  <ludo@gnu.org>

	Correctly relativize file names in the presence of common prefixes.
	* libguile/filesys.c (scm_i_relativize_path): When DIR is a prefix of
	SCANON, make sure DIR ends with a separator or SCANON starts with a
	separator.
	* test-suite/tests/ports.test (%temporary-directory): New variable.
	("%file-port-name-canonicalization")["relative canonicalization with
	common prefixes"]: New test.

2017-06-12  Mark H Weaver  <mhw@netris.org>

	doc: Document 'short' and 'unsigned-short' foreign types.
	This is a followup to commit 42f7c01e0a1d1c139ec8b835429a80ab15ac4007.
	Reported by Adriano Peluso <catonano@gmail.com>.

	* doc/ref/api-foreign.texi (Foreign Types): Add missing entries for
	'short' and 'unsigned-short'.

2017-05-31  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.2'

	Update guile.m4 to check for 2.2 by default
	* meta/guile.m4 (GUILE_PKG): Update default Guile versions to 2.2.

	guile.m4 fix for 3.0 prereleases
	* meta/guile.m4 (GUILE_PROGS): Allow prereleases of Guile with a new
	  major version.

	guile.m4 fix for 3.0 prereleases
	* meta/guile.m4 (GUILE_PROGS): Allow prereleases of Guile with a new
	  major version.

2017-05-22  Andy Wingo  <wingo@pobox.com>

	Update uri? documentation.
	* doc/ref/web.texi (URIs): Update uri? documentation for deprecation
	  removal.

	Remove support for legacy syntax objects.
	* module/ice-9/psyntax.scm: Remove support for legacy syntax objects.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/ice-9/deprecated.scm (allow-legacy-syntax-objects?): New
	  deprecation.
	* module/ice-9/boot-9.scm: Don't define allow-legacy-syntax-objects?.
	* doc/ref/api-macros.texi: Remove documentation for
	  allow-legacy-syntax-objects?.

	Update effective version to 3.0
	* GUILE-VERSION: Bump version to 2.3.0, and effective version to 3.0.
	* .gitignore:
	* README:
	* doc/guile.1:
	* doc/ref/api-evaluation.texi:
	* doc/ref/api-options.texi:
	* doc/ref/guile-invoke.texi:
	* doc/ref/libguile-foreign-objects.texi:
	* doc/ref/libguile-parallel.texi:
	* doc/ref/srfi-modules.texi: Update to 3.0.
	* libguile/_scm.h (SCM_OBJCODE_MAJOR_VERSION):
	(SCM_OBJCODE_MINIMUM_MINOR_VERSION, SCM_OBJCODE_MINOR_VERSION): Bump
	bytecode version for fallback path.
	* libguile/loader.c: Update to avoid loading version 2.2 bytecode
	files.
	* meta/guile-3.0-uninstalled.pc.in:
	* meta/guile-3.0.pc.in: Rename.
	* module/system/vm/assembler.scm (*bytecode-major-version*):
	(*bytecode-minor-version*): Write the new bytecode version.

	Remove all deprecated code
	* module/ice-9/debug.scm:
	* module/ice-9/mapping.scm:
	* module/ice-9/syncase.scm: Delete these deprecated files.
	* module/Makefile.am: Remove deleted files.
	* libguile/deprecated.c:
	* libguile/deprecated.h:
	* libguile/backtrace.c:
	* libguile/goops.c:
	* libguile/numbers.c:
	* libguile/socket.c:
	* libguile/srfi-13.c:
	* module/ice-9/deprecated.scm:
	* module/ice-9/format.scm:
	* module/oop/goops.scm:
	* module/statprof.scm:
	* module/texinfo/reflection.scm:
	* module/web/client.scm:
	* module/web/uri.scm: Remove deprecated code.

	Minor updates of README.
	* README: Minor updates.

	Remove legacy NEWS.guile-vm.
	* NEWS.guile-vm: Remove.

	Minor updates to HACKING.
	* HACKING: Minor updates.

	Remove outdated ANNOUNCE.
	* ANNOUNCE: Remove outdated file.

	Remove outdated README.guile-vm.
	* README.guile-vm: Remove.

2017-05-21  Andy Wingo  <wingo@pobox.com>

	web: add support for URI-reference
	Based on a patch by Daniel Hartwig <mandyke@gmail.com>.

	* NEWS: Update.
	* doc/ref/web.texi (URIs): Fragments are properly part of a URI, so
	  remove the incorrect note.  Add documentation on URI subtypes.
	* module/web/uri.scm (uri-reference?): New base type predicate.
	  (uri?, relative-ref?): Specific predicates.
	  (validate-uri-reference): Strict validation.
	  (validate-uri, validate-relative-ref): Specific validators.
	  (build-uri-reference, build-relative-ref): New constructors.
	  (string->uri-reference): Rename from string->uri.
	  (string->uri, string->relative-ref): Specific constructors.
	  (uri->string): Add #:include-fragment? keyword argument.
	* module/web/http.scm (parse-request-uri): Use `build-uri-reference',
	  and result is a URI-reference, not URI, object.  No longer infer an
	  absent `uri-scheme' is `http'.
	  (write-uri): Just use `uri->string'.
	  (declare-uri-header!): Remove unused function.
	  (declare-uri-reference-header!): Update.  Rename from
	  `declare-relative-uri-header!'.
	* test-suite/tests/web-uri.test ("build-uri-reference"):
	  ("string->uri-reference"): Add.
	  ("uri->string"): Also tests for relative-refs.
	* test-suite/tests/web-http.test ("read-request-line"):
	  ("write-request-line"): Update for no scheme in some URIs.
	  ("entity headers", "request headers"): Content-location, Referer, and
	  Location should also parse relative-URIs.
	* test-suite/tests/web-request.test ("example-1"): Expect URI-reference
	  with no scheme.

2017-05-17  Andy Wingo  <wingo@pobox.com>

	readline: Avoid interpreting control characters in pastes.
	* NEWS: Update.
	* doc/ref/repl-modules.texi (Readline Options): Update for
	  bracketed-paste.
	* guile-readline/readline.h (SCM_READLINE_BRACKETED_PASTE): Add
	  bracketed-paste option.
	* guile-readline/readline.c (scm_readline_opts): Add bracketed-paste.
	  (scm_init_readline): Wire up the logic.

2017-05-16  Manolis Ragkousis  <manolis837@gmail.com>

	On Hurd, skip tests that require working setrlimits for memory
	On Hurd, setrlimits are not yet implemented. See
	<https://lists.gnu.org/archive/html/bug-hurd/2017-05/msg00013.html>.

	* test-suite/standalone/test-out-of-memory: skip for Hurd.
	* test-suite/standalone/test-stack-overflow: skip for Hurd.

2017-05-09  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add a second pass to compute live register ranges
		* include/lightning/jit_private.h, lib/lightning.c: Add a
		second pass from start when computing register live ranges.
		This should be used temporarily, and is required for certain
		loop constructs, with several consecutive blocks not referencing
		a live register.

2017-04-28  Andy Wingo  <wingo@pobox.com>

	Fix reading of HTTPS responses that are smaller than port buffer
	* module/web/client.scm (tls-wrap): Use get-bytevector-some instead of
	  get-bytevector-n, to prevent Guile from attempting to read more bytes
	  than are available.  Normally trying to read data on a shut-down
	  socket is fine, but but gnutls issues an error if you attempt to read
	  data from a shut-down socket, and that appears to be a security
	  property.  Fixes HTTPS requests whose responses are smaller than the
	  port buffer.

2017-04-25  Zefram  <zefram@fysh.org>

	Correct note about Gregorian reform in SRFI-19
	* doc/ref/srfi-modules.texi (SRFI-19): SRFI-19 specifies proleptic use
	of the Gregorian calendar, so it was incorrect of the documentation to
	describe the code as erroneous in doing so.  Rewrite the caution more
	neutrally, and move it to the section about the "date" structure, where
	it seems most relevant.

2017-04-22  Ludovic Courtès  <ludo@gnu.org>

	SRFI-19: Swap seconds and nanoseconds in 'current-time-monotonic'.
	* module/srfi/srfi-19.scm (current-time-monotonic): Swap the 2nd and 3rd
	arguments.  Fixes a regression introduced in
	commit b11e2922c36c4105797c269c7e616535b702698a.

2017-04-21  Andy Wingo  <wingo@pobox.com>

	Bump version to 2.2.2.
	* GUILE-VERSION: Bump to 2.2.2.

	Update NEWS some more
	* NEWS: More updates.

	Update NEWS.
	* NEWS: Update.

	Syntax objects are comparable with equal?
	* libguile/eq.c (scm_equal_p, scm_raw_ihash): Add cases for syntax
	  objects, which should be comparable with equal?.
	* test-suite/tests/syntax.test ("syntax objects"): Add tests.

2017-04-20  Thomas Danckaert  <thomas.danckaert@gmail.com>

	SRFI-37: Account for zero-length arguments.
	* module/srfi/srfi-37.scm (args-fold): When checking if an argument is
	an option (starts with #\-), first check if the length is non-zero.

2017-04-20  Andy Wingo  <wingo@pobox.com>

	Restore libgc 7.2 compatibility
	* configure.ac: Check for GC_is_heap_ptr, added after libgc 7.2.
	* libguile/pairs.h (GC_is_heap_ptr): Define a shim for GC_is_heap_ptr,
	  inside BUILDING_LIBGUILE so as not to expose it to users.

2017-04-19  Andy Wingo  <wingo@pobox.com>

	GNU Guile 2.2.1.
	* GUILE-VERSION (GUILE_MICRO_VERSION, LIBGUILE_INTERFACE_CURRENT):
	  (LIBGUILE_INTERFACE_AGE): Increment version.

	Update release docs
	* doc/release.org: Update for 2.2.

	Update NEWS
	* NEWS: Update.

2017-04-19  Sergei Trofimovich  <slyfox@gentoo.org>

	guile-snarf: skip -g* arguments to avoid build failure
	* libguile/guile-snarf.in: skip -g* arguments to avoid failure on
	  -ggdb3.

	Bug: https://bugs.gentoo.org/608190
	Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25803

2017-04-19  Sergei Trofimovich  <slyfox@gentoo.org>

	api-procedures.texi: typo: 'an' -> 'on'
	* doc/ref/api-procedures.texi: Fix typo.

	Documentation typo tweak
	* doc/ref/api-data.texi: Tweak 'u+0007' to 'U+0007' (as in the rest of
	  the table).

2017-04-19  Andy Wingo  <wingo@pobox.com>

	Fix spurious warnings in net_db.c
	* libguile/guile-func-name-check (/^SCM_DEFINE /): Fix pattern to not
	  produce spurious warnings.  Thanks to Dale Smith for the suggestion.
	  Fixes https://bugs.gnu.org/26123.

2017-04-19  Freja Nordsiek  <fnordsie@gmail.com>

	Fixed bug: statprof flat display wasn't writing summary lines to port
	* module/statprof.scm (statprof-display/flat): fixed bug where summary lines
	  were written to (current-output-port) instead of the provided port.

2017-04-19  Andy Wingo  <wingo@pobox.com>

	Document guile-2.2 cond-expand feature.
	* doc/ref/srfi-modules.texi (SRFI-0): Mention guile-2.2 feature.

	Add --with-bdw-gc and update README
	* README: Update to 2.2.  Add instructions for FreeBSD based on notes
	  from Matt Wette.
	* configure.ac: Add --with-bdw-gc argument.

	Fix typo in fold-layout documentation
	* doc/ref/sxml.texi (SXML Tree Fold): Fix minor typo.  Fixes
	  https://bugs.gnu.org/26188.

	Add srfi-19 ~f regression test
	* test-suite/tests/srfi-19.test ("SRFI date/time library"): Add test for
	  https://bugs.gnu.org/26259.

	Fix date->string ~f operator to not emit leading zeros
	* module/srfi/srfi-19.scm (directives): Format ~f without leading
	  zeroes.  Fixes https://bugs.gnu.org/26260.
	* test-suite/tests/srfi-19.test ("SRFI date/time library"): Add test.

2017-04-19  Andrew Moss  <andrewmoss@pobox.com>

	Fixed bug: ~N mishandles small nanoseconds value
	Fixes <http://bugs.gnu.org/26261>.
	Reported by Zefram <zefram@fysh.org>.

	* module/srfi/srfi-19.scm ("define directives"): N padding increased from 7 to 9

	* test-suite/tests/srfi-19.test ("date->string"): New test.

2017-04-19  Andy Wingo  <wingo@pobox.com>

	SRFI-19 current-time-monotonic returns time of right type
	* module/srfi/srfi-19.scm (current-time-monotonic): Actually return a
	  time with the correct type.  Fixes #26329.

	Avoid causing GC when lookup up exception handler
	* libguile/fluids.c (scm_fluid_ref_star): Avoid causing GC.  Possibly
	  fixes some crashes during out-of-memory conditions (#26351).

	Fix test suite for constant literals change
	* test-suite/tests/elisp-compiler.test ("List Built-Ins"): Avoid
	  mutating a literal pair.  If this turns out to be necessary for elisp,
	  the compiler will have to compile literals to calls to run-time heap
	  allocations rather than constants.

2017-04-18  Andy Wingo  <wingo@pobox.com>

	Bump objcode version in a compatible way
	* libguile/_scm.h (SCM_OBJCODE_MINIMUM_MINOR_VERSION): New definition,
	  indicating the oldest objcode version that we support.
	  (SCM_OBJCODE_MINOR_VERSION): Bump.
	* libguile/loader.c (process_dynamic_segment): Support a range of
	  versions.
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.

	Add sandboxed evaluation facility
	* module/ice-9/sandbox.scm: New file.
	* module/Makefile.am (SOURCES): Add new file.
	* doc/ref/api-evaluation.texi (Sandboxed Evaluation): New section.
	* NEWS: Update.
	* test-suite/tests/sandbox.test: New file.
	* test-suite/Makefile.am: Add new file.

	Update NEWS
	* NEWS: Add note about constants and mutation.

	All literal constants are read-only
	* libguile/array-handle.c (initialize_vector_handle): Add mutable_p
	  argument.  Unless the vector handle is mutable, null out its
	  writable_elements member.
	  (scm_array_get_handle): Adapt to determine mutability of the various
	  arrays.
	  (scm_array_handle_elements, scm_array_handle_writable_elements):
	  Reverse the sense: instead of implementing read-only in terms of
	  read-write, go the other way around, adding an assertion in the
	  read-write case that the array handle is mutable.
	* libguile/array-map.c (racp): Assert that the destination is mutable.
	* libguile/bitvectors.c (SCM_F_BITVECTOR_IMMUTABLE, IS_BITVECTOR):
	  (IS_MUTABLE_BITVECTOR): Add a flag to indicate immutability.
	  (scm_i_bitvector_bits): Fix indentation.
	  (scm_i_is_mutable_bitvector): New helper.
	  (scm_array_handle_bit_elements)
	  ((scm_array_handle_bit_writable_elements): Build writable_elements in
	  terms of elements.
	  (scm_bitvector_elements, scm_bitvector_writable_elements): Likewise.
	  (scm_c_bitvector_set_x): Require a mutable bitvector for the
	  fast-path.
	  (scm_bitvector_to_list, scm_bit_count): Use read-only elements()
	  function.
	* libguile/bitvectors.h (scm_i_is_mutable_bitvector): New decl.
	* libguile/bytevectors.c (INTEGER_ACCESSOR_PROLOGUE):
	  (INTEGER_GETTER_PROLOGUE, INTEGER_SETTER_PROLOGUE):
	  (INTEGER_REF, INTEGER_NATIVE_REF, INTEGER_SET, INTEGER_NATIVE_SET):
	  (GENERIC_INTEGER_ACCESSOR_PROLOGUE):
	  (GENERIC_INTEGER_GETTER_PROLOGUE, GENERIC_INTEGER_SETTER_PROLOGUE):
	  (LARGE_INTEGER_NATIVE_REF, LARGE_INTEGER_NATIVE_SET):
	  (IEEE754_GETTER_PROLOGUE, IEEE754_SETTER_PROLOGUE):
	  (IEEE754_REF, IEEE754_NATIVE_REF, IEEE754_SET, IEEE754_NATIVE_SET):
	  Setters require a mutable bytevector.
	  (SCM_BYTEVECTOR_SET_FLAG): New helper.
	  (SCM_BYTEVECTOR_SET_CONTIGUOUS_P, SCM_BYTEVECTOR_SET_ELEMENT_TYPE):
	  Remove helpers.
	  (SCM_VALIDATE_MUTABLE_BYTEVECTOR): New helper.
	  (make_bytevector, make_bytevector_from_buffer): Use
	  SCM_SET_BYTEVECTOR_FLAGS.
	  (scm_c_bytevector_set_x, scm_bytevector_fill_x)
	  (scm_bytevector_copy_x): Require a mutable bytevector.
	* libguile/bytevectors.h (SCM_F_BYTEVECTOR_CONTIGUOUS)
	  (SCM_F_BYTEVECTOR_IMMUTABLE, SCM_MUTABLE_BYTEVECTOR_P): New
	  definitions.
	* libguile/bytevectors.h (SCM_BYTEVECTOR_CONTIGUOUS_P): Just access one
	  bit.
	* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): Implement
	  writable_elements() in terms of elements().
	* libguile/strings.c (scm_i_string_is_mutable): New helper.
	* libguile/uniform.c (scm_array_handle_uniform_elements):
	  (scm_array_handle_uniform_writable_elements): Implement
	  writable_elements in terms of elements.
	* libguile/vectors.c (SCM_VALIDATE_MUTABLE_VECTOR): New helper.
	  (scm_vector_elements, scm_vector_writable_elements): Implement
	  writable_elements in terms of elements.
	  (scm_c_vector_set_x): Require a mutable vector.
	* libguile/vectors.h (SCM_F_VECTOR_IMMUTABLE, SCM_I_IS_MUTABLE_VECTOR):
	  New definitions.
	* libguile/vm-engine.c (VM_VALIDATE_MUTABLE_BYTEVECTOR):
	  (VM_VALIDATE_MUTABLE_VECTOR, vector-set!, vector-set!/immediate)
	  (BV_BOUNDED_SET, BV_SET): Require mutable bytevector/vector.
	* libguile/vm.c (vm_error_not_a_mutable_bytevector):
	  (vm_error_not_a_mutable_vector): New definitions.
	* module/system/vm/assembler.scm (link-data): Mark residualized vectors,
	  bytevectors, and bitvectors as being read-only.

	Attempt to mutate residualized literal pair throws exception
	* libguile/validate.h (SCM_VALIDATE_MUTABLE_PAIR):
	* libguile/pairs.h (scm_is_mutable_pair): New internal definitions.
	* libguile/pairs.c (scm_set_car_x, scm_set_cdr_x): Validate mutable
	  pairs.
	* libguile/alist.c (scm_assq_set_x, scm_assv_set_x, scm_assoc_set_x):
	* libguile/list.c (scm_reverse_x, scm_list_set_x, scm_list_cdr_set_x):
	* libguile/srcprop.c (scm_make_srcprops):
	* libguile/srfi-1.c (scm_srfi1_append_reverse_x)
	  (scm_srfi1_delete_duplicates_x):
	* libguile/symbols.c (scm_symbol_fset_x, scm_symbol_pset_x):
	* libguile/sort.c (scm_merge_list_x): Use scm_set_car_x / scm_set_cdr_x
	  instead of the macros, so as to check for mutable pairs.
	  (SCM_VALIDATE_MUTABLE_LIST): New internal helper macro.
	  (scm_sort_x, scm_stable_sort_x, scm_sort_list_x): Use
	  SCM_VALIDATE_MUTABLE_LIST.
	* libguile/vm-engine.c (VM_VALIDATE_MUTABLE_PAIR): New definition.
	  (set-car!, set-cdr!): Use VM_VALIDATE_MUTABLE_PAIR.  Fix error message
	  for set-cdr!.

2017-04-14  Ludovic Courtès  <ludo@gnu.org>

	types: Hide one of the 'bytevector->string' procedures.
	* module/system/base/types.scm: Hide 'bytevector->string' from (rnrs io
	ports).

2017-04-04  Michael Gran  <spk121@yahoo.com>

	Only run tests that require fork if it is provided
	* test-suite/tests/00-repl-server.test (call-with-repl-server): throw if no fork provided
	* test-suite/tests/00-socket.test (primitive-fork-if-available): new help procedure
	  (bind/sockaddr, AF_UNIX/SOCK_STREAM): use helper func
	* test-suite/tests/ports.test ("pipe, fdopen, and line buffering"): throw if no fork provided

2017-04-03  Andy Wingo  <wingo@pobox.com>

	Speed up procedure-minimum-arity for fixed arity
	* libguile/programs.c (try_parse_arity): Add a case for
	  assert-nargs-ee/locals.

2017-04-01  Mike Gran  <spk121@yahoo.com>

	fix repl server test to allow for ECONNABORTED
	For some systems, ECONNABORTED is a failure condition for reading from closed sockets.

	* test-suite/tests/00-repl-server.test (HTTP inter-protocol attack): modified

2017-03-28  Andy Wingo  <wingo@pobox.com>

	Add allow-legacy-syntax-objects? parameter
	* module/ice-9/psyntax.scm (syntax?): Only recognize legacy syntax
	  objects if the new allow-legacy-syntax-objects? parameter is true.
	* module/ice-9/boot-9.scm (allow-legacy-syntax-objects?): New
	  parameter.
	* doc/ref/api-macros.texi (Syntax Transformer Helpers): Document the
	  horrible situation with legacy syntax objects.
	* NEWS: Add entry.

	Psyntax generates new syntax objects
	* module/ice-9/psyntax.scm (make-syntax-object): Change to make
	  new-style syntax objects.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/ice-9/compile-psyntax.scm (squeeze-syntax-object): Change to be
	  functional.
	  (squeeze-constant): Likewise.
	  (squeeze-tree-il): Likewise.
	  (translate-literal-syntax-objects): New pass.  The compiler can embed
	  literal syntax objects into compiled objects, but syntax can no longer
	  be read/written; otherwise users could forge syntax objects.  So for
	  the bootstrap phase, rewrite literal constants to calls to
	  make-syntax.

	Beginnings of psyntax switch to new syntax objects
	* module/ice-9/psyntax.scm: Baby steps towards support of a new
	  representation of syntax objects.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	Add disjoint syntax object type
	* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  (DOT_X_FILES, DOT_DOC_FILES, noinst_HEADERS): Add syntax.c and
	  syntax.h.
	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/goops.c (class_syntax, scm_class_of, scm_goops_early_init):
	* libguile/init.c (scm_init_guile):
	* libguile/print.c (iprin1):
	* libguile/tags.h (scm_tc7_syntax):
	* module/oop/goops.scm (<syntax>):
	* module/system/base/types.scm (%tc7-syntax, cell->object):
	* module/system/vm/disassembler.scm (code-annotation): Wire up the new
	  data type.
	* libguile/syntax.c:
	* libguile/syntax.h: New files.
	* module/ice-9/boot-9.scm: Move new definitions to (system syntax
	  internal).
	* module/system/syntax.scm (print-syntax): New helper.
	* module/system/vm/assembler.scm (statically-allocatable?)
	  (intern-constant, link-data): Arrange to be able to write syntax
	  objects into images.
	* module/language/cps/types.scm (&syntax): New type.  Remove
	  &hash-table; it was never detected, an internal binding, and we need
	  the bit to avoid going into bignum territory.

	Plumbing changes to rename "syntax-module"
	* module/ice-9/psyntax.scm (%syntax-module): Rename from syntax-module
	  in order to make room for a new syntax-module primitive binding.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/ice-9/boot-9.scm: Push syntax bindings into an internal
	  module.
	* module/system/syntax.scm: New file.
	* module/Makefile.am (SOURCES): Add system/syntax.scm.

2017-03-23  Mike Gran  <spk121@yahoo.com>

	Git ignore .exe files
	* .gitignore: add *.exe

2017-03-21  Mike Gran  <spk121@yahoo.com>

	i18n: add international sign positions to %locale-dump
	* module/ice-9/i18n.scm (%locale-dump): modified

	i18n: locale-positive-separated-by-space? should return bool, not string
	* libguile/i18n.c (scm_nl_langinfo): unpack INT_P_SEP_BY_SPACE as bool
	* test-suite/tests/i18n.test (nl-langinfo et al.): new tests

	i18n: add debugging helper procedure for locales
	* module/ice-9/i18n.scm (%locale-dump): new procedure

2017-03-20  Mike Gran  <spk121@yahoo.com>

	i18n: add tests for locale-digit-grouping
	* test-suite/tests/i18n.test ("nl-langinfo et al."): new tests

	i18n: add tests for locale AM/PM
	* test-suite/tests/i18n.test ("nl-langinfo et al."): new tests

	i18n: rename locale-monetary-digit-grouping to locale-monetary-grouping
	* module/ice-9/i18n.scm (locale-monetary-digit-grouping): renamed to locale-monetary grouping
	  (monetary-amount->locale-string): use renamed procedure
	* test-suite/tests/i18n.test (%french-locale): add LC_MONETARY
	  (%french-utf8-locale): add LC_MONETARY
	  ("nl-langinfo et al."): tests for locale-monetary-grouping

2017-03-17  Ludovic Courtès  <ludo@gnu.org>

	web: Avoid deprecated '_IOFBF'.
	* module/web/client.scm (open-socket-for-uri): Use 'block instead of
	_IOFBF.

	web: Remove export of nonexistent 'open-connection-for-uri'.
	* module/web/client.scm: Don't export 'open-connection-for-uri', which
	doesn't exist.

2017-03-15  Andy Wingo  <wingo@pobox.com>

	Add generic prebuilt links to dist.
	* prebuilt/Makefile.am (EXTRA_DIST): Add generic prebuilt links.

	Update --version and REPL copyright years
	* module/ice-9/command-line.scm (version-etc):
	* module/system/repl/common.scm (*version*): Update release year.

	GNU Guile 2.2.0.
	* GUILE-VERSION (GUILE_MINOR_VERSION, GUILE_MICRO_VERSION): Bump.
	  (LIBGUILE_INTERFACE_CURRENT): Incrememt to indicate that we now have a
	  defined libtool ABI "interface" of 1, that we support no other
	  interface (yet), and that this is the 0th revision of that interface.

2017-03-15  Freja Nordsiek  <fnordsie@gmail.com>

	GUILE_SITE_DIR: Update to find compiled site directories
	* meta/guile.m4 (GUILE_SITE_DIR): Update to find compiled site
	  directories.
	* meta/guile-2.2.pc.in: Add entry for site-ccache directory.

2017-03-14  Andy Wingo  <wingo@pobox.com>

	Better eval+promise+gc test
	* test-suite/tests/eval.test ("promises"): Increase clear pass rate on
	  this test.

	Resolve unresolved alist test cases
	* test-suite/tests/alist.test: Update unresolved cases to match current
	  behavior.  Bogus but stable :/

2017-03-14  Ludovic Courtès  <ludo@gnu.org>

	build: Compress with lzip too.
	* configure.ac: Add 'dist-lzip' Automake option.

2017-03-14  Freja Nordsiek  <fnordsie@gmail.com>

	Fixed reversed version order bug in GUILE_PROGS Autoconf macro.
	* meta/guile.m4 (GUILE_PROGS): Build version in correct order.

2017-03-14  Andy Wingo  <wingo@pobox.com>

	Update NEWS
	* NEWS: Update for 2.2.0.

	configure detects which set of prebuilt binaries to use
	* configure.ac: Use detected endianness and word size to automatically
	  select which set of prebuilt binaries to use.
	* meta/build-env.in (top_builddir):
	* meta/uninstalled-env.in (top_builddir): Update to use
	  SCM_PREBUILT_BINARIES for prebuilt entry in GUILE_LOAD_COMPILED_PATH.
	* prebuilt/32-bit-big-endian:
	* prebuilt/32-bit-little-endian:
	* prebuilt/64-bit-little-endian: New links.
	* prebuilt/x86_64-pc-linux-gnu: Remove this link now that it's unneeded.

2017-03-13  Andy Wingo  <wingo@pobox.com>

	Nonlocal prompt returns cause all effects
	* module/language/cps/effects-analysis.scm (expression-effects): Prompts
	  cause &all-effects.  I tried to limit this change to CSE but it was
	  actually LICM that was borked, so better to be conservative
	* test-suite/tests/control.test ("escape-only continuations"): Add
	  test.

2017-03-13  Andy Wingo  <wingo@pobox.com>

	Fix finalizer resuscitation causing excessive GC
	* libguile/finalizers.c (async_gc_finalizer):
	  (scm_i_register_async_gc_callback): Replace "weak gc callback"
	  mechanism with "async gc callback" mechanism.  Very similar but the
	  new API is designed to be called a bounded number of times, to avoid
	  running afoul of libgc heuristics.
	* libguile/weak-list.h: New internal header.
	* libguile/Makefile.am (noinst_HEADERS): Add weak-list.h.
	* libguile/weak-set.c (vacuum_all_weak_sets):
	  (scm_c_make_weak_set, scm_init_weak_set):
	* libguile/weak-table.c (vacuum_all_weak_tables):
	  (scm_c_make_weak_table, scm_init_weak_table): Arrange to vacuum all
	  weak sets from a single async GC callback, and likewise for weak
	  tables.

	Thanks to Ludovic Courtès for tracking this bug down!

2017-03-10  Andy Wingo  <wingo@pobox.com>

	Guile 2.1.8.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.

	Revert "Fix "Scheme Syntax" info rendering"
	This reverts commit 62f08b8f38990c1849ea61cd622f84b3d2611cd9, which was
	causing failing texi2dvi runs.

	Update NEWS
	* NEWS: Update for 2.1.8.

	Fix atomics compilation on clang
	* libguile/atomics-internal.h (scm_atomic_subtract_uint32):
	  (scm_atomic_compare_and_swap_uint32, scm_atomic_set_pointer):
	  (scm_atomic_ref_pointer, scm_atomic_set_scm):
	  (scm_atomic_ref_scm, scm_atomic_swap_scm):
	  (scm_atomic_compare_and_swap_scm): Use C11 atomic types if we have
	  loaded C11 stdatomic.h.

2017-03-09  Vladislav Ivanishin  <vladislav.ivanishin@gmail.com>

	Fix a couple of typos in the docs
	* doc/ref/scheme-ideas.texi: the some way -> the same way
	* doc/ref/scheme-intro.texi: Use @math inside a texinfo command (turns out
	  $math$ is not processed in this context and thus is not rendered correctly).

2017-03-09  Andy Wingo  <wingo@pobox.com>

	VM support for string-set!; slimmer read-string
	* doc/ref/vm.texi (Inlined Scheme Instructions): Add string-set!.
	* libguile/vm-engine.c (string-set!): New opcode.
	* module/ice-9/rdelim.scm (read-string): Reimplement in terms of a
	  geometrically growing list of strings, to reduce total heap usage when
	  reading big files.
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  string-set! support.
	* module/language/cps/types.scm (string-set!): Update for &u64 index.
	* module/language/tree-il/compile-cps.scm (convert): Unbox index to
	  string-set!.
	* module/system/vm/assembler.scm (system): Export string-set!.

	Micro-optimize update-port-position.
	* libguile/ports.c (update_port_position): Only fetch line if we need to
	  increment it.

2017-03-09  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix bug in comparison between real and complex
	This bug was introduced by 35a90592501ebde7e7ddbf2486ca9d315e317d09.

	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Check that both operands are real as a condition for
	  specialize-f64-comparison.
	* test-suite/tests/numbers.test: Add test.

2017-03-09  Andy Wingo  <wingo@pobox.com>

	Remove contification restriction in case-lambda
	* module/language/cps/compile-bytecode.scm (compile-function): Check for
	  fallthrough after $kclause too; possible to need to jump if clause
	  tails are contified.
	* module/language/cps/contification.scm (compute-contification-candidates):
	  Enable inter-clause contification.

	All clauses of function have same nlocals
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/slot-allocation.scm ($allocation)
	  (lookup-nlocals, compute-frame-size, allocate-slots): Adapt to
	  have one frame size per function, for all clauses.

	Adapt gcprof to preemptive interrupts
	* module/statprof.scm (gcprof): Remove handle-interrupts trampoline from
	  captured stacks.

	Adapt statprof to new preemptive interrupts
	* module/statprof.scm (profile-signal-handler): Cut an additional stack
	  frame, corresponding to the handle-interrupts trampoline added
	  recently.

2017-03-09  Ludovic Courtès  <ludo@gnu.org>

	statprof: 'with-statprof' honors #:display-style.
	* module/statprof.scm (with-statprof): Pass #:display-style to 'statprof'.

2017-03-08  Andy Wingo  <wingo@pobox.com>

	64KB segment alignment
	* module/system/vm/linker.scm (*lcm-page-size*): Rename
	  from *page-size*, change to 64 KB.
	* libguile/loader.c (load_thunk_from_memory): Only require page size
	  alignment, knowing that although Guile might emit ELF with 64k
	  alignment, it only really needs page alignment.

2017-03-07  Andy Wingo  <wingo@pobox.com>

	Fix new thread-local fluids test
	* test-suite/tests/fluids.test ("dynamic states"): Fix test.

	Fix documentation build
	* doc/ref/api-control.texi (Fluids and Dynamic States): Fix link.

	Add thread local fluids
	* libguile/fluids.h (struct scm_dynamic_state): Add thread_local_values
	  table.  Thread locals are flushed to a separate thread-local table.
	  The references are strong references since the table never escapes the
	  thread.
	  (scm_make_thread_local_fluid, scm_fluid_thread_local_p): New
	  functions.
	* libguile/fluids.c (FLUID_F_THREAD_LOCAL):
	  (SCM_I_FLUID_THREAD_LOCAL_P): New macros.
	  (restore_dynamic_state): Add comment about precondition.
	  (save_dynamic_state): Flush thread locals.
	  (scm_i_fluid_print): Print thread locals nicely.
	  (new_fluid): Add flags arg.
	  (scm_make_fluid, scm_make_fluid_with_default, scm_make_unbound_fluid):
	  Adapt.
	  (scm_make_thread_local_fluid, scm_fluid_thread_local_p): New
	  functions.
	  (fluid_set_x): Special flushing logic for thread-locals.
	  (fluid_ref): Special cache miss logic for thread locals.
	* libguile/stacks.c (scm_init_stacks):
	* libguile/throw.c (scm_init_throw): %stacks and %exception-handler are
	  thread-locals.
	* libguile/threads.c (guilify_self_2): Init thread locals table.
	* test-suite/tests/fluids.test ("dynamic states"): Add test.
	* doc/ref/api-control.texi (Fluids and Dynamic States): Add link to
	  Thread-Local Variables.
	* doc/ref/api-scheduling.texi (Thread Local Variables): Update with real
	  thread-locals.
	* NEWS: Update.

2017-03-07  Mark H Weaver  <mhw@netris.org>
	    Ludovic Courtès  <ludo@gnu.org>

	psyntax: Generate identifiers in a deterministic fashion.
	Fixes <http://bugs.gnu.org/20272>.

	* module/ice-9/boot-9.scm (module-generate-unique-id!)
	(module-gensym): New procedures.
	(module): Add 'next-unique-id' field.
	(the-root-module): Inherit 'next-unique-id' value from early stub.
	(make-module, make-autoload-interface): Adjust calls to
	module-constructor.
	* module/ice-9/psyntax.scm (gen-label, new-mark): Generate unique
	identifiers from the module name and the per-module unique-id.
	(build-lexical-var, generate-temporaries): Use
	'module-gensym' instead of 'gensym'.
	* module/ice-9/psyntax-pp.scm: Regenerate.
	* module/language/tree-il/fix-letrec.scm (fix-letrec!): Use
	'module-gensym' instead of 'gensym'.
	* module/system/base/syntax.scm (define-record): Likewise.
	(transform-record): Likewise.

2017-03-07  Mike Gran  <spk121@yahoo.com>

	Check for working profiling and virtual itimers
	* configure.ac (HAVE_USABLE_GETITIMER_PROF, HAVE_USABLE_GETITIMER_VIRTUAL): new tests
	* doc/ref/posix.texi (setitimer, getitimer): document provided? 'ITIMER_VIRTUAL and 'ITIMER_PROF
	* doc/ref/statprof.texi (statprof): document ITIMER_PROF requirements
	* libguile/scmsigs.c (scm_setitimer, scm_getitimer): document (provided? 'ITIMER_VIRTUAL) and (provided? 'ITIMER_PROF)
	  (scm_init_scmsigs): add features ITIMER_VIRTUAL and ITIMER_PROF
	* test-suite/tests/asyncs.test ("prevention via sigprof"): throw when unsupported
	* test-suite/tests/signals.test: throw when not supported
	* test-suite/tests/statprof.test: throw when not supported

2017-03-05  Mike Gran  <spk121@yahoo.com>

	Can't recursively search DLLs with FFI on Cygwin
	* doc/ref/api-foreign.text (dynamic-link): document problems with recursive DLLs.
	* test-suite/standalone/test-ffi (global): with Cygwin, dynamic-link C library explicitly
	* test-suite/standalone/test-foreign-object-scm (libc-ptr): with Cygwin, link C library explicitly
	* test-suite/tests/foreign.test (qsort): with Cygwin, link C library explicitly

2017-03-05  Mike Gran  <spk121@yahoo.com>

	Disable Turkish locale tests on Cygwin
	Cygwin's support of Turkish casing rules is broken.

	* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved): modified

2017-03-03  Mike Gran  <spk121@yahoo.com>

	Fix regression in non-mmap fallback elf loader
	* libguile/loader.c [!HAVE_SYS_MMAN_H] (map_file_contents): updated
	  variables and function calls to the current names

2017-03-03  Mike Gran  <spk121@yahoo.com>

	Cygwin: skip tests that require working setrlimits for memory
	On Cygwin, setrlimits cannot be used to set total memory availabe
	for a process.

	* test-suite/standalone/test-out-of-memory: skip for cygwin
	* test-suite/standalone/test-stack-overflow: skip for cygwin

2017-03-02  Andy Wingo  <wingo@pobox.com>

	Revert "build: Compress with lzip too."
	This reverts commit 89ce9fb31b00f1f243fe6f2450db50372cc0b86d.  It was
	causing the hydra builds to fail.

2017-03-01  Andy Wingo  <wingo@pobox.com>

	Fix makeinfo warnings
	* doc/ref/api-languages.texi (Nil):
	* doc/ref/statprof.texi (Statprof): Use headings instead of sections to
	  avoid makeinfo warnings.

	Remove useless subsection from hooks documentation
	* doc/ref/api-utility.texi (Hook Reference): Remove useless "handling
	  hooks from C" section that was also generating warnings.

	Fix scheme-scripts markup.
	* doc/ref/scheme-scripts.texi (Scripting Examples): Fix $@ rendering in
	  texinfo.

	Update NEWS for prerelease.
	* NEWS: Update for next prerelease.

	Update NEWS
	* NEWS: Update 2.0.x NEWS.  Fold 2.1.7 NEWS into main 2.2 body.

2017-03-01  Arne Babenhauserheide  <arne_bab@web.de>
	    Ludovic Courtès  <ludo@gnu.org>

	doc: Describe -e (module) on equal footing with (@ ...).
	* doc/ref/guile-invoke.texi, doc/ref/scheme-scripts.texi:
	describe the -e (module) shorthand as on equal footing with (@ ...)

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	i18n: 'number->locale-string' guesses the minimum number of decimals.
	This feature was removed by 4aead68cdb86ca60cc372f0cd558cadda90ddec5.

	* module/ice-9/i18n.scm (number-decimal-string): Rewrite the case where
	DIGIT-COUNT is not an integer.
	(number->locale-string): Always pass FRACTION-DIGITS to
	'number-decimal-string'.
	* test-suite/tests/format.test ("~h localized number")["1234.5"]
	["padding", "padchar"]: Remove decimal specifier.
	* test-suite/tests/i18n.test ("number->locale-string")
	["fraction",
	* test-suite/tests/i18n.test ("format ~h")["12 345,678"]: Remove decimal
	specifier.  Remove one decimal.
	* doc/ref/api-i18n.texi (Number Input and Output): Update
	'number->locale-string' doc to mention the number of decimals.

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	i18n: Fix corner cases for monetary and number string conversions.
	Fixes <http://bugs.gnu.org/24990>.
	Reported by Martin Michel <dev@famic.de>.

	* module/ice-9/i18n.scm (integer->string, number-decimal-string): New
	procedures.
	(monetary-amount->locale-string): Use them instead of 'number->string'
	followed by 'string-split'.
	(number->locale-string): Likewise.
	* test-suite/tests/i18n.test ("number->locale-string")["fraction"]: Add
	second argument to 'number->locale-string'.
	["fraction, 1 digit"]: Round up.
	["fraction, 10 digits", "trailing zeros", "negative integer"]: New
	tests.
	* test-suite/tests/i18n.test ("format ~h"): Pass the number of decimals
	for ~h.
	("monetary-amount->locale-string")["French"]: Always expect two decimals
	after the comma.
	["one cent", "very little money"]: New tests.
	* test-suite/tests/format.test ("~h localized number")["1234.5"]:
	Specify the number of decimals explicitly.
	["padding"]: Expect zero decimals.
	["padchar"]: Ask for one decimal.
	["decimals", "locale"]: Adjust rounding.

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	tests: Choose a more plausible US English locale name.
	* test-suite/tests/i18n.test (%american-english-locale-name): Change to
	en_US.utf8".

	tests: Use 'pass-if-equal' for (ice-9 i18n) tests.
	* test-suite/tests/i18n.test ("number->locale-string")
	("format ~h", "monetary-amount->locale-string"): Use 'pass-if-equal'
	instead of 'pass-if'.

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	i18n: Do not represent zero as "-0".
	Partly fixes <http://bugs.gnu.org/24990>.
	Reported by Martin Michel <dev@famic.de>.

	* module/ice-9/i18n.scm (monetary-amount->locale-string): Don't negate
	AMOUNT when it's zero.
	(number->locale-string): Likewise.
	* test-suite/tests/i18n.test ("number->locale-string")["positive inexact
	zero, 1 digit"]: New test.
	("monetary-amount->locale-string")["positive inexact zero"]: New test.

2017-03-01  John Paul Adrian Glaubitz  <glaubitz@physik.fu-berlin.de>

	Recognize sh3 as compilation targets
	* module/system/base/target.scm (cpu-endianness, triplet-pointer-size):
	  Add case for "sh3".

2017-03-01  Georgi Kirilov  <kirilov.georgi.s@gmail.com>

	doc: Fix typo in site packages documentation.
	* doc/ref/scheme-using.texi (Installing Site Packages): Fix typo

	doc: Fix typo in keywords documentation.
	* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	tests: Avoid statprof test failure on systems without 'setitimer'.
	Partly fixes <http://bugs.gnu.org/25463>.
	Reported by rennes@openmailbox.org.

	* test-suite/tests/statprof.test ("return values"): Wrap in
	'when-implemented'.

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	build: Honor $SOURCE_DATE_EPOCH for the recorded timestamp.
	Reported by Jan Nieuwenhuizen <janneke@gnu.org>
	at <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20272#36>.

	* libguile/Makefile.am (libpath.h): Honor 'SOURCE_DATE_EPOCH'.

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	scandir: Avoid 'stat' calls on each entry.
	* module/ice-9/ftw.scm (scandir): Rewrite in terms of 'readdir'.

	build: Compress with lzip too.
	* configure.ac: Add 'dist-lzip' Automake option.

	build: Check for /gnu/store file names upon "make dist".
	* Makefile.am (assert-no-store-file-names): New rule, taken from Guix.
	(dist-hook): Depend on it.

2017-03-01  Andy Wingo  <wingo@pobox.com>

	Disable REPL server tests if no threads
	* test-suite/tests/00-repl-server.test (call-with-repl-server): The REPL
	  server needs threads so don't bother testing if we have no threads.
	  Also, prevent SIGPIPE from killing the parent process.

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	tests: Avoid race condition in REPL server test.
	Fixes <http://bugs.gnu.org/24769>.
	Reported by Rob Browning <rlb@defaultvalue.org>.

	* test-suite/tests/00-repl-server.test ("simple expression"): Add call
	to 'select' before 'display'.

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	tests: Throw 'unresolved when the REPL server is too slow.
	* test-suite/tests/00-repl-server.test (call-with-repl-server):
	Use (usleep 100) instead of (sleep 1).  Throw 'unresolved when TRIES is
	too high.

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	tests: Add REPL server test for CVE-2016-8606.
	This is a followup to 08c021916dbd3a235a9f9cc33df4c418c0724e03.

	* test-suite/tests/00-repl-server.test: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add it.

2017-03-01  Mark H Weaver  <mhw@netris.org>
	    Ludovic Courtès  <ludo@gnu.org>

	REPL Server: Guard against HTTP inter-protocol exploitation attacks.
	Reported by Christopher Allan Webber <cwebber@dustycloud.org>

	This commit adds protection to Guile's REPL servers against HTTP
	inter-protocol exploitation attacks, a scenario whereby an attacker can,
	via an HTML page, cause a web browser to send data to TCP servers
	listening on a loopback interface or private network.  See
	<https://en.wikipedia.org/wiki/Inter-protocol_exploitation> and
	<https://www.jochentopf.com/hfpa/hfpa.pdf>, The HTML Form Protocol
	Attack (2001) by Tochen Topf <jochen@remote.org>.

	Here we add a procedure to 'before-read-hook' that looks for a possible
	HTTP request-line in the first line of input from the client socket.  If
	present, the socket is drained and closed, and a loud warning is written
	to stderr (POSIX file descriptor 2).

	* module/system/repl/server.scm: Add 'maybe-check-for-http-request'
	to 'before-read-hook' when this module is loaded.
	(with-temporary-port-encoding, with-saved-port-line+column)
	(drain-input-and-close, permissive-http-request-line?)
	(check-for-http-request, guard-against-http-request)
	(maybe-check-for-http-request): New procedures.
	(serve-client): Use 'guard-against-http-request'.
	* module/system/repl/coop-server.scm (start-repl-client): Use
	'guard-against-http-request'.
	* doc/ref/guile-invoke.texi (Command-line Options): In the description
	of the --listen option, make the security warning more prominent.
	Mention the new protection added here.  Recommend using UNIX domain
	sockets for REPL servers.  "a path to" => "the file name of".

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	tests: Use the "normalized codeset" in locale names.
	* test-suite/tests/i18n.test (%french-locale-name)
	(%french-utf8-locale-name, %turkish-utf8-locale-name)
	(%german-utf8-locale-name, %greek-utf8-locale-name): Use the normalized
	codeset for ISO-8859-1 and UTF-8.

	Treat 'SIG_IGN' as a pointer.
	* libguile/posix.c (scm_system_star): Cast 'SIG_IGN' to
	'scm_t_uintptr_t' and use 'scm_from_uintptr_t'.  This fixes an
	'int-conversion' warning with GCC 6.2.

	Document 'scm_to_uintptr_t' and 'scm_from_uintptr_t'.
	* doc/ref/api-data.texi (Integers): Document them.

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	Remove 'umask' calls from 'mkdir'.
	Fixes <http://bugs.gnu.org/24659>.

	* libguile/filesys.c (SCM_DEFINE): Remove calls to 'umask' when MODE is
	unbound; instead, use 0777 as the mode.  Update docstring to clarify
	this.
	* doc/ref/posix.texi (File System): Adjust accordingly.
	* NEWS: Mention it.

2017-03-01  Andy Wingo  <wingo@pobox.com>

	%port-encoding requires an open port
	* libguile/ports.c (scm_sys_port_encoding)
	  (scm_sys_set_port_encoding_x): Require an open port, to match 2.0
	  behavior.

2017-03-01  Mark H Weaver  <mhw@netris.org>

	http: Do not use 'eq?' to compare characters in parse-request-uri.
	* module/web/http.scm (parse-request-uri): Use 'eqv?' to compare
	characters.

2017-03-01  Mark H Weaver  <mhw@netris.org>

	build: .x and .doc files depend on generated includes.
	Fixes <https://bugs.gentoo.org/show_bug.cgi?id=590528>.

	* libguile/Makefile.am (BUILT_INCLUDES): New variable.
	(BUILT_SOURCES): Put generated .h to BUILT_INCLUDES.
	(DOT_X_FILES, EXTRA_DOT_X_FILES, DOT_DOC_FILES, EXTRA_DOT_DOC_FILES):
	Depend on $(BUILT_INCLUDES), in place of scmconfig.h which is included
	in $(BUILT_INCLUDES).

2017-03-01  Ludovic Courtès  <ludo@gnu.org>

	texinfo: Remove unnecessary (oop goops) dependency.
	* module/texinfo/string-utils.scm: Remove #:use-module (oop goops).

2017-03-01  Mark H Weaver  <mhw@netris.org>

	Do not assume that sizeof (long) == sizeof (void *) == sizeof (SCM).
	This assumption does not hold on systems that use the LLP64 data model.

	Partially fixes <https://debbugs.gnu.org/22406>.
	Reported by Peter TB Brett <peter@peter-b.co.uk>.

	* libguile/numbers.h (scm_t_inum): Move here from numbers.c, and change
	  to be equivalent to 'long' (formerly 'scm_t_signed_bits').
	  (SCM_MOST_POSITIVE_FIXNUM, SCM_MOST_NEGATIVE_FIXNUM): Define based on
	  SCM_I_FIXNUM_BIT instead of SCM_T_SIGNED_BITS_MAX.
	  (SCM_I_INUM): Adjust definitions to return a 'scm_t_inum', and avoiding
	  the assumption that SCM_UNPACK returns a 'long'.
	* libguile/numbers.c (scm_t_inum): Move definition to numbers.h.
	  Verify that 'scm_t_inum' fits within a SCM value.
	  (scm_i_inum2big): Remove preprocessor code that forced a compile error
	  unless sizeof (long) == sizeof (void *).

2017-03-01  Mark H Weaver  <mhw@netris.org>

	Avoid signed integer overflows in numeric conversions.
	Reported by Miroslav Lichvar <mlichvar@redhat.com>
	in <https://lists.gnu.org/archive/html/guile-devel/2016-02/msg00045.html>

	* libguile/conv-integer.i.c: Avoid signed overflow.
	* libguile/numbers.c (scm_is_signed_integer): Avoid signed overflow.

2017-03-01  Andy Wingo  <wingo@pobox.com>

	Remove extraneous debugging output in test
	* test-suite/standalone/test-scm-c-bind-keyword-arguments.c
	  (missing_value_error_handler): Remove debugging write.

	Fix open-file mode misinterpretation
	* libguile/fports.c (scm_i_mode_to_open_flags): Validate that argument
	  is string.  Fixes #25498.

	"select" no longer throws exception on EINTR
	* doc/ref/posix.texi (Ports and File Descriptors): Update.
	* libguile/filesys.c (scm_select): Use scm_std_select so that pending
	  interrupts can be delivered.  On EINTR or EAGAIN, just return directly
	  so that calling Scheme code can run asyncs.

	scm_std_select doesn't tick itself
	* libguile/threads.c (scm_std_select): If there are unblocked asyncs
	  pending, return directly instead of ticking ourselves.

	Cosmetic REPL server improvements
	* module/system/repl/server.scm (run-server*): Cosmetic improvements.

	Fix trap frame matching
	* module/system/vm/traps.scm (program-last-ip): Actually return an
	  absolute IP.  Fixes traps!

	Fix class slot allocation since GOOPS rewrite
	* module/oop/goops.scm (%compute-layout): Fix class slot layout.
	  Before, a #:class that was an argument to #:allocation was getting
	  interpreted as a keyword with a value.
	* test-suite/tests/goops.test ("#:class slot allocation"): Add test.

	Fix (mkstemp! "XX" 0) errors
	* libguile/filesys.c (scm_i_mkstemp): Validate "mode" argument as a
	  string, and validate writability of template string early too.  Thanks
	  to Jean Louis for the bug report.

	Flush when getting string from r6rs string output port
	* module/rnrs/io/ports.scm (open-string-output-port): Calling the
	  get-string proc should flush the buffer and reset the file position.
	* test-suite/tests/r6rs-ports.test ("8.2.10 Output ports"): Add tests.
	  Thanks to Freja Nordsiek for the report.

	String ports can be truncated
	* libguile/strports.c (string_port_truncate):
	  (scm_make_string_port_type): Support truncate-file on string ports.
	* test-suite/tests/ports.test ("string ports"): Add tests.

	Minor expansion of guile-test comments
	* test-suite/guile-test: Add -L to example.

2017-03-01  Wilfred Hughes  <me@wilfred.me.uk>

	Favor docstrings for describing the purpose of functions.
	* module/ice-9/boot-9.scm: Where functions have docstring-style
	  comments, make them proper docstrings.

2017-03-01  Andy Wingo  <wingo@pobox.com>

	Fix "Scheme Syntax" info rendering
	* doc/ref/api-evaluation.texi (Expression Syntax): Fix quote and
	  quasiquote so that they actually look different in Info.

2017-02-28  Andy Wingo  <wingo@pobox.com>

	Better errors for odd-length keyword args
	* libguile/vm-engine.c (bind-kwargs):
	* libguile/vm.c (vm_error_kwargs_missing_value):
	* libguile/eval.c (error_missing_value)
	  (prepare_boot_closure_env_for_apply): Adapt to mirror VM behavior.
	* libguile/keywords.c (scm_c_bind_keyword_arguments): Likewise.
	* module/ice-9/eval.scm (primitive-eval): Update to error on (foo #:kw)
	  with a "Keyword argument has no value" instead of the horrible "odd
	  argument list length".  Also adapts to the expected args format for
	  the keyword-argument-error exception printer in all cases.  Matches
	  1.8 optargs behavior also.
	* test-suite/standalone/test-scm-c-bind-keyword-arguments.c (test_missing_value):
	  (missing_value_error_handler): Update test.
	* test-suite/tests/optargs.test: Add tests.

	Fix segfault introduced with R6RS port commit
	* libguile/init.c (scm_i_init_guile): Move scm_register_r6rs_ports
	  later, so that defining port types hsa the SCM trampoline subrs
	  defined.
	* libguile/bytevectors.c (scm_bootstrap_bytevectors): Cosmetic changes.

	"Scripting Examples" update.
	* doc/ref/scheme-scripts.texi (Scripting Examples): Mention system* and
	  open-pipe.

	Register R6RS port and bytevector internals early
	* libguile/bytevectors.c (sym_big, sym_little): Rename from scm_sym_big
	  and scm_sym_little, and don't use the snarf mechanism as we need to
	  initialize this value eagerly in case the C API is used before the
	  Scheme module is loaded.
	  (scm_bootstrap_bytevectors): Initialize the endianness symbols here.
	* libguile/r6rs-ports.c (scm_register_r6rs_ports): Register the R6RS
	  port kinds here, for the same reason.

2017-02-28  Andy Wingo  <wingo@pobox.com>

	Fix support for threads already known to GC
	* libguile/threads.h (scm_i_thread): Add bool tracking whether the
	  thread needs to be unregistered from libgc.
	* libguile/threads.c (guilify_self_1): Add needs_unregister arg.
	  (on_thread_exit): Only unregister thread if the thread needs it.
	  (scm_i_init_thread_for_guile): A thread needs unregistering if
	  GC_register_my_thread succeeded.
	  (scm_threads_prehistory): Don't unregister initial thread.

	  Fixes #19523.  Thanks to Anthonin Bonnefoy for the report.

2017-02-28  Andy Wingo  <wingo@pobox.com>

	Declare module exports before loading imports
	* module/ice-9/boot-9.scm (define-module*): Process module imports after
	  module exports.  Allows for an additional kind of circular module
	  imports (see https://bugs.gnu.org/15540).
	* test-suite/tests/modules.test ("circular imports"): Add test.

	Revert "futures: Limit the number of nested futures on the same stack."
	This reverts commit 8a177d316c0062afe74f9a761ef460e297435e59, though
	keeping the additional tests.  (Guile 2.2 doesn't have a fixed stack
	limit).

	Fix (* x -1) for GOOPS types
	* libguile/numbers.c (scm_product): Only reduce (* x -1) to (- x) when X
	  is a bignum.  Fixes weirdness when X is not a number and instead
	  multiplication should dispatch to GOOPS.  Thanks to Alejandro Sanchez
	  for the report.

2017-02-27  Diogo F. S. Ramos  <dfsr@riseup.net>

	Explain why no native accessors for `s8' and `u8' exist
	* doc/ref/api-data.texi: Instead of saying it is obvious, explain why
	  no native endianness accessors exist for the `s8' and `u8' variants.

2017-02-23  Andy Wingo  <wingo@pobox.com>

	Fix guild compile --to=cps / --from=cps
	* module/language/cps/spec.scm (read-cps, write-cps): Fix CPS
	  serialization and parsing, so that "guild compile" works with --to=cps
	  and --from=cps.

	Fix kfun parse-cps bug
	* module/language/cps.scm (parse-cps): Fix bug parsing kfun.

2017-02-23  Freja Nordsiek  <fnordsie@gmail.com>

	Fixed specific version of guile search in autoconf macro GUILE_PROGS.
	* meta/guile.m4 (GUILE_PROGS): Search for guile with suffixes
	  first ('-X.Y' and 'X.Y' where X.Y denotes the version) before
	  searching for guile with no suffix.  Patch co-authored by Andy Wingo.

2017-02-23  Andy Wingo  <wingo@pobox.com>

	Fix typo in old NEWS.
	* NEWS: Fix typo.

2017-02-22  Andy Wingo  <wingo@pobox.com>

	Fix multi-arity dispatch in GOOPS
	* module/oop/goops.scm (multiple-arity-dispatcher): Fix dispatch for
	  max-arity+1 when a generic is already in multiple-arity dispatch.
	  Fixes #24454.
	* test-suite/tests/goops.test ("dispatch"): Add test.

	Fix compute-frame-sizes for case-lambda jumps
	* module/system/vm/frame.scm (compute-frame-sizes): Fix for jumps to the
	  next arity.

2017-02-21  Andy Wingo  <wingo@pobox.com>

	Use labs instead of abs where needed
	* libguile/numbers.c (log_of_fraction): Use labs instead of abs on
	  longs.  Thanks to Matt Wette for the tip.

2017-02-21  Matt Wette  <matt.wette@gmail.com>

	Fix make-polar signedness of zeros on macOS
	* configure.ac: Check for __sincos.
	* libguile/numbers.c (scm_c_make_polar): Fall back to __sincos if
	  possible.  Fixes zero signedness of make-polar on macOS.

2017-02-21  Andy Wingo  <wingo@pobox.com>

	Conditionally define SOCK_CLOEXEC, SOCK_NONBLOCK
	* libguile/socket.c (scm_init_socket): Conditionally define SOCK_CLOEXEC
	  and SOCK_NONBLOCK.  Fixes compilation on macOS.

2017-02-19  Andy Wingo  <wingo@pobox.com>

	Fix flonum/complex type inference.
	* module/language/cps/types.scm (define-binary-result!): Arithmetic
	  where one argument is a flonum may produce a complex.
	* test-suite/tests/compiler.test: Add test.

2017-02-18  Andy Wingo  <wingo@pobox.com>

	Guile 2.1.7.
	* GUILE-VERSION: Bump to 2.1.7.

	Update NEWS for 2.1.7.
	* NEWS: Update.

	Fold 2.1.6 NEWS changes
	* NEWS: Fold 2.1.6 changes into main 2.2 NEWS.

2017-02-17  Andy Wingo  <wingo@pobox.com>

	Speed up number->string
	* libguile/numbers.c (scm_number_to_string): Use scm_from_latin1_string
	  where appropriate.  Avoids mucking about with iconv.

	Minor make-string optimization
	* libguile/strings.c (STRINGBUF_SET_MUTABLE): New helper.
	  (scm_i_string_ensure_mutable_x): Use new helper.
	  (scm_make_string): Mark stringbuf as mutable.

	Bump fluid cache size to 16 entries
	* libguile/cache-internal.h (SCM_CACHE_SIZE): Bump to 16.  It seems that
	  a thread accesses more than 8 fluids by default (%stacks, the
	  exception handler, current ports, current-fiber, port read/write
	  waiters) which leads every fiber to cause cache eviction and copying
	  the value table, which is a bottleneck.  Instead just bump this cache
	  size.
	  (scm_cache_lookup): Update unrolled search.

	Revert "Cheaper fluid-ref cache"
	This reverts commit cd3ff33a31c51612f2247bdb15ecbe92d7da1310.

2017-02-16  Andy Wingo  <wingo@pobox.com>

	Stringbufs immutable by default
	* libguile/snarf.h (SCM_IMMUTABLE_STRINGBUF): Remove shared flag.
	  Stringbufs are immutable by default.
	* libguile/strings.c: Rewrite blurb.  Change to have stringbufs be
	  immutable by default and mutable only when marked as such.  Going
	  mutable means making a private copy.
	  (STRINGBUF_MUTABLE, STRINGBUF_F_MUTABLE): New definitions.
	  (SET_STRINGBUF_SHARED): Remove.
	  (scm_i_print_stringbuf): Simplify to just alias the stringbuf as-is.
	  (substring_with_immutable_stringbuf): New helper.
	  (scm_i_substring, scm_i_substring_read_only, scm_i_substring_copy):
	  use new helper.
	  (scm_i_string_ensure_mutable_x): New helper.
	  (scm_i_substring_shared): Use scm_i_string_ensure_mutable_x.
	  (stringbuf_write_mutex): Remove; yaaaaaaaay.
	  (scm_i_string_start_writing): Use scm_i_string_ensure_mutable_x.  No
	  more mutex.
	  (scm_i_string_stop_writing): Now a no-op.
	  (scm_i_make_symbol): Use substring/copy.
	  (scm_sys_string_dump, scm_sys_symbol_dump): Update.
	* libguile/strings.h (SCM_I_STRINGBUF_F_SHARED): Remove.
	  (SCM_I_STRINGBUF_F_MUTABLE): Add.
	* module/system/vm/assembler.scm (link-data): Don't add shared flag any
	  more.  Existing compiled flags are harmless tho.
	* test-suite/tests/strings.test ("string internals"): Update.

	Remove unnecessary scm_i_string_start_writing calls
	* libguile/strings.c (scm_string, scm_c_make_string):
	* libguile/srfi-13.c (scm_reverse_list_to_string, scm_string_map)
	  (scm_string_unfold, scm_string_unfold_right, scm_xsubstring)
	  (scm_string_filter, scm_string_delete): Remove
	  scm_i_string_start_writing / scm_i_string_stop_writing calls around
	  fresh strings that aren't visible to other threads.

	Cheaper fluid-ref cache
	* libguile/cache-internal.h (struct scm_cache_entry): Add needs_flush
	  member.
	  (scm_cache_evict_1): Clear needs_flush on newly evicted entry.
	  (scm_cache_insert): Propagate needs_flush to new entry.
	* libguile/fluids.c (restore_dynamic_state): Mark all restored entries
	  as needing a flush.
	  (save_dynamic_state): Only cons on "needs_flush" entries to the
	  resulting dynamic state.  The result is the same as before but
	  avoiding the refq on the weak table.
	  (fluid_set_x): Propagate needs_flush down to the cache.
	  (fluid_ref): When adding entry to cache, use needs_flush==0.
	  (scm_fluid_set_x, scm_fluid_unset_x, scm_swap_fluid, swap_fluid): Use
	  needs_flush==1.

2017-02-15  Andy Wingo  <wingo@pobox.com>

	Fix accept4 gnulib update.
	* m4/accept4.m4: Add missing file.
	* lib/accept4.c: Add missing file.
	* .gitignore: Update.

	Add accept4 support
	* doc/ref/posix.texi (Network Sockets and Communication): Add
	  documentation.
	* libguile/socket.c (scm_accept4): New function, replaces accept
	  implementation.
	  (scm_accept): Call scm_accept4.
	  (scm_init_socket): Define SOCK_CLOEXEC and SOCK_NONBLOCK.
	* libguile/socket.h: Add private scm_accept4 decl.
	* module/ice-9/suspendable-ports.scm (accept): Update.

	Switch to accept4
	* lib/Makefile.am:
	* m4/gnulib-cache.m4:
	* m4/gnulib-comp.m4: Switch from accept gnulib module to accept4.
	* libguile/socket.c (scm_accept): Use accept4.

	Update Gnulib to v0.1-1157-gb03f418.

2017-02-14  Andy Wingo  <wingo@pobox.com>

	Elide syscalls in fdes->port
	* libguile/fports.h (scm_t_fport): Add options field.
	  (SCM_FDES_RANDOM_P): Deprecate.
	  (scm_i_fdes_to_port): Add options argument.
	* libguile/fports.c (scm_i_fdes_to_port): Add options argument.  Only
	  verify FD if SCM_FPORT_OPTION_VERIFY is there.
	  (scm_fdes_to_port, scm_open_file_with_encoding): Adapt to
	  scm_i_fdes_to_port changes.
	  (fport_random_access_p): Don't try to seek if NOT_SEEKABLE option is
	  set.
	* libguile/deprecated.h:
	* libguile/deprecated.c (SCM_FDES_RANDOM_P): Deprecate.
	* NEWS: Add deprecation.
	* libguile/filesys.c:
	* libguile/ioext.c:
	* libguile/posix.c:
	* libguile/read.c:
	* libguile/socket.c: Adapt callers.

2017-02-13  Andy Wingo  <wingo@pobox.com>

	Fix compilation of continuations.c
	* libguile/continuations.c (scm_i_continuation_to_frame): Remove unused
	  assignment.  The previous commit removed the declaration in order to
	  silence an unused-assignment warning, but forgot to remove the
	  assignment :/

2017-02-12  Andy Wingo  <wingo@pobox.com>

	Remove unused variable in continuations.c
	* libguile/continuations.c (scm_i_continuation_to_frame): Remove unused
	  variable.

	VM continuations store FP/SP by offset
	* libguile/continuations.c (scm_i_continuation_to_frame):
	* libguile/stacks.c (scm_make_stack):
	* libguile/vm.c (scm_i_vm_cont_to_frame, scm_i_vm_capture_stack):
	  (vm_return_to_continuation_inner)
	  (struct vm_reinstate_partial_continuation_data):
	  (vm_reinstate_partial_continuation_inner):
	  (vm_reinstate_partial_continuation):
	* libguile/vm.h (sstruct scm_vm_cont): Simplify VM continuations by
	  recording the top FP by offset, not value + reloc.
	* libguile/frames.c (frame_offset, scm_i_vm_frame_offset): Remove unused
	  functions.
	* libguile/frames.h (SCM_VALIDATE_VM_FRAME, scm_i_vm_frame_offset):
	  Remove.
	* libguile/control.c (reify_partial_continuation): Once we know the
	  base_fp, relocate the dynamic stack.
	* libguile/dynstack.h:
	* libguile/dynstack.c (scm_dynstack_relocate_prompts): New function.
	  (scm_dynstack_wind_prompt): Adapt to add new fp offset.

	Avoid reading garbage from dynstack
	* libguile/dynstack.c (push_dynstack_entry_unchecked): Reset top
	  dynstack tag to prevent garbage.

2017-02-08  Andy Wingo  <wingo@pobox.com>

	Web server and client use suspendable ports
	* module/web/request.scm (write-request):
	* module/web/response.scm (write-response): Use put-string instead of
	  display.

	Prevent TOCTTOU bugs in C ports
	* libguile/ports-internal.h (scm_port_buffer_can_take):
	  (scm_port_buffer_can_put): Add cur/end output arguments so that when a
	  caller asks the buffer room, it can be relative to a fixed point in
	  the buffer and not whatever point it's at when we go to fill it.
	  (scm_port_buffer_did_take, scm_port_buffer_did_put): Similarly,
	  require that the caller knows where they took/put data in the buffer.
	  Prevents overflow.
	  (scm_port_buffer_take_pointer, scm_port_buffer_put_pointer): Likewise,
	  require that the caller has already checked and knows a position in
	  the buffer and therefore how much data is available.
	  (scm_port_buffer_take, scm_port_buffer_put, scm_port_buffer_putback):
	  Adapt.
	* libguile/ports.h (scm_fill_input): Add cur/avail output arguments.
	* libguile/filesys.c:
	* libguile/poll.c:
	* libguile/ports.c:
	* libguile/r6rs-ports.c:
	* libguile/read.c:
	* libguile/rw.c: Adapt all callers.  Gnarly work!

	Prevent TOCTTOU bugs in suspendable ports
	* module/ice-9/suspendable-ports.scm: Prevent TOCTTOU bugs by
	  additionally returning the buffer and offset when we compute an
	  amount-buffered.

	Remove remaining "display" uses in (web http)
	* module/web/http.scm (header-writer): Default to calling put-string.
	  (put-list): Rename from write-list, take the port first, and call the
	  put-item function with port then value.  Adapt all callers.
	  (write-date): Rename display-digits to put-digits.
	  (put-challenge): Rename from write-challenge, adapt arguments to put
	  convention, and adapt callers.
	  (declare-symbol-list-header!): Use put-symbol.
	  (declare-integer-header!): Use put-non-negative-integer.o
	  (declare-entity-tag-list-header!): Use put-entity-tag-list.
	  ("If-Range", "Etag"): Adapt to put-entity-tag.
	  (make-chunked-output-port): Use put-char.

	Beginnings of suspendable HTTP
	* module/web/http.scm: Use put-string and other routines from (ice-9
	  textual-ports) in preference to `display'.  The goal is for these
	  operations to be suspendable.

	Modernize (web http) a bit
	* module/web/http.scm: Modernize the Guile Scheme by using more match,
	  when, unless, and non-tail conversion.  No functional change, with the
	  exception of fixing a bug in write-key-value-list for symbols like
	  100-continue that shouldn't print as #{100-continue}#.
	* test-suite/tests/web-http.test (pass-if-only-parse):
	  (pass-if-reparse, pass-if-parse): Arrange to also serialize and
	  reparse values from pass-if-parse.  Apply to all existing tests except
	  fragments where we don't expect fragments to be written out.

2017-02-07  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix rank 0 arrays and nested arrays in truncated-print
	* module/ice-9/pretty-print.scm (print): In the array case, pass
	  #:inner? along to (print-sequence), unless we're at the last dimension
	  of the array.
	  Special case for 0-rank arrays, which cannot be empty and have no
	  length.
	* test-suite/tests/print.test: Test some of the cases fixed by this
	  patch.

	Support arrays in truncated-print
	* module/ice-9/pretty-print.scm (print): Handle general arrays.
	* test-suite/tests/print.test: Test truncated-print with general arrays.

	Fix bug #25492
	* libguile/vm-engine.c (BR_F64_ARITHMETIC): Fix type.

2017-02-07  Andy Wingo  <wingo@pobox.com>

	Avoid stacks in dynamically-bound values
	* libguile/dynstack.h:
	* libguile/dynstack.c (scm_dynstack_find_old_fluid_value): New
	  function.
	* libguile/fluids.c (saved_dynamic_state_ref): New helper.
	  (scm_fluid_ref): Fix docstring.
	  (scm_fluid_ref_star): New function allowing access to previous values
	  for a fluid.
	  (scm_dynamic_state_ref): New internal function.
	* libguile/fluids.h: Add scm_fluid_ref_star and scm_dynamic_state_ref.
	* libguile/stacks.c (scm_stack_id): Adapt to %stacks not being a chain.
	* libguile/throw.c (catch, throw_without_pre_unwind): Adapt to
	  %exception-handlers not being a chain.
	* module/ice-9/boot-9.scm (catch, dispatch-exception): Instead of having
	  %exception-handlers be a chain, use fluid-ref* to access the chain
	  that is in place at the time the exception is thrown.  Prevents
	  unintended undelimited capture of the current exception handler stack
	  by a delimited "catch".
	  (%start-stack): Similarly, don't be a chain.
	* module/system/repl/debug.scm (frame->stack-vector):
	* module/system/repl/error-handling.scm (call-with-error-handling):
	* module/ice-9/save-stack.scm (save-stack): Adapt to %stacks not being a
	  chain.
	* test-suite/tests/exceptions.test ("delimited exception handlers"): Add
	  tests.
	* doc/ref/api-control.texi (Fluids and Dynamic States): Add docs.

2017-01-19  Andy Wingo  <wingo@pobox.com>

	Guile 2.1.6.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to 2.1.6.

	Update NEWS.
	* NEWS: Update.

	Fix build warning
	* libguile/stime.c (scm_init_stime): Remove unused variable.

2017-01-12  David Thompson  <dthompson2@worcester.edu>

	Add unboxed floating point comparison instructions.
	* libguile/vm-engine.c (BR_F64_ARITHMETIC): New preprocessor macro.
	(br_if_f64_ee, br_if_f64_lt, br_if_f64_le, br_if_f64_gt, br_if_f64_ge):
	New VM instructions.
	* doc/ref/vm.texi ("Unboxed Floating-Point Arithmetic"): Document them.
	* module/language/cps/compile-bytecode.scm (compile-function): Emit f64
	comparison instructions.
	* module/language/cps/effects-analysis.scm: Define effects for f64
	primcalls.
	* module/language/cps/primitives.scm (*branching-primcall-arities*): Add
	arities for f64 primcalls.
	* module/language/cps/specialize-numbers.scm (specialize-f64-comparison):
	New procedure.
	(specialize-operations): Specialize f64 comparisons.
	* module/system/vm/assembler.scm (emit-br-if-f64-=, emit-br-if-f64-<)
	(emit-br-if-f64-<=, emit-br-if-f64->, emit-br-if-f64->=): Export.
	* module/system/vm/disassembler.scm (code-annotation): Add annotations
	for f64 comparison instructions.

2017-01-11  Andy Wingo  <wingo@pobox.com>

	Protect call-with-new-thread data from GC.
	* libguile/threads.c (struct launch_data): Add prev/next pointers.
	  (protected_launch_data, protected_launch_data_lock): New static vars.
	  (protect_launch_data, unprotect_launch_data): New functions.
	  (really_launch, scm_sys_call_with_new_thread): Preserve launch data
	  from GC.  Thanks to Linas Vepstas for the report!

2017-01-09  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Final names for new array functions
	Globally rename (array-from* -> array-slice), (array-from ->
	array-cell-ref), (array-amend! -> array-cell-set!), (array-for-each-cell
	-> array-slice-for-each).

2017-01-08  Andy Wingo  <wingo@pobox.com>

	Fix scm_init_stime for macOS
	* libguile/stime.c (scm_init_stime): Remove needless test of
	  clock_getcpuclockid.  Fixes build on macOS; thanks to Matt Wette for
	  the report and fix.

	Fix alloc_aligned for high allocations
	* libguile/loader.c (alloc_aligned): Widen alignment.  Thanks to Matt
	  Wette for the report and the fix!

	Speed up load-thunk-from-memory for page alignment
	* libguile/loader.c (page_size): New static var.
	  (alloc_aligned): Enable mmap path that was never used in the
	  past (!).  Thanks to Matt Wette for the bug report!
	  (load_thunk_from_memory): Use page_size instead of 4096.
	  (scm_bootstrap_loader): Init page_size.

	Fix mkstemp on macOS
	* libguile/filesys.c (scm_i_mkstemp): Limit flags to mkostemp.  Based on
	  a patch by Matt Wette; thanks!

	Fix close-port race.
	* libguile/ports.c (release_port): Fix race.

	Exited threads retain less memory
	* libguile/threads.c (on_thread_exit): Lessen excess retention.

	Prevent some interrupts of wait-condition-variable
	* libguile/threads.c (timed_wait): Disable interrupts while reacquiring
	  mutex after wait-condition-variable.

	Enable interrupts only when running thread body
	* libguile/threads.c (really_launch): Start threads with asyncs
	  blocked.
	* module/ice-9/threads.scm (call-with-new-thread): Unblock asyncs once
	  we have the bookkeeping sorted out.  Don't use
	  with-continuation-barrier; it's not needed.  Print nice thread
	  backtraces.

	Remove thread-specific admin mutex
	* libguile/threads.c (guilify_self_1):
	* libguile/threads.h (scm_i_thread): Remove unused thread "admin
	  mutex".

	Remove thread-exited? check in sigaction
	* libguile/scmsigs.c (scm_sigaction_for_thread): Remove check that
	  thread hadn't exited.  This check was racy as it's always possible
	  that the other thread exits between checking it or even after the
	  signal handler is installed.

	Thread prepare-to-wait respects block_asyncs
	* libguile/async.c (scm_i_prepare_to_wait): Don't signal interrupt if
	  asyncs are blocked.

2016-12-29  Andy Wingo  <wingo@pobox.com>

	New interfaces to help wait on fd/cond
	* libguile/async.h:
	* libguile/async.c (struct scm_thread_wake_data): Include the cond to
	  signal.  Be a union and include a tag.
	  (scm_i_prepare_to_wait): Rename from scm_i_setup_sleep and take wake
	  data directly.  Also call scm_i_wait_finished as appropriate.
	  (scm_i_wait_finished): Rename from scm_i_reset_sleep.
	  (scm_i_prepare_to_wait_on_fd, scm_c_prepare_to_wait_on_fd):
	  (scm_i_prepare_to_wait_on_cond, scm_c_prepare_to_wait_on_cond): New
	  functions.
	  (scm_c_wait_finished): New function.
	  (scm_system_async_mark_for_thread): Adapt to wake data change.
	* libguile/threads.c (block_self, scm_std_select): Adapt to async
	  interface changes.
	* doc/ref/api-scheduling.texi (Asyncs): Doc new public interfaces.

2016-12-18  Andy Wingo  <wingo@pobox.com>

	Improve handle-interrupts placement
	* module/language/cps/handle-interrupts.scm (compute-safepoints): New
	  function.
	  (add-handle-interrupts): Add safepoints at backedge targets, not
	  backedges.  Gives better register allocation, loop rotation, and code
	  size.

2016-12-18  Mark H Weaver  <mhw@netris.org>

	FFI: Add support for functions that set 'errno'.
	Implements wishlist item <https://debbugs.gnu.org/18592>.
	Requested by Frank Terbeck <ft@bewatermyfriend.org>.
	Based on a proposed patch by Nala Ginrut <nalaginrut@gmail.com>.
	Patch ported to 2.2 by Andy Wingo <wingo@pobox.com>.

	* libguile/foreign.c (cif_to_procedure): Add 'with_errno' argument.
	  If true, truncate result to only one return value.
	  (scm_i_foreign_call): Separate the arguments.  Always return errno.
	  (pointer_to_procedure): New static function.
	  (scm_pointer_to_procedure_with_errno): New C API function, implemented
	  in terms of 'pointer_to_procedure'.
	  (scm_pointer_to_procedure): Reimplement in terms of
	  'pointer_to_procedure', no longer bound to "pointer->procedure".  See
	  below.
	  (scm_i_pointer_to_procedure): New C function bound to
	  "pointer->procedure" which now accepts the optional #:return-errno?
	  keyword argument, implemented in terms of 'pointer_to_procedure'.
	  (k_return_errno): New keyword #:return-errno?.
	* libguile/foreign.h (scm_pointer_to_procedure_with_errno): Add prototype.
	* doc/ref/api-foreign.texi (Dynamic FFI): Adjust documentation.
	* libguile/vm-engine.c (foreign-call): Return two values.

2016-12-15  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Test format ~f with width parameters
	* test-suite/tests/format.test: Additional tests for ~f.

2016-12-14  Andy Wingo  <wingo@pobox.com>

	Fix bug in compute-significant-bits for phi predecessors
	* module/language/cps/specialize-numbers.scm (compute-significant-bits):
	  Always revisit predecessors after first visit.  Avoids situation where
	  predecessor of an unvisited phi var could default to 0 significant
	  bits and never be revisited.  Fixes (format #f "~2f" 9.9).

2016-12-14  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Make scm_gc_warn_proc() write directly to stderr
	This avoids a deadlock due to the lookup of cur_warnport_fluid while an
	allocation is ongoing.

	* libguile/gc.c (scm_gc_warn_proc): Write the warning directly to
	  stderr.

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

	Add suspendable-continuation?
	* doc/ref/api-control.texi (Prompt Primitives): Document
	  suspendable-continuation?.
	* libguile/control.c (scm_suspendable_continuation_p): New procedure.
	  (scm_init_ice_9_control): New extension procedure, defines
	  suspendable-continuation?.
	  (scm_init_control): Register scm_init_ice_9_control.
	* libguile/eval.c (eval):
	* libguile/throw.c (catch):
	* libguile/continuations.c (scm_i_make_continuation): Restore resumable
	  prompt cookie after continuation invocation.
	* libguile/vm.c (scm_call_n): Arrange to set resumable_prompt_cookie
	  during invocation of VM.
	* libguile/vm.h (struct scm_vm): Add resumable_prompt_cookie member.
	* module/ice-9/control.scm: Export suspendable-continuation?.
	* test-suite/tests/control.test ("suspendable-continuation?"): New
	  test.

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

	Bump version to 2.1.5.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump.

	Fix --without-threads
	* libguile/dynl.c:
	* libguile/gc.c:
	* libguile/keywords.c:
	* libguile/scmsigs.c:
	* libguile/stime.c: Use scm_i_dynamic_link instead of scm_dynamic_link
	  so that things compile in without-threads configurations.

2016-12-06  Andy Wingo  <wingo@pobox.com>

	Refine check for when atomics are available.
	* configure.ac:
	* libguile/atomics-internal.h: Use HAVE_STDATOMIC_H to know when to use
	  atomics.

	Use readdir instead of readdir_r
	* libguile/filesys.c:
	* configure.ac: Remove readdir_r / readdir64_r checks and usage.
	  glibc's impls are thread-safe, the _r variants are squirrely and now
	  deprecated in glibc, and it is expected that POSIX will mandate that
	  readdir{,64} be thread-safe already.  See
	  https://sourceware.org/ml/libc-alpha/2016-02/msg00093.html.

	Update NEWS.
	* NEWS: Update.

	Add thread-local variables manual section.
	* doc/ref/api-scheduling.texi (Thread Local Variables): New subsection.

	Minor parameters doc change
	* doc/ref/api-control.texi (Parameters): Make the opening a bit less
	  abrupt.

	Update fluids / dynstate docs
	* doc/ref/api-control.texi (Fluids and Dynamic States): Update
	  documentation.

	Move fluids, parameters docs nearer to dynamic-wind
	* doc/ref/api-control.texi:
	* doc/ref/api-scheduling.texi: Move fluids and parameters docs.

2016-12-06  Christopher Allan Webber  <cwebber@dustycloud.org>

	Fix small typo in suspendable-ports documentation.
	* doc/ref/api-io.texi (Non-Blocking I/O): Fix example to call use-modules
	  rather than use-module.

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

	with-dynamic-state compiler and VM support
	* libguile/dynstack.h (SCM_DYNSTACK_TYPE_DYNAMIC_STATE):
	* libguile/dynstack.c (DYNAMIC_STATE_WORDS, DYNAMIC_STATE_STATE_BOX):
	  (scm_dynstack_push_dynamic_state):
	  (scm_dynstack_unwind_dynamic_state): New definitions.
	  (scm_dynstack_unwind_1, scm_dynstack_wind_1): Add with-dynamic-state
	  cases.
	* libguile/memoize.c (push_dynamic_state, pop_dynamic_state)
	  (do_push_dynamic_state, do_pop_dynamic_state): New definitions.
	  (memoize, scm_init_memoize): Handle push-dynamic-state and
	  pop-dynamic-state.
	* libguile/vm-engine.c (push-dynamic-state, pop-dynamic-state): New
	  opcodes.
	* module/ice-9/boot-9.scm (with-dynamic-state): New definition in Scheme
	  so that the push-dynamic-state and pop-dynamic-state always run in the
	  VM.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/types.scm:
	* module/language/tree-il/effects.scm (make-effects-analyzer):
	* module/language/tree-il/peval.scm (peval):
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	* module/system/vm/assembler.scm: Add support for with-dynamic-state to
	  the compiler.
	* test-suite/tests/fluids.test ("dynamic states"): Add basic tests.
	* doc/ref/vm.texi (Dynamic Environment Instructions): Update.

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

	Reimplement dynamic states
	There are two goals: one, to use less memory per dynamic state in order
	to allow millions of dynamic states to be allocated in light-weight
	threading scenarios.  The second goal is to prevent dynamic states from
	being actively mutated in two threads at once.  This second goal does
	mean that dynamic states object that escape into scheme are now copies
	that won't receive further updates; an incompatible change, but one
	which we hope doesn't affect anyone.

	* libguile/cache-internal.h: New file.
	* libguile/fluids.c (is_dynamic_state, get_dynamic_state)
	  (save_dynamic_state, restore_dynamic_state, add_entry)
	  (copy_value_table): New functions.
	  (scm_i_fluid_print, scm_i_dynamic_state_print): Move up.
	  (new_fluid): No need for a number.
	  (scm_fluid_p: scm_is_fluid): Inline IS_FLUID uses.
	  (fluid_set_x, fluid_ref): Adapt to dynamic state changes.
	  (scm_fluid_set_x, scm_fluid_unset_x): Call fluid_set_x.
	  (scm_swap_fluid): Rewrite in terms of fluid_ref and fluid_set.
	  (swap_fluid): Use internal fluid_set_x.
	  (scm_i_make_initial_dynamic_state): Adapt to dynamic state
	  representation change.
	  (scm_dynamic_state_p, scm_is_dynamic_state): Use new accessors.
	  (scm_current_dynamic_state): Use make_dynamic_state.
	  (scm_dynwind_current_dynamic_state): Use new accessor.
	* libguile/fluids.h: Remove internal definitions.  Add new struct
	  definition.
	* libguile/threads.h (scm_i_thread): Use scm_t_dynamic_state for dynamic
	  state.
	* libguile/threads.c (guilify_self_1, guilify_self_2):
	  (scm_i_init_thread_for_guile, scm_init_guile):
	  (scm_call_with_new_thread):
	  (scm_init_threads, scm_init_threads_default_dynamic_state): Adapt to
	  scm_i_thread change.
	  (scm_i_with_guile, with_guile): Remove "and parent" suffix.
	  (scm_i_reset_fluid): Remove unneeded function.
	* doc/ref/api-scheduling.texi (Fluids and Dynamic States): Remove
	  scm_make_dynamic_state docs.  Update current-dynamic-state docs.
	* libguile/vm-engine.c (vm_engine): Update fluid-ref and fluid-set!
	  inlined fast paths for dynamic state changes.
	* libguile/vm.c (vm_error_unbound_fluid): Remove now-unused function.
	* NEWS: Update.
	* module/ice-9/deprecated.scm (make-dynamic-state): New definition.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_make_dynamic_state): Move here.
	* libguile/__scm.h (scm_t_dynamic_state): New typedef.
	* libguile/dynstack.h:
	* libguile/dynstack.c (scm_dynstack_push_fluid):
	  (scm_dynstack_unwind_fluid): Take raw dynstate in these internal
	  functions.
	* libguile/throw.c (catch): Adapt to dynstack changes.

2016-11-30  Andy Wingo  <wingo@pobox.com>

	Fix two wait-condition-variable race conditions
	* libguile/threads.c (timed_wait): When looping to reacquire mutex,
	  check if mutex owner after dropping mutex to run asyncs when the
	  reacquire is interrupted.

	  Also for asyncs that interrupted the initial wait, just return #t
	  directly, and allow the caller to loop.  Fixes a deadlock in which a
	  thread could have pending asyncs after dropping a mutex and which
	  prevent it from going to wait on a cond, but then the broadcast comes
	  while nobody is waiting and the mutex is dropped, then after
	  reacquiring the mutex when we go to wait again, we wait forever.

	  The correct thing to do is after reacquiring the mutex, to allow the
	  application to check if waiting is appropriate.

2016-11-27  Andy Wingo  <wingo@pobox.com>

	Compile fluid-set! to VM opcode
	* libguile/vm-engine.c (fluid-set!): Fix name of opcode to correspond
	  with name of Tree-IL primitive.  Fixes compilation of fluid-set! to
	  actually use the fluid-set! opcode.
	* doc/ref/vm.texi (Dynamic Environment Instructions): Update.
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  fluid-set! case.
	* module/system/vm/assembler.scm: Update export name for
	  emit-fluid-set!.

	Ensure autoconf doesn't downgrade us to C99
	* configure.ac: Add -std=gnu11 if the compiler is GCC (or clang).  This
	  prevents AC_PROG_CC_C99 from downgrading us by adding -std=gnu99.
	  Fixes regression whereby we were always using the fallback
	  implementation of atomics.

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

	Add weak-table fast path for update
	* libguile/weak-table.c (weak_table_put_x): If the key is the same and
	  the table is weak-key, avoid re-setting disappearing links.

	Fix scm_weak_table_refq for undefined default
	* libguile/weak-table.c (scm_weak_table_refq): No need to default weak
	  table result to #f; just use whatever was passed in.

	Remove special support for fluids in GDB interface
	* module/system/base/types.scm (inferior-fluid?, inferior-fluid-number)
	  (<inferior-fluid>): Remove.  Fluids won't have numbers in the future.
	  (cell->object): Adapt.
	* test-suite/tests/types.test ("opaque objects"): Update.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Deprecate scm_from_contiguous_array
	scm_from_contiguous_array() was undocumented, unused within Guile, and
	can be replaced by make-array + array-copy! without requiring contiguity
	and without loss of performance.

	* libguile/arrays.c (scm_array_contents): Do not rely on
	  SCM_I_ARRAY_CONTP.
	* test-suite/tests/arrays.test: Test array-contents with 0-rank array.
	* libguile/arrays.h: Declare scm_i_shap2ra(),
	  SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG so that
	  scm_from_contiguous_array() can keep using them.
	* libguile/deprecated.c (scm_from_contiguous_array): Move here from
	  arrays.c.
	* libguile/deprecated.h (scm_from_contiguous_array): Deprecate.
	* NEWS: Add deprecation notice.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Document new array functions, with provisional names
	* doc/ref/api-data.texi: New section 'Arrays as arrays of
	  arrays'. Document array-from, array-from*, array-amend!,
	  array-for-each-cell, array-for-each-cell-in-order.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	New functions (array-for-each-cell, array-for-each-cell-in-order)
	* libguile/array-map.c (scm_i_array_rebase, scm_array_for_each_cell):
	  New functions. Export scm_array_for_each_cell() as
	  (array-for-each-cell).

	  (array-for-each-cell-in-order): Define additional export.

	* libguile/array-map.h (scm_i_array_rebase, scm_array_for_each_cell):
	  Add prototypes.

	* test-suite/tests/array-map.test: Renamed from
	  test-suite/tests/ramap.test, fix module name. Add tests for
	  (array-for-each-cell).

	* test-suite/Makefile.am: Apply rename array-map.test -> ramap.test.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	New functions array-from, array-from*, array-amend!
	* libguile/arrays.h (scm_array_from, scm_array_from_s,
	  scm_array_amend_x): New declarations.

	* libguile/arrays.c (scm_array_from, scm_array_from_s,
	  scm_array_amend_x): New functions, export as array-from, array-from*,
	  array-amend!.

	* test-suite/tests/arrays.test: Tests for array-from, array-from*,
	  array-amend!. Replace with-test-prefix/c&e with with-test-prefix where
	  the array read syntax isn't used.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Do not use array handles in scm_vector
	* libguile/vectors.c (scm_vector): Use SCM_I_VECTOR_WELTS on new vector
	  instead of generic scm_vector_elements; cf. scm_vector_copy().

	  (scm_vector_elements): Forward to scm_vector_writable_elements().

	  (scm_vector_writable_elements): Remove special error message for weak
	  vector arg.

	* libguile/generalized-vectors.c (SCM_VALIDATE_VECTOR_WITH_HANDLE):
	  Remove unused macro.

	* libguile/array-handle.c (scm_array_handle_elements): Forward to
	  scm_array_handle_writable_elements().

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Special case for array-map! with three arguments
	Benchmark:

	(define type #t)
	(define A (make-typed-array 's32 0 10000 1000))
	(define B (make-typed-array 's32 0 10000 1000))
	(define C (make-typed-array 's32 0 10000 1000))

	before:

	scheme@(guile-user)> ,time (array-map! C + A B)
	;; 0.792653s real time, 0.790970s run time.  0.000000s spent in GC.

	after:

	scheme@(guile-user)> ,time (array-map! C + A B)
	;; 0.598513s real time, 0.597146s run time.  0.000000s spent in GC.

	* libguile/array-map.c (ramap): Add special case with 3 arguments.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Speed up for multi-arg cases of scm_ramap functions
	This patch results in a 20%-40% speedup in the > 1 argument cases of
	the following microbenchmarks:

	(define A (make-shared-array #0(1) (const '()) #e1e7))
	; 1, 2, 3 arguments.
	(define a 0) ,time (array-for-each (lambda (b) (set! a (+ a b))) A)
	(define a 0) ,time (array-for-each (lambda (b c) (set! a (+ a b c))) A A)
	(define a 0) ,time (array-for-each (lambda (b c d) (set! a (+ a b c d))) A A A)

	(define A (make-shared-array (make-array 1) (const '()) #e1e7))
	(define B (make-shared-array #0(1) (const '()) #e1e7))
	; 1, 2, 3 arguments.
	,time (array-map! A + B)
	,time (array-map! A + B B)
	,time (array-map! A + B B B)

	* libguile/array-map.c (scm_ramap): Note on cproc arguments.

	  (rafill): Assume that dst's lbnd is 0.

	  (racp): Assume that src's lbnd is 0.

	  (ramap): Assume that ra0's lbnd is 0. When there're more than two
	  arguments, compute the array handles before the loop. Allocate the arg
	  list once and reuse it in the loop.

	  (rafe): Do as in ramap(), when there's more than one argument.

	  (AREF, ASET): Remove.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Support typed arrays in some sort functions
	* libguile/sort.c (sort!, sort, restricted-vector-sort!, sorted?):
	  Support arrays of rank 1, whatever the type.

	* libguile/quicksort.i.c: Fix accessors to handle typed arrays.

	* test-suite/tests/sort.test: Test also with typed arrays.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Remove deprecated array functions
	* libguile/array-map.c (scm_array_fill_int, scm_array_fill_int,
	    scm_ra_eqp, scm_ra_lessp scm_ra_leqp, scm_ra_grp, scm_ra_greqp,
	    scm_ra_sum, scm_ra_difference, scm_ra_product, scm_ra_divide,
	    scm_array_identity): Remove deprecated functions.

	* libguile/array-map.h: Remove declaration of deprecated functions.

	* libguile/generalized-vectors.h, libguile/generalized-vectors.c
	  (scm_is_generalized_vector, scm_c_generalized_vector_length,
	  scm_c_generalized_vector_ref, scm_c_generalized_vector_set_x): These
	  functions were deprecated in 2.0.9. Remove.

	* doc/ref/api-compound.texi: Remove uniform-array-read!,
	  uniform-array-write from the manual. These procedures where removed in
	  fc7bd367ab4b5027a7f80686b1e229c62e43c90b (2011-05-12).

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Reuse SCM_BYTEVECTOR_TYPED_LENGTH in scm_array_get_handle
	* libguile/bytevectors.h (SCM_BYTEVECTOR_TYPE_SIZE,
	  SCM_BYTEVECTOR_TYPED_LENGTH): Moved from libguile/bytevectors.c.

	* libguile/array-handle.c (scm_array_get_handle): Reuse
	  SCM_BYTEVECTOR_TYPED_LENGTH.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Avoid unneeded internal use of array handles
	* libguile/arrays.c (scm_shared_array_root): Adopt uniform check order.

	  (scm_shared_array_offset, scm_shared_array_increments): Use the array
	  fields directly just as scm_shared_array_root does.

	  (scm_c_array_rank): Moved from libguile/generalized-arrays.c. Don't
	  use array handles, but follow the same type check sequence as the
	  other array functions (shared-array-root, etc).

	  (scm_array_rank): Moved from libguile/generalized-arrays.h.

	* libguile/arrays.h: Move prototypes here.

	* test-suite/tests/arrays.test: Tests for shared-array-offset,
	  shared-array-increments.

2016-11-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix compilation of rank 0 typed array literals
	* module/system/vm/assembler.scm (simple-uniform-vector?): array-length
	  fails for rank 0 arrays; fix the shape condition.

	* test-suite/tests/arrays.test: Test reading of #0f64(x) in compilation
	  context.

2016-11-22  Andy Wingo  <wingo@pobox.com>

	Merge api-{data,compound}.texi
	* doc/ref/api-compound.texi: Remove.
	* doc/ref/api-data.texi: Fold "Compound Data Types" and "Simple Data
	  Types" into just "Data Types".  The distinction didn't work.
	* doc/ref/guile.texi:
	* doc/ref/Makefile.am:
	* doc/ref/srfi-modules.texi: Adapt.

	Add NEWS item about mutexes
	* NEWS: Add entry.

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

	Deprecate dynamic roots
	* libguile/root.h:
	* libguile/root.c: Remove these files.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_internal_cwdr, scm_call_with_dynamic_root)
	  (scm_dynamic_root, scm_apply_with_dynamic_root): Deprecate.

	Remove all root.h usage, which was vestigial.

	* module/ice-9/serialize.scm: Use (current-thread) instead
	  of (dynamic-root).

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

	Update join-thread docs
	* doc/ref/api-scheduling.texi (Threads): Joining a foreign thread is an
	  error.
	* NEWS: Update.

2016-11-19  Andy Wingo  <wingo@pobox.com>

	Add asyncs test
	* test-suite/tests/asyncs.test: New file.

	Inline interrupts
	* libguile/async.c:
	* libguile/async.h (scm_i_async_push, scm_i_async_pop): Make internally
	  available.
	* libguile/vm-engine.c (vm_engine): Invoke interrupts inline.  Add
	  return-from-interrupt instruction.
	* libguile/vm.c (vm_handle_interrupt_code): New "builtin".

2016-11-18  Andy Wingo  <wingo@pobox.com>

	Refactor async handling to be FIFO
	* libguile/async.c (scm_i_async_push, scm_i_async_pop): New helpers.
	  (scm_async_tick, scm_system_async_mark_for_thread): Use the new
	  helpers.

2016-11-18  Andy Wingo  <wingo@pobox.com>

	Remove SCM_DEBUG_CELL_ACCESSES==1
	Since the move to BDW-GC this option has not been useful.

	* libguile/__scm.h (SCM_DEBUG_CELL_ACCESSES): Remove default
	  definition.
	* libguile/gc.h: Add comment about cells.
	  (SCM_VALIDATE_CELL): Remove.  I did a search on the internet and I
	  found no external users.
	  (SCM_CELL_WORD, SCM_CELL_OBJECT, SCM_SET_CELL_WORD)
	  (SCM_SET_CELL_OBJECT, SCM_CELL_OBJECT_LOC): Remove SCM_VALIDATE_CELL
	  uses.
	* libguile/gc.c (scm_debug_cell_accesses_p)
	  (scm_expensive_debug_cell_accesses_p)
	  (scm_debug_cells_gc_interval, scm_i_expensive_validation_check)
	  (scm_assert_cell_valid): Remove bindings only available when
	  SCM_DEBUG_CELL_ACCESSES was 1.
	* libguile/list.c (scm_list_n): Remove SCM_VALIDATE_CELL usage.

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

	Explicit interrupt handling in VM
	* libguile/foreign.c (CODE, get_foreign_stub_code): Add explicit
	  handle-interrupts and return-values calls, as foreign-call will fall
	  through.
	* libguile/gsubr.c (A, B, C, AB, AC, BC, ABC, SUBR_STUB_CODE)
	  (scm_i_primitive_call_ip): Same.
	* libguile/vm-engine.c (VM_HANDLE_INTERRUPTS): Inline into
	  handle-interrupts.
	  (RETURN_ONE_VALUE, RETURN_VALUE_LIST): Inline into callers, and fall
	  through instead of returning.
	  (BR_BINARY, BR_UNARY, BR_ARITHMETIC, BR_U64_ARITHMETIC): Remove
	  conditional VM_HANDLE_INTERRUPTS, as the compiler already inserted the
	  handle-interrupts calls if needed.
	  (vm_engine): Remove VM_HANDLE_INTERRUPTS invocations except in the
	  handle-interrupts instruction.

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

	Add handle-interrupts inst and compiler pass
	* libguile/vm-engine.c (vm_engine): Remove initial VM_HANDLE_INTERRUPTS
	  call; surely our caller already handled interrupts.  Add
	  handle-interrupts opcode.
	* am/bootstrap.am (SOURCES):
	* module/Makefile.am (SOURCES): Add handle-interrupts.scm.
	* module/system/vm/assembler.scm (system):
	* module/language/cps/compile-bytecode.scm (compile-function):
	  (lower-cps): Add handle-interrupts support.
	* module/language/cps/handle-interrupts.scm: New file.

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

	Slim thread cleanup
	* libguile/threads.c (on_thread_exit): Clean up the cleanup.  We no
	  longer need to re-enter Guile mode, and some of the comments were
	  incorrect.

	join-thread in Scheme
	* module/ice-9/threads.scm (join-thread): Implement in Scheme.
	  (call-with-new-thread): Arrange to record values in a weak table and
	  signal the join cond.
	  (with-mutex): Move up definition; call-with-new-thread needs it.  (How
	  was this working before?)
	* libguile/threads.c (guilify_self_1, guilify_self_2, do_thread_exit):
	  Remove join queue management.
	* libguile/threads.c (scm_join_thread, scm_join_thread_timed): Call out
	  to Scheme.
	  (scm_init_ice_9_threads): Capture join-thread var.

	scm_spawn_thread uses call-with-new-thread
	* libguile/throw.h (scm_i_make_catch_body_closure)
	  (scm_i_make_catch_handler_closure): Add scm_i_ prefix and make
	  available for internal use.
	* libguile/throw.c: Adapt.
	* libguile/threads.c (scm_spawn_thread): Rewrite in terms of
	  scm_call_with_new_thread.

2016-11-13  Andy Wingo  <wingo@pobox.com>

	Fix crasher in scm_system_async_mark_for_thread
	* libguile/async.c (scm_system_async_mark_for_thread): Only signal the
	  cond if there is a wait mutex.

	More comments in threads.c
	* libguile/threads.c (struct scm_mutex): Better comments.

	Optimize lock-mutex
	* libguile/threads.c (lock_mutex, scm_timed_lock_mutex): As with
	  unlock_mutex before, optimize by specializing to the mutex kind.
	  Also, avoid lock thrashing after a return from block_self.

	Improve mutexes / condition variable implementation
	* libguile/threads.c (scm_timed_lock_mutex): Use "level" field only for
	  recursive mutexes.
	  (unlock_mutex, scm_unlock_mutex): Factor implementation back out of
	  scm_unlock_mutex (doh?), but in such a way that can specialize against
	  mutex type.
	  (scm_mutex_level): Only look at level for recursive mutexes.
	  (scm_mutex_locked_p): Look at owner field, not level field.
	  (timed_wait, scm_timed_wait_condition_variable): Factor implementation
	  out, as above with unlock-mutex.  Specialize relocking of the Guile
	  mutex.

	Refactor GC implications of thread sleep
	* libguile/async.c (struct scm_thread_wake_data): Move definition here.
	  (scm_i_setup_sleep): Remove "sleep_object".  Caller now responsible
	  for scm_remember_upto_here_1 as appropriate.
	  (scm_system_async_mark_for_thread): Remove scm_remember_upto_here_1
	  call.
	* libguile/async.h (scm_i_setup_sleep): Adapt prototype.
	* libguile/threads.h (struct scm_thread_wake_data): Remove definition.
	* libguile/threads.c (block_self): Remove sleep_object argument.
	  (scm_join_thread_timed, scm_timed_lock_mutex)
	  (scm_timed_wait_condition_variable, scm_std_select): Adapt.

	Unlocked mutexes don't have owners
	* libguile/threads.c (scm_unlock_mutex)
	  (scm_timed_wait_condition_variable): Unlocked mutexes should never
	  have owners.

	Put mutex kind in SMOB flags
	* libguile/threads.c (struct scm_mutex, SCM_MUTEX_KIND, scm_make_mutex)
	  (scm_timed_lock_mutex, scm_unlock_mutex)
	  (scm_timed_wait_condition_variable): Mutex kind in SMOB flags.

	Rename Guile's internal mutexes and condvars
	* libguile/threads.c: Rename fat_mutex to struct scm_mutex, and likewise
	  for scm_cond.

	Internal threads refactor
	* libguile/threads.c: Inline "fat mutexes" and "fat conds" into their
	  users.  These are just Guile mutexes and Guile condition variables.

2016-11-07  Christopher Allan Webber  <cwebber@dustycloud.org>

	doc: Adjust capitalization for "HTTPS" and "GnuTLS".
	* doc/ref/web.texi (open-socket-for-uri): Adjust capitalization.

2016-11-07  Christopher Allan Webber  <cwebber@dustycloud.org>

	web: Add https support through gnutls.
	Since importing gnutls directly would result in a dependency cycle,
	we load gnutls lazily.

	This uses code originally written for Guix by Ludovic Courtès.

	* module/web/client.scm: (%http-receive-buffer-size)
	  (gnutls-module, ensure-gnutls, gnutls-ref, tls-wrap): New variables.
	  (open-socket-for-uri): Wrap in tls when uri scheme is https.
	* doc/ref/web.texi (open-socket-for-uri): Document gnutls usage.

2016-11-06  Andy Wingo  <wingo@pobox.com>

	Update NEWS.
	* NEWS: Update.

	Minor editing in api-scheduling.texi
	* doc/ref/api-scheduling.texi: Fix a couple editing mistakes.

	Update documentation on mutexes
	* doc/ref/api-scheduling.texi (Mutexes and Condition Variables):
	  Update.

2016-11-05  Andy Wingo  <wingo@pobox.com>

	scm_timed_lock_mutex replaces scm_lock_mutex_timed
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_lock_mutex_timed): Deprecate.
	* libguile/threads.h:
	* libguile/threads.c (scm_timed_lock_mutex): New function.
	  (scm_join_thread): Fix formatting.
	  (scm_lock_mutex): Fix formatting and update to scm_timed_lock_mutex
	  change.
	  (scm_try_mutex): Update to scm_timed_lock_mutex.

	Update mutex documentation
	* doc/ref/api-scheduling.texi (Mutexes and Condition Variables): Add
	  foreboding preface.

	Separate fat mutex unlock and wait operations
	* libguile/threads.c (fat_mutex_unlock, fat_mutex_wait): Separate wait
	  from unlock.
	  (scm_unlock_mutex, scm_timed_wait_condition_variable): Adapt.

	Back to simple unlock-mutex
	* libguile/threads.c (scm_unlock_mutex): Bind to unlock-mutex.
	* libguile/threads.h: Remove scm_unlock_mutex_timed.
	* libguile/deprecated.h: Add scm_unlock_mutex_timed.
	* libguile/deprecated.c (scm_unlock_mutex_timed): Deprecate.
	* test-suite/tests/threads.test: Update unlock-mutex tests to use
	  wait-condition-variable if they would wait on a cond.

	Replace scm_make_mutex_with_flags
	* libguile/threads.c (enum fat_mutex_kind): New data type, replacing
	  separate flags.
	  (struct fat_mutex): Adapt.
	  (make_fat_mutex): Fat mutexes can only be one of three kinds, not one
	  of 4 kinds.  (Recursive unowned mutexes are not a thing.)
	  (scm_make_mutex): Adapt.
	  (scm_make_mutex_with_kind): New function, replacing
	  scm_make_mutex_with_flags.  Still bound to make-mutex.
	  (scm_make_recursive_mutex): Adapt.
	  (fat_mutex_lock, fat_mutex_unlock): Adapt.
	* libguile/threads.h (scm_make_mutex_with_kind): New decl.
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_make_mutex_with_flags): Deprecate.

	Remove unchecked-unlock facility from Guile mutexes
	* libguile/threads.c (fat_mutex): Remove unchecked_unlock member.
	  (make_fat_mutex): Adapt.
	  (scm_make_mutex_with_flags): Remove unchecked-unlock flag.
	  (scm_make_recursive_mutex): Likewise.
	  (fat_mutex_unlock): Remove unchecked-unlock case.
	* test-suite/tests/threads.test: Remove unchecked-unlock test.

	Recursively locking a SRFI-18 mutex blocks
	* libguile/threads.c (fat_mutex_lock): allow-external-unlock mutexes
	  can't be recursive, but a recursive lock attempt can be unblocked by
	  an external thread, so these mutexes shouldn't throw an error on
	  recursive lock attempts.
	* test-suite/tests/srfi-18.test: Add tests.

	SRFI-18 mutexes are not recursive
	* module/srfi/srfi-18.scm (make-mutex): Not recursive.

	Move more functionality to SRFI-18 mutex-unlock!
	* module/srfi/srfi-18.scm (mutex-unlock!): Implement the
	  ignore-unlock-errors and wait-condition-variable behavior of
	  mutex-unlock! directly, without relying on Guile.

	Remove fat mutex abandoned mutex error
	* libguile/threads.c (fat_mutex_lock): Remove abandoned mutex error, as
	  SRFI-18 is responsible for this.
	* test-suite/tests/threads.test: Update test.

	Remove thread held pthread_mutex field
	* libguile/threads.h (scm_i_thread):
	* libguile/threads.c (guilify_self_1, on_thread_exit)
	  (scm_pthread_cond_wait, scm_pthread_cond_timedwait): The thread-local
	  held_mutex field is no longer needed, now that we cancel threads via
	  interrupts instead of pthread_cancel.

	Remove thread-local weak mutex set
	* libguile/threads.h (scm_i_thread):
	* libguile/threads.c (guilify_self_1, do_thread_exit, fat_mutex_lock):
	  Remove thread-local weak mutex set.

	SRFI-18 manages own mutex "abandoned" state
	* module/srfi/srfi-18.scm (<mutex>, with-thread-mutex-cleanup)
	  (make-mutex, mutex-state, abandon-mutex!, mutex-lock!): Manage
	  "abandoned" bit on Scheme side with no need for thread cleanup
	  handler.

2016-11-04  Andy Wingo  <wingo@pobox.com>

	Remove lock-mutex owner facility
	* libguile/threads.c (scm_lock_mutex_timed): Deprecate "owner"
	  argument.
	  (fat_mutex_lock): Remove owner argument.
	  (fat_mutex_unlock): Don't pass owner to scm_lock_mutex_timed.
	* test-suite/tests/threads.test: Remove tests of mutex-owner.

	SRFI-18 threads disjoint from guile threads
	* doc/ref/srfi-modules.texi (SRFI-18 Threads): Update.
	* module/srfi/srfi-18.scm (<mutex>): Add owner field.
	  (<thread>): New data type.
	  (make-thread): Adapt for boxed threads.
	  (thread-start!, thread-terminate!): Likewise.
	  (mutex-state): Adapt for boxed threads.
	  (mutex-lock!, mutex-unlock!): Update owner field.

	Update SRFI-18 documentation.
	* doc/ref/srfi-modules.texi (SRFI-18): Update documentation for disjoint
	  mutexes and cond variables.

	srfi-18 condition variables disjoint
	* module/srfi/srfi-18.scm (<condition-variable>): New data type.
	  (make-thread): Use srfi-18 interfaces.
	  (mutex-unlock!): Adapt to optional cond argument being disjoint from
	  Guile condition variables.
	  (make-condition-variable, condition-variable-signal!)
	  (condition-variable-broadcast!): Adapt.

	Remove export srfi-18 never had
	* module/srfi/srfi-18.scm (condition-variable-wait!): Remove undefined
	  export.

	SRFI-18 mutexes disjoint from Guile mutexes
	* module/srfi/srfi-18.scm (<mutex>): Define as a wrapper type around
	  Guile mutexes.
	  (thread-mutexes): New variable.
	  (with-thread-mutex-cleanup): New facility to abandon mutexes on
	  SRFI-18 thread exit.  Not yet used.
	  (make-thread): Use SRFI-18 interfaces.
	  (make-mutex): Reimplement for our boxed mutexes.
	  (mutex-state): Adapt.
	  (mutex-lock!): Adapt.
	  (mutex-unlock!): Adapt.
	* test-suite/tests/srfi-18.test: Don't assume that SRFI-18 mutexes are
	  the same as Guile mutexes.

2016-11-02  Andy Wingo  <wingo@pobox.com>

	try-mutex in terms of mutex-lock
	* libguile/threads.c (scm_try_mutex): Just call scm_lock_mutex_timed
	  with a zero timeout.
	* module/ice-9/threads.scm (try-mutex): Likewise.

	Fix typo in threads documentation
	* doc/ref/api-scheduling.texi (Threads): Fix typo.

2016-11-01  Andy Wingo  <wingo@pobox.com>

	Deprecate critical sections
	* NEWS: Deprecate critical sections.
	* doc/ref/api-scheduling.texi (Critical Sections): Remove.
	* libguile/async.c:
	* libguile/async.h:
	* libguile/deprecated.c:
	* libguile/deprecated.h:
	* libguile/threads.c:
	* libguile/threads.h: Deprecate critical section API.

	Threads no longer track critical section level
	* libguile/threads.h (scm_i_thread):
	* libguile/threads.c (guilify_self_1): Remove critical_section_level
	  member of scm_i_thread.
	* libguile/async.c (scm_critical_section_end)
	  (scm_critical_section_start): Remove bookkeeping.

	Remove call/cc assertion about critical sections
	* libguile/continuations.c (scm_dynthrow): Remove assertion about
	  critical section level; it's just a mutex anyway.

	Remove last critical section use
	* libguile/scmsigs.c (signal_handler_lock): New variable.
	  (scm_sigaction_for_thread): Block asyncs and use a mutex instead of
	  using scm_dynwind_critical_section.

	Mutex in dynamic linker
	* libguile/dynl.c (scm_dynamic_link, scm_dynamic_unlink)
	  (scm_dynamic_pointer): Use a mutex to provide thread-safety.

	Remove critical section in scm_debug_options
	* libguile/debug.c (scm_debug_options): Remove critical section.  There
	  is no memory corruption hazard and racing callers to debug options
	  won't produce sensible results anyway; or anyway they will be the same
	  as racing vector-set!.

	Mutex instead of critical section in gc.c
	* libguile/gc.c (scm_gc_protect_object, scm_gc_unprotect_object): Use a
	  mutex instead of a critical section.  Remove dead code.

	Mutex instead of critical section in GOOPS
	* libguile/goops.c (scm_sys_modify_instance)
	  (scm_sys_modify_class): Use a mutex instead of a critical section.

	Simplify critical section implementation
	* libguile/async.h (SCM_CRITICAL_SECTION_START)
	  (SCM_CRITICAL_SECTION_END): Define in just one way.
	* libguile/async.c (critical_section_mutex): New static variable.
	  (scm_critical_section_start, scm_critical_section_end): Inline
	  internal body of critical section gates.
	  (scm_init_async): Init critical_section_mutex.
	* libguile/threads.c (scm_threads_prehistory): Don't declare critical
	  section mutex here.

	Mutex instead of critical sectoin in symbol->keyword
	* libguile/keywords.c (scm_symbol_to_keyword): Use a mutex in a dynwind
	  instead of a critical section.

	Mutexes instead of critical sections in stime.c
	* libguile/stime.c (scm_current_time): No need for a critical section
	  around time().
	  (tz_lock): New mutex.
	  (scm_localtime): Use tz_lock in a dynwind.  Fixes bug in which
	  critical section was never left on error.
	  (scm_gmtime, scm_mktime, scm_strftime, scm_strptime): Use a normal
	  mutex instead of a critical section.

	Remove unused internal definitions
	* libguile/async.h (scm_i_pthread_mutex_lock_block_asyncs)
	  (scm_i_pthread_mutex_unlock_unblock_asyncs): Remove unused internal
	  definitions.

	regexec comment fix
	* libguile/regex-posix.c (SCM_DEFINE): Remove comment about
	  threadsafety, given that regexec does appear to be threadsafe.

	sigaction critical section refactor.
	* libguile/scmsigs.c (scm_sigaction_for_thread): Use critical section
	  dynwinds instead of SCM_CRITICAL_SECTION_START.

	threads: Use a mutex instead of a critical section.
	* libguile/threads.c: Replace uses of critical sections with a dedicated
	  mutex.

	Add scm_yield to manual alongside yield
	* doc/ref/api-scheduling.texi (Threads): Mention scm_yield.

	api-scheduling.texi: Syntactic cleanups.
	* doc/ref/api-scheduling.texi: Remove vestigial comments.

2016-10-31  Andy Wingo  <wingo@pobox.com>

	Remove thread cleanup facility
	* NEWS: Add entry.
	* doc/ref/api-scheduling.texi (Threads): Remove thread-cleanup docs.
	* libguile/threads.c (guilify_self_1, do_thread_exit):
	  (scm_set_thread_cleanup_x, scm_thread_cleanup): Remove these.
	* libguile/threads.h (scm_i_thread): Remove cleanup_handler.
	* module/ice-9/threads.scm:
	* module/ice-9/deprecated.scm (thread-cleanup, set-thread-cleanup!):
	  Remove.
	* test-suite/tests/threads.test: Adapt to test cancel-thread return
	  values and not test thread-cleanup procs.

	REPL server avoids thread cleanup handlers
	* module/system/repl/server.scm (serve-client): Avoid thread cleanup
	  handlers.

	srfi-18: thread-terminate! without cleanup handlers
	* module/srfi/srfi-18.scm (%cancel-sentinel, thread-terminate!): Just
	  use cancel-thread to cause the thread to return a sentinel value.
	  (%timeout-sentinel): Rename from %sentinel.
	  (thread-join!): Adapt and transform %cancel-sentinel to a
	  &terminated-thread-exception.

	cancel-thread can take arguments
	* doc/ref/api-scheduling.texi (Threads):
	* module/ice-9/threads.scm (cancel-thread): Additional args to
	  cancel-thread will be returned by the thread.

	Trim srfi-18 thread startup machinery
	* module/srfi/srfi-18.scm (make-thread): Use just one cond/mutex pair
	  for signalling in both directions: waiting for launch and waiting for
	  start.

	Refactor thread-join! to use optional args.
	* module/srfi/srfi-18.scm (thread-join!): Use optional args.  Also don't
	  treat false return values from threads as meaning anything.

	Rationalize exception handling in srfi-18
	* module/srfi/srfi-18.scm (make-thread): Inline some helpers, and use
	  just one catch block.
	  (thread->exception): Move up definition.
	  (exception-handler-for-foreign-threads): Use this as the default
	  handler, not the one that squirrels away exceptions in
	  thread->exception.
	  (thread-terminate!): Don't instate an exception handler for the thread
	  cleanup proc.

	srfi-18: Avoid call/cc.
	* module/srfi/srfi-18.scm (with-exception-handlers-here): New function.
	  (wrap): Remove.
	  (thread-join!, mutex-lock!): Use with-exception-handlers-here instead
	  of the call/cc+wrap mess.

2016-10-30  Andy Wingo  <wingo@pobox.com>

	srfi-18: Inline uses of srfi-18-exception-preserver.
	* module/srfi/srfi-18.scm (srfi-18-exception-preserver): Inline into
	  call sites.

	srfi-18: Use srfi-35 conditions.
	* module/srfi/srfi-18.scm: Use srfi-35 conditions instead of our
	  home-grown equivalent system.
	  (thread-exception-handlers): Remove unused table.
	  (srfi-18-exception-handler): Always capture key consed to args; no
	  special case for bare key.
	* test-suite/tests/srfi-18.test (provided?): Adapt to reason always
	  being key+args.

	srfi-18: Use parameters.
	* module/srfi/srfi-18.scm: Use srfi-34 internally with srfi-34: prefix.
	  (current-exception-handler): Be a parameter.
	  (with-exception-handler): Adapt to current-exception-handler change.
	  (thread-join!, mutex-lock!): Adapt to use srfi-34: prefix.

	srfi-18: Use lambda* optional arguments.
	* module/srfi/srfi-18.scm (make-mutex, make-condition-variable): Use
	  optional arguments.

	srfi-18: Simplify thread-sleep!, thread-terminate!.
	* module/srfi/srfi-18.scm (thread-sleep!): Use `when'.
	  (thread-terminate!): Simplify.

	srfi-18: Use `match' in thread-start!.
	* module/srfi/srfi-18.scm (thread-start!): Use `match'.

	srfi-18: Improve style.
	* module/srfi/srfi-18.scm (raise): Rely on SRFI-34 to #:replace raise.
	  (make-thread): Use lambda* and when.

	Fix srfi-34 indentation
	* module/srfi/srfi-34.scm (with-exception-handler): Fix indentation.

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

	cancel-thread via asyncs, not pthread_cancel
	* module/ice-9/threads.scm (cancel-tag): New variable.
	  (cancel-thread): New Scheme function.
	  (call-with-new-thread): Install a prompt around the thread.
	* libguile/threads.h (scm_i_thread): Remove cancelled member.
	* libguile/threads.c (scm_cancel_thread): Call out to Scheme.  Always
	  available, and works on the current thread too.
	  (scm_set_thread_cleanup_x, scm_thread_cleanup): Adapt.
	  (scm_init_ice_9_threads): Capture cancel-thread var.
	* doc/ref/api-scheduling.texi (Threads): Update.
	* NEWS: Update.

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

	Use atomics for async interrupts
	* libguile/__scm.h (SCM_TICK): Always define as scm_async_tick().
	* libguile/error.c (scm_syserror, scm_syserror_msg):
	* libguile/fports.c (fport_read, fport_write):
	* libguile/_scm.h (SCM_SYSCALL): Replace SCM_ASYNC_TICK with
	  scm_async_tick ().
	  (SCM_ASYNC_TICK, SCM_ASYNC_TICK_WITH_CODE)
	  (SCM_ASYNC_TICK_WITH_GUARD_CODE): Remove internal definitions.  We
	  inline into vm-engine.c, the only place where it matters.
	* libguile/async.h:
	* libguile/async.c (scm_async_tick, scm_i_setup_sleep):
	  (scm_i_reset_sleep, scm_system_async_mark_for_thread):
	* libguile/threads.h (struct scm_thread_wake_data):
	* libguile/threads.h (scm_i_thread):
	* libguile/threads.c (block_self, guilify_self_1, scm_std_select):
	  Rewrite to use sequentially-consistent atomic references.
	* libguile/atomics-internal.h (scm_atomic_set_pointer):
	  (scm_atomic_ref_pointer): New definitions.
	* libguile/finalizers.c (queue_finalizer_async): We can allocate, so
	  just use scm_system_async_mark_for_thread instead of the set-cdr!
	  shenanigans.
	* libguile/scmsigs.c (take_signal):
	* libguile/gc.c (queue_after_gc_hook): Adapt to new asyncs mechanism.
	  Can't allocate but we're just manipulating the current thread when no
	  other threads are running so we should be good.
	* libguile/vm-engine.c (VM_HANDLE_INTERRUPTS): Inline the async_tick
	  business.

	Move call-with-new-thread to Scheme
	* libguile/threads.c (scm_call_with_new_thread): Trampoline to Scheme.
	  (launch_data, really_launch, scm_sys_call_with_new_thread): Simplify.
	  (scm_init_ice_9_threads): Capture call-with-new-thread variable.
	* module/ice-9/threads.scm (call-with-new-thread): Add implementation in
	  Scheme.  Should allow for easier cancel-thread via prompt abort.

2016-10-25  Julian Graham  <joolean@undecidable.net>

	Fix tree-il code generation for ECMAscript `new' expression.
	The compiler was producing `((toplevel foo))' instead of `(toplevel foo)'.
	Changed to use `call' form with target type and spliced constructor
	arguments.

	* module/language/ecmascript/compile-tree-il.scm (comp): Replace `@impl'
	  shorthand with `call' + `@implv' for better control over resulting
	  tree-il.
	* test-suite/tests/ecmascript.test (compiler): Add test for "new Object();"

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

	Move thread bindings to (ice-9 threads)
	* libguile/init.c (scm_i_init_guile): Don't call scm_init_thread_procs.
	* libguile/threads.c (scm_init_ice_9_threads): Rename from
	  scm_init_thread_procs, make static.
	  (scm_init_threads): Register scm_init_thread_procs extension.
	* libguile/threads.h (scm_init_thread_procs): Remove decl.
	* module/ice-9/boot-9.scm: Load (ice-9 threads), so that related side
	  effects occur early.
	* module/ice-9/deprecated.scm (define-deprecated): Fix to allow
	  deprecated bindings to appear in operator position.  Export deprecated
	  bindings.
	  (define-deprecated/threads, define-deprecated/threads*): Trampoline
	  thread bindings to (ice-9 threads).
	* module/ice-9/futures.scm: Use ice-9 threads.
	* module/ice-9/threads.scm: Load scm_init_ice_9_threads extension.
	  Reorder definitions and imports so that the module circularity
	  with (ice-9 futures) continues to work.
	* module/language/cps/intmap.scm:
	* module/language/cps/intset.scm:
	* module/language/tree-il/primitives.scm: Use (ice-9 threads).
	* module/language/cps/reify-primitives.scm: Reify current-thread
	  in (ice-9 threads) module.
	* module/srfi/srfi-18.scm: Use ice-9 threads with a module prefix, and
	  adapt all users.  Use proper keywords in module definition form.
	* test-suite/tests/filesys.test (test-suite):
	* test-suite/tests/fluids.test (test-suite):
	* test-suite/tests/srfi-18.test: Use ice-9 threads.
	* NEWS: Add entry.
	* doc/ref/api-scheduling.texi (Threads): Update.
	* doc/ref/posix.texi (Processes): Move current-processor-count and
	  total-processor-count docs to Threads.

	Deferred module observers via a parameter
	* module/ice-9/boot-9.scm (module-defer-observers): Instead of being a
	  global flag, change to be a parameter.
	  (module-defer-observers-mutex, module-defer-observers-table): Remove.
	  (module-modified): Adapt.
	  (call-with-deferred-observers): Adapt.  Allow nested called.

2016-10-19  Andy Wingo  <wingo@pobox.com>

	Adapt run-server* to change to `accept'.
	* module/system/repl/server.scm (run-server*): Adapt to new #f return
	  value of accept on non-blocking ports.
	  (errs-to-retry): Remove variable.

2016-10-18  Andy Wingo  <wingo@pobox.com>

	Small api-scheduling.texi reorder
	* doc/ref/api-scheduling.texi: Put "Threads" section at beginning of
	  scheduling chapter.

	Update "Asyncs" section of manual.
	* doc/ref/api-scheduling.texi (Asyncs): Update.

2016-10-17  Andy Wingo  <wingo@pobox.com>

	NEWS item for deprecated user asyncs
	* NEWS: Add news.

	Deprecate user asyncs
	* libguile/async.c:
	* libguile/async.h:
	* libguile/deprecated.c:
	* libguile/deprecated.h (scm_async, scm_async_mark, scm_run_asyncs):
	  Deprecate these functions, which comprise the "users asyncs" facility.
	* module/oop/goops.scm: Adapt to <async> deprecation.
	* doc/ref/api-scheduling.texi:
	* doc/ref/libguile-concepts.texi:
	* doc/ref/libguile-foreign-objects.texi:
	* doc/ref/posix.texi: Remove documentation on user asyncs, and replace
	  references to "system asyncs" to be just "asyncs".

	Deprecate arbiters
	* libguile/arbiters.c:
	* libguile/arbiters.h:
	* test-suite/tests/arbiters.test: Delete files.
	* libguile/deprecated.c:
	* libguile/deprecated.h: Move arbiters code here.
	* doc/ref/api-scheduling.texi: Remove section on arbiters.
	* libguile.h:
	* libguile/Makefile.am:
	* libguile/init.c:
	* module/oop/goops.scm:
	* test-suite/Makefile.am: Remove mention of arbiters.
	* NEWS: Update.

	Fold 2.1.4 news into 2.2 news
	* NEWS: Fold 2.1.4 news into main 2.2 news.

2016-10-11  Andy Wingo  <wingo@pobox.com>

	Fix slot allocation for prompts
	* module/language/cps/slot-allocation.scm
	  (add-prompt-control-flow-edges): Fix to add links from prompt bodies
	  to handlers, even in cases where the handler can reach the body but
	  the body can't reach the handler.
	* test-suite/tests/compiler.test ("prompt body slot allocation"): Add
	  test case.

	Texinfo serialization: add braces when needed
	* module/texinfo/serialize.scm (include, empty-command, inline-text):
	  (inline-args, inline-text-args, eol-text-args, eol-text, eol-args)
	  (environ, table-environ, paragraph, item, entry, fragment, serialize)
	  (stexi->texi): Pass extra rest? parameter around to indicate arguments
	  that can take any number of subforms without being surrounded by
	  braces.
	  (embrace, serialize-text-args): Surround non-rest arguments with
	  braces.
	* test-suite/tests/texinfo.serialize.test: Add tests.

	Remove .gnuploadrc.
	* .gnuploadrc: Remove file.

2016-09-14  Andy Wingo  <wingo@pobox.com>

	Fix compile warning in posix.c
	* libguile/posix.c (scm_system_star): Fix SIG_IGN usage to not emit a
	  warning.  Still broken on Windows64 and similar systems though!

	Bump version to 2.1.4
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to 2.1.4.

	Update NEWS.
	* NEWS: Update.

	Avoid deprecated _IONBF in http tests
	* test-suite/tests/web-http.test ("chunked encoding"): Avoid deprecated
	  _IONBF.

	Avoid deprecated statprof interface in test
	* test-suite/tests/statprof.test ("return values"): Avoid deprecated
	  with-statprof.

2016-09-06  Andy Wingo  <wingo@pobox.com>

	Fix cross-compilation of negative fixnums
	* module/system/vm/assembler.scm (encoder): Use immediate-bits instead
	  of object-address, to fix cross-compilation.

2016-09-06  Andy Wingo  <wingo@pobox.com>

	Compiler support for atomics
	* doc/ref/vm.texi (Inlined Atomic Instructions): New section.
	* libguile/vm-engine.c (VM_VALIDATE_ATOMIC_BOX, make-atomic-box)
	  (atomic-box-ref, atomic-box-set!, atomic-box-swap!)
	  (atomic-box-compare-and-swap!): New instructions.
	* libguile/vm.c: Include atomic and atomics-internal.h.
	  (vm_error_not_a_atomic_box): New function.
	* module/ice-9/atomic.scm: Register primitives with the compiler.
	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  support for atomic ops.
	* module/language/cps/effects-analysis.scm: Add comment about why no
	  effects analysis needed.
	* module/language/cps/reify-primitives.scm (primitive-module): Add case
	  for (ice-9 atomic).
	* module/language/tree-il/primitives.scm (*effect-free-primitives*):
	  (*effect+exception-free-primitives*): Add atomic-box?.
	* module/system/vm/assembler.scm: Add new instructions.

	* test-suite/tests/atomic.test: Test with compilation and
	  interpretation.

2016-09-06  Andy Wingo  <wingo@pobox.com>

	Fix fixnum min/max for assembler
	* module/system/vm/assembler.scm (immediate-bits): I am a complete and
	  total idiot and got the fixnum mins and maxes swapped.

	Add atomic boxes
	* doc/ref/api-scheduling.texi (Atomics): New manual section.
	* libguile.h: Include atomic.h.
	* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  (DOT_X_FILES, DOT_DOC_FILES, modinclude_HEADERS): Add atomic.
	* libguile/atomic.c:
	* libguile/atomic.h: New files.
	* libguile/atomics-internal.h (scm_atomic_set_scm, scm_atomic_ref_scm)
	  (scm_atomic_swap_scm, scm_atomic_compare_and_swap_scm): New
	  facilities.
	* libguile/goops.c (class_atomic_box, scm_sys_goops_early_init): Add
	  support for <atomic-box>.  Remove duplicate <keyword> fetch.
	* libguile/init.c (scm_i_init_guile): Call scm_register_atomic_box.
	* libguile/print.c (iprin1): Add atomic box case.
	* libguile/tags.h (scm_tc7_atomic_box): New tag.
	* libguile/validate.h (SCM_VALIDATE_ATOMIC_BOX): New macro.
	* module/Makefile.am (SOURCES): Add ice-9/atomic.scm.
	* module/ice-9/atomic.scm: New file.
	* module/oop/goops.scm (<atomic-box>): New var.

	Reorder tc7 type codes
	* libguile/tags.h: Reorder type codes so that they are in numeric order
	  in the header file; no type code value is changed.

	Tweak value of tc7-smob.
	* libguile/tags.h (scm_tc7_smob):
	* module/system/base/types.scm (%tc7-smob): Tweak this value, just to
	  prove that it can be done.  Remove scary comment.

	Convert tc7 values to hex in tags.h and elsewhere
	* libguile/tags.h:
	* module/system/base/types.scm:
	* module/system/vm/assembler.scm: Convert tc7 values to hex.  No change
	  otherwise.

2016-09-05  Wilfred Hughes  <me@wilfred.me.uk>

	Clarify bootstrap docs
	* doc/ref/vm.texi: Add a sentence stating which parts of the bytecode
	  toolchain are in C, and which are in Scheme. This avoids confusion if
	  users assume Guile==Scheme and so assume the whole toolchain is in
	  Scheme.

2016-09-03  Robin Templeton  <robin@terpri.org>

	Check for missing debug info in print-program
	* module/system/vm/program.scm (print-program): Check the return value
	  of find-program-debug-info. Fixes #24320.

2016-09-02  Andy Wingo  <wingo@pobox.com>

	Fix typo in Nil documentation
	* doc/ref/api-languages.texi (Nil): Fix typo.  Thanks to Wilfred Hughes
	  for the report.  Fixes #24342.

	Better char<? compilation
	* module/language/tree-il/primitives.scm
	  (character-comparison-expander): Expand out char<? and friends to <,
	  unboxing the char arguments.
	* module/language/cps/types.scm:
	* module/language/cps/effects-analysis.scm: Remove mention of char<? and
	  friends as we won't see them any more.  Also fixes #24318.

	GOOPS caches created vtables
	* libguile/goops.c (scm_i_define_class_for_vtable): Cache created
	  vtables.  Fixes #24286.
	* test-suite/tests/goops.test ("classes for built-in types"): Add
	  tests.

2016-09-01  Andy Wingo  <wingo@pobox.com>

	Better unboxing
	* module/language/cps/specialize-numbers.scm (truncate-u64): New helper,
	  truncates a SCM value.
	  (specialize-u64-binop): Add ulogxor case.
	  (sigbits-union, sigbits-intersect, sigbits-intersect3)
	  (next-power-of-two, range->sigbits, inferred-sigbits)
	  (significant-bits-handlers, define-significant-bits-handler):
	  (significant-bits-handler, compute-significant-bits): Add facility to
	  compute the bits in a value that are significant.
	  (specialize-operations): Unbox in more cases, when only u64 bits are
	  significant.  Unbox logxor.  Elide logand where it has no effect.

	Fabricated expression tweak in CSE
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	  u64->scm fabricates equivalence for scm->u64/truncate too.

	Add unboxed logxor on u64 values
	* libguile/vm-engine.c (ulogxor): New instruction.
	* module/language/cps/effects-analysis.scm (ulogxor):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/types.scm (ulogxor):
	* module/system/vm/assembler.scm (emit-ulogxor): Add support for new
	  instruction.
	* doc/ref/vm.texi (Unboxed Integer Arithmetic): Document ulogxor.

2016-08-31  Andy Wingo  <wingo@pobox.com>

	GC of non-blocking port does not block
	* libguile/ports.h (SCM_F_PORT_FINALIZING)
	  (SCM_PORT_FINALIZING_P, SCM_SET_PORT_FINALIZING): New private
	  definitions.
	* libguile/ports.c (finalize_port): Set the port-finalizing flag.
	  (scm_i_write_bytes): If the port is finalizing but output returned
	  EWOULDBLOCK, warn and discard the output.

	Only ptob->close() after read/write finish
	* libguile/Makefile.am (noinst_HEADERS): Add atomics-internal.h.
	* libguile/atomics-internal.h: New file.
	* libguile/ports-internal.h (refcount): New member.
	* libguile/ports.c (release_port, scm_dynwind_acquire_port): New
	  facility for acquiring a port within a dynwind.
	  (scm_port_poll, scm_i_read_bytes, scm_setvbuf, scm_end_input)
	  (scm_i_write_bytes, scm_char_ready_p, scm_seek)
	  (scm_truncate_file, trampoline_to_c_read)
	  (trampoline_to_c_write): Acquire port.
	  (scm_c_make_port_with_encoding): Init refcount to 1.
	  (scm_close_port): Release port.
	* doc/ref/api-io.texi (I/O Extensions): Add documentation

2016-08-31  Christopher Allan Webber  <cwebber@dustycloud.org>

	Fix example in make-custom-binary-input-port documentation
	* doc/ref/api-io.texi (Custom Ports): Add additional argument to example's
	  invocation of make-custom-binary-input-port.  Previously had mismatched arity
	  by missing "closed" argument.

2016-08-31  Andy Wingo  <wingo@pobox.com>

	Set rw_random correctly for all custom binary port types
	* libguile/r6rs-ports.c (custom_binary_port_random_access_p): Rename
	  from custom_binary_input_output_port_type, and use for all custom
	  binary port types.

	Avoid flushing buffers for ftell
	* libguile/ports.c (scm_seek): Avoid flushing buffers for an ftell.
	  Also allows non-random-access ports to ftell() if they have a seek
	  implementation, as is the case for custom binary ports with a
	  get-position function but no set-position function.
	* test-suite/tests/ports.test: Adapt expectations, reverting changes
	  made in April by me in b77fb752dd7e14876741ecb6360ef0319eae18e0.

	Require C99 to build Guile.
	* configure.ac: Require C99 or later.  Emacs does, therefore so can
	  we.  Note that by default GCC compiles in "gnu11" mode these days, and
	  this declaration doesn't change that.

2016-08-31  Christopher Allan Webber  <cwebber@dustycloud.org>

	Add tests for make-custom-binary-input/output-port
	* test-suite/tests/r6rs-ports.test ("8.2.13 Input/output ports"):
	  Add tests for custom binary input/output ports, copied from
	  existing binary input and binary output tests.

	Correct section number for "Input Ports" tests.
	* test-suite/tests/r6rs-ports.test: Correct "Input Ports" section heading
	  from "7.2.7" -> "8.2.7", "7.2.5" -> "8.2.5", "7.2.8" -> "8.2.8",
	  and "7.2.11" -> "8.2.11".

2016-08-31  Andy Wingo  <wingo@pobox.com>

	Move system* to posix.c, impl on open-process
	* libguile/simpos.c: Trim includes.
	  (scm_system_star): Move to posix.c.
	* libguile/simpos.h (scm_system_star): Remove.
	* libguile/posix.h (scm_system_star): Add.
	* libguile/posix.c (scm_system_star): Move here and implement in terms
	  of open-process.  This lets system* work on Windows.  Inspired by a
	  patch by Eli Zaretskii.
	  (start_child): Exit with 127 if the command isn't found.

2016-08-30  Andy Wingo  <wingo@pobox.com>

	Add file descriptor finalizers
	* doc/ref/posix.texi (Ports and File Descriptors): Document new
	  interfaces.
	* libguile/filesys.c (scm_close, scm_close_fdes)
	* libguile/fports.c (fport_close):
	* libguile/ioext.c (scm_primitive_move_to_fdes): Call
	  scm_run_fdes_finalizers.
	* module/ice-9/fdes-finalizers.scm:
	* test-suite/tests/fdes-finalizers.test:
	* libguile/fdes-finalizers.h:
	* libguile/fdes-finalizers.c: New files.
	* module/Makefile.am:
	* test-suite/Makefile.am:
	* libguile/Makefile.am:
	* libguile.h:
	* libguile/init.c: Wire up new files.

2016-08-28  Andy Wingo  <wingo@pobox.com>

	Remove duplicate documentation
	* doc/ref/posix.texi (Ports and File Descriptors): Remove duplicate
	  documentation for port-mode and setvbuf.

	Remove SCM_I_MAX_PORT_TYPE_COUNT
	* libguile/ports.h (SCM_I_MAX_PORT_TYPE_COUNT): Remove unused CPP
	  definition.

	ETag list headers accept sloppy etags
	* module/web/http.scm (parse-entity-tag): Add #:sloppy-delimiters
	  keyword argument, and return a second value indicating the end
	  position.
	  (parse-entity-tag-list): Use parse-entity-tag, so that we also accept
	  sloppy etags that aren't qstrings.
	* test-suite/tests/web-http.test ("request headers"): Add a test.

	Add prebuilt alias for x86_64-pc-linux-gnu
	* prebuilt/x86_64-pc-linux-gnu: Add as alias to
	  x86_64-unknown-linux-gnu.

2016-08-25  Andy Wingo  <wingo@pobox.com>

	Tweak to conversion strategy access
	* libguile/strings.c (scm_from_port_stringn, scm_to_port_stringn):
	  Access the conversion_strategy directly to make sure these functions
	  can run while the port is flushing on close.  Fixes web-http.test to
	  allow the closed flag to be atomically cleared on a port before
	  flushing.

	Fix exception when running ",help debug"
	* module/system/repl/command.scm (*command-table*): Remove entry for
	  ",procedure", a command removed a few months ago.

2016-08-08  sirgazil  <felipe.lopez@openmailbox.org>

	Fix typo about open-pipe
	* doc/ref/posix.texi (Pipes): Fix typo.

2016-08-08  James Clarke  <jrtc27@jrtc27.com>

	Recognize alpha as compilation target
	* module/system/base/target.scm (cpu-endianness): Add case for "alpha".
	(triplet-pointer-size): Likewise.

2016-08-08  sirgazil  <felipe.lopez@openmailbox.org>

	Fix typo about variable definitions
	* doc/ref/api-binding.texi (Top Level Variable Definitions): Fix typo.

2016-08-07  Ethan Stefan Day  <esday@ethan-stefan.net>

	Documentation fixes
	* doc/ref/api-compound.texi:
	* doc/ref/api-control.texi:
	* doc/ref/api-data.texi: Fix typos and clarify.

2016-08-07  David Kastrup  <dak@gnu.org>

	Let assv/assoc shortcircuit to assq where feasible
	* libguile/alist.c (scm_sloppy_assv, scm_sloppy_assoc):
	  (scm_assv, scm_assoc): Shortcircuit to scm_assq where feasible.

2016-08-07  Marek Vasut  <marex@denx.de>

	Recognize nios2 as compilation target
	Add support for the nios2 architecture.

2016-08-07  Andy Wingo  <wingo@pobox.com>

	Capture full path to GUILE_FOR_BUILD.
	* acinclude.m4: Capture full path to GUILE_FOR_BUILD.  Fixes #22342.

2016-08-07  Calvin Heim  <frofroggy@gmail.com>

	Fix grammar in api-compound.texi
	* doc/ref/api-compound.texi: Fix grammar.

2016-08-07  sirgazil  <felipe.lopez@openmailbox.org>

	Fix typo about pattern variables
	* doc/ref/sxml-match.texi (Matching XML Elements): Fix typo.

2016-08-07  Andy Wingo  <wingo@pobox.com>

	Manual recommends against SRFI-10
	* doc/ref/srfi-modules.texi (SRFI-10): Deprecate, or at least recommend
	  against.

2016-08-04  Andy Wingo  <wingo@pobox.com>

	Implement R6RS custom binary input/output ports
	* NEWS: Add new feature.
	* doc/ref/r6rs.texi (rnrs io ports):
	* doc/ref/api-io.texi (Custom Ports): Document new procedure.
	* libguile/r6rs-ports.h:
	* libguile/r6rs-ports.c (make_custom_binary_input_output_port)
	  (scm_make_custom_binary_input_output_port)
	  (custom_binary_input_output_port_random_access_p)
	  (initialize_custom_binary_input_output_ports)
	  (scm_init_r6rs_ports): Implement custom binary input/output ports.
	* module/rnrs/io/ports.scm (rnrs):
	* module/ice-9/binary-ports.scm (ice-9): Export
	  make-custom-binary-input/output-port.

	Fix compilation of `continue' in `while'.
	* module/language/cps/rotate-loops.scm (rotate-loops-in-function): Don't
	  attempt to rotate a loop whose header is a $prompt.  Fixes use of
	  `continue' in `while'.  Thanks to Nala Ginrut for the report :)

2016-07-25  Eli Zaretskii  <eliz@gnu.org>

	Avoid compilation warnings about alloca in read.c
	* libguile/read.c: Include alloca.h.

2016-07-25  Andy Wingo  <wingo@pobox.com>

	Fix --without-threads against threaded BDW-GC
	* libguile/gc.c (scm_storage_prehistory): Prevent BDW-GC from spawning
	  marker threads if Guile was built without threading support.

	Reimplement null-threads as inline functions
	* libguile/null-threads.h: Reimplement null-threads stubs for pthread
	  data types, initializers, and functions in terms of types and inline
	  functions instead of CPP macros.  Fixes unused-value warnings, and
	  tightens things up in general.
	  (scm_i_pthread_cleanup_push, scm_i_pthread_cleanup_pop): Remove these,
	  as they were unused and incorrect -- they would never run the cleanup
	  handler even if 1 was passed to pop.

	Use non-deprecated HAVE_STRUCT_TM_TM_ZONE
	* libguile/stime.c: Change uses of the deprecated HAVE_TM_ZONE to the
	  new HAVE_STRUCT_TM_TM_ZONE.

	Use gnulib for basename / dirname
	* libguile/filesys.c (scm_dirname, scm_basename): Rewrite to use
	  gnulib's dirname-lgpl.

	Gnulib: Add dirname-lgpl.
	* lib/Makefile.am:
	* m4/gnulib-cache.m4:
	* m4/gnulib-comp.m4: Add dirname-lgpl.

2016-07-25  Ludovic Courtès  <ludo@gnu.org>

	doc: Add unquote and unquote-splicing examples.
	Suggested by Vincent Legoll <vincent.legoll@gmail.com>.

	* doc/ref/api-evaluation.texi (Expression Syntax): Add an unquote and an
	unquote-splicing example.

2016-07-25  Eli Zaretskii  <eliz@gnu.org>

	Untabify posix-w32.c

	Improve process handling on MS-Windows
	* libguile/posix-w32.c: Include gc.h and threads.h.
	(proc_record): New structure tag.
	<procs, proc_size>: New static variables.
	(find_proc, proc_handle, record_proc, delete_proc): New utility
	functions.
	(start_child): Return value is now pid_t, as it is on Posix
	platforms.  Record the new process and returns its PID, instead of
	returning a handle.  Fix the recursive call.
	(waitpid, kill, getpriority, setpriority, sched_getaffinity)
	(sched_setaffinity): Look up the PID in the recorded subprocesses
	before trying to open a process that is not our subprocess.  Make
	sure any open handle is closed before returning, unless it's our
	subprocess.

2016-07-25  Andy Wingo  <wingo@pobox.com>

	Allow mkstemp! to have optional "mode" argument
	* m4/mkstemp.m4: Remove.
	* lib/mkstemp.c: Remove.
	* lib/mkostemp.c: New file.
	* m4/mkostemp.m4: New file.
	* lib/Makefile.am:
	* m4/gnulib-cache.m4:
	* m4/gnulib-comp.m4: Remove mkstemp module, replace with mkostemp.

	* libguile/fports.h:
	* libguile/fports.c (scm_i_mode_to_open_flags): Factor out helper to
	  parse mode string to open flags.
	  (scm_open_file_with_encoding): Use the new helper.
	* libguile/filesys.c:
	  (scm_i_mkstemp): Adapt to take optional second argument, being a mode
	  string.  Use mkostemp.
	  (scm_mkstemp): Backwards compatible shim that calls scm_i_mkstemp.

	* doc/ref/posix.texi:
	* NEWS: Update.

	* module/system/base/compile.scm (call-with-output-file/atomic): Pass
	  "wb" as mode, to cause O_BINARY to be added on MinGW.

2016-07-25  Ricardo Wurmus  <rekado@elephly.net>

	doc: Do not gender the programmer.
	* doc/ref/api-foreign.texi: Replace "his" with "their".
	* doc/ref/sxml.texi: Likewise.

2016-07-25  Eli Zaretskii  <eliz@gnu.org>

	Update uname implementation in posix-w32
	* libguile/posix-w32.c (uname): Update to modern processors (ia64 and
	  x86_64) and OS versions (Vista to Windows 10).  Delete trailing
	  whitespace.

2016-07-25  Andy Wingo  <wingo@pobox.com>

	Fix unused static variables in net_db.c
	* libguile/net_db.c (SCM_DEFINE_CONSTANT): New helper.  Use it to
	  define constants and avoid the unneeded static variables that were
	  used before, named "sym_" but actually holding variables.  Thanks to
	  Eli Zaretskii for the report.

	Fix MinGW build error
	* configure.ac: Fix for recent rename of win32-uname.c to posix-w32.c.

	Update NEWS
	* NEWS: Update.

	Add popen feature
	* doc/ref/api-options.texi (Common Feature Symbols): Document the popen
	  feature.
	* doc/ref/posix.texi (Pipes): Depend on the popen feature, not fork.
	* libguile/posix.c (scm_init_posix): Add popen feature if we can.

2016-07-25  Eli Zaretskii  <eliz@gnu.org>

	Add POSIX shims for MinGW
	* libguile/posix-w32.h:
	* libguile/posix-w32.c (kill, waitpid, getpriority, setpriority)
	  (sched_getaffinity, sched_setaffinity): Add MinGW implementations.
	  Also, provides macros that on Posix hosts are in sys/wait.h, like
	  WIFEXITED and WTERMSIG.
	  (start_child): Add implementation.

2016-07-25  Andy Wingo  <wingo@pobox.com>

	Rename win32-uname.[ch] to posix-w32.[ch]
	* libguile/posix-w32.c:
	* libguile/posix-w32.h: Rename from win32-uname.c and win32-uname.h.
	* libguile/posix.c:
	* libguile/Makefile.am
	  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES)
	  (noinst_HEADERS): Adapt.

	Ignore meta/build-env
	* .gitignore: Ignore meta/build-env.

	Factor start_child out of open_process
	* libguile/posix.c (start_child): Factor out from open_process.  Based
	  on initial work by Eli Zaretskii.

	More specific status:exit-val et al compilation guards
	* libguile/posix.c (scm_status_exit_val, scm_status_term_sig)
	  (scm_status_stop_sig): Guard on WIFEXITED et al macros instead of on
	  MinGW.

	getaffinity, setaffinity docstring cleanup
	* libguile/posix.c (scm_getaffinity, scm_setaffinity): Clean up
	  docstrings.  Obviously if you have the function, you don't need to be
	  told that you have it in the docstring.

	Provide `kill' only if supported by the host
	* libguile/posix.c (scm_kill): Only provide if the host has `kill'.  An
	  incompatible change on MinGW, where this function would work only if
	  the PID was the current PID, but that will be fixed by the next
	  process.

	More robust setuid, setgid, etc detection
	* configure.ac: Check for getuid, getgid, setuid, and setgid.
	* libguile/posix.c (scm_getuid, scm_getgid, scm_setuid, scm_setgid):
	  Only provide Scheme functions if the OS provides these facilities.
	  (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid): Provide if the
	  host has getuid, getgid, etc, instead of being in a MinGW guard.

2016-07-25  Ludovic Courtès  <ludo@gnu.org>

	Add missing 'const' qualifier.
	* libguile/stime.c (tzvar): Add 'const'.

	Unconditionally include <time.h> from Gnulib.
	* libguile/stime.c: Unconditionally include <time.h>.

	build: Remove unneeded check for 'unsetenv'.
	* configure.ac: Remove check for 'unsetenv', which is unneeded since we
	use Gnulib's 'unsetenv'.

2016-07-11  Andy Wingo  <wingo@pobox.com>

	build-env: prebuilt .go files are in srcdir
	* meta/build-env.in (GUILE_LOAD_COMPILED_PATH): Look for prebuilt files
	  in the srcdir, not the builddir.

2016-07-10  Andy Wingo  <wingo@pobox.com>

	Add meta/build-env
	* meta/build-env.in: New file which sets up an environment that does not
	  inherit GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH (unless
	  cross-compiling).
	* doc/ref/Makefile.am (autoconf-macros.texi):
	* libguile/Makefile.am (snarf2checkedtexi):
	* module/Makefile.am (ice-9/psyntax-pp.go):
	* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
	* am/bootstrap.am (.scm.go):
	* am/guilec (.scm.go): Use build-env.
	* configure.ac: Create build-env.

	Avoid Gnulib unistr/* modules
	(unistr/base, unistr/u8-mbtouc, unistr/u8-mbtouc-unsafe)
	(unistr/u8-mbtoucr, unistr/u8-prev unistr/u8-uctomb, unitypes): --avoid
	these modules.

2016-07-07  Andy Wingo  <wingo@pobox.com>

	Update Gnulib to 68b6ade.
	Also add --conditional-dependencies to the flags.  See:
	https://lists.gnu.org/archive/html/guile-devel/2016-07/msg00012.html

	Update git-version-gen.diff for current gnulib
	* gnulib-local/build-aux/git-version-gen.diff: Update.

2016-06-29  Andy Wingo  <wingo@pobox.com>

	Update NEWS
	* NEWS: Add 2.0.12 NEWS.  Fold 2.1.3 NEWS into main 2.2.0 NEWS.

2016-06-28  Jan Nieuwenhuizen  <janneke@gnu.org>

	tests-suite: resurrect invoking check-guile --coverage.
	* test-suite/guile-test (main): remove (the-vm) from with-code-coverage call.

2016-06-27  Andy Wingo  <wingo@pobox.com>

	psyntax can trace expand-time changes to the current module
	* module/ice-9/psyntax.scm (expand-top-sequence): Support expand-time
	  changes to the current module.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	Fix uninstalled-env bug that put prebuilt/ in front
	* meta/uninstalled-env.in (top_builddir): Fix bug whereby
	  meta/uninstalled-env run within meta-uninstalled-env, as happens
	  sometimes, would move the prebuilt dir to the front.

2016-06-27  David Pirotte  <david@altosw.be>

	Fixing GUILE_PROGS wrong versioning checks
	* meta/guile.m4: Fixing GUILE_PROGS versioning checks were wrong and
	  incomplete, leading to false errors like: "... checking for Guile
	  version >= 2.0.11... configure: error: Guile 2.0.11 required, but
	  2.1.3 found".

	  thanks to Colomban Wendling, aka b4n, who also suggested this fix
	  during a chat on #autotools while helping me wrt another autotool
	  related problem I was nvestigating.

2016-06-27  David Pirotte  <david@altosw.be>

	Do not track some test-suite files
	* .gitignore:  Adding test-smob-mark-race to the list of the test-suite
	  files we do not track.

2016-06-27  Taylan Ulrich Bayırlı/Kammer  <taylanbayirli@gmail.com>

	Fix 'monitor' macro.
	* module/ice-9/threads.scm (monitor-mutex-table)
	(monitor-mutex-table-mutex, monitor-mutex-with-id): New variables.
	(monitor): Fix it.

2016-06-25  Andy Wingo  <wingo@pobox.com>

	Add -Wmacro-use-before-definition
	* module/ice-9/boot-9.scm (%auto-compilation-options):
	* am/guilec (GUILE_WARNINGS): Add -Wmacro-use-before-definition.
	* module/language/tree-il/analyze.scm (unbound-variable-analysis): Use
	  match-lambda.
	  (<macro-use-info>, macro-use-before-definition-analysis): New
	  analysis.
	* module/system/base/message.scm (%warning-types): Add
	  macro-use-before-definition warning type.
	* module/language/tree-il/compile-cps.scm (%warning-passes): Add
	  support for macro-use-before-definition.

	Fix duplicate case in peval
	* module/language/tree-il/peval.scm (singly-valued-expression?): Fix
	  duplicate case.  Spotted by "mejja" on IRC.

	Add documentation pointer from getopt-long to SRFI-37.
	* doc/ref/mod-getopt-long.texi (getopt-long): Point to SRFI-37.

2016-06-24  Andy Wingo  <wingo@pobox.com>

	Favor "escape continuation" over "one-shot continuation" in manual
	* doc/ref/api-control.texi (Prompt Primitives): Remove mention of
	  one-shot continuations, as it's possible to invoke them multiple times
	  if the continuation is re-entered through other means.

2016-06-24  Andy Wingo  <wingo@pobox.com>

	Check for strtod_l before using it.
	Based on a patch by Andy Stormont <astormont@racktopsystems.com>.

	* configure.ac: Check for strtod_l.
	* libguile/i18n.c (scm_locale_string_to_integer): Fix style.
	  (scm_locale_string_to_inexact): Check for strtod_l.

2016-06-24  Andy Wingo  <wingo@pobox.com>

	Constant-folding eq? and eqv? uses deduplication
	* test-suite/tests/peval.test ("partial evaluation"): Add tests.
	* module/language/tree-il/peval.scm (peval): Constant-fold eq? and eqv?
	  using equal?, anticipating deduplication.

	Prevent (@ (ice-9 boot-9) x)
	* module/ice-9/boot-9.scm: Prevent re-loading, perhaps via (@ (ice-9
	  boot-9) foo).  (ice-9 boot-9) isn't a module.  Fixes #21801.

2016-06-24  Daniel Llorens  <daniel.llorens@bluewin.ch>

	On Darwin, skip tests that depend on setrlimit
	On Darwin, setrlimit is ignored, and these tests do not terminate. There
	doesn't seem to be another way to limit the memory allocated by a
	process.

	* test-suite/standalone/test-stack-overflow: Skip this test on Darwin.
	* test-suite/standalone/test-out-of-memory: Skip this test on Darwin.

2016-06-24  Andy Wingo  <wingo@pobox.com>

	Fix texinfo->html for @acronym, @itemize
	* module/texinfo/html.scm (itemize, acronym, tag-replacements, rules):
	  Fix HTML serialization of @itemize and @acronym.  Fixes #21772.
	* test-suite/tests/texinfo.html.test: New file.
	* test-suite/Makefile.am: Add new file.

	Parse bytecode to determine minimum arity
	* libguile/programs.c (try_parse_arity): New helper, to parse bytecode
	  to determine the minimum arity of a function in a cheaper way than
	  grovelling through the debug info.  Should speed up all thunk? checks
	  and similar.
	  (scm_i_program_arity): Simplify.
	* libguile/gsubr.h:
	* libguile/gsubr.c (scm_i_primitive_arity):
	* libguile/foreign.h:
	* libguile/foreign.c (scm_i_foreign_arity):

	Fix include-from-path when file found in relative path
	* module/ice-9/psyntax.scm (include-from-path): Canonicalize result of
	  %search-load-path.  Otherwise a relative path passed to `include'
	  would be treated as relative to the directory of the file that
	  contains the `include-from-path'.  Fixes #21347.
	* module/ice-9/psyntax-pp.scm: Regenerate.

2016-06-24  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Avoid stifling readline history when looking up options
	With this patch, history is never stifled unless (readline-set!) is used.

	* src/guile-readline/readline.c (scm_readline_options)

2016-06-24  Andy Wingo  <wingo@pobox.com>

	Fix typo about `keywords' read option
	* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo.  Thanks to
	  Glenn Michaels for the report and fix.

	Fix ,profile in pure modules
	* libguile/scmsigs.c (close_1): Make the async closure in an environment
	  where `lambda' has its usual meaning.  Fixes #21013.

	Add with-input-from-port, etc documentation
	* doc/ref/api-io.texi (Default Ports): Add documentation for
	  with-input-from-port, with-output-to-port, and with-error-to-port.
	  Fixes #20919.

	Clarify use of the term "scanning" in the manual
	* doc/ref/api-memory.texi (Garbage Collection Functions):
	* doc/ref/libguile-concepts.texi (Garbage Collection): Attempt to be
	  clear that scanning is a thing that happens in the mark phase.  Fixes
	  #20907 I think.

	Locale is default port encoding
	* libguile/ports.c (scm_init_ports): Use the locale as the default
	  charset.  After the switch to default GUILE_INSTALL_LOCALE=1, this
	  harmonizes the default port encoding with the installed locale.

2016-06-23  Andy Wingo  <wingo@pobox.com>

	Add weak hash table documentation
	* doc/ref/api-memory.texi (Weak hash tables): Update documentation.
	  Fixes #20551.

	Fix R6RS fold-left documentation
	* doc/ref/r6rs.texi (rnrs lists): Fix documentation of fold-left.

	Static default for define-module #:duplicates
	* module/ice-9/boot-9.scm (define-module*): Leaving off #:duplicates
	  defaults to installing the duplicate binding handlers specified in the
	  manual, not the value of some other dynamic parameter.
	  (default-duplicate-binding-procedures):
	  (default-duplicate-binding-handler): Instead of closing over a
	  separate fluid, close over the handlers of the current module.  That
	  way when a user does (default-duplicate-binding-handler ...) in a
	  script, then it applies to the right module.

	Fix default-duplicate-binding-handlers for compilation
	* module/ice-9/boot-9.scm (define-module*): Capture value of
	  `default-duplicate-binding-procedures' when the module is created.
	  Fixes #20093.

	Don't serialize uninterned symbols
	* module/system/vm/assembler.scm (intern-constant): Don't serialize
	  uninterned symbols.
	* test-suite/tests/rtl.test ("bad constants"): Add a test.

	Fix memory leak in scm_from_{u,}int64 on 32-bit platforms
	* libguile/conv-integer.i.c (SCM_FROM_TYPE_PROTO):
	* libguile/conv-uinteger.i.c (SCM_FROM_TYPE_PROTO): Fix a big in which
	  scm_from_int64 and scm_from_uint64 on a 32-bit platform leaked memory
	  if they needed to allocate a bignum.  Fixes #20079.

2016-06-23  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Remove unused doc/maint

2016-06-23  Andy Wingo  <wingo@pobox.com>

	Fix race between SMOB marking and finalization
	* libguile/smob.c (clear_smobnum): New helper.
	  (finalize_smob): Re-set the smobnum to the "finalized smob" type
	  before finalizing.  Fixes #19883.
	  (scm_smob_prehistory): Pre-register a "finalized smob" type, which has
	  no mark procedure.
	* test-suite/standalone/test-smob-mark-race.c: New file.
	* test-suite/standalone/Makefile.am: Arrange to build and run the new
	  test.

	Fix relative file name canonicalization on paths with "."
	* libguile/filesys.c (scm_i_relativize_path): Canonicalize the file
	  names elements that we will be using as prefixes.  Fixes the case
	  where a load path contains a relative file name: #19540.
	* test-suite/tests/ports.test ("%file-port-name-canonicalization"): Add
	  tests that elements of the load path are canonicalized.

2016-06-22  Andy Wingo  <wingo@pobox.com>

	Remove unused internal i18n functions
	* libguile/i18n.c (str_upcase, str_downcase, str_upcase_l)
	  (str_downcase_l): Remove unused inline functions.  Based on a patch by
	  Pedro Aguilar <paguilar@paguilar.org>.  Fixes #19172.

	Remove a stale variable use in libguile/Makefile.am
	* libguile/Makefile.am (BUILT_SOURCES): Remove a use of a variable that
	  doesn't exist in 2.2.

	Fix SCM_DEBUG_TYPING_STRICTNESS bug
	* libguile/ports.c (scm_setvbuf): Fix bad use of SCM as a test value.
	  Actually all ports have read buffers, so we can remove the condition
	  entirely.  Thanks Hydra for building in this way :)

2016-06-21  Andy Wingo  <wingo@pobox.com>

	Fix (< 'foo) compilation
	* module/language/tree-il/primitives.scm (expand-chained-comparisons):
	  Fix (< 'foo) compilation.
	* test-suite/tests/compiler.test ("regression tests"): Add test case.

	Fix srfi-64.test for #:select borkage.  The irony...
	* test-suite/tests/srfi-64.test: Fix for recent #:select borkage.

	`define!' instruction returns the variable
	* doc/ref/vm.texi (Top-Level Environment Instructions): Update
	  documentation.
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump, sadly.
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.
	* libguile/vm-engine.c (define!): Change to store variable in dst slot.
	* module/language/tree-il/compile-cps.scm (convert):
	* module/language/cps/compile-bytecode.scm (compile-function): Adapt to
	  define! change.
	* module/language/cps/effects-analysis.scm (current-module): Fix define!
	  effects.  Incidentally here was the bug: in Guile 2.2 you can't have
	  effects on different object kinds in one instruction, without
	  reverting to &unknown-memory-kinds.
	* test-suite/tests/compiler.test ("regression tests"): Add a test.

	Use source file permissions for compiled files
	* module/system/base/compile.scm (call-with-output-file/atomic): Use the
	  permissions of the source file, if available, as the permissions of
	  the compiled file.  Fixes #18477.

	Document pretty-print #:max-expr-width
	* doc/ref/misc-modules.texi (Pretty Printing): Document #:max-expr-width
	  keyword argument.  Fixes #17657.

	Importing modules with #:select no longer grovels private bindings
	* module/ice-9/boot-9.scm (resolve-interface): Don't look in private
	  interface for #:select bindings.  Fixes #17418.
	* module/system/repl/coop-server.scm: Don't rely on bad #:select
	  behavior.
	* NEWS: Add entry.

	Detect too-old libunistring at configure-time.
	* configure.ac: Detect too-old libunistring at configure-time.  Fixes
	  #17399.

	Update and-let-star.test
	* test-suite/tests/and-let-star.test ("and-let*"): Update test
	  expectations.

2016-06-21  Taylan Ulrich Bayırlı/Kammer  <taylanbayirli@gmail.com>

	Add SRFI-2 (and-let*) test suite.
	* test-suite/tests/srfi-2.test: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add it.

	Fix SRFI-2 (and-let*) implementation.
	* module/ice-9/and-let-star.scm (%and-let*): Re-implemented this in a
	  more verbose but accurate way.

2016-06-21  Andy Wingo  <wingo@pobox.com>

	Add R6RS bytevector->string, string->bytevector
	* module/rnrs/io/ports.scm (string->bytevector):
	  (bytevector->string): New procedures.
	* module/rnrs.scm: Export new procedures.
	* test-suite/tests/r6rs-ports.test: Add string->bytevector and
	  bytevector->string tests.

	Export &i/o-decoding, &i/o-encoding from (rnrs)
	* module/rnrs/io/ports.scm (&i/o-decoding, &i/o-encoding): Rename from
	  &i/o-decoding-error and &i/o-encoding-error, to conform to R6RS.
	* module/rnrs.scm (rnrs): Export &i/o-decoding, &i/o-encoding, their
	  accessors and constructors.

	Implement R6RS output-port-buffer-mode
	* module/rnrs/io/ports.scm (r6rs-open): Set buffer-mode on new port.
	  (output-port-buffer-mode): Implement and export.
	* module/rnrs.scm (rnrs): Export output-port-buffer-mode
	* test-suite/tests/r6rs-ports.test (test-output-file-opener): Add
	  tests.

2016-06-21  Taylan Ulrich Bayırlı/Kammer  <taylanbayirli@gmail.com>

	(rnrs hashtables): Hash functions of eq? and eqv? hashtables
	Also pinging this thread with a (very slightly) updated patch. :-)

	[2. text/x-diff; 0001-Hashtable-hash-function-returns-f-on-eq-and-eqv-tabl.patch]

	From 17599f6ce7ba0beb100e80455ff99af07333d871 Mon Sep 17 00:00:00 2001
	From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
	 <taylanbayirli@gmail.com>
	Date: Tue, 21 Jun 2016 00:23:29 +0200
	Subject: [PATCH] Hashtable-hash-function returns #f on eq and eqv tables.

	* module/rnrs/hashtables.scm (r6rs:hashtable)[type]: New field.
	(r6rs:hashtable-type): New procedure.
	* test-suite/tests/r6rs-hashtables.test: Add related tests.

2016-06-21  Taylan Ulrich Bayırlı/Kammer  <taylanbayirli@gmail.com>

	(rnrs hashtables): Mutation of immutable hashtable ignored
	Pinging this thread with a (very slightly) updated patch. :-)

	[2. text/x-diff; 0001-Hashtable-set-errors-on-immutable-hashtable.patch]

	From 7f35d515d711e255bba5a89a013d9d92034edf41 Mon Sep 17 00:00:00 2001
	From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
	 <taylanbayirli@gmail.com>
	Date: Tue, 21 Jun 2016 00:25:19 +0200
	Subject: [PATCH] Hashtable-set! errors on immutable hashtable.

	* module/rnrs/hashtables.scm (hashtable-set!): Raise an assertion
	  violation error when the hashtable is immutable.
	* test-suite/tests/r6rs-hashtables.test: Fix accordingly.

2016-06-21  Andy Wingo  <wingo@pobox.com>

	Fix fixnum-range changes in R6RS fixnum bitops
	* module/rnrs/arithmetic/fixnums.scm (fxcopy-bit, fxbit-field)
	  (fxcopy-bit-field, fxarithmetic-shift)
	  (fxarithmetic-shift-left, fx-arithmetic-shift-right)
	  (fxrotate-bit-field, fxreverse-bit-field): Enforce range on amount by
	  which to shift.  Fixes #14917.
	* test-suite/tests/r6rs-arithmetic-fixnums.test ("fxarithmetic-shift-left"):
	  Update test to not shift left by a negative amount.

	Add another code coverage test
	* test-suite/tests/coverage.test ("line-execution-counts"): Add a test
	  from Taylan Ulrich B, from bug #14849.

	Document sigaction + SA_RESTART
	* doc/ref/posix.texi (Signals): Document interaction between Guile's
	  signal handling and SA_RESTART.  Fixes #14640.

2016-06-20  Andy Wingo  <wingo@pobox.com>

	Fix peval on (call-with-values foo (lambda (x) x))
	* module/language/tree-il/peval.scm (peval): Don't
	  inline (call-with-values foo (lambda (x) exp)) to (let ((x (foo)))
	  exp).  The idea is that call-with-values sets up an explicit context
	  in which we are requesting an explicit return arity, and that dropping
	  extra values when there's not a rest argument is the wrong thing.
	  Fixes #13966.
	* test-suite/tests/peval.test ("partial evaluation"): Update test.

	Document char-ready? limitations.
	* doc/ref/api-io.texi (Venerable Port Interfaces): Document limitations
	  of char-ready?.  See http://debbugs.gnu.org/10627.

2016-06-20  Andy Wingo  <wingo@pobox.com>

	Fix size measurement in bytevector_large_set
	* libguile/bytevectors.c (bytevector_large_set): Fix computation of
	  value size in words.
	* test-suite/tests/bytevectors.test: Add test.

	Thanks to Ben Rocer <fleabyte@mail.com> for the bug report and fix.

2016-06-20  Andy Wingo  <wingo@pobox.com>

	Fix uri-decode behavior for "+"
	* module/web/uri.scm (uri-decode): Add #:decode-plus-to-space? keyword
	  argument.
	  (split-and-decode-uri-path): Don't decode plus to space.
	* doc/ref/web.texi (URIs): Update documentation.
	* test-suite/tests/web-uri.test ("decode"): Add tests.
	* NEWS: Add entry.

	Based on a patch by Brent <brent@tomski.co.za>.

2016-06-19  Diogo F. S. Ramos  <dfsr@riseup.net>

	Add reference to the lack of "non-greedy" variants
	While describing special characters, remind the reader that
	"non-greedy" variants are not supported.  They might not be familiar
	with POSIX extended regular expression and expect it to work.

	* doc/ref/api-regex.texi: Add "non-greedy" observation

2016-06-19  Diogo F. S. Ramos  <dfsr@riseup.net>

	Remove link to Emacs' regexp syntax
	Linking to Emacs' regexps as an example of regexp syntax gives the
	wrong impression that Guile supports it, which is not true.

	* doc/ref/api-regex.texi: Remove link to Emacs' regexp syntax

2016-06-18  Andy Wingo  <wingo@pobox.com>

	Bump version to 2.1.3
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to 2.1.3.

	Minor NEWS updates
	* NEWS: Minor updates.

	Fix ports bug when size_t is 32 bits
	* libguile/ports.c (scm_end_input): I am a complete idiot.  I had no
	  idea that `- (uint32_t) x' is actually still a uint32_t.

2016-06-17  Andy Wingo  <wingo@pobox.com>

	Fix 64->32 bit cross-compilation of large-ish fixnums
	* module/system/vm/assembler.scm (immediate-bits): Fix a bug whereby
	  compiling to a 32-bit target from a 64-bit host would treat all
	  integers whose representation fit into 32 bits as immediates.  This
	  would result in integer constants between #x20000000 and 0x3fffffff
	  being residualized in such a way that they would be loaded as negative
	  numbers.

2016-06-12  Andy Wingo  <wingo@pobox.com>

	Skip incompatible .go files
	* libguile/load.c (load_thunk_from_path, try_load_thunk_from_file): New
	  functions.
	  (search_path): Simplify.
	  (scm_primitive_load_path, scm_init_eval_in_scheme): Use the new
	  functions to load compiled files.
	* module/ice-9/boot-9.scm (load-in-vicinity): Skip invalid .go files.

	Inspired by a patch from Jan Nieuwenhuizen <janneke@gnu.org>.

2016-06-11  Andy Wingo  <wingo@pobox.com>

	Remove unused static definitions
	* libguile/expand.c:
	* libguile/vm.c: Remove unused static definitions.

	Fix shuffling of unboxed stack elements on 32-bit systems
	* libguile/vm-engine.c (SP_REF_SLOT, SP_SET_SLOT): New defines.
	  (push, pop, mov, long-mov): Move full slots.  Fixes 32-bit with
	  unboxed 64-bit stack values; before when shuffling these values
	  around, we were only shuffling the lower 32 bits on 32-bit platforms.

	VM type checking refactor
	* libguile/vm-engine.c (VM_VALIDATE): Refactor some type-related
	  assertions to use a common macro.
	  (vector-length, vector-set!/immediate): Fix the proc mentioned in the
	  error message.

	vm: Make sure IP is stored before potentially GCing.
	* libguile/vm-engine.c: Add a number of SYNC_IP calls that were missing
	  before calls that could GC.

2016-06-10  Andy Wingo  <wingo@pobox.com>

	Fix bad backtraces
	* libguile/vm-engine.c (BV_REF, BV_BOUNDED_SET, BV_SET, integer->char)
	  (char->integer): Use VM_ASSERT so that we save the IP before erroring
	  out.

	Minor VM fixes
	* libguile/vm-engine.c (string-ref): Unpack the index into a 64-bit
	  integer.
	  (br-if-u64-<-scm): Tighten up the fast path.

	Type inference: Use &u64-max instead of #xffff...
	* module/language/cps/types.scm: Use &u64-max where possible.

	Types refactor for unboxed char ranges
	* module/language/cps/types.scm (*max-codepoint*): Factor codepoint
	  range restrictions to use this value.

2016-06-09  Andy Wingo  <wingo@pobox.com>

	Non-blocking accept/connect Scheme support
	* module/ice-9/sports.scm (accept, connect): New Scheme functions.

	Support `connect' on nonblocking sockets
	* libguile/socket.c (scm_connect):
	* doc/ref/posix.texi (Network Sockets and Communication): Support
	  connect on nonblocking ports.

	`accept' on nonblocking socket can return #f
	* doc/ref/posix.texi (Network Sockets and Communication):
	* libguile/socket.c (scm_accept): Return #f if the socket is nonblocking
	  and no connection is ready.

	put-char in Scheme
	* libguile/ports.c (scm_port_encode_char): New function.
	* module/ice-9/ports.scm (port-encode-char): Export port-encode-char to
	  the internals module.
	* module/ice-9/sports.scm (put-char): New function.
	  (port-bindings): Add put-char and put-string.

	Update port documentation, rename sports to suspendable ports
	* module/ice-9/suspendable-ports.scm: Rename from ice-9/sports.scm, and
	  adapt module names.  Remove exports that are not related to the
	  suspendable ports facility; we want people to continue using the port
	  operations from their original locations.  Add put-string to the
	  replacement list.
	* module/Makefile.am: Adapt to rename.
	* test-suite/tests/suspendable-ports.test: Rename from sports.test.
	* test-suite/Makefile.am: Adapt to rename.
	* module/ice-9/textual-ports.scm (unget-char, unget-string): New
	  functions.
	* doc/ref/api-io.texi (Textual I/O, Simple Output): Flesh out
	  documentation.
	  (Line/Delimited): Undocument write-line, read-string, and
	  read-string!.  This is handled by (ice-9 textual-ports).
	  (Bytevector Ports): Fix duplicated section.
	  (String Ports): Move the note about encodings down to the end.
	  (Custom Ports): Add explanatory text.  Remove mention of C functions;
	  they should use the C port interface.
	  (Venerable Port Interfaces): Add text, and make documentation refer to
	  recommended interfaces.
	  (Using Ports from C): Add documentation.
	  (Non-Blocking I/O): Document more fully and adapt to suspendable-ports
	  name change.

2016-06-08  Andy Wingo  <wingo@pobox.com>

	Big ports documentation update
	* doc/ref/api-io.texi: Update to document ports more thoroughly.  Still
	  some work needed.

	* doc/ref/r6rs.texi: Move ports documentation back to r6rs.texi, now
	  that Guile has a more thorough binary/textual I/O story, heavily based
	  on R6RS.

	* doc/ref/api-control.texi:
	* doc/ref/api-data.texi:
	* doc/ref/api-options.texi:
	* doc/ref/misc-modules.texi:
	* doc/ref/posix.texi:
	* doc/ref/srfi-modules.texi: Update references.

2016-06-08  Andy Wingo  <wingo@pobox.com>

	Undocument (ice-9 rw)
	* doc/ref/api-io.texi (Block Reading and Writing): Undocument (ice-9
	  rw).  The R6RS routines do the same job and are not so clunky.

	Add (ice-9 textual-ports)
	* module/ice-9/textual-ports.scm: New module.
	* module/Makefile.am: Add new module.

	put-char, put-string in (ice-9 ports internals)
	* libguile/ports.h (scm_put_char):
	* libguile/ports.c (scm_put_char): New function.
	  (scm_put_string): Add docstrings, and expose to the internal ports
	  module.
	* module/ice-9/ports.scm (put-char, put-string): Expose these bindings
	  only through the internals module.

2016-06-04  Andy Wingo  <wingo@pobox.com>

	socket: TCP_CORK, TCP_NODELAY
	* libguile/socket.c (scm_init_socket): Define TCP_NODELAY and TCP_CORK
	  if they are available.
	* doc/ref/posix.texi (Network Sockets and Communication): Add
	  documentation.
	* NEWS: Add entry.

2016-06-01  Andy Wingo  <wingo@pobox.com>

	put-string in Scheme
	* module/ice-9/ports.scm: Export port-encode-chars and
	  port-clear-stream-start-for-bom-write via the internals module.
	* module/ice-9/sports.scm (put-string): New function.

	Rework text encoding to be more Scheme-friendly
	* libguile/ports.c (scm_port_clear_stream_start_for_bom_write): Instead
	  of returning the BOM, take an optional buffer in which to write the
	  BOM.  Return number of bytes written.
	  (port_clear_stream_start_for_bom_write): Remove.
	  (scm_i_write): Adapt scm_port_clear_stream_start_for_bom_write call.
	  (try_encode_char_to_iconv_buf, encode_latin1_chars_to_latin1_buf):
	  (encode_latin1_chars_to_utf8_buf, encode_latin1_chars_to_iconv_buf):
	  (encode_latin1_chars, encode_utf32_chars_to_latin1_buf):
	  (encode_utf32_chars_to_utf8_buf, encode_utf32_chars_to_iconv_buf):
	  (encode_utf32_chars, port_encode_chars): New helpers.
	  (scm_port_encode_chars): New procedure.
	  (scm_c_put_latin1_chars, scm_c_put_utf32_chars): Rework to use new
	  encoding helpers.
	  (scm_lfwrite): Use scm_c_put_latin1_chars.

2016-05-30  Andy Wingo  <wingo@pobox.com>

	Simplify string, symbol, char display/write impls
	* libguile/print.h:
	* libguile/print.c: Use the new routines from ports.[ch].

	Add scm_c_put_escaped_char, scm_c_can_put_char
	* libguile/ports.h:
	* libguile/ports.c (scm_c_put_escaped_char, scm_c_can_put_char): New
	  helpers.

	iprin1 uses scm_c_put_string
	* libguile/print.c (iprin1): Use scm_c_put_string for strings.
	* test-suite/test-suite/lib.scm (exception:encoding-error): Add an
	  additional expected error string for `encoding-error'.

	print_normal_symbol uses new port functions
	* libguile/print.c (print_normal_symbol): Use new port functions.

	Beginnings of supporting encoding text in ports.c
	* libguile/ports.h (scm_c_put_latin1_chars, scm_c_put_utf32_chars)
	  (scm_c_put_char, scm_c_put_string, scm_print_string): New public
	  functions.  The plan is to move encoding to ports.c and out of
	  print.c.
	* libguile/ports.c (UTF8_BUFFER_SIZE, ESCAPE_BUFFER_SIZE): New internal
	  defines.
	  (update_port_position): Take a position instead of a port.  Update
	  callers.
	  (utf8_to_codepoint): Allow lengths that are larger than necessary.
	  (port_clear_stream_start_for_bom_write): Require that io_mode be
	  BOM_IO_TEXT to write a BOM.
	  (scm_fill_input): Add a related comment about BOM handling.
	  (scm_i_write): use BOM_IO_TEXT, at least for now.
	  (encode_escape_sequence, codepoint_to_utf8, utf8_to_codepoint)
	  (put_utf8_chars_to_iconv_port, put_latin1_chars_to_utf8_port)
	  (put_latin1_chars_to_iconv_port, put_utf32_chars_to_latin1_port)
	  (put_utf32_chars_to_utf8_port, put_utf32_chars_to_iconv_port): New
	  helpers.
	  (scm_putc, scm_puts): Use scm_c_put_char and scm_put_latin1_chars.

2016-05-25  Andy Wingo  <wingo@pobox.com>

	Add port-line-buffered?
	* libguile/ports.c (scm_port_line_buffered_p): New function.
	* module/ice-9/ports.scm: Plump port-line-buffered? and
	  port-auxiliary-write-buffer through to the internals module

	port_clear_stream_start_for_bom_write refactor
	* libguile/ports.c (port_clear_stream_start_for_bom_write): Rework to be
	  friendly to Scheme write implementations.

2016-05-24  Andy Wingo  <wingo@pobox.com>

	Speed up scm_c_write / scm_lfwrite
	* libguile/ports-internal.h (scm_t_port): Add write_buf_aux field.
	* libguile/ports.h (scm_port_auxiliary_write_buffer): New internal
	  decl.
	* libguile/ports.c (AUXILIARY_WRITE_BUFFER_SIZE): New constant.
	  (initialize_port_buffers): Init aux write buf.
	  (scm_port_auxiliary_write_buffer): Lazily allocate an aux write
	  buffer.
	  (scm_c_write): Arrange to write through an aux buffer if the port is
	  unbuffered.

	Speed golf on Scheme put-u8, put-bytevector
	* module/ice-9/sports.scm (put-u8, put-bytevector): Speed hack.

	Add put-u8 implementation in Scheme
	* module/ice-9/sports.scm (put-u8): Add implementation.
	  (port-bindings): Add put-u8.

	`put-bytevector' in Scheme
	* module/ice-9/sports.scm (flush-input): New helper.
	  (put-bytevector): New function.
	  (port-bindings): Add put-bytevector.

	Wire up non-blocking support in sport writes
	* module/ice-9/sports.scm (write-bytes): Support non-blocking writes.
	  (force-output, flush-output): Rearrange placement.

	close-port implementation in sports
	* module/ice-9/sports.scm (close-port): New function.
	  (port-bindings): Add close-port.

	Add force-output to sports
	* module/ice-9/sports.scm (force-output): New implementation.
	  (port-bindings): Add force-output.

2016-05-23  Andy Wingo  <wingo@pobox.com>

	Thread-safety fixes for iconv and ports
	* libguile/ports-internal.h (scm_t_port): Rework to store iconv
	  descriptors inline, so that the port finalizer doesn't race with the
	  iconv descriptor finalizer.  Access is serialized through a lock.
	  Fixes a bug whereby if the port finalizer and the descriptor finalizer
	  run on different threads, the close-port run by the port finalizer
	  could try to free the iconv descriptors at the same time as the
	  descriptor finalizer.
	* libguile/ports.c (iconv_lock): New static variable.
	  (scm_c_make_port_with_encoding): Initialize iconv-related fields.
	  (scm_close_port): Lock while frobbing iconv descriptors.
	  (prepare_iconv_descriptors): Adapt.
	  (scm_specialize_port_encoding_x, scm_i_set_port_encoding_x): Lock
	  while preparing iconv descriptors.
	  (scm_port_acquire_iconv_descriptors)
	  (scm_port_release_iconv_descriptors): New functions, which replace
	  scm_i_port_iconv_descriptors.
	  (scm_port_decode_char): Lock around iconv operations.
	  (port_clear_stream_start_for_bom_write): Acquire iconv descriptors
	  before checking precise_encoding, to make sure precise_encoding is
	  initialized.
	* libguile/print.c (display_string_using_iconv): Adapt to use the new
	  interface to get iconv descriptors from a port.

2016-05-22  Andy Wingo  <wingo@pobox.com>

	get-bytevector-n in Scheme.
	* module/ice-9/sports.scm (fill-input): Add io-mode optional arg.
	  (get-bytevector-n): New implementation.
	  (port-bindings): Add get-bytevector-n.
	* test-suite/tests/sports.test: Add r6rs-ports tests.

	Fix range checking in new Scheme-to-C port code
	* libguile/ports.c (trampoline_to_c_read, trampoline_to_c_write): Fix
	  bugs checking ranges of start and count parameters.

2016-05-22  Andy Wingo  <wingo@pobox.com>

	More thorough ice-9 sports testing
	* module/ice-9/sports.scm: Export read-line, %read-line, and
	  read-delimited.  Add these latest three to install-sports!, and fix
	  install-sports! if the current module isn't (ice-9 sports).

	* test-suite/tests/sports.test: Use install-sports! instead of lexical
	  bindings, to allow us to nicely frob bindings in rdelim.  Include
	  rdelim tests.

2016-05-22  Andy Wingo  <wingo@pobox.com>

	Merge from stable-2.0
	This cherry-picks changes from stable-2.0, starting from
	acd2c8e36a25d77e9e9c9b6782780b23a1764973 and ending in
	461b62efc90135d3ca8719ba0f3b6ced4ad13754, inclusively.  I did not
	cherry-pick patches that were already on master and did not cherry-pick
	ones that don't make sense on master (for example because of the port
	re-write).  I did pick all tests though.

	I also did not cherry-pick the "Revert foreign objects" patch from
	ff98cbb643d43c9f8c6ee0e0b4e1bad72aced62e; further discussion necessary.

2016-05-22  Luribert  <luribert331@zoho.com>

	doc: Fix typo in Web documentation.
	* doc/ref/web.texi (Http Headers): Fixed typo.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	http: Accept date strings with a leading space for hours.
	Fixes <http://bugs.gnu.org/23421>.
	Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

	* module/web/http.scm (parse-rfc-822-date): Add two clauses for hours
	with a leading space.
	* test-suite/tests/web-http.test ("general headers"): Add two tests.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	Bump user-visible copyright years to 2016.
	* doc/ref/guile.texi: Add 2016 to user-visible copyright notice.
	* module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to
	  2016.
	* module/system/repl/common.scm (*version*): Add 2016 to the range of
	  copyright years.

	SRFI-19: Update the table of leap seconds.
	* module/srfi/srfi-19.scm (leap-second-table): Update to include the
	  most recent leap second.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	http: Use 'read-header-line' instead of 'read-line*'.
	* module/web/http.scm (read-line*): Remove.
	(read-continuation-line, read-header, read-request-line): Use
	'read-header-line' instead of 'read-line*'.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	http: Accept empty reason phrases.
	Fixes <http://bugs.gnu.org/22273>.
	Reported by Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>.

	* module/web/http.scm (read-header-line): New procedure.
	(read-response-line): Use it instead of 'read-line*'.
	* test-suite/tests/web-http.test ("read-response-line"): Add test.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	http: Test that responses lacking CR/LF are rejected.
	* test-suite/tests/web-http.test ("read-response-line")["missing
	CR/LF"]: New test.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	Bump user-visible copyright years to 2015.
	* module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to
	  2015.

	* module/system/repl/common.scm (*version*): Add 2015 to the range of
	  copyright years.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	Fix getsockopt/setsockopt handling of SO_SNDBUF/SO_RCVBUF options.
	Reported by Park SungMin <byulparan_eng@icloud.com>
	in <https://lists.gnu.org/archive/html/guile-user/2015-11/msg00026.html>.

	* libguile/socket.c (scm_getsockopt, scm_setsockopt): Remove code that
	  incorrectly assumed that the argument for SO_SNDBUF and SO_RCVBUF
	  options was of type 'size_t'.  Both the Linux and POSIX documentation
	  indicates that the argument is of type 'int', as is the case for most
	  options.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	Regenerate SRFI-14 character set data.
	Suggested by Mike Gran <spk121@yahoo.com>.

	* libguile/srfi-14.i.c: Regenerate for Unicode 8.0.0,
	  <ftp://unicode.org/Public/UNIDATA/UnicodeData.txt> with SHA256
	  38b17e1118206489a7e0ab5d29d7932212d38838df7d3ec025ecb58e8798ec20.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	build: Add SCM_T_OFF_MAX and SCM_T_OFF_MIN to scmconfig.h.
	* libguile/gen-scmconfig.c (main): Add SCM_T_OFF_MAX and SCM_T_OFF_MIN
	  to the generated 'scmconfig.h' file.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	doc: Mention a known-good Flex version number.
	Suggested by Jamil Egdemir <unclejamil@gmail.com>.

	* HACKING: Mention a Flex version number.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	Thank David and Kouhei.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	build: Remove libguile/mkstemp.c, redundant with Gnulib.
	Fixes <http://bugs.gnu.org/21425>.
	Reported by Kouhei Sutou <kou@cozmixng.org>.

	* configure.ac: Remove 'AC_REPLACE_FUNCS' for 'mkstemp'.
	* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  Remove mkstemp.c.
	* libguile/mkstemp.c: Remove.

2016-05-22  David Michael  <fedora.dm0@gmail.com>

	Remove SIGEV constant definitions.
	* libguile/Makefile.am (chknew-E chknew-SIG): Anchor the end of the
	  signal/error name pattern to only match alphanumeric symbols.
	* libguile/cpp-SIG.syms (SIGEV_MAX_SIZE, SIGEV_NONE): Remove.
	  (SIGEV_PAD_SIZE, SIGEV_SIGNAL, SIGEV_THREAD): Likewise.
	  (SIGEV_THREAD_ID): Likewise.

	Add Hurd signal and error constants.
	* libguile/cpp-E.syms (EAUTH, EBACKGROUND): New definitions.
	  (EBADRPC, ED, EDIED, EFTYPE, EGRATUITOUS, EGREGIOUS): Likewise.
	  (EIEIO, ENEEDAUTH, EPROCLIM, EPROCUNAVAIL): Likewise.
	  (EPROGMISMATCH, EPROGUNAVAIL, ERPCMISMATCH): Likewise.
	* libguile/cpp-SIG.syms (SIGEMT, SIGEV_MAX_SIZE): Likewise.
	  (SIGEV_PAD_SIZE, SIGINFO, SIGLOST): Likewise.

	Add new Linux errno constants.
	* libguile/cpp-E.syms (EHWPOISON, ERFKILL): New definitions.

2016-05-22  David Michael  <fedora.dm0@gmail.com>

	Fix the rule to check for new signals and errors
	Fixes <http://bugs.gnu.org/21114>.

	* libguile/Makefile.am (chknew-E chknew-SIG): Remove the line
	  continuation after the targets, and include numbers in the
	  recipe's signal/error regexp to catch names like E2BIG.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	i18n: Add new collation test for posterity.
	* test-suite/tests/i18n.test ("text collation (Czech)"): New test
	  prefix.

	web: Gracefully handle premature EOF when reading chunk header.
	* module/web/http.scm (read-chunk-header): Return 0 when 'read-line'
	  returns EOF.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	docs: Fix external representation of <toplevel-define> in tree-il.
	* doc/ref/compiler.texi (Tree-IL): Provide the correct external
	  representation of <toplevel-define>.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	web: Fix 'close' method of delimited input ports.
	* module/web/response.scm (make-delimited-input-port)[close]: Replace
	  erroneous self-recursive call with a call to 'close-port'.
	* test-suite/tests/web-response.test ("example-1")["response-body-port +
	  close"]: New test.

	Thank Ricardo.

	doc: Fix menu order for SXML.
	* doc/ref/sxml.texi (SXML): Add missing quotes in example.
	  Fix node order in menu.

2016-05-22  Ricardo Wurmus  <rekado@elephly.net>

	doc: Add SXPath documentation from sources
	Fixes <http://bugs.gnu.org/19478>.

	* doc/ref/sxml.texi (SXPath): Add procedure documentation from sources.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	psyntax: Fix bug in match-each+.
	Reported by Panicz Maciej Godek <godek.maciek@gmail.com> in
	<http://lists.gnu.org/archive/html/guile-user/2015-09/msg00017.html>.

	* module/ice-9/psyntax.scm (match-each+): Fix the case where a non-pair
	  syntax object is encountered in a dotted tail.
	* module/ice-9/psyntax-pp.scm: Regenerate.

2016-05-22  Taylan Ulrich Bayırlı/Kammer  <taylanbayirli@gmail.com>

	Clarify datum->syntax documentation.
	* doc/ref/api-macros.texi (Syntax Case): Make it clear that the first
	  argument to datum->syntax must be an identifier.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	Fix uses of 'scm_gc_protect', which does not exist, in the manual.
	* doc/ref/api-memory.texi (Garbage Collection Functions),
	  doc/ref/libguile-concepts.texi (Garbage Collection): Change
	  'scm_gc_protect' --> 'scm_gc_protect_object'.

2016-05-22  Andreas Rottmann  <a.rottmann@gmx.at>

	Heed the reader settings implied by #!r6rs
	When encountering the #!r6rs directive, apply the appropriate reader
	settings to the port.

	* libguile/read.scm (read-string-as-list): New helper procedure.
	  (scm_read_shebang): Set reader options implied by the R6RS syntax
	  upon encountering the #!r6rs directive.
	* test-suite/tests/reader.test (per-port-read-options): Add tests for
	  the #!r6rs directive.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	Fix atan procedure when applied to complex numbers.
	Fixes a regression introduced in commit
	ad79736c68a803a59814fbfc0cb4b092c2b4cddf.

	* libguile/numbers.c (scm_atan): Fix the complex case.
	* test-suite/tests/numbers.test ("atan"): Add test.

2016-05-22  Mathieu Lirzin  <mthl@openmailbox.org>

	doc: Fix parameter of 'set-record-type-printer!'.
	* doc/ref/api-compound.texi (SRFI-9 Records)[set-record-type-printer!]:
	  Fix parameter name.

2016-05-22  Natanael Copa  <ncopa@alpinelinux.org>

	i18n: Check for non-POSIX strtol_l.
	* configure.ac: Check for strtol_l.
	* libguile/i18n.c: Check HAVE_STRTOL_L before using strtol_l.

2016-05-22  Alex Kost  <alezost@gmail.com>

	Fix typo in the man page.
	* doc/guile.1: "--no-autocompile" -> "--no-auto-compile".

	Fix typo in manual.
	* doc/ref/api-modules.texi (Using Guile Modules): Remove extra "yet".

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	doc: Update libgc URL.
	* doc/ref/data-rep.texi (Conservative GC): Update libgc URL.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	Add more R6RS port encoding tests
	Originally applied to stable-2.0 as "Fix bytevector and custom binary
	ports to actually use ISO-8859-1 encoding.", commit
	d574d96f879c147c6c14df43f2e4ff9e8a6876b9.  Related to
	http://bugs.gnu.org/20200, which was introduced in in stable-2.0 but
	never existed on master.  Test modified by Andy Wingo to add a
	`force-output' where needed.

	* test-suite/tests/r6rs-ports.test: Add tests.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	Handle zero-length bytevectors correctly in (system base types).
	* module/system/base/types.scm (cell->object): Use 'get-bytevector-n'
	  instead of 'get-bytevector-all', so that the zero-length case does not
	  return EOF.

	Work around requirement that size be non-zero in GDB 'open-memory'.
	* module/system/base/types.scm (memory-port): Handle zero size case
	  specially.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	web: Export 'server-impl' procedures and the 'http' server implementation.
	* module/web/server.scm: Export the 'server-impl' procedures.
	* module/web/server/http.scm: Export 'http'.

2016-05-22  Taylan Ulrich Bayırlı/Kammer  <taylanbayirli@gmail.com>

	Correct docstring of 'symlink'.
	* libguile/filesys.c (symlink): Correct the docstring, which had
	  'oldpath' and 'newpath' confused.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	tests: Gracefully handle ENOSYS return for 'setaffinity'.
	Fixes <http://bugs.gnu.org/19646>.
	Reported by John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>.

	* test-suite/tests/posix.test ("affinity")["setaffinity"]: Wrap in
	  'catch' and throw 'unresolved upon ENOSYS.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	tests: Make 'test-guild-compile' more reliable.
	Before that it would occasionally fail because the "$target" (not the
	intermediate temporary file) would be produced.

	* test-suite/standalone/test-guild-compile: Call 'pause' before 'sleep'
	  in test program.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	Don't return expressions from void functions in numbers.c
	Although popular compilers allow it as long as the expression is of type
	void, it violates C99 and some compilers choke on it.

	* libguile/numbers.c (scm_euclidean_divide, scm_floor_divide)
	  (scm_ceiling_divide, scm_truncate_divide, scm_centered_divide)
	  (scm_round_divide): Don't use the return statement with an expression
	  from functions with return type void.

2016-05-22  Mark H Weaver  <mhw@netris.org>

	Implement 'string-utf8-length' and 'scm_c_string_utf8_length'.
	* libguile/strings.c (utf8_length, scm_c_string_utf8_length)
	  (scm_string_utf8_length): New functions.
	* libguile/strings.h (scm_c_string_utf8_length, scm_string_utf8_length):
	  New prototypes.
	* doc/ref/api-data.texi (Bytevectors as Strings): Add docs.
	* doc/ref/guile.texi: Update manual copyright date to 2015.
	* test-suite/tests/strings.test (string-utf8-length): Add tests.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	http: Do not buffer HTTP chunks.
	Fixes <http://bugs.gnu.org/19939>.

	* module/web/http.scm (read-chunk, read-chunk-body): Remove.
	  (make-chunked-input-port)[next-chunk, buffer-, buffer-size,
	  buffer-pointer]: Remove.
	  [chunk-size, remaining]: New variables.
	  [read!]: Rewrite to write directly to BV.
	* test-suite/tests/web-http.test ("chunked encoding")["reads chunks
	  without buffering", "reads across chunk boundaries"]: New tests.

2016-05-22  Ludovic Courtès  <ludo@gnu.org>

	tests: Use 'pass-if-equal' in web-http chunked encoding tests.
	* test-suite/tests/web-http.test ("chunked encoding"): Use
	  'pass-if-equal' where appropriate.

2016-05-22  Andy Wingo  <wingo@pobox.com>

	Speed up port position access from Scheme
	* libguile/ports-internal.h (scm_port_buffer_position):
	  (scm_port_position_line, scm_port_position_set_line):
	  (scm_port_position_column, scm_port_position_set_column): New
	  helpers.
	  (scm_t_port): Ports now hold position as a pair, so that Scheme can
	  access it easily.
	  (SCM_LINUM, SCM_COL, SCM_INCLINE, SCM_ZEROCOL, SCM_INCCOL)
	  (SCM_DECCOL, SCM_TABCOL): Remove.
	* libguile/ports.c (make_port_buffer): Rename from
	  scm_c_make_port_buffer, make static, and take port as an argument so
	  we can initialize the position field.
	  (initialize_port_buffers): Adapt make_port_buffer change.
	  (scm_c_make_port_with_encoding): Initialize position.
	  (update_port_position): Rename from update_port_lf, and operate on
	  port position objects.
	  (scm_ungetc): Operate on port position objects.
	  (scm_setvbuf, scm_expand_port_read_buffer_x): Adapt to
	  make_port_buffer change.
	  (scm_lfwrite): Adapt to call update_port_position.
	  (scm_port_line, scm_set_port_line_x, scm_port_column)
	  (scm_set_port_column_x): Adapt to use port positions.
	* libguile/ports.h (scm_c_make_port_buffer): Remove internal decl.
	* libguile/read.c: Adapt to use scm_port_line / scm_port_column instead
	  of SCM_LINUM et al.
	* module/ice-9/ports.scm (port-buffer-position, port-position-line)
	  (port-position-column, set-port-position-line!)
	  (set-port-position-column!): New accessors for the internals module.
	* module/ice-9/sports.scm (advance-port-position!): Rename from
	  port-advance-position! and use the new accessors.
	  (read-char, port-fold-chars/iso-8859-1): Adapt to use
	  advance-port-position!.

	Implementation of read-delimited in Scheme
	* module/ice-9/sports.scm (port-fold-chars/iso-8859-1):
	  (port-fold-chars, read-delimited, read-line, %read-line): Initial
	  implementation of read-delimited.

	Sports refactor
	* module/ice-9/sports.scm (port-advance-position!): Factor out to a
	  helper.
	  (read-char): Use port-advance-position!.

2016-05-20  Andy Wingo  <wingo@pobox.com>

	Add install-sports!, uninstall-sports! functions
	* module/ice-9/sports.scm (install-sports!, uninstall-sports!): New
	  functions.

	Support for non-blocking I/O
	* doc/ref/api-io.texi (I/O Extensions): Document read_wait_fd /
	  write_wait_fd members.
	  (Non-Blocking I/O): New section.
	* libguile/fports.c (fport_read, fport_write): Return -1 if the
	  operation would block.
	  (fport_wait_fd, scm_make_fptob): Add read/write wait-fd
	  implementation.
	* libguile/ports-internal.h (scm_t_port_type): Add read_wait_fd /
	  write_wait_fd.
	* libguile/ports.c (default_read_wait_fd, default_write_wait_fd): New
	  functions.
	  (scm_make_port_type): Initialize default read/write wait fd impls.
	  (trampoline_to_c_read, trampoline_to_scm_read)
	  (trampoline_to_c_write, trampoline_to_scm_write): To Scheme, a return
	  of #f indicates EWOULDBLOCk.
	  (scm_set_port_read_wait_fd, scm_set_port_write_wait_fd): New
	  functions.
	  (port_read_wait_fd, port_write_wait_fd, scm_port_read_wait_fd)
	  (scm_port_write_wait_fd, port_poll, scm_port_poll): New functions.
	  (scm_i_read_bytes, scm_i_write_bytes): Poll if the read or write would
	  block.
	* libguile/ports.h (scm_set_port_read_wait_fd)
	  (scm_set_port_write_wait_fd): Add declarations.
	* module/ice-9/ports.scm: Shunt port-poll and port-{read,write}-wait-fd
	  to the internals module.
	* module/ice-9/sports.scm (current-write-waiter):
	  (current-read-waiter): Implement.
	* test-suite/tests/ports.test: Adapt non-blocking test to new behavior.
	* NEWS: Add entry.

2016-05-18  Andy Wingo  <wingo@pobox.com>

	Fix sports.test
	* test-suite/tests/sports.test (include-tests): Fix encoding when
	  reading ports.test.

2016-05-16  Andy Wingo  <wingo@pobox.com>

	Test Scheme port implementation
	* module/ice-9/ports.scm: Add port-decode-char to internals export
	  list.
	* test-suite/Makefile.am:
	* test-suite/tests/sports.test: Add new test.

	U+FFFD is the input substitution character
	* libguile/ports.c (UNICODE_REPLACEMENT_CHARACTER):
	* libguile/ports.c (peek_utf8_codepoint)
	  (scm_port_decode_char, peek_iconv_codepoint):
	* module/ice-9/sports.scm (peek-char-and-len/utf8):
	  (peek-char-and-len/iconv): Return U+FFFD when we get a decoding error
	  when reading, instead of '?', in accordance with Unicode
	  recommendations.
	* test-suite/tests/iconv.test:
	* test-suite/tests/ports.test:
	* test-suite/tests/rdelim.test: Update tests.
	* NEWS: Update.

	Bump objcode version
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION):
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump for
	  Guile 2.1.3.

2016-05-15  Andy Wingo  <wingo@pobox.com>

	Update NEWS for release
	* NEWS: Try to tell the port story better.

2016-05-14  Andy Wingo  <wingo@pobox.com>

	Remove unused type from ports-internal
	* libguile/ports-internal.h: Remove unused scm_t_port_rw_active.
	* libguile/deprecated.h (scm_port_rw_active): Remove deprecation shim,
	  as this thing is just gone now.

	Document scm_c_make_port and friends
	* doc/ref/api-io.texi (I/O Extensions): Document scm_c_make_port and
	  friends, and document "mode bits".

	Update port mode bits documentation.
	* libguile/ports.h: Update documentation of port mode bits.

	Add SCM_OPN to mode bits when making ports
	* libguile/ports.c (scm_c_make_port_with_encoding): Add SCM_OPN to mode
	  bits, so that users don't have to.
	  (scm_i_mode_bits_n):
	* libguile/print.c (scm_simple_format)
	* libguile/r6rs-ports.c (make_bytevector_input_port)
	  (make_custom_binary_input_port, make_bytevector_output_port)
	  (make_custom_binary_output_port, make_transcoded_port)
	* libguile/strports.c (scm_object_to_string, scm_open_input_string)
	  (scm_open_output_string, scm_c_read_string): Remove now-unneeded
	  SCM_OPN mentions.

2016-05-13  Andy Wingo  <wingo@pobox.com>

	Update port type documentation
	* doc/ref/api-io.texi (I/O Extensions): Update for port type change.

2016-05-13  Andy Wingo  <wingo@pobox.com>

	Use heap-allocated port types instead of ptobnums
	This removes a limitation on the number of port types, simplifies the
	API, and removes a central point of coordination.

	* libguile/ports-internal.h (struct scm_t_port_type): Rename from
	  scm_t_ptob_descriptor, now that it's private.  Add GOOPS class
	  fields.
	  (struct scm_t_port): Rename from struct scm_port, especially
	  considering that deprecated.h redefines scm_port using the
	  preprocessor :(.
	* libguile/ports.h: Add definitions of SCM_PORT and SCM_PORT_TYPE,
	  though the scm_t_port and scm_t_port_type types are incomplete.
	  (SCM_TC2PTOBNUM, SCM_PTOBNUM, SCM_PTOBNAME): Remove, as there are no
	  more typecodes for port types.
	  (scm_c_num_port_types, scm_c_port_type_ref, scm_c_port_type_add_x):
	  Remove.
	  (scm_make_port_type): Return a scm_t_port_type*.  All methods adapted
	  to take a scm_t_port_type* instead of a ptobnum.
	  (scm_c_make_port_with_encoding, scm_c_make_port): Take a port type
	  pointer instead of a tag.
	  (scm_new_port_table_entry): Remove; not useful.
	* libguile/ports.c: Remove things related to the port kind table.  Adapt
	  uses of SCM_PORT_DESCRIPTOR / scm_t_ptob_descriptor to use
	  SCM_PORT_TYPE and scm_t_port_type.
	* libguile/deprecated.c:
	* libguile/deprecated.h:
	* libguile/filesys.c:
	* libguile/fports.c:
	* libguile/fports.h:
	* libguile/print.c:
	* libguile/r6rs-ports.c:
	* libguile/strports.c:
	* libguile/strports.h:
	* libguile/tags.h:
	* libguile/vports.c:
	* test-suite/standalone/test-scm-c-read.c: Adapt to change.
	* libguile/goops.c (scm_class_of, make_port_classes)
	  (scm_make_port_classes, create_port_classes): Adapt to store the
	  classes in the ptob.

2016-05-13  Andy Wingo  <wingo@pobox.com>

	Make scm_t_ptob_descriptor private.
	* libguile/goops.c: Use port internals header.
	* libguile/ports-internal.h (scm_t_port_type_flags)
	  (struct scm_t_ptob_descriptor): Make private.
	* libguile/ports.h: Adapt.

	Update port documentation
	* doc/ref/api-io.texi: Update for refactorings.

	Remove scm_t_port_internal
	* libguile/ports-internal.h (SCM_PORT): Rename from SCM_PTAB_ENTRY.
	  (scm_t_port_internal, SCM_PORT_GET_INTERNAL): Remove.
	  (SCM_FILENAME, SCM_SET_FILENAME, SCM_LINUM, SCM_COL): Adapt.
	* libguile/ports.c:
	* libguile/poll.c:
	* libguile/ioext.c:
	* libguile/fports.c:
	* libguile/filesys.c:
	* libguile/print.c:
	* libguile/read.c:
	* libguile/rw.c:
	* libguile/strings.c: Adapt.

	Make scm_t_port private
	* libguile/ports-internal.h (enum scm_port_encoding_mode): Remove unused
	  enum.
	  (scm_t_port_internal, scm_t_port): Make encoding and
	  conversion_strategy private. Instead of scm_t_port_internal containing
	  scm_t_port, now that all members are private, we can store the user's
	  "stream" in a word in the port object itself and make the whole of
	  scm_t_port private.  The next commit will remove scm_t_port_internal.
	  (SCM_PTAB_ENTRY, SCM_PORT_DESCRIPTOR): Make private.
	* libguile/ports.c (scm_c_make_port_with_encoding): Adapt to new port
	  layout.
	  (scm_port_print): Use SCM_PTAB_ENTRY when printing.
	* libguile/ports.h: Remove scm_t_port definition.
	* libguile/ioext.c (get_matching_port): Simplify.
	* libguile/fports.c (scm_i_evict_port): Simplify.

	Make port buffering fields private
	* libguile/ports-internal.h (enum scm_port_buffer_field)
	  (scm_t_port_internal): Make port buffering fields private.
	* libguile/ports.h (scm_t_port): Adapt.
	* libguile/filesys.c (set_element):
	* libguile/ioext.c (scm_redirect_port):
	* libguile/poll.c (scm_primitive_poll):
	* libguile/ports.c:
	* libguile/read.c (scm_i_scan_for_encoding):
	* libguile/rw.c (scm_write_string_partial): Adapt users.

	Make file/line/column fields of ports private
	* libguile/ports-internal.h (scm_t_port_internal): Move file_name,
	  line_number, and column_number here.
	  (SCM_FILENAME, SCM_SET_FILENAME, SCM_LINUM, SCM_COL, SCM_INCLINE):
	  (SCM_ZEROCOL, SCM_INCCOL, SCM_DECCOL, SCM_TABCOL): Make internal.
	* libguile/ports.c (scm_c_make_port_with_encoding)
	  (scm_set_port_line_x, scm_set_port_column_x): Adapt to change.

	Embed scm_t_port in scm_t_port_internal
	* libguile/ports-internal.h (scm_t_port_internal)
	* libguile/ports.h (scm_t_port): Embed scm_t_port in scm_t_port_internal
	  so that we have just one allocation.
	* libguile/ports-internal.h (SCM_PORT_GET_INTERNAL): Adapt.
	* libguile/ports.c (scm_i_port_property, scm_i_set_port_property_x)
	  (scm_c_make_port_with_encoding): Adapt.

	Remove SCM backlink in port structure
	* libguile/ports.h (scm_t_port): Remove port backlink.
	* libguile/ports.c (scm_c_make_port_with_encoding, scm_fill_input)
	  (scm_seek): Adapt.

	Add random_access_p port type method
	* doc/ref/api-io.texi (I/O Extensions): Update documentation on
	  implementing port types.  Document get_natural_buffer_sizes.  Document
	  the new random_access_p.
	* libguile/fports.c (scm_i_fdes_to_port, fport_random_access_p):
	  (scm_make_fptob): Instead of frobbing rw_random manually, implement a
	  random_access_p function.
	* libguile/ports.c (default_random_access_p)
	  (scm_set_port_random_access_p): New functions.
	  scm_make_port_type, scm_c_make_port_with_encoding): Arrange for
	  random_access_p to work.

	Add (ice-9 sports) module
	* module/ice-9/sports.scm: New module.
	* module/Makefile.am (SOURCES): Add new module.

2016-05-13  Andy Wingo  <wingo@pobox.com>

	Beginnings of shunting ports-in-scheme off to a module
	* libguile/ports.c (scm_specialize_port_encoding_x): Add some sanity
	  checks.
	  (scm_unget_bytes): Use scm_expand_port_read_buffer_x.
	  (port_clear_stream_start_for_bom_read): Use
	  scm_specialize_port_encoding_x.
	  (scm_fill_input): Use scm_expand_port_read_buffer_x.
	  (scm_expand_port_read_buffer_x): Rename from
	  scm_set_port_read_buffer_x and actually expand the buffer.
	* libguile/ports.h: Adapt to scm_expand_port_read_buffer_x change.

	* module/ice-9/ports.scm: Remove ports-in-scheme stuff, and instead
	  expose the ports internals via an auxiliary module.  This will let
	  ports-in-scheme live in a module during Guile 2.2.

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

	Implement lookahead-u8, get-u8 in Scheme
	* module/ice-9/ports.scm (%lookahead-u8, %get-u8): Scheme
	  implementations.

2016-05-10  Andy Wingo  <wingo@pobox.com>

	%read-char speedup
	* module/ice-9/ports.scm (%read-char): Always call update-position! with
	  the same continuation, so that it will contify.

	Implement read-char in Scheme.
	* module/ice-9/ports.scm (%read-char): New function.

	%peek-char port argument optional.
	* module/ice-9/ports.scm (%peek-char): Port argument is optional.

	peek-char-and-len/iconv uses both returns from fill-input
	* module/ice-9/ports.scm (peek-char-and-len/iconv): Use buffered value
	  from fill-input.

	Fix bad-utf8-len bug.
	* module/ice-9/ports.scm (bad-utf8-len): Fix bug.

	clear-stream-start-for-bom-read refactor
	* module/ice-9/ports.scm (clear-stream-start-for-bom-read): Use the
	  "buffered" value that fill-input returns.

	Fix port-clear-stream-start-for-bom-read logic.
	* libguile/ports.c (scm_port_clear_stream_start_for_bom_read): Fix
	  logic.

	Scheme peek-char can handle iconv encodings
	* module/ice-9/ports.scm (peek-char-and-len/iconv): Fully implement.

	Factor out iconv to port-decode-char
	* libguile/ports.c (scm_port_decode_char): New helper, exported
	  to (ice-9 ports).
	  (peek_iconv_codepoint): Use scm_port_decode_char.

	Simplify decoding error handling
	* libguile/ports.c (peek_utf8_codepoint, peek_latin1_codepoint):
	  (peek_iconv_codepoint, peek_codepoint): Refactor to push error
	  handling to the leaves, where errors happen.  Just return
	  the (possibly substituted) codepoint, without an error code; if
	  there's really an error, we should raise it.
	  (scm_getc, scm_peek_char): Adapt.

	Decoding errors do not advance read pointer
	* libguile/ports.c (scm_getc): If the port conversion strategy is
	  'error, signal an error before advancing the read pointer.  This is a
	  change from previous behavior; before, we advanced the read pointer
	  under an understanding that that was what R6RS required.  But, that
	  seems to be not the case.
	* test-suite/tests/ports.test ("string ports"): Update decoding-error
	  tests to assume that read-char with an error doesn't advance the read
	  pointer.
	* test-suite/tests/rdelim.test ("read-line"): Likewise.

	Fix bug in trampoline_to_c_read
	* libguile/ports.c (trampoline_to_c_read): Fix bug comparing SCM
	  values.

2016-05-07  Andy Wingo  <wingo@pobox.com>

	Speed refactors to Scheme %peek-char
	* module/ice-9/ports.scm (peek-bytes): New helper.
	  (peek-byte): Use peek-bytes helper.
	  (decoding-error): Don't inline; no need.
	  (decode-utf8, bad-utf8-len): New helpers.
	  (peek-char-and-len/utf8): Use new helpers.
	  (peek-char-and-len): No fast paths, and not inline.  Peek-char has its
	  own fast path.
	  (%peek-char): Use helpers to make fast path.

	Fix port-clear-stream-start-for-bom-read bug
	* libguile/ports.c (scm_port_clear_stream_start_for_bom_read): Fix to
	  return SCM_BOOL_F instead of 0.

2016-05-05  Andy Wingo  <wingo@pobox.com>

	Fix use of port-encoding
	* module/ice-9/ports.scm (clear-stream-start-for-bom-read): Fix to use
	  %port-encoding, which works in symbols.

	Speed up peek-char
	* module/ice-9/ports.scm (peek-char-and-len): Only inline fast path for
	  UTF-8.

2016-05-05  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct wrong live information for some code patterns
		* lib/lightning.c: Correct wrong movr simplification,
		remove no longer needed code to set return registers live
		and update live register set when reaching a label boundary,
		but do not descend if the block has been already visited.
		The later need some tuning for complex code generation, where
		it will still have issues.

2016-05-05  Andy Wingo  <wingo@pobox.com>

	Port to Scheme of new BOM handling
	* libguile/ports.c (scm_specialize_port_encoding_x)
	  (scm_port_clear_stream_start_for_bom_read): New functions exported
	  to (ice-9 ports).
	* module/ice-9/ports.scm (clear-stream-start-for-bom-read):
	  (fill-input, peek-char-and-len): Rework to handle BOM in fill-input
	  instead of once per peek-char.

2016-05-05  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct wrong movr simplification

2016-05-05  Andy Wingo  <wingo@pobox.com>

	Handle BOM around fill/flush instead of peek/put
	* libguile/print.c (display_string_using_iconv): Remove BOM handling;
	  this is now handled by scm_lfwrite.
	* libguile/ports.c (open_iconv_descriptors): Refactor to take encoding
	  as a symbol.
	  (prepare_iconv_descriptors): New helper.
	  (scm_i_port_iconv_descriptors): Remove scm_t_port_rw_active argument,
	  and don't sniff UTF-16/UTF-32 byte orders here.  Instead BOM handlers
	  will call prepare_iconv_descriptors.
	  (scm_c_read_bytes): Call new port_clear_stream_start_for_bom_read
	  helper.
	  (port_maybe_consume_initial_byte_order_mark)
	  (scm_port_maybe_consume_initial_byte_order_mark): Remove.  Leaves
	  Scheme %peek-char broken but it's unused currently so that's OK.
	  (peek_iconv_codepoint): Fetch iconv descriptors after doing fill-input
	  because it's fill-input that will sniff the BOM.
	  (peek_codepoint): Instead of handling BOM at every character, handle
	  in fill-input instead.
	  (maybe_consume_bom, port_clear_stream_start_for_bom_read)
	  (port_clear_stream_start_for_bom_write): New helpers.
	  (scm_fill_input): Slurp a BOM if needed.
	  (scm_i_write): Clear the start-of-stream-for-bom-write flag.
	  (scm_lfwrite): Write a BOM if needed.

2016-05-04  Andy Wingo  <wingo@pobox.com>

	Spead tweaks to Scheme peek-char
	* module/ice-9/ports.scm: Speed tweaks to %peek-char.  Ultimately
	  somewhat fruitless; I can get 1.4s instead of 1.5s by only
	  half-inlining the UTF-8 case though.

	Add integer->char and char->integer opcodes
	* libguile/vm-engine.c (integer_to_char, char_to_integer): New opcodes.
	* libguile/vm.c (vm_error_not_a_char): New error case.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/types.scm:
	* module/language/tree-il/compile-cps.scm (convert):
	* doc/ref/vm.texi (Inlined Scheme Instructions):
	* module/system/vm/assembler.scm: Add support for new opcodes.

	Initial peek-char implementation in Scheme
	* module/ice-9/ports.scm (EILSEQ, decoding-error, peek-char-and-len/utf8):
	  (peek-char-and-len/iso-8859-1, peek-char-and-len/iconv):
	  (peek-char-and-len, %peek-char): New definitions.  Missing iconv1 for
	  peek-char, but enough to benchmark.

	Port refactors to help Scheme peek-char
	* libguile/ports.h (scm_sys_port_encoding, scm_sys_set_port_encoding):
	  New functions, to expose port encodings as symbols directly to (ice-9
	  ports).
	  (scm_port_maybe_consume_initial_byte_order_mark): New function.
	* libguile/ports.c (scm_port_encoding): Dispatch to %port-encoding.
	  (scm_set_port_encoding_x): Dispatch to %set-port-encoding!.
	  (port_maybe_consume_initial_byte_order_mark): New helper, factored out
	  of peek_codepoint.
	  (scm_port_maybe_consume_initial_byte_order_mark, peek_codepoint): Call
	  port_maybe_consume_initial_byte_order_mark.
	* module/ice-9/ports.scm (port-encoding): Implement in Scheme.

	Port conversion strategies internally are symbols
	* libguile/ports.h (scm_t_port): Represent the conversion strategy as a
	  symbol, to make things easier for Scheme.  Rename to
	  "conversion_strategy".
	  (scm_c_make_port_with_encoding): Change to take encoding and
	  conversion_strategy arguments as symbols.
	  (scm_i_string_failed_conversion_handler): New internal helper, to turn
	  a symbol to a scm_t_string_failed_conversion_handler.
	  (scm_i_default_port_encoding): Return the default port encoding as a
	  symbol.
	  (scm_i_default_port_conversion_strategy)
	  (scm_i_set_default_port_conversion_strategy): Rename from
	  scm_i_default_port_conversion_handler et al.  Take and return Scheme
	  symbols.
	* libguile/foreign.c (scm_string_to_pointer, scm_pointer_to_string): Use
	  scm_i_default_string_failed_conversion_handler instead of
	  scm_i_default_port_conversion_handler.
	* libguile/print.c (PORT_CONVERSION_HANDLER): Update definition.
	  (print_normal_symbol): Use PORT_CONVERSION_HANDLER.
	* libguile/r6rs-ports.c (make_bytevector_input_port):
	  (make_custom_binary_input_port, make_bytevector_output_port): Adapt to
	  changes in scm_c_make_port_with_encoding.
	* libguile/strings.h:
	* libguile/strings.c (scm_i_default_string_failed_conversion_handler):
	  New helper.
	  (scm_from_locale_stringn, scm_from_port_stringn):
	  (scm_to_locale_stringn, scm_to_port_stringn): Adapt to interface
	  changes.
	* libguile/strports.c (scm_mkstrport): Adapt to
	  scm_c_make_port_with_encoding change.
	* libguile/ports.c (scm_c_make_port): Adapt to
	  scm_c_make_port_with_encoding change.
	  (ascii_toupper, encoding_matches, canonicalize_encoding): Move down in
	  the file.
	  (peek_codepoint, get_codepoint, scm_ungetc): Adapt to port conversion
	  strategy change.  Remove duplicate case in get_codepoint.
	  (scm_init_ports): Move symbol initializations to the same place.

2016-05-03  Andy Wingo  <wingo@pobox.com>

	Port encoding internally represented as symbol
	* libguile/ports-internal.h (scm_t_port_internal): Remove encoding_mode
	  member.
	* libguile/ports.h (scm_t_port): "encoding" member is now a SCM symbol.
	* libguile/ports.c (scm_init_ports): Define symbols for the encodings
	  that we handle explicitly.
	  (encoding_matches): Adapt to check against an encoding as a symbol.
	  (canonicalize_encoding): Return an encoding as a symbol.
	  (scm_c_make_port_with_encoding, scm_i_set_default_port_encoding)
	  (decide_utf16_encoding, decide_utf32_encoding)
	  (scm_i_port_iconv_descriptors, scm_i_set_port_encoding_x)
	  (scm_port_encoding, peek_codepoint, scm_ungetc): Adapt to encoding
	  change.

	* libguile/print.c (display_string_using_iconv, display_string):
	* libguile/read.c (scm_read_character):
	* libguile/strings.c (scm_from_port_stringn, scm_to_port_stringn): Adapt
	  to port encoding change.

2016-05-01  Andy Wingo  <wingo@pobox.com>

	Minor tweak to Scheme peek-byte.
	* module/ice-9/ports.scm (peek-byte): Use second return from
	  fill-input.

	Changes to Scheme fill-input corresponding to C
	* module/ice-9/ports.scm (fill-input): Rewrite to make changes like the
	  ones made to the C scm_fill_input: allow callers to specify a minimum
	  amount of buffering.

	Char readers peek into read buffer
	* libguile/ports.c (scm_i_set_pending_eof): Remove now-unused helper.
	  (peek_utf8_codepoint, peek_latin1_codepoint, peek_iconv_codepoint):
	  (peek_codepoint): Refactor the fundamental character readers in Guile
	  to peek into the read buffer instead of reading then unreading.  This
	  will allow Scheme to use the port buffer to convert, when we port this
	  to Scheme.
	  (get_codepoint): Use peek_codepoint.
	  (scm_getc): Adapt.
	  (scm_peek_char): Use peek_codepoint.

	scm_fill_input can guarantee a minimum fill amount
	* libguile/ports.h (scm_fill_input): Add "minimum_size" argument.  Adapt
	  all callers to pass 0 as this argument.
	* libguile/ports.c (scm_i_read): Inline into scm_fill_input.
	  (scm_fill_input): "minimum_size" argument ensures that there are a
	  certain number of bytes available, or EOF.  Instead of shrinking the
	  read buffer, only fill by the read_buffering amount, or the
	  minimum_size, whichever is larger.
	* libguile/r6rs-ports.c:
	* libguile/read.c: Adapt scm_fill_input callers.

2016-04-30  Andy Wingo  <wingo@pobox.com>

	peek-byte in Scheme
	* libguile/ports.c (trampoline_to_c_read, trampoline_to_c_write): Since
	  C might assume that the indices are within bounds of the bytevector,
	  verify them more here.
	  (scm_port_random_access_p, scm_port_read_buffering)
	  (scm_set_port_read_buffer, scm_port_read, scm_port_write): New helpers
	  exposed to (ice-9 ports).
	  (scm_port_read_buffer, scm_port_write_buffer): Don't flush or validate
	  port mode; we do that in Scheme.
	* module/ice-9/ports.scm: Implement enough of port machinery to
	  implement peek-byte in Scheme.  Not yet exported.

	Tweak port initialization order
	* libguile/init.c (scm_i_init_guile): Initialize ports before
	  strports/fports, so that we have initialized the read/write
	  trampolines before making port types.

	Refactor way the-eof-object is defined
	* libguile/ports.c (scm_init_ice_9_ports): Define the-eof-object here.
	  Update a comment.
	* module/ice-9/ports.scm: Use the-eof-object definition from C.

	Add SCM port read/write functions
	* libguile/ports.h (scm_t_ptob_descriptor): Add "scm_read" and
	  "scm_write" members, for calling from Scheme.
	  (scm_set_port_scm_read, scm_set_port_scm_write): New procedures.
	* libguile/ports.c (trampoline_to_c_read_subr)
	  (trampoline_to_c_write_subr): New static variables.
	* libguile/ports.c (scm_make_port_type): Initialize scm_read and
	  scm_write members to trampoline to C.
	  (trampoline_to_c_read, trampoline_to_scm_read)
	  (trampoline_to_c_write, trampoline_to_scm_write): New helpers.
	  (scm_set_port_scm_read, scm_set_port_scm_write): New functions.
	  (default_buffer_size): Move definition down.
	  (scm_i_read_bytes, scm_i_write_bytes): Use new names for read and
	  write procedures.
	  (scm_init_ports): Initialize trampolines.

2016-04-28  Andy Wingo  <wingo@pobox.com>

	Remove port locks
	* libguile/ports.h (scm_t_port): Remove lock field.
	  (scm_dynwind_lock_port, scm_c_lock_port, scm_c_try_lock_port):
	  Remove.
	* libguile/ports.c (scm_i_port_property, scm_i_set_port_property_x):
	  Remove locking.
	* libguile/ports.c (scm_c_make_port_with_encoding): Remove lock.
	  (scm_i_read_bytes, scm_i_read, scm_i_write_bytes, scm_i_write): Remove
	  "_unlocked" from names and adapt callers.

	Optimize peek-char
	* libguile/ports.c (scm_peek_char): Optimize.  A loop calling peek-char
	  on a buffered string port 10e6 times goes down from 50ns/iteration to
	  32ns/iteration.

	Remove port locking around write, display
	* libguile/print.c (scm_write, scm_display):
	* libguile/read.c (set_port_read_option): Remove port locking.  Reading
	  and writing to the same port from multiple threads just must not
	  crash; it doesn't have to make sense.

2016-04-26  Andy Wingo  <wingo@pobox.com>

	scm_lfwrite, not scm_lfwrite_unlocked
	* libguile/ports.h (scm_lfwrite_unlocked): Remove.
	* libguile/ports.c (scm_lfwrite): Rename from scm_lfwrite_unlocked.
	* libguile/numbers.c:
	* libguile/print.c: Adapt to call scm_lfwrite.

	Remove scm_c_write_unlocked
	* libguile/ports.h (scm_c_write_bytes_unlocked): Remove.
	* libguile/ports.c (scm_c_write_bytes): Rename from
	  scm_c_write_bytes_unlocked, make public, and return void.
	  (scm_c_write): Rename from scm_c_write_unlocked.  Remove locked
	  variant.
	  (scm_lfwrite_unlocked): Call scm_c_write.
	* libguile/rw.c (scm_write_string_partial): Call scm_c_write.

	Remove scm_puts_unlocked.
	* libguile/ports.h (scm_puts_unlocked): Remove.
	* libguile/ports.c (scm_puts): Replace implementation with
	  scm_puts_unlocked's implementation.
	* libguile/arbiters.c:
	* libguile/backtrace.c:
	* libguile/bitvectors.c:
	* libguile/continuations.c:
	* libguile/deprecation.c:
	* libguile/dynl.c:
	* libguile/eval.c:
	* libguile/filesys.c:
	* libguile/fluids.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/guardians.c:
	* libguile/hashtab.c:
	* libguile/hooks.c:
	* libguile/load.c:
	* libguile/macros.c:
	* libguile/mallocs.c:
	* libguile/print.c:
	* libguile/programs.c:
	* libguile/promises.c:
	* libguile/smob.c:
	* libguile/srcprop.c:
	* libguile/srfi-14.c:
	* libguile/stackchk.c:
	* libguile/struct.c:
	* libguile/threads.c:
	* libguile/throw.c:
	* libguile/values.c:
	* libguile/variable.c:
	* libguile/vm.c:
	* libguile/weak-set.c:
	* libguile/weak-table.c: Use scm_puts instead of scm_puts_unlocked.

	Remove scm_putc_unlocked.
	* libguile/ports.h (scm_putc_unlocked): Remove.
	* libguile/ports.c (scm_putc): Replace implementation with
	  scm_putc_unlocked's implementation.
	  (scm_port_print): Use scm_putc.
	* libguile/arbiters.c:
	* libguile/arrays.c:
	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/continuations.c:
	* libguile/dynl.c:
	* libguile/eval.c:
	* libguile/filesys.c:
	* libguile/fluids.c:
	* libguile/foreign.c:
	* libguile/fports.c:
	* libguile/frames.c:
	* libguile/hashtab.c:
	* libguile/hooks.c:
	* libguile/macros.c:
	* libguile/mallocs.c:
	* libguile/print.c:
	* libguile/programs.c:
	* libguile/promises.c:
	* libguile/r6rs-ports.c:
	* libguile/smob.c:
	* libguile/srcprop.c:
	* libguile/struct.c:
	* libguile/variable.c:
	* libguile/weak-set.c:
	* libguile/weak-table.c: Use scm_putc instead of scm_putc_unlocked.

	Remove scm_fill_input_unlocked
	* libguile/ports.h (scm_fill_input_unlocked): Remove.
	* libguile/ports.c (scm_fill_input): Rename from
	  scm_fill_input_unlocked.  Adapt callers.
	* libguile/r6rs-ports.c (scm_get_bytevector_some): Adapt.
	* libguile/read.c (scm_i_scan_for_encoding): Adapt.

	Remove locking in scm_end_input
	* libguile/ports.c (scm_end_input): Sadly, we can't naively lock around
	  the scm_port_buffer_take, as it might throw.  Will revisit in the
	  future.

2016-04-23  Andy Wingo  <wingo@pobox.com>

	scm_ungetc, scm_ungets instead of _unlocked variants
	* libguile/ports.h (scm_ungetc_unlocked, scm_ungets_unlocked): Remove;
	  replace with scm_ungetc, scm_ungets.
	* libguile/ports.c (scm_ungetc, scm_ungets, scm_unread_char)
	  (scm_unread_string): Adapt.
	* libguile/rdelim.c (scm_read_delimited_x): Use scm_ungetc.
	* libguile/read.c: Unread characers with scm_ungetc, not
	  scm_ungetc_unlocked.

	Remove scm_unget_{byte,bytes}_unlocked
	* libguile/ports.h (scm_unget_bytes_unlocked, scm_unget_byte_unlocked):
	  Remove.
	* libguile/ports.c (looking_at_bytes): Use scm_unget_bytes instead of
	  scm_i_unget_bytes_unlocked
	  (scm_unget_bytes): Rename from scm_i_unget_bytes_unlocked.  Remove
	  other implementations of this function.
	  (scm_unget_byte): Likewise.
	  (scm_ungetc_unlocked, scm_peek_char): Use scm_unget_byte.
	* libguile/read.c (read_token): Use scm_unget_byte.

	Replace scm_getc with scm_getc_unlocked
	* libguile/ports.h (scm_getc_unlocked): Remove, or rather rename to
	  scm_getc.  This probably introduces some thread-related bugs but we'll
	  fix them in a different way.
	* libguile/ports.c (scm_getc): Rename from scm_getc_unlocked, replacing
	  the locky implementation.
	  (scm_read_char): Use scm_getc.
	* libguile/r6rs-ports.c (scm_get_string_n_x): Use scm_getc.
	* libguile/rdelim.c (scm_read_delimited_x, scm_read_line): Use
	  scm_getc.
	* libguile/read.c: Use scm_getc.

	Remove scm_c_read_bytes_unlocked
	* libguile/ports.c (scm_c_read_bytes_unlocked): Remove internal
	  function.

	Remove scm_flush_unlocked / scm_end_input_unlocked
	* libguile/ports.h (scm_flush_unlocked, scm_end_input_unlocked):
	  Remove.
	* libguile/ports.c (scm_c_read_bytes_unlocked):
	  (scm_i_unget_bytes_unlocked, scm_setvbuf, scm_force_output)
	  (scm_fill_input_unlocked, scm_c_write_bytes_unlocked)
	  (scm_c_write_unlocked, scm_lfwrite_unlocked, scm_seek)
	  (scm_truncate_file, flush_output_port): Call scm_flush / scm_end_input
	  instead of the _unlocked variants.
	  (scm_end_input): Lock while discarding the input buffer but not while
	  calling out to the seek function.
	* libguile/filesys.c (scm_fsync):
	* libguile/ioext.c (scm_redirect_port):
	* libguile/read.c (scm_i_scan_for_encoding):
	* libguile/rw.c (scm_write_string_partial): Use scm_flush, not
	  scm_flush_unlocked.

2016-04-22  Andy Wingo  <wingo@pobox.com>

	Remove port rw_active field
	* libguile/ports.h (scm_t_port_rw_active): Move type definition to
	  ports-internal.h.
	  (scm_t_port): Remove rw_active field.  It's sufficient to check the
	  port buffer cursors.
	* libguile/read.c (scm_i_scan_for_encoding): Just call
	  scm_flush_unlocked; it's idempotent.
	* libguile/ports.c (scm_c_make_port_with_encoding): Remove rw_active
	  field.
	  (scm_c_read_bytes_unlocked, scm_c_read, scm_i_unget_bytes_unlocked)
	  (scm_end_input_unlocked, scm_flush_unlocked, scm_fill_input_unlocked)
	  (scm_port_write_buffer, scm_port_read_buffer)
	  (scm_c_write_bytes_unlocked, scm_c_write_unlocked, scm_seek): Remove
	  management of rw_active field.

	scm_c_read instead of scm_c_read_unlock
	* libguile/ports.h (scm_c_read_unlocked): Remove.
	* libguile/ports.c (scm_c_read): Rename from scm_c_read_unlocked.
	  Remove old scm_c_read.  Lock around access to the rw_active flag, and
	  call scm_flush instead of scm_flush_unlocked, and scm_fill_input
	  instead of scm_fill_input_unlocked.
	* libguile/read.c (scm_i_scan_for_encoding): Use scm_c_read instead of
	  the _unlocked function.

	Refactor to internal get/peek-byte functions
	* libguile/ports.h (scm_get_byte_or_eof_unlocked)
	  (scm_peek_byte_or_eof_unlocked): Remove inline functions.  The
	  important uses are in ports.c anyway and we will use a static function
	  there.
	  (scm_slow_get_byte_or_eof_unlocked)
	  (scm_slow_peek_byte_or_eof_unlocked): Remove declarations without
	  definitions.
	* libguile/ports.c (looking_at_bytes): Use scm_peek_byte_or_eof instead
	  of the _unlocked variant.
	  (get_byte_or_eof, peek_byte_or_eof): New static functions.
	  (scm_get_byte_or_eof, scm_peek_byte_or_eof): Don't lock: the port
	  buffer mechanism means that we won't crash.  More comments to come.
	  (get_utf8_codepoint, get_latin1_codepoint, get_iconv_codepoint): Use
	  new static functions.
	* libguile/read.c (read_token, scm_read_semicolon_comment): Use
	  scm_get_byte_or_eof, not scm_get_byte_or_eof_unlocked.

	Refactor thread safety for %port-property
	* libguile/ports.c (scm_i_port_property, scm_i_set_port_property_x):
	  Knowing that the critical section can't throw, use serial lock
	  discipline.

2016-04-20  Andy Wingo  <wingo@pobox.com>

	Port buffers are Scheme values
	* libguile/ports-internal.h (scm_port_buffer_bytevector)
	  (scm_port_buffer_cur, scm_port_buffer_set_cur)
	  (scm_port_buffer_end, scm_port_buffer_set_end)
	  (scm_port_buffer_has_eof_p, scm_port_buffer_set_has_eof_p): New
	  helpers.
	* libguile/ports-internal.h (scm_port_buffer_size)
	  (scm_port_buffer_reset, scm_port_buffer_reset_end)
	  (scm_port_buffer_can_take, scm_port_buffer_can_put)
	  (scm_port_buffer_can_putback, scm_port_buffer_did_take)
	  (scm_port_buffer_did_put, scm_port_buffer_take_pointer)
	  (scm_port_buffer_put_pointer, scm_port_buffer_take)
	  (scm_port_buffer_put, scm_port_buffer_putback): Adapt to treat port
	  buffers as SCM values and use helpers to access them.
	* libguile/ports.c (scm_i_clear_pending_eof, scm_i_set_pending_eof)
	  (scm_c_make_port_buffer, scm_i_read_unlocked)
	  (scm_c_read_bytes_unlocked, scm_i_unget_bytes_unlocked)
	  (scm_setvbuf, scm_fill_input, scm_take_from_input_buffers)
	  (scm_drain_input, scm_end_input_unlocked, scm_flush_unlocked)
	  (scm_fill_input_unlocked, scm_i_write_unlocked)
	  (scm_c_write_bytes_unlocked, scm_c_write_unlocked)
	  (scm_char_ready_p): Adapt to treat port buffers as SCM values and use
	  helpers to access them.
	  (scm_port_read_buffer, scm_port_write_buffer): New functions,
	  allowing (ice-9 ports) to access port buffers.
	* libguile/ports.h: Update comments on port buffers.  Replace
	  scm_t_port_buffer structure with a Scheme vector whose fields are
	  enumerated by "enum scm_port_buffer_field".
	  (scm_get_byte_or_eof_unlocked, scm_peek_byte_or_eof_unlocked): Adapt
	  these implementations to port buffer representation change.
	* libguile/r6rs-ports.c (scm_get_bytevector_some):
	* libguile/read.c (scm_i_scan_for_encoding):
	* libguile/rw.c (scm_write_string_partial): Port buffers are Scheme
	  objects.

2016-04-19  Andy Wingo  <wingo@pobox.com>

	peek-u8 correctness and speed refactor
	* libguile/ports-internal.h (scm_port_buffer_size): Verify that the
	  bytevector field is a bytevector, in anticipation of Schemification.
	  (scm_port_buffer_can_take, scm_port_buffer_can_put)
	  (scm_port_buffer_can_putback): Enforce invariants on cur and end
	  here.
	  (scm_port_buffer_did_take, scm_port_buffer_did_put): Relax to not call
	  other functions.
	* libguile/ports.h (scm_get_byte_or_eof_unlocked)
	  (scm_peek_byte_or_eof_unlocked): Refactor to call no functions on the
	  fast path.

	Port buffer cur/next pointers are Scheme values
	* libguile/ports.h (scm_t_port_buffer): Change "cur" and "end" members
	  to be SCM values, in preparation for changing port buffers to be
	  Scheme vectors.
	  (scm_get_byte_or_eof_unlocked, scm_peek_byte_or_eof_unlocked): Adapt.
	* libguile/ports.c (scm_c_make_port_buffer): Initialize cur and end
	  members.
	  (looking_at_bytes): Use helper instead of incrementing cur.
	  (scm_i_read_unlocked): Adapt to end type change.
	  (CONSUME_PEEKED_BYTE): Use helper instead of incrementing cur.
	  (scm_i_unget_bytes_unlocked): Use helper instead of comparing cur.
	  (scm_i_write_unlocked): Fix for changing end/cur types.
	* libguile/read.c (scm_i_scan_for_encoding): Use helpers instead of
	  addressing cursors directly.
	* libguile/rw.c (scm_write_string_partial): Likewise.
	* libguile/ports-internal.h (scm_port_buffer_reset):
	  (scm_port_buffer_reset_end, scm_port_buffer_can_take):
	  (scm_port_buffer_can_put, scm_port_buffer_can_putback):
	  (scm_port_buffer_did_take, scm_port_buffer_did_put):
	  (scm_port_buffer_take_pointer, scm_port_buffer_put_pointer):
	  (scm_port_buffer_putback): Adapt to data types.

2016-04-18  Andy Wingo  <wingo@pobox.com>

	Remove "buf" field from port buffers
	* libguile/ports-internal.h (scm_port_buffer_reset_end): New helper.
	  (scm_port_buffer_putback): New helper.
	* libguile/ports.h (scm_t_port_buffer): Remove "buf" field.
	  (scm_get_byte_or_eof_unlocked, scm_peek_byte_or_eof_unlocked): Adapt.
	* libguile/ports.c (scm_c_make_port_buffer): No more "buf" field.
	  (scm_i_unget_bytes_unlocked): Use helper.
	* libguile/read.c (scm_i_scan_for_encoding): No more "buf" field.

2016-04-17  Andy Wingo  <wingo@pobox.com>

	Remove size field from port buffers
	* libguile/ports.h (scm_t_port_buffer): Remove size field.  Instead use
	  bytevector size.
	* libguile/ports-internal.h (scm_port_buffer_size)
	  (scm_port_buffer_reset)
	  (scm_port_buffer_can_take, scm_port_buffer_can_put)
	  (scm_port_buffer_did_take, scm_port_buffer_did_put)
	  (scm_port_buffer_take_pointer, scm_port_buffer_put_pointer)
	  (scm_port_buffer_take, scm_port_buffer_put): New helpers.
	* libguile/filesys.c (set_element): Use new helpers.
	* libguile/poll.c (scm_primitive_poll): Use new helpers.
	* libguile/ports.c (scm_c_make_port_buffer): No more "size" field.
	  (scm_i_read_unlocked, scm_c_read_bytes_unlocked)
	  (scm_c_read_unlocked, scm_i_unget_bytes_unlocked)
	  (scm_unget_bytes, scm_setvbuf, scm_take_from_input_buffers)
	  (scm_drain_input, scm_end_input_unlocked, scm_flush_unlocked)
	  (scm_fill_input_unlocked, scm_i_write_unlocked)
	  (scm_c_write_bytes_unlocked, scm_c_write_unlocked)
	  (scm_char_ready_p): Use new helpers.
	* libguile/r6rs-ports.c (scm_get_bytevector_some): Use new helpers.
	* libguile/rw.c (scm_write_string_partial): Use new helpers.

	Port buffer has-eof? field is SCM value
	* libguile/ports.h (scm_t_port_buffer): Rename has_eof member to
	  has_eof_p, and be a Scheme value, in anticipation of moving the port
	  buffers to be Scheme objects.

	Remove unrelated scm_t_port_buffer use in vports
	* libguile/vports.c (struct soft_port): Inline the encoding buffer so as
	  to not use scm_t_port_buffer, in anticipation of changing the port
	  buffer representations.  Adapt users.

2016-04-15  Andy Wingo  <wingo@pobox.com>

	Load port bindings in separate (ice-9 ports) module
	* module/ice-9/ports.scm: New file.
	* am/bootstrap.am (SOURCES): Add ice-9/ports.scm.
	* libguile/fports.c (scm_init_ice_9_fports): New function.
	  (scm_init_fports): Arrange for scm_init_ice_9_fports to be called via
	  load-extension, and load snarfed things there.  Move open-file
	  definition early, to allow ports to bootstrap.
	* libguile/ioext.c (scm_init_ice_9_ioext): New function.
	  (scm_init_ioext): Similarly, register scm_init_ice_9_ioext as an
	  extension.
	* libguile/ports.c (scm_set_current_input_port)
	  (scm_set_current_output_port, scm_set_current_error_port): Don't
	  define Scheme bindings; do that in Scheme.
	* libguile/ports.c (scm_i_set_default_port_encoding):
	  (scm_i_default_port_encoding, scm_i_default_port_conversion_handler):
	  (scm_i_set_default_port_conversion_handler): Since we now init
	  encoding early, remove the "init" flags on these encoding/strategy
	  vars.
	  (scm_init_ice_9_ports): New function.
	  (scm_init_ports): Register scm_init_ice_9_ports extension, and define
	  some bindings needed by the bootstrap.
	* module/Makefile.am (SOURCES): Add ice-9/ports.scm.
	* module/ice-9/boot-9.scm: Remove code that's not on the boot path,
	  moving it to ice-9/ports.scm.  At the end, load (ice-9 ports).
	* module/ice-9/psyntax.scm (include): Use close-port instead of
	  close-input-port.
	* module/ice-9/psyntax-pp.scm (include): Regenerate.

2016-04-14  Andy Wingo  <wingo@pobox.com>

	Fix R6RS imports of interfaces that use interfaces
	* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface): In Guile, a
	  module's public interface is just another module, and that means that
	  it can import other modules as well.  Allow for R6RS modules that
	  import module whose interfaces import other modules to access all
	  visible bindings.
	* test-suite/tests/rnrs-libraries.test ("import features"): Update
	  test.

	Fix scm_init_struct dependency on port conversion handlers
	* libguile/struct.c (scm_init_struct): Use scm_from_latin1_string to
	  avoid locale-dependency for what is really a latin1 string.  Also
	  avoids an early dependency on the default port conversion handler,
	  though I wonder if using port conversion handlers in strings is the
	  right thing.

2016-04-13  Andy Wingo  <wingo@pobox.com>

	Fix error in exception printer when bootstrapping
	* module/ice-9/boot-9.scm (exception-printers): Fix error in which, for
	  a pure bootstrap with no compiled files, the exception printer would
	  use false-with-exception before it has been defined, which doesn't
	  work for macros.  We wouldn't see this problem normally because,
	  oddly, the macro is indeed defined normally because of boot reasons.

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

	Allow port "write" functions to only write a chunk
	* libguile/ports.c (scm_i_write_bytes_unlocked): Allow incomplete
	  writes from the implementation.
	  (scm_c_write_bytes_unlocked): Use scm_i_write_bytes_unlocked helper to
	  call the write function.
	* libguile/r6rs-ports.c (custom_binary_output_port_write): Don't loop;
	  core Guile will do that.

	Update port implementation documentation.
	* doc/ref/api-io.texi (I/O Extensions): Update read/write
	  documentation.

2016-04-11  Andy Wingo  <wingo@pobox.com>

	Port read/write functions take bytevectors
	This will allow better Scheme integration for ports.

	* libguile/ports.h (scm_t_port_buffer): Change "holder" member to be a
	  bytevector defined to have "buf" as its starting point.
	  (scm_t_ptob_descriptor): Change read and write functions to take
	  bytevectors as arguments and to return the number of octets read or
	  written.
	  (scm_make_port_type): Adapt accordingly.
	  (scm_c_read_bytes, scm_c_write_bytes): New functions that take
	  bytevectors.
	* libguile/ports.c (scm_make_port_type): Adapt to read/write function
	  prototype change.
	  (scm_c_make_port_buffer): Arrange to populate the "bytevector" field.
	  (scm_i_read_bytes_unlocked): New function.
	  (scm_i_read_unlocked): Use scm_i_read_bytes_unlocked.
	  (scm_c_read_bytes_unlocked): New function.
	  (scm_c_read_unlocked): Update comment, and always go through the
	  buffer.
	  (scm_c_read_bytes): New function.
	  (scm_flush_unlocked): Use scm_i_write_unlocked instead of the port's
	  write function.
	  (scm_i_write_bytes_unlocked): New function.
	  (scm_i_write_unlocked): Use scm_i_write_bytes_unlocked.
	  (scm_c_write_bytes_unlocked): New function.
	  (scm_c_write_unlocked): Always write through the buffer.
	  (scm_c_write_bytes): New function.
	  (scm_truncate_file): Remove unused variable.
	  (void_port_read, void_port_write): Adapt to read/write prototype
	  change.
	* libguile/fports.c (fport_read, fport_write):
	* libguile/r6rs-ports.c (bytevector_input_port_read)
	  (custom_binary_input_port_read, bytevector_output_port_write)
	  (custom_binary_output_port_write, transcoded_port_write)
	  (transcoded_port_read): Adapt to read/write prototype
	  change.
	  (scm_get_bytevector_n, scm_get_bytevector_n_x)
	  (scm_get_bytevector_all): Use scm_c_read_bytes.
	  (scm_put_bytevector): Use scm_c_write_bytes.
	* libguile/strports.c (string_port_read, string_port_write):
	* libguile/vports.c (soft_port_write, soft_port_read): Adapt to
	  read/write prototype change.
	* test-suite/standalone/test-scm-c-read.c (custom_port_read): Fix for
	  read API change.

2016-04-11  Andy Wingo  <wingo@pobox.com>

	make-chunked-output-port buffering fix
	* module/web/http.scm (make-chunked-output-port): Add #:buffering
	  argument, defaulting to 1200 (some random value under the MTU).  This
	  will force a flush every so often, and not every character as would
	  otherwise be the case after this port rewrite.

2016-04-08  Andy Wingo  <wingo@pobox.com>

	Fold 2.1.2 NEWS items into cumulative 2.2 NEWS
	* NEWS: Update.

	Update NEWS for changes to port buffering.
	* NEWS: Update.

2016-04-06  Andy Wingo  <wingo@pobox.com>

	Generic port facility provides buffering uniformly
	* libguile/ports.h (struct scm_t_port_buffer): New data type.
	  (struct scm_t_port): Refactor to use port buffers instead of
	  implementation-managed read and write pointers.  Add "read_buffering"
	  member.
	  (SCM_INITIAL_PUTBACK_BUF_SIZE, SCM_READ_BUFFER_EMPTY_P): Remove.
	  (scm_t_ptob_descriptor): Rename "fill_input" function to "read", and
	  take a port buffer, returning void.  Likewise "write" takes a port
	  buffer and returns void.  Remove "end_input"; instead if there is
	  buffered input and rw_random is true, then there must be a seek
	  function, so just seek back if needed.  Remove "flush"; instead all
	  calls to the "write" function implicitly include a "flush", since the
	  buffering happens in the generic port code now.  Remove "setvbuf", but
	  add "get_natural_buffer_sizes"; instead the generic port code can
	  buffer any port.
	  (scm_make_port_type): Adapt to read and write prototype changes.
	  (scm_set_port_flush, scm_set_port_end_input, scm_set_port_setvbuf):
	  Remove.
	  (scm_slow_get_byte_or_eof_unlocked)
	  (scm_slow_get_peek_or_eof_unlocked): Remove; the slow path is to call
	  scm_fill_input.
	  (scm_set_port_get_natural_buffer_sizes): New function.
	  (scm_c_make_port_buffer): New internal function.
	  (scm_port_non_buffer): Remove.  This was a function for
	  implementations that is no longer needed.  Instead open with BUF0 or
	  use (setvbuf port 'none).
	  (scm_fill_input, scm_fill_input_unlocked): Return the filled port
	  buffer.
	  (scm_get_byte_or_eof_unlocked, scm_peek_byte_or_eof_unlocked): Adapt
	  to changes in buffering and EOF management.
	* libguile/ports.c: Adapt to port interface changes.
	  (initialize_port_buffers): New function, using the port mode flags to
	  set up appropriate initial buffering for all ports.
	  (scm_c_make_port_with_encoding): Create port buffers here instead of
	  delegating to implementations.
	  (scm_close_port): Flush the port if needed instead of delegating to
	  the implementation.
	* libguile/filesys.c (set_element): Adapt to buffering changes.
	* libguile/fports.c (fport_get_natural_buffer_sizes): New function,
	  replacing scm_fport_buffer_add.
	  (fport_write, fport_read): Update to let the generic ports code do the
	  buffering.
	  (fport_flush, fport_end_input): Remove.
	  (fport_close): Don't flush in a dynwind; that's the core ports' job.
	  (scm_make_fptob): Adapt.
	* libguile/ioext.c (scm_redirect_port): Adapt to buffering changes.
	* libguile/poll.c (scm_primitive_poll): Adapt to buffering changes.
	* libguile/ports-internal.h (struct scm_port_internal): Remove
	  pending_eof flag; this is now set on the read buffer.
	* libguile/r6rs-ports.c (struct bytevector_input_port): New type.  The
	  new buffering arrangement means that there's now an intermediate
	  buffer between the bytevector and the user of the port; this could
	  lead to a perf degradation, but on the other hand there are some other
	  speedups enabled by the buffering refactor, so probably the memcpy
	  cost is dwarfed by the cost of the other parts of the ports
	  machinery.
	  (make_bytevector_input_port, bytevector_input_port_read):
	  (bytevector_input_port_seek, initialize_bytevector_input_ports): Adapt
	  to new buffering arrangement.
	  (struct custom_binary_port): Remove read buffer, as Guile handles that
	  now.
	  (custom_binary_input_port_setvbuf): Remove; now handled by Guile.
	  (make_custom_binary_input_port, custom_binary_input_port_read)
	  (initialize_custom_binary_input_ports): Adapt.
	  (scm_get_bytevector_some): Adapt to new EOF management.
	  (scm_t_bytevector_output_port_buffer): Hold on to the underlying port,
	  so we can flush it if it's open.
	  (make_bytevector_output_port, bytevector_output_port_write):
	  (bytevector_output_port_seek): Adapt.
	  (bytevector_output_port_procedure): Flush the port as appropriate, so
	  that we get all the bytes.
	  (make_custom_binary_output_port, custom_binary_output_port_write):
	  Adapt.
	  (make_transcoded_port): Don't muck with buffering.
	  (transcoded_port_write): Simply forward the write to the underlying
	  port.
	  (transcoded_port_read): Likewise.
	  (transcoded_port_close): No need to flush.
	  (initialize_transcoded_ports): Adapt.
	* libguile/read.c (scm_i_scan_for_encoding): Adapt to buffering
	  changes.
	* libguile/rw.c (scm_write_string_partial): Adapt to buffering changes.
	* libguile/strports.c: Adapt to the fact that we don't manage the
	  buffer.  Probably room for speed improvements here...
	* libguile/vports.c (soft_port_get_natural_buffer_sizes): New function.
	  Adapt the rest of the file for the new buffering regime.
	* test-suite/tests/r6rs-ports.test ("8.2.10 Output ports"): Custom
	  binary output ports need to be flushed before you can rely on the
	  write! procedure having been called.  Add necessary flush-port
	  invocations.
	  ("8.2.6  Input and output ports"): Transcoded ports now have an
	  internal buffer by default.  This test checks that the characters are
	  transcoded one at a time, so to do that, call setvbuf on the
	  transcoded port to remove the buffer.
	* test-suite/tests/web-client.test (run-with-http-transcript): Fix for
	  different flushing regime on soft ports.  (The vestigial flush
	  procedure is now called after each write, which is not what the test
	  was expecting.)
	* test-suite/standalone/test-scm-c-read.c: Update for changes to the C
	  interface for defining port types.
	* doc/ref/api-io.texi (Ports): Update to discuss buffering in a generic
	  way, and to remove a hand-wavey paragraph describing string ports as
	  "interesting and powerful".
	  (Reading, Writing): Remove placeholder comments.  Document
	  `scm_lfwrite'.
	  (Buffering): New section.
	  (File Ports): Link to buffering.
	  (I/O Extensions): Join subnodes into parent and describe new API,
	  including buffering API.
	* doc/ref/posix.texi (Ports and File Descriptors): Link to buffering.
	  Remove unread-char etc, as they are documented elsewhere.
	  (Pipes, Network Sockets and Communication): Link to buffering.

2016-04-05  Andy Wingo  <wingo@pobox.com>

	Port close functions return void
	* libguile/ports.h (scm_t_ptob_descriptor): The port close function now
	  returns void.
	  (scm_set_port_close): Adapt prototype.
	* libguile/ports.c (scm_close_port): Always return true if we managed to
	  call the close function.  There's no other sensible result; exceptions
	  are handled, well, exceptionally.

	* libguile/fports.c (fport_close)
	* libguile/r6rs-ports.c (custom_binary_port_close, transcoded_port_close):
	* libguile/vports.c (soft_port_close): Adapt.

	* doc/ref/api-io.texi (Port Implementation): Update.

2016-04-05  Andy Wingo  <wingo@pobox.com>

	When making soft port, parse handlers into struct
	* libguile/vports.c (struct soft_port): New data structure.
	  (scm_make_soft_port): Unpack vector into struct when making soft
	  port.
	  (soft_port_input_waiting, soft_port_close, soft_port_fill_input):
	  (soft_port_write, soft_port_flush): Adapt.  Remove an extraneous
	  errno=0 in soft_port_close.

2016-04-04  Andy Wingo  <wingo@pobox.com>

	Cosmetic changes to vports.c
	* libguile/vports.c (soft_port_flush): Rename from sf_flush, and similar
	  changes following.

	Fix POLLOUT assignment from port buffers
	* libguile/poll.c (scm_primitive_poll): A buffered port's buffer marks
	  it as writable only when writing a byte would not block, which is the
	  case only if there is more than one byte free in the buffer; writing
	  the last byte would block.

	Flush buffered reads / writes before seeking
	* libguile/ports.c (scm_seek): Flush before seeking on a buffered port.
	* libguile/fports.c (fport_seek):
	* libguile/strports.c (st_seek): Remove code to flush buffers.
	* test-suite/tests/ports.test: Update test expectations that the
	  putback buffer is flushed on a seek.  Previously there was a special
	  case for SEEK_CUR with an offset of 0 to avoid flushing buffers, but
	  that's an arbitrary choice that differs from all other combinations of
	  OFFSET and WHENCE.

	Whitespace fixes
	* libguile/ports.c: Fix whitespaces introduced when adding the port
	  lock.

	Refactor to rw_random / rw_active port flags
	* libguile/fports.c (fport_flush, fport_end_input): Move rw_active
	  handling to ports.c.
	* libguile/ioext.c (scm_redirect_port): Use scm_flush_unlocked instead
	  of calling the flush function directly.
	* libguile/ports.c (scm_c_make_port_with_encoding): Ports default to
	  "rw_random" mode when they have a seek function.
	  (scm_c_read_unlocked, scm_i_unget_bytes_unlocked)
	  (scm_slow_get_byte_or_eof_unlocked)
	  (scm_slow_peek_byte_or_eof_unlocked): Flush write buffer and set
	  rw_active always in the same way, and only if rw_random is true.
	  (scm_end_input_unlocked, scm_flush_unlocked): Clear rw_active here
	  unconditionally.
	  (scm_c_write_unlocked): Flush read buffer and set rw_active always in
	  the same way, but only if rw_random is true.
	  (scm_c_write, scm_lfwrite): Whitespace fixes.
	  (scm_lfwrite_substr): Don't flush read buffer; lower-level code will
	  do this.
	  (scm_truncate_file): Use scm_flush_unlocked instead of calling the
	  flush function directly.
	* libguile/r6rs-ports.c (transcoded_port_flush): Don't muck with
	  rw_active.
	* libguile/read.c (scm_i_scan_for_encoding): Flush write buffer if
	  needed in same way as ports.c.
	* libguile/strports.c (st_end_input): Don't muck with rw_active.
	  (scm_mkstrport): rw_random defaults to 1 now.

	Custom binary port internals refactor
	* libguile/r6rs-ports.c (struct custom_binary_port): Use a struct
	  instead of a vector as the state for a custom binary port.  Adapt all
	  callers.  Some whitespace fixes as well.

	Cosmetic changes to r6rs-ports.c
	* libguile/r6rs-ports.c: Expand out the acronyms "bip", "bop", "cbip",
	  "cbop", and "tp".  They always confused me, especially that the "b" in
	  cbip/cbop wasn't the same as the one in bip/bop.

	Remove port equal functions
	* doc/ref/api-io.texi (Port Implementation): Remove mention of port
	  equal functions.
	* NEWS: Update.
	* libguile/ports.c (scm_set_port_equalp): Remove.
	* libguile/ports.h (scm_t_ptob_descriptor): Remove equalp function.

	Remove port free functions; just close instead
	* libguile/ports.h (scm_t_port_type_flags): Replace
	  SCM_PORT_TYPE_HAS_FLUSH with SCM_PORT_TYPE_NEEDS_CLOSE_ON_GC.
	  (scm_t_ptob_descriptor): Remove free function.
	* libguile/ports.c (scm_set_port_needs_close_on_gc): New function.
	  (scm_set_port_flush): Don't set flags.
	  (scm_c_make_port_with_encoding, scm_close_port): Use the new flag to
	  determine when to add a finalizer and also when to include the port in
	  the weak set.
	  (scm_set_port_free): Remove.
	  (do_close, finalize_port): Close port instead of calling free
	  function.
	* libguile/r6rs-ports.c (initialize_transcoded_ports):
	* libguile/vports.c (scm_make_sfptob):
	* libguile/fports.c (scm_make_fptob): Mark these ports as needing close
	  on GC.
	* libguile/fports.c (fport_free): Remove.
	* NEWS: Update.
	* doc/ref/api-io.texi (Port Implementation): Update.

	Remove port mark functions
	* doc/ref/api-io.texi (Port Implementation): Remove documentation.
	* libguile/ports.c (scm_set_port_mark): Remove function.
	* libguile/ports.h (scm_t_ptob_descriptor): Remove mark function.
	* NEWS: Add entry.

	Move line-buffing machinery to ports.c
	* libguile/ports.c (scm_lfwrite_unlocked):
	* libguile/fports.c (fport_write): Move line-buffering from fport_write
	  to scm_lfwrite_unlocked.

	Use symbols instead of _IONBF values as args to setvbuf
	* libguile/ports.c (scm_setvbuf): Use the symbols `none', `line', and
	  `block' instead of the values `_IONBF', `_IOLBF', and `_IOFBF'.
	* NEWS: Update.
	* doc/ref/posix.texi (Ports and File Descriptors): Update setvbuf
	documentation.
	* module/ice-9/deprecated.scm (define-deprecated): New helper.
	(_IONBF, _IOLBF, _IOFBF): Define deprecated values.
	* benchmark-suite/benchmarks/read.bm ("read"):
	* benchmark-suite/benchmarks/uniform-vector-read.bm
	("uniform-vector-read!"):
	* libguile/r6rs-ports.c (cbip_fill_input):
	* module/system/base/types.scm (%ffi-memory-backend):
	* module/web/client.scm (open-socket-for-uri):
	* module/web/server/http.scm (http-read):
	* test-suite/tests/ports.test ("pipe, fdopen, and line buffering"):
	("setvbuf"):
	* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports"): Update to use
	non-deprecated interfaces.

	Move setvbuf impl to ports.[ch]
	* libguile/fports.h (scm_setbuf0): Remove extraneous declaration.
	* libguile/fports.c:
	* libguile/ports.c:
	* libguile/ports.c (scm_setvbuf): Move setvbuf to ports.[ch].
	  (scm_init_ports): Move _IONBF, _IOLBF, _IOFBF definitions here.

	display-{application,-backtrace} delegate to Scheme
	* libguile/backtrace.h:
	* libguile/backtrace.c (print_frame_var, kw_count, print_frames_var)
	(frame_to_stack_vector_var): New variables.
	(init_print_frame_var)
	(init_print_frames_var_and_frame_to_stack_vector_var): New functions.
	(scm_set_print_params_x): Remove function.
	(scm_display_application): Delegate to print-frame.
	(display_backtrace_body, scm_display_backtrace_with_highlights):
	Delegate to print-frames.

	Fix frame->stack-vector when no stack is active
	* module/system/repl/debug.scm (frame->stack-vector): Handle the case
	  where there is no active stack.

2016-03-14  Andy Wingo  <wingo@pobox.com>

	Fix lower-bound saturation in type inference
	* module/language/cps/types.scm (type-entry-saturating-union): Fix range
	  saturation in the negative direction.  Previously we were artificially
	  truncating negative range ends to zero.

2016-02-03  Andy Wingo  <wingo@pobox.com>

	Release v2.1.2
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to 2.1.2.

2016-02-02  Andy Wingo  <wingo@pobox.com>

	Fix frame-call-representation for change to <binding>.
	* module/system/vm/frame.scm (frame-call-representation): Fix for change
	  to <binding>.

2016-02-01  Andy Wingo  <wingo@pobox.com>

	Document new VM instructions
	* doc/ref/vm.texi (Stack Layout): Add a note about unboxed values.
	  (Instruction Set): Update for new instructions.

	Update NEWS.
	* NEWS: Update.

2016-02-01  Andy Wingo  <wingo@pobox.com>

	Update statprof documentation; deprecate `with-statprof'
	* module/statprof.scm: Remove most of the commentary, as it was
	  duplicated in the manual and was getting out of date.
	  (stats): Remove self-secs-per-call and cum-secs-per-call fields as
	  they can be computed from the other fields.
	  (statprof-call-data->stats): Adapt.
	  (statprof-stats-self-secs-per-call):
	  (statprof-stats-cum-secs-per-call): New functions.
	  (statprof-display/flat): Don't print the seconds-per-call fields, as
	  we are no longer stopping the clock around call counters.  Anyway
	  these times were quite misleading.
	  (with-statprof): Deprecate.  It took its keyword arguments at the
	  beginning; very complicated!  Better to use the `statprof' function.
	  (`statprof' was introduced after `with-statprof' and then
	  `with-statprof' was adapted to use it.)

	* doc/ref/statprof.texi (Statprof): Port this documentation away from
	  the automatically generated text and update it for the new interfaces
	  like #:display-style.

	* module/system/base/syntax.scm (record-case): Remove comment that
	  referenced with-statprof.  Add comment indicating that record-case
	  should be replaced.

	* doc/ref/scheme-using.texi (Profile Commands): Update to mention
	  keyword arguments and to link to the statprof documentation.

2016-02-01  Andy Wingo  <wingo@pobox.com>

	Better call-counting profiles in statprof
	* module/statprof.scm: Update commentary.
	  (count-call): Don't bother stopping and starting the timer.  The
	  overhead of call counting perturbs timing too much already, and
	  somewhat paradoxically stopping and starting the timer takes too much
	  time.
	  (skip-count-call): New function.
	  (stack-samples->procedure-data, stack-samples->callee-lists): If we
	  are counting calls, skip any part of the stack that is inside
	  count-call.

2016-01-31  Andy Wingo  <wingo@pobox.com>

	Frame <binding> objects capture frame, can ref value directly
	* module/system/repl/debug.scm (print-locals): Adapt to
	  frame-binding-ref change.

	* module/system/vm/frame.scm (<binding>): Add `frame' field.
	  (available-bindings): Capture the frame.
	  (binding-ref, binding-set!): New functions, accessing a local variable
	  value directly from a frame.
	  (frame-binding-ref, frame-binding-set!): Remove.  As these are very
	  low-level debugging interfaces introduced in 2.0, never documented,
	  and quite tied to the VM, we feel comfortable making this change.
	  (frame-call-representation): Adapt to available-bindings change.
	  (frame-environment, frame-object-binding): Adapt to binding-ref
	  interface change.

	* doc/ref/vm.texi (Stack Layout): Mention that slots can be re-used.
	  Update disassembly in example.

	* doc/ref/api-debug.texi (Frames): Remove documentation for
	  frame-local-ref, frame-local-set!, and frame-num-locals.  Replace with
	  documentation for frame-bindings, binding accessors, and binding-ref /
	  binding-set!.

2016-01-31  Andy Wingo  <wingo@pobox.com>

	Remove frame-local-ref, frame-local-set!
	* libguile/frames.h (scm_frame_num_locals, scm_frame_local_ref)
	  (scm_frame_local_set_x): Remove.  As long as we are changing the
	  interface in a backward-incompatible way, we might as well remove
	  these.
	* libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref)
	  (scm_frame_local_set_x, scm_init_frames_builtins, scm_init_frames):
	  Arrange to make frame-local-ref et al private to frames.scm.

	* module/system/vm/frame.scm: Load scm_init_frames_builtins extensions.
	  (frame-instruction-pointer-or-primitive-procedure-name): New public
	  function.
	  (frame-binding-ref, frame-binding-set!): Allow binding objects as
	  vars.

	* module/system/repl/debug.scm (print-locals): Pass binding directly to
	  frame-binding-ref.

	* module/statprof.scm (sample-stack-procs, count-call): Use new
	  frame-instruction-pointer-or-primitive-procedure-name function.

2016-01-29  Andy Wingo  <wingo@pobox.com>

	Dist the prebuilt .go files
	* prebuilt/i686-pc-linux-gnu/Makefile.am:
	* prebuilt/mips-unknown-linux-gnu/Makefile.am:
	* prebuilt/x86_64-unknown-linux-gnu/Makefile.am: Actually dist the .go
	  files.

	Fix uniform vector compilation to foreign byte orders.
	* module/system/vm/assembler.scm (define-byte-order-swapper): New
	  helper.
	  (byte-swap/2!, byte-swap/4!, byte-swap/8!): New functions.
	  (link-data): Swap bytes in uniform vectors on foreign byte orders.

2016-01-29  Andy Wingo  <wingo@pobox.com>

	Distribute prebuilt bootstraps for common hosts
	* am/bootstrap.am: New file, factored out of bootstrap/Makefile.am.
	* bootstrap/Makefile.am: Use bootstrap.am.

	* prebuilt/Makefile.am:
	* prebuilt/i686-pc-linux-gnu/Makefile.am:
	* prebuilt/mips-unknown-linux-gnu/Makefile.am:
	* prebuilt/x86_64-unknown-linux-gnu/Makefile.am: New files.

	* configure.ac: Output the prebuilt/ makefiles.
	* Makefile.am: Descend into prebuilt/ when making dist.

	* meta/uninstalled-env.in: Arrange to put prebuilt/ in the beginning of
	  the GUILE_LOAD_COMPILED_PATH.  Also fix a case where bootstrap/ wasn't
	  being correctly added to the load path.

2016-01-29  Andy Wingo  <wingo@pobox.com>

	Fix cross-compilation of immediates to targets with different word sizes
	* module/system/vm/assembler.scm (immediate-bits): Rename from
	  immediate?, and return the bits.  Take asm argument so that we measure
	  what's an immediate not on the host but for the target.  Adapt all
	  callers.
	  (write-immediate): Take bits instead of SCM object.  Adapt callers.
	  (write-placeholder): New helper, to write bits for #f.  Adapt callers
	  that wrote #f to use write-placeholder.

2016-01-17  Andy Wingo  <wingo@pobox.com>

	Fix type inference of integer division
	* module/language/cps/types.scm (define-binary-result!): Fix inference
	  of integer division.

2016-01-11  Andy Wingo  <wingo@pobox.com>

	statprof: Better tree-format profiles
	* module/statprof.scm (statprof-fetch-call-tree): Add #:precise? keyword
	  argument, defaulting to false.  Search for cycles after computing
	  printable source locations instead of doing so over addresses -- it
	  could be that two addresses map to the same source location, and from
	  the user's perspective they are then indistinguishable in the
	  printout.

	statprof: Add tree #:display-style.
	* module/statprof.scm (statprof-display/flat): Rename from
	  statprof-display.  Use real format; we have it.
	  (statprof-display-anomalies): Likewise use real format.
	  (procedure=?): Remove unused function.
	  (collect-cycles): New helper.
	  (statprof-fetch-call-tree): Fix to root the trees correctly -- it was
	  interpreting them in the wrong order.  Detect cycles so that it's not
	  so terrible.  Use precise locations for source locations.  Probably
	  need to add an option to go back to the per-function behavior.
	  (statprof-display/tree): New helper, uses statprof-fetch-call-tree to
	  display a profile in a nested tree.
	  (statprof-display): Add #:style argument, which can be `flat',
	  `anomalies', or `tree'.
	  (statprof): Add #:display-style argument, proxying to #:style,
	  defaulting to 'flat.

2016-01-07  Andy Wingo  <wingo@pobox.com>

	web: Be less strict when parsing entity tags.
	* module/web/http.scm (parse-entity-tag): Be less strict, accepting
	  unquoted strings as well.

	* test-suite/tests/web-http.test ("response headers"): Add a test for
	  etag parsing.

2016-01-04  Andy Wingo  <wingo@pobox.com>

	Remove unused function in simplify.scm
	* module/language/cps/simplify.scm (intset-add*): Remove unused
	  function.

	Inline some helpers in intset.scm.
	* module/language/cps/intset.scm (round-down): Inline.
	  (clone-branch-and-set): Inline, and inline the vector-move-left!.

	Include missing #:simplify? option in (language cps optimize).
	* module/language/cps/optimize.scm (cps-default-optimization-options):
	  Add missing #:simplify? option.  Otherwise the simplification pass was
	  running even at -O0.

2016-01-03  Andy Wingo  <wingo@pobox.com>

	Don't serialize build through psyntax-pp.scm
	* bootstrap/Makefile.am: Don't serialize the build through
	  psyntax-pp.scm.  On a multicore make, this will result in higher total
	  CPU time as multiple processes use an interpreted expander, but lower
	  total build time, as all processes will take approximately the same
	  time to load and run the compiler.

	Better CPS conversion for tests in tests
	* module/language/tree-il/compile-cps.scm (convert): Tests in tests have
	  their consequents and alternates also converted in test context.

	Better partial evaluation of tests in tests
	* module/language/tree-il/peval.scm (peval): In test context,
	  fold (let ((x EXP)) (if x x ALT)) to (if EXP #t ALT).  This reduces
	  the number of boolean literals that the compiler has to reify, by
	  causing EXP to evaluate in test context instead of value context.
	  Also, rotate `let' out of the test part of conditionals, for the same
	  reason.

	Better folding of branches on $values
	* module/language/cps/type-fold.scm (local-type-fold): Fold branches on
	  $values, if we can.

	Eta-reduce branches
	* module/language/cps/simplify.scm (compute-eta-reductions): Eta-reduce
	  branches as well, so that passing a constant to a branch will fold to
	  the true or false branch, provided that the test variable was just
	  used in the branch.

2015-12-30  Andy Wingo  <wingo@pobox.com>

	Fix module for reification of srfi-4 primitives
	* module/language/cps/reify-primitives.scm (primitive-module): Add cases
	  for SRFI-4 primitives.  These primitives are only treated as such for
	  the purposes of Tree-IL primitive expansion; perhaps the right fix is
	  elsewhere, but it's here for now.

2015-12-26  Andy Wingo  <wingo@pobox.com>

	Type inference copes better with unsorted graphs
	* module/language/cps/types.scm (&min/0, &min/s64, &max/s64, &max/size)
	  (&max/u64, &max/vector): New clamped variable range accessors.  Use
	  them in type inferrers.

	Fix bug in intmap-map
	* module/language/cps/utils.scm (intmap-map): Use transient intmap-add!
	  on an empty intmap to build the result instead of intmap-replace! on
	  the argument.  Avoids spooky action-at-a-distance mutation of the
	  argument if it happens to be a transient -- although the intmap-fold
	  will correctly traverse a snapshot of the argument and the result will
	  be correct, the argument value would be modified in place, causing
	  strange results to calling code that passes in a transient.

	Assembler O(n) in instruction encodings, not instruction count
	* module/system/vm/assembler.scm: Change define encoders for all of the
	  kinds of instructions and have the emit-foo procedures call the common
	  encoders.  No change to public interface.  This decreases the amount
	  of generated code in the assembler.

	Fix emit-receive* for many locals
	* module/system/vm/assembler.scm (emit-receive*): Fix to use FP-relative
	  move instead of SP-relative move.

2015-12-26  Andy Wingo  <wingo@pobox.com>

	Assembler works on byte offsets, not u32 offsets
	* module/system/vm/assembler.scm (u32-ref, u32-set!, s32-ref, s32-set!):
	  Remove these helpers.
	* module/system/vm/assembler.scm (<asm>): Track offsets in bytes, not
	  u32 units.
	  (emit, assembler, process-relocs, process-labels, link-text-object)
	  (link-frame-maps, link-symtab, write-arities, link-docstrs)
	  (link-procprops, link-debug): Adapt.

	* module/system/vm/linker.scm (process-reloc): Add addend before
	  dividing by 4 for rel32/4 symbols.

2015-12-16  Andy Wingo  <wingo@pobox.com>

	Fix build when threads are disabled
	* module/language/cps/intmap.scm: Remove srfi-18 import.  We just need
	  current-thread which is actually defined in (guile), and
	  importing (srfi srfi-18) raises an error if Guile is compiled without
	  threads support.

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

	Add another simplification pass to make rotate-loops work better
	* module/language/cps/optimize.scm (optimize-first-order-cps): Toss in
	  another simplification pass.

	Add support for comparing u64 values with SCM values
	* libguile/vm-engine.c (BR_U64_SCM_COMPARISON): New helper.
	  (br-if-u64-<=-scm, br-if-u64-<-scm, br-if-u64-=-scm)
	  (br-if-u64->-scm, br-if-u64->=-scm): New instructions, to compare an
	  untagged u64 with a tagged SCM.  Avoids many u64->scm operations.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/type-fold.scm:
	* module/system/vm/assembler.scm:
	* module/system/vm/disassembler.scm (code-annotation, compute-labels):
	* module/language/cps/primitives.scm (*branching-primcall-arities*): Add
	  support for new opcodes.
	* module/language/cps/specialize-numbers.scm
	  (specialize-u64-scm-comparison): New helper.
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Specialize u64 comparisons.
	* module/language/cps/types.scm (true-comparison-restrictions): New helper.
	  (define-comparison-inferrer): Use the new helper.  Add support for
	  u64-<-scm et al.

	Small VM cleanups
	* libguile/vm-engine.c (BR_U64_ARITHMETIC): No need for a second
	  argument.  Adapt callers.
	  (scm->u64/truncate): Remove extra SYNC_IP.

2015-12-02  Andy Wingo  <wingo@pobox.com>

	Refactor range checking in assembler instruction packers
	* module/system/vm/assembler.scm (check-urange, check-srange): New
	  helpers.
	  (pack-u8-u24, pack-u8-s24, pack-u1-u7-u24, pack-u8-u12-u12):
	  (pack-u8-u8-u16, pack-u8-u8-u8-u8): Use the new helpers.  Not only
	  makes the code nicer but also reduces register pressure.

	Add ursh/immediate and ulsh/immediate ops
	* libguile/vm-engine.c (ursh/immediate, ulsh/immediate): New ops.
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/slot-allocation.scm (compute-var-representations)
	  (compute-needs-slot):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/system/vm/assembler.scm:
	* module/language/cps/types.scm: Add support for new ops, and specialize
	  ursh and ulsh.

	Assembler has a single growable vector
	* module/system/vm/assembler.scm (<asm>): Instead of writing words into
	  a list of fixed-size buffers, use a growable vector.
	  (expand, emit): Instead of assuming that there is enough space for
	  only one word, check that there is space for the entire instruction at
	  the beginning.

	More efficient assembler instructions
	* module/system/vm/assembler.scm (pack-u8-u24, pack-u8-s24):
	  (pack-u1-u7-u24, pack-u8-u12-u12, pack-u8-u8-u16): Tweak to expose
	  more possibilities for untagging u64 values.

	Specialize u64 bit operations
	* module/language/cps/specialize-numbers.scm (specialize-u64-binop):
	  (specialize-operations): Specialize u64 bit operations.

	Add untagged bitwise operations
	* libguile/vm-engine.c (ulogand, ulogior, ulogsub, ulsh, ursh)
	  (scm->u64/truncate): New ops.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	* module/language/cps/types.scm:
	* module/language/cps/utils.scm (compute-constant-values):
	* module/system/vm/assembler.scm: Wire up support for the new ops.

	Disable warnings on bootstrap build
	* bootstrap/Makefile.am (GUILE_WARNINGS): Don't enable warnings for the
	  bootstrap build, as they probably slow things down.

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

	Add logsub op.
	* libguile/vm-engine.c (logsub): New op.
	* module/language/cps/effects-analysis.scm (logsub):
	* module/language/cps/types.scm (logsub):
	* module/system/vm/assembler.scm (system): Add support for the new op.

	* module/language/tree-il/compile-cps.scm (canonicalize):
	  Rewrite (logand x (lognot y)) to (logsub x y).

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

	Add current-thread VM op
	* libguile/vm-engine.c (current-thread): New op.
	* module/language/cps/effects-analysis.scm (&thread): New memory kind.

	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm (current-thread):
	* module/language/cps/types.scm (current-thread):
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	* module/system/vm/assembler.scm (emit-current-thread): Wire up the new
	  op.

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

	Unbox indexes of vectors, strings, and structs
	* libguile/vm-engine.c (string-length, string-ref)
	  (make-vector, vector-ref, vector-set!)
	  (allocate-struct, struct-ref, struct-set!): Take indexes and return
	  lengths as untagged u64 values.

	* libguile/vm.c (vm_error_not_a_string): New helper.

	* module/language/tree-il/compile-cps.scm (convert):
	* module/language/cps/constructors.scm (inline-vector):
	* module/language/cps/closure-conversion.scm (convert-one): Untag
	  arguments to {string,vector,struct}-{ref,set!}, make-vector, and
	  allocate-struct.  Tag return values from {string,vector}-length.

	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  vector-length and string-length define u64 slots.

	* module/language/cps/effects-analysis.scm: make-vector no longer causes
	  a &type-check effect.

	* module/language/cps/types.scm: Update to expect &u64 values for
	  lengths and indexes.

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

	Untag values and indexes for all bytevector instructions
	* libguile/vm-engine.c (bv-s8-ref, bv-s16-ref, bv-s32-ref, bv-s64-ref):
	  Unbox index and return unboxed S32 value.
	  (bv-s8-set!, bv-s16-set!, bv-s32-set!, bv-s64-set!): Unbox index and
	  take unboxed S32 value.
	  (bv-u8-ref, bv-u16-ref, bv-u32-ref, bv-u64-ref)
	  (bv-s8-set!, bv-s16-set!, bv-s32-set!, bv-s64-set!): Likewise, but
	  with unsigned values.
	  (bv-f32-ref, bv-f32-set!, bv-f64-ref, bv-f64-set!): Use memcpy to
	  access the value so we don't have to think about alignment.  GCC will
	  inline this to a single instruction on architectures that support
	  unaligned access.
	* libguile/vm.c (vm_error_out_of_range_uint64)
	  (vm_error_out_of_range_int64): New helpers.

	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  All bytevector ref operations produce untagged values.

	* module/language/cps/types.scm (define-bytevector-accessors): Update
	  for bytevector untagged indices and values.

	* module/language/cps/utils.scm (compute-constant-values): Fix s64
	  case.

	* module/language/tree-il/compile-cps.scm (convert): Box results of all
	  bytevector accesses, and unbox incoming indices and values.

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

	Add support for unboxed s64 values
	* libguile/frames.c (enum stack_item_representation):
	  (scm_to_stack_item_representation):
	  (scm_frame_local_ref, scm_frame_local_set_x): Support for S64
	  representations.

	* libguile/frames.h (union scm_vm_stack_element): Add signed 64-bit
	  integer field.

	* libguile/vm-engine.c (scm->s64, s64->scm, load-s64): New
	  instructions.

	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/slot-allocation.scm (compute-var-representations)
	  (compute-needs-slot, allocate-slots):
	* module/language/cps/utils.scm (compute-constant-values):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Add support for new primcalls.

	* module/language/cps/types.scm (&s64): New type.
	  (&s64-min, &s64-max, &u64-max): New convenience definitions.
	  (&range-min, &range-max): Use &s64-min and &u64-max names.
	  (scm->s64, load-s64, s64->scm): Add support for new primcalls.

	* module/system/vm/assembler.scm (emit-scm->s64, emit-s64->scm)
	  (emit-load-s64): New exports.
	* module/system/vm/assembler.scm (write-arities): Support for s64
	  slots.

	* module/system/vm/debug.scm (arity-definitions): Support for s64
	  slots.

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

	New instructions load-f64, load-u64
	* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Add word
	  types for immediate f64 and u64 values.
	  (TYPE_WIDTH): Bump up by a bit, now that we have 32 word types.
	  (NOP, parse_instruction): Use 64-bit meta type.

	* libguile/vm-engine.c (load-f64, load-u64): New instructions.

	* module/language/bytecode.scm (compute-instruction-arity): Add parser
	  for new instruction word types.

	* module/language/cps/compile-bytecode.scm (compile-function): Add
	  special-cased assemblers for new instructions, and also for scm->u64
	  and u64->scm which I missed before.

	* module/language/cps/effects-analysis.scm (load-f64, load-u64): New
	  instructions.

	* module/language/cps/slot-allocation.scm (compute-needs-slot): load-f64
	  and load-u64 don't need slots.
	  (compute-var-representations): Update for new instructions.

	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Specialize scm->f64 and scm->u64 to make-f64 and make-u64.

	* module/language/cps/types.scm (load-f64, load-u64): Wire up to type
	  inference, though currently type inference only runs before
	  specialization.

	* module/language/cps/utils.scm (compute-defining-expressions): For some
	  reason I don't understand, it's possible to see two definitions that
	  are equal but not equal? here.  Allow for now.
	  (compute-constant-values): Punch through type conversions to get
	  constant u64/f64 values.

	* module/system/vm/assembler.scm (assembler): Support for new word
	  types.  Export the new assemblers.

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

	Add tagged and untagged arithmetic ops with immediate operands
	* libguile/vm-engine.c (add/immediate, sub/immediate)
	  (uadd/immediate, usub/immediate, umul/immediate): New instructions.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/slot-allocation.scm (compute-needs-slot):
	* module/language/cps/types.scm:
	* module/system/vm/assembler.scm (system):
	* module/language/cps/effects-analysis.scm: Support
	  for new instructions.

	* module/language/cps/optimize.scm (optimize-first-order-cps): Move
	  primcall specialization to the last step -- the only benefit of doing
	  it earlier was easier reasoning about side effects, and we're already
	  doing that in a more general way with (language cps types).
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Specialize add and sub to add/immediate and sub/immediate, and
	  specialize u64 addition as well.  U64 specialization doesn't work now
	  though because computing constant values doesn't work for U64s; oh
	  well.

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

	Remove add1 and sub1
	* libguile/vm-engine.c: Remove add1 and sub1 instructions.  Will replace
	  with add/immediate and sub/immediate.
	* module/language/tree-il/peval.scm (peval): If we reify a new
	  <primcall>, expand it.  Removes 1- and similar primcalls.
	* module/language/tree-il/primitives.scm: Don't specialize (+ x 1) to 1+.
	  (expand-primcall): New export, does a single primcall expansion.
	  (expand-primitives): Use the new helper.
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/primitives.scm:
	* module/language/cps/types.scm:
	* module/system/vm/assembler.scm: Remove support for add1 and sub1 CPS
	  primitives.
	* test-suite/tests/peval.test ("partial evaluation"): Adapt tests that
	  expect 1+/1- to expect +/-.

	Specialize u64 arithmetic
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  (specialize-u64-binop): Specialize u64 addition, subtraction, and
	  multiplication.

	Better range inference for indexes of vector-ref, string-ref et al
	* module/language/cps/types.scm (vector-ref, vector-set!)
	  (string-ref, string-set!, struct-ref, struct-set!)
	  (define-bytevector-accessors, define-bytevector-uaccessors): Clamp
	  range of object and index to be within the range of indices, with a
	  maximum of *max-size-t*.

	Slower range saturation in type inference
	* module/language/cps/types.scm (*max-size-t*): New definition.
	  (type-entry-saturating-union): Saturate more slowly, first stopping at
	  [0,*max-size-t*] then at [&range-min, &range-max] before saturating to
	  [-inf.0, +inf.0].  This allows most offset phi variables to have their
	  range inferred within the u64 range.

	Add unsigned 64-bit arithmetic operators: uadd, usub, umul
	* libguile/vm-engine.c (uadd, usub, umul): New ops.
	* module/language/cps/effects-analysis.scm (uadd, usub, umul): Add
	  effects analysis.
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  The new ops define 'u64 values.
	* module/language/cps/types.scm (uadd, usub, umul): Add type checkers
	  and inferrers.
	* module/system/vm/assembler.scm (emit-uadd, emit-usub, emit-umul): New
	  assemblers.

	Unbox u64 phi values
	* module/language/cps/specialize-numbers.scm
	  (compute-specializable-vars): Refactor to work on any kind of
	  unboxable value, not just f64 values.
	  (compute-specializable-f64-vars, compute-specializable-u64-vars): New
	  helpers.
	  (apply-specialization): Support for u64 values.

	Beginning of u64 phi unboxing
	* module/language/cps/specialize-numbers.scm
	  (compute-specializable-u64-vars): New stub.
	* module/language/cps/specialize-numbers.scm
	  (compute-specializable-phis): Rename from
	  compute-specializable-f64-phis, and return an intmap instead of an
	  intset.  The values distinguish f64 from u64 vars.
	* module/language/cps/specialize-numbers.scm (apply-specialization):
	  Start of u64 phi unboxing.
	* module/language/cps/specialize-numbers.scm (specialize-phis):
	  (specialize-numbers): Adapt.

	Specialize u64 comparisons
	* module/language/cps/specialize-numbers.scm
	  (specialize-u64-comparison): New function.
	* module/language/cps/specialize-numbers.scm (specialize-operations):
	  Rename from specialize-f64-operations, as it will specialize both
	  kinds.  Add a case to specialize u64 comparisons.
	* module/language/cps/specialize-numbers.scm (specialize-numbers): Adapt
	  to specialize-operations name change.

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

	Add instructions to branch on u64 comparisons
	* libguile/vm-engine.c (BR_U64_ARITHMETIC): New helper.
	  (br-if-u64-=, br-if-u64-<, br-if-u64->=): New instructions.

	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/primitives.scm (*branching-primcall-arities*):
	* module/language/cps/type-fold.scm:
	* module/language/cps/types.scm (u64-=, infer-u64-comparison-ranges):
	  (define-u64-comparison-inferrer, u64-<, u64-<=, u64->=, u64->):
	* module/system/vm/assembler.scm:
	* module/system/vm/disassembler.scm (code-annotation):
	  (compute-labels): Compiler and toolchain support for the new
	  instructions.

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

	bv-f{32,64}-{ref,set!} take unboxed u64 index
	* module/language/tree-il/compile-cps.scm (convert): bv-f32-ref,
	  bv-f32-set!, bv-f64-ref, and bv-f64-set! take the index as an untagged
	  u64 value.
	* module/language/cps/types.scm (define-bytevector-uaccessors): New
	  helper, used while migrating bytevectors to take unboxed indexes.
	  Adapt f32/f64 accessors to use this definition helper.
	* libguile/vm-engine.c (BV_FLOAT_REF, BV_FLOAT_SET): The index is
	  unboxed.

	Add bv-length instruction
	* libguile/vm-engine.c (bv-length): New instruction.
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm (bv-length):
	* module/language/cps/primitives.scm (*instruction-aliases*):
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	* module/language/cps/types.scm (bv-length):
	* module/language/tree-il/compile-cps.scm (convert): Add support for
	  bv-length.
	* module/system/vm/assembler.scm: Export emit-bv-length.

	Range inference over the full U64+S64 range
	* module/language/cps/types.scm (*min-s32*, *max-s32*): Remove unused
	  definitions.
	  (&range-min, &range-max): New definitions, replacing min-fixnum and
	  max-fixnum as the bounds of precise range analysis.
	  (type-entry-min, type-entry-max): Store inf values directly as
	  -inf.0/+inf.0.
	  (type-entry-clamped-min, type-entry-clamped-max): Remove, as they are
	  no longer needed.
	  (clamp-min, clamp-max, make-type-entry): Clamp minimum and maximum
	  half-ranges in different ways.
	  (type-entry-union, type-entry-saturating-union)
	  (type-entry-intersection): Adapt to type-entry-min / type-entry-max
	  change.
	  (bv-u32-ref, bv-u32-set!):
	  (bv-s32-ref, bv-s32-set!):
	  (bv-u64-ref, bv-u64-set!):
	  (bv-s64-ref, bv-s64-set!): Precise range inference.  This will allow
	  robust unboxing.
	  (ash): Infer 64-bit shifts.

	Remove frame->module
	* module/system/repl/debug.scm (frame->module): Remove.  Has been broken
	  for a while, had no callers, and was calling frame-procedure.  We can
	  revive again in a better way, like ice-9 local-eval.

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

	Add low-level support for unboxed 64-bit unsigned ints
	* libguile/frames.c (enum stack_item_representation)
	* libguile/frames.c (scm_to_stack_item_representation):
	  (scm_frame_local_ref, scm_frame_local_set_x): Support 'u64 slots.
	* libguile/frames.h (union scm_vm_stack_element): Add as_u64 member.

	* libguile/vm-engine.c (SP_REF_U64, SP_SET_U64): New helpers.
	  (scm->u64, u64->scm): New instructions.

	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	  Scalar replacement for u64->scm and scm->u64.

	* module/language/cps/effects-analysis.scm (scm->u64, u64->scm): Add
	  cases.

	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  (allocate-slots): Represent the result of scm->u64 as a "u64" slot.

	* module/language/cps/types.scm (&u64): New type.
	  (scm->u64, u64->scm): Add support for these ops.

	* module/system/vm/assembler.scm (write-arities):
	* module/system/vm/debug.scm (arity-definitions): Support u64
	  representations.

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

	Remove frame-procedure
	* libguile/frames.h:
	* libguile/frames.c (scm_frame_procedure): Remove.
	* test-suite/tests/eval.test ("stacks"): Adapt test.
	* NEWS: Add news item.
	* doc/ref/api-debug.texi (Frames): Document frame-procedure-name instead
	  of frame-procedure.

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

	VM traps don't match on value of slot 0
	* module/system/vm/traps.scm (frame-matcher): Always match on a
	  procedure's code, instead of the value in slot 0.  Prevents confusion
	  with closure-optimized procedures, re-use of slot 0, and untagged
	  values in slot 0.
	  (trap-at-procedure-call, trap-in-procedure)
	  (trap-instructions-in-procedure, trap-at-procedure-ip-in-range)
	  (trap-at-source-location, trap-in-dynamic-extent)
	  (trap-calls-in-dynamic-extent, trap-instructions-in-dynamic-extent):
	  Update to adapt to frame-matcher change and remove #:closure?
	  argument, effectively changing the default behavior to #:closure? #t.

	* doc/ref/api-debug.texi (Low-Level Traps): Update documentation.

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

	Remove `procedure' repl command
	* doc/ref/scheme-using.texi (Debug Commands):
	* module/system/repl/command.scm (procedure): Remove REPL command.
	  Since there is a closure binding and we have improved the ,registers
	  output, this is no longer necessary and by removing it we remove
	  another bogus use of frame-procedure.

	,registers doesn't use frame-procedure
	* module/system/repl/debug.scm (print-registers): Avoid frame-procedure,
	  and be more useful and print an offset in units of 4 bytes.

	Better frame-call-representation printing of GC clobbers
	* module/system/vm/frame.scm (frame-call-representation): Assume that
	  unspecified values are GC clobbers rather than actual arguments, and
	  print as _.

	More robust low-level frame printer
	* libguile/frames.c (scm_i_frame_print): Print using
	  frame-procedure-name, not frame-procedure.

	frame-call-representation avoids frame-procedure.
	* module/system/vm/frame.scm (frame-call-representation): Never use
	  frame-procedure, as we don't know that slot 0 is a SCM value and even
	  if it were, we don't know that it corresponds to the procedure being
	  applied, except in the case of primcalls.  Print _ as the procedure
	  name if we don't know it, instead of #f.

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

	Add frame-procedure-name
	* libguile/frames.c (frame_procedure_name_var): New static definition.
	  (init_frame_procedure_name_var): New helper.
	  (scm_frame_procedure_name): New function that returns the name of the
	  frame's procedure, as frame-procedure is to be deprecated.

	* libguile/frames.h (scm_frame_procedure_name): Export.

	* module/ice-9/boot-9.scm (exception-printers): Use frame-procedure-name
	  instead of procedure-name on frame-procedure.

	* module/system/vm/frame.scm (frame-procedure-name): New private
	  function, implementing scm_frame_procedure_name.
	  (frame-call-representation): Use frame-procedure-name to get the
	  procedure name to print.

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

	Remove primitive?, add primitive-code?
	We need to be able to identify frames that are primitive applications
	without assuming that slot 0 in a frame is an SCM value and without
	assuming that value is the procedure being applied.

	* libguile/gsubr.c (scm_i_primitive_code_p): New helper.
	  (scm_i_primitive_arity): Use the new helper.
	* libguile/gsubr.h: Declare the new helper.

	* libguile/programs.h:
	* libguile/programs.c (scm_program_code_p): New function, replacing
	  scm_primitive_p.
	  (scm_primitive_call_ip): Fix FUNC_NAME definition.

	* module/statprof.scm (sample-stack-procs, count-call): Identify
	  primitive frames from the IP, not the frame-procedure.  Avoids the
	  assumption that slot 0 in a frame is a SCM value.
	  (statprof-proc-call-data): Adapt to primitive-code? change.

	* module/system/vm/frame.scm (frame-call-representation): Identify
	  primitive frames from the IP, not the closure.  Still more work to do
	  here to avoid assuming slot 0 is a procedure.

	* module/system/vm/program.scm: Export primitive-code? instead of
	  primitive?.
	  (program-arguments-alist, program-arguments-alists): Identify
	  primitives from the code instead of the flags on the program.  Not
	  sure this is a great change, but it does avoid having to define a
	  primitive? predicate in Scheme.

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

	Apply of non-programs has IP that is not from prev frame
	* libguile/vm-engine.c (vm_engine)
	* libguile/vm.c (vm_apply_non_program_code): Arrange so that the code to
	  apply a non-program has its own IP, so that frame-instruction-pointer
	  for a non-program application doesn't point into the previously active
	  frame.

	All arities serialize a "closure" binding
	* module/language/cps/compile-bytecode.scm (compile-function): Always
	  define a 'closure binding in slot 0.
	* module/system/vm/frame.scm (available-bindings): No need to futz
	  around not having a closure binding.
	* module/system/vm/debug.scm (arity-arguments-alist): Expect a closure
	  binding.
	* test-suite/tests/rtl.test: Emit definitions for the closure.

	Identify boot continuations by code, not closure
	* libguile/vm.h:
	* libguile/vm.c (scm_i_vm_is_boot_continuation_code): New internal
	  procedure.
	* libguile/stacks.c (scm_make_stack):
	* libguile/frames.c (scm_c_frame_previous): Use new helper to identify
	  boot frames.

2015-11-30  Paulo Andrade  <pcpa@gnu.org>

	Correct wrong check for argument of value 2 in check/fib.tst.

2015-11-30  Paulo Andrade  <pcpa@gnu.org>

	Implement a correct generation of Fibonacci numbers.
		* doc/body.texi: Change documentation to no longer say
		it is a variant of the Fibonacci sequence, and document
		a proper implementation.
		Thanks to Jon Arintok for pointing out that the Fibonacci
		sequence generation was incorrect. It was documented, but
		still confusing.

		* check/fib.tst, check/fib.ok, check/bp.tst, check/bp.ok,
		doc/ifib.c, doc/rbif.c: Implement a proper Fibonacci
		sequence implementation.

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

	Remove br-if-equal opcode
	* libguile/vm-engine.c (br-if-equal): Remove opcode.

	Don't compile equal? to br-if-equal
	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/primitives.scm (*branching-primcall-arities*):
	* module/language/cps/type-fold.scm (equal?):
	* module/language/cps/types.scm (equal?):
	* module/language/tree-il/compile-cps.scm (convert): `equal?' is no
	  longer a branching primcall, because it isn't inline.  The
	  implementation could lead to bad backtraces also, as it didn't save
	  the IP, and actually could lead to segfaults as it didn't reload the
	  SP after the return.  There is an eqv? fast-path, though.
	* module/system/vm/assembler.scm (br-if-equal): Remove interface.
	* module/system/vm/disassembler.scm (code-annotation):
	  (compute-labels): No need to handle br-if-equal.

2015-11-11  Andy Wingo  <wingo@pobox.com>

	Fix miscompilation of closures allocated as vectors
	* module/language/cps/closure-conversion.scm (convert-one): Fix
	  miscompilation of vector closure initialization.

	load-path will skip over stale .go files and keep going
	* libguile/load.c (compiled_is_fresh): Write warnings to warning port.
	  Move up in the file.
	  (search_path): Add ability to skip over matching files in the path
	  that are stale, relative to some other corresponding file.
	  (scm_search_path, scm_sys_search_load_path): Adapt to search_path
	  changes.
	  (do_try_auto_compile): Write status to warning port.
	  (scm_primitive_load_path): Use new search_path ability to skip over
	  stale files.  Allows updates to source files to use freshly-compiled
	  bootstrap files, when building Guile itself.  Also allows
	  simplification of fallback logic.
	  (scm_init_eval_in_scheme): Skip stale eval.go files in the path.

2015-11-11  Andy Wingo  <wingo@pobox.com>

	Eval speedup for lexical-ref
	* module/ice-9/eval.scm (primitive-eval): Specialize lexical-ref for
	  depths 0, 1, and 2.  Speeds up this test by around 13%:

	    (primitive-eval '(let lp ((n 0)) (when (< n #e1e7) (lp (1+ n)))))

2015-11-11  Andy Wingo  <wingo@pobox.com>

	Bump bytecode version
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION):
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump
	  bytecode version to prevent 2.1.1 users from thinking that they don't
	  need to make clean after pulling.

	Remove debug printout in specialize-numbers
	* module/language/cps/specialize-numbers.scm (apply-f64-specialization):
	  Remove printout.  I didn't see any when compiling Guile, which means
	  that probably this optimization doesn't hit for any code in Guile
	  itself, sadly :P

	Better f64 unboxing for loop vars that might flow to $ktail
	* module/language/cps/specialize-numbers.scm (compute-specializable-f64-vars):
	  Tweak to allow f64 values to flow directly to return sites.

	The compiler can unbox float64 loop variables
	* module/language/cps/specialize-numbers.scm: Specialize phi variables
	  as well.

	Fix slot representation computation for fadd, fmul, etc
	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  fadd, fmul and so on also define f64 values.

2015-11-11  Andy Wingo  <wingo@pobox.com>

	Add new pass to specialize "add" into "fadd" where possible
	* module/language/cps/specialize-numbers.scm: New pass, to turn "add"
	  into "fadd", and similarly for sub, mul, and div.

	* module/language/cps/optimize.scm:
	* module/Makefile.am:
	* bootstrap/Makefile.am: Wire up the new pass.

2015-11-11  Andy Wingo  <wingo@pobox.com>

	Add fadd, fsub, fmul, fdiv instructions
	* libguile/vm-engine.c (fadd, fsub, fmul, fdiv): New instructions.

	* module/language/cps/effects-analysis.scm:
	* module/language/cps/types.scm: Wire up support for new instructions.

	* module/system/vm/assembler.scm: Export emit-fadd and friends.

2015-11-11  Andy Wingo  <wingo@pobox.com>

	Scalar replacement for f64->scm
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	  Scalar replacement for float boxes.

2015-11-11  Andy Wingo  <wingo@pobox.com>

	bv-{f32,f64}-{ref,set!} operate on raw f64 values
	* module/language/tree-il/compile-cps.scm (convert): Box results of
	  bv-f32-ref and bv-f64-ref.  Unbox the argument to bv-f32-set! and
	  bv-f64-set!.

	* libguile/vm-engine.c (bv-f32-ref, bv-f64-ref): Results are raw.
	  (bv-f32-set!, bv-f64-set!): Take unboxed arguments.

	* module/system/vm/assembler.scm (emit-scm->f64, emit-f64->scm):
	  Export.

	* module/language/cps/compile-bytecode.scm (compile-function):
	* module/language/cps/effects-analysis.scm: Add support for scm->f64 and
	  f64->scm.

	* module/language/cps/slot-allocation.scm (compute-var-representations):
	  Add cases for primops returning raw values.

	* module/language/cps/types.scm (bv-f32-ref, bv-f32-set!)
	  (bv-f64-ref, bv-f64-set!): Deal in &f64 values instead of reals.

2015-11-11  Andy Wingo  <wingo@pobox.com>

	Type inference distinguishes between untagged and tagged flonums
	* module/language/cps/types.scm (&f64): New type, for untagged f64
	  values.  Having a distinct type prevents type folding from replacing
	  an untagged 3.0 with a tagged 3.0.
	  (scm->f64, f64->scm): Support these new primcalls.

2015-11-04  Paulo Andrade  <pcpa@gnu.org>

	Correct missing jit_unget_reg calls

2015-10-28  Andy Wingo  <wingo@pobox.com>

	Add VM ops to pack and unpack raw f64 values.
	* libguile/vm-engine.c (scm->f64, f64->scm): New ops.

	Stack slots can hold a double
	* libguile/frames.h (union scm_vm_stack_element): Add double member.
	* libguile/frames.c (scm_frame_local_ref, scm_frame_local_set_x): Wire
	  up f64 support.

2015-10-28  Andy Wingo  <wingo@pobox.com>

	Reflection support for unboxed f64 slots
	* module/system/vm/assembler.scm (emit-definition): Add representation
	  field.
	  (write-arities): Emit representations into the arities section.

	* module/system/vm/debug.scm (arity-definitions): Read representations.

	* module/system/vm/frame.scm (<binding>): Add representation field and
	  binding-representation getter.
	  (available-bindings): Pass representation to make-binding.
	  (frame-binding-set!, frame-binding-ref, frame-call-representation):
	  Pass representation to frame-local-ref / frame-local-set!.

	* test-suite/tests/rtl.test: Update definition instructions.

	* module/language/cps/slot-allocation.scm ($allocation): Add
	  representations field.
	  (lookup-representation): New public function.
	  (allocate-slots): Pass representations to make-$allocation.

	* module/language/cps/compile-bytecode.scm (compile-function): Adapt to
	  emit-definition change.

	* libguile/frames.h:
	* libguile/frames.c (scm_frame_local_ref, scm_frame_local_set_x): Take
	  representation argument.
	  (scm_to_stack_item_representation): New internal helper.

2015-10-28  Andy Wingo  <wingo@pobox.com>

	VM support for raw slots
	* libguile/loader.c (scm_find_slot_map_unlocked): Rename from
	  scm_find_dead_slot_map_unlocked.

	* libguile/vm.c (struct slot_map_cache_entry, struct slot_map_cache)
	  (find_slot_map): Rename, changing "dead_slot" to "slot".
	  (enum slot_desc): New type.
	  (scm_i_vm_mark_stack): Interpret slot maps as having two bits per
	  slot, allowing us to indicate that a slot is live but not a pointer.

	* module/language/cps/compile-bytecode.scm (compile-function): Adapt to
	  emit-slot-map name change.

	* module/system/vm/assembler.scm (<asm>): Rename dead-slot-maps field to
	  slot-maps.
	  (emit-slot-map): Rename from emit-dead-slot-map.
	  (link-frame-maps): 2 bits per slot.

	* module/language/cps/slot-allocation.scm (lookup-slot-map): Rename from
	  lookup-dead-slot-map.
	  (compute-var-representations): New function.
	  (allocate-slots): Adapt to encode two-bit slot representations.

2015-10-28  Andy Wingo  <wingo@pobox.com>

	Treat tail $values as generating lazy allocations
	* module/language/cps/slot-allocation.scm (compute-lazy-vars): Returning
	  values in tail position also generates lazy vars.

	Remove return opcode
	* libguile/vm-engine.c (return): Remove opcode.

	Remove use of return in disassembler.scm
	* module/system/vm/disassembler.scm (instruction-has-fallthrough?):
	  Remove return from static opcode set.

	rtl.test uses return-values
	* test-suite/tests/rtl.test: Fix up to use return-values.

2015-10-28  Andy Wingo  <wingo@pobox.com>

	Always emit return-values
	* module/language/cps/compile-bytecode.scm (compile-function): Remove
	  special cases for nullary and unary returns; instead always use
	  return-values and rely on hinting to try to place values in the right
	  slot already.

	* module/system/vm/assembler.scm (emit-init-constants): Use
	  return-values.

	* module/system/vm/disassembler.scm (code-annotation): Add annotation
	  for return-values.

2015-10-28  Andy Wingo  <wingo@pobox.com>

	Replace return primcalls with $values
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/type-fold.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Never generate a return
	  primcall.  Instead use $values.

	Don't emit redundant reset-frame before return
	* module/language/cps/compile-bytecode.scm (compile-function): Don't
	  emit reset-frame before return-values.

2015-10-28  Andy Wingo  <wingo@pobox.com>

	return-values opcode resets the frame
	* libguile/vm-engine.c (return-values): Change to also reset the frame,
	  if nlocals is nonzero.

	* doc/ref/vm.texi (Procedure Call and Return Instructions): Updated
	  docs.

	* module/language/cps/compile-bytecode.scm (compile-function): Adapt to
	  call emit-return-values with the right number of arguments.

2015-10-28  Andy Wingo  <wingo@pobox.com>

	Fix slot-allocation to make 'return' not need to alloc-frame
	* module/language/cps/slot-allocation.scm (compute-frame-sizes): Ensure
	  that frames with `return' have space to shuffle the arg into return
	  position.

	Run CSE to clean up after closure conversion
	* module/language/cps/optimize.scm: Enable CSE over first-order CPS.

	CSE can run on first-order CPS
	* module/language/cps/cse.scm (compute-truthy-expressions):
	  (compute-equivalent-subexpressions):
	  (eliminate-common-subexpressions): Refactor to be able to work on
	  first-order CPS.

	Revert "Bootstrap build doesn't have to expand CPS optimizations"
	This reverts commit ce36fb16fff30ba1915dbd9d52d2325acedd54c7.

	Bootstrap build doesn't have to expand CPS optimizations
	* module/language/cps/optimize.scm (define-optimizer)
	  (optimize-higher-order-cps, optimize-first-order-cps): Obfuscate a bit
	  so that the bootstrap build won't have to expand optimization passes.
	  Might marginally speed up the bootstrap process.

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

	Release v2.1.1
	* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to v2.1.1.

	Fix distcheck issues
	* bootstrap/Makefile.am:
	* libguile/Makefile.am: Fix distcheck issues.

	Fix uninstalled-env bug that preferred bootstrap/ to module/
	* meta/uninstalled-env.in (top_builddir): Whoops!  We were
	  preferring bootstrap/ unoptimized .go files to module/ optimized .go
	  files.  Fix!

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

	Revert "Update Gnulib to v0.1-603-g1d16a7b"
	This reverts commit 2d4da30fdefbcdb065d4b1f48f2a77d06f69e3c3.

	This Gnulib update was causing failures related to timezones in
	stime.c.  I tried to fix it by adopting the time_rz module from gnulib
	but that then caused other failures.  We can try again later.

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

	Bootstrap makefile tweaks
	* bootstrap/Makefile.am (.scm.go): Fix -L options to point to /module.
	  (SOURCES): Move up psyntax-pp.scm.  Sadly a bug while I was developing
	  the bootstrap makefile meant that there was a stale psyntax-pp.go from
	  module/ that the build was picking up, leading to invalid
	  bootstrap timing measurements.

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

	Use a bootstrapped -O0 compiler to compile the -O2 Guile
	This reduces total build time to around 30 minutes or so.

	* Makefile.am (SUBDIRS): Visit bootstrap/ before module/.

	* bootstrap/Makefile.am: New file.

	* configure.ac: Generate bootstrap/Makefile.

	* meta/uninstalled-env.in (top_builddir): Add bootstrap/ to the
	  GUILE_LOAD_COMPILED_PATH.

	* module/Makefile.am: Simplify to just sort files in alphabetical order;
	  since bootstrap/ was already compiled, we don't need to try to
	  optimize compilation order.  Although the compiler will get faster as
	  more of the compiler itself is optimized, this isn't a significant
	  enough effect to worry about.

2015-10-22  Andy Wingo  <wingo@pobox.com>

	Wire up `guild compile -O0 foo.scm'
	* module/scripts/compile.scm (%options): Resurrect -O option and make it
	  follow GCC, more or less.  The default is equivalent to -O2.

	* module/language/cps/compile-bytecode.scm (lower-cps):
	* module/language/cps/optimize.scm (optimize-higher-order-cps): Move
	  split-rec to run unconditionally for now, as closure conversion fails
	  without it.
	  (define-optimizer): Only verify the result if we are debugging, to
	  save time.
	  (cps-default-optimization-options): New exported procedure.

	* module/language/tree-il/optimize.scm
	  (tree-il-default-optimization-options): New exported procedure.

2015-10-22  Andy Wingo  <wingo@pobox.com>

	Update Gnulib to v0.1-603-g1d16a7b

	Minor NEWS update.

	Small subr-call refactor
	* libguile/gsubr.c (scm_apply_subr): New internal helper.
	* libguile/vm-engine.c (subr-call): Call out to scm_apply_subr.
	* doc/ref/vm.texi (subr-call): Don't specify how the foreign pointer is
	  obtained.

	subr-call implementation simplification
	* libguile/vm-engine.c (subr-call): Reference args from SP, not FP.

	Update VM documentation for new stack layout
	* doc/ref/vm.texi: Update for new stack layout.
	* module/system/vm/disassembler.scm (code-annotation): Print the frame
	  sizes after alloc-frame, reset-frame, etc to make reading the
	  disassembly easier.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	Add stack size computation to disassembler
	* module/system/vm/disassembler.scm (define-stack-effect-parser)
	  (stack-effect-parsers, instruction-stack-size-after): New stack size
	  facility.
	  (define-clobber-parser, clobber-parsers, instruction-slot-clobbers):
	  Take incoming and outgoing stack sizes as arguments to interpret
	  SP-relative clobbers.

	* module/system/vm/frame.scm (compute-frame-sizes): New helper that
	  computes frame sizes for each position in a function.
	  (compute-killv): Adapt to compute the clobbered set given the computed
	  frame sizes.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	Minor assembler cleanups
	* module/system/vm/assembler.scm (shuffling-assembler): Minor renames.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	SP-relative local addressing
	* libguile/vm-engine.c: S24/S12/S8 operands addressed relative to the
	  SP, not the FP.  Cache the SP instead of a FP-relative locals
	  pointer.  Further cleanups to follow.

	* libguile/vm.c (vm_builtin_call_with_values_code): Adapt to mov operand
	  addresing change.

	* module/language/cps/compile-bytecode.scm (compile-function): Reify
	  SP-relative local indexes where appropriate.

	* module/system/vm/assembler.scm (emit-fmov*): New helper, exported as
	  emit-fmov.
	  (shuffling-assembler, define-shuffling-assembler): Rewrite to shuffle
	  via push/pop/drop.
	  (standard-prelude, opt-prelude, kw-prelude): No need to provide for
	  shuffling args.

	* test-suite/tests/rtl.test: Update.

	* module/language/cps/slot-allocation.scm: Don't reserve slots 253-255.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	Fix boot closure wrong-num-args error
	* libguile/eval.c (prepare_boot_closure_env_for_eval): Fix issue if
	  fixed closure is called with wrong number of arguments during
	  bootstrap.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	Prepare for SP-addressed locals
	* libguile/vm-engine.c: Renumber opcodes, and take the opportunity to
	  fold recent additions into more logical places.  Be more precise when
	  describing the encoding of operands, to shuffle local references only
	  and not constants, immediates, or other such values.
	  (SP_REF, SP_SET): New helpers.
	  (BR_BINARY, BR_ARITHMETIC): Take full 24-bit operands.  Our shuffle
	  strategy is to emit push when needed to bring far locals near, then
	  pop afterwards, shuffling away far destination values as needed; but
	  that doesn't work for conditionals, unless we introduce a trampoline.
	  Let's just do the simple thing for now.  Native compilation will use
	  condition codes.
	  (push, pop, drop): Back from the dead!  We'll only use these for
	  temporary shuffling though, when an opcode can't address the full
	  24-bit range.
	  (long-fmov): New instruction, like long-mov but relative to the frame
	  pointer.
	  (load-typed-array, make-array): Don't use a compressed encoding so
	  that we can avoid the shuffling case.  It would be a pain, given that
	  they have so many operands already.

	* module/language/bytecode.scm (compute-instruction-arity): Update for
	  new instrution word encodings.

	* module/system/vm/assembler.scm: Update to expose some opcodes
	  directly, without the need for shuffling wrappers.  Adapt to
	  instruction word encodings change.

	* module/system/vm/disassembler.scm (disassembler): Adapt to instruction
	  coding change.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	Replace dynamic link on stack with previous frame size
	* libguile/frames.h (SCM_FRAME_DYNAMIC_LINK)
	  (SCM_FRAME_SET_DYNAMIC_LINK): Instead of storing the absolute value of
	  the previous FP, store its offset from the current FP.  This allows us
	  to avoid relinking when composing continuations or when relocating the
	  stack.

	* libguile/frames.c (scm_frame_dynamic_link, scm_c_frame_previous): No
	  need to relocate the dynamic link.

	* libguile/vm.c (vm_return_to_continuation_inner):
	  (vm_reinstate_partial_continuation_inner, vm_expand_stack_inner):
	  Don't relocate the frame pointer chain.
	  (scm_i_vm_mark_stack): Terminate when FP is above stack_top, not when
	  0.
	  (make_vm): Init FP to stack_top.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	Rename union scm_vm_stack_element members
	* libguile/frames.h (union scm_vm_stack_element): Rename members from
	  scm, ip, etc to as_scm, as_ip, etc.  Adapt users.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	Remove sp from scm_vm_cont
	* libguile/vm.h (struct scm_vm_cont): Remove "sp" member; it's always
	  the same as stack_bottom.

	* libguile/vm.c (scm_i_vm_cont_to_frame, scm_i_vm_capture_stack):
	  (vm_return_to_continuation_inner):
	* libguile/stacks.c (scm_make_stack):
	* libguile/continuations.c (scm_i_continuation_to_frame): Adapt.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	VM caches address of local 0 instead of FP
	* libguile/vm-engine.c (vm_engine): Cache the address of local 0 instead
	  of the FP.  This makes locals access a bit cheaper, but we still have
	  to negate the index.  The right fix is to index relative to the SP
	  instead.  That's a more involved change, so we punt until later.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	VM stack grows downward
	Adapt VM stack to grow downward.  This will make native compilation look
	more like the VM code, as we will be able to use native CALL
	instructions, taking proper advantage of the return address buffer.

	* libguile/continuations.c (scm_i_continuation_to_frame): Record offsets
	  from stack top.

	* libguile/control.c (scm_i_prompt_pop_abort_args_x): Adapt for reversed
	  order of arguments, and instead of relying on the abort to push on the
	  number of arguments, make the caller save the stack depth, which
	  allows us to compute the number of arguments ourselves.
	  (reify_partial_continuation, scm_c_abort): Adapt to reversed stack
	  order.

	* libguile/dynstack.c (scm_dynstack_wind_prompt): Since we wind the
	  stack in a downward direction, subtract the reloc instead of adding
	  it.

	* libguile/dynstack.h (SCM_F_DYNSTACK_PROMPT_ESCAPE_ONLY): Remove flag;
	  instead rely on prompt-establishing code to save the stack depth.

	* libguile/eval.c (eval): Remove extraneous "volatile" declarations for
	  variables that are not re-set between the setjmp and any longjmp.
	  Adapt to save stack depth before instating the prompt.

	* libguile/foreign.c (scm_i_foreign_call): Adapt to receive arguments in
	  reverse order.

	* libguile/frames.c (frame_stack_top, scm_i_frame_stack_top): Adapt to
	  compute stack top instead of stack bottom.
	  (scm_c_frame_closure): Adapt to stack growth change.
	  (scm_frame_num_locals, scm_frame_local_ref, scm_frame_set_x): Use
	  union data type to access stack.
	  (RELOC): Reformat.
	  (scm_c_frame_previous): Adapt to stack growth change.

	* libguile/frames.h: Adapt stack diagram to indicate that the stack
	  grows up.
	  (union scm_vm_stack_element): New data type used to access items on
	  the stack.
	  (SCM_FRAME_PREVIOUS_SP)
	  (SCM_FRAME_RETURN_ADDRESS, SCM_FRAME_SET_RETURN_ADDRESS)
	  (SCM_FRAME_DYNAMIC_LINK, SCM_FRAME_SET_DYNAMIC_LINK)
	  (SCM_FRAME_LOCAL, SCM_FRAME_NUM_LOCALS): Adapt to stack representation
	  change.
	  (SCM_FRAME_SLOT): New helper.
	  (SCM_VM_FRAME_FP, SCM_VM_FRAME_SP): Adapt to stack growth change.

	* libguile/stacks.c (scm_make_stack): Record offsets from top of stack.

	* libguile/throw.c (catch): Adapt to scm_i_prompt_pop_abort_args_x
	  change.

	* libguile/vm-engine.c (ALLOC_FRAME, RESET_FRAME):
	  (FRAME_LOCALS_COUNT_FROM): Adapt to stack growth change.
	  (LOCAL_ADDRESS): Use SCM_FRAME_SLOT to get the address as the proper
	  data type.
	  (RETURN_ONE_VALUE, RETURN_VALUE_LIST): Adapt to stack growth change.
	  (apply): Shuffling up the SMOB apply args can cause the stack to
	  expand, so use ALLOC_FRAME instead of RESET_FRAME.
	  (vm_engine): Adapt for stack growth change.

	* libguile/vm.c (vm_increase_sp, vm_push_sp, vm_restore_sp): Adapt to
	  stack representation change.
	  (scm_i_vm_cont_to_frame): Adapt to take offsets from the top.
	  (scm_i_vm_capture_stack): Adapt to capture from the top.
	  (vm_return_to_continuation_inner): Adapt for data type changes.
	  (vm_return_to_continuation): Likewise, and instead of looping, just
	  splat the saved arguments on with memcpy.
	  (vm_dispatch_hook): Adapt to receive arguments in the reverse order.
	  Adapt callers.
	  (vm_abort): There is never a tail argument.  Adapt to stack
	  representation change.
	  (vm_reinstate_partial_continuation)
	  (vm_reinstate_partial_continuation_inner): Adapt to stack growth
	  change.
	  (allocate_stack, free_stack): Adapt to data type change.
	  (expand_stack): Don't try to mremap(), as you can't grow a mapping
	  from the bottom.  Without knowing that there's a free mapping space
	  right below the old stack, which there usually isn't on Linux, we have
	  to copy.  We can't use MAP_GROWSDOWN because Linux is buggy.
	  (make_vm): Adapt to stack representation changes.
	  (return_unused_stack_to_os): Round down instead of up, as the stack
	  grows down.
	  (scm_i_vm_mark_stack): Adapt to walk up the stack.
	  (scm_i_vm_free_stack): Adapt to scm_vm changes.
	  (vm_expand_stack_inner, reset_stack_limit, vm_expand_stack): Adapt to
	  the stack growing down.
	  (scm_call_n): Adapt to the stack growing down.  Don't allow argv to
	  point into the stack.

	* libguile/vm.h (struct scm_vm, struct scm_vm_cont): Adapt to hold the
	  stack top and bottom.

2015-10-21  Andy Wingo  <wingo@pobox.com>

	Fix prompt miscompilation
	* module/language/cps/compile-bytecode.scm (compile-function): Fix
	  miscompilation when the handler body is forwarded.

	Minor VM documentation updates
	* doc/ref/vm.texi (Why a VM?, Variables and the VM): Minor updates.

2015-10-06  Mark H Weaver  <mhw@netris.org>

	Fix typo in CPS conversion.
	Fixes <http://bugs.gnu.org/21614>.
	Reported by tantalum <sph@posteo.eu>.

	* module/language/tree-il/compile-cps.scm (convert): Add missing 'cps'
	  argument to the continuation passed to 'convert-arg'.

2015-09-18  Andy Wingo  <wingo@pobox.com>

	Minor CPS documentation cleanups
	* doc/ref/compiler.texi (Continuation-Passing Style): Minor cleanups.

2015-09-17  Andy Wingo  <wingo@pobox.com>

	Update CPS language documentation
	* doc/ref/compiler.texi (Continuation-Passing Style): Update to latest
	  CPS language.

	Remove unused (language tree-il inline) module.
	* module/language/tree-il/inline.scm: Remove.
	* module/Makefile.am (TREE_IL_LANG_SOURCES): Remove inline.scm.

2015-08-13  Mark H Weaver  <mhw@netris.org>

	Allow decoding of UTF-8 containing U+FFFD, the replacement character.
	* libguile/strings.c (scm_from_utf8_stringn): Use 'u8_mbtoucr' and check
	  for a decoding error by its 'nbytes' return value.  Previously we used
	  'u8_mbtouc' and improperly assumed that a U+FFFD character indicated a
	  decoding error.
	* libguile/symbols.c (utf8_string_equals_wide_string): Likewise.
	* test-suite/tests/bytevectors.test (exception:decoding-error): New
	  variable.
	  ("2.9 Operations on Strings"): Add tests.

2015-07-27  Andy Wingo  <wingo@pobox.com>

	Add closure effects
	* module/language/cps/effects-analysis.scm: Add closure effects, to
	  enable hoisting/CSE of free-ref/free-set!.

	Better codegen for $values terms that don't shuffle
	* module/language/cps/compile-bytecode.scm (compute-forwarding-labels):
	  Analyze forwarding labels before emitting code.  This lets us elide
	  conts that cause no shuffles, allowing more fallthrough.

2015-07-27  Andy Wingo  <wingo@pobox.com>

	Loop peeling
	* module/language/cps/peel-loops.scm: New pass.  Only enabled if the
	  loop has one successor.

	* module/language/cps/optimize.scm: Peel instead of doing LICM on
	  higher-order CPS, then LICM on first-order CPS.

	* module/Makefile.am: Wire up new pass.

2015-07-27  Andy Wingo  <wingo@pobox.com>

	solve-flow-equations tweak
	* module/language/cps/utils.scm (solve-flow-equations): Revert to take
	  separate in and out maps.  Take an optional initial worklist.

	* module/language/cps/slot-allocation.scm: Adapt to solve-flow-equations
	  change.

2015-07-27  Andy Wingo  <wingo@pobox.com>

	Simplify rotate-loops.scm
	* module/language/cps/rotate-loops.scm: Clean up unused code.

2015-07-25  Andy Wingo  <wingo@pobox.com>

	Loop inversion with multiple exits
	* module/language/cps/rotate-loops.scm (rotate-loop): Instead of
	  restricting rotation to loops with just one exit node, restrict to
	  loops with just one exit successor.

2015-07-24  Andy Wingo  <wingo@pobox.com>

	Rotate comparisons down to loop back-edges
	* module/language/cps/rotate-loops.scm: New pass.
	* module/Makefile.am:
	* module/language/cps/optimize.scm: Wire up the new pass.

	Eliminate trampoline gotos when possible in compile-bytecode
	* module/language/cps/compile-bytecode.scm (compile-function): Eliminate
	  trampoline jumps for conditional branches that don't shuffle.

	Small expression-effects tweak
	* module/language/cps/effects-analysis.scm (expression-effects):
	  Closures with zero free vars don't allocate.

	Loop-invariant code motion
	* module/language/cps/licm.scm: New pass.
	* module/language/cps/optimize.scm: Wire up new pass.
	* module/Makefile.am: Add new file.

2015-07-24  Andy Wingo  <wingo@pobox.com>

	Move solve-flow-equations to utils
	* module/language/cps/slot-allocation.scm (compute-lazy-vars):
	  (compute-live-variables):  Adapt to solve-flow-equations interface
	  change.

	* module/language/cps/utils.scm (solve-flow-equations): Move here.  Use
	  an init value instead of an init map.

2015-07-24  Andy Wingo  <wingo@pobox.com>

	Factor out compute-effects/elide-type-checks from dce.scm
	* module/language/cps/type-checks.scm: New module.
	* module/language/cps/dce.scm: Use new module.
	* module/Makefile.am: Add new module.

2015-07-22  Andy Wingo  <wingo@pobox.com>

	Add missing files
	Last commit meant to rename files, not delete them.  Whoops!

	Rename CPS2 to CPS

	Remove CPS1 language
	* module/language/cps.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/spec.scm:
	* module/language/cps/verify.scm:
	* module/language/cps2/compile-cps.scm: Delete.
	* module/Makefile.am: Remove deleted files.

	Compile CPS2 directly to bytecode
	* module/language/cps2/spec.scm (cps2): Compile directly to bytecode.

	Slot allocation and bytecode compilation from CPS2.
	* module/language/cps2/compile-bytecode.scm: New file.
	* module/language/cps2/slot-allocation.scm: New file.
	* module/Makefile.am: Add new files.

	Fix CPS2 compute-successors
	* module/language/cps2/utils.scm (compute-successors): Propagate $kfun
	  to $ktail so that we don't leave off the tail if the body iloops.

	intset-intersect bugfix
	* module/language/cps/intset.scm (intset-intersect): Remove new-leaf
	  procedure, inlining to single call site.  An empty intersection
	  properly produces #f so that the set can be pruned.

2015-07-21  Andy Wingo  <wingo@pobox.com>

	Fix bad return shuffles for multiply-used $kreceive conts
	* module/language/cps2/reify-primitives.scm (uniquify-receive):
	  (reify-primitives): Ensure that $kreceive conts can have only one
	  predecessor.  Otherwise return shuffles are incorrectly allocated.

2015-07-20  Andy Wingo  <wingo@pobox.com>

	Fix error printing some wrong-num-args backtraces
	* module/system/repl/debug.scm (print-frame): Pass #:top-frame? #t for
	  the top frame.

	* module/system/vm/frame.scm (available-bindings): Be permissive and
	  allow #:top-frame? #f even when the IP is at the start of the
	  function.

2015-07-20  Andy Wingo  <wingo@pobox.com>

	More slot-allocation simplification
	* module/language/cps/slot-allocation.scm (allocate-slots): Remove
	  unreachable clause.

2015-07-19  Andy Wingo  <wingo@pobox.com>

	CPS1 slot-allocation simplification
	* module/language/cps/slot-allocation.scm (allocate-slots): Don't pass
	  around nargs, as it's not used.

2015-07-19  Andy Wingo  <wingo@pobox.com>

	Utils refactors
	* module/language/cps2/utils.scm (compute-successors): kfun is
	  optional.
	  (compute-sorted-strongly-connected-components): New function, moved
	  from split-rec.scm.  Doesn't assume that 0 is a free node identifier.

	* module/language/cps2/split-rec.scm
	  (compute-sorted-strongly-connected-components): Remove, use utils.scm
	  version instead.

	* module/language/cps2/closure-conversion.scm (intset-select): Remove
	  unused function.

2015-07-19  Andy Wingo  <wingo@pobox.com>

	Add intset-prev and intset-fold-right
	* module/language/cps/intset.scm (intset-prev): New function.
	  (make-intset-folder): Add forward? argument like make-intmap-folder.
	  (intset-fold-right): New function.

2015-07-16  Andy Wingo  <wingo@pobox.com>

	Reify primitives in CPS2
	* module/language/cps/reify-primitives.scm: Remove.
	* module/language/cps2/reify-primitives.scm: New file.
	* module/Makefile.am: Adapt build.

	* module/language/cps/compile-bytecode.scm:
	* module/language/cps2/compile-cps.scm: Reify primitives in CPS2 instead
	  of CPS.

2015-07-16  Andy Wingo  <wingo@pobox.com>

	Fix type/range inference for mul
	* module/language/cps2/types.scm (mul): Fix nan testing.

2015-07-16  Andy Wingo  <wingo@pobox.com>

	Remove CPS optimization passes and closure conversion
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/prune-bailouts.scm:
	* module/language/cps/prune-top-level-scopes.scm:
	* module/language/cps/self-references.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/cps/type-fold.scm:
	* module/language/cps/types.scm: Remove these files, obsoleted by CPS2.

	* module/Makefile.am: Update.

2015-07-16  Andy Wingo  <wingo@pobox.com>

	Optimize first-order CPS
	* module/language/cps2/optimize.scm: Move comments here from
	  cps/compile-bytecode.scm.

	* module/language/cps/compile-bytecode.scm: Remove optimization and
	  closure conversion calls, since CPS2 does this for us.

	* module/language/cps2/compile-cps.scm (compile-cps): Use set! to save
	  memory at bootstrap-time.  Optimize first-order CPS, to get rid of
	  strangeness introduced in closure conversion.

2015-07-16  Andy Wingo  <wingo@pobox.com>

	Beta reduction over first-order CPS
	* module/language/cps2/simplify.scm (beta-reduce): Handle $closure.

2015-07-16  Andy Wingo  <wingo@pobox.com>

	DCE works on first-order CPS
	* module/language/cps2/dce.scm (compute-live-code): Use the live-labels
	  set to indicate function liveness.  $closure and $callk mark their
	  associated functions as live.
	  (process-eliminations): Handle $closure.

	* module/language/cps2/effects-analysis.scm (expression-effects): Handle
	  $closure.

2015-07-16  Andy Wingo  <wingo@pobox.com>

	compute-reachable-functions refactor
	* module/language/cps2/utils.scm (compute-reachable-functions): New
	  function.

	* module/language/cps2/verify.scm (check-label-partition)
	  (compute-reachable-labels): Use the new function.

	* module/language/cps2/simplify.scm (compute-singly-referenced-vars):
	  Allow $closure.
	  (compute-eta-reductions, compute-beta-reductions): Use
	  compute-reachable-functions, which besides being a simplification also
	  allows simplification to work on first-order CPS.

2015-07-15  Andy Wingo  <wingo@pobox.com>

	Prepare DCE pass for first-order CPS2
	* module/language/cps2/dce.scm (compute-live-code): Prepare for handling
	  first-order CPS by tracking functions in the live label set.

	Enable CPS2 closure conversion
	* module/language/cps2/closure-conversion.scm: Remove debug printfs.
	* module/language/cps2/compile-cps.scm (compile-cps):
	* module/language/cps/compile-bytecode.scm (compile-bytecode): Use CPS2
	  closure conversion by default.

	CPS2 closure conversion bugfixes
	* module/language/cps2/closure-conversion.scm
	  (rewrite-shared-closure-calls): Fix to make shared closures call the
	  right label.
	  (closure-label): New helper.
	  (prune-free-vars): If a shared closure is not well-known, don't use
	  the alias optimization.
	  (convert-one): Fix for shared closures with one not-well-known
	  closure.

	closure-conversion docstring tweak
	* module/language/cps2/closure-conversion.scm (prune-free-vars): Fix
	  docstring.

2015-07-15  Andy Wingo  <wingo@pobox.com>

	Wire up new closure conversion pass
	* module/language/cps/compile-bytecode.scm (compile-bytecode): Only
	  convert closures if the #:cps2-convert? option is not passed.

	* module/language/cps2/compile-cps.scm (conts->fun*, compile-cps): Add
	  support for CPS2 closure conversion, disabled by default.

2015-07-14  Andy Wingo  <wingo@pobox.com>

	Add CPS2 closure conversion module
	* module/language/cps2/closure-conversion.scm: New module.
	* module/Makefile.am: Add new file.

	Verify pass works on first-order CPS
	* module/language/cps2/verify.scm: Work with first-order CPS.

2015-07-14  Andy Wingo  <wingo@pobox.com>

	Beginnings of first-order CPS optimization
	* module/language/cps2/optimize.scm (optimize-higher-order-cps): Renamed
	  from "optimize".
	  (optimize-first-order-cps): New function.

	* module/language/cps2/compile-cps.scm: Adapt.

2015-07-14  Andy Wingo  <wingo@pobox.com>

	Tweak intset printing
	* module/language/cps/intset.scm: Print members of set as absolute
	  values, not diffs from set minumum.

	CPS2 renumber works with first-order CPS
	* module/language/cps2/renumber.scm (compute-renaming): Add support for
	  $closure and $callk.

2015-07-13  Andy Wingo  <wingo@pobox.com>

	Fix intset-subtract to reliably produce empty-intset
	* module/language/cps/intset.scm (intset-subtract): Reliably produce
	  empty-intset if the result is empty.

	intset-union fast paths
	* module/language/cps/intset.scm (intset-union): Add fast paths for
	  union with empty intset.

	Reorganizing of intset/intmap helper functions
	* module/language/cps2/split-rec.scm (intmap-keys): Move to utils.
	* module/language/cps2/utils.scm (trivial-intset): New function.
	  (intmap-keys, invert-bijection, invert-partition): New functions.

2015-07-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	mips: Pass tests for variadic jit functions on new abi
		* lib/jit_mips-cpu.c: Correct definition of htonr_ul.
		Correct prolog/epilog/va* routines to work on o64 abi.

		* lib/jit_mips-fpu.c: Correct load of double literal
		argument when not using a data buffer.
		Remove alignment correction in vaarg_d if using the
		new mips abi.

		* lib/jit_mips.c: Correct code to allow creating variadic
		jit functions when using the new mips abi.

		* lib/jit_rewind.c: Minor adjust for rewind when using
		the new mips abi, if there are varargs arguments in
		registers.

2015-06-07  Andy Wingo  <wingo@pobox.com>

	Add split-rec pass
	* module/language/cps2/split-rec.scm: New pass.
	* module/language/cps2/optimize.scm: Run new pass.
	* module/Makefile.am: Add new pass to build.

2015-06-07  Paulo Andrade  <pcpa@gnu.org>

	ia64: Pass all tests for variadic jit functions
		* lib/jit_ia64-cpu.c: Search backward for the last output
		register used, otherwise would stop too early if a float
		argument used the slot.
		Correct offset of first va_list argument, and use proper
		va_list abi.

		* lib/jit_ia64-fpu.c: Add new functions to move a gpr
		to a fpr register, to counterpart the ones that move a
		fpr to a gpr. These are required to properly implement
		jit_getarg*_{f,d} on complex prototypes, or variadic
		jit functions.

		* lib/jit_ia64-sz.c: Update for support to jit variadic
		functions.

		* lib/jit_ia64.c: Implement proper abi for variadic
		jit functions.

2015-06-05  Andy Wingo  <wingo@pobox.com>

	Renumber before contifying to eliminate stale conts
	* module/language/cps2/contification.scm (contify): Renumber before contifying.

	Disable CPS optimization passes
	* module/language/cps/compile-bytecode.scm (compile-bytecode): Don't
	  bother running the CPS optimization passes, as they are redundant
	  with CPS2.

	Enable all CPS2 optimization passes
	* module/language/cps2/optimize.scm (optimize): Enable all CPS2
	  passes.  Wheee!

	Tweaks to bootstrap build order
	* module/Makefile.am (SOURCES): Since intmaps and intsets are used so
	  much in CPS2, bump them up.  Demote (language cps types).

	Add CPS2 verification pass
	* module/language/cps2/verify.scm: New diagnostic pass.
	* module/Makefile.am: Add verify.scm.
	* module/language/cps2/optimize.scm: Wire up verification pass.
	  Always run the pass at the end, and if a variable is set run it
	  between passes too.

	Refactor renumber.scm
	* module/language/cps2/renumber.scm (sort-labels-locally): Rewrite to
	  be functional.  Yay :)

	Port self-references pass to CPS2
	* module/language/cps2/self-references.scm: New pass, ported from CPS.
	* module/language/cps2/optimize.scm: Wire up the self references pass.
	* module/Makefile.am: Add new file.

	Fix eta reduction on CPS2
	* module/language/cps2/simplify.scm (compute-singly-referenced-vars):
	  New helper.
	  (compute-eta-reductions): Turns out, eta conversion on a graph
	  doesn't work the same way that it works on nested terms -- since
	  uses and defs are computed using the flow graph and not nested
	  terms, we need to check additionally that the vars are singly-used.

	Fix intmap-ref bug
	* module/language/cps/intmap.scm (intmap-ref): Fix a case in which the
	  not-found procedure could be called with an incorrect value.

	Fix slot allocation hinting for intervening terms that define dead values
	* module/language/cps/slot-allocation.scm (allocate-slots): Even if an
	  expression does not define a live value, it might need a place to
	  put its value.  In that case we should stop scanning for hints,
	  otherwise e.g. an (current-module) primcall whose value isn't used
	  could clobber a hinted variable.

	Fix write beyond stack boundary in vm-engine.c
	* libguile/vm-engine.c (RETURN_ONE_VALUE, RETURN_VALUE_LIST): These
	  helpers, used in subr-call and the like, might not actually have
	  enough space to push the return values.  Use ALLOC_FRAME instead of
	  RESET_FRAME, for that reason.

2015-06-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement new synthesized IR codes sequences
		* lib/jit_rewind.c: New file implementing generic functions
		to "rewind", or rewrite IR code sequences.

		* include/lightning.h: Add several new codes, that previously
		were a function call, that would synthesize the operation.
		Now, there is a code for the operation, and a new flag to
		know an operation is synthesized.

		* include/lightning/jit_private.h: Add several new macros to
		help construct synthesized IR code sequences.

		* lib/Makefile.am: Update for lib/jit_rewind.c.

		* lib/jit_disasm.c: Update for a small rework on jit_node_t,
		so that --enable-devel-disassembler does not need a change
		in the layout of jit_node_t.

		* lib/jit_names.c: Update for the new codes.

		* lib/jit_print.c: Update to print more readable output, and
		flag synthesized IR code sequences.

		* lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
		lib/jit_arm-sz.c, lib/jit_arm.c, lib/jit_x86-sz.c,
		lib/jit_x86.c: Update for new synthesized IR code sequences.

		* lib/jit_ppc-cpu.c, lib/jit_ppc-fpu., lib/jit_ppc-sz.c,
		lib/jit_ppc.c, lib/jit_mips-cpu.c, lib/jit_mips-fpu.c,
		lib/jit_mips-sz.c, lib/jit_mips.c, lib/jit_s390-fpu.c,
		lib/jit_s390-sz.c, lib/jit_s390.c: Update for new synthesized
		IR code sequences and correct bugs in the initial varargs
		implementation support.

		* lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_hppa-sz.c,
		lib/jit_hppa.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
		lib/jit_sparc-sz.c, lib/jit_sparc.c: Add generic, untested
		support for the new synthesized	IR code sequences. Known
		most likely broken right now, and should be corrected once
		access to these hosts is available.

		* lib/lightning.c: Update for new IR codes, and add support
		for not yet existing instructions that change third argument.

		* size.c: Change to use different tables for LE and BE PowerPC.
		Correct a wrong endif for x32.

2015-06-03  Andy Wingo  <wingo@pobox.com>

	Port type-fold to CPS2
	* module/language/cps2/type-fold.scm: New file, ported from CPS.
	* module/language/cps2/optimize.scm: Wire up type-fold.
	* module/Makefile.am (CPS2_LANG_SOURCES): Add language/cps2/type-fold.cps.

	Add setk clause to with-cps
	* module/language/cps2/with-cps.scm: Add a setk clause kind.

2015-06-03  Andy Wingo  <wingo@pobox.com>

	Port CSE to CPS2
	* module/language/cps2/cse.scm: New file, ported from CPS.
	* module/language/cps2/optimize.scm: Wire up CSE.
	* module/Makefile.am: Add language/cps2/cse.scm.

	* module/language/cps/compile-bytecode.scm (optimize): Disable
	  prune-top-level-scopes on old CPS.  It seems to not work if CSE has
	  run beforehand.

2015-06-03  Andy Wingo  <wingo@pobox.com>

	Fix some cps2 utils bugs
	* module/language/cps2/utils.scm (compute-function-body): $callk does
	  not add to a local function graph.
	  (compute-successors): Fix extraction of "handler" continuation for
	  $prompt.

2015-06-03  Andy Wingo  <wingo@pobox.com>

	Move some graph utilities from contification.scm to utils.scm
	* module/language/cps2/utils.scm (compute-successors): New helper.
	  (compute-reverse-post-order): Move here from contification.scm and
	  rename from "sort-nodes".
	  (invert-graph): New helper.
	  (compute-strongly-connected-components): Move here from
	  contification.scm and rename from "compute-sccs".

	* module/language/cps2/contification.scm (sort-nodes, compute-sccs): Remove.

2015-06-02  Andy Wingo  <wingo@pobox.com>

	Port prune-bailouts pass to CPS2
	* module/language/cps2/prune-bailouts.scm: New file.
	* module/language/cps2/optimize.scm: Wire up prune-bailouts pass.

	* module/Makefile.am (CPS2_LANG_SOURCES): Add language/cps2/prune-bailouts.scm.

2015-06-02  Andy Wingo  <wingo@pobox.com>

	Port elide-values pass to CPS2
	* module/language/cps2/elide-values.scm: New file.
	* module/language/cps2/optimize.scm (optimize): Wire up elide-values.
	* module/Makefile.am: Add new file.

	prune-top-level-scopes elides with $values
	* module/language/cps2/prune-top-level-scopes.scm
	  (prune-top-level-scopes): Given that cache-current-module! is an
	  instruction, it will always continue to a nullary $kargs, so $values
	  is actually the correct replacement and not a values primcall.

	Port specialize-primcalls pass to CPS2
	* module/language/cps2/specialize-primcalls.scm: New file.
	* module/language/cps2/optimize.scm: Wire up specialize-primcalls.
	* module/Makefile.am: Add new file.

	Port inline-constructors pass to CPS2
	* module/language/cps2/constructors.scm: New file.
	* module/language/cps2/optimize.scm: Enable inline-constructors pass.
	* module/Makefile.am: Add new file to build.

2015-06-02  Andy Wingo  <wingo@pobox.com>

	Factor with-cps out to separate module
	* module/language/cps2/with-cps.scm: New file.
	* module/language/tree-il/compile-cps2.scm: Use (language cps2 with-cps).
	* module/Makefile.am: Add language/cps2/with-cps.scm.

	* .dir-locals.el: Add indentation rules for with-cps.

2015-06-02  Andy Wingo  <wingo@pobox.com>

	Port contification pass to CPS2.
	* module/language/cps2/contification.scm: New pass, ported from CPS.  Faster!
	* module/language/cps2/optimize.scm: Wire up contification pass.
	* module/Makefile.am: Add language/cps2/contification.scm.

	Add "intset" syntax to construct intsets.
	* module/language/cps/intset.scm (intset): New syntax.

	Add intmap-fold-right
	* module/language/cps/intmap.scm (make-intmap-folder): Add forward? argument.
	  (intmap-fold): Adapt.
	  (intmap-fold-right): New function.

2015-06-02  Andy Wingo  <wingo@pobox.com>

	Port prune-top-level-scopes pass to CPS2
	* module/language/cps2/prune-top-level-scopes.scm: Port to CPS2.

	* module/language/cps2/optimize.scm: Enable prune-top-level-scopes
	  pass.

	* module/Makefile.am (CPS2_LANG_SOURCES): Add prune-top-level-scopes.scm.

2015-06-02  Andy Wingo  <wingo@pobox.com>

	Fix compute-defining-expressions (and thereby compute-constant-values)
	* module/language/cps2/utils.scm (compute-defining-expressions): Fix
	  not one but two bugs in this pattern.  Grrr.

2015-06-02  Andy Wingo  <wingo@pobox.com>

	Add intmap-replace!.
	* module/language/cps/intmap.scm (intmap-replace!): New interface.

	* module/language/cps2/dce.scm (elide-type-checks):
	* module/language/cps2/simplify.scm (transform-conts):
	* module/language/cps2/utils.scm (intmap-map):
	* module/language/tree-il/compile-cps2.scm (cps-convert/thunk): Use intmap-replace!.

2015-06-02  Andy Wingo  <wingo@pobox.com>

	DCE uses type analysis to find dead code
	* module/language/cps2/dce.scm (compute-effects/elide-type-checks): New helper.
	  (elide-type-checks): Implement.
	  (fold-nested-functions): Remove.
	  (compute-live-code): Call compute-effects/elide-type-checks.

	Port type inference module to CPS2
	* module/Makefile.am:
	* module/language/cps2/types.scm: Port to CPS2.  Relative to the CPS1
	  module, this one uses worklists, which should result in fewer
	  visits, though it does use a different strategy for deciding when to
	  saturate.  We'll see!

	intset-next starting point is optional
	* module/language/cps/intset.scm (intset-remove): Remove incorrect comment.
	  (intset-next): "i" is optional.

	Add intmap-replace.
	* module/language/cps/intmap.scm (intmap-replace): New interface.

	Fix type-fold on multiplying exact numbers
	* module/language/cps/types.scm (mul): Fix bug inferring results of
	  exact multiplications.

	Fix regression in compute-idoms
	* module/language/cps2/utils.scm (compute-idoms): Adapt to previous
	  change that makes intmap-ref throw when the key is not present.

2015-05-25  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Move definition of jit_va_ codes, cosmetic change.

	Use an actual, invalid code, as last jit code.

	Move multiply defined macro to a single header file.

2015-05-25  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Intermediate, fully functional, rework for variadic functions
		* check/cva_list.c: New file implementing a test to ensure
		the value returned by jit_va_start is a valid C va_list.

		* check/va_list.ok: New simple helper file, as now the
		va_list.tst test is enabled.

		* check/va_list.tst: Rewritten for an extensive variadic
		jit functions test.

		* check/Makefile.am: Update for the new tests.

		* lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
		lib/jit_arm.c: Correct broken software float in a previous
		commit. Note that the hard float abi implementation is known
		broken at this time, for special cases involving variadic
		functions, and should be corrected next.

		lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c: Correct
		the jit_va_list_t semantics to match C va_list.

2015-05-24  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Bump library major.
		* lib/Makefile.am: Bump library major. This is a preparation
		for a rework that was due for quite some time, but that is
		now required to properly implement variadic jit functions.
		The rework is mainly required to know at prolog parsing, if
		a function is variadic or not. This will benefit a few
		backends, and is mandatory for the hard float arm abi.
		The rework was already planned for quite some time, to
		be able to use a variable stack framesize, and for leaf
		functions optimization where applicable.
		The change will be source compatible, but will change
		some internals, and jit_code_t values, as some new will
		be added.
		The only behavior change is that, jit_arg_register_p may
		change return value on hard float arm abi, if called before
		or after jit_ellipsis. Common sense anyway, would say to
		make that call after jit_ellipsis, but documentation
		should be updated for it.

	aarch64: Correct va_list offsets and double load.
		* lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: Correct base
		aarch64 varargs code.

	Correct make check for systems without gcc.
		* check/lightning.c: Clearly run check if clang is the system
		compiler.

2015-05-21  Paulo Andrade  <pcpa@gnu.org>

	alpha: Save correct offset if loading a vararg double.

2015-05-20  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	sparc: Add initial jit_va_ calls to sparc
		* lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c, lib/jit_sparc.c:
		Add base support to jit vararg functions to the sparc backend.

2015-05-20  Andy Wingo  <wingo@pobox.com>

	Port dead code elimination (DCE) pass to CPS2
	* module/language/cps2/dce.scm: New file.
	* module/language/cps2/optimize.scm: Enable CPS2 DCE pass.
	* module/Makefile.am: Add language/cps2/dce.scm.

	Port effects analysis to CPS2
	* module/Makefile.am (CPS2_LANG_SOURCES): Add effects-analysis.scm.
	* module/language/cps2/effects-analysis.scm: New file, based on
	  cps/effects-analysis.scm.
	* module/language/cps2/utils.scm (intmap-map):
	  (compute-defining-expressions, compute-constant-values): New helpers.

	Fix bug in CPS2 simplify's "transform-conts"
	* module/language/cps2/simplify.scm (transform-conts): Return a persistent intmap.

	intmaps and intsets print with abbreviated key ranges
	* module/language/cps/intset.scm (intset-key-ranges, range-string):
	  (print-helper, print-intset, print-transient-intset): New helpers.
	  Install as intset printers.
	* module/language/cps/intmap.scm (intmap-key-ranges, range-string):
	  (print-helper): New helpers.
	  (print-intmap, print-transient-intmap): Call the new helpers.

2015-05-20  Andy Wingo  <wingo@pobox.com>

	Add arity to worklist-fold
	* module/language/cps2/utils.scm (worklist-fold): Add two-seeded arity.
	  (worklist-fold2): Remove.

	* module/language/cps2/renumber.scm (compute-tail-path-lengths): Adapt.

2015-05-20  Andy Wingo  <wingo@pobox.com>

	Variadic intset-fold, intmap-fold
	* module/language/cps/intmap.scm (intmap-fold): Add two-seeded arity.
	* module/language/cps/intset.scm (intset-fold): Merge intset-fold2
	  into this function, as a two-seeded arity.

	* module/language/cps2/simplify.scm (compute-eta-reductions):
	  (compute-singly-referenced-labels, compute-beta-reductions): Adapt
	  intset-fold2 callers.

2015-05-20  Andy Wingo  <wingo@pobox.com>

	Intmaps do not treat #f specially as a value
	* module/language/cps/intmap.scm: Intmaps can now contain any value;
	  #f does not indicate the absence of a value.  Instead we use a unique
	  private sentinel to mark absent values or branches.
	  (*absent*, absent?, present?): New helpers.
	  (new-branch): Initialize empty elements to *absent*.
	  (clone-branch-with-edit): New helper.
	  (clone-branch-and-set): Use clone-branch-with-edit.
	  (writable-branch): Use clone-branch-with-edit
	  (empty-intmap): Initialize value to *absent*.
	  (add-level): clone-branch-and-set doesn't take #f as a branch any
	  more; use new-branch.
	  (branch-empty?, make-intmap/prune, intmap-add!):
	  (intmap-add, intmap-remove, intmap-next, intmap-prev):
	  (intmap-fold, intmap-union, intmap-intersect): Use absent? to detect
	  absent branches / values.
	  (intmap-ref): Likewise.  Instead of returning #f if the value is not
	  found, call the optional not-found procedure.  By default this will
	  signal an error.

	* module/language/cps/types.scm:
	* module/language/cps2/renumber.scm:
	* module/language/cps2/simplify.scm: Adapt to intmap-ref signalling an
	  error by default if the value is not found.

	* module/language/tree-il/compile-cps2.scm: Adapt to intmap-add
	  signalling an error if #f was in the intmap as a value.

2015-05-20  Andy Wingo  <wingo@pobox.com>

	Add two-argument fixpoint arity
	* module/language/cps2/utils.scm (fixpoint): Add two-argument arity.

	Fix bug compiling fixpoint combinator
	* module/language/tree-il/peval.scm (<operand>): Rename "alias-value"
	  field to "alias", which is now an operand and not an expression.
	  This allows the operand to capture its environment; before, the
	  alias was being visited in its use environment instead of its
	  definition environment.
	  (peval): Adapt to operand change.  Fix construction of rest bindings
	  as well.
	* test-suite/tests/peval.test ("partial evaluation"): New test.

	Fix fixpoint
	* module/language/cps2/utils.scm (fixpoint): Fix embarrassing bug
	  where it wouldn't actually fixpoint!  Didn't show up in practice
	  because CPS2 hasn't run after contification yet.

	Fix sub/- primcall bug
	* module/language/tree-il/compile-cps2.scm (convert): Fix bug
	  in (apply - ...), because the instruction for "-" is "sub", and
	  "sub" lookup was failing.  Caught by numbers.test.  Really I would
	  like to get rid of $prim, somehow.

2015-05-20  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	alpha: Add initial jit_va_ calls to alpha
		* lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c, lib/jit_alpha.c:
		Add base support to jit vararg functions to the alpha backend.

	hppa: Add initial jit_va_ calls to hppa
		* lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c, lib/jit_hppa.c:
		Add base support to jit vararg functions to the hppa backend.

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

	Add optimization pass over CPS2
	* module/language/cps2/optimize.scm: New file.
	* module/language/cps2/simplify.scm: New file, factored out of
	  simplify2.scm.

	* module/language/cps/simplify2.scm: Remove, as it's obsolete.

	* module/language/cps2/compile-cps.scm: Optimize the CPS.

	* module/Makefile.am: Adapt for added and deleted files.

2015-05-11  Andy Wingo  <wingo@pobox.com>

	Consolidate CPS2 above CPS in the compiler
	This is an intermediate step.  We'll replace CPS bit by bit.  If it
	turns out to be a terrible idea we can just revert.

	* module/Makefile.am (TREE_IL_LANG_SOURCES): Remove compile-cps.scm.
	  (CPS_LANG_SOURCES): Remove arities.scm.

	* module/language/cps/arities.scm: Remove.
	* module/language/tree-il/compile-cps.scm: Remove.

	* module/language/tree-il/spec.scm: Remove use of compile-cps.scm.

	* module/language/cps/compile-bytecode.scm: Remove use of arities.scm.
	  Instead, incoming terms are expected to call their continuations
	  with the correct number of arguments.

2015-05-11  Andy Wingo  <wingo@pobox.com>

	Adapt return arities in Tree-IL -> CPS2 conversion
	* module/language/tree-il/compile-cps2.scm (adapt-arity): New
	  procedure.  This is equivalent to (language cps arities), but as it
	  is a necessary pass and not an optimization it's more proper to put
	  it in the converter itself.  Unlike with the nested CPS
	  representation, it's possible to look up continuations without
	  making a DFG.
	  (convert): Adapt arities as necessary.

	Build CPS2 with transient intmaps
	* module/language/tree-il/compile-cps2.scm (with-cps)
	  (cps-convert/thunk): Use transient intmaps.

2015-05-11  Paulo Andrade  <pcpa@gnu.org>

	ia64: Add initial jit_va_ calls to ia64
		* lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c, lib/jit_ia64.c:
		Add base support to jit vararg functions to the ia64 backend.

2015-05-10  Paulo Andrade  <pcpa@gnu.org>

	ia64: Do not use a dangling pointer for double to integer copy
		* lib/jit_ia64-fpu.c, lib/jit_ia64.c: Correct movi_d_w
		and movi_f_w implementation to work when not using a
		data buffer. This causes the check varargs.tst to
		work when passing "-d" to the lightning test tool.

	ia64: Implement cache flush.
		* lib/jit_ia64.c: Implement inline assembly cache flush,
		required on multiprocessor systems.

2015-05-09  Andy Wingo  <wingo@pobox.com>

	Tree-IL -> CPS2 -> CPS
	* module/language/tree-il/spec.scm (tree-il): Compile to CPS2 instead of CPS.

	compute-dom-edges returns a persistent intmap
	* module/language/cps/utils.scm (compute-dom-edges): Return a
	  persistent intmap.  Fixes strange bootstrapping failures that I
	  don't understand :/.

	Fix another intset transient bug
	* module/language/cps/intset.scm (intset-add!): If the root is a
	  branch but isn't editable, be sure to actually update the transient
	  intset's root to store the writable root.

	Fix intset-add! transient bug
	* module/language/cps/intset.scm (intset-add!): Fix as in
	  0f082bd3f7ad4854333728c6d0f71ef7df1fbec3.

2015-05-08  Andy Wingo  <wingo@pobox.com>

	Fix convert-cps2 for "not" primcalls
	* module/language/tree-il/compile-cps2.scm (convert): Fix typo in "not"
	  compilation.

	Fix intmap-add! transient bug
	* module/language/cps/intmap.scm (intmap-add!): Fix a bug creating a
	  transient branch out of a persistent branch.

	Register up cps2 compiler with language tower
	* module/language/tree-il/compile-cps2.scm (compile-cps2): Rename from compile-cps.
	* module/language/cps2/spec.scm: New file.
	* module/Makefile.am (CPS2_LANG_SOURCES): Add spec.scm.
	* module/language/tree-il/spec.scm (tree-il): Declare compiler to cps2.

	cps2: Fix parse-cps for `prompt'
	* module/language/cps2.scm (parse-cps): Fix for `prompt'.

	Add compiler from tree-il to cps2
	* module/language/tree-il/compile-cps2.scm: New file.
	* module/Makefile.am: Add the file to the build.

2015-05-08  Andy Wingo  <wingo@pobox.com>

	Beginnings of CPS2 language.
	The tentative plan is to replace CPS with CPS2, and to rename CPS2 to
	CPS.  We will add a pass to compile tree-il to CPS2, then work from
	the top down to replace the CPS compiler passes.

	* module/language/cps2.scm:
	* module/language/cps2/compile-cps.scm:
	* module/language/cps2/renumber.scm:
	* module/language/cps2/utils.scm: New files.

	* module/Makefile.am: Add new files to build.

2015-05-08  Andy Wingo  <wingo@pobox.com>

	Add printers for <intmap> and <transient-intmap>
	* module/language/cps/intmap.scm (intmap->alist, print-intmap)
	  (print-transient-intmap): New functions.
	  Install the new functions as printers for <intmap> and <transient-intmap>.

2015-05-07  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	mips: Add initial jit_va_ calls to mips
		* lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c:
		Add base support to jit vararg functions to the mips backend.
		Currently only supported on the o32 abi, until access to a
		n32 system is arranged.

2015-05-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Remove wrong comment after cut and paste

	ppc: Add initial jit_va_ calls to ppc
		* lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c:
		Add base support to jit vararg functions to the PowerPC backend.

2015-05-03  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	s390: Add initial jit_va_ calls to s390
		* lib/jit_s390-cpu.c, lib/jit_s390-fpu.c, lib/jit_s390.c:
		Add base support to jit vararg functions to the s390 backend.

2015-05-01  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	arm: Add initial jit_va_ calls to arm
		* lib/jit_arm-cpu.c, lib/jit_arm-swf.c, lib/jit_arm-vfp.c,
		lib/jit_arm.c: Add base support to jit vararg
		functions to the arm backend.

2015-04-30  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	aarch64: Add initial jit_va_ calls to aarch64
		* lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c,
		lib/jit_aarch64.c: Add base support to jit vararg
		functions to the aarch64 backend.

	Correct update of on stack vararg double argument pointer

	Update the correct fp offset and add assertions

2015-04-28  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add initial support to implement vararg jit functions
		* include/lightning.h, include/lightning/jit_private.h,
		lib/jit_names.c, lib/lightning.c: Add initial support
		for the new jit_va_start, jit_va_arg, jit_va_arg_d, and
		jit_va_end interfaces. The jit_va_start call is supposed
		to return a va_list compatible pointer, but not yet
		decided if it will be "declared" stdarg compatible,
		as for now only x86 support has been added (and should
		be compatible), but issues may arise on other backends.

		* check/lightning.c: Add wrappers to call the new jit_va_*
		interfaces.

		* lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
		jit_va_* for x86.

		* lib/jit_x86-sz.c: Add fields, but not yet fully updated,
		as this is an intermediate commit.

		* lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
		lib/jit_alpha-sz.c, lib/jit_alpha.c,
		lib/jit_arm-sz.c, lib/jit_arm.c,
		lib/jit_hppa-sz.c, lib/jit_hppa.c,
		lib/jit_ia64-sz.c, lib/jit_ia64.c,
		lib/jit_mips-sz.c, lib/jit_mips.c,
		lib/jit_ppc-sz.c, lib/jit_ppc.c,
		lib/jit_s390-sz.c, lib/jit_s390.c,
		lib/jit_sparc-sz.c, lib/jit_sparc.c: Prepare for the
		new jit_va_* interfaces. Not yet implemented, and will
		cause an assertion if used.

		* check/va_list.tst: Simple early test case, that works
		on x86_64, x32, ix86, cygwin, and cygwin64.

2015-04-26  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Update copyright date

2015-04-08  Andy Wingo  <wingo@pobox.com>

	Add "cps2" experiment
	* module/Makefile.am: Add new file to makefile.
	* module/language/cps/simplify2.scm: New file.

	Transient intsets
	* module/language/cps/intset.scm (make-atomic-reference)
	  (get-atomic-reference, set-atomic-reference!): New functions.
	  (*branch-size-with-edit*, *edit-index*): New constants.
	  (<transient-intset>): New data type.
	  (new-branch, clone-branch-and-set): Adapt to set edit field.
	  (transient-intset, persistent-intset): New exports.
	  (intset-add!): New interface, supporting "transient" intsets.
	  (intset-ref, intset-next, intset-prev, intset-fold, intset-fold2):
	  Work with transients.

	Add "transient" intmap interface
	* module/language/cps/intmap.scm (make-atomic-reference):
	  (get-atomic-reference, set-atomic-reference!): New helpers.
	  (*branch-size-with-edit*, *edit-index*): Branches now have a trailing
	  field, an atomic reference to their owner.
	  (<transient-intmap>): New record type.  A mutable intmap.
	  (new-branch): Set the "edit" field on the branch.
	  (clone-branch-and-set): No editor for this field.
	  (assert-readable!, writable-branch): New helpers.
	  (transient-intmap, persistent-intmap): New exported functions.
	  (intmap-add!): New function.
	  (intmap-next, intmap-prev, intmap-ref): Work on transient intmaps.
	  (intmap-fold): Persist the intmap before folding over it.

2015-04-01  Andy Wingo  <wingo@pobox.com>

	32-way branching in intmap.scm, not 16-way
	* module/language/cps/intmap.scm (*branch-bits*): Switch to 32-way
	  branching.  Marginally faster on lookup, and creation costs can be
	  amortized via using the transient interface.  Marginal speedup for
	  assembler.scm compilation.

	Intset-next micro-optimizations
	* module/language/cps/intset.scm (intset-next): Micro-optimizations.

	Add intset-fold, intset-fold2
	* module/language/cps/intset.scm (intset-fold, intset-fold2): New
	  functions.

	Add intmap-fold.
	* module/language/cps/intmap.scm (intmap-fold): New function.

	Add intmap-prev
	* module/language/cps/intmap.scm (intmap-next): Starting index is
	  optional.
	  (intmap-prev): New function.

	Default "meet" operator is meet-error for intmap
	* module/language/cps/intmap.scm (meet-error): New helper.
	  (intmap-add, intmap-union, intmap-intersect): The "meet" argument is
	  optional and defaults to meet-error.

	Remove "free" field of $fun
	* module/language/cps.scm ($fun): Remove unused "free" field.
	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/prune-bailouts.scm:
	* module/language/cps/prune-top-level-scopes.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/self-references.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/cps/type-fold.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Adapt all callers.

2015-04-01  Andy Wingo  <wingo@pobox.com>

	Replace $letrec with $rec
	* module/language/cps.scm ($rec): Replace $letrec with $rec, which is an
	  expression, not a term.  This means that the names bound by the letrec
	  appear twice: once in the $rec term, and once in the continuation.
	  This is not very elegant, but the situation is better than it was
	  before.  Adapt all callers.

	* doc/ref/compiler.texi (CPS in Guile): Incomplete documentation
	  updates.  I'll update these later when the IL settles down.

2015-04-01  Andy Wingo  <wingo@pobox.com>

	Precise range inference on <, <=, >=, > branches
	* module/language/cps/types.scm (restricted-comparison-ranges): New
	  helper.
	  (define-comparison-inferrer): New helper.
	  (<, <=, >=, >): Infer ranges precisely.

	Fix intmap bug for maps with only one element
	* module/language/cps/intmap.scm (intmap-ref): Fix bug referencing
	  values when there is only one value in the map.

2015-03-30  Ludovic Courtès  <ludo@gnu.org>

	elf: Add missing argument in 'elf-segment'.
	* module/system/vm/elf.scm (elf-segment): Add missing argument N.

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

	Only lazily compile where profitable
	* module/ice-9/eval.scm (primitive-eval): Only lazily compile box-ref on
	  toplevel variables; otherwise compile eagerly to avoid the
	  indirection.

	Optimize branches in the evaluator
	* module/ice-9/eval.scm (primitive-eval): Factor out primitive=?
	  helper.  Simplify compile-top-call.  Add compile-top-branch for
	  primcall branches, so the compiler can see the specialized branch
	  operator.

	Primcall inlining in eval.scm, lazy function body compilation
	* module/ice-9/eval.scm (primitive-eval): Lazily compile lambda bodies.
	  Special-case calls to top-level or module variables, and recognize
	  some of those calls as primcalls.  In that case, emit closures with
	  the primcalls.

	Remove unused "nargs" field of memoized call expressions
	* libguile/eval.c (eval):
	* libguile/memoize.c (MAKMEMO_CALL, memoize, unmemoize):
	* module/ice-9/eval.scm (primitive-eval): Remove "nargs" field from
	  memoized call expressions, and adapt callers.

	Marginal bootstrap memory improvements
	* module/language/cps/compile-bytecode.scm (optimize, compile-bytecode):
	  Marginally improve bootstrap memory usage by not retaining stale
	  copies of already-rewritten terms.

2015-03-11  Andy Wingo  <wingo@pobox.com>

	Remove $void CPS expression type
	* module/language/cps.scm: Remove the $void expression type, replaced by
	  $const of the unspecified value.
	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/self-references.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/cps/types.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Update callers.

2015-03-09  Andy Wingo  <wingo@pobox.com>

	Adapt GDB integration to newest patches
	* libguile/libguile-2.2-gdb.scm (vm-frame-function-name): Don't default
	  to the address, as we will have better identifying info via the file
	  name.
	  (vm-frame-source): New helper.
	  (compile-time-cond): For some reason "else" matching wasn't working;
	  punt and use expressions.
	  (snarfy-frame-decorator): Rename from decorator, and adapt to new
	  version of Guile frame filter patch.
	  (vm-frame-filter): Adapt to frame filter changes, and fill in source
	  info.

	Re-implement (ice-9 streams) in terms of (srfi srfi-41)
	* module/ice-9/streams.scm: Re-implement in terms of SRFI-41.  Passes
	  tests.

2015-03-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Properly correct read of freed memory

2015-03-07  Mark H Weaver  <mhw@netris.org>

	build: Use pipe symbol instead of comma for substitutions.
	* meta/Makefile.am (substitute): Use pipe symbol instead of comma for
	  substitutions.

2015-03-01  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct read of freed memory

2015-02-18  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Non-vector 1D arrays print as #1()
	* libguile/arrays.c (scm_i_print_array): Print the dimension whenever
	  the array is a true scm_tc7_array.

	* test-suite/tests/arrays.test: Check that non-vector 1D arrays print as
	  expected.

2015-02-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add missing ellipsis in allocar.tst

	Correct typo in x87.nodata test list

2015-02-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement jit_allocar for dynamic stack allocation
		* include/lightning.h, include/lightning/jit_private.h,
		lib/jit_aarch64-cpu.c, lib/jit_aarch64.c,
		lib/jit_alpha-cpu.c, lib/jit_alpha.c,
		lib/jit_arm-cpu.c, lib/jit_arm.c,
		lib/jit_hppa-cpu.c, lib/jit_hppa.c,
		lib/jit_ia64-cpu.c, lib/jit_ia64.c,
		lib/jit_mips-cpu.c, lib/jit_mips.c,
		lib/jit_ppc-cpu.c, lib/jit_ppc.c,
		lib/jit_s390-cpu.c, lib/jit_s390.c,
		lib/jit_sparc-cpu.c, lib/jit_sparc.c,
		lib/jit_x86-cpu.c, lib/jit_x86.c: Implement the new
		jit_allocar(offs, size) interface, that receives
		two integer registers arguments, allocates space
		dynamically in the stack, returns the offset in
		the first argument, and uses the second argument
		for the size in bytes of the memory to be allocated.

		* check/allocar.ok, check/allocar.tst: New files
		implementing test cases for the new jit_allocar
		interface.

		* check/Makefile.am, check/lightning.c: Update for
		the new test case and interface.

		* doc/body.texi: Add documentation of the new
		interface.

2015-02-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	X86: No longer make st7 available as a temporary
		* include/lightning/jit_x86.h, lib/jit_x86-cpu.c,
		lib/jit_x86-x87.c: No longer make st(7) available.
		Need to keep one x87 slots empty to avoid exceptions.
		This has the side effect of no longer needing the
		hackish emms instruction before a function call.

2015-02-17  Andy Wingo  <wingo@pobox.com>

	Struct and array GDB pretty printers hint as arrays
	* libguile/libguile-2.2-gdb.scm (make-scm-pretty-printer-worker):
	  (%scm-pretty-printer): Refactor to avoid printing all struct / array
	  fields by hinting these as arrays.  The resulting print is not as
	  faithful to the original data, but that's probably OK.

2015-02-17  Andy Wingo  <wingo@pobox.com>

	GDB support: add frame annotators and filters
	These features depend on a patch to GDB that has not been merged yet.
	If GDB doesn't support the annotator/filter interface, the code have no
	effect.

	* libguile/libguile-2.2-gdb.scm (compile-time-cond): New helper.
	  (snarfy-frame-annotator): Simple annotator that gives subr names for
	  snarfed gsubrs.
	  (vm-frame-filter): New filter that interleaves Scheme frames with C
	  frames on the stack when the user asks for a backtrace.

2015-02-17  Andy Wingo  <wingo@pobox.com>

	De-bitrot libguile-2.2-gdb.scm
	* libguile/libguile-2.2-gdb.scm: Update to work with Guile 2.2 stacks.
	  Represent the VM stack as a SRFI-41 stream, which will work better
	  with the frame filter interface.  Add support for getting the vm
	  frame's function name, if possible.

2015-02-17  Andy Wingo  <wingo@pobox.com>

	(system base types) knows about variables
	* module/system/base/types.scm (%tc7-variable): New tc7.
	  (cell->object): Handle tc7-variable.

	* test-suite/tests/types.test ("opaque objects"): Add a test.

2015-02-16  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct inconsistency with jit_regno_patch
		* lib/lightning.c: Remove the jit_regno_patch bitfield
		register fields before actual emit, as it is only really
		used before emit, otherwise, on special	conditions it
		may consider live registers as dead during code emit.

2015-02-16  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	X86: Correct load and store in the x32 abi
		* lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
		Correct encoding of ldxr* stxr* in the x32 abi. If the
		displacement register is negative, it would generate
		a 64 bit instruction with a 32 bit unsigned displacement.

		* check/ranger.tst, check/ranger.ok: New files, implementing
		a test case for negative loads and stores. This is range.tst
		converted to use registers instead of immediate offsets.

		check/Makefile.am: Update for the new test case.

2015-02-13  Andy Wingo  <wingo@pobox.com>

	Fix infinite loop in expander
	* module/ice-9/psyntax.scm (resolve-identifier): There is a case where a
	  syntax object can resolve to itself.  Prevent an infinite loop in that
	  case by continuing to resolve by name.

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

	* test-suite/tests/syncase.test ("infinite loop bug"): Add a test.

2015-02-10  Andy Wingo  <wingo@pobox.com>

	Add `scm_smob_type_class()'.
	* libguile/smob.h:
	* libguile/smob.c (scm_smob_type_class): New function, to access the
	  GOOPS class for a SMOB type.

2015-02-09  Andy Wingo  <wingo@pobox.com>

	NEWS and doc updates
	* doc/ref/vm.texi: Update for new instructions.
	* doc/ref/web.texi: Update for URI-reference support.
	* NEWS: Update.

2015-02-08  Andy Wingo  <wingo@pobox.com>

	Document support for URI references.
	* doc/ref/web.texi (URIs): Update for URI reference changes.

2015-02-07  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	GNU lightning 2.1.0 release

	Correct typo

	Avoid problems if JIT_INSTR_MAX is miscalculated
		* lib/jit_size.c: Preventively use at least 144 bytes
		if JIT_INSTR_MAX is less than it. The logic is not
		guaranteed to be 100% precise, it is mostly heuristics
		to allocate a buffer with as close as possible size,
		but a wrong value may cause code generation to write
		past the end of the buffer.

2015-02-06  Andy Wingo  <wingo@pobox.com>

	Reify bytevector? in the correct module
	* module/language/cps/reify-primitives.scm (primitive-module): Reify
	  bytevector? in the correct module.  Thanks to Nala Ginrut for the
	  report.

2015-02-06  Andy Wingo  <wingo@pobox.com>

	Add #:static-slot-allocation?
	* libguile/goops.h (SCM_VTABLE_FLAG_GOOPS_STATIC): Reserve the fourth
	  GOOPS flag to indicate that a class has static slot allocation.

	* libguile/goops.c (scm_init_goops_builtins): Define
	  vtable-flag-goops-static for goops.scm.

	* module/oop/goops.scm (class-has-statically-allocated-slots?): New
	  helper.
	  (build-slots-list): Instead of the ad-hoc checks for <class> or
	  <slot>, use the new helper.
	  (initialize): Accept #:static-slot-allocation? keyword.

	* module/system/foreign-object.scm (make-foreign-object-type): Declare
	  foreign object classes as having static slot allocation.

	* test-suite/tests/goops.test ("static slot allocation"): Add tests.

2015-02-06  Andy Wingo  <wingo@pobox.com>

	Fix foreign objects for getter method change
	* module/system/foreign-object.scm: Fix getters after change to make
	  <accessor-method> instances only apply to their precise specializer
	  types.

2015-02-03  Paulo Andrade  <pcpa@gnu.org>

	Correct the reason the simplify_stxi bug was not noticed before
		* lib/lightning.c: Correct the reason the bug in
		simplify_stxi was not triggered before, it was due to
		incorrectly resetting the value->code field, what was
		causing it to never properly optimize:
			stxi Im0 Rb0 Rt0
			ldxi Rt1 Rb1 Im1
		when Rb0 == Rb1, Rt0 == Rt1 and Im0 == Im1
		There was another possible issue, that has been also
		addressed in this commit, that would be the case of
		Rbn == Rtn, where no redundancy removal is possible.

	Correct wrong check in simplify_stxi.
		* lib/lightning.c: Correct wrong check in simplify_stxi.
		The test was incorrectly comparing the target register
		and the displacement offset. This was a time bomb bug,
		that would trigger in code like:
			stxi Im0 Rb0 Rt0
			stxi Im1 Rb1 Rt1
		if Rb0 == Rb1 && Rt0 == Rt1 && Im0 == Rt1, that is,
		the wrong check was Im0 == Rt1, instead of the supposed
		Im0 == Imm1 (that was what the code mean't to do). It
		was removing the second stxi assuming it was redundantly
		generated; as that is not uncommon pattern on
		translators generating jit.

2015-02-02  Paulo Andrade  <pcpa@gnu.org>

	ARM: Regenerate size table for hard float armv7 or newer.

	Add new --enable-devel-disassembler configure option
		* configure.ac, include/lightning/jit_private.h,
		lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
		lib/jit_disasm.c, lib/jit_hppa.c, lib/jit_ia64.c,
		lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,
		lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c: Add a new
		--enable-devel-disassembler option, that should be used
		during development, or lightning debug. This option
		intermixes previous jit_print and jit_disassemble
		output, making it easier to visualize what lightning
		call was used, and what code was generated.

2015-02-01  Paulo Andrade  <pcpa@gnu.org>

	Make more readable always true test

2015-01-31  Paulo Andrade  <pcpa@gnu.org>

	ARM: Do not limit to 24 bit displacement jump to unknown address
		* lib/jit_arm-cpu.c, lib/jit_arm.c: Only limit to 24 bit
		displacement non conditional jump in the same jit_state_t.

2015-01-26  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/goops.c
		libguile/vm-engine.h
		module/oop/goops.scm
		module/oop/goops/compile.scm
		module/oop/goops/dispatch.scm
		test-suite/tests/goops.test

2015-01-26  Andy Wingo  <wingo@pobox.com>

	Accessor methods only apply to subclasses with their slot
	* libguile/goops.c (is_accessor_method, scm_compute_applicable_methods):
	  Fix regression from 51f66c912078a25ab0380c8fc070abb73d178d98 (2009).
	  Accessor methods are added on each subclass on which the slot is
	  present; therefore if a subclass doesn't have a method, then the
	  methods doesn't apply.  Truly fixes #17355, unlike
	  583a23bf104c84d9617222856e188f3f3af4934d.

	* module/oop/goops.scm (compute-cmethod, compute-getter-method)
	  (compute-setter-method): Revert earlier changes.

	* test-suite/tests/goops.test ("accessor slots"): Update for new
	  expectations, in agreement with Guile 1.8.

2015-01-25  Andy Wingo  <wingo@pobox.com>

	Fix verify-cps
	* module/language/cps/verify.scm (verify-cps): Fix.  Thanks to Steven
	  H. Margolis for the note.  Fixes bug #19389.

2015-01-24  Andy Wingo  <wingo@pobox.com>

	Fix accessor struct field inlining
	* module/oop/goops/compile.scm: Inline into goops.scm, leaving a
	  compatible interface stub behind.

	* module/oop/goops/dispatch.scm: Don't import (oop goops compile), to
	  break circularities.

	* module/oop/goops.scm: Move (oop goops util) include up to the top, and
	  import (ice-9 match).
	  (compute-cmethod): Move here from compile.scm.  Add a special case for
	  accessor methods, so as to fix bug #17355.
	  (compute-getter-method, compute-setter-method): #:procedure slot is
	  now generic.

	* test-suite/tests/goops.test ("accessor slots"): New test.

2015-01-24  Andy Wingo  <wingo@pobox.com>

	Fix accessor struct inlining in GOOPS
	Fixes bug #17355.

	* module/oop/goops.scm (memoize-effective-method!): Adapt to
	  compute-effective-method change.
	  (compute-effective-method, %compute-effective-method): Renamed from
	  compute-cmethod; now a generic protocol.
	  (compute-specialized-effective-method)
	  (%compute-specialized-effective-method): New sub-protocol.
	  (memoize-generic-function-application!): Adapt to call the hard-wired
	  compute-applicable-methods based on the concrete arguments types --
	  the semantics is that %compute-applicable-methods is the
	  implementation for <generic> functions.  Perhaps we should do the same
	  for sort-applicable-methods and method-more-specific?.
	  (compute-getter-method, compute-setter-method): The standard
	  #:procedure is now a generic slot-ref.  It wasn't valid to inline
	  field access here, because subtypes could have different field
	  layouts.
	  (compute-applicable-methods): Refactor generic definition to use
	  lexical scoping.
	  (compute-specialized-effective-method): New method for
	  <accessor-method>, which does field access inlining based on the
	  concrete types being applied.

	* test-suite/tests/goops.test ("accessor slots"): New test.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Simplify and optimize slot access
	* module/oop/goops.scm (fold-slot-slots): Add `slot-ref/raw' slot, which
	  is what the slot-ref slot was.  Now the slot-ref slot checks that the
	  slot is bound, if needed.
	  (slot-definition-slot-ref/raw): Define.
	  (make-slot): Adapt.  Also, effective slot definition slots have no
	  initargs.
	  (define-standard-accessor-method, bound-check-get, standard-get)
	  (standard-set): Move definitions up.
	  (allocate-slots): Adapt.  If the slot has an init thunk, we don't need
	  to check that it's bound.
	  (slot-ref, slot-set!, slot-bound?): Simplify.
	  (class-slot-ref): Use the raw getter so that we can call
	  `slot-unbound' with just the class.
	  (compute-getter-method, compute-setter-method): Simplify to just use
	  the slot-ref / slot-set! functions from the slot.
	  (%initialize-object): Simplify.

	Export <slot> from GOOPS
	* module/oop/goops.scm (<slot>): Export.  This is the way to tell if you
	  have new GOOPS or not: whether <slot> is defined.

	Simplify GOOPS effective method cache format
	* module/oop/goops.scm (single-arity-cache-dispatch)
	  (compute-generic-function-dispatch-procedure)
	  (memoize-effective-method!): Simplify format of effective method
	  cache.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Fast generic function dispatch without calling `compile' at runtime
	* module/oop/goops.scm: Rewrite generic function dispatch to use chained
	  closures instead of compiling specific dispatch procedures.  The big
	  speed win before was not allocating rest arguments, which we gain by
	  simply pre-generating dispatchers for arities of up to 20 arguments.
	  Also now a tail call without reshuffling arguments -- which is what
	  dispatch now is -- is just a (mov 0 new-procedure) and (tail-call),
	  which is pretty cheap.

	  (%invalidate-method-cache!): Use the new
	  recompute-generic-function-dispatch-procedure!.
	  (arity-case, multiple-arity-dispatcher, single-arity-dispatcher)
	  (single-arity-cache-dispatch)
	  (compute-generic-function-dispatch-procedure)
	  (recompute-generic-function-dispatch-procedure!): New internal
	  interfaces.
	  (memoize-effective-method!): Update for new interfaces.
	  (memoize-generic-function-application!): Rename from `memoize-method!'.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	GOOPS cosmetics
	* module/oop/goops.scm: More commenting.  Move around <keyword> in the
	  export section.

	Update (oop goops save) for <slot> objects
	* module/oop/goops/describe.scm (describe): Remove commented code.
	* module/oop/goops/save.scm (get-set-for-each, access-for-each): Update
	  these hoary routines for the new <slot> universe.

	Fix foreign objects for removal of getters-n-setters
	* module/system/foreign-object.scm (getter-method): Fix for removal of
	  getters-n-setters property.

	Minor GOOPS cleanups
	* module/oop/goops.scm: Minor commenting fixes.

	Optimize %initialize-object
	* module/oop/goops.scm (%initialize-object): Optimize by inlining the
	  slot initialization, and by avoiding multiple checks for initargs
	  validity.

	Inline internal slot accessors
	* module/oop/goops.scm (define-slot-accessor): Also define internal
	  accessors without the type check for when we know that the object is a
	  slot.  Adapt struct-ref users to use these variants.

	Inline helpers into slot-ref, slot-set!, etc
	* module/oop/goops.scm (%class-slot-definition): New helper.
	  (class-slot-definition): Use the new helper.
	  (get-slot-value-using-name, set-slot-value-using-name!)
	  (test-slot-existence): Remove helpers.
	  (slot-ref, slot-set!, slot-bound?, slot-exists?): Inline helpers for
	  speed.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Use a vtable bit to mark <slot> instances
	* libguile/goops.h (SCM_VTABLE_FLAG_GOOPS_SLOT): Allocate another vtable
	  flag to indicate that instances of this vtable are slots.
	* libguile/goops.c (scm_init_goops_builtins): Export
	  vtable-flag-goops-slot to Scheme.

	* module/oop/goops.scm (<slot>, slot?, make-standard-class, initialize):
	  Arrange for <slot> classes to have the vtable-flag-goops.slot.
	  (build-slots-list): Ensure that <slot> slots are statically laid out.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Introduce <slot> objects in GOOPS
	* module/oop/goops.scm (fold-class-slots): Change format to use proper
	  slot specifications.
	  (fold-slot-slots): Flesh out with all needed slots.
	  (<class>): Update cons-layout to deal with new fold-class-slots form.
	  Don't create slots; we do that later.
	  (is-a?, get-keyword, *unbound, unbound?, %allocate-instance): Move
	  definitions up.
	  (<slot>, slot?): New definitions.
	  (slot-definition-name, slot-definition-allocation)
	  (slot-definition-init-keyword, slot-definition-init-form)
	  (slot-definition-init-value, slot-definition-init-thunk)
	  (slot-definition-options, slot-definition-getter)
	  (slot-definition-setter, slot-definition-accessor)
	  (slot-definition-slot-ref, slot-definition-slot-set!)
	  (slot-definition-index, slot-definition-size): New definitions as
	  accessors on <slot> objects.
	  (class-slot-definition): Adapt to class-slots change.
	  (direct-slot-definition-class, make-slot): New definitions.
	  (make): Define a boot version that can allocate <slot> instances.
	  (compute-direct-slot-definition)
	  (compute-direct-slot-definition-initargs)
	  (effective-slot-definition-class, compute-effective-slot-definition):
	  New definitions.
	  (build-slots-list): Adapt to slots being <slot> objects.
	  (compute-get-n-set): New boot definition.
	  (allocate-slots): New definition.  Replaces
	  compute-getters-n-setters.
	  (%compute-layout, %prep-layout): Adapt to changes.
	  (make-standard-class): Make <slot> objects for direct-slots, and
	  handle the allocate-slots protocol.
	  (<foreign-slot>): Inherit from <slot>.
	  (get-slot-value-using-name, set-slot-value-using-name!)
	  (test-slot-existence): Adapt to using slot definition objects.
	  (make-class): Allow slot specs or <slot> objects as the `slots'
	  argument.
	  (write): New method on <slot>.
	  (class-slot-ref, class-slot-set!): Reimplement.
	  (compute-slot-accessors, compute-getter-method)
	  (compute-setter-method): Adapt to changes.
	  (compute-getters-n-setters): Remove.  Yay!
	  (compute-get-n-set): Adapt to use effective slot definitions instead
	  of the getters-n-setters for #:class / #:each-subclass allocation.
	  (%initialize-object): Adapt.
	  (initialize): New method for <slot>.  Adapt method for <class>.

	* module/oop/goops/active-slot.scm (compute-get-n-set):
	* module/oop/goops/composite-slot.scm (compute-propagated-get-n-set):
	  Use slot-definition-options to access options of slot.

	* test-suite/tests/goops.test ("bad init-thunk"): Fix to be a "pass-if"
	  instead of an "expect-fail".

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Beginnings of <slot> slot definition class
	* module/oop/goops.scm (define-macro-folder): Factor out this helper.
	  (fold-class-slots): Implement using define-macro-folder.
	  (fold-slot-slots): New definition, for slots of <slot-definition>.
	  (define-slot-indexer): New helper.  Use to define indexes for slots of
	  <class> and of <slot>.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	The GOOPS "unbound" value is a unique pair
	* libguile/goops.c (SCM_GOOPS_UNBOUND, SCM_GOOPS_UNBOUNDP): Remove
	  internal macros.
	  (scm_make_unbound, scm_unbound_p): Remove internal functions.
	  (scm_sys_clear_fields_x): Add "unbound" parameter, for the init
	  value.

	* module/oop/goops.scm (*unbound*): Define in Scheme as a simple
	  heap-allocated value.
	  (unbound?): New definition.
	  (%allocate-instance): Pass *unbound* to %clear-fields!.
	  (make-class, slot-definition-init-value)
	  (slot-definition-init-form, make-closure-variable): Use *unbound*
	  instead of (make-unbound), which is now gone.

	* module/oop/goops/active-slot.scm (compute-get-n-set): Use *unbound*
	  instead of make-unbound.  This module uses the GOOPS internals module;
	  perhaps we should export make-unbound or something...

	* module/oop/goops/save.scm (make-unbound): Export our own make-unbound
	  definition, for use by residualized save code.

	* module/language/ecmascript/base.scm (<undefined>, *undefined*): Use a
	  unique object kind and instance for the undefined value.

	* libguile/vm.c (scm_i_vm_mark_stack): Fill the stack with
	  SCM_UNSPECIFIED instead of SCM_UNBOUND.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	GOOPS: Deprecate "using-class" procs like slot-ref-using-class
	* libguile/deprecated.h:
	* libguile/goops.c:
	* libguile/goops.h:
	* libguile/deprecated.c (scm_slot_ref_using_class):
	  (scm_slot_set_using_class_x):
	  (scm_slot_bound_using_class_p):
	  (scm_slot_exists_using_class_p): Deprecate.

	* module/oop/goops.scm (slot-ref-using-class, slot-set-using-class!)
	  (slot-bound-using-class?, slot-exists-using-class?): Deprecate.
	  Change to check that `class' is indeed the class of `obj', as
	  required, and then dispatch to slot-ref et al.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	change-object-class refactor
	* module/oop/goops.scm (change-object-class): Refactor to use slot-ref,
	  slot-bound?, and slot-set! instead of the using-class? variants.

	slot-ref, slot-set! et al bypass "using-class" variants
	* module/oop/goops.scm (slot-ref, slot-set!, slot-bound?, slot-exists?):
	  Bypass slot-ref-using-class, slot-set-using-class!, and so on.  Those
	  interfaces are public and have to check that the class is indeed a
	  class, they should check that the object is an instance of the class,
	  and so on, whereas if we get the class via class-of we know that the
	  invariant holds.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Manipulate GOOPS vtable flags from Scheme, for speed
	* libguile/goops.h: Remove unimplemented declarations of
	  scm_make_next_method, scm_sys_invalidate_method_cache_x, and
	  stklos_version.
	  (scm_sys_invalidate_class_x): Remove helper definition.  This was
	  exported in the past but shouldn't have been.

	* libguile/goops.c (scm_sys_make_vtable_vtable): Rename from
	  scm_sys_make_root_class, and don't do anything about flags.
	  (scm_sys_bless_applicable_struct_vtables_x, scm_class_p)
	  (scm_sys_invalidate_class_x): Remove; we do these in Scheme now.
	  (scm_init_goops_builtins): Define Scheme values for vtable flags.

	* module/oop/goops.scm (vtable-flag-goops-metaclass)
	  (class-add-flags!, class-clear-flags!, class-has-flags?)
	  (class?, instance?): New definitions.
	  (<class>): Add GOOPS metaclass flags from Scheme.
	  (<applicable-struct-class>, <applicable-struct-with-setter-class>):
	  Add flags from Scheme.
	  (make, initialize): Add class flags as appropriate.
	  (class-redefinition): Clear the "valid" flag on the old class.
	  (check-slot-args): Use instance? instead of a CPL check.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	GOOPS class slot indices defined as inline values
	* module/oop/goops.scm (define-class-index): Define as inline values.

	`match' refactor in goops.scm
	* module/oop/goops.scm (compute-dispatch-procedure): Use `match'.

	Convert emit-linear-dispatch to use match
	* module/oop/goops.scm (emit-linear-dispatch): Convert to use `match'.

	More GOOPS cleanups
	* module/oop/goops.scm (build-slots-list): Use `match'.
	  (make-standard-class): Formatting fixes.

	when and unless for one-armed ifs in goops.scm
	* module/oop/goops.scm: Consistently use when or unless for one-armed
	  ifs.

	More GOOPS comments
	* module/oop/goops.scm: More expository comments.

	Commenting in goops.scm
	* module/oop/goops.scm: More narrative cleanup.

	Narrative reordering in goops.scm
	* module/oop/goops.scm: Reorder for narrative.

	scm_make cleanup
	* libguile/goops.c (scm_make): Remove SCM_DEFINE around scm_make; the
	  real definition is in Scheme.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Add compute-cpl tests
	* test-suite/tests/goops.test: Add tests for compute-cpl based on
	  comments from goops.scm.

	* module/oop/goops.scm (compute-std-cpl): Remove comment, and add
	  docstring.
	  (compute-cpl): Improve comment.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Fold (oop goops util) into (oop goops)
	* module/oop/goops/util.scm: Removed.  Instead we fold these definitions
	  into goops.scm.

	* module/oop/goops/save.scm: Remove useless import of util.scm.

	* module/oop/goops.scm: Fold in util.scm.  Since we always use
	  add-interesting-primitive!, import (language tree-il primitives) in
	  the header.  Clean up some early comments, and use of eval-when.

	* module/Makefile.am: Adapt.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	GOOPS utils module cleanups
	* module/oop/goops.scm (make-class): Inline find-duplicate to its use
	  site.

	* module/oop/goops/util.scm (improper->proper): Remove unused function.
	  (any, every): Don't re-export these from SRFI-1; users can get them
	  from SRFI-1 directly.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	append-map rather than mapappend
	* module/oop/goops/util.scm: Remove mapappend alias; SRFI-1 append-map
	  should be used instead.

	GOOPS cleanup to use SRFI-1 better
	* module/oop/goops.scm (class-subclasses, class-methods): Reimplement
	  using stock SRFI-1 procedures.

	Cosmetic goops refactors.
	* module/oop/goops.scm: Update comments.
	* libguile/goops.c: Cosmetic reorderings, re-commentings, and
	  de-commentings.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Incorporate %inherit-magic! into %init-layout!
	* libguile/goops.c (scm_make_standard_class, scm_sys_init_layout_x):
	  Move definitions up.  Incorporate scm_sys_inherit_magic_x into
	  scm_sys_init_layout_x.

	* libguile/goops.h: Remove scm_sys_init_layout_x declaration.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	goops.c no longer knows about <class> slot allocation
	* libguile/goops.c (scm_class_of): Access "redefined" slot by name in
	  the case where we need to change the class of an instance.
	  (scm_sys_goops_early_init): Move up capture of class-precedence-list
	  so SCM_SUBCLASSP can use it.

	* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, scm_si_redefined)
	  (scm_si_direct_supers, scm_si_direct_slots, scm_si_direct_subclasses)
	  (scm_si_direct_methods, scm_si_cpl scm_si_slots)
	  (scm_si_getters_n_setters, SCM_N_CLASS_SLOTS, SCM_OBJ_CLASS_REDEF):
	  Remove.  Now C code has no special knowledge about the layout of
	  GOOPS classes.
	  (SCM_SUBCLASSP): Use scm_class_precedence_list to get CPL.
	  (SCM_INST, SCM_ACCESSORS_OF): Remove unused macros that were
	  undocumented and nonsensical.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Reimplement inherit-applicable! in Scheme
	* libguile/goops.c: Move captured keywords and symbols up to the top.
	  (scm_i_inherit_applicable): Dispatch to Scheme.
	  (scm_sys_goops_early_init): Capture inherit-applicable!.

	* module/oop/goops.scm (inherit-applicable!): Scheme implementation.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Reimplement %allocate-instance in Scheme
	* libguile/goops.c (scm_sys_clear_fields_x): New function.
	  (scm_sys_allocate_instance): Remove.  It was available to C but not to
	  Scheme and it's really internal.
	* libguile/goops.h: Remove scm_sys_allocate_instance.

	* module/oop/goops.scm (%allocate-instance): Implement in Scheme, using
	  allocate-struct and %clear-fields!.
	  (make, shallow-clone, deep-clone, allocate-instance): Adapt to
	  %allocate-instance not taking an initargs argument.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Re-use the vtable "size" field for GOOPS nfields
	* module/oop/goops.scm (fold-<class>-slots): The first "reserved" slot
	  is actually for instance sizes, used by the "simple struct"
	  mechanism.  Reuse this field for GOOPS's "nfields".
	  (make-standard-class, <class>, initialize): Adapt order of field
	  initializations.

	* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, SCM_N_CLASS_SLOTS)
	* libguile/goops.c (scm_sys_allocate_instance): Adapt.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Move <class> initialization to Scheme
	* libguile/goops.c (scm_sys_make_root_class): Just make the
	  vtable-vtable, and leave initialization to Scheme.

	* libguile/struct.c (scm_i_make_vtable_vtable): Change to take a full
	  list of fields, not just the extra fields.
	  (scm_init_struct): Adapt to scm_i_make_vtable_vtable change.

	* module/oop/goops.scm (<class>): Compute layout for <class>, and
	  initialize <class> from here.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Deprecate scm_get_keyword
	* libguile/deprecated.c (scm_get_keyword): Deprecate.
	* libguile/deprecated.h:
	* libguile/goops.c:
	* libguile/goops.h:

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Rewrite %initialize-object in Scheme
	* libguile/goops.h:
	* libguile/goops.c (scm_sys_initialize_object): Remove C interface.
	  This function was only really useful as part of a GOOPS initialize
	  method but was not exported from the goops module.

	* module/oop/goops.scm (get-keyword, %initialize-object): Implement in
	  Scheme.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Minor goops.c tidying
	* libguile/goops.c: Reorder static variables.  Remove unused
	  sym_procedure.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Remove scm_c_extend_primitive_generic
	* libguile/goops.h (scm_c_extend_primitive_generic): Remove public
	  interface.  This was introduced in 2003 with the "extended" generics
	  but never documented, unused as far as I can tell, and is better
	  accessed from Scheme.

	* libguile/goops.c: Remove support for scm_c_extend_primitive_generic.
	  Simplify capture of change-class.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	No more concept of "pure generics"
	* libguile/goops.h (SCM_PUREGENERICP, SCM_VALIDATE_PUREGENERIC)
	  (SCM_VTABLE_FLAG_GOOPS_PURE_GENERIC, SCM_CLASSF_PURE_GENERIC):
	  Remove.
	* libguile/goops.c (scm_set_primitive_generic_x): Use SCM_GENERICP, not
	  SCM_PUREGENERICP.
	  (scm_sys_bless_pure_generic_vtable_x): Remove; this flag isn't
	  checked.

	* module/oop/goops.scm: Don't call %bless-pure-generic-vtable!; there's
	  no need.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Remove TEST_CHANGE_CLASS
	* libguile/goops.c (TEST_CHANGE_CLASS): Remove unused macro and comment.

	Remove pure-generic?
	* libguile/goops.h:
	* libguile/goops.c (scm_pure_generic_p): Remove function only compiled
	  in debug mode.

	Goops slot-unbound / slot-missing cleanups
	* libguile/goops.c: Remove useless slot-unbound / slot-missing
	  captures.

	Move slot-ref et al to Scheme
	* libguile/goops.c:
	* module/oop/goops.scm (slot-ref-using-class, slot-set-using-class!):
	  (slot-bound-using-class?, slot-exists-using-class?, slot-set!):
	  (slot-bound?, slot-exists?): Move implementation to Scheme.

	Port method and generic accessors to Scheme
	* libguile/goops.c:
	* module/oop/goops.scm (generic-function-methods)
	  (method-generic-function, method-specializers, method-procedure): Port
	  to Scheme.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	<class> accessors implemented in Scheme
	* libguile/goops.c (scm_class_p): New internal helper, exported to
	  goops.scm.
	  (scm_class_name, scm_class_direct_supers, scm_class_direct_slots):
	  (scm_class_direct_subclasses, scm_class_direct_methods):
	  (scm_class_precedence_list, scm_class_slots): Dispatch to Scheme.
	  (scm_sys_goops_early_init): Capture <class> accessors.

	* module/oop/goops.scm (define-class-accessor): New helper.
	  (class-name, class-direct-supers, class-direct-slots):
	  (class-direct-subclasses, class-direct-methods)
	  (class-precedence-list, class-slots): Define in Scheme.
	  (compute-std-cpl, compute-cpl): Move lower.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	goops: use computed class slot offsets; untabify and fix whitepace
	* module/oop/goops.scm: Untabify and remove trailing whitespace.  Change
	  slot-ref on classes to struct-ref of fixed offsets.

	Statically compute offsets for slots of <class> in Scheme
	* module/oop/goops.scm (macro-fold-left): New helper.
	  (define-class-index): Define class-index-FOO for each slot FOO.
	  (fold-<class>-slots): Make the slots list have the marks of the
	  "visit" macro.

	Refactor to <class> slot computation
	* module/oop/goops.scm (macro-fold-right, fold-<class>-slots, <class>):
	  Use a macro folder to define (and redefine) class slots.  We'll use
	  this to compute static indices as well.

	Remove GOOPS random state
	* libguile/goops.c: Remove GOOPS random state, now that there are no
	  more hashsets.

	More goops.c cleanups, and fix a security issue
	* libguile/goops.c: Remove unused #includes.
	  (make_class_name): New helper, replaces unsafe use of sprintf.
	  (scm_make_extended_class): Rewrite to call scm_make_standard_class
	  directly.
	  (scm_make_port_classes): Rewrite to use scm_make_standard_class, and
	  no need to patch the CPL any more.

	Remove unused union scm_t_debug_info
	* libguile/debug.h (union scm_t_debug_info): Remove unused type
	  declaration.

	More unused code removal in GOOPS
	* libguile/goops.c: Remove unused sym_memoize_method_x.

	Remove private var_no_applicable_method capture
	* libguile/goops.c (var_no_applicable_method): Remove unused capture.
	  (sym_no_applicable_method): Remove unused symbol.

	Remove scm_assert_bound
	* libguile/goops.c (scm_assert_bound): Remove unexported unused helper.
	* module/oop/goops.scm (make-generic-bound-check-getter): Change
	  assert-bound use to use `unbound?'.

	Remove scm_at_assert_bound_ref
	* libguile/goops.c (scm_at_assert_bound_ref): Remove unused, unexported
	  function.

	Remove hashset slots from GOOPS classes
	* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, SCM_INSTANCE_HASH)
	  (SCM_SET_HASHSET):
	* libguile/goops.c (prep_hashsets, scm_sys_make_root_class,
	  scm_sys_init_layout_x):
	* module/oop/goops.scm (build-<class>-slots): Remove hashsets from
	  classes.  We haven't implemented hashed dispatch since Guile 1.8, and
	  it's not clear that the particular formulation of dispatch is a good
	  idea.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Deprecate C exports of GOOPS classes.
	* libguile/deprecated.h:
	  (scm_class_boolean, scm_class_char, scm_class_pair)
	  (scm_class_procedure, scm_class_string, scm_class_symbol)
	  (scm_class_primitive_generic, scm_class_vector, scm_class_null)
	  (scm_class_real, scm_class_complex, scm_class_integer)
	  (scm_class_fraction, scm_class_unknown, scm_class_top)
	  (scm_class_object, scm_class_class, scm_class_applicable)
	  (scm_class_applicable_struct, scm_class_applicable_struct_with_setter)
	  (scm_class_generic, scm_class_generic_with_setter, scm_class_accessor)
	  (scm_class_extended_generic, scm_class_extended_generic_with_setter)
	  (scm_class_extended_accessor, scm_class_method)
	  (scm_class_accessor_method, scm_class_procedure_class)
	  (scm_class_applicable_struct_class, scm_class_number, scm_class_list)
	  (scm_class_keyword, scm_class_port, scm_class_input_output_port)
	  (scm_class_input_port, scm_class_output_port, scm_class_foreign_slot)
	  (scm_class_self, scm_class_protected, scm_class_hidden)
	  (scm_class_opaque, scm_class_read_only, scm_class_protected_hidden)
	  (scm_class_protected_opaque, scm_class_protected_read_only)
	  (scm_class_scm, scm_class_int, scm_class_float)
	  (scm_class_double, scm_port_class, scm_smob_class): Deprecate.

	* libguile/deprecated.c:
	* libguile/goops.c:
	* libguile/goops.h: Adapt to deprecation.

	* libguile/goops.h
	* libguile/goops.c (scm_is_generic, scm_is_method): New interfaces.
	  (SCM_GENERICP, SCM_METHODP): Change to use new interfaces.

	* libguile/ports.c (scm_make_port_type):
	* libguile/smob.c (scm_make_smob_type, scm_set_smob_apply): Use internal
	  names for the port and smob class arrays.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Generics with setters have <applicable-struct-with-setter> layout
	* libguile/goops.c (scm_sys_set_object_setter_x): Remove.  Instead, we
	  use slot-set! of 'setter.
	  (scm_i_define_class_for_vtable): Move lower in the file, and fold in
	  scm_make_extended_class_from_symbol and make_class_from_symbol.
	  Properly handle applicable structs with setters.
	  (scm_class_applicable_struct_with_setter_class): New private capture.
	  (scm_sys_bless_applicable_struct_vtables_x): Rename to take two
	  arguments, and bless the second argument as an applicable struct with
	  setter vtable.
	  (scm_sys_goops_early_init): Capture setter classes.

	* libguile/deprecated.c (SPEC_OF, CPL_OF): Access slots by name, not by
	  index.
	  (applicablep, more_specificp): Adapt to use CPL_OF.
	  (scm_find_method): Access "methods" slot by name.

	* libguile/procs.c (scm_setter): Remove special case for generics; if
	  it's a setter, it will be a normal applicable struct.
	* module/oop/goops.scm (<applicable-struct-with-setter-class>)
	  (<applicable-struct-with-setter>): New classes.
	  (<generic-with-setter>): Now an instance of the setter metaclass and a
	  child of the setter class, so that the "setter" slot ends up in the
	  right place.
	  (<accessor>, <extended-generic-with-setter>, <extended-accessor>): Be
	  instances of the setter metaclass.
	  (<method>, <accessor-method>): Move definitions farther down.
	  (make): Use slot-set! when initializing setters here.
	  (initialize): Likewise for <applicable-struct-with-setter>.  Remove
	  specialization for <generic-with-setter>.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Remove unused CPP defines naming <method> slots
	* libguile/goops.h (scm_si_generic_function, scm_si_specializers)
	  (scm_si_procedure, scm_si_formals, scm_si_body)
	  (scm_si_make_procedure): Remove unused CPP defines.

	Remove unused `default-slot-definition-class' <class> slot
	* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, scm_si_slotdef_class)
	* module/oop/goops.scm (build-<class>-slots): Remove unused
	  `default-slot-definition-class' <class> slot.

	Remove useless scm_s_slot_set_x export
	* libguile/goops.c:
	* libguile/goops.h (scm_s_slot_set_x): Remove unused and useless
	  export.

	Remove unreachable code in scm_setter
	* libguile/procs.c (scm_setter): Remove unreachable code.

	Deprecate scm_no_applicable_method C export
	* libguile/deprecated.c (scm_init_deprecated_goops)
	  (scm_no_applicable_method):
	* libguile/goops.h:
	* libguile/goops.c (scm_no_applicable_method)
	  (scm_sys_goops_early_init): Deprecate scm_no_applicable_method C
	  export.

	Remove unused scm_t_method and SCM_METHOD
	* libguile/goops.h (scm_t_method, SCM_METHOD): Remove unused struct
	  type, typedef, and macro.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Fold GOOPS compile and dispatch modules into main GOOPS module
	* libguile/goops.c (scm_sys_invalidate_method_cache_x): Remove C
	  interface to this internal method.  Instead, internal callers are all
	  from Scheme, so we move the implementation to Scheme.
	  (scm_make): Dispatch to `make' in Scheme.  This is an incompatible but
	  great change, as it fulfills the common user perception that scm_make
	  is the same as GOOPS's `make'.
	  (scm_sys_goops_early_init): Capture `make'.
	  (scm_no_applicable_method): Define in Scheme and capture in C.

	* module/Makefile.am: Remove oop/goops/compile.scm and
	  oop/goops/dispatch.scm.

	* module/oop/goops/compile.scm:
	* module/oop/goops/dispatch.scm: Fold into goops.scm.

	* module/oop/goops.scm: Fold in the generic compile and dispatch
	  modules.  This eliminates a circularity that caused some eval-when
	  shenanigans, so remove the eval-whens as well.  Reimplement the boot
	  version of `make' in Scheme, and make the <generic> `initialize'
	  method handle invalidation instead of the generic %allocate-instance.
	  (no-applicable-method): Define here.  Import the utils module in the
	  normal define-module block.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Remove unused *goops-module* definition.
	* module/oop/goops.scm (*goops-module*): Remove.

	define-generic, define-extended-generic are hygienic syntax
	* module/oop/goops.scm (define-generic, define-extended-generic):
	  (define-extended-generics): Reimplement using syntax-case.

	`class' is a hygienic macro
	* module/oop/goops.scm (class): Rewrite as a hygienic macro.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Deprecate scm_basic_make_class
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_basic_make_class): Deprecate.

	* libguile/goops.c:
	* libguile/goops.h (scm_make_standard_class): New internal helper.  It's
	  a better spelling, as it matches make-standard-class, and is internal
	  so as not to cause confusion between boot GOOPS helpers and "real"
	  GOOPS interfaces.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Move GOOPS boot to Scheme
	* module/oop/goops.scm (build-<class>-slots): New helper, replacing
	  build_class_class_slots.
	  (build-slots-list, %compute-getters-n-setters, %compute-layout): New
	  private helpers, moved here from C.
	  (%prep-layout!): Reimplement in Scheme.
	  (make-standard-class): New private helper, replacing
	  scm_basic_make_class.
	  (<class>, <top>, <object>): Define in Scheme.

	  (<foreign-slot>, <protected-slot>, <hidden-slot>, <opaque-slot>,
	   <read-only-slot>, <self-slot>, <protected-opaque-slot>,
	   <protected-hidden-slot>, <protected-read-only-slot>, <scm-slot>,
	   <int-slot>, <float-slot>, <double-slot>, <procedure-class>,
	   <applicable-struct-class>, <method>, <accessor-method>, <applicable>,
	   <applicable-struct>, <generic>, <extended-generic>,
	   <generic-with-setter>, <accessor>, <extended-generic-with-setter>,
	   <extended-accessor>): Define in Scheme.

	  (<boolean>, <char>, <list>, <pair>, <null>, <string>, <symbol>,
	   <vector>, <foreign>, <hashtable>, <fluid>, <dynamic-state>, <frame>,
	   <vm-continuation>, <bytevector>, <uvec>, <array>, <bitvector>,
	   <number>, <complex>, <real>, <integer>, <fraction>, <keyword>,
	   <unknown>, <procedure>, <primitive-generic>, <port>, <input-port>,
	   <output-port>, <input-output-port>): Define in Scheme.

	  (compute-slots): Use build-slots-list helper.

	* libguile/goops.h:
	* libguile/goops.c (scm_basic_basic_make_class, scm_sys_compute_slots)
	  (scm_sys_prep_layout_x): Remove.  These were available to C, but were
	  undocumented internals that were dangerous, confusing, and
	  unnecessary.

	* libguile/goops.c: Add note about variable versus value references.
	  Remove internal C routines that were just used during boot, as they
	  have been moved to Scheme.
	  (scm_basic_make_class): Change to call out to make-standard-class in
	  Scheme.
	  (scm_sys_make_root_class, scm_sys_bless_applicable_struct_vtable_x)
	  (scm_sys_bless_pure_generic_vtable_x, scm_sys_init_layout_x): New
	  private helpers.
	  (scm_sys_goops_early_init): Change to capture values defined in
	  Scheme.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Remove declarations without definitions
	* libguile/goops.h: Remove declarations for scm_oldfmt, scm_c_oldfmt0,
	  and scm_c_oldfmt.  These symbols were not defined.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Remove unused %fast-slot-ref / %fast-slot-set! from GOOPS
	* libguile/goops.h:
	* libguile/goops.c (scm_sys_fast_slot_ref, scm_sys_fast_slot_set_x):
	  Remove these unused, unsafe functions.  They were publically available
	  only to C.

	* module/oop/goops/active-slot.scm (compute-get-n-set): Update to use
	  struct-ref / struct-set! instead of %fast-slot-ref / %fast-slot-set!
	  from (oop goops internal).

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Preparation for more GOOPS refactorings
	* libguile/goops.c (scm_sys_goops_early_init)
	  (scm_init_goops_builtins): Factor out some initialization to a
	  separate helper.  This will be the base for moving more things from C
	  to Scheme in the future.

	* module/oop/goops.scm: Call %goops-early-init.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	%init-goops-builtins is an extension, not a global
	* libguile/goops.h:
	* libguile/goops.c (scm_init_goops, scm_init_goops_builtins): Move
	  %init-goops-builtins to be an extension instead of a globally
	  accessible function.

	* module/oop/goops.scm: Adapt.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	compute-cpl implementation only in Scheme
	* libguile/goops.c (build_class_class_slots, create_basic_classes):
	  Instead of creating <class> with uninitialized `direct-slots',
	  `slots', and `getters-n-setters' fields and initializing them later,
	  create <class> with a "boot" version of unspecialized slots and later
	  replace the fields with specialized slot classes.  This allows
	  slot-ref to work during early boot, which is necessary to move
	  compute-cpl to Scheme.
	  (create_standard_classes): Finish initializing <class> here.
	  (map, filter_cpl, compute_cpl): Remove the boot-time compute-cpl in C
	  and its helpers.
	  (scm_basic_basic_make_class): Call compute-cpl in Scheme.
	  (fix_cpl): Remove; since we use the correct compute-cpl from the
	  beginning, there's no need to correct for the deficiencies of the C
	  implementation any more.
	  (build_slots_list): Adapt to build_class_class_slots change.

	* module/oop/goops.scm (compute-std-cpl, compute-cpl): Move these up to
	  the top, so they can be called by the boot process.
	  (compute-clos-cpl, top-sort, std-tie-breaker, build-transitive-closure)
	  (build-constraints): Remove unused private code.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	More useless goops.c code removal
	* libguile/goops.c: Remove needless scm_sym_define_public definition.

	Remove unused macros in goops.c
	* libguile/goops.c (NXT_MTHD_METHODS, NXT_MTHD_ARGS): Remove unused
	  macros.

	Rewrite %method-more-specific? to be in Scheme
	* libguile/goops.h:
	* libguile/goops.c (more_specificp, scm_sys_method_more_specific_p):
	* module/oop/goops.scm (%method-more-specific?): Rewrite in Scheme.  We
	  remove the scm_sys_method_more_specific_p interface as it is a private
	  interface and it's not extensible.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Deprecate C interfaces scm_compute_applicable_methods, scm_find_method
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_compute_applicable_methods): Deprecate.
	  This was the boot version of compute-applicable-methods, not the full
	  version; the right thing to do is to call scheme.
	  (scm_find_method): Deprecate.  Again, the right thing is to do this on
	  the Scheme level.

	* libguile/goops.c:
	* libguile/goops.h: Deprecated code moved to deprecated.[ch].

2015-01-23  Andy Wingo  <wingo@pobox.com>

	%compute-applicable-methods in Scheme
	* libguile/goops.c: Move %compute-applicable-methods to Scheme.
	  (scm_sys_goops_loaded): No need to initialize
	  var_compute_applicable_methods.
	* libguile/goops.h (scm_sys_compute_applicable_methods): Remove.  This
	  was internal so it shouldn't cause a problem.

	* module/oop/goops.scm (%sort-applicable-methods):
	  (%compute-applicable-methods): New definitions.

2015-01-23  Andy Wingo  <wingo@pobox.com>

	Mark two coverage tests as XFAIL
	* test-suite/tests/coverage.test ("several times", "one proc hit, one
	  proc unused"): Mark as XFAIL until we can fix either the expander or
	  the compiler to have proper source info.

	Fix the assembler for unexpected source properties
	* module/system/vm/assembler.scm (link-debug): Fix for source properties
	  that don't have line and column, as are currently being produced by
	  the new lalr.

2015-01-22  Andy Wingo  <wingo@pobox.com>

	Merge commit '5b7632331e7551ac202bbaba37c572b96a791c6e'
	Conflicts:
		module/oop/goops.scm

	Merge commit 'ed72201a795ac1c8d6c0288b6bb710f2bd0ebd9c'
	Conflicts:
		test-suite/tests/r6rs-ports.test

	Merge commit '01a301d1b606b84d986b735049e7155d2f4cd6aa'
	Conflicts:
		libguile/hash.c

	Merge commit '894d0b894daae001495c748b3352cd79918d3789'
	Conflicts:
		libguile/hash.c

	Merge commit '5943a62042432b86d757200ef595d7aebb5c9bac'

	Merge commit '37b1453032488de582175270d1b3a1653ea81457'

	Merge commit 'cdcba5b2f6270de808e51b3b933374170611b91d'
	Conflicts:
		module/statprof.scm

2015-01-22  Ludovic Courtès  <ludo@gnu.org>

	Really disable stack underflow checks when VM_CHECK_UNDERFLOW == 0.
	* libguile/vm-engine.h: Use '#if VM_CHECK_UNDERFLOW' instead of
	  '#ifdef'.

2015-01-22  Andy Wingo  <wingo@pobox.com>

	Merge commit '5d971db802eaa8038db17e1aa5b4c69452739744'
	Conflicts:
		libguile/ports.c

	Merge commit '47ca15c7dffd14a82e75c1a0aeeaf2e77f3fa5b4'

	Merge commit '7c433cbbce83bc9f2f9967afba00bbb68e312657'
	Conflicts:
		meta/Makefile.am

	Merge commit '5fac1a7ada362d78f13143acbc0ceca7f2f101de'
	Conflicts:
		configure.ac
		doc/ref/libguile-parallel.texi

	Merge commit '8cf2a7ba7432d68b9a055d29f18117be70375af9'

	Merge commit '81d2c84674f03f9028f26474ab19d3d3f353881a'
	Some fixups in bytevectors.c.

	Merge commit 'fdd319e9bd4121d844662d3d8ccc69b462b60840'

	Merge commit 'a7bbba05838cabe2294f498e7008e1c51db6d664'

2015-01-22  Andy Wingo  <wingo@pobox.com>

	Keywords have a tc7
	* libguile/tags.h (scm_tc7_keyword): Allocate a tc7, so that the VM can
	  have cheap keyword? tests.

	* libguile/keywords.c:
	* libguile/keywords.h: Adapt.

	* libguile/goops.c (scm_class_of, scm_sys_goops_early_init): Capture
	  <keyword>.

	* libguile/print.c (iprin1): Inline keyword printer.

	* libguile/evalext.c (scm_self_evaluating_p): Add keywords here.

	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_tc16_keyword): Deprecate.

	* module/language/cps/compile-bytecode.scm (compile-fun): Add keyword?
	  case, and bitvector? case while we're at it.
	* module/language/cps/effects-analysis.scm (define-primitive-effects):
	  Add bytevector?, keyword?, and bitvector? cases.

	* module/language/cps/primitives.scm (*branching-primcall-arities*): Add
	  keyword?.

	* module/language/cps/types.scm (bitvector?, keyword?, bytevector?): Add
	  branch inferrers.

	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect-free-primitives*):
	  (*effect+exception-free-primitives*): Add bytevector?, keyword?, and
	  bitvector?.

	* module/oop/goops.scm (<keyword>): New class.

	* module/system/base/types.scm (%tc7-keyword, cell->object): Add cases.

	* module/system/vm/assembler.scm (br-if-keyword): New definition.
	* module/system/vm/disassembler.scm (code-annotation): Add br-if-tc7
	  case for keywords.

	* test-suite/tests/types.test ("clonable objects"): Update now that
	  keywords are cloneable.

2015-01-22  Andy Wingo  <wingo@pobox.com>

	Add allocate-struct, struct-ref, struct-set! instructions
	* libguile/vm-engine.c (allocate-struct, struct-ref, struct-set!): New
	  instructions, to complement their "immediate" variants.

	* module/language/cps/compile-bytecode.scm (compile-fun):
	* module/system/vm/assembler.scm (system): Wire up the new instructions.

2015-01-22  Andy Wingo  <wingo@pobox.com>

	Merge commit '5af307de43e4b65eec7f235b48a8908f2a00f134'
	Conflicts:
		test-suite/tests/reader.test

	Merge commit 'b1451ad859183ae48c624d19ec144306bd2d3e3a'

2015-01-22  Andy Wingo  <wingo@pobox.com>

	Fix #:init-value on class-allocated slots
	Allocating an instance of a class with a #:class or #:each-subclass slot
	allocation should not re-initialize the class-allocated slot.  In Guile
	1.8, this worked by effectively doing a slot-bound? within
	%initialize-object.  In Guile 2.0 we instead initialize the slot when it
	is allocated -- in compute-get-n-set.

	* module/oop/goops.scm (compute-getters-n-setters): Don't set an
	  init-thunk for class-allocated slots.
	  (compute-get-n-set): Initialize class-allocated slots here, if an
	  init-thunk or init-value are present.

	* test-suite/tests/goops.test ("#:each-subclass"): Add test.

2015-01-19  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Update documentation on jit_frame and jit_tramp
		* doc/body.texi: Reorder documentation, making jit_frame
		and jit_tramp the lightning response to the need of
		trampolines, continuations and tail call optimizations.
		A pseudo code example of a factorial function was added.
		Also added a section for description of the available
		predicates.

		* doc/fact.c: New file, implementing a simple example of
		a translation of a trivial, recursive, tail call optimization
		into lightning calls. This is the conversion to functional C
		code of the example in doc/body.texi.

		* doc/Makefile.am: Update for the next test case.

2015-01-18  Ludovic Courtès  <ludo@gnu.org>

	Fix buffer overrun with unbuffered custom binary input ports.
	Fixes <http://bugs.gnu.org/19621>.

	Before that, in 'cbip_fill_input', BUFFERED would be set to 0 when
	reading from 'scm_getc' et al, because 'shortbuf' was being used.  Thus,
	we could eventually execute this line:

	      /* Copy the data back to the internal buffer.  */
	      memcpy ((char *) c_port->read_pos, SCM_BYTEVECTOR_CONTENTS (bv),
		      c_octets);

	But 'read_pos' would quickly point to the fields beyond 'shortbuf',
	thereby leading to a corruption of the 'scm_t_port' itself.

	* libguile/r6rs-ports.c (cbip_setvbuf): When READ_SIZE is 0, keep using
	  BV as the 'read_buf'.
	  (cbip_fill_input): Adjust assertion to accept 'read_buf_size = 1'.
	* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports")["custom binary
	  input port unbuffered & 'get-string-all'", "custom binary input port
	  unbuffered UTF-8 & 'get-string-all'"]: New tests.

2015-01-18  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement the jit_arg_register_p predicate.
		* include/lightning.h, lib/jit_aarch64.c,
		lib/jit_alpha.c, lib/jit_arm-vfp.c, lib/jit_arm.c,
		lib/jit_hppa.c,	lib/jit_ia64.c, lib/jit_mips.c,
		lib/jit_ppc.c, lib/jit_s390.c, lib/jit_sparc.c,
		lib/jit_x86.c: Add the new jit_arg_register_p predicate.
		The predicate is expected to be used to know if an
		argument is in a register, what would need special
		handling if code that can overwrite non callee save
		registers is executed.

		* check/carg.c: New test case to check consistency and
		expected usage of jit_arg_register_p.

		* check/Makefile.am: Update for new test case.

2015-01-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Remove inconsistent, public jit_arg_reg_p macro
		* include/lightning/jit_aarch64.h,
		include/lightning/jit_alpha.h,
		include/lightning/jit_arm.h,
		include/lightning/jit_hppa.h,
		include/lightning/jit_mips.h,
		 include/lightning/jit_ppc.h,
		include/lightning/jit_s390.h,
		include/lightning/jit_sparc.h,
		include/lightning/jit_x86.h,
		lib/jit_aarch64.c, lib/jit_alpha.c,
		lib/jit_arm.c, lib/jit_hppa.c,
		lib/jit_ia64.c, lib/jit_mips.c,
		lib/jit_ppc.c, lib/jit_s390.c,
		lib/jit_sparc.c, lib/jit_x86.c: Remove jit_arg_reg_p and
		jit_arg_f_reg_p from a public header, and define it only
		on port specific files where an integer offset is used
		to qualify an argument identifier. Exported code expects
		an opaque pointer (but of jit_node_t* type) to "qualify"
		an argument identifier.
		This patch, and the code review/simplification done during
		it also corrected some bugs:
		o Inconsistent jit_arg_d value of double argument after 3
		  integer arguments in arm for jit_functions; tested, C
		  functions were being properly called.
		o Inconsistent use of getarg_{f,d} and putarg*_{f,d} on
		  s390 (32-bit) that happened to not have a proper test
		  case, as it would only happen for jit functions, and
		  tested, called C functions had proper arguments.
		o Corrected a "last minute" correction that did not go
		  to the committed version, and would not compile on hppa,
		  due to bad _jit_putargi_d prototype definition.

	Update documentation
		* doc/body.texi: Correct wrong/outdated information for
		hton*, pusharg* and ret*, and add missing documentation
		for rsb*, qmul*, qdvi* and putarg*.

2015-01-15  Paulo Andrade  <pcpa@gnu.org>

	PPC: Only call binutils function if it is available
		* configure.ac, lib/jit_disasm.c: Rewrite workaround
		to apparent problem to initialize powerpc disassembler.

	Correct typo.

2015-01-15  Paulo Andrade  <pcpa@gnu.org>

	Implement jit_putarg*
		* include/lightning.h, lib/jit_aarch64.c,
		lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
		lib/jit_ia64.c, lib/jit_mips.c,	lib/jit_ppc.c,
		lib/jit_s390.c, lib/jit_sparc.c, lib/jit_x86.c:
		Implement jit_putarg*. It works as a mix of jit_getarg*
		and jit_pusharg*, in the way that the first argument is
		a register or immediate, and the second is a pointer
		returned by jit_arg*. The use of the interface is to change
		values of arguments to the current jit function.

		* check/put.ok, check/put.tst: New test cases exercising
		the new jit_putarg* interface.

		* check/Makefile.am, check/lightning.c: Update for the
		new test case and interface.

2015-01-13  Ludovic Courtès  <ludo@gnu.org>

	Improve output of command-line errors.
	* module/ice-9/command-line.scm (shell-usage): Add 'newline' call when
	  FMT is true.
	  (compile-shell-switches)[error]: Prepend "error: " and append "~%" to
	  FMT.
	  Use a lower-case message.

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

	Optimize 'string-hash'.
	This yields a 50% improvement on the "narrow string" benchmark of
	'hash.bm', 41% on "wide string", and 76% on "long string".

	* libguile/hash.c (scm_i_string_hash): Rewrite to avoid
	  'scm_i_string_ref' calls.

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

	Add 'string-hash' benchmarks.
	* benchmark-suite/benchmarks/hash.bm: New file.
	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add it.

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

	Deprecate 'scm_string_hash'.
	This function has been unused internally for some time and is undocumented.

	* libguile/hash.c (scm_string_hash): Wrap if #if SCM_ENABLE_DEPRECATED
	  == 1.
	* libguile/hash.h (scm_string_hash): Likewise, and replace SCM_API with
	  SCM_DEPRECATED.

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

	Optimize 'write' for strings.
	This shows a 19% improvement on the "string without escapes"
	micro-benchmark of 'write.bm', and 12% on "string with escapes".

	* libguile/print.c (iprin1) <scm_tc7_string>: Replace 'scm_i_string_ref'
	  loop with a call to 'write_string'.
	  (display_character): Adjust description of return value in comment.
	  (write_string): New function.

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

	Avoid converting the 'mode' argument of 'open-file'.
	* libguile/fports.c (scm_open_file_with_encoding): const-qualify 'md'
	  and 'ptr'.  Add call to 'scm_i_try_narrow_string'.  Use
	  'scm_i_string_chars' instead of 'scm_to_locale_string' plus '
	  scm_dynwind_free'.
	* test-suite/tests/ports.test ("invalid wide mode string",
	  "valid wide mode string"): New tests.

	statprof: 'statprof' and 'with-statprof' return the code's return values.
	* module/statprof.scm (statprof): Return the return values of THUNK.
	  (with-statprof): Adjust docstring accordingly.
	* test-suite/tests/statprof.test ("return values"): New test.
	* doc/ref/statprof.texi (Statprof): Adjust accordingly.

2015-01-09  Ludovic Courtès  <ludo@gnu.org>

	Improve deprecation message of 'scm_add_to_port_table'.
	Reported by Thien-Thi Nguyen <ttn@gnu.org>.

	* libguile/ports.c (scm_add_to_port_table): Mention
	  'scm_new_port_table_entry'.

2015-01-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	S390: Replace s390x filenames with s390
		* include/lightning/jit_s390.h, lib/jit_s390-cpu.c,
		lib/jit_s390-fpu.c, lib/jit_s390-sz.c, lib/jit_s390.c:
		Renamed s390x* files to s390*.

		* check/float.tst, check/lightning.c, configure.ac,
		include/lightning.h, include/lightning/Makefile.am,
		lib/Makefile.am, lib/jit_s390.c, lib/jit_size.c,
		lib/lightning.c: Update for renamed files.

2015-01-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	S390: Add support for 32 bit.
	        * include/lightning.h, include/lightning/jit_private.h,
	        include/lightning/jit_s390x.h, lib/jit_disasm.c,
	        lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
	        lib/jit_s390x.c, lib/jit_size.c, lib/lightning.c:
		Add support for generating jit for s390 32 bit. This change
		also removed %f15 from the list of temporaries fpr registers;
		it was not being used, but if were, it would corrupt the
		stack frame because the spill address would overwrite grp
		offsets.

2014-12-26  Paulo Andrade  <pcpa@gnu.org>

	PPC: Build and pass all tests in powerpcle
		* lib/jit_ppc-cpu.c, lib/jit_ppc.c: Correct some endianess issues
		on the powerpc le backend.

	PPC: Implement and use mcrxr emulation by default
		* lib/jit_ppc-cpu.c: Add mcrxr instruction emulation,
		as this instruction has been phased out, and should be
		implemented as a kernel trap.

2014-12-26  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	ARM: Better check for constants offset overflow
		* lib/jit_arm.c: Better check for need to flush constants
		before the pool being no longer reachable.

	Implement new, typed, jit_htonr* interfaces
		* include/lightning.h: Split jit_htonr in the new 3 interfaces
		jit_htonr_us, jit_htonr_ui and jit_htonr_ul, the later only
		available on 64 bit. The plain/untyped jit_htonr macro call
		maps to the wordsize one.
		* lib/jit_aarch64-cpu.c,  lib/jit_aarch64-sz.c, lib/jit_aarch64.c,
		lib/jit_alpha-cpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c,
		lib/jit_arm-cpu.c, lib/jit_arm-sz.c, lib/jit_arm.c,
		lib/jit_hppa-cpu.c, lib/jit_hppa-sz.c, lib/jit_hppa.c,
		lib/jit_ia64-cpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
		lib/jit_mips-cpu.c, lib/jit_mips-sz.c, lib/jit_mips.c,
		lib/jit_ppc-cpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
		lib/jit_s390x-cpu.c, lib/jit_s390x-sz.c, lib/jit_s390x.c,
		lib/jit_sparc-cpu.c, lib/jit_sparc-sz.c, lib/jit_sparc.c,
		lib/jit_x86-cpu.c, lib/jit_x86-sz.c, lib/jit_x86.c:
		Update backends for the new jit_htonr*.
		* check/lightning.c, lib/jit_names.c, lib/lightning.c:
		Update for the new jit_htonr* interfaces.
		* check/Makefile.am: Update for new test cases.
		* check/hton.ok, check/hton.tst: New test cases.

2014-12-24  Paulo Andrade  <pcpa@gnu.org>

	x86: Implement support for the x32 abi
		* include/lightning/jit_private.h, include/lightning/jit_x86.h,
		lib/jit_disasm.c, lib/jit_x86-cpu.c, lib/jit_x86-sse.c,
		lib/jit_x86-sz.c, lib/jit_x86-x87.c, lib/jit_x86.c,
		size.c: Implement support for the x32 abi. Built and
		tested on Gentoo default/linux/amd64/13.0/x32 profile.

	Add missing float rsbi strings

2014-12-22  Paulo Andrade  <pcpa@gnu.org>

	ARM: Flush cache page by page
		* lib/jit_arm.c: Call __clear_cache for every page.
		This should only be required for older boards or
		toolchain setup, but has been reported to be required
		for lightning at some point.

	ARM: Correct constants offset check
		* lib/jit_arm.c: Correct check to guard overflow of index
		of constants from program counter.

2014-12-16  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add missing ellipsis mark to align.tst

2014-12-14  Mark H Weaver  <mhw@netris.org>

	Assembler: Cope with non-string port filenames.
	Fixes <http://bugs.gnu.org/19354>.
	Reported by Linas Vepstas <linasvepstas@gmail.com>.

	* module/system/vm/assembler.scm (write-sources): Intern the filename
	  only if it's a string.  (For sockets, the filename is a symbol).

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

	Convert primitive-eval to "compile" its expressions to linked closures
	* libguile/memoize.c (memoize): Fix meta on subsequent case-lambda
	  clauses.

	* module/ice-9/eval.scm (primitive-eval): Rewrite to compile expressions
	  to thunks, to avoid runtime dispatch cost.

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

	Fix syntax.test
	* test-suite/tests/syntax.test (exception:variable-ref): Change expected
	  error.

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

	Minor evaluator tweaks
	* libguile/eval.c (eval): Remove unused variable.
	* libguile/memoize.c (unmemoize): Fix unmemoization.
	* module/ice-9/eval.scm: Attempt to speed up common box-ref cases.

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

	Simplify variable resolution in the evaluator
	* libguile/expand.c (convert_assignment): Handle creation of the default
	  lambda-case body here.

	* libguile/eval.c (eval):
	* module/ice-9/eval.scm (primitive-eval):

	* libguile/memoize.h:
	* libguile/memoize.c (MAKMEMO_BOX_REF, MAKMEMO_BOX_SET):
	  (MAKMEMO_TOP_BOX, MAKMEMO_MOD_BOX): Refactor all global var resolution
	  to go through "resolve".  Add "box-ref" and "box-set!".  Rename
	  memoize-variable-access! to %resolve-variable, and don't be
	  destructive.

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

	Closure conversion in evaluator
	* libguile/memoize.c (MAKMEMO_CAPTURE_ENV, push_nested_link)
	  (push_flat_link, env_link_is_flat, env_link_vars)
	  (env_link_add_flat_var, lookup, capture_flat_env, memoize): Capture
	  flat environments around closures.

2014-12-06  Andy Wingo  <wingo@pobox.com>

	Add capture-env to evaluator
	* libguile/eval.c (eval):
	* libguile/memoize.c (memoized_tags, unmemoize):
	* libguile/memoize.h (SCM_M_CAPTURE_ENV):
	* module/ice-9/eval.scm (primitive-eval): Add capture-env memoized
	  expression type.

2014-12-06  Ludovic Courtès  <ludo@gnu.org>

	build: Better handle substitutions in 'guile-2.0.pc' & co.
	* meta/Makefile.am (dependency_substitutions): Use '|' as the separate
	  instead of ','.  See <http://hydra.nixos.org/build/17684751>.

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

	Simplify the interpreter for trivial inits and no letrec
	* libguile/memoize.c (FULL_ARITY): Serialize "ninits" and the unbound
	  value instead of the init list.
	  (memoize): Adapt to FULL_ARITY changes.  Remove LETREC case.
	  (unmemoize): Adapt to memoized code change.

	* libguile/eval.c (BOOT_CLOSURE_PARSE_FULL): Adapt to parse ninits and
	  unbound instead of inits.
	  (eval): Lexical-ref can no longer raise an error.
	  (prepare_boot_closure_env_for_apply): Adapt to inits change.

	* module/ice-9/eval.scm (primitive-eval): Adapt to ninits/unbound
	  change.

	* libguile/expand.c (expand_named_let): Fix lambda-case creation to make
	  lists for opt and inits.

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

	Assignment conversion in the interpreter
	* libguile/expand.c (compute_assigned, convert_assignment)
	  (scm_convert_assignment): New functions.

	* libguile/expand.h: Declare scm_convert_assignment.

	* libguile/memoize.c (scm_memoize_expression): Do assignment conversion
	  before memoization.

	* test-suite/tests/syntax.test ("letrec"): Detection of unbound letrec
	  variables now works.

2014-12-03  Ludovic Courtès  <ludo@gnu.org>

	build: Add missing substitutions for 'guile-2.0.pc'.
	This is a followup to 5fac1a7.

	* meta/Makefile.am (substitute): Add GUILE_* and LIBGUILE_* substitutions,
	  and $(dependency_substitutions).
	  (dependency_substitutions): New variable.

2014-12-03  Ludovic Courtès  <ludo@gnu.org>

	doc: Clarify the unit of the 'offset' argument of 'seek'.
	Reported in <http://bugs.gnu.org/18520>
	by David Kastrup <dak@gnu.org>.

	* doc/ref/api-io.texi (Random Access): Clarify the unit of the 'offset'
	  argument to 'seek'.

2014-12-03  Ludovic Courtès  <ludo@gnu.org>

	Add the 'guild' and 'guile' variables to 'guile-2.0.pc'.
	* configure.ac: Remove meta/guile-2.0.pc and
	  meta/guile-2.0-uninstalled.pc from 'AC_CONFIG_FILES'.
	* meta/Makefile.am (substitute): New variable.
	  (guile-2.0.pc, guile-2.0-uninstalled.pc): New targets.
	  (guile-config, guild): Use $(substitute) instead of duplicated sed
	  script.
	  (CLEANFILES): Add the .pc files.
	* meta/guile-2.0.pc.in (bindir, guild, guile): New variables.
	* doc/ref/libguile-parallel.texi (Parallel Installations): Document the
	  'guild' and 'guile' pkg-config variables.

2014-12-02  Ludovic Courtès  <ludo@gnu.org>

	Update (system base lalr) from upstream.
	Suggested by Jan Nieuwenhuizen <janneke@gnu.org>.

	* module/system/base/lalr.upstream.scm: Update from
	  <https://github.com/schemeway/lalr-scm.git>, commit 4c4f149.

2014-12-02  Ludovic Courtès  <ludo@gnu.org>

	doc: Tell when 'GUILE_INSTALL_LOCALE' first appeared.
	* doc/ref/guile-invoke.texi (Environment Variables): Add footnote about
	  the Guile version where 'GUILE_INSTALL_LOCALE' appeared.

2014-12-02  Chris Jester-Young  <cky944@gmail.com>

	Implement SRFI 28: Basic Format Strings.
	* module/srfi/srfi-28.scm: New module.
	* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-28.scm.
	* doc/ref/srfi-modules.texi (SRFI-28): New node.

2014-11-24  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Remove a wrong optimization of callee save registers

2014-11-21  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct bogus git entry

	PPC: Add initial powerpc le support.

2014-11-20  Ludovic Courtès  <ludo@gnu.org>

	doc: Clarify behavior of 'select' in the presence of signal interruptions.
	Fixes <http://bugs.gnu.org/18988>.
	Reported by Chris Vine <chris@cvine.freeserve.co.uk>.

	* libguile/filesys.c (scm_select): Clarify handling of signal
	  interruptions.
	* doc/ref/posix.texi (Ports and File Descriptors): Adjust accordingly.

2014-11-20  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	ARM: Correct several inconsistencies with ldrd and strd
		* lib/jit_disasm.c: Change thumb or arm disassemble based on
		jit code before disassembly.

		* lib/jit_arm-cpu.c: Correct reversed arguments to LDRD and
		STRD instructions, and correct checking for support of those.

		* lib/jit_arm-swf.c: Correct wrong use of LDRD and STRD and
		only use those if the register is even.

		* check/check.arm.swf.sh, check/check.arm4.swf.sh: New files
		to test LDRD and STRD, as well as the alternate code path
		when those are not available, in the .arm4. test case.

		* check/Makefile.am: Update for the new test cases.

2014-11-19  Rob Browning  <rlb@defaultvalue.org>

	Recognize m68k, s390x, and sh4 as compilation targets
	* module/system/base/target.scm (cpu-endianness, triplet-pointer-size):
	  Add cases for "m68k", "sh4", and "s390x".

2014-11-12  Mark H Weaver  <mhw@netris.org>

	Fix bytevector-fill! to accept fill arguments greater than 127.
	Fixes <http://bugs.gnu.org/19027>.

	* libguile/bytevectors.c (scm_bytevector_fill_x): Accept fill arguments
	  between -128 and 255.

	* test-suite/tests/bytevectors.test ("2.2 General Operations"): Add
	  tests.

2014-11-12  Mark H Weaver  <mhw@netris.org>

	Avoid signed overflow and use size_t in bytevectors.c.
	* libguile/bytevectors.c (ULONG_MAX): Remove (unportable) fallback
	  definition.  It is no longer used.
	  (scm_make_bytevector): Use 'size_t' instead of 'unsigned' for
	  indices.  Use 'scm_t_uint8' instead of 'signed char' for elements
	  and c_fill.  Previously relied on GNU-C-specific behavior when
	  casting integers in the range 128-255 to signed char.
	  (GENERIC_INTEGER_ACCESSOR_PROLOGUE, INTEGER_LIST_TO_BYTEVECTOR)
	  (scm_bytevector_eq_p, scm_bytevector_copy_x, scm_bytevector_copy)
	  (scm_bytevector_to_u8_list, scm_u8_list_to_bytevector)
	  (scm_bytevector_fill_x): Use 'size_t' instead of 'unsigned' for
	  indices.  Use 'scm_t_uint8' for elements.

	Add SCM_VALIDATE_SIZE_COPY and SCM_NUM2SIZE.
	* libguile/validate.h (SCM_VALIDATE_SIZE_COPY, SCM_NUM2SIZE): New
	  macros.

2014-11-12  Mark H Weaver  <mhw@netris.org>

	Fix bytevector-copy when applied to SRFI-4 homogeneous numeric vectors.
	Fixes <http://bugs.gnu.org/18866>.
	Reported by tantalum <sph@posteo.eu>.

	* libguile/bytevectors.c (scm_bytevector_copy): Always create a VU8
	  bytevector.

	* test-suite/tests/bytevectors.test: Add test.

2014-11-12  Thomas Klausner  <wiz@NetBSD.org>

	Avoid bash-specific '==' comparison operator in guile.m4.
	Fixes <http://bugs.gnu.org/18898>.

	* meta/guile.m4 (GUILE_PROGS): Use '=' instead of the bash-specific '=='
	  comparison operator in 'test' call.

2014-11-12  Mark H Weaver  <mhw@netris.org>

	Fix strerror error handling when given a non-integer argument.
	Fixes <http://bugs.gnu.org/18065>.
	Reported and fixed by Glenn Michaels <gmichaels@Safe-mail.net>.

	* libguile/error.c (scm_strerror): Convert the argument to a C integer
	  outside of the critical section, to avoid deadlock on error.
	* THANKS: Add Glenn Michaels to the fixes section.

2014-11-09  Andy Wingo  <wingo@pobox.com>

	texinfo: fix @url{@@} parsing
	* module/texinfo.scm (texi-command-specs): The body of @url{} can have
	  texinfo commands.

	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add tests.

2014-11-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement jit_flush
		* include/lightning/jit_private.h, lib/jit_aarch64.c,
		lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c,
		lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
		lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c:
		Implement a private jit_flush call, that flushes
		the cache, if applicable, aligning down to the
		previous and up to the next page boundary.

2014-11-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add test case to check possible issues with 2 contexts
		* check/ctramp.c: New file. It just repeats the test
		of tramp.tst, but using two jit_state_t, what should
		test possible issues with two contexts, and also validate
		jit_tramp works on backends with function descriptions.

		* check/Makefile.am: Update for new test case.

2014-11-03  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	mips: Do not make t9 available as a generic register
		* include/lightning/jit_mips.h: Do not make the t9 register
		JIT_R11 (or JIT_R7 for n32 or n64 abi) available. Previously
		it cause problems if one expects it to not be changed in a
		function call. For example, calling a jit function, where it
		really does not need to be changed.

2014-11-02  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Resync with new patch to make functions receive a const argument

2014-11-02  Holger Hans Peter Freyther  <holger@moiji-mobile.com>

	cross: Provide the action for the cross compiling case
	Assume that the functionality is not present

2014-11-01  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Update THANKS file

	Force creation of the m4 directory on a clean checkout

	Actually install the pkgconfig file.

2014-11-01  Holger Hans Peter Freyther  <holger@moiji-mobile.com>

	misc: Create a pkg-config file
	Make it more easy to find GNU lightning. Create and install
	a pkg-config file.

	misc: Enable silent rules to make warnings stick out

2014-11-01  Holger Hans Peter Freyther  <holger@moiji-mobile.com>

	misc: Make jit_note and related functions take a const argument
	Make jit_memcpy, jit_memmove, jit_data take const pointers to
	allow jit_note to be used with a const string (e.g. a string
	literal, __FILE__ or __func__). This is needed for GNU Smalltalk
	to silence compiler warnings.

	Sadly "const jit_pointer_t" is not the same as "typedef const void *"
	so I introduced a new typedef for a const jit pointer. The other
	option would be to replace jit_pointer_t with void*.

2014-11-01  Andy Wingo  <wingo@pobox.com>

	web: Location header is URI-reference; better URI-reference support
	* module/web/uri.scm (validate-uri): Add reference? keyword argument,
	  for validating references.
	  (build-uri): Clarify comments to indicate that the result is an
	  absolute URI.
	  (build-uri-reference): New interface, to build URI-references.
	  (string->uri-reference): Rename from string->uri*.  Fix fragment
	  parsing to not include the #.
	  (string->uri): Adapt to string->uri-reference name change.

	* module/web/request.scm (request-absolute-uri): Add default-scheme
	  optional argument.  Use it if the request-uri has no scheme, or
	  error.

	* module/web/http.scm (write-uri): Reflow to use "when".  Fix writing of
	  URI-reference instances.
	  (declare-uri-reference-header!): Rename from
	  declare-relative-uri-header!.  Use string->uri-reference.
	  ("Location"): Declare as a URI-reference header, as per RFC 7231.

	* module/web/client.scm (open-socket-for-uri): Handle the case in which
	  there is no URI scheme.

	* test-suite/tests/web-http.test:
	* test-suite/tests/web-uri.test: Add tests.

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

	Use on-stack or GC-managed memory in 'search-path'.
	* libguile/load.c (stringbuf_free): Remove.
	  (stringbuf_grow): Use 'scm_gc_malloc_pointerless' instead of 'scm_realloc'.
	  (search_path): Use stack-allocated INITIAL_BUFFER instead of
	  'scm_malloc'.  Remove use of 'stringbuf_free'.

	Reduce C heap allocations in 'search-path'.
	* libguile/load.c (scm_c_string_has_an_ext): Rename to...
	  (string_has_an_ext): ... this.  Add docstring.  Change
	  'str' to be an SCM, and remove 'len' parameter.  Change loop body to
	  use 'scm_string_suffix_p'.
	  (search_path): Update accordingly.

2014-10-30  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Merge branch 'lloda-array-support'

2014-10-26  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add assertion to check for register allocation leaks
		* lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
		lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c,
		lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c: Add an
		assertion to all code generation "drivers" to ensure
		_jitc->regarg is empty or in an expected state, after
		translation of a lightning instruction to native code.
		This change was a brute force test to find out other cases
		of a temporary not being release (like was happening with
		_bmsi and _bmci on x86), but no other case was found,
		after running make check, with assertions enabled, on all
		backends.

	x86: Correct not released temporary register
		* lib/jit_x86-cpu.c: Correct a register allocation leak in
		_bmsi and _bmci.

2014-10-25  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Do not fail gratuitously in jit_init_debug
		* lib/jit_disasm.c: Do not cause an fatal error if init_jit
		fails in the jit_init_debug call.

2014-10-24  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Properly handle jit_tramp and function descriptors
		* lib/jit_ia64.c, lib/jit_ppc.c: Correct handling of function
		descriptor when first prolog is a jit_tramp prolog. The
		test case was using the same jit_context_t, so was not
		triggering this condition.

		* lib/jit_ppc-cpu.c: Properly handle jump displacements that
		do not fit on 24 powerpc. This required changing from previous
		"mtlr reg, blr" to "mtctr reg, bctr" to properly handle
		the logic to "hide" function descriptors, but that would
		also be required as the proper jit_jmpr when/if implementing
		optimizations to leaf functions (was working with blr because
		it is saved/reloaded in prolog/epilog).

2014-10-21  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add label predicates
		* include/lightning.h, lib/lightning.c: Add three predicates
		to query information about labels. jit_forward_p(label)
		will return non zero if the label is "forward", that is
		need a call to jit_link(label), jit_indirect_p(label)
		that returns non zero if the label was created with the
		jit_indirect() call, and jit_target_p(label) that will
		return non zero if there is at least one jump patched
		to land at that label.

2014-10-18  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add the new "range" test.
		* check/range.ok, check/range.tst: New test case designed
		to catch incorrect code generation, usually due to incorrect
		test of immediate size. The test checks a large amount of
		encodings in "power of two" boundaries. This test exorcises
		a significant amount of code paths that was previously not
		tested.

		* check/Makefile.am: Add range test to make check target.

		* lib/jit_aarch64-cpu.c: Correct wrong address calculation
		for stxi_c, stxi_s, stxi_i and stxi_l when the offset is
		too large.

	        * lib/jit_mips-fpu.c: Correct wrong size test to check if
		an immediate can be encoded in a float or double store.

		* lib/jit_s390x-cpu.c: Correct inverted encoding to stxi_s
		when the offset cannot be encoded, and fallbacks to an
		alternate encoding in 2 instructions.

2014-10-18  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement the jit_rsb* interface.
		* check/alu_rsb.ok, check/alu_rsb.tst: New files implementing
		tests for jit_rsb*.

		* check/Makefile.am, check/lightning.c, include/lightning.h,
		lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c, lib/jit_aarch64-sz.c,
		lib/jit_aarch64.c, lib/jit_alpha-cpu.c, lib/jit_alpha-fpu.c,
		lib/jit_alpha-sz.c, lib/jit_alpha.c, lib/jit_arm-cpu.c,
		lib/jit_arm-swf.c, lib/jit_arm-sz.c, lib/jit_arm-vfp.c,
		lib/jit_arm.c, lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c,
		lib/jit_hppa-sz.c, lib/jit_hppa.c, lib/jit_ia64-cpu.c,
		lib/jit_ia64-fpu.c, lib/jit_ia64-sz.c, lib/jit_ia64.c,
		lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips-sz.c,
		lib/jit_mips.c, lib/jit_names.c, lib/jit_ppc-cpu.c,
		lib/jit_ppc-fpu.c, lib/jit_ppc-sz.c, lib/jit_ppc.c,
		lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c, lib/jit_s390x-sz.c,
		lib/jit_s390x.c, lib/jit_sparc-cpu.c, lib/jit_sparc-fpu.c,
		lib/jit_sparc-sz.c, lib/jit_sparc.c, lib/jit_x86-cpu.c,
		lib/jit_x86-sse.c, lib/jit_x86-sz.c, lib/jit_x86-x87.c,
		lib/jit_x86.c, lib/lightning.c: Implement jit_rsb*. This
		was a missing lightning 1.x interface, that on most
		backends is synthesized, but on a few backends (hppa and ia64),
		it can generate better code as on those there is, or the
		only instruction with an immediate is in "rsb" format
		(left operand).

2014-10-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add string representation of IR codes to -sz.c files
		* lib/jit_names.c: New file with single definition of string
		representation of lightning IR codes.

		* size.c: Modified to append the code name in a C comment
		after the maximum instruction size.

		* lib/jit_print.c: Minor change to not duplicate jit_names.c
		contents.

		* lib/jit_aarch64-sz.c, lib/jit_alpha-sz.c, lib/jit_arm-sz.c,
		lib/jit_hppa-sz.c, lib/jit_ia64-sz.c, lib/jit_mips-sz.c,
		lib/jit_ppc-sz.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
		lib/jit_x86-sz.c: Rewritten to add string representation of
		IR codes in a C comment.

2014-10-15  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add back files missed when reapplying patches

2014-10-15  Mark H Weaver  <mhw@netris.org>

	i18n: Add HAVE_USELOCALE as a requirement for USE_GNU_LOCALE_API.
	* configure.ac: Check for uselocale.
	* libguile/i18n.c: Add HAVE_USELOCALE to the list of requirements
	  before defining USE_GNU_LOCALE_API.

2014-10-14  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement the jit_align interface
		* lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c,
		lib/jit_hppa-cpu.c, lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c,
		lib/jit_sparc-cpu.c: Implement or correct the internal
		nop(count) call that receives an argument that tells the
		modulo bytes to align the code for the next instruction.

		* include/lightning.h, lib/lightning.c, lib/jit_aarch64.c,
		lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c, lib/jit_ia64.c,
		lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
		lib/jit_x86.c: Implement the new jit_align() call that receive
		an argument, that tells the modulo, in bytes, to align the
		next instruction. In most backends the only value that makes
		a difference is a value that matches sizeof(void*), as all
		other values usually are already automatically aligned in
		labels, but not guaranteed to be aligned at word size bytes.

		* check/align.ok, check/align.tst: New files, implementing
		a simple test for the new jit_align() interface.

		* check/Makefile.am, check/lightning.c, lib/jit_aarch64-sz.c,
		lib/jit_alpha-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
		lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
		lib/jit_print.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c,
		lib/jit_x86-sz.c: Update for the new jit_code_align code and
		the jit_align() interface.

2014-10-14  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Use jit_code_last_code as symbolic name of last enum
		* include/lightning.h, lib/jit_size.c, size.c: Use a
		symbolic value for the last IR code.

2014-10-14  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement jit_frame and jit_tramp interfaces
		* include/lightning.h, include/lightning/jit_private.h,
		lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c,
		lib/jit_hppa-cpu.c, lib/jit_ia64-cpu.c, lib/jit_mips-cpu.c,
		lib/jit_ppc-cpu.c, lib/jit_s390x-cpu.c, lib/jit_sparc-cpu.c,
		lib/jit_x86-cpu.c, lib/lightning.c: Implement the new
		jit_frame and jit_tramp interfaces, that allow writing
		trampoline like calls, where a single dispatcher jit buffer
		is written, and later other jit buffers are created, with
		the same stack frame layout as the dispatcher. This is the
		logic that GNU Smalltalk used in lightning 1.x, and is required
		to make a sane port for lighting 2.x.

		* jit_ia64-cpu.c: Implement support for jit_frame and jit_tramp,
		and also correct wrong encoding for B4 instructions, that
		implement jmpr, as well as correct reverse logic in _jmpr,
		that was moving the branch register to the jump register,
		and not vice-versa.
		Also, if a stack frame is to be assumed, always assume it may
		call a function with up to 8 arguments, regardless of the
		hint frame argument.

		* lib/jit_arm.c: Add a new must_align_p() interface to ensure
		function prologs are always aligned. This condition was
		previously always true, somewhat by accident, but with
		jit_tramp it is not guaranteed.

		* jit_ia64-cpu.c: lib/jit_ppc.c: Add minor special handling
		required to implement jit_tramp, where a function descriptor
		should not be added before a prolog, as jit_tramp means omit
		prolog.

		* check/lightning.c: Update test driver for the new interfaces.

		* check/Makefile.am, check/tramp.tst, check/tramp.ok: Add
		a simple test and example of the jit_frame and jit_tramp
		usage implementing a simple Fibonacci function using a
		simulation of an interpreter stack and how it would handle
		state in language specific variables.

		* doc/body.texi: Add documentation for jit_frame and
		jit_tramp.

2014-10-14  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Allow jit_jmpi on an immediate constant address.
		* lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c,
		lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c,
		lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c,
		lib/jit_x86.c, lib/lightning.c: Allow jit_jmpi on a
		target that is not a node. This may lead to hard to
		debug code generation, but is a required feature for
		certain generators, like the ones that used lightning
		1.2x. Note that previously, but not really well
		documented, it was instructed to use:
		jit_movi(rn, addr); jit_jmpr(rn);
		but now, plain:
		jit_patch_abs(jit_jmpi(), addr);
		should also work.

	Do not fail if NULL is passed to init_jit.
	This should just tell to disable the disassembler.

2014-10-11  Mark H Weaver  <mhw@netris.org>

	scm_boot_guile: Gracefully handle the case where argc == 0.
	Fixes <http://bugs.gnu.org/18680>.
	Reported by Nala Ginrut <nalaginrut@gmail.com>.

	* libguile/init.c (scm_boot_guile): Do not canonicalize argv[0] unless
	  argc > 0.
	* THANKS: Add Nala Ginrut to the fixes section.

2014-10-07  Mark H Weaver  <mhw@netris.org>

	Thank Per Bothner.
	* THANKS: Add Per Bothner to the "libraries" section (for SRFI-64).

2014-10-06  Ludovic Courtès  <ludo@gnu.org>

	build: Adjust autogen.sh to 'libtoolize' name on Darwin.
	Reported by Daniel Llorens.

	* autogen.sh: Use 'glibtoolize' on Darwin.

2014-10-02  Mark H Weaver  <mhw@netris.org>

	read: Accept "\(" in string literals.
	Suggested by David Kastrup <dak@gnu.org> in <http://bugs.gnu.org/13644>.

	* libguile/read.c (scm_read_string_like_syntax): Accept "\(" as
	  equivalent to "(".
	* doc/ref/api-data.texi (String Syntax): Document it.
	* test-suite/tests/reader.test ("reading"): Add test.

2014-10-02  Mark H Weaver  <mhw@netris.org>

	docs: Fix documented return type of 'scm_c_export'.
	Fixes <http://bugs.gnu.org/17869>.
	Reported and fixed by Alexei Matveev <alexei.matveev@gmail.com>.

	* doc/ref/api-modules.texi (Accessing Modules from C): Change documented
	  return type of 'scm_c_export' to 'void' to reflect reality.
	* THANKS: Add Alexei Matveev to the fixes section.

2014-09-30  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Intern general arrays
	* module/system/vm/assembler.scm (intern-constant, link-data): handle
	  the array case.

2014-09-30  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Pack array dimensions in array object
	* libguile/arrays.c (scm_i_make_array): redo object layout.

	* libguile/arrays.h (SCM_I_ARRAY_V, SCM_ARRAY_BASE, SCM_I_ARRAY_DIMS):
	  to match new layout.

	  (SCM_I_ARRAY_SET_V, SCM_ARRAY_SET_BASE): new setters.

	  (SCM_I_ARRAY_MEM, scm_i_t_array): unused, remove.

	  (scm_i_shap2ra, scm_make_typed_array, scm_from_contiguous_typed_array,
	  scm_from_contiguous_array, scm_make_shared_array, scm_transpose_array,
	  scm_array_contents): fix uses of SCM_I_ARRAY_V, SCM_ARRAY_BASE as
	  lvalues.

	* libguile/array-map.c (make1array, scm_ramapc): fix uses of
	  SCM_I_ARRAY_V, SCM_ARRAY_BASE as lvalues.

2014-09-30  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Run some of arrays.test under both compiler & interpreter
	* test-suite/test-suite/lib.scm (c&e): accept (pass-if exp) clause.

	* test-suite/tests/arrays.test: use with-prefix/c&e instead of
	  with-prefix where possible.

2014-09-30  Mark H Weaver  <mhw@netris.org>

	Merge branch 'stable-2.0'
	Conflicts:
		benchmark-suite/benchmarks/ports.bm
		libguile/async.h
		libguile/bytevectors.c
		libguile/foreign.c
		libguile/gsubr.c
		libguile/srfi-1.c
		libguile/vm-engine.h
		libguile/vm-i-scheme.c
		module/Makefile.am
		module/language/tree-il/analyze.scm
		module/language/tree-il/peval.scm
		module/scripts/compile.scm
		module/scripts/disassemble.scm
		test-suite/tests/asm-to-bytecode.test
		test-suite/tests/peval.test
		test-suite/tests/rdelim.test

2014-09-30  Andy Wingo  <wingo@pobox.com>

	Add (ice-9 unicode) module
	* libguile/unicode.c:
	* libguile/unicode.h:
	* test-suite/tests/unicode.test:
	* module/ice-9/unicode.scm: New files.

	* module/Makefile.am:
	* libguile/Makefile.am:
	* test-suite/Makefile.am:
	* libguile/init.c: Wire new files into the build.

	* doc/ref/api-data.texi: Add docs.

2014-09-29  Mark H Weaver  <mhw@netris.org>

	peval: Handle optional argument inits that refer to previous arguments.
	Fixes <http://bugs.gnu.org/17634>.
	Reported by Josep Portella Florit <jpf@primfilat.com>.

	* module/language/tree-il/peval.scm (inlined-application): When inlining
	  an application whose operator is a lambda expression with optional
	  arguments that rely on default initializers, expand into a series of
	  nested let expressions, to ensure that previous arguments are in scope
	  when the default initializers are evaluated.

	* test-suite/tests/peval.test ("partial evaluation"): Add tests.

2014-09-25  Mark H Weaver  <mhw@netris.org>

	doc: Improve description of vector-unfold and vector-unfold-right.
	* doc/ref/srfi-modules.texi (SRFI-43 Constructors)[vector-unfold]:
	  Improve description.
	* module/srfi/srfi-43.scm (vector-unfold, vector-unfold-right):
	  Improve docstrings.

2014-09-24  Paulo Andrade  <paulo.cesar.pereira.de.andrade@gmail.com>

	x86: Update instruction size information for Windows x64
		* lib/jit_x86-sz.c: Generate information about instruction
		lengths for more precise calculation of buffer size on
		Windows x64. This change is specially important because
		the maximum instruction length is larger than other
		systems, what could cause an out of bounds write on
		special conditions without this update.

2014-09-24  Paulo Andrade  <paulo.cesar.pereira.de.andrade@gmail.com>

	x86: Build and pass all tests on 32 bit cygwin
		* check/lightning.c: Add workaround to conflicting global
		optind variable in cygwin binutils that have an internal
		getopt* implementation.

		* lib/jit_x86-cpu.c: Add a simple define ffsl ffs if building
		for 32 bit and there is no ffsl function.

2014-09-24  Paulo Andrade  <paulo.cesar.pereira.de.andrade@gmail.com>

	x86: Build and pass all tests under cygwin64 (Windows x64)
	        * check/lightning.c: Add a hopefully temporary kludge to not use
		sprintf and sscanf returned by dlsym. This is required to pass
		the varargs test.

	        * include/lightning/jit_private.h: Use symbolic name for first
		integer register argument, as this is different in sysv and
		win64 abi.

	        * include/lightning/jit_x86.h: Add conditionals and definitions
		for Windows x64 (under __CYGWIN__ preprocessor conditional).

	        * lib/jit_x86-cpu.c: Correct one instruction encoding bug, that
		was working by accident. Only use rax to rdx for some byte
		operations to work on compatibility mode (that is, to generate
		the proper encoding, instead of actually generating encoding
		for high byte registers, e.g. %bh).
		Add proper prolog and epilog for windows x64.

	        * lib/jit_x86-sse.c: Correct a swapped rex prefix for float
		operations.

	        * lib/jit_x86.c: Adjust to support Windows x64 abi.

		* check/check.x87.nodata.sh: New file, previously used but that
		was missing git.

2014-09-24  David Kastrup  <dak@gnu.org>

	Fix ungetc for characters 0x80 <= c < 0xf0 in UTF-8.
	Fixes <http://bugs.gnu.org/18536>.

	* libguile/ports.c (scm_ungetc_unlocked): Fix bad UTF-8 reencoding,
	  introduced in commit be7ecef05c1eea66f30360f658c610710c5cb22e.

2014-09-22  Ludovic Courtès  <ludo@gnu.org>

	Add 'EXIT_SUCCESS' and 'EXIT_FAILURE'.
	Suggested by Frank Terbeck <ft@bewatermyfriend.org>.

	* libguile/posix.c (scm_init_posix): Define 'EXIT_SUCCESS' and
	  'EXIT_FAILURE'.
	* doc/ref/posix.texi (Processes): Document them.

2014-09-22  David Michael  <fedora.dm0@gmail.com>

	guile-readline: Use the current directory if HOME is unset.
	* guile-readline/ice-9/readline.scm (history-file): When the HOME
	  environment variable is unset, use the current directory instead.

2014-09-20  Ludovic Courtès  <ludo@gnu.org>

	build: Use 'libtoolize' in autogen.sh.
	Fixes <http://bugs.gnu.org/18470>.
	Reported by Rob Browning <rlb@defaultvalue.org>.

	* autogen.sh: Invoke 'libtoolize' instead of 'libtool'.

2014-09-20  David Kastrup  <dak@gnu.org>

	Fix SCM_SMOB_OBJECT{_,_0_,_1_,_2_,_3_}LOC.
	Fixes <http://bugs.gnu.org/18495>.

	* libguile/smob.h (SCM_SMOB_OBJECT_LOC, SCM_SMOB_OBJECT_0_LOC)
	  (SCM_SMOB_OBJECT_1_LOC, SCM_SMOB_OBJECT_2_LOC)
	  (SCM_SMOB_OBJECT_3_LOC): These elementary API macros have been broken
	  by commit 56164dc47f6616b359f0ad23be208f01a77b55fa in 2009.

2014-09-20  Mark H Weaver  <mhw@netris.org>

	guild disassemble: Use #:prefix instead of #:renamer.
	* module/scripts/disassemble.scm: Use #:prefix instead of #:renamer
	  in #:use-module clause.

	Document #:prefix option in use-module clauses.
	* doc/ref/api-modules.texi (Using Guile Modules): Document #:prefix
	  option.

	SRFI-43: vector-concatenate: Fix error message.
	* module/srfi/srfi-43.scm (vector-concatenate): Fix the 'who' of an
	  error message.

2014-09-20  Mark H Weaver  <mhw@netris.org>

	VM: Use register "a3" for IP_REG on m68k.
	Subset of a patch by Andreas Schwab <schwab@linux-m68k.org>.
	Reported by Rob Browning <rlb@defaultvalue.org>.

	* libguile/vm-engine.h (IP_REG)[__mc68000__]: Use register "a3".

2014-09-20  Mark H Weaver  <mhw@netris.org>

	VM: Allow the C compiler to choose FP_REG on ARM.
	Reported by Rob Browning <rlb@defaultvalue.org>.

	* libguile/vm-engine.h (IP_REG)[__arm__]: Remove explicit register
	  choice ("r7") for FP_REG, which was reported to cause compilation
	  failures on ARM.

2014-09-20  Mark H Weaver  <mhw@netris.org>

	Do not assume that 64-bit integers will be 64-bit aligned.
	* libguile/foreign.c (raw_bytecode, objcode_cells):
	* libguile/gsubr.c (raw_bytecode, objcode_cells): Use SCM_ALIGNED to
	  ensure 64-bit alignment.

2014-09-20  Mark H Weaver  <mhw@netris.org>

	VM: ASM_MUL for ARM: Add earlyclobber constraint to the SMULL outputs.
	Reported by Rob Browning <rlb@defaultvalue.org>.

	* libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint
	  to the SMULL output registers.

2014-09-17  Ludovic Courtès  <ludo@gnu.org>

	tests: Link test against Gnulib.
	Reported by Eli Zaretskii <eliz@gnu.org>.

	* test-suite/standalone/Makefile.am (test_scm_take_locale_symbol_LDADD):
	  Add libgnu.la, for the 'strdup' replacement.

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

	Add (ice-9 unicode) module
	* libguile/unicode.c:
	* libguile/unicode.h:
	* test-suite/tests/unicode.test:
	* module/ice-9/unicode.scm: New files.

	* module/Makefile.am:
	* libguile/Makefile.am:
	* test-suite/Makefile.am:
	* libguile/init.c: Wire new files into the build.

	* doc/ref/api-data.texi: Add docs.

2014-09-07  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Consider all callee_save_p regs as live on non trackable jumps

2014-09-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct typo in documentation.
	  Thanks to Yaroslav Tsarko for noticing the problem.

2014-09-01  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Only mark callee save regs as live on jumps that cannot be tracked.
		* lib/lightning.c: Do not mark all registers in unknown state
		as live on jit_jmpr, or jit_jmpi to an absolute address. Instead,
		treat it as a function call, and only consider JIT_Vn registers
		as possibly live.

2014-08-29  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add info menu entry for lightning
		* doc/body.texi: Add a proper info menu entry for
		GNU lightning.

		* doc/version.texi: Regenerate.

2014-08-26  Ludovic Courtès  <ludo@gnu.org>

	Thank Franck.

2014-08-26  Ludovic Courtès  <ludo@gnu.org>

	Handle ~p in 'format' warnings.
	Fixes <http://bugs.gnu.org/18299>.
	Reported by Frank Terbeck <ft@bewatermyfriend.org>.

	* module/language/tree-il/analyze.scm (format-string-argument-count):
	  Add case for ~p.
	* test-suite/tests/tree-il.test ("warnings")["format"]("~p", "~p, too
	  few arguments", "~:p", "~:@p, too many arguments", "~:@p, too few
	  arguments"): New tests.

2014-08-24  Andy Wingo  <wingo@pobox.com>

	Separate &boolean type into &true and &false
	* module/language/cps/types.scm (&all-types): Represent true and false
	  as separate bits, so that #f can be removed from types on true
	  branches.  Adapt all users.

	* module/language/cps/type-fold.scm (&scalar-types):
	  (fold-and-reduce): Adapt to boolean type representation change.

2014-08-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	GNU lightning 2.0.5 release

	Add consistency check on temporaries during a jump
		* lib/jit_aarch64-cpu.c, lib/jit_aarch64-fpu.c,
		lib/jit_arm-cpu.c, lib/jit_arm-vfp.c,
		lib/jit_hppa-cpu.c, lib/jit_hppa-fpu.c,
		lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c,
		lib/jit_mips-cpu.c, lib/jit_mips-fpu.c,
		lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c,
		lib/jit_s390x-cpu.c, lib/jit_s390x-fpu.c,
		lib/jit_s390x.c, lib/jit_sparc-cpu.c,
		lib/jit_x86-cpu.c, lib/jit_x86-sse.c,
		lib/jit_x86-x87.c: Review generation of all branch
		instructions and always adds the jit_class_nospill
		bitfield for temporary registers that cannot be	spilled
		because the reload would be after a conditional jump; the
		patch only adds an extra assertion. These conditions do
		not happen on documented lightning usage, but can happen
		if one uses the not exported jit_get_reg and jit_unget_reg
		calls and cause enough register starvation.

	ALPHA: Correct class of argument float registers
		* lib/jit_alpha.c: Correct wrong bitmask of most argument
		float register arguments, that were being set as callee
		save instead of argument registers class.

2014-08-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	ARM: Correct wrong table of instruction sizes in software float
		* lib/jit_arm-sz.c: Regenerate table of known maximum
		instruction sizes for the software float fallback,
		that implements "virtual" float registers in the stack
		and operations as calls to libgcc.

		* size.c: Correct typo in the generated jit_arm-sz.c file.

2014-08-15  Eli Zaretskii  <eliz@gnu.org>

	On MS-Windows, don't return file names with backslashes from search-path.
	* libguile/load.c (search_path): On MS-Windows, convert all
	  backslashes to forward slashes if the file was found on PATH.

2014-08-14  Mark H Weaver  <mhw@netris.org>

	Copy the result from 'nl_langinfo' before it can be overwritten.
	Based on a patch by Eli Zaretskii <eliz@gnu.org>.

	* libguile/i18n.c (copy_string_or_null): New static function.
	  (scm_nl_langinfo): Use 'copy_string_or_null' to copy the result from
	  'nl_langinfo' and 'nl_langinfo_l' before the next call and before
	  releasing the locale mutex.

2014-08-13  Eli Zaretskii  <eliz@gnu.org>

	Make temporary file in coding.test work on MS-Windows.
	* test-suite/tests/coding.test (with-temp-file): Instead of
	  hard-coding "/tmp" as the temporary directory, use $TMPDIR or
	  $TEMP from the environment, and fall back on "/tmp" if none of
	  those 2 is defined.

2014-08-12  Ludovic Courtès  <ludo@gnu.org>

	doc: "!#" does not need to appear on a line of its own.
	* doc/ref/api-evaluation.texi (Block Comments): Remove "which must appear on a
	  line of their own".  Reported by David Michael <fedora.dm0@gmail.com>.

2014-08-11  David Kastrup  <dak@gnu.org>

	Clarify that object-properties cannot be reliably applied to numbers.
	* doc/ref/api-utility.texi (Object Properties)[make-object-property]:
	  Clarify that object-properties cannot be reliably applied to numbers.

2014-08-10  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Do not filter -sz.c files in gitignore

2014-08-10  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	ALPHA: Implement lightning Alpha port.
	        * include/lightning/jit_alpha.h, lib/jit_alpha-cpu.c,
	        lib/jit_alpha-fpu.c, lib/jit_alpha-sz.c, lib/jit_alpha.c:
		New files implementing a lightning Alpha port. Thanks
		to Trent Nelson and snakebit.net staff for providing access
		to an Alpha system.

	        * check/float.tst, check/lightning.c, configure.ac,
	        include/lightning.h, include/lightning/Makefile.am,
	        include/lightning/jit_private.h, lib/Makefile.am,
	        lib/jit_disasm.c, lib/jit_size.c, lib/lightning.c:
		Minor changes to adapt for the new Alpha port.

2014-08-10  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Always mark return registers as live in epilog
		* lib/lightning.c: Always mark JIT_RET and JIT_FRET as
		live in a function epilog. This is required because
		on some ports a complex sequence, allocating one or more
		registers, may be required to jump from a ret* to the
		epilog, and the lightning api does not have annotations
		to know if a function returns a value, or the type of
		the return value.

	Correct change of possibly wrong bitmask in jit_update
		* lib/lightning.c: Change the correct live bitmask of
		return registers after a function call in jit_update.

	Do not have assertions with a long type test
		* lib/lightning.c: Change assertions to have an int
		result and correct a bad bit mask assertion.

	AARCH64: Correct assertion test
		* lib/jit_aarch64.c: Correct bad setup for assertion
		of consistency before a patch.

	MIPS: Correct use of wrong test register
		* lib/jit_mips-cpu.c: Correct typo in the jit_bmsr
		implementation that was using the wrong test result
		register.

2014-07-31  Ian Price  <ianprice90@googlemail.com>

	Provide curried version of define*-public.
	* module/ice-9/curried-definitions.scm (define*-public): New macro.

2014-07-30  Ian Price  <ianprice90@googlemail.com>

	Prevent add-to-load-path from adding duplicate entries
	* module/ice-9/boot-9.scm (add-to-load-path): Remove argument from
	  %load-path (if it exists) before pushing. This also means that the
	  `elt' will always be at the front of %load-path.

2014-07-29  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Do not pass null for free, memcpy and memmove
		* lib/jit_memory.c: Do not call free on NULL pointers.

		* include/lightning/jit_private.h, lib/jit_note.c,
		lib/lightning.c: Add a wrapper to memcpy and memmove
		to not actually call those functions with a zero size
		argument, and likely also a null src or dst.

2014-07-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Remove the global but not advertised jit_progname variable
		* include/lightning/jit_private.h, lib/jit_disasm.c,
		lib/lightning.c: Remove the global jit_progname variable.
		It was being only used in jit_init_debug, that is called
		from init_jit, so, just pass an argument.

	Add note about jit_set_memory_functions call.
		* doc/body.texi: Add note that jit_set_memory_functions
		should be called before init_jit, because init_jit
		itself may call the memory wrappers.

2014-07-22  Andy Wingo  <wingo@pobox.com>

	Better simplification of literal constants that continue to branches
	* module/language/cps/simplify.scm (eta-reduce): Constants that continue
	  to branches eta-reduce to the true or false branch.

2014-07-22  Andy Wingo  <wingo@pobox.com>

	CPS will not see "not" primcalls
	* module/language/tree-il/compile-cps.scm (convert): Remove "not"
	  primcalls.

	* module/language/cps/effects-analysis.scm (values):
	* module/language/cps/types.scm: Remove special cases for the "not"
	  primcall.

2014-07-22  Andy Wingo  <wingo@pobox.com>

	Simplify pass rewrite scope tree to reflect dominator tree
	* module/language/cps/simplify.scm (redominate): Add micropass to
	  rewrite the scope tree to reflect the dominator tree.  Will enable
	  better eta reduction.

	Remove dead case in CSE
	* module/language/cps/cse.scm (apply-cse): Remove a case that couldn't
	  occur.

2014-07-21  Andy Wingo  <wingo@pobox.com>

	CSE allocate-struct fix
	* module/language/cps/cse.scm (compute-equivalent-subexpressions):
	  Fix handling of allocate-struct in tail position.

	Fix typo in arities.scm
	* module/language/cps/arities.scm (fix-arities*): Fix typo.

	Stabilize renumber.scm:sort-conts.
	* module/language/cps/renumber.scm (sort-conts): Prevent spurious
	  continuation reordering.

	maybe_annotate_source does not annotate negative positions
	* libguile/read.c (maybe_annotate_source): Don't annotate with negative
	  lines or columns.

	Soft port fill-input doesn't alter line or column
	* libguile/vports.c (sf_fill_input): Save and restore the line/column
	  info around the ungetc.

	scm_ungetc_unlocked should not result in negative columns
	* libguile/ports.c (scm_ungetc_unlocked): Use DECCOL in all cases, to
	  avoid negative columns.

	Fix allocate-slots for $kreceive with multiple predecessors
	* module/language/cps/slot-allocation.scm (allocate-slots): For
	  continuations of $call, $callk, and $values with multiple
	  predecessors, recalculate the set of live slots.  Fixes miscompilation
	  of ice-9/futures.scm:process-future!, broken since the previous patch,
	  now that $kreceive continuations can have multiple predecessors.

2014-07-05  Andy Wingo  <wingo@pobox.com>

	Block sorting to keep loop bodies together
	* module/language/cps/renumber.scm (compute-new-labels-and-vars):
	  (compute-tail-path-lengths, sort-conts): Arrange to visit successors
	  in such a way that if branches are unsorted, the longest path length
	  will appear first.  This keeps loop bodies together.

2014-07-04  Ludovic Courtès  <ludo@gnu.org>

	Recognize more ARM targets.
	Suggested by Dale P. Smith.

	* module/system/base/target.scm (cpu-endianness): Add cases for
	  "arm.*eb", "^aarch64.*be", and "aarch64".  Change "arm" case to
	  "arm.*".
	  (triplet-pointer-size): Allow underscore as in 'aarch64_be'.
	* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["armeb-unknown-linux-gnu",
	  "aarch64-linux-gnu", "aarch64_be-linux-gnu"]: New tests.

2014-07-04  Andy Wingo  <wingo@pobox.com>

	Fix bit-count* bug
	* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in
	  2005 refactor (!) in which the second arg was erroneously taken from
	  the first arg.

	* test-suite/tests/bitvectors.test: Add test.

	* doc/ref/api-compound.texi: Fix doc example for u32vector selector.

2014-07-04  Ludovic Courtès  <ludo@gnu.org>

	build: Support pthread builds without 'pthread_cancel' support (Android).
	Reported by Sylvain Beucler <beuc@beuc.net>.

	* configure.ac: Check for 'pthread_cancel'.
	* libguile/threads.c (scm_cancel_thread): Conditionalize on
	  !SCM_USE_PTHREAD_THREADS || defined HAVE_PTHREAD_CANCEL.
	* test-suite/tests/threads.test (require-cancel-thread): New procedure.
	  ("timed joining fails if timeout exceeded", "join-thread returns
	  timeoutval on timeout", "cancel succeeds", "handler result passed to
	  join", "can cancel self"): Use it.

2014-07-04  Ludovic Courtès  <ludo@gnu.org>

	build: Use 'LT_LIB_M' to determine whether -lm is needed.
	* configure.ac: Use 'LT_LIB_M' instead of 'AC_CHECK_LIB(m, cos)'.
	  Suggested by Sylvain Beucler <beuc@beuc.net>.

2014-07-04  Ludovic Courtès  <ludo@gnu.org>

	Recognize arm-* target triplets.
	Reported by Sylvain Beucler <beuc@beuc.net>.

	* module/system/base/target.scm (cpu-endianness): Add case where CPU is
	  "arm".
	* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["arm-unknown-linux-androideabi"]:
	  New test.

2014-07-04  Andy Wingo  <wingo@pobox.com>

	logbit? strength reduction
	* module/language/cps/type-fold.scm (fold-and-reduce): Don't require
	  types to check out; it could be that the reduced expression can
	  exhibit the same type-check effects.  Reduce for all continuations,
	  even $kreceive.  Pass dfg to reducer.
	  (mul): Check types.
	  (logbit?): New reducer.

	Fix logand range analysis.
	* module/language/cps/types.scm (logand): Fix range analysis.

	Fix range analysis for mul and div
	* module/language/cps/types.scm (mul): Avoid producing nans in the
	  resulting range.
	  (div): Fix range analysis.

	Type-driven strength reduction
	* module/language/cps/type-fold.scm (*primcall-reducers*):
	  (define-primcall-reducer, define-unary-primcall-reducer):
	  (define-binary-primcall-reducer, mul): Beginnings of strength
	  reduction.
	  (fold-and-reduce): Rename from compute-folded.
	  (fold-constants*): Adapt.

	Small type-fold cleanup
	* module/language/cps/type-fold.scm (fold-constants*): Remove stale
	  branches that were there when we only type folded on limited-size
	  branches.

2014-07-03  Eli Zaretskii  <eliz@gnu.org>

	Remove trailing whitespace from ports.test.

	Untabify some test files.
	* test-suite/tests/ports.test: Untabify.
	* test-suite/tests/posix.test: Untabify.
	* test-suite/tests/r6rs-files.test: Untabify.

2014-07-03  Eli Zaretskii  <eliz@gnu.org>

	Fix problems with Windows file names that use backslashes.
	* libguile/load.c (scm_i_mirror_backslashes): New function.
	  (scm_init_load_path): Call it to produce MS-Windows file names
	  with forward slashes.
	  (FILE_NAME_SEPARATOR_STRING): Define as "/" on all platforms.

	* libguile/load.h (scm_i_mirror_backslashes): Add prototype.

	* libguile/init.c (scm_boot_guile): Call scm_i_mirror_backslashes
	  on argv[0].

	* libguile/filesys.c (scm_getcwd): Call scm_i_mirror_backslashes
	  on the directory name returned by getcwd.

	* test-suite/tests/ports.test ("file name separators"): New test.

2014-07-03  Eli Zaretskii  <eliz@gnu.org>

	Fix calculation of CPU set size for getaffinity.
	* libguile/posix.c (cpu_set_to_bitvector): Use CPU_SETSIZE, not
	  sizeof, to compute the size of the CPU set.

	Provide a more reasonable default value for stack limit on MS-Windows.
	* libguile/debug.c (init_stack_limit) [__MINGW32__]: Use
	  VirtualQuery to compute the stack limit on MS-Windows.

2014-07-03  Eli Zaretskii  <eliz@gnu.org>

	Unconditionally build and test the ice-9/popen module.
	* module/Makefile.am (ICE_9_SOURCES): Add ice-9/popen.scm.
	  (ICE_9_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition
	  of ice-9/popen.scm.
	  (SCRIPTS_SOURCES): Add scripts/autofrisk.scm and
	  scripts/scan-api.scm unconditionally.
	  (SCRIPTS_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition
	  of scripts/autofrisk.scm and scripts/scan-api.scm.

	* configure.ac: Remove the BUILD_ICE_9_POPEN condition.

	* test-suite/tests/popen.test (if-supported): Don't test for 'fork
	 feature being supported.

2014-07-03  Andy Wingo  <wingo@pobox.com>

	Compiler emits br-if-logtest
	* module/language/cps/compile-bytecode.scm (compile-fun):
	* module/language/cps/primitives.scm (*branching-primcall-arities*):
	* module/language/cps/type-fold.scm (logtest):
	* module/language/cps/types.scm (logtest):
	* module/system/vm/assembler.scm (system):
	* module/system/vm/disassembler.scm (compute-labels): Add backend
	  support for the logtest instruction.

	Add br-if-logtest opcode
	* libguile/vm-engine.c (br-if-logtest): New opcode.
	* module/system/vm/disassembler.scm (code-annotation): Add branch
	  annotation support.

	Optimizer support for logtest and logbit?
	* module/language/cps/effects-analysis.scm: Add entries for logtest and
	  logbit?.
	* module/language/cps/types.scm (logtest, logbit?): New checkers and
	  inferrers.
	* module/language/tree-il/peval.scm (peval): Convert (zero? (logand a
	  b)) to (logtest a b), in anticipation of opcode support for logtest.
	*
	  module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect-free-primitives*): Add logtest and logbit?.

2014-07-03  Andy Wingo  <wingo@pobox.com>

	Convert slot allocation to use intsets
	* module/language/cps/dfg.scm (compute-live-variables): Convert to use
	  intsets, and fold in compute-maximum-fixed-point.
	  (print-dfa): Update.

	* module/language/cps/slot-allocation.scm (dead-after-def?)
	  (dead-after-use?, allocate-slots): Convert to use intsets.

2014-07-03  Andy Wingo  <wingo@pobox.com>

	Add bitvector->intset.
	* module/language/cps/intset.scm (bitvector->intset): New interface.

	Restrict intsets and maps to non-negative integers
	* module/language/cps/intmap.scm (intmap-add):
	* module/language/cps/intset.scm (intset-add): Restrict to only hold
	  non-negative integers.

	Adapt visit-prompt-control-flow to use intsets.
	* module/language/cps/dfg.scm (compute-reachable): Use intsets.
	  (compute-interval): Adapt.
	  (visit-prompt-control-flow): Adapt.

	CSE comments
	* module/language/cps/cse.scm (compute-available-expressions): Add
	  clarifying comment.

	Add intset-subtract.
	* module/language/cps/intset.scm (intset-subtract): New interface.

2014-07-02  Eli Zaretskii  <eliz@gnu.org>

		More fixes for deleting files whose ports are not closed.
		* test-suite/tests/r6rs-files.test: Close the port after
		using it.

		* test-suite/tests/posix.test ("mkstemp!"): Close the port after
		using it.

2014-07-02  Eli Zaretskii  <eliz@gnu.org>

		Make 'system*' available on MS-Windows.
		* libguile/simpos.c (scm_system_star) [!HAVE_FORK]: An
		implementation of 'system*' for MS-Windows, which doesn't have
		'fork', but can use 'spawnvp' in this case.

		Fix deletion of ports.test test file on MS-Windows.
		* test-suite/tests/ports.test ("fdes->port", "seek")
		("truncate-file"): Close every file and port we open, to avoid
		failure to delete the test file on MS-Windows when the test is
		completed.

2014-07-01  Andy Wingo  <wingo@pobox.com>

	Fix intset on 32-bit machines
	* module/language/cps/intset.scm (*leaf-bits*): Define to 4 on 32-bit
	  machines, to stay in fixnum range.

2014-06-30  Andy Wingo  <wingo@pobox.com>

	Remove size limit in elide-type-checks
	* module/language/cps/dce.scm (elide-type-checks!): Remove limit on
	  label-count, now that complexity is under control.

2014-06-29  Andy Wingo  <wingo@pobox.com>

	Fix intmap-intersect corner case
	* module/language/cps/intmap.scm (intmap-intersect): Fix a corner case,
	  as was recently fixed for intsets.

	CSE truth inference pass uses intsets
	* module/language/cps/cse.scm (compute-truthy-expressions): Rewrite to
	  use intsets instead of bitvectors.
	  (apply-cse): Adapt.

	Result of intsect-intersect will share structure with A if it can
	* module/language/cps/intset.scm (intset-intersect): Ensure that the
	  result shares structure with A if possible, as intmaps do.

	Fix an intset-intersect corner case
	* module/language/cps/intset.scm (intset-intersect): Avoid creating
	  invalid intsets when lowering an intset with a higher shift.

	Fix intset pruning for empty intsets
	* module/language/cps/intset.scm (make-intset/prune): Fix empty intset
	  case.

2014-06-29  Andy Wingo  <wingo@pobox.com>

	Remove namesets.
	This was a failed experiment.  It had good space complexity but terrible
	time complexity.

	* module/Makefile.am: Update.
	* module/language/cps/nameset.scm: Remove.

2014-06-29  Andy Wingo  <wingo@pobox.com>

	Rewrite type inference to use intmaps
	* module/language/cps/types.scm: Rewrite to use intmaps instead of
	  namesets.

	New module (language cps intmap)
	* module/language/cps/intmap.scm: New file.
	* module/Makefile.am: Add to build.

	Rewrite CSE to use intsets.
	* module/language/cps/cse.scm: Rewrite using intsets.

	New module: (language cps intset)
	* module/Makefile.am: Add to build.
	* module/language/cps/intset.scm: New file.

2014-06-29  Andy Wingo  <wingo@pobox.com>

	Fix bit-count* bug
	* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in
	  2005 refactor (!) in which the second arg was erroneously taken from
	  the first arg.

	* test-suite/tests/bitvectors.test: Add test.

	* doc/ref/api-compound.texi: Fix doc example for u32vector selector.

2014-06-22  Eli Zaretskii  <eliz@gnu.org>

	Fix compilation of scm_nl_langinfo when some nl_langinfo items are missing.
	* i18n.c (scm_nl_langinfo): Don't assume that both INT_* and
	  the corresponding non-INT_* items are always either all defined
	  or all undefined.

2014-06-22  Andy Wingo  <wingo@pobox.com>

	Rewrite type inference pass to use namesets
	* module/Makefile.am: Build types.scm early, but don't block the rest of
	  the build on it.

	* module/language/cps/types.scm: Rewrite to use namesets.

	* module/language/cps/dce.scm:
	* module/language/cps/type-fold.scm: Adapt to interface changes.

2014-06-22  Andy Wingo  <wingo@pobox.com>

	New module: (language cps nameset)
	* module/language/cps/nameset.scm: New file.
	* module/Makefile.am: Add new file.

2014-06-19  Andy Wingo  <wingo@pobox.com>

	Refactor dominator computation
	* module/language/cps/cse.scm:
	* module/language/cps/dfg.scm (compute-idoms, compute-dom-edges): Move
	  these procedures from cse.scm to dfg.scm.
	  Remove loop-detection code; that can come back later but it is
	  bitrotten for now.

	Constant folding for (list) and (vector) in peval
	* module/language/tree-il/peval.scm (peval): Add cases for (list) -> '()
	  and (vector) -> #().

2014-06-12  Ludovic Courtès  <ludo@gnu.org>

	tests: Improve lack-of-/dev/null detection.
	Suggested by Eli Zaretskii <eliz@gnu.org>.

	* test-suite/test-suite/lib.scm (%null-device): Test for Windows based
	  by checking for a drive letter in the current directory name.

2014-06-11  Ludovic Courtès  <ludo@gnu.org>
	    Eli Zaretskii  <eliz@gnu.org>

	i18n: Adjust tests for Windows.
	* test-suite/tests/i18n.test (mingw?): New variable.
	  (%french-locale-name, %french-utf8-locale-name,
	  %turkish-utf8-locale-name, %german-utf8-locale-name,
	  %greek-utf8-locale-name): Add name of corresponding Windows codepage,
	  when MINGW? is true.
	  (under-turkish-utf8-locale-or-unresolved): Add exception for
	  "mingw32".

	i18n: Ignore LC_MESSAGES on MinGW.
	* libguile/locale-categories.h (MESSAGES): Add condition on
	  !(defined(LC_MAX) && LC_MESSAGES > LC_MAX).
	* test-suite/tests/i18n.test ("locale objects")["make-locale (2 args,
	  list)", "make-locale (3 args)", "locale?"]: Use LC_NUMERIC or LC_TIME
	  instead of LC_MESSAGES.

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

	tests: Use NUL instead of /dev/null on MinGW.
	Reported by Eli Zaretskii <eliz@gnu.org>.

	* test-suite/test-suite/lib.scm (%null-device): New variable.
	* test-suite/tests/c-api.test (egrep): Use %NULL-DEVICE instead of
	  /dev/null.
	* test-suite/tests/popen.test ("open-input-pipe")["no duplicate"]:
	  Likewise.

2014-06-09  Ludovic Courtès  <ludo@gnu.org>

	Use the right GC version macros.
	Reported by Doug Evans <xdje42@gmail.com>.

	* libguile/gc.c (scm_storage_prehistory): Use GC_VERSION_MICRO, not
	  GC_ALPHA_VERSION.

2014-06-06  Taylan Ulrich B  <taylanbayirli@gmail.com>

	R6RS library documentation fix
	* doc/ref/api-modules.texi (R6RS Libraries): Move 'export' before
	  'import' in the example library form, as required by R6RS.

2014-06-05  Dmitry Bogatov  <KAction@gnu.org>

	Fix typo in `transform-string' doc.
	* doc/ref/texinfo.texi: Fix single typo.

2014-06-05  Mark H Weaver  <mhw@netris.org>

	Optimize scm_ilength and 'length+'.
	* libguile/list.c (scm_ilength): Test for SCM_NULL_OR_NIL_P only after
	  testing scm_is_pair.  Conform to GNU coding standards.

	* libguile/srfi-1.c (scm_srfi1_length_plus): Ditto.

2014-06-05  Mark H Weaver  <mhw@netris.org>

	test-guild-compile: Increase sleep time before sending SIGINT.
	* test-suite/standalone/test-guild-compile: Increase sleep time
	  before sending SIGINT, for slow machines.

2014-06-05  Mark H Weaver  <mhw@netris.org>

	Avoid quadratic expansion time in 'and' and 'or' macros.
	Fixes <http://bugs.gnu.org/17147>.
	Reported by David Kastrup <dak@gnu.org>.

	* module/ice-9/boot-9.scm (and, or): Use dotted tail instead of ellipsis
	  in patterns.

2014-06-03  Ludovic Courtès  <ludo@gnu.org>

	'guild compile' doesn't leave temporary files behind it.
	* module/scripts/compile.scm (compile): Add 'sigaction' call.
	* test-suite/standalone/test-guild-compile: New file.
	* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.

2014-06-02  Mark H Weaver  <mhw@netris.org>

	SRFI-1 'length+' raises an error unless passed a proper or circular list.
	Fixes <http://bugs.gnu.org/17296>.

	* libguile/srfi-1.c (scm_srfi1_length_plus): Rewrite to raise an error
	  unless passed a proper or circular list, based on code from
	  'scm_ilength'.

	* test-suite/tests/srfi-1.test (length+): Add tests.

2014-06-02  Mark H Weaver  <mhw@netris.org>

	Mark system async functions as SCM_API.
	Fixes <http://bugs.gnu.org/17661>.
	Reported and fixed by Chris Vine <chris@cvine.freeserve.co.uk>.

	* libguile/async.h (scm_c_call_with_blocked_asyncs)
	  (scm_c_call_with_unblocked_asyncs, scm_dynwind_block_asyncs)
	  (scm_dynwind_unblock_asyncs): Mark as SCM_API.

	* THANKS: Add Chris Vine to fixes section.

2014-06-01  Andy Wingo  <wingo@pobox.com>

	Remove $kif
	* module/language/cps.scm: Remove $kif.

	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/prune-top-level-scopes.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/type-fold.scm:
	* module/language/cps/types.scm:
	* module/language/cps/verify.scm: Adapt.

2014-06-01  Andy Wingo  <wingo@pobox.com>

	CPS conversion produces $branch nodes, not $kif
	* module/language/tree-il/compile-cps.scm (unbound?, convert): Create
	  $branch nodes instead of $kif nodes.

2014-06-01  Andy Wingo  <wingo@pobox.com>

	Add $branch expression type
	* module/language/cps.scm ($branch): New expression type; will replace
	  $kif.

	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/primitives.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/self-references.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/type-fold.scm:
	* module/language/cps/types.scm:
	* module/language/cps/verify.scm: Adapt to $branch expression type.

2014-06-01  Andy Wingo  <wingo@pobox.com>

	Fix source-line-for-user for unknown line
	* module/system/vm/debug.scm (source-line-for-user): Fix to allow for
	  unknown lines.

	Fix off-by-one in dump-dfg
	* module/language/cps/dfg.scm (dump-dfg): Fix bug where the last
	  continuation wasn't printed.

	Fix compute-predecessors bug in frame.scm
	* module/system/vm/frame.scm (compute-predecessors): Fix bug in
	  resolving targets of backwards branches.

2014-05-28  Ludovic Courtès  <ludo@gnu.org>

	Slightly simplify 'scm_open_process'.
	* libguile/posix.c (scm_open_process): Call 'scm_fdes_to_port' with the
	  '0' flag, and remove 'scm_setvbuf' calls.

2014-05-28  Ludovic Courtès  <ludo@gnu.org>

	rdelim: Speed up 'read-string' (aka. 'get-string-all'.)
	This yields a 20% improvement on the "read-string" benchmark.

	* module/ice-9/rdelim.scm (read-string): Rewrite as a 'case-lambda',
	  with a tight loop around 'read-char', and without using
	  'read-string!'.
	* test-suite/tests/rdelim.test ("read-string")["longer than 100 chars,
	  with limit"]: New test.
	* benchmark-suite/benchmarks/ports.bm ("rdelim")["read-string"]: New
	  benchmark.

2014-05-28  Ludovic Courtès  <ludo@gnu.org>

	tests: Add test for <http://bugs.gnu.org/17466>.
	* test-suite/tests/r6rs-ports.test ("7.2.8 Binary
	  Input")("http://bugs.gnu.org/17466"): New test.

2014-05-28  Ludovic Courtès  <ludo@gnu.org>

	Fix shrinking of contiguous bytevectors, as from 'get-bytevector-n'.
	Fixes <http://bugs.gnu.org/17466>.
	Reported by J Kalbhenn <jkal@posteo.eu>.

	* libguile/bytevectors.c (scm_c_shrink_bytevector): When BV is
	  contiguous, add use of 'SCM_BYTEVECTOR_SET_CONTENTS'.

2014-05-23  Ludovic Courtès  <ludo@gnu.org>

	web: Keep the default size for the client's in-kernel receive buffer.
	Fixes <http://bugs.gnu.org/15368>.

	* module/web/client.scm (open-socket-for-uri): Remove call to
	  'setsockopt'.  Contrary to what the comment said, its effect was to
	  shrink the receive buffer from 124 KiB (the default size, per
	  /proc/sys/net/core/rmem_default on Linux-based systems) to 12 KiB.

2014-05-21  Ludovic Courtès  <ludo@gnu.org>

	tests: Add test for _IOLBF.
	* test-suite/tests/ports.test ("pipe, fdopen, and _IOLBF"): New test.

2014-05-16  Andy Wingo  <wingo@pobox.com>

	Update effects-analysis docstring.
	* module/language/cps/effects-analysis.scm: Update docs.

2014-05-16  Andy Wingo  <wingo@pobox.com>

	Redefine memory kind part of effects to be enumeration, not flags
	* module/language/cps/effects-analysis.scm (define-enumeration): New
	  helper.
	  (&memory-kind-mask): Define as an enumeration, not a bitfield.  Add
	  &unknown-memory-kinds.
	  (&all-effects, effect-clobbers?, make-prompt-tag, expression-effects):
	  Adapt.

	Note that this change requires dce.go and cse.go to be recompiled.

2014-05-16  Ludovic Courtès  <ludo@gnu.org>

	Silence GCC warning.
	* libguile/fports.c (scm_setvbuf): Initialize 'drained'.  GCC 4.9 raises
	  a "may be used uninitialized warning" for 'drained', because it can't
	  tell that 'drained' is initialized anytime NDRAINED > 0.

2014-05-15  Andy Wingo  <wingo@pobox.com>

	DCE uses type analysis to elide type checks
	* module/language/cps/dce.scm (elide-type-checks!, compute-live-code):
	  Replace old ad-hoc type check elision with one driven from type
	  analysis.  Type check elision only operates on smallish functions, to
	  avoid n**2 explosion in type inference.

2014-05-15  Andy Wingo  <wingo@pobox.com>

	Limit impact of O(n^2) type analysis by imposing limit
	* module/language/cps/types.scm (infer-types): Add #:max-label-count
	  argument.

	* module/language/cps/type-fold.scm (compute-folded, fold-constants*):
	  Disable for big functions.  Perhaps we can relax this if we find an
	  O(n log n) way to represent types.

2014-05-15  Andy Wingo  <wingo@pobox.com>

	Compile language/cps/types.scm early
	* module/Makefile.am (BOOT_SOURCES, BOOT_GOBJECTS): New variables.
	  (CLEANFILES, nobase_mod_DATA, nobase_ccache_DATA, EXTRA_DIST)
	  (ETAGS_ARGS): Use the new variables.

	  (CPS_LANG_SOURCES): Remove language/cps/types.scm, as it is a boot
	  file.

2014-05-15  Andy Wingo  <wingo@pobox.com>

	Enable type folding
	* module/language/cps/compile-bytecode.scm (optimize): Enable type
	  folding.

2014-05-15  Andy Wingo  <wingo@pobox.com>

	Type and range inference for CPS
	* module/language/cps/types.scm: New file, implementing type and range
	  inference over CPS.

	* module/language/cps/type-fold.scm: New file, implementing abstract
	  constant folding for CPS.

	* module/Makefile.am: Add the new files.

	* module/language/cps/compile-bytecode.scm: Wire up type-fold, but
	  currently disabled.

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

	Add syntax-parameterize indentation to .dir-locals.el.
	* .dir-locals.el: Add syntax-parameterize indentation.

2014-05-08  Andy Wingo  <wingo@pobox.com>

	Rewrite effects analysis to be precise for fields.
	* module/language/cps/effects-analysis.scm: Rewrite so that instead of
	  the depends/causes effects, there is just &type-check, &allocation,
	  &read, and &write.  The object kind is a separate part of the
	  bitfield, and the field in the object (if appropriate) is another
	  field.  Effects are still a fixnum.  This enables precise effects for
	  vectors and structs on all architectures.

	  This kind of effects analysis was not possible in Tree-IL because
	  Tree-IL relied on logior-ing effects of subexpressions, whereas with
	  CPS we have no sub-expressions and we do flow analysis instead.

	  (effect-clobbers?): Replace effects-commute? with this inherently
	  directional and precise predicate.

	* module/language/cps/cse.scm (compute-always-available-expressions):
	  (compute-equivalent-subexpressions): Adapt to effects analysis
	  change.
	* module/language/cps/dce.scm (compute-live-code): Likewise.

2014-05-07  Andy Wingo  <wingo@pobox.com>

	CSE effects analysis cleanup
	* module/language/cps/cse.scm (compute-always-available-expressions):
	  Use constant? instead of zero?, to avoid punching through the effects
	  abstraction.

	Add dump-dfg pretty-printer
	* module/language/cps/dfg.scm (dump-dfg): New pretty-printer.  Under
	  construction.

	Synthetic definitions take advantage of CSE'd vars
	* module/language/cps/cse.scm (compute-available-expressions):
	  Simplify initialization.
	  (compute-equivalent-subexpressions): When synthesizing definitions,
	  use substed vars.  Add synthetic definitions after processing an
	  expression, to take advantage of the substed vars.

	Fix thinko in synthesize-definition-effects!
	* module/language/cps/effects-analysis.scm (synthesize-definition-effects!):
	  Fix a boneheaded thinko that caused all primcalls to be marked as
	  causing car, cdr, vector, struct, and box effects.

2014-05-04  Andy Wingo  <wingo@pobox.com>

	Fix frame-call-representation for frames from apply-hook
	* module/system/vm/frame.scm (frame-call-representation): Fix when
	  called on frames that are created from the apply hook.

2014-05-04  Andy Wingo  <wingo@pobox.com>

	Program printing tweaks
	* module/system/vm/program.scm (print-program): New public interface --
	  the guts of write-program, but refactored to be able to work when only
	  given an addr.
	  (write-program): Use print-program.

	* module/system/vm/frame.scm (frame-call-representation): Remove attempt
	  to abbreviate procedure representations; was confusing because the
	  result would write as a string, quotes and all.

2014-05-04  Andy Wingo  <wingo@pobox.com>

	Refactorings to apply-hook and push-continuation-hook
	* libguile/vm-engine.c (vm_engine): Always invoke the apply hook after
	  the ip has been reset.  Avoids problems in frame-bindings, which
	  builds its bindings map based on the IP.  Invoke push-continuation
	  before linking the new frame, so that more locals are available to the
	  frame inspector.

	* module/system/vm/traps.scm (trap-in-procedure): No need for a
	  push-cont handler, as the apply handler will exit the frame.

2014-05-04  Andy Wingo  <wingo@pobox.com>

	frame-address, frame-stack-pointer return offsets
	* libguile/frames.c (scm_frame_address, scm_frame_stack_pointer): Return
	  offsets instead of absolute pointers.  This is robust in the presence
	  of stack relocation.

	* module/system/repl/debug.scm (print-registers): Adapt to print sp and
	  fp as integers.

2014-05-04  Andy Wingo  <wingo@pobox.com>

	frame-call-representation has #:top-frame? as keyword argument
	* module/system/vm/frame.scm (frame-call-representation): Change
	  top-frame? argument to be a keyword instead of an optional argument.

	* module/system/vm/trace.scm (print-application): Adapt caller.

2014-05-03  Andy Wingo  <wingo@pobox.com>

	Set-car! on a dead pair does not force the pair to be live
	* module/language/cps/dce.scm (constant-type, lookup-type)
	  (default-type-checker, *primcall-type-checkers*)
	  (define-primcall-type-checker, define-simple-primcall-types)
	  (check-primcall-arg-types): Define a really lame type analysis that
	  can elide some expressions causing &type-check.
	  (compute-live-code): Wire up the type checker.

	Add auxiliary definitions for boxes
	* module/language/cps/cse.scm (compute-equivalent-subexpressions): Add
	  auxiliary definitions for boxes.

2014-05-02  Andy Wingo  <wingo@pobox.com>

	CSE does scalar replacement of aggregates
	* module/language/cps/effects-analysis.scm (effects-clobber): New
	  helper.
	  (length): Only depend on &cdr.
	  (synthesize-definition-effects!): New interface.

	* module/language/cps/cse.scm (compute-available-expressions): Don't
	  count out constructors here -- we'll do that below.
	  (compute-defs): Add a comment.
	  (compute-equivalent-subexpressions): Synthesize getter calls at
	  constructor/setter sites, so that (set-car! x y) can cause a
	  future (car x) to just reference y.  The equiv-labels set now stores
	  the defined vars, so there is no need for the defs vector.
	  (cse, apply-cse): Adapt to compute-equivalent-subexpressions change.

2014-05-02  Andy Wingo  <wingo@pobox.com>

	More inlinable effects-analysis procedures
	* module/language/cps/effects-analysis.scm (exclude-effects)
	  (effect-free?, constant?): Define to be inlinable.
	  (allocate-struct/immediate): Add effects.

	Update NEWS
	* NEWS: Update.

2014-05-01  Andy Wingo  <wingo@pobox.com>

	Rewrite boot-9 map to be recursive and pure
	* module/ice-9/boot-9.scm (map): Rewrite to be recursive and pure
	  instead of iterative and effectful.  At best this is faster; at worst
	  it is slower.  In any case it resolves continuation-related issues.

	* module/srfi/srfi-1.scm (fold): Specialize the two-arg case.
	  (map): Rewrite to be recursive.

	* test-suite/tests/r5rs_pitfall.test (8.3): Update for new expected map
	  behavior.

2014-05-01  Andy Wingo  <wingo@pobox.com>

	Fix inner and outer stack cuts to match on procedure code
	* doc/ref/api-debug.texi (Stack Capture): Update make-stack docs.

	* libguile/programs.h:
	* libguile/programs.c (scm_program_address_range): New internal
	  procedure.

	* libguile/stacks.c (narrow_stack): Interpret a pair of integers as an
	  address range.  If a cut is a procedure, attempt to resolve it to an
	  address range.
	  (scm_make_stack): Update docstring.

	* module/system/vm/program.scm (program-address-range): New exported
	  procedure.

	* module/statprof.scm (statprof, gcprof): Use program-address-range to
	  get the outer-cut, for efficiency.

2014-04-28  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		.gitignore
		doc/example-smob/Makefile
		doc/ref/api-smobs.texi
		doc/ref/libguile-concepts.texi
		doc/ref/libguile-smobs.texi
		libguile.h
		libguile/finalizers.c
		libguile/finalizers.h
		libguile/goops.c
		module/language/tree-il/compile-glil.scm
		module/oop/goops.scm

2014-04-28  Andy Wingo  <wingo@pobox.com>

	Prefer foreign objects over smobs in manual
	* doc/ref/api-memory.texi (Memory Blocks): Recommend against
	  scm_gc_free.  Refer to foreign objects instead of smobs.  Remove
	  discussion of scm_must_malloc et al.

	* doc/ref/guile.texi (API Reference): Rename SMOB menu item.

	* doc/ref/libguile-snarf.texi (Function Snarfing): Update example to not
	  refer to smobs.
	* doc/ref/tools.texi (How guile-snarf works): Likewise.

2014-04-28  Andy Wingo  <wingo@pobox.com>

	Add new standalone tests to gitignore
	* .gitignore: Add entries.

2014-04-28  Andy Wingo  <wingo@pobox.com>

	Remove doc/example-smob/
	* doc/example-smob/: Remove example.  It's smaller than it used to be in
	  Guile 1.8, and with foreign objects there's practically nothing
	  interesting to test.

	* doc/oldfmt.c: Remove this hoary thing.

	* doc/README:
	* doc/Makefile.am: Update.

2014-04-28  Andy Wingo  <wingo@pobox.com>

	Remove SMOB tutorial; update manual.
	* doc/ref/libguile-smobs.texi: Remove; this tutorial is superseded by
	  libguile-foreign-objects.

	* doc/ref/libguile-foreign-objects.texi: Proofreading.

	* doc/ref/libguile-program.texi: Update Dia examples to refer to foreign
	  objects.

	* doc/ref/libguile-concepts.texi (Garbage Collection): Update to
	  accurately describe the BDW-GC, and to avoid reference to mark
	  functions.

	* doc/ref/guile.texi: Remove libguile-smobs, and reword API menu.

	* doc/ref/api-utility.texi (Equality): Mention GOOPS instead of SMOBs.

	* doc/ref/api-smobs.texi (Smobs): Describe as a legacy interface.
	  Exhort readers against the writing of mark functions.

	* doc/ref/api-foreign-objects.texi (Foreign Objects): Proofreading.

	* doc/ref/api-control.texi (Catch): Fix ref to point to foreign
	  objects.

	* doc/ref/Makefile.am: Remove libguile-smobs.texi.

2014-04-28  Andy Wingo  <wingo@pobox.com>

	Add foreign object documentation
	* doc/ref/api-foreign-objects.texi:
	* doc/ref/libguile-foreign-objects.texi: New files.

	* doc/ref/guile.texi:
	* doc/ref/Makefile.am: Link new files into docs.

2014-04-28  Andy Wingo  <wingo@pobox.com>

	Add more foreign object interfaces
	* libguile/foreign-object.c:
	* libguile/foreign-object.h (scm_make_foreign_object_1)
	  (scm_make_foreign_object_2, scm_make_foreign_object_3)
	  (scm_make_foreign_object_n): Change to take void * arguments, and to
	  add a comment to the header indicating that these are convenience
	  constructors.

	* libguile/foreign-object.c:
	* libguile/foreign-object.h (scm_foreign_object_unsigned_ref)
	  (scm_foreign_object_unsigned_set_x): New functions, equivalent to the
	  old scm_foreign_object_ref and scm_foreign_object_set_x.

	* libguile/foreign-object.c:
	* libguile/foreign-object.h (scm_foreign_object_signed_ref)
	  (scm_foreign_object_signed_set_x): New functions taking
	  scm_t_signed_bits.

	* libguile/foreign-object.c:
	* libguile/foreign-object.h (scm_foreign_object_ref)
	  (scm_foreign_object_set_x): New functions that take void*.

2014-04-28  Andy Wingo  <wingo@pobox.com>

	Avoid non-constant struct initializers
	* libguile/foreign-object.c (scm_make_foreign_object_2):
	  (scm_make_foreign_object_3): Avoid non-constant struct initializers.

2014-04-28  Andy Wingo  <wingo@pobox.com>

	Add scm_make_foreign_object_0; optimize scm_make_foreign_object_n.
	* libguile/foreign-object.c (scm_make_foreign_object_0): New function.
	  (scm_make_foreign_object_n): Pre-fetch layout_chars.

	* libguile/foreign-object.h: Add scm_make_foreign_object_0.

2014-04-28  Andy Wingo  <wingo@pobox.com>

	New foreign object facility, to replace SMOBs
	* libguile/foreign-object.c:
	* libguile/foreign-object.h:
	* module/system/foreign-object.scm:
	* test-suite/standalone/test-foreign-object-c.c:
	* test-suite/standalone/test-foreign-object-scm: New files.

	* test-suite/standalone/Makefile.am:
	* module/Makefile.am:
	* libguile/Makefile.am: Add new files.

	* libguile.h: Add foreign-object.h.
	* libguile/init.c (scm_i_init_guile): Call scm_register_foreign_object.

2014-04-27  Andy Wingo  <wingo@pobox.com>

	Fix foreign slot initialization and access
	* libguile/goops.c (scm_sys_initialize_object): Refactor initialization
	  so that we don't ref uninitialized slots before initializing them.
	  This allows foreign slots, whose initial value is 0, to be initialized
	  via #:init-form.

	* module/oop/goops.scm (@slot-ref, @slot-set!): Remove definitions.
	  Change callers to use struct-ref and struct-set!.  slot-ref and
	  slot-set! were only marginally more efficient and were much more
	  dangerous.  This change allows the standard accessors to work on
	  foreign slots; that was not the case before, as the 'u' fields of the
	  struct were read as if they were 'p' slots.
	* module/language/tree-il/compile-glil.scm (lambda): Remove support for
	  compiling @slot-ref/@slot-set!.  These were private to GOOPS.

	* test-suite/tests/goops.test ("active-slot"): Update to not expect a
	  ref before initialization.
	  ("foreign slots"): Add tests.

2014-04-26  Andy Wingo  <wingo@pobox.com>

	Add interface to disable automatic finalization
	* libguile/finalizers.h:
	* libguile/finalizers.c (run_finalizers_async_thunk): Call the new
	  scm_run_finalizers helper.
	  (scm_set_automatic_finalization_enabled, scm_run_finalizers): New
	  functions.
	  (scm_init_finalizers): Only set a finalizer notifier if automatic
	  finalization is enabled.

	* doc/ref/libguile-smobs.texi (Garbage Collecting Smobs): Add discussion
	  of concurrency.

	* doc/ref/api-smobs.texi (Smobs): Document new functions.

2014-04-25  Mark H Weaver  <mhw@netris.org>

	Merge branch 'stable-2.0'
	Conflicts:
		GUILE-VERSION
		NEWS
		guile-readline/ice-9/readline.scm
		libguile/async.c
		libguile/backtrace.c
		libguile/deprecated.h
		libguile/gc-malloc.c
		libguile/gdbint.c
		libguile/init.c
		libguile/ioext.c
		libguile/mallocs.c
		libguile/print.c
		libguile/rw.c
		libguile/scmsigs.c
		libguile/script.c
		libguile/simpos.c
		libguile/snarf.h
		libguile/strports.c
		libguile/threads.c
		libguile/vm-i-scheme.c
		libguile/vm-i-system.c
		module/srfi/srfi-18.scm
		test-suite/Makefile.am
		test-suite/standalone/test-num2integral.c

	print: Fix printing of weak vectors.
	* libguile/print.c (print_vector_or_weak_vector): New static function.
	  (iprin1): Use 'print_vector_or_weak_vector' in the vector and weak
	  vector cases.

	Support weak vectors, arrays, and bitvectors in (system base types).
	* module/system/base/types.scm (%tc7-wvect, %tc7-array, %tc7-bitvector):
	  New variables.
	  (cell->object): Add cases for weak vectors, arrays, and bitvectors.

	print: avoid triggering deprecation warnings when printing weak vectors.
	* libguile/print.c (iprin1): Use 'scm_c_weak_vector_ref' to access
	  elements of weak vectors.

2014-04-24  Ludovic Courtès  <ludo@gnu.org>

	build: Clean up rules for meta/{guild,guile-config}.
	* meta/Makefile.am (guile-config, guild): Avoid useless 'cat'
	  invocation'.  Quote all occurrences of '@'.
	  Suggested by Eric Blake <eblake@redhat.com>.

	build: Clean up rules for meta/{guild,guile-config}.
	* meta/Makefile.am (guile-config, guild): Avoid useless 'cat'
	  invocation'.  Quote all occurrences of '@'.
	  Suggested by Eric Blake <eblake@redhat.com>.

	build: Honor program name transformation in 'guild'.
	* configure.ac: Remove erroneous 'guile_program_name' substitute; see
	  <https://lists.gnu.org/archive/html/autoconf/2014-04/msg00010.html>
	  for details.  Remove 'meta/guild' config file.
	* meta/Makefile.am (guild): New target.
	  (CLEANFILES): Add 'guild'.
	* meta/guild.in: Remove 'prefix' and 'exec_prefix' definitions; use
	  @installed_guile@.

	build: Honor program name transformation in 'guild'.
	* configure.ac: Remove erroneous 'guile_program_name' substitute; see
	  <https://lists.gnu.org/archive/html/autoconf/2014-04/msg00010.html>
	  for details.  Remove 'meta/guild' config file.
	* meta/Makefile.am (guild): New target.
	  (CLEANFILES): Add 'guild'.
	* meta/guild.in: Remove 'prefix' and 'exec_prefix' definitions; use
	  @installed_guile@.

2014-04-23  Ludovic Courtès  <ludo@gnu.org>

	Set $GC_MARKERS to 1 when libgc 7.4.0 is used.
	* libguile/gc.c (scm_storage_prehistory) [GC_VERSION == 7.4.0]: Add
	  'setenv' call.

2014-04-22  Dmitry Bogatov  <KAction@gnu.org>

	Fix memory leak on `realloc' failure
	* libguile/script.c (realloc0): New helper.
	  (script_read_arg, scm_get_meta_args): Use realloc0, not realloc.

2014-04-22  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	ARM: Do not leave early init_jit if /proc is not mounted.
		* lib/jit_arm.c: Do not get confused with default settings
		if /proc is not mounted on Linux specific code path.

2014-04-21  Andy Wingo  <wingo@pobox.com>

	Add make-vector opcode
	* libguile/vm-engine.c (make-vector): New opcode.
	* module/language/cps/compile-bytecode.scm (compile-fun):
	* module/system/vm/assembler.scm (system): Support the new opcode.
	  (*bytecode-minor-version*): Bump.

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

	* test-suite/tests/compiler.test ("limits"): Add vector test.

2014-04-21  Andy Wingo  <wingo@pobox.com>

	Operations on 8-bit and 12-bit operands shuffle args into range
	* module/language/cps/slot-allocation.scm (allocate-slots): Avoid
	  allocating locals in the range [253,255].

	* module/system/vm/assembler.scm: List exports explicitly.  For
	  operations with limited-range operands, export wrapper assemblers that
	  handle shuffling their operands into and out of their range.
	  (define-assembler): Get rid of enclosing begin.
	  (shuffling-assembler, define-shuffling-assembler): New helpers to
	  define shuffling wrapper assemblers.
	  (emit-mov*, emit-receive*): New functions.
	  (shuffle-up-args): New helper.
	  (standard-prelude, opt-prelude, kw-prelude): Call shuffle-up-args
	  after finishing.

	* test-suite/tests/compiler.test ("limits"): Add test cases.

2014-04-21  Andy Wingo  <wingo@pobox.com>

	More expansion-time-only definitions in assembler.scm
	* module/system/vm/assembler.scm (define-inline): Change so that the
	  defined macro is only defined at expansion-time.
	  (u32-ref, u32-set!, s32-ref, s32-set!, pack-arity-flags): Use
	  define-inline.
	  (pack-flags, assert-match, *block-size*, id-append, assembler)
	  (define-assembler, visit-opcodes, define-macro-assembler): Wrap in
	  eval-when expand.

	define-inline in assembler.scm
	* module/system/vm/assembler.scm (define-inline): New local helper.
	  Update local users of define-inlinable to use it.

2014-04-20  Andy Wingo  <wingo@pobox.com>

	VM opcodes only have <24-bit slot operands in the first word
	* libguile/vm-engine.c (make-array): Change to only have
	  restricted-width operands in the first word.  This instruction is
	  currently unused, however.

	* module/system/vm/assembler.scm (assembler):
	* module/system/vm/disassembler.scm (disassembler): Disallow
	  restricted-width operands in tail words.

2014-04-17  Andy Wingo  <wingo@pobox.com>

	Add interface to disable automatic finalization
	* libguile/finalizers.h:
	* libguile/finalizers.c (run_finalizers_async_thunk)
	  (finalization_thread_proc): Call the new scm_run_finalizers helper.
	  (scm_i_finalizer_pre_fork): Only spawn the thread if automatic
	  finalization is enabled.
	  (scm_set_automatic_finalization_enabled, scm_run_finalizers): New
	  functions.
	  (scm_init_finalizers, scm_init_finalizer_thread): Only set a finalizer
	  notifier if automatic finalization is enabled.

	* doc/ref/libguile-smobs.texi (Garbage Collecting Smobs): Add discussion
	  of concurrency.

	* doc/ref/api-smobs.texi (Smobs): Document new functions.

2014-04-16  Andy Wingo  <wingo@pobox.com>

	Slot allocation can re-use closure and argument slots
	* module/language/cps/slot-allocation.scm (allocate-slots): Allow slot
	  allocation to re-use the closure and argument slots.

	Remove SCM_FRAME_PROGRAM
	* libguile/frames.h: Remove SCM_FRAME_PROGRAM, now unused.

2014-04-16  Andy Wingo  <wingo@pobox.com>

	VM robustness for optimized closures
	* libguile/vm.c (vm_error_unbound, vm_error_unbound_fluid): Remove proc
	  argument.  The value in slot 0 is not necessarily the procedure being
	  applied, after the prelude is done.

	* libguile/vm-engine.c (vm_engine): Use LOCAL_REF (0) instead of
	  SCM_FRAME_PROGRAM, and adapt to above changes.

2014-04-16  Andy Wingo  <wingo@pobox.com>

	Fix rewinding continuations when outermost frame has zero locals
	* libguile/vm.c (vm_reinstate_partial_continuation_inner): Fix boundary
	  condition when the outermost frame has zero locals.

	frame-previous, frame-procedure robustness
	* libguile/frames.c (scm_c_frame_closure): Don't use SCM_FRAME_PROGRAM,
	  as we don't know if the frame actually has any locals.
	  (scm_c_frame_previous): More robustly detect end-of-stack.  Allows
	  scm_c_frame_previous to work on partial continuations.

	make-stack works on delimited continuations
	* libguile/stacks.c (scm_make_stack, scm_stack_id):
	* libguile/vm.c (scm_i_vm_cont_to_frame): Allow delimited continuations
	  as the argument to make-stack.

	More robust coverage tests
	* test-suite/tests/coverage.test ("line-execution-counts"): Allow zero
	  or one count on the loop head.

	Change some make-stack tests to use frame-call-representation
	* test-suite/tests/eval.test ("stacks"): Use frame-call-representation.

	Fix statprof for optimizations
	* module/statprof.scm (profile-signal-handler): Bind in a letrec.
	  Otherwise the compiler may see the closure slot as dead, and the inner
	  stack cut won't work.

	Fix a frame-call-representation bug
	* module/system/vm/frame.scm (frame-call-representation): Fix logic for
	  displaying names of non-procedures and procedures out of arities.

2014-04-16  Andy Wingo  <wingo@pobox.com>

	Better backtraces from C, especially for optimized closures
	* libguile/frames.h:
	* libguile/frames.c (scm_frame_call_representation): New interface;
	  dispatches to Scheme.

	* libguile/backtrace.c (display_application): Use
	  scm_frame_call_representation.  This should be monotonically better,
	  given that scm_frame_arguments (which was previously called) also
	  dispatched to Scheme and actually ended up calling
	  frame-call-representation.

2014-04-16  Andy Wingo  <wingo@pobox.com>

	frame-call-representation checks available-bindings, as appropriate
	* module/system/vm/frame.scm (available-bindings): Map indexes in such a
	  way that the first argument is index 1.
	  (frame-call-representation): Update to search the bindings for live
	  bindings.

2014-04-16  Andy Wingo  <wingo@pobox.com>

	Update frame-bindings interface
	* module/system/repl/debug.scm (print-locals): Update to work with new
	  interface.
	  (frame->module): Update.  Still doesn't work due to lack of
	  `program-module', though.

	* module/system/vm/program.scm (make-binding, binding:name)
	  (binding:definition-offset, program-arity-bindings-for-ip): Remove
	  these.

	* module/system/vm/frame.scm (<binding>): New type.
	  (available-bindings): Return a list of <binding> instances.
	  (frame-lookup-binding, frame-binding-set!, frame-binding-ref):
	  (frame-environment, frame-object-name): Adapt.

2014-04-16  Andy Wingo  <wingo@pobox.com>

	Implement frame-bindings
	* module/system/vm/frame.scm (parse-code, compute-predecessors):
	  (compute-genv, compute-defs-by-slot, compute-killv, available-bindings):
	  (frame-bindings): Add a bunch of hairy code to compute the set of
	  bindings that are live in a frame.

	Add arity-code
	* module/system/vm/debug.scm (arity-code): New interface.

	Add parsing interfaces to the disassembler
	* module/system/vm/disassembler.scm (instruction-length):
	  (instruction-has-fallthrough?, instruction-relative-jump-targets):
	  (instruction-slot-clobbers): New interfaces; to be used when
	  determining the bindings available at a given point of a procedure.

	Fix up some opcode metadata
	* libguile/vm-engine.c (make-long-immediate, static-ref): Mark as "dst"
	  instructions.

2014-04-16  Mark H Weaver  <mhw@netris.org>

	Update libgc URL in README.
	* README: Update libgc URL.  Suggested by Ian Grant
	  <ian.a.n.grant@googlemail.com>.

2014-04-15  Andy Wingo  <wingo@pobox.com>

	Add ability to query local definitions for a procedure
	* module/system/vm/debug.scm (arity-definitions): New interface.

	* module/system/vm/program.scm (make-binding, binding:boxed?)
	  (binding:index, binding:start, binding:end): Remove.
	  (binding:definition-offset, binding:slot): Add.
	  (program-arity-bindings-for-ip): Rename from program-bindings-for-ip,
	  as it gives all definitions in an arity.  The user will have to do
	  data-flow analysis to recover the set of variables that are actually
	  available at any given point.
	  (arity->arguments-alist): Remove crufty code.

2014-04-15  Andy Wingo  <wingo@pobox.com>

	Fix rtl tests
	* module/system/vm/assembler.scm (write-arities): Add a diagnostic.

	* test-suite/tests/rtl.test: Fix tests to emit "definition"
	  instructions.

2014-04-15  Andy Wingo  <wingo@pobox.com>

	Fix frame-call-representation for primitive applications
	* module/system/vm/frame.scm (frame-call-representation): Fix to work
	  for primitives.

	* test-suite/tests/eval.test ("stacks"): Update expected result for
	  substring.

2014-04-15  Andy Wingo  <wingo@pobox.com>

	Assembler residualizes local variable definition locations
	* module/system/vm/assembler.scm (write-arities): Serialize definition
	  locations after names.
	  (definition): Store definition as a byte offset.

	Bump minor objcode version for recent changes
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION):
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.

2014-04-15  Andy Wingo  <wingo@pobox.com>

	Write all local variable names into the arities section
	* module/system/vm/assembler.scm (put-uleb128, put-sleb128)
	  (port-position): Lift out these helpers.
	  (arity-header-len, write-arities, link-arities): Add "nlocals" to the
	  arity headers.  Write names of all locals into the arities section,
	  not just the arguments.  Write them as uleb128's instead of uint32's,
	  to save space.

	* module/system/vm/debug.scm (arity-header-len, arity-nlocals*)
	  (arity-nlocals, arity-locals, arity-arguments-alist): Adapt to new
	  encoding for arities.

2014-04-15  Andy Wingo  <wingo@pobox.com>

	Tweak arities debugging representation
	* module/system/vm/assembler.scm (meta-arities-size, write-arity-links):
	* module/system/vm/debug.scm (arity-keyword-args)
	  (arity-arguments-alist): Rewrite to put they keyword literals link
	  first.  Unfortunately requires a recompile :/

2014-04-15  Andy Wingo  <wingo@pobox.com>

	Beginnings of local variable information
	* module/system/vm/assembler.scm (<arity>, begin-kw-arity, end-arity):
	  (definition): Add definition macro-instruction.  Arrange to record
	  variable definitions.

	* module/language/cps/compile-bytecode.scm (compile-fun): Emit
	  definition macro-instructions as appropriate.

2014-04-15  Andy Wingo  <wingo@pobox.com>

	Remove needless label remapping in slot-allocation
	* module/language/cps/slot-allocation.scm (dead-after-def?):
	  (dead-after-use?, allocate-slots): Remove some needless remapping
	  between label indexes in the CFA, the DFA, and their names.

	DFA datums don't rename their labels
	* module/language/cps/dfg.scm (analyze-reverse-control-flow): Don't
	  compute and return an order vector; it's not needed.
	  ($dfa): Remove label renaming.  We can just rename labels before
	  returning the DFA.
	  (dfa-k-idx, dfa-k-sym, dfa-k-count): Adapt.
	  (compute-live-variables): Adapt, and rename labels before returning.

2014-04-15  Andy Wingo  <wingo@pobox.com>

	Better backtraces for optimized closures
	* module/system/vm/debug.scm (arity-keyword-args, find-program-arity):
	  New exports.

	* module/system/vm/frame.scm (frame-call-representation): Prefer to use
	  the frame IP to get the procedure.

2014-04-14  Andy Wingo  <wingo@pobox.com>

	statprof avoids mucking with VM trace levels when not counting calls
	* module/statprof.scm (statprof-start, statprof-stop): Don't futz the vm
	  trace level when we aren't counting calls.  With this change, statprof
	  now imposes no overhead on the measured program.

	Better state handling in statprof
	* module/statprof.scm (statprof-fold-call-data)
	  (statprof-proc-call-data): Add optional state arg.
	  (gcprof): Add optional port arg, and pass state arg explicitly.
	  (statprof-display-anomalies, statprof-display)
	  (statprof-call-data->stats): Pass state explicitly.

2014-04-14  Andy Wingo  <wingo@pobox.com>

	Optimize make-stack
	* libguile/continuations.h:
	* libguile/continuations.c (scm_i_continuation_to_frame): Operate on
	  low-level C structures instead of heap objects.

	* libguile/frames.h:
	* libguile/frames.c (frame_offset, frame_stack_base): Const args.
	  (scm_c_frame_closure): New helper.
	  (scm_frame_procedure): Use the new helper.

	* libguile/stacks.c (stack_depth, narrow_stack, scm_make_stack): Rework
	  to avoid allocating frames as we traverse the stack, and to avoid an
	  n**2 case where there are outer cuts.

2014-04-14  Andy Wingo  <wingo@pobox.com>

	Readline history preserves newlines
	* guile-readline/ice-9/readline.scm (make-readline-port): Preserve
	  newlines.  This preserves the semantics of history entries that
	  contain until-end-of-line comments using `;'.

2014-04-14  Andy Wingo  <wingo@pobox.com>

	scm_c_make_frame takes struct scm_frame as arg
	* libguile/frames.h:
	* libguile/frames.c (scm_c_make_frame): Adapt to take a const struct
	  scm_frame as the argument.  Adapt callers.

	* libguile/continuations.c:
	* libguile/stacks.c: Adapt callers.

2014-04-14  Andy Wingo  <wingo@pobox.com>

	Refactor to frames code
	* libguile/frames.h:
	* libguile/frames.c (scm_c_frame_previous): New internal helper.
	  (scm_frame_previous): Use the helper.
	  (RELOC): Take kind and low-level frame args separately.  Adapt
	  callers.
	  (frame_stack_base, frame_offset): New helpers.
	  (scm_i_frame_offset, scm_i_frame_stack_base): Use low-level helpers.

	Optimize make-global-cont-folder
	* module/language/cps.scm (make-global-cont-folder): Inline the
	  fold-values, as peval doesn't do so.  Allows closure conversion to
	  avoid any closure creation.

2014-04-13  Andy Wingo  <wingo@pobox.com>

	Improve disassembly for optimized closures
	* module/system/vm/disassembler.scm (code-annotation): Add call-label
	  and tail-call-label cases.
	  (disassemble-addr): With call-label we can see sets of mutually
	  recursive functions, so keep a global "visited?" set.

	Remove debugging code in closure-conversion
	* module/language/cps/closure-conversion.scm (prune-free-vars): Remove
	  pk.

	Eval has no more free variables
	* module/ice-9/eval.scm (primitive-eval): Expand out the call to
	  make-general-closure, so that make-general-closure becomes
	  well-known.  Now eval has no more free variables!

	Closure conversion eliminates self-references introduced by fixpoint
	* module/language/cps/closure-conversion.scm (analyze-closures): Build a
	  bound-vars set as well, to resolve introduced self-references.
	  (prune-free-vars, convert-one): Arrange to eliminate self-references.

	Refactor to closure-conversion
	* module/language/cps/closure-conversion.scm (convert-one): Refactor to
	  pull in helpers locally, as they will need more state.

	Avoid consing an unbound-arg marker in the evaluator
	* module/ice-9/eval.scm (primitive-eval): Turns out we don't need to
	  cons to make the unbound-arg marker.

	Optimize closures with one free variable
	* module/language/cps/closure-conversion.scm (convert-free-var)
	  (allocate-closure, init-closure, prune-free-vars, convert-one)
	  (convert-closures): Optimize closures with one free variable.

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

	Well-known closures represented using pairs or vectors
	* module/language/cps/closure-conversion.scm (convert-free-var):
	  (convert-free-vars): Take self-known? param, to do the right thing for
	  well-known closures.
	  (allocate-closure): New helper.  Well-known closures are represented
	  using pairs or vectors.
	  (init-closure): Adapt tpo DTRT for well-known closures.
	  (prune-free-vars): Move up.
	  (convert-one): Adapt to new well-known closure representation.

	Update verify-cps
	* module/language/cps/verify.scm (verify-cps): Update for recent CPS
	  changes.

	Avoid creating closures with no free variables
	* module/language/cps/closure-conversion.scm (init-closure): Return just
	  one value.
	  (analyze-closures): Rewrite the well-known set to key off the label
	  instead of the closure identifiers before returning.
	  (convert-one): Avoid creating closure objects at runtime or load-time
	  when "instantiating" or calling well-known closures with no free
	  variables.
	  (prune-free-vars): New pass.
	  (convert-closures): Adapt.

	Hard-wire calls to known procedures
	* module/language/cps/closure-conversion.scm (analyze-closures):
	  (convert-one, convert-closures): Hard-wire calls to known procedures
	  by transforming $call to $callk.

	closure conversion computes well-known functions
	* module/language/cps/closure-conversion.scm (analyze-closures)
	  (convert-closures, convert-one): Adapt to compute well-known
	  functions.  We don't yet produce $callk though.

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

	First-order CPS has $program and $closure forms
	* module/language/cps.scm ($closure, $program): New CPS types, part of
	  low-level (first-order) CPS.
	  (build-cps-exp, build-cps-term, parse-cps, unparse-cps)
	  (compute-max-label-and-var): Update for new CPS types.

	* module/language/cps/closure-conversion.scm: Rewrite to produce a
	  $program with $closures, and no $funs.

	* module/language/cps/reify-primitives.scm:
	* module/language/cps/compile-bytecode.scm (compile-fun):
	  (compile-bytecode): Adapt to new first-order format.

	* module/language/cps/dfg.scm (compute-dfg): Add $closure case.

	* module/language/cps/renumber.scm (renumber): Allow this pass to work
	  on either format.

	* module/language/cps/slot-allocation.scm (allocate-slots): Add $closure
	  case.

2014-04-11  Andy Wingo  <wingo@pobox.com>

	Separate make-cont-folder into global and local variants
	* module/language/cps.scm (make-global-cont-folder)
	  (make-local-cont-folder): Separate this macro in two.  It's hot and
	  the difference can be important for perf.

	* module/language/cps/dfg.scm (compute-label-and-var-ranges):
	* module/language/cps/cse.scm (compute-label-and-var-ranges):
	* module/language/cps/dce.scm (compute-live-code): Adapt.

2014-04-11  Andy Wingo  <wingo@pobox.com>

	Root higher-order CPS term is always $kfun $cont
	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/prune-bailouts.scm:
	* module/language/cps/prune-top-level-scopes.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/self-references.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/tree-il/compile-cps.scm: Adapt to produce and consume
	  raw $kfun $cont instances.

	* .dir-locals.el: Update $letrec indentation.

2014-04-11  Andy Wingo  <wingo@pobox.com>

	Closure conversion, reify-primitives use $kfun $cont
	* module/language/cps/closure-conversion.scm: Produce a $kfun $cont.
	* module/language/cps/reify-primitives.scm: Produce and consume $kfun
	  $cont.
	* module/language/cps/compile-bytecode.scm: Adapt.

2014-04-11  Andy Wingo  <wingo@pobox.com>

	Preparation for compile-bytecode to work on $kfun $conts
	* module/language/cps/compile-bytecode.scm (compile-fun): Change to take
	  a $kfun $cont instead of a $fun.
	  (visit-funs): Change likewise, and call the proc on $kfun $cont's, not
	  $fun's.
	  (compile-bytecode): Adapt.

	* module/language/cps/dfg.scm (analyze-reverse-control-flow): Adapt to
	  expect a $kfun $cont.

2014-04-11  Andy Wingo  <wingo@pobox.com>

	compute-dfg takes a $kfun $cont, not a $fun
	* module/language/cps/dfg.scm (compute-dfg): Take a $kfun $cont instead
	  of a $fun.

	* module/language/cps/arities.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/specialize-primcalls.scm: Adapt callers.

2014-04-11  Andy Wingo  <wingo@pobox.com>

	with-fresh-name-state takes a cont, not a $fun
	* module/language/cps.scm (with-fresh-name-state): Take a cont instead
	  of a fun.

	* module/language/cps/closure-conversion.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/prune-bailouts.scm:
	* module/language/cps/reify-primitives.scm: Adapt.

2014-04-11  Andy Wingo  <wingo@pobox.com>

	Function defined by make-cont-folder takes a cont, not a $fun
	* module/language/cps.scm (make-cont-folder): Take a cont instead of a
	  $fun.
	  (with-fresh-name-state): Adapt.

	* module/language/cps/cse.scm (compute-label-and-var-ranges):
	* module/language/cps/dce.scm (compute-live-code):
	* module/language/cps/dfg.scm (compute-dfg):
	* module/language/cps/elide-values.scm (elide-values):
	* module/language/cps/reify-primitives.scm (reify-primitives):
	* module/language/cps/renumber.scm (compute-new-labels-and-vars):
	  (renumber): Adapt.

2014-04-10  Andy Wingo  <wingo@pobox.com>

	Rename $kentry to $kfun
	* module/language/cps.scm ($kfun): Rename from $kentry.

	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/prune-bailouts.scm:
	* module/language/cps/prune-top-level-scopes.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/self-references.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Adapt users.

2014-04-10  Andy Wingo  <wingo@pobox.com>

	src and meta are fields of $kentry, not $fun
	* module/language/cps.scm ($kentry, $fun): Attach "src" and "meta" on
	  the $kentry, not the $fun.  This prepares us for $callk to $kentry
	  continuations that have no corresponding $fun.

	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/cse.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/prune-bailouts.scm:
	* module/language/cps/prune-top-level-scopes.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/self-references.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Adapt.

2014-04-10  Andy Wingo  <wingo@pobox.com>

	Remove tests for old Tree-IL CSE module
	* test-suite/tests/cse.test: Remove.
	* test-suite/Makefile.am:

2014-04-09  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Do not export private definitions and types.
		* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
		include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
		include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
		include/lightning/jit_private.h, include/lightning/jit_s390x.h,
		include/lightning/jit_sparc.h, include/lightning/jit_x86.h:
		Do not add jit_regset_t, JIT_RA0, and JIT_FA0 to the installed
		header file. These types and definitions are supposed to be
		only used internally.

2014-04-09  Andy Wingo  <wingo@pobox.com>

	Remove obsolete comment in compile-bytecode.scm
	* module/language/cps/compile-bytecode.scm (optimize): Remove an
	  obsolete comment.

2014-04-08  Andy Wingo  <wingo@pobox.com>

	New pass to avoid free variable creation for self-recursion
	* module/language/cps/self-references.scm: New pass, avoids the need for
	  self-recursion to allocate free variables.

	* module/Makefile.am:
	* module/language/cps/compile-bytecode.scm: Wire up the new pass.

2014-04-08  Andy Wingo  <wingo@pobox.com>

	Compile some standalone tests to bytecode
	* test-suite/standalone/test-out-of-memory:
	* test-suite/standalone/test-stack-overflow: Compile these files before
	  running them.  That way, recursion can check the stack-overflow
	  mechanism instead of the memory allocation mechanism.  We compile
	  beforehand as a prepass so as not to impose an rlimit on a Guile that
	  previously ran auto-compilation.

2014-04-06  Andy Wingo  <wingo@pobox.com>

	Remove old Tree-IL CSE pass
	* module/language/tree-il/cse.scm: Delete.

	* module/language/tree-il/optimize.scm: Remove use of Tree-IL CSE.

	* module/Makefile.am: Remove language/tree-il/cse.scm.

	* module/language/cps/compile-bytecode.scm: Rename CSE keyword to
	  #:cse?.

2014-04-06  Andy Wingo  <wingo@pobox.com>

	Flow-sensitive analysis of truth values
	* module/language/cps/cse.scm (compute-truthy-expressions):
	  (compute-equivalent-subexpressions, apply-cse): Arrange to infer
	  truthiness of expressions, and use that information to elide redundant
	  tests.

2014-04-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	GNU lightning 2.0.4 release

2014-04-05  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	ARM: Do not emit a nop stack adjust instruction.
		lib/jit_arm-cpu.c: Only adjust stack pointer in prolog if
		need stack space, that is, do not emit a nop instruction
		subtracting zero from the stack pointer.

2014-04-05  Andy Wingo  <wingo@pobox.com>

	Add effects for specialized primitives
	* module/language/cps/effects-analysis.scm (make-vector)
	  (make-vector/immediate, vector-ref/immediate, vector-set!/immediate)
	  (struct-ref/immediate, struct-set!/immediate): Add effects.

	Minor cleanup/optimization in CSE
	* module/language/cps/cse.scm (compute-available-expressions): Remove
	  needless for-each definition.
	  (compute-equivalent-subexpressions): Optimize for-each/2.

	Prune bailouts after contification
	* module/language/cps/compile-bytecode.scm (optimize): Prune bailouts
	  after contifying, so that we return to the tail of the contified
	  function.

2014-04-05  Andy Wingo  <wingo@pobox.com>

	Match and srfi-9 expose their bailouts to the CSE pass
	* module/ice-9/match.upstream.scm (match-next): Inline a call to
	  "error", so the new CSE pass will see this case as a bailout.

	* module/srfi/srfi-9.scm (throw-bad-struct): Reimplement as a syntax
	  rule, so that the CSE pass sees the "throw" call.

2014-04-05  Andy Wingo  <wingo@pobox.com>

	Remove &bailout; replace uses of &unknown-effects with &all-effects
	* module/language/cps/effects-analysis.scm (&bailout): Remove effect.
	  (&unknown-effects): Remove.  Replace uses with &all-effects.
	* module/language/cps/cse.scm:

	Remove parts of CSE that deal with bailout
	* module/language/cps/cse.scm (compute-available-expressions, cse):
	  (compute-idoms, compute-equivalent-subexpressions, apply-cse): Remove
	  attempts to deal with bailout, as the bailout pass handles that
	  already.

	Add prune-bailouts pass
	* module/language/cps/prune-bailouts.scm: New pass.
	* module/language/cps/compile-bytecode.scm: Wire it up.
	* module/Makefile.am: Add new file.

	Disable Tree-IL CSE
	* module/language/tree-il/optimize.scm (optimize): Disable Tree-IL CSE
	  by default.

	Fix effects analysis for cached-module-box
	* module/language/cps/effects-analysis.scm (cached-module-box): Fix
	  expected arity.

2014-04-05  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct crash on arm in the doc/printf example.
		* lib/jit_disasm.c: Correct a crash in the doc/printf example
		on arm due to releasing the data_info information in
		jit_clear_state. This is a special case for arm only, and
		actually, only armv5 or older uses the data_info buffer,
		or when forcing arm instruction set mode besides thumb
		available.

2014-04-04  Andy Wingo  <wingo@pobox.com>

	Fix coverage expectations
	* test-suite/tests/coverage.test ("line-execution-counts"): Update
	  expectations.  Since there's nothing to do at the loop header and the
	  renaming of X happens at the end of the loops, the compiled code only
	  sees the loop header once.

	More bailout preparation work
	* module/language/cps/cse.scm (compute-available-expressions): Compute a
	  bailout set -- or at least, set things up so that we can do so.
	  (compute-idoms): Don't add predecessors that bail out.
	  (apply-cse, cse, compute-equivalent-subexpressions): Thread the
	  bailout set through the computations.

2014-04-04  Andy Wingo  <wingo@pobox.com>

	Prepare for CSE bailout propagation
	* module/language/cps/cse.scm (compute-available-expressions): Prepare
	  for being able to prune joins from bailouts.  Always loop after the
	  first iteration.

	* module/language/cps/effects-analysis.scm: Remove &possible-bailout.
	  Rename &definite-bailout to &bailout, and rename
	  &all-effects-but-bailout to &unknown-effects.

2014-04-04  Andy Wingo  <wingo@pobox.com>

	Add common subexpression elimination pass on CPS
	* module/language/cps/cse.scm: New file.
	* module/language/cps/compile-bytecode.scm: Wire up CSE, on by default.
	  Currently using the #:cps-cse? keyword.

	* module/Makefile.am: Add new file.

2014-04-04  Andy Wingo  <wingo@pobox.com>

	Effects analysis tweaks
	* module/language/cps/effects-analysis.scm: Add &fluid-environment
	  effect, a dependency of fluid-ref and fluid-set!, and an effect of
	  push-fluid/pop-fluid.
	  (list): Depend on &cdr.
	  (resolve, cached-toplevel-box, cached-module-box): Don't depend on
	  &box.

	Fix verify-cps to work
	* module/language/cps/verify.scm (verify-cps): Relax requirements for
	  variable names to be symbols.

	constant-needs-allocation? fix
	* module/language/cps/dfg.scm (constant-needs-allocation?): Constants
	  need allocation when they are used as a slot-needing operand, not when
	  they are not used as an immediate operand.  Fixes the case where one
	  var is used in both ways after CSE, in struct-set!/immediate.

	Remove variable-set! clause from compile-fun
	* module/language/cps/compile-bytecode.scm (compile-fun): Remove
	  vestigial `variable-set!' clause.

2014-04-03  Andy Wingo  <wingo@pobox.com>

	Effects analysis: define causes-all-effects?
	* module/language/cps/effects-analysis.scm (causes-all-effects?): New
	  export.

	build-cps niceties
	* module/language/cps.scm (build-cps-exp, build-cont-body): Respect
	  unquote in list builders (kargs, call, callk, primcall, and values).

	Minor CSE optimization
	* module/language/tree-il/cse.scm (cse): Use hashq instead of modulo to
	  convert a full-width hash value to a vector index.

2014-04-03  Andy Wingo  <wingo@pobox.com>

	Add with-fresh-name-state-from-dfg
	* module/language/cps/dfg.scm (with-fresh-name-state-from-dfg): New
	  helper.
	  ($dfg, compute-dfg): Store max-var and max-label in the dfg.

	* module/language/cps.scm (with-fresh-name-state): Don't raise an error
	  on recursive invocation; that was mostly useful when finding a bug.

	* module/language/cps/arities.scm (fix-arities):
	* module/language/cps/specialize-primcalls.scm (specialize-primcalls):
	  Use the new helper.

	* .dir-locals.el: Update.

2014-04-02  Andy Wingo  <wingo@pobox.com>

	(test-suite lib) uses plain old catch, not stack-catch
	* test-suite/test-suite/lib.scm (run-test-exception): Refactor to just
	  use "catch" instead of stack-catch.

	Refactor toplevel scope name generation in compile-cps
	* module/language/tree-il/compile-cps.scm (scope-counter, fresh-scope-id):
	  (toplevel-box, capture-toplevel-scope, convert, cps-convert/thunk):
	  Refactor to avoid abusing the var counter to generate scope
	  identifiers.

	compute-max-label-and-var takes letrec vars into account.
	* module/language/cps.scm (compute-max-label-and-var): Fix to take
	  letrec vars into account.

	Fix DCE for refactor-introduced borkage
	* module/language/cps/dce.scm ($fun-data, compute-live-code)
	  (process-eliminations): Fix clownshoes regarding fun-data field names
	  and order.

	Fix prune-top-level-scopes to allow collisions between var, scope, cont names
	* module/language/cps/prune-top-level-scopes.scm (compute-referenced-scopes):
	  Fix to not assume that scope names, continuation names, and var names
	  are mutually unique.
	  (prune-top-level-scopes): Better variable names.

	Update old-style REPL code for deprecation
	* module/ice-9/scm-style-repl.scm:
	* module/ice-9/save-stack.scm: As the deprecated bindings have been
	  removed from the default environment, use #:export instead of
	  #:replace.

	Remove CFA data type
	* module/language/cps/dfg.scm: Remove CFA data type.
	  (analyze-reverse-control-flow): Take min-label and label-count as
	  args, and return multiple values instead of returning a CFA object.
	  (compute-live-variables): Rework to accept multiple values from
	  analyze-reverse-control-flow.
	  ($dfa): Update comments.

	$dfa includes CFA fields
	* module/language/cps/dfg.scm ($dfa): Include CFA min-label, k-map, and
	  k-order inline.
	  (dfa-k-idx, dfa-k-sym, dfa-k-count): Adapt.
	  (compute-live-variables): Extract fields of CFA for make-dfa.
	  (print-dfa): Adapt (and fix positional record matching).

	More CFA removals
	* module/language/cps/dfg.scm (compute-reachable): Reword docstring.
	  (visit-prompt-control-flow): Likewise.
	  ($dominator-analysis): Change to store min-label instead of CFA.
	  (compute-idoms, compute-join-edges, mark-loop-body, identify-loops):
	  Take min-label and label-count, and use the DFG's preds list instead
	  of requiring a fresh renumbered one.
	  (analyze-dominators): Adapt to use a DFG with a label range instead of
	  a CFA.

	Simplify analyze-reverse-control-flow
	* module/language/cps/dfg.scm (analyze-reverse-control-flow): Use the
	  DFG's label count and min label analysis instead of rolling our own.

	analyze-control-flow only used in reverse direction; make private
	* module/language/cps/dfg.scm ($cfa): Use a vector to map labels to
	  indices.  Don't export any CFA bindings.
	  (cfa-k-idx): Adapt.
	  (compute-reachable, find-prompts, compute-interval):
	  (find-prompt-bodies, visit-prompt-control-flow): Take a DFG as an
	  argument instead of a CFA.
	  (analyze-reverse-control-flow): Refactor from analyze-control-flow, as
	  it is only used in the reverse case.  Simplify accordingly, inlining
	  the RPO sort.
	  (compute-live-variables): Adapt to call analyze-reverse-control-flow
	  instead.

2014-04-01  Andy Wingo  <wingo@pobox.com>

	Fix DFG compute-reachable bug
	* module/language/cps/dfg.scm (compute-reachable): Fix embarassing bug
	  where we wouldn't actually iterate to fixpoint.  I haven't seen it
	  yet, but that's just luck...

	Optimize two-list srfi-1 map
	* module/srfi/srfi-1.scm (map): Optimize the two-list variant.

	Speed up compute-label-and-var-ranges
	* module/language/cps/dfg.scm (compute-label-and-var-ranges): Duplicate
	  the cont-folder cases in the global/not-global cases.  Lets the
	  optimizer DTRT.

2014-04-01  Andy Wingo  <wingo@pobox.com>

	Fix compute-label-and-var-ranges for global DFG computation
	* module/language/cps/dfg.scm (compute-label-and-var-ranges): Fix to
	  work with global DFGs -- it wasn't taking $letrec into account for var
	  ranges.

	* module/language/cps/dce.scm (compute-live-code): Use bitvectors to
	  represent the live var set.

2014-04-01  Andy Wingo  <wingo@pobox.com>

	Renumber doesn't visit unreachable continuations
	* module/language/cps/renumber.scm (compute-new-labels-and-vars): Don't
	  visit functions that are not reachable.
	  (renumber): Reindent.

2014-04-01  David Kastrup  <dak@gnu.org>

	Make reverse! forego the cost of SCM_VALIDATE_LIST
	* libguile/list.c (scm_reverse_x): Do not validate first argument to
	  reverse! in advance.  Instead undo reversal in error case.

2014-04-01  Andy Wingo  <wingo@pobox.com>

	Renumber returns label/var counters for use in let-fresh
	* module/language/cps/renumber.scm (renumber): Refactor to return the
	  label and var counters as additional values.

	* module/language/cps/dce.scm (eliminate-dead-code): Use the renumber
	  label/var counters to initialize the fresh name state.

2014-04-01  Andy Wingo  <wingo@pobox.com>

	Refactor DCE to not build a CFA
	* module/language/cps/effects-analysis.scm (compute-effects): Change to
	  analyze the effects for a subrange of a DFG's continuations.

	* module/language/cps/dce.scm (compute-defs, $fun-data, compute-live-code):
	  (process-eliminations, eliminate-dead-code): Renumber before
	  eliminating dead code, to avoid computing a CFG and other data.

2014-04-01  Andy Wingo  <wingo@pobox.com>

	Simplification renumbers instead of local prune-continuation pass
	* module/language/cps/simplify.scm (simplify): Use renumbering instead
	  of rolling our own prune-continuations pass.

	DFA uses DFG var numbering
	* module/language/cps/dfg.scm ($dfa): Instead of a var-map table an a
	  syms vector, use the DFG's var numbering.
	  (dfa-var-idx, dfa-var-sym, compute-live-variables): Adapt.

	Allocate-slots avoids building CFA
	* module/language/cps/slot-allocation.scm (allocate-slots): Rework to
	  avoid computing a CFA, and just relying on the incoming term to have
	  sorted labels.

2014-04-01  Andy Wingo  <wingo@pobox.com>

	Compile-fun takes advantage of sorted output of "renumber", avoids CFA
	* module/language/cps/dfg.scm ($dfg): Rename nvars and nlabels fields to
	  var-count and label-count.  Export dfg-min-var, dfg-min-label,
	  dfg-label-count, dfg-var-count.

	* module/language/cps/compile-bytecode.scm (compile-fun): No need to
	  build a CFA given the renumbering pass.  Adapt to treat labels as
	  ordered small integer in a contiguous vector.

2014-04-01  Andy Wingo  <wingo@pobox.com>

	CPS renumbering pass sorts conts in topological order
	* module/language/cps/renumber.scm (sort-conts)
	  (compute-new-labels-and-vars): Rework to sort the labels in
	  topological order, and to prune any unreachable labels.

2014-04-01  Andy Wingo  <wingo@pobox.com>

	Add visit-cont-successors helper
	* module/language/cps/dfg.scm (lookup-successors, control-point?): Use
	  the new helper.

	* module/language/cps.scm (visit-cont-successors): New helper.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Fix analyze-control-flow to preserve order among unordered labels
	* module/language/cps/dfg.scm (analyze-control-flow): Sort blocks to
	  preserve order among unordered successors.
	  (lookup-successors): Choose a more natural order, now that it doesn't
	  matter.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Use Tree-IL-like case-lambda clause chaining in CPS
	* module/language/cps.scm ($kclause, $kentry): Instead of having an
	  entry continuation contain a list of clauses, have the clauses contain
	  clauses (as in Tree-IL).  In some ways it's not as convenient but it
	  does reflect the continuation tree correctly.

	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/prune-top-level-scopes.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/renumber.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Adapt aaaaaaall users.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Rewrite control-point? to avoid consing
	* module/language/cps/dfg.scm (control-point?): Rewrite to avoid consing
	  a successors list.

	Remove succs from DFG
	* module/language/cps/dfg.scm ($dfg): Remove "succs" from DFG.  Instead
	  we can compute the successors set on-demand.
	  (lookup-successors): Adapt.

	Simplify boot-9 and srfi-1 map
	* module/ice-9/boot-9.scm (map):
	* module/srfi/srfi-1.scm (map): Simplify the implementations to check
	  for list? beforehand.  It's faster, and it will be needed if we decide
	  to go recursive.

	Avoid consing in compute-label-and-var-ranges.
	* module/language/cps/dfg.scm (compute-label-and-var-ranges): Avoid
	  consing.

	Scope and scope-level in DFG vector
	* module/language/cps/dfg.scm ($dfg): Hoist scopes and scope levels out
	  of $block and into $dfg.  Adapt all callers.

	Predecessors and successors in DFG vectors
	* module/language/cps/dfg.scm ($dfg, $block): Record predecessors and
	  successors in vectors instead of in $block data structures.  Adapt
	  users.

	DFG refactor
	* module/language/cps/dfg.scm (lookup-cont, lookup-block):
	  (lookup-def, constant-needs-allocation?): Rework these accessors to
	  avoid completely destructuring the $dfg.

	Renumber functions before emitting code
	* module/language/cps/compile-bytecode.scm (compile-bytecode): Renumber
	  a function before going to compile it, so that the vars and labels are
	  contiguous within each function.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Add renumber module
	* module/language/cps/renumber.scm: New module.
	* module/Makefile.am: Add to build.

	fix renumber

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Replace use-map in DFG with separate def / use vectors
	* module/language/cps/dfg.scm ($dfg, $use-map): Replace use-map vector
	  with "defs" and "uses" vectors.  Adapt callers.

	Remove "sym" from $use-map
	* module/language/cps/dfg.scm ($use-map): Remove "sym" from use-map;
	  it's redundant.  Adapt callers.

	$use-map no longer has name member
	* module/language/cps/dfg.scm ($use-map): Remove name member.  Adapt
	  users.

	$dfa no longer includes name vector (can get that from dfg)
	* module/language/cps/dfg.scm ($dfa, dfa-var-name):
	  (compute-live-variables, print-dfa): Remove "names" from DFAs.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	DFG stores conts, blocks, and use-maps in vectors
	* module/language/cps/dfg.scm ($dfg): Change to store conts, blocks, and
	  use-maps as vectors.  A DFG also records the minimum label, minimum
	  variable, and the number of labels and variables.  The first entry in
	  one of these vectors corresponds to the minimum.  This can be
	  optimum in the local case if the conts and variables have been renamed
	  appropriately.

	  Adapt callers.

	  (compute-live-variables): Adapt.  This is currently suboptimal but it
	  works, so it's a useful base for optimization.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	lookup-cont takes a DFG as its argument
	* module/language/cps/dfg.scm (lookup-cont): Change to take a DFG
	  instead of a cont table.
	  (build-cont-table): Change to return a vector.

	* module/language/cps/arities.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm: Adapt to lookup-cont and
	  build-cont-table changes.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Public make-cont-folder
	* module/language/cps.scm (make-cont-folder): Add global? parameter, and
	  make public.
	  (fold-conts): Adapt.
	  (fold-local-conts): Use make-cont-folder, and take a function instead
	  of a continuation.

	* module/language/cps/arities.scm (fix-clause-arities, fix-arities*):
	* module/language/cps/compile-bytecode.scm (collect-conts):
	* module/language/cps/elide-values.scm (elide-values*): Adapt to
	  fold-local-conts change.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Vars and labels are separate namespaces
	* module/language/cps.scm (fresh-var, with-fresh-name-state): Vars have
	  their own namespace.

	Prepare for decoupling of var/label name uniqueness
	* module/language/cps/simplify.scm (compute-beta-reductions):
	  (beta-reduce): Separate state into two tables, so we can relax current
	  guarantee that vars and labels are mutually unique.

	Update verify-cps
	* module/language/cps/verify.scm (verify-cps): Vars should only be exact
	  integers now.

	CPS conversion renames incoming gensyms to small integers
	* module/language/tree-il/compile-cps.scm (fold-formals)
	  (unbound?, init-default-value, convert): Arrange to rename incoming
	  gensyms as small integers.
	  (canonicalize): Convert vector and abort here too.

	Less copying in tree-il pre-order / post-order.
	* module/language/tree-il.scm (pre-post-order): If the pre handler
	  doesn't modify the components of a tree-il expression, avoid copying a
	  new one.

	Prompt-related refactor in compile-cps
	* module/language/tree-il/compile-cps.scm (fix-prompts): New procedure.
	  Eta-expand prompts before compiling to ensure that they have inline
	  handlers.

	DCE uses fresh-var instead of gensym
	* module/language/cps/dce.scm (eliminate-dead-code): Use fresh-var
	  instead of gensym.

	Adapt verify-cps to CPS changes
	* module/language/cps/verify.scm (verify-cps): Update to expect integer
	  labels, and to allow integer variables.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Replace all let-gensyms uses with let-fresh
	* .dir-locals.el: Add with-fresh-name-state.
	* module/language/cps.scm (fresh-label, fresh-var): Signal an error if
	  the counters are not initialized.
	  (with-fresh-name-state): New macro.
	  (make-cont-folder): New macro, generates an n-ary folder.
	  (compute-max-label-and-var): New function, uses make-cont-folder.
	  (fold-conts): Use make-cont-folder.
	  (let-gensyms): Remove.

	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/specialize-primcalls.scm: Use let-fresh instead of
	  let-gensyms, and wrap in a with-fresh-name-state as needed.

	* module/language/tree-il/compile-cps.scm: Remove hack to avoid
	  importing let-gensyms from (language tree-il).

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Remove unneeded local exact-integer? definition
	* module/system/vm/assembler.scm (link-debug): Remove unneeded
	  exact-integer? definition.

2014-03-31  Andy Wingo  <wingo@pobox.com>

	Continuation labels and variable identifiers may be integers
	* module/language/cps.scm (label-counter, var-counter): New parameters,
	  for producing fresh label and var names.
	  (fresh-label, fresh-var): New procedures.
	  (let-fresh): New macro, will replace let-gensyms.
	  (build-cps-term): Use let-fresh.

	* module/language/tree-il/compile-cps.scm: Use let-fresh to generate
	  fresh names.

	* module/system/vm/assembler.scm (make-meta, begin-kw-arity): Allow
	  exact integers as labels.
	  (link-debug): Explicitly mark low-pc as being an "addr" value.

2014-03-26  Andy Wingo  <wingo@pobox.com>

	Sloppier matching in setitimer tests
	* test-suite/tests/signals.test: Update setitimer tests to sloppily
	  match both times -- it seems that the interval can also be sloppy on
	  some platforms, sadly.

	Adapt test-out-of-memory to work on 32-bit systems
	* test-suite/standalone/test-out-of-memory (*limit*): Reduce limit to 50 MB.
	  Adapt vector test to avoid exceeding maximum vector size on 32-bit
	  systems.

2014-03-23  Nathaniel Alderson  <alderson@gmail.com>

	Calculate usecs correctly in thread-sleep!
	* module/srfi/srfi-18.scm (thread-sleep!): Correctly compute
	  microseconds.

	* test-suite/tests/srfi-18.test: Add test.

2014-03-22  Andy Wingo  <wingo@pobox.com>

	Fix compile warnings
	* libguile/throw.c (catch): Fix bad declarations.

	* libguile/stackchk.c (reset_scm_stack_checking_enabled_p): Remove
	  unused static function.

2014-03-22  Andy Wingo  <wingo@pobox.com>

	Out-of-memory situations raise exceptions instead of aborting
	* libguile/gc.c (scm_oom_fn, scm_init_gc): Install an out-of-memory
	  handler that raises an unwind-only out-of-memory exception.
	  (scm_gc_warn_proc, scm_init_gc): Install a warning proc that tries to
	  print to the current warning port, if the current warning port is a
	  file port.
	  (scm_gc_after_nonlocal_exit): New interface.  Should be called after a
	  nonlocal return to potentially collect memory; otherwise allocations
	  could try to expand again when they should collect.

	* libguile/continuations.c (scm_i_make_continuation):
	* libguile/eval.c (eval):
	* libguile/throw.c (catch):
	* libguile/vm.c (scm_call_n): Call scm_gc_after_nonlocal_exit after
	  nonlocal returns.

	* libguile/throw.c (abort_to_prompt, throw_without_pre_unwind): Rework
	  to avoid allocating memory.
	  (scm_report_out_of_memory): New interface.
	  (scm_init_throw): Pre-allocate the arguments for stack-overflow and
	  out-of-memory errors.

	* module/ice-9/boot-9.scm: Add an out-of-memory exception printer.
	* module/system/repl/error-handling.scm (call-with-error-handling): Add
	  out-of-memory to the report-keys set.

	* libguile/gc-malloc.c (scm_realloc): Call scm_report_out_of_memory if
	  realloc fails.

	* libguile/error.h:
	* libguile/error.c:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_memory_error): Deprecate.

	* test-suite/standalone/Makefile.am:
	* test-suite/standalone/test-out-of-memory: New test case.

2014-03-22  Andy Wingo  <wingo@pobox.com>

	Define a C fluid for current-warning-port
	* libguile/ports.c (scm_current_input_port, scm_current_output_port)
	  (scm_current_error_port): Fix declarations to C99.
	  (scm_current_warning_port, scm_set_current_warning_port): Rework to
	  use a C fluid, like scm_current_error_port.
	  (scm_init_ports): Initialize and define the warning port fluid.

	* libguile/init.c (scm_init_standard_ports): Init the current warning
	  port.

	* module/ice-9/boot-9.scm: Remove definitions for current-warning-port.
	  Instead, steal it from the boot objtable with port-parameterize!.

2014-03-20  Ludovic Courtès  <ludo@gnu.org>

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

	Update NEWS.

	tests: Add #undef NDEBUG when using <assert.h>.
	* test-suite/standalone/test-loose-ends.c,
	  test-suite/standalone/test-num2integral.c,
	  test-suite/standalone/test-round.c,
	  test-suite/standalone/test-scm-c-bind-keyword-arguments.c,
	  test-suite/standalone/test-scm-c-read.c,
	  test-suite/standalone/test-scm-values.c,
	  test-suite/standalone/test-smob-mark.c,
	  test-suite/standalone/test-srfi-4.c: Add #undef NDEBUG.

2014-03-20  Ludovic Courtès  <ludo@gnu.org>

	tests: Check 'simple-format' with closed current-output-port.
	This is a follow-up to e26ab06.

	* libguile/print.c (scm_simple_format): Pass 1 to
	  SCM_VALIDATE_OPORT_VALUE, for 'destination'.
	* test-suite/tests/format.test ("simple-format"): Add test.

2014-03-20  Mark H Weaver  <mhw@netris.org>

	Fix (rnrs io simple) to open file ports in textual mode.
	Fixes <http://bugs.gnu.org/17044>.
	Reported and diagnosed by Xin Wang <dram.wang@gmail.com>.

	* module/rnrs/io/simple.scm (open-input-file, open-output-file): Pass
	  missing buffer-mode argument to open-file-{input,output}-port.
	  Previously, (native-transcoder) was incorrectly passed as the
	  buffer-mode argument, so no transcoder was provided, thus creating a
	  binary port.

2014-03-19  Mark H Weaver  <mhw@netris.org>

	simple-format: Don't assume the current output port is valid.
	* libguile/print.c (scm_simple_format): Validate the current output
	  port.

2014-03-19  Andy Wingo  <wingo@pobox.com>

	Fix breakage of SRFI-4 C accessors
	* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): Fix bad assumption that
	  width was a byte width.  Thanks very much to Barry Fishman for the
	  report, and to Daniel Llorens for tracking it down.

	* test-suite/standalone/Makefile.am (test_srfi_4_CFLAGS):
	* test-suite/standalone/test-srfi-4.c: Add test.

2014-03-17  Ludovic Courtès  <ludo@gnu.org>

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

	Fix typo in NEWS.

	Update NEWS.
	* NEWS: Remove last 'XXX'.

2014-03-17  Andy Wingo  <wingo@pobox.com>

	Update NEWS
	* NEWS: Update.

2014-03-17  Ludovic Courtès  <ludo@gnu.org>

	Update NEWS.
	* NEWS: Move "New interfaces" higher.  Complement.

2014-03-17  Andy Wingo  <wingo@pobox.com>

	Fix newline preservation in @example with lines beginning with @
	* module/texinfo.scm (read-char-data): Preserve newlines in @example and
	  similar environments in the case when the next line starts with an @.

	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add a test.

2014-03-17  Andy Wingo  <wingo@pobox.com>

	DFG inlines uses of for-each
	* module/language/cps/dfg.scm (for-each, for-each/2): Define inline
	  versions of these.  Adapt callers.

2014-03-17  Mark H Weaver  <mhw@netris.org>

	Minor NEWS tweaks.
	* NEWS: Fix typo and improve wording in custom ellipsis entry.

	Add first draft of NEWS for 2.0.10.
	* NEWS: Add first draft of changes in 2.0.10.

	Documentation tweaks for the 'r7rs-symbols' read/print options.
	* doc/ref/api-data.texi (Symbol Read Syntax): Mention the 'r7rs-symbols'
	  print option, and provide example code to enable both the read and
	  print options.  Add 'r7rs-symbols' to the concept index.

2014-03-16  Ludovic Courtès  <ludo@gnu.org>

	build: Link 'test-unwind.c' against libgnu.la.
	* test-suite/standalone/Makefile.am (test_unwind_LDADD): Add libgnu.la,
	  which provides 'rpl_mkstemp' on systems missing 'mkstemp'.

2014-03-16  Andy Wingo  <wingo@pobox.com>

	Optimize srfi-1 for-each with two lists.
	* module/srfi/srfi-1.scm (for-each): Optimize for the two-list case.

	Simplify boot-9 for-each with two lists
	* module/ice-9/boot-9.scm (for-each): Simplify the two-argument case in
	  the same way as the one-argument case.

	More for-each micro-optimizations
	* module/ice-9/boot-9.scm (for-each):
	* module/srfi/srfi-1.scm (for-each): Re-implement one-list case using an
	  explicit check for list? instead of the tortoise-hare thing.  Seems to
	  be faster!

	Doc and NEWS updates
	* NEWS: Update section on dynamic stacks.  Add link for intptr
	  interfaces.
	* doc/ref/api-data.texi (Integers): Add intptr interfaces.

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

	Refine unwind-only exception message.
	* libguile/throw.c (throw_without_pre_unwind): Refine warning message.

2014-03-16  Andy Wingo  <wingo@pobox.com>

	Document stack-overflow handlers, limits, and unwind-only exceptions
	* module/system/repl/error-handling.scm (call-with-error-handling): Add
	  #:report-keys kwarg, so that unwind-only exceptions (stack-overflow in
	  particular) get reported.

	* doc/ref/api-debug.texi (Pre-Unwind Debugging): Add documentation for
	  #:report-keys kwarg of call-with-error-handling.
	  (Stack Overflow): New subsubsection.
	  (Debug Options): Remove discussion of stack overflow.

2014-03-15  Andy Wingo  <wingo@pobox.com>

	Add call-with-stack-overflow-handler tests
	* test-suite/tests/eval.test ("stack overflow handlers"): Add
	  call-with-stack-overflow-handler tests, replacing the old stack
	  overflow test.

2014-03-15  Andy Wingo  <wingo@pobox.com>

	Add stack overflow test
	* libguile/throw.c (throw_without_pre_unwind): Newline after the
	  unwind-only warning.

	* test-suite/standalone/Makefile.am:
	* test-suite/standalone/test-stack-overflow: New test to handle
	  mmap/malloc failure.

2014-03-15  Mark H Weaver  <mhw@netris.org>

	Fix (system base types) on big-endian systems.
	* module/system/base/types.scm (cell->object): When reading stringbufs,
	  use UTF-32BE on big-endian systems.

2014-03-14  Mark H Weaver  <mhw@netris.org>

	SRFI-43 documentation tweaks
	* doc/ref/api-compound.texi (Vectors): Add cross-reference to SRFI-43.
	* doc/ref/srfi-modules.texi (SRFI-43 Selectors): Simplify description of
	  'vector-ref'.

	Check SCM_USE_PTHREAD_THREADS using #if not #ifdef.
	* libguile/bdw-gc.h: Check SCM_USE_PTHREAD_THREADS using #if not #ifdef.

2014-03-14  Mark H Weaver  <mhw@netris.org>

	Include <config.h> in gen-scmconfig even when cross-compiling.
	Partially reverts 8cb0d6d7fa9aaac316c29a64c541336b51b6f93d.

	* libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): Remove
	  -DCROSS_COMPILING=1 from cross-compiling case.
	* libguile/gen-scmconfig.c: Include <config.h> regardless of
	  whether CROSS_COMPILING is defined.

2014-03-12  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Document the lightning customization functions.
		* doc/body.texi: Write detailed description and examples for
		jit_get_memory_functions, jit_set_memory_functions,
		jit_get_code, jit_set_code, jit_get_data and jit_set_data.

2014-03-12  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement the new jit_set_data interface.
		* include/lightning.h, include/lightning/jit_private.h,
		lib/lightning.c: Implement the new jit_set_data() interface,
		and the new jit_get_data() helper. Like jit_set_code(),
		jit_realize() should be called before jit_set_data().
		The most common usage should be jit_set_data(JIT_DISABLE_DATA
		| JIT_DISABLE_NOTE), to force synthesize any float/double
		constant in the stack and not generate any debug information.

		* lib/jit_note.c: Minor change to debug note generation as
		now it uses an alternate temporary data buffer during constants
		and debug generation to accommodate the possibility of the user
		setting an alternate data buffer.

		* lib/jit_hppa-fpu.c, lib/jit_s390x.c, lib/jit_s390x-cpu.c,
		lib/jit_s390x-fpu.c, lib/jit_sparc.c, lib/jit_sparc-fpu.c,
		lib/jit_x86-sse.c, lib/jit_x86-x87.c: Implement jit_set_data.

		* lib/jit_hppa-sz.c, lib/jit_sparc-sz.c, lib/jit_x86-sz.c,
		lib/jit_s390x-sz.c: Update for several instructions that now
		have a different maximum length due to jit_set_data.

		* lib/jit_mips-fpu.c: Implement jit_set_data, but missing
		validation on n32 and n64 abis (and/or big endian).

		* lib/jit_mips-sz.c: Update for changes in o32.

		* lib/jit_ppc-fpu.c: Implement jit_set_data, but missing
		validation on Darwin PPC.

		* lib/jit_ppc-sz.c: Update for changes in powerpc 32 and
		64 bit.

		* lib/jit_ia64-fpu.c: Implement untested jit_set_data.

		* TODO: Add note to list ports that were not tested for the
		new jit_set_data() feature, due to no longer having access
		to them.

		* check/nodata.c: New file implementing a simple test exercising
		several different conditions created by jit_set_data().

		* check/check.nodata.sh: New file implementing a wrapper
		over the existing *.tst files, that runs all tests without
		using a data buffer for constants; only meaningful (and
		enabled) on architectures that used to store float/double
		constants on a read only data buffer.

		* configure.ac, check/Makefile.am: Update for the new test
		cases.

		* check/lightning.c: Implement the new "-d" option that
		sets an internal flag to call jit_set_data() disable
		constants and debug, that is, using only a pure code
		buffer.

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

	Remove default soft stack limit; add call-with-stack-overflow-handler
	* libguile/vm.h:
	* libguile/vm.c (default_max_stack_size, initialize_default_stack_size):
	  Remove the default stack limit.  In this way, programs run from the
	  command line or outside of the REPL will have no soft stack limit.
	  (make_vm): Change `max_stack_size' field to be a stack of limits and
	  handlers.
	  (current_overflow_size, should_handle_stack_overflow)
	  (reset_stack_limit, wind_overflow_handler, unwind_overflow_handler)
	  (vm_expand_stack): If the stack surpasses a user-set limit, call the
	  user-specified handler within its outer stack limit.
	  (call-with-stack-overflow-handler): New interface.

	* module/system/vm/vm.scm: Export call-with-stack-overflow-handler.

2014-03-12  Ludovic Courtès  <ludo@gnu.org>

	build: Remove libguile-2.0-gdb.scm and $infodir/dir upon uninstall.
	* libguile/Makefile.am (uninstall-data-hook): New target.

	build: Install libguile-2.0-gdb.scm after libguile-2.0.so.
	* libguile/Makefile.am (install-data-local): Rename to...
	  (install-data-hook): ... this.  This guarantees that the rule runs
	  after libguile-2.0.so has been installed.

	build: Don't include <config.h> in native programs when cross-compiling.
	* libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): When cross-compiling,
	  pass -DCROSS_COMPILING=1.
	  (c-tokenize.$(OBJEXT)): Likewise.
	* libguile/c-tokenize.lex (%top): Include <config.h> only when
	  CROSS_COMPILING is undefined.
	* libguile/gen-scmconfig.c: Likewise.

	build: Fix Gnulib compilation when $builddir != $srcdir.
	* configure.ac: Add -I$top_srcdir_absolute to 'CPPFLAGS'.  Fixes
	  out-of-source-tree compilation of lib/regex.c.  Reported at
	  <https://lists.gnu.org/archive/html/guile-devel/2014-03/msg00022.html>.

2014-03-12  David Thompson  <dthompson2@worcester.edu>

	Test for deleted weak pairs in hash-for-each.
	* libguile/hashtab.c (scm_internal_hash_for_each_handle): Test for
	  deleted weak pairs.
	* test-suite/tests/hash.test: Add test case.

2014-03-12  Mark H Weaver  <mhw@netris.org>

	SCM_I_INUM: Rewrite to avoid unspecified behavior when not using GNU C.
	* libguile/numbers.h (SCM_I_INUM): Unless using GNU C, use a portable
	  implementation that avoids unspecified behavior.

	SCM_SRS: Improve fallback implemention to avoid unspecified behavior.
	* libguile/numbers.h (SCM_SRS): Rewrite preprocessor test to avoid
	  left-shifting negative integers, and to test more comprehensively for
	  the behavior we need.  Rewrite fallback implementation to avoid
	  unspecified behavior.

2014-03-12  Mark H Weaver  <mhw@netris.org>

	SRFI-60: Reimplement 'rotate-bit-field' on inums to be more portable.
	* libguile/srfi-60.c (scm_srfi60_rotate_bit_field): Avoid division by
	  zero in the (start == end) case.  Rewrite inum case to work with
	  unsigned integers in two's complement format.

	* test-suite/tests/srfi-60.test ("rotate-bit-field"): Add more tests.

2014-03-12  Mark H Weaver  <mhw@netris.org>

	Use 'offsetof' to avoid undefined behavior.
	* libguile/socket.c (SUN_LEN): Use 'offsetof'.

2014-03-12  Mark H Weaver  <mhw@netris.org>

	Avoid undefined behavior regarding signed integers and left shifts.
	* libguile/numbers.c (scm_logbit_p): If the requested bit is the sign
	  bit (or above), check the sign portably.  Otherwise, ensure that we're
	  testing the bit in a two's complement representation.
	  (left_shift_exact_integer): Avoid left-shifting negative integers.

	* libguile/vm-i-scheme.c (ash): Avoid left-shifting negative integers.

2014-03-12  Mark H Weaver  <mhw@netris.org>

	Avoid signed overflow in random.c.
	* libguile/random.c (scm_i_mask32): Avoid signed overflow from shifting
	  an unsigned char (promoted to signed int) 24 bits to the left.

	Avoid side effects in argument to SCM_I_INUM.
	* libguile/vm-i-system.c (halt): Avoid side effects in argument to
	  SCM_I_INUM.

2014-03-12  Ludovic Courtès  <ludo@gnu.org>

	Thank Paul.

2014-03-12  Ludovic Courtès  <ludo@gnu.org>

	Provide glthread/lock.h implementation in terms of Guile threads.
	Fixes <http://bugs.gnu.org/14404>.
	Thanks to Paul Eggert <eggert@cs.ucla.edu> for the suggestion.

	* m4/gnulib-cache.m4: Avoid 'lock' module.
	* m4/lock.m4, m4/threadlib.m4, lib/glthread/threadlib.c,
	  lib/glthread/lock.c: Remove.
	* lib/glthread/lock.h: Rewrite in terms of libguile/threads.h.
	* m4/gnulib-common.m4, m4/gnulib-comp.m4, lib/Makefile.am,
	  lib/unistd.in.h, maint.mk : Update, from Gnulib v0.1-92-g546ff82.

	* configure.ac (GNULIB_LOCK): Define 'GNULIB_LOCK'.  Define
	  'USE_POSIX_THREADS' when building with pthread support.
	* Makefile.am (noinst_HEADERS): New variable.
	  (BUILT_SOURCES): Add libguile/scmconfig.h.
	  (libguile/scmconfig.h): New target.

2014-03-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement the new jit_set_code interface.
		* include/lightning.h, include/lightning/jit_private.h,
		lib/lightning.c: Implement the new jit_set_code() interface,
		that allows instructing lightning to use an alternate code
		buffer. The new jit_realize() function should be called
		before jit_set_code(), and usually call jit_get_code()
		to query the amount of bytes expected to be required for
		the code.

		* lib/jit_size.c: Minor update to have less chances of
		miscalculating the code buffer by starting the counter
		with the size of the longest instruction instead of zero,
		as code emit fails if at any moment less than the longest
		instruction bytes are available.

		* check/setcode.c: New file implementing some basic tests
		of the new jit_set_code() interface.

		* check/Makefile.am: Update for newer test case.

2014-03-07  Mark H Weaver  <mhw@netris.org>

	Improve compliance with C standards regarding signed integer shifts.
	* configure.ac: Add -fwrapv when using GCC (or compatible), if
	  supported.

	* libguile/numbers.h (SCM_I_MAKINUM): Cast to scm_t_bits (unsigned)
	  before shifting, to avoid undefined behavior.

2014-03-07  Mark H Weaver  <mhw@netris.org>

	chars.c: Remove duplicate 'const' specifiers.
	* libguile/chars.c (scm_r5rs_charnums, scm_r6rs_charnums)
	  (scm_r7rs_charnums, scm_C0_control_charnums, scm_alt_charnums):
	  Remove duplicate 'const' specifiers.

	snarf.h: Declare static const function name vars as SCM_UNUSED.
	* libguile/snarf.h (SCM_DEFINE_GSUBR, SCM_DEFINE, SCM_PRIMITIVE_GENERIC,
	  SCM_DEFINE_PUBLIC, SCM_PROC, SCM_REGISTER_PROC, SCM_GPROC): Declare
	  static const function name variables as SCM_UNUSED to avoid spurious
	  warnings.

2014-03-06  Mark H Weaver  <mhw@netris.org>

	Make snarfing tools more robust to varied C preprocessor behavior.
	* libguile/guile-snarf.in (modern_snarf): Rewrite sed script to cope
	  with newlines in the snarfed code segments, or multiple code segments
	  on the same line.

	* module/scripts/snarf-check-and-output-texi.scm (process-stream):
	  Strip all 'hash' tokens from the stream.
	  (do-command): Remove special cases that handled 'hash' tokens
	  in a few places.

2014-03-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement and document the new jit_indirect call.
		* include/lightning.h, lib/lightning.c: Add the new
		jit_indirect() call, that returns a special label node,
		and tells lightning that the label may be the target of
		an indirect jump.

		* doc/body.texi: Document the new jit_indirect() call, and
		add examples of different ways to create labels and branches.

2014-03-03  Mark H Weaver  <mhw@netris.org>

	SRFI-19: Update the table of leap seconds.
	* module/srfi/srfi-19.scm (leap-second-table): Update to include the two
	  most recent leap seconds.

	Add missing files to the test-suite Makefile.
	* test-suite/Makefile.am (SCM_TESTS): Add "tests/compiler.test",
	  "tests/encoding-escapes.test", "tests/encoding-iso88591.test",
	  "tests/encoding-iso88597.test", "tests/encoding-utf8.test",
	  "tests/pairs.test", "tests/records.test", "tests/sort.test",
	  "tests/srfi-17.test", "tests/srfi-18.test", "tests/srfi-98.test",
	  "tests/streams.test", "tests/vectors.test", and "tests/web-client.test".

2014-03-02  Andy Wingo  <wingo@pobox.com>

	Port unrolled one-argument for-each from boot-9 to srfi-1
	* module/srfi/srfi-1.scm (for-each): Port unrolled one-argument
	  implementation here from the boot-9 version.

2014-03-02  Andy Wingo  <wingo@pobox.com>

	Fix for-each bug detecting not-a-list
	* module/ice-9/boot-9.scm (for-each): Fix detection of not-a-list in the
	  unrolled one-argument case.

	* test-suite/tests/eval.test ("for-each"): Add a test.

2014-03-01  Andy Wingo  <wingo@pobox.com>

	,profile, statprof, gcprof have an outer stack cut
	* module/statprof.scm (<state>): Add outer-cut member.
	  (fresh-profiler-state): Add outer-cut kwarg.
	  (sample-stack-procs): Stop when the stack-length is zero, which will
	  be before the frames run out if there is an outer cut.
	  (profile-signal-handler): Use the outer cut when capturing the stack.
	  (call-thunk): New helper, for use as an outer cut.
	  (statprof, gcprof): Call the thunk within call-thunk, and use
	  call-thunk as an outer cut.

	Statprof commentings
	* module/statprof.scm: Add a big ol' comment.
	  (sample-stack-procs): If slot 0 isn't a primitive, use the IP to
	  mark.  In the future we will see more non-procedures in slot 0 as we
	  start to use call-label and tail-call-label.

	statprof-display prints source locations
	* module/statprof.scm (call-data): Source is after printable.
	  (addr->printable): Just produce a name, without source.  Anonymous
	  printables get "anon " prefixed.
	  (stack-samples->procedure-data): Adapt to call-data change.
	  (stats): Add "proc-source" element.
	  (statprof-call-data->stats): Give a source to the call-data.
	  (statprof-display): Print source also.

2014-02-28  Ludovic Courtès  <ludo@gnu.org>

	build: Make c-tokenize.c build on non-GNU systems.
	* libguile/c-tokenize.lex: Add %top directive to include <config.h>
	  first.  This fixes builds on systems that use Gnulib's <stdio.h> and
	  similar replacements.  See <http://hydra.nixos.org/build/9259627> for
	  an example.

2014-02-28  Andy Wingo  <wingo@pobox.com>

	Refactorings: call-data has source, stats is a record
	* module/statprof.scm (call-data): Add source member.
	  (stack-samples->procedure-data): Populate source member
	  (stats): Convert to record from vector.
	  (statprof-call-data->stats): Adapt to produce a record.

	Statprof uses stack trace buffer to always provide full stacks
	* module/statprof.scm (<state>): Remove record-full-stacks? and stacks
	  members.  The stack trace buffer is sufficient.
	  (fresh-profiler-state): Adapt.
	  (sample-stack-procs): Don't save stacks.
	  (statprof-reset): Deprecate the full-stacks? argument.
	  (stack-samples->procedure-data): Remove a needless vector-ref.
	  (stack-samples->callee-lists): New helper.
	  (statprof-fetch-stacks): Use stack-samples->callee-lists.
	  (statprof-fetch-call-tree): Use stack-samples->callee-lists, and
	  implement our own callee->string helper.
	  (statprof, with-statprof, gcprof): Deprecate full-stacks? argument.

2014-02-28  Andy Wingo  <wingo@pobox.com>

	Statprof always stores full stack traces
	* module/statprof.scm (<state>): Instead of a boolean count-calls?,
	  treat the presence of a call-counts hash table as indicating a need to
	  count calls.  That hash table maps callees to call counts.  A "callee"
	  is either the IP of the entry of a program, the symbolic name of a
	  primitive, or the identity of a non-program.

	  New members "buffer" and "buffer-pos" replace "procedure-data".
	  We try to avoid analyzing things at runtime, instead just recording
	  the stack traces into a buffer.  This will let us do smarter things
	  when post-processing.

	  (fresh-buffer, expand-buffer): New helpers.

	  (fresh-profiler-state): Adapt to <state> changes.

	  (sample-stack-procs): Instead of updating the procedure-data
	  table (which no longer exists), instead trace the stack into the
	  buffer.

	  (count-call): Update to update the call-counts table instead of the
	  procedure-data table.

	  (statprof-start, statprof-start): Adapt to call-counts change.

	  (call-data): Move lower in the file.  Add "name" and "printable"
	  members, and no longer store a proc.

	  (source->string, program-debug-info-printable, addr->pdi)
	  (addr->printable): New helpers.

	  (stack-samples->procedure-data): New procedure to process stack trace
	  buffer into a hash table of the same format as the old procedure-data
	  table.

	  (statprof-fold-call-data, statprof-proc-call-data): Use
	  stack-samples->procedure-data instead of procedure-data.

	  (statprof-call-data->stats): Adapt to count-calls change.

	  (statprof-display, statprof-display-anomalies): Adapt.

2014-02-28  Andy Wingo  <wingo@pobox.com>

	(system vm program) exports primitive?
	* module/system/vm/program.scm: Export primitive?.  Primitive
	  program-code doesn't map uniquely to the primitive, which may be of
	  interest to various meta-level utilities like statprof.

	Improve statprof test
	* test-suite/tests/statprof.test ("statistical sample counts within
	  expected range"): Increase number of calls, as the computer speed
	  increases and VM/compiler speed increases have meant that we get fewer
	  samples than before.  Also, compare the maximum deviation to the
	  square root of the expected value.  I don't actually know what the
	  right statistical check is here, but this is closer to an "all points
	  fall within a standard deviation" than our previous 30% check.  Print
	  a nicer warning when the check fails.

	Update statprof commentary
	* module/statprof.scm: Update commentary.

	More state-related refactors in statprof
	* module/statprof.scm (statprof-start, statprof-stop): Take optional
	  state arg.
	  (statprof-reset): Return no values.
	  (statprof): Take port keyword arg.  Since statprof-reset is now the
	  same as parameterizing profiler-state, there's no need to call
	  statprof-reset.  Pass the state argument explicitly to statprof-start,
	  statprof-stop, and statprof-display.

	Statprof restores previous sigprof handler when stopping
	* module/statprof.scm (<state>): Add field for the previous SIGPROF
	  handler.
	  (statprof-start, statprof-stop, statprof-reset): Instead of setting
	  the SIGPROF handler in statprof-reset, set it when the profiler
	  becomes active, and actually restore it when the profiler becomes
	  inactive.

	More statprof refactors
	* module/statprof.scm (statprof-display, statprof-display-anomalies)
	  (statprof-accumulated-time, statprof-sample-count)
	  (statprof-fetch-stacks, statprof-fetch-call-tree): Take optional state
	  argument.
	  (statprof-display-anomolies): Deprecate this mis-spelling.
	  (statprof): Just compute usecs for the period.

	Slight gcprof refactor
	* module/statprof.scm (gcprof): Refactor a bit.

	statprof uses new setitimer magical usecs ability
	* module/statprof.scm (sample-stack-procs): Take advantage of setitimer
	  allowing usecs >= 1e6.

2014-02-28  Andy Wingo  <wingo@pobox.com>

	Fix setitimer documentation.  Allow microseconds >= 1e6.
	* doc/ref/posix.texi (Signals): Fix the documentation for setitimer; it
	  was wrong.

	* libguile/scmsigs.c (pack_tv): New helper.  Allow usecs >= 1e6.
	  (unpack_tv): New helper.
	  (scm_setitimer): Use the new helpers.

	* test-suite/tests/signals.test: Add setitimer tests.

2014-02-28  Mark H Weaver  <mhw@netris.org>

	SRFI-18: Export 'current-thread'.
	Fixes <http://debbugs.gnu.org/16890>.
	Reported by Xin Wang <dram.wang@gmail.com>.

	* module/srfi/srfi-18.scm: Reexport 'current-thread'.
	* THANKS: Add "Xin Wang" to fixes section.

2014-02-28  Mark H Weaver  <mhw@netris.org>

	Rely on Gnulib for <unistd.h>.
	* libguile/async.c:
	* libguile/backtrace.c:
	* libguile/error.c:
	* libguile/filesys.c:
	* libguile/fports.c:
	* libguile/gc-malloc.c:
	* libguile/gc.c:
	* libguile/gdbint.c:
	* libguile/init.c:
	* libguile/ioext.c:
	* libguile/load.c:
	* libguile/mallocs.c:
	* libguile/mkstemp.c:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/r6rs-ports.c:
	* libguile/random.c:
	* libguile/rw.c:
	* libguile/scmsigs.c:
	* libguile/script.c:
	* libguile/simpos.c:
	* libguile/socket.c:
	* libguile/stime.c:
	* libguile/strports.c:
	* libguile/threads.c: Unconditionally include <unistd.h>.

	Rely on Gnulib for fsync, link, readlink, mkdir, rmdir, and rename.
	* libguile/filesys.c: Remove 'fsync' wrapper for MinGW.
	  (scm_link, scm_readlink, scm_mkdir, scm_rmdir): Define these
	  unconditionally.
	  (my_rename): Remove.
	  (scm_rename): Use 'rename' instead of 'my_rename'.

2014-02-28  Mark H Weaver  <mhw@netris.org>

	Import Gnulib modules: link, fsync, readlink, rename, mkdir, rmdir, unistd.
	* lib/fsync.c:
	* lib/link.c:
	* lib/mkdir.c:
	* lib/strdup.c:
	* m4/fsync.m4:
	* m4/link.m4:
	* m4/mkdir.m4:
	* m4/strdup.m4: New files.

	* lib/Makefile.am
	* m4/gnulib-cache.m4
	* m4/gnulib-comp.m4: Add modules.

2014-02-28  Mark H Weaver  <mhw@netris.org>

	Fix typo in manual.
	* doc/ref/api-foreign.texi (Void Pointers and Byte Access):
	  (rnrs bytevector) --> (rnrs bytevectors).

2014-02-27  Andy Wingo  <wingo@pobox.com>

	Fix newline preservation in @example with lines beginning with @
	* module/texinfo.scm (read-char-data): Preserve newlines in @example and
	  similar environments in the case when the next line starts with an @.

	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add a test.

2014-02-27  Ludovic Courtès  <ludo@gnu.org>

	build: Fix out-of-source-tree installation of libguile-2.0-gdb.scm.
	* libguile/Makefile.am (install-data-local): Use $< instead of just
	  libguile-2.0-gdb.scm.  Quote file names in $(INSTALL_DATA) invocation.

2014-02-25  Andy Wingo  <wingo@pobox.com>

	gcprof tweaks
	* module/statprof.scm (gcprof): No need to reset in gcprof; the fresh
	  profiler state and the parameterize handle that.  Fix mistaken
	  set-vm-trace-level! as well.

	Refactor representation of sampling periods in statprof
	* module/statprof.scm (<state>): The sampling frequency is actually a
	  period; label it as such, and express in microseconds instead of as a
	  pair.  Likewise for remaining-prof-time.
	  (fresh-profiler-state): Adapt.
	  (reset-sigprof-timer): New helper.
	  (profile-signal-handler): Use the new helper.
	  (statprof-start): Use the new helper.
	  (statprof-stop): Here too.
	  (statprof-reset): Adapt to <state> change.
	  (gcprof): Set remaining prof time to 0.

	statprof and gcprof procedures use a fresh statprof state
	* module/statprof.scm (statprof, gcprof): Create a fresh statprof
	  state.

	Simplification pass prunes all unreachable continuations
	* module/language/cps/simplify.scm (prune-continuations): Prune
	  continuations as a post-pass with a fresh DFG.  Using a
	  pre-eta-conversion DFG as we were doing before missed some cases.

2014-02-23  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	x86_64: Change x86_64 to also save/restore %rbx in inline asm.
		*  lib/jit_x86.c: Rewrite previous patch to inline save/restore
		because clobbering %ebx in x86 is treated as an error
		(jit_x86.c:239:5: error: PIC register clobbered by 'ebx' in 'asm').

2014-02-22  Andy Wingo  <wingo@pobox.com>

	simplify profile-signal-handler
	* module/statprof.scm (profile-signal-handler): Don't bother detecting
	  if we were in a count-call call or not; it doesn't matter, and we
	  should accumulate time in any case.

2014-02-22  Andy Wingo  <wingo@pobox.com>

	statprof: accumulated-time is in jiffies
	* module/statprof.scm (fresh-profiler-state): accumulated-time and
	  gc-time-taken are in jiffies, not seconds, so they are exact.
	  (statprof-accumulated-time): Divide by 1.0 so that we get a flonum.

	  Also refactor use of assq to get the gc-time-taken.

2014-02-22  Andy Wingo  <wingo@pobox.com>

	Zero-offset branches are backward branches; fix "br" backward branches
	* libguile/vm-engine.c (BR_UNARY, BR_BINARY, BR_ARITHMETIC): A jump with
	  a zero offset is also a backward branch, in the sense that it's not a
	  forward branch.
	  ("br"): We forgot to VM_HANDLE_INTERRUPTS here on backwards branches.
	  Oops!

	Avoid attempting to eta-reduce self-loops.
	* module/language/cps/simplify.scm (compute-eta-reductions): Avoid
	  trying to eta-reduce a jump-to-self, as in (let lp () (lp)).  This
	  caused the compiler to hang.

	Pass state around statprof in more places
	* module/statprof.scm (get-call-data, sample-stack-procs): Take the
	  state as an argument.
	  (profile-signal-handler, count-call, statprof-proc-call-data)
	  (gcprof): Adapt.

	statprof: call-data is a record type
	* module/statprof.scm (call-data): Reimplement as a record type.

	statprof: when/unless instead of if.
	* module/statprof.scm: Use when or unless instead of if, where
	  appropriate.

2014-02-21  Andy Wingo  <wingo@pobox.com>

	add a statprof fixme
	* module/statprof.scm: Add a fixme.

	statprof-active? instead of checking profile level
	* module/statprof.scm (statprof-reset, statprof-fold-call-data):
	  (statprof-proc-call-data, statprof-accumulated-time):
	  (statprof-sample-count): Refactor some things to use statprof-active?
	  instead of checking the profile level manually.

	statprof-reset creates a new state
	* module/statprof.scm (fresh-profiler-state): New helper.
	  (ensure-profiler-state): Use it.
	  (accumulate-time): No need to add 0.0 here.
	  (statprof-reset): Create a new state instead of mutating the existing
	  one.

	More statprof state refactorings
	* module/statprof.scm (existing-profiler-state): New helper, gets the
	  profiler state or fails if there is no state.
	  (sample-stack-procs, profile-signal-handler, count-call)
	  (statprof-fold-call-data, statprof-proc-call-data)
	  (statprof-call-data->stats, statprof-display)
	  (statprof-display-anomolies, statprof-accumulated-time)
	  (statprof-sample-count, statprof-fetch-stacks)
	  (statprof-fetch-call-tree): Use the new helper.
	  (statprof-active?): Don't create a state if there isn't one already.

	inside-profiler? to parameter instead of global variable
	* module/statprof.scm (<state>): Add inside-profiler? member.  Move
	  mutations of inside-profiler? here.

	Beginnings of statprof threadsafety
	* module/statprof.scm (<state>, profiler-state, ensure-profiler-state):
	  A mostly-mechanical refactor to encapsulate profiler state in a
	  parameter and a record instead of global variables.

	reform statprof commentary
	* module/statprof.scm: Reformat the commentary.

	Fix segfault in thread_mark
	* libguile/threads.c (thread_mark): There is a window in which the
	  thread has a handle but doesn't yet have the set of pointerless
	  freelists, so don't unconditionally dereference
	  t->pointerless_freelists.

2014-02-20  Ludovic Courtès  <ludo@gnu.org>

	Make sure 'ftw' allows directory traversal when running as root.
	* module/ice-9/ftw.scm (stat-dir-readable?-proc): Return #t when UID is
	  zero.  Reported Frank Terbeck <ft@bewatermyfriend.org>.

	build: Bail out when 'PKG_CHECK_MODULES' is missing.
	* configure.ac: Add 'm4_pattern_forbid' invocation.

2014-02-20  Andy Wingo  <wingo@pobox.com>

	Threadsafe stack relocation
	* libguile/vm.c (vm_return_to_continuation, vm_expand_stack):
	  (vm_reinstate_partial_continuation): Hold the GC lock while relocating
	  the stack.

	assertion refactor in the vm
	* libguile/vm.c:
	* libguile/vm-engine.c: Change the one use of
	  VM_ENABLE_PARANOID_ASSERTIONS to ASSERT.  That becomes the one use of
	  VM_ENABLE_ASSERTIONS, so disable that too.

	Fix "VM never extends vp->sp ..." commit
	* libguile/vm.c (vm_expand_stack): Make sure the new SP is visible to
	  vm_error if we throw because of stack overflow.

	Remove the hard stack size limit
	* libguile/vm.c (vm_expand_stack): Remove the hard stack size limit.

2014-02-20  Andy Wingo  <wingo@pobox.com>

	VM never extends vp->sp beyond mapped region of stack
	* libguile/vm-engine.c (ALLOC_FRAME): Fold CHECK_OVERFLOW into this
	  routine, and rework to not extend vp->sp until the stack has been
	  expanded.

	* libguile/vm.c (vm_increase_sp): Likewise, don't extend vp->sp until
	  the stack has expanded.
	  (vm_expand_stack): Rework to take the new stack pointer as an
	  argument, and also to update vp->sp_max_since_gc and vp->sp.

2014-02-20  Andy Wingo  <wingo@pobox.com>

	Unwind-only stack overflow exceptions
	* module/ice-9/boot-9.scm (catch): Signal an early error if the handler
	  or pre-unwind handler types aren't right.  This is more important than
	  it was, given that we dispatch on type now when finding matching catch
	  clauses.

	* libguile/vm.c (vm_expand_stack): Use the standard
	  scm_report_stack_overflow to signal stack overflow.  This will avoid
	  running pre-unwind handlers.

	* libguile/throw.h: Move scm_report_stack_overflow here.

	* libguile/throw.c (catch): Define a version of catch in C.
	  (throw_without_pre_unwind): New helper.  Besides serving as the
	  pre-boot "throw" binding, it allows stack overflow to throw without
	  running pre-unwind handlers.
	  (scm_catch, scm_catch_with_pre_unwind_handler)
	  (scm_with_throw_handler): Use the new catch in C.
	  (scm_report_stack_overflow): Moved from stackchk.c; throws an
	  unwind-only exception.

	* libguile/stackchk.h:
	* libguile/stackchk.c: Remove the scm_report_stack_overflow bits.

2014-02-19  Andy Wingo  <wingo@pobox.com>

	%exception-handler fluid refactor
	* libguile/throw.c (scm_init_throw): Define %exception-handler here.
	* module/ice-9/boot-9.scm (%eh): Use the incoming %exception-handler,
	  and then delete it.  This way we should be able to do unwind-only
	  exceptions from C.

	Reimplement catch, throw, and with-throw-handler
	* module/ice-9/boot-9.scm: Reimplement catch, throw, and
	  with-throw-handler in such a way that the exception handler is
	  threaded not through the exception-handling closures, but through a
	  data structure in the exception-handler fluid.  This will allow us to
	  do unwind-only exception dispatch on stack overflow.

2014-02-19  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	x86_64: Correct wrong inline assembly in jit_get_cpu
		* lib/jit_x86.c: Rewrite incorrect inline assembly that could
		truncate a variable in a callee save register. Now it simply
		tells gcc that the register is clobbered, instead of using a
		*32 bit* swap with a temporary variable. The problem only
		happens when compiling with optimization.

2014-02-19  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Rewrite jit_regset_scan1 for easier optimization.
		* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
		include/lightning/jit_hppa.h, include/lightning/jit_ia64.h,
		include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
		include/lightning/jit_s390x.h, include/lightning/jit_sparc.h,
		include/lightning/jit_x86.h: Change jit_regset_t to an
		unsigned type, to allow safe right shift.

		* lib/lightning.c: Rewrite jit_regset_scan1 to allow easier
		compiler optimization.

2014-02-19  Andy Wingo  <wingo@pobox.com>

	boot-9 boot order refactor for catch, throw, and such
	* module/ice-9/boot-9.scm: Move error-handling initialization after
	  psyntax initialization.  Only "throw" is used before psyntax, and both
	  throw and catch have pre-boot variants in C.

	Fix scm_i_vm_capture_stack comment.
	* libguile/vm.c (scm_i_vm_capture_stack): Fix a comment.

	Default stack size is one page.
	* libguile/vm.c (initialize_default_stack_size): Initial stack size is
	  one page.

	More robust stack expansion and contraction
	* libguile/vm.c (allocate_stack, expand_stack): Return NULL on
	  allocation failure instead of throwing an exception.  Throwing an
	  exception is tricky to get right, and we need more context to do it
	  correctly.
	  (return_unused_stack_to_os): Try again if madvise returns -EAGAIN.  If
	  madvise fails, print an error message.
	  (vm_expand_stack): Abort if stack expansion fails.  We'll fix this in
	  a future patch.
	  (make_vm): Abort if we can't mmap a single page.

2014-02-18  Ludovic Courtès  <ludo@gnu.org>

	Add GDB extension to support Guile.
	* libguile/libguile-2.0-gdb.scm: New file.
	* libguile/Makefile.am (install-data-local): New target.  Based on code
	  from GNU libstdc++.
	  (EXTRA_DIST): Add 'libguile-2.0-gdb.scm'.
	* doc/ref/api-debug.texi (GDB Support): New section.

	Add (system base types).
	* module/system/base/types.scm, test-suite/tests/types.test: New files.
	* module/Makefile.am (SYSTEM_BASE_SOURCES): Add system/base/types.scm.
	* test-suite/Makefile.am (SCM_TESTS): Add tests/types.test.

2014-02-17  Andy Wingo  <wingo@pobox.com>

	Don't peval-penalize let-bound lambdas only referenced once
	* module/language/tree-il/peval.scm (peval): When going to peval a call
	  whose operator isn't just a lambda but is a let-bound lambda, as one
	  bound via define-inlinable, don't create a new counter if the lambda
	  is only referenced once in the source.  Avoids needless failure to
	  inline once-referenced procedures.

	* test-suite/tests/peval.test ("partial evaluation"): Wheeeee

2014-02-17  Andy Wingo  <wingo@pobox.com>

	PT_DYNAMIC inside some other PT_LOAD segment
	* libguile/loader.c (load_thunk_from_memory): Only load PT_LOAD
	  segments, as libc does.  The PT_DYNAMIC segment should be inside some
	  other PT_LOAD segment.

	* module/system/vm/linker.scm (segment-kind): Give the .dynamic segment
	  PT_LOAD kind, so that it is written in a PT_LOAD segment.
	  (count-segments): Add one if there is a SHT_DYNAMIC segment.
	  (allocate-segment): Set the paddr to the addr, as binutils do.
	  (record-special-segments): New routine, to write out special segments
	  like PT_DYNAMIC.
	  (allocate-elf): Call record-special-segments.

2014-02-16  Andy Wingo  <wingo@pobox.com>

	Add elf-symbol-value-offset, for properly relocating symtab entries
	* module/system/vm/elf.scm (elf-symbol-value-offset): New export.

2014-02-16  Andy Wingo  <wingo@pobox.com>

	ELF linker can produce objects with native ABI
	* module/system/vm/elf.scm: Define more ABI types and ELF object types.
	  Export the ABI, object type, and machine type values.

	* module/system/vm/linker.scm (<linker-reloc>, process-reloc): Allow
	  rel32/1 relocs.
	  (add-elf-objects, allocate-elf, link-elf): Allow the user to set an
	  ABI, type, and machine-type.

2014-02-14  Andy Wingo  <wingo@pobox.com>

	bytevector-length reifies to correct module
	* module/language/cps/reify-primitives.scm (primitive-module): Whoops,
	  bytevector-length is needs to map to the (rnrs bytevectors) module.

2014-02-13  Andy Wingo  <wingo@pobox.com>

	bytevector-length is an interesting primitive.
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect-free-primitives*):
	* module/language/cps/effects-analysis.scm: bytevector-length is an
	  interesting primitive.

	sqrt and abs are interesting primitives
	* module/language/cps/effects-analysis.scm:
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect-free-primitives*): Add sqrt and abs.

2014-02-13  Andy Wingo  <wingo@pobox.com>

	Add prune-top-level-scopes pass
	* module/language/cps/prune-top-level-scopes.scm: New pass, to prune
	  unneeded "cache-current-module!" forms.

	* module/language/cps/compile-bytecode.scm:
	* module/Makefile.am: Add the new pass to the build and enable by
	  default.

2014-02-13  Mark H Weaver  <mhw@netris.org>

	Fix inline asm of VM numerical operations for x32.
	* libguile/vm-i-scheme.c (_CX): Choose register size based on
	  'SIZEOF_VOID_P' instead of '__x86_64__'.

2014-02-13  Mark H Weaver  <mhw@netris.org>

	Rely on Gnulib for 'select', 'lstat', and 'mkstemp'.
	* libguile/iselect.h:
	* libguile/threads.c:
	* libguile/deprecated.h: Rely on Gnulib for sys/select.h.

	* libguile/filesys.c: Rely on Gnulib for 'lstat' and 'mkstemp'.

2014-02-13  Mark H Weaver  <mhw@netris.org>

	Import 'lstat' and 'mkstemp' modules from Gnulib.
	* lib/mkstemp.c:
	* lib/secure_getenv.c:
	* lib/tempname.c:
	* lib/tempname.h:
	* m4/mkstemp.m4:
	* m4/secure_getenv.m4:
	* m4/tempname.m4: New files.

	* lib/Makefile.am:
	* m4/gnulib-cache.m4:
	* m4/gnulib-comp.m4: Add modules.

2014-02-12  David Thompson  <dthompson2@worcester.edu>

	Add cooperative REPL server module.
	Modified-by: Mark H Weaver <mhw@netris.org>

	* module/system/repl/coop-server.scm: New module.

	* module/system/repl/repl.scm (start-repl): Extract body to start-repl*.
	  (start-repl*): New procedure.
	  (run-repl): Extract body to run-repl*.
	  (run-repl*): New procedure.

	* module/system/repl/server.scm (run-server): Extract body to
	  run-server*.
	  (run-server*): New procedure.

	* doc/ref/api-evaluation.texi (Cooperative REPL Servers): New node.

	* module/Makefile.am (SYSTEM_SOURCES): Add system/repl/coop-server.scm.

2014-02-12  Mark H Weaver  <mhw@netris.org>

	REPL Server: Fix 'stop-server-and-clients!'.
	* module/system/repl/server.scm: Import (ice-9 match) and (srfi srfi-1).
	  (*open-sockets*): Add comment.  This is now a list of pairs with a
	  'force-close' procedure in the cdr.
	  (close-socket!): Add comment noting that it is unsafe to call this
	  from another thread.
	  (add-open-socket!): Add 'force-close' argument, and put it in the cdr
	  of the '*open-sockets*' entry.
	  (stop-server-and-clients!): Use 'match'.  Remove the first element
	  from *open-sockets* immediately.  Call the 'force-close' procedure
	  instead of 'close-socket!'.
	  (errs-to-retry): New variable.
	  (run-server): Add a pipe, used in the 'force-close' procedure to
	  cleanly shut down the server.  Put the server socket into non-blocking
	  mode.  Use 'select' to monitor both the server socket and the pipe.
	  Don't call 'add-open-socket!' on the client-socket.  Close the pipe
	  and the server socket cleanly when we're asked to shut down.
	  (serve-client): Call 'add-open-socket!' with a 'force-close' procedure
	  that cancels the thread.  Set the thread cleanup handler to call
	  'close-socket!', instead of calling it in the main body.

	* doc/ref/api-evaluation.texi (REPL Servers): Add a caveat to the manual
	  entry for 'stop-servers-and-clients!'.

2014-02-12  Andy Wingo  <wingo@pobox.com>

	guile.m4 tweaks
	* meta/guile.m4 (GUILE_PKG): Don't print "checking for guile 2.0" if
	  we've already found 2.2.  Print the correct effective version at the
	  end.
	  (GUILE_PROGS): Allow prereleases, whose micro version does not yet
	  match the effective version.  Default to the already-chosen effective
	  version.

2014-02-11  Andy Wingo  <wingo@pobox.com>

	Bytevector f32 an f64 ops actually map to VM primitives
	* module/language/cps/primitives.scm (*instruction-aliases*): Whoops!
	  Fix mapping of f32 and f64 instructions to VM primitives.

	guile.m4 tweaks
	* meta/guile.m4 (GUILE_PKG): Don't print "checking for guile 2.0" if
	  we've already found 2.2.  Print the correct effective version at the
	  end.
	  (GUILE_PROGS): Allow prereleases, whose micro version does not yet
	  match the effective version.  Default to the already-chosen effective
	  version.

2014-02-10  Daniel Llorens  <daniel.llorens@bluewin.ch>

	array-contents returns root for empty arrays with empty root
	This fixes a compiler issue where (uniform-array->bytevector #2f64())
	failed because of the stricter definition of uniform-vector? on this branch.

	Perhaps it would be better if uniform-array->bytevector didn't require
	a contiguous argument.

	* libguile/arrays.c: (scm_array_contents): return the root regardless of
	  the value of SCM_I_ARRAY_DIMS (ra)->inc.
	* test-suite/tests/arrays.test: check.

2014-02-10  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Add tests for more kinds of typed arrays.
	* test-suite/tests/arrays.test: Add more type array tests.

	Preallocate index list in scm_array_index_map_x
	* libguile/array-map.c
	  - (scm_array_index_map_x): preallocate the index list instead of
	    constructing it on each rank-1 iteration.
	  - (ramap, rafe): use SCM_I_ARRAY_V just once.

	Match types used in arrays.c to struct field types
	* libguile/arrays.c
	  - scm_shared_array_root: check for SCM_I_ARRAYP first.
	  - scm_i_shap2ra:
	    * check valid bounds in the '(lbnd ubnd) case. This makes
	      (make-array 0 '(4 -3)) fail with a 'bad dimension' instead of
	      with a 'wrong index' error.
	    * use ssize_t for lbnd/ubnd/inc, not long.
	  - scm_make_shared_array: use ssize_t for indices, not long.
	  - scm_transpose_array: use size_t for ndim, not ulong.
	  - scm_i_print_array: idem.

	Don't use ASET in scm_array_index_map_x
	* libguile/array-map.c: (scm_array_index_map_x): replace ASET by direct
	  use of handle->impl.

	In scm_ramapc, only check unrolled axes for emptiness
	* libguile/array-map.c: (scm_ramapc)
	  - Don't check emptiness while preparing ra0, but only after kroll is known,
	    and only before kroll. len = 0 will be caught by the unrolled loop.
	  - Use ra0 axis length in unroll check depth for rest args, not ra1's.
	  - Recover early exit feature when cproc returns 0.

2014-02-10  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix corner cases of scm_ramapc
	* libguile/array-map.c
	  - (scm_ramapc): mismatched axes limit unrollk (kroll). Reorganize
	    the function to do all checking as we go.
	  - (scm_ra_matchp): unused; remove.
	  - (find_unrollk): inlined in scm_ramapc; remove.
	  - (klen): inlined in scm_ramapc; remove.
	  - (rafill): n is size_t.
	  - (racp): n is size_t. Use n and not i0end to bound the loop.
	  - (ramap): Use n and not i0end to bound the loop. This is needed for the rank
	    0 case to work with the new scm_ramapc, as inc may be set to 0 in that case.
	  - (rafe): idem.

	* test-suite/tests/ramap.test
	  - check that size mismatch prevents unrolling (matching behavior III) with
	    both array-copy! and array-map!.
	  - check that non-contiguous stride in non-ref args prevents unrolling
	    (rank 2, discontinuous) with both array-copy! and array-map!.
	  - check rank 0 cases with array-for-each, array-map!.
	  - Test the 0-inc, non empty case for both array-map! and array-copy!.

2014-02-10  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Rewrite scm_ramapc()
	* libguile/array-map.c
	  - (cind): replace by cindk, that operates only on the unrolled index set.
	  - (klen): new function.
	  - (make1array): take extra inc argument.
	  - (scm_ramapc): rewrite to unroll as many axes as possible instead of just all
	    or one.
	  - (AREF): lbnd is known to be 0: remove.
	  - (ASET): v is known to come from SCM_I_ARRAY_V; assume base, inc, lbnd.
	  - (racp): use ssize_t instead of long for the indices.
	  - (scm_array_index_map_x): build the index list at the last-but-one axis, then
	    set the car of the last element, instead of building the list at the last axis.
	* test-suite/tests/ramap.test
	  - add array-map! test with offset arguments.

	Factor out make1array() in scm_ramapc()
	* libguile/array-map.c: (scm_ramapc): factor out vector->array conversion
	  to aux function make1array.

	Check more cases of array-contents
	* libguile/arrays.c: (scm_array_contents): fix comment.
	* test-suite/tests/arrays.test: add cases that depend on correct
	  setting of CONTIGUOUS_FLAG.

	Refactor array-contents
	* libguile/arrays.c (scm_array_contents): Branch cases not on
	  scm_is_generalized_vector but on SCM_I_ARRAYP. Thus lbnd!=0, which
	  could happen with scm_is_generalized_vector, never appears in the
	  output.
	* test-suite/tests/arrays.test: Test array-contents.

	Check the documented matching behavior of array-map!/copy!
	* test-suite/tests/arrays.test: move array-copy! tests to ramap.test.
	* test-suite/tests/ramap.test: check the dissimilar matching behavior of
	  array-copy! and array-map! with arguments of different size.

2014-02-09  Andy Wingo  <wingo@pobox.com>

	Reindent scm_ramapc
	* libguile/array-map.c (scm_ramapc): Reindent.

2014-02-09  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Raw pointer loop in array-copy! for vector/vector case
	This special case improves

	(define a (make-array 1. 1000000 10))
	(define b (make-array *unspecified* 1000000 10))
	(define c (transpose-array (make-array *unspecified* 10 1000000) 1 0))
	,time (array-copy! a b)
	,time (array-copy! a c)

	from 0.041598s / 0.072561 to 0.012164s / 0.041886s on a i7-3930K.

	* libguile/array-map.c: (racp): if both src and dst are on vectors, use
	  the element pointers to do the copy.

2014-02-09  Andy Wingo  <wingo@pobox.com>

	Simplify scm_array_get_handle for tc7-arrays
	* libguile/array-handle.c (scm_array_get_handle): Simplify for the array
	  case, as suggested by Daniel Llorens.

2014-02-09  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Test that typed-array? returns #f with non-array argument
	* test-suite/tests/arrays.test: ditto.

	Replace SCM_IMP in array-map.c
	* libguile/array-map.c
	  - scm_ramapc: check scm_array_contents with scm_is_false.

2014-02-09  Andy Wingo  <wingo@pobox.com>

	Remove array impl. registry; instead, hard-code array handle creation
	* libguile/array-handle.h (scm_t_vector_ref, scm_t_vector_set): Rename
	  from scm_t_array_ref, scm_t_array_set.  These were named
	  scm_i_t_array_ref and scm_i_t_array_set in 1.8 and 2.0.  Change to
	  take the vector directly, instead of the array handle.  In this way,
	  generic array handles are layered on top of specific implementations
	  of backing stores.

	  Remove scm_t_array_implementation, introduced in 2.0 but never
	  documented.  It was a failed attempt to layer the array implementation
	  that actually introduced too many layers, as it prevented the "vref"
	  and "vset" members of scm_t_array_handle (called "ref" and "set" in
	  1.8, not present in 2.0) from specializing on array backing stores.

	  (scm_i_register_array_implementation) (scm_i_array_implementation_for_obj):
	  Remove these internal interfaces.

	  (scm_t_array_handle): Adapt to scm_t_vector_ref / scm_t_vector_set
	  change.

	  (scm_array_handle_ref, scm_array_handle_set): Adapt to change in
	  vref/vset prototype.

	* libguile/array-handle.c (scm_array_get_handle): Inline all the
	  necessary initializations here for all specific array types.

	* libguile/array-map.c (rafill, racp, ramap, rafe, array_index_map_1):

	* libguile/arrays.c: Remove array implementation code.

	* libguile/bitvectors.h:
	* libguile/bitvectors.c: Remove array implementation code.
	  (scm_i_bitvector_bits): New internal interface.

	* libguile/bytevectors.c: Remove array implementation code.

	* libguile/srfi-4.h: Remove declarations for internal procedures that
	  don't exist (!).

	* libguile/strings.c: Remove array implementation code.

	* libguile/vectors.c: Remove array implementation code.

2014-02-09  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix array map functions with empty arguments
	* libguile/array-map.c
	  - scm_ra_matchp: look for empty axes and return new case 5 if so. Use
	    array handles to remove the SCM_I_ARRAYP / not branch.
	  - scm_ramapc: Heed case 5.
	* test-suite/tests/ramap.test
	  - test empty arguments for array-copy! and array-for-each. Note those
	    that failed in 2.0.9.

	Fix empty array bug in array-index-map!
	* libguile/array-map.c: (scm_array_index_map_x): bail out if any one of the
	  axes is empty.
	* test-suite/tests/ramap.test: add tests for empty array-case of
	  array-index-map!. The 'f64 case with not-last emtpy axis is broken in 2.0.9.

2014-02-08  Andy Wingo  <wingo@pobox.com>

	Add "vector" member to scm_t_array_handle
	* libguile/array-handle.h (scm_t_array_handle): Add "vector" member.
	* libguile/array-handle.c (scm_array_get_handle): Initialize the vector
	  member.

	Remove "impl" member of array handles.
	* libguile/array-handle.h (scm_t_array_handle): Remove "impl" member.
	* libguile/array-handle.c (scm_array_get_handle): Adapt.

	Inline scm_i_array_implementation_for_obj in scm_i_array
	* libguile/generalized-arrays.c (scm_is_array, scm_is_typed_array): In
	  preparation for removing the registry of array implementations, remove
	  a couple uss of scm_i_array_implementation_for_obj.

2014-02-08  Andy Wingo  <wingo@pobox.com>

	vref, vset members of scm_t_array_handle
	* libguile/array-handle.h (scm_t_array_ref, scm_t_array_set): Rename
	  from scm_i_t_array_ref, scm_i_t_array_set.
	  (scm_t_array_handle): Copy vref and vset from impl to handle.
	  (scm_array_handle_ref, scm_array_handle_set):

	* libguile/array-map.c (racp, ramap, rafe, rafill, array_index_map_1):
	* libguile/array-handle.c (scm_array_get_handle): Adapt.

2014-02-08  Mark H Weaver  <mhw@netris.org>

	Fix improper use of 'with-locale'.
	* test-suite/guile-test (run-tests): Use 'setlocale' with check
	  instead of 'with-locale'.

2014-02-08  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Change uses of scm_is_simple_vector to scm_is_vector
	* libguile/filesys.c, libguile/random.c, libguile/stime.c, libguile/trees.c,
	  libguile/validate.h: use scm_is_vector instead of scm_is_simple_vector.
	* libguile/sort.c (scm_sort_x, scm_sort, scm_stable_sort_x)
	  (scm_stable_sort): Remove scm_is_vector check; scm_is_array is
	  sufficient.
	* test-suite/tests/arrays.test: Fix header.
	* test-suite/tests/random.test: New coverage test covering
	  random:normal-vector!.
	* test-suite/Makefile.am: Include random.test in make check.

2014-02-08  Andy Wingo  <wingo@pobox.com>

	SCM_I_IS_VECTOR only true for tc7_vector, not weak vectors
	* libguile/tags.h (SCM_TYP7S, SCM_HAS_TYP7S): Remove these, as we no
	  longer do the differs-by-one-bit thing for vectors and weak vectors.
	* libguile/vectors.h (SCM_I_IS_VECTOR): Use SCM_HAS_TYP7.
	  (SCM_I_IS_NONWEAK_VECTOR): Remove.
	* libguile/vm-engine.c (vector-length, vector-ref, vector-set!)
	  (vector-ref/immediate, vector-set!/immediate): We can inline these
	  instructions completely now.

	* libguile/vm.c (vm_error_not_a_vector, vm_error_out_of_range): New
	  error conditions.

2014-02-08  Andy Wingo  <wingo@pobox.com>

	Merge commit '24cac6554073bb6e691605cd6ac6196f3c0851a3'
	Conflicts:
		libguile/vectors.c

	Merge commit '5cfeff11cc58148c58a85a879fd7a3e7cfbbe8e2'
	Conflicts:
		libguile/vectors.c

2014-02-08  Andy Wingo  <wingo@pobox.com>

	Deprecate the use of the vector interface on arrays
	* libguile/vectors.c (scm_is_vector): Deprecate use on weak vectors and
	  arrays.
	  (scm_is_simple_vector): Deprecate use on weak vectors.
	  (scm_vector_length, scm_c_vector_ref, scm_c_vector_set_x): Deprecate
	  use on arrays.

	* libguile/sort.c: Adapt to check explicitly for arrays.

2014-02-08  Andy Wingo  <wingo@pobox.com>

	Deprecate use of vector-length, vector-ref, vector-set! as primitive-generics
	* libguile/vectors.c (scm_vector_length, scm_c_vector_ref):
	  (scm_c_vector_set_x): Deprecate the use of vector-length, vector-ref,
	  and vector-set! as primitive generics.

2014-02-08  Andy Wingo  <wingo@pobox.com>

	Merge commit 'fb7dd00169304a5922838e4d2f25253640a35def'
	This commit also renames uniform-vector-element-type-code to
	array-type-code.

	Conflicts:
		libguile/uniform.c
		libguile/uniform.h
		test-suite/tests/arrays.test

2014-02-08  Andy Wingo  <wingo@pobox.com>

	Merge commit 'dc65b88d839c326889618112c4870ad3a64e9446'
	Conflicts:
		libguile/srfi-4.c

	Merge commit 'b9b88351ea2c4b43a6f90938554dc5693b17e328'
	Conflicts:
		libguile/deprecated.h
		test-suite/tests/00-socket.test

	Merge commit '0ce224594ae5a673f6a397c284db5f5a61935334'

	Merge commit '495cea0c931de23f074892b3f32808e676712a18'
	Conflicts:
		libguile/weaks.c

	Merge commit 'b86069c1308a6ca36f3a3bc56134b3f8fd693592'
	Conflicts:
		libguile/hashtab.c

	Merge commit '54cded99dc5db94b1df0dc417161ebef7c60d874'

	Merge commit '2f3b7e9a41677bfe802e8a1ee851827297384c58'
	Conflicts:
		module/ice-9/pretty-print.scm

	Merge commit 'a675a2e81b792b9f860bec57c38a1948631c7a41'

2014-02-08  Andy Wingo  <wingo@pobox.com>

	Deprecate general "uniform-vector" interface
	* libguile/uniform.h:
	* libguile/uniform.c (scm_is_uniform_vector, scm_uniform_vector_p)
	  (scm_c_uniform_vector_length, scm_uniform_vector_length)
	  (scm_uniform_vector_element_type, scm_uniform_vector_element_size)
	  (scm_c_uniform_vector_ref, scm_uniform_vector_ref):
	  (scm_c_uniform_vector_set_x, scm_uniform_vector_set_x):
	  (scm_uniform_vector_to_list)
	  (scm_uniform_vector_elements, scm_uniform_vector_writable_elements):
	  Deprecate.  This interface lacked both generality and specificity.
	  The general replacement is array-length, array-ref, and friends on the
	  scheme side, or the array handle interface on the C side.  On the
	  specific side of things, there are the specific bytevector, srfi-4,
	  and bitvector interfaces.

	* test-suite/tests/arrays.test:
	* test-suite/tests/bitvectors.test:
	* test-suite/tests/ports.test:
	* test-suite/tests/srfi-4.test: Update to use array interfaces.

	* doc/ref/api-foreign.texi (Void Pointers and Byte Access):
	* doc/ref/srfi-modules.texi (SRFI-4): Update.

2014-02-08  Andy Wingo  <wingo@pobox.com>

	Simplify srfi-4 C implementation
	* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): In the raw element
	  accessors (e.g scm_u32vector_writable_elements), only permit
	  bytevectors, as the constructors will only make bytevectors.  This
	  harmonizes with the Scheme interfaces as well, which expect packed
	  bytevectors.
	  (scm_make_srfi_4_vector): Knowing that the new value is a bytevector
	  with base 0 and inc 1, simplify initialization.

2014-02-08  Andy Wingo  <wingo@pobox.com>

	Deprecate htons, htonl, ntohs, ntohl
	* libguile/sockets.h:
	* libguile/sockets.c:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_htons, scm_htonl, scm_ntohs, scm_ntohl):
	  Deprecate.  Bytevectors adequately subsume their functionality.

	* doc/ref/posix.texi:
	* test-suite/tests/00-socket.test: Update.

2014-02-08  Mark H Weaver  <mhw@netris.org>

	Improve handling of locales in the test suite.
	* test-suite/guile-test (run-tests): Load each test file within
	  (with-locale "C" ...).

	* test-suite/tests/encoding-iso88591.test:
	* test-suite/tests/encoding-iso88597.test:
	* test-suite/tests/encoding-utf8.test:
	* test-suite/tests/srfi-14.test: Remove broken code to save and restore
	  the previous locale.

	* test-suite/tests/bytevectors.test:
	* test-suite/tests/format.test:
	* test-suite/tests/regexp.test:
	* test-suite/tests/srfi-19.test:
	* test-suite/tests/tree-il.test: Make sure 'setlocale' is defined before
	  calling it.

2014-02-08  Mark H Weaver  <mhw@netris.org>

	Avoid using 'eval-when' with 'expand' in (oop goops).
	* module/oop/goops.scm: Avoid using 'eval-when' with 'expand'.

2014-02-07  Mark H Weaver  <mhw@netris.org>

	Better error reporting in 'weak-vector-ref' and 'weak-vector-set!'.
	* libguile/weaks.c (scm_c_weak_vector_ref, scm_c_weak_vector_set_x):
	  Pass procedure name to 'scm_out_of_range'.

2014-02-07  Mark H Weaver  <mhw@netris.org>

	Make size argument optional to 'make-doubly-weak-hash-table'; fix docs.
	* libguile/hashtab.c (scm_make_doubly_weak_hash_table): Make 'size'
	  argument optional, like the weak hash table constructors.

	* doc/ref/api-memory.texi (Weak hash tables): Document that 'size'
	  argument is optional for the weak hash table constructors.

2014-02-07  Mark H Weaver  <mhw@netris.org>

	Fix 'weak-vector?' doc: Weak hash tables are not weak vectors.
	* doc/ref/api-memory.texi (Weak vectors): In 'weak-vector?' entry, don't
	  claim that weak hash tables are weak vectors.  Remove statement that
	  weak vectors are mainly useful for implementing weak hash tables.

2014-02-07  Andy Wingo  <wingo@pobox.com>

	Fix truncated-print for uniform vectors
	* module/ice-9/pretty-print.scm (truncated-print): Use bytevector?
	  instead of uniform-vector?; the latter could be true for shared arrays
	  with non-zero lower bounds.

	(srfi srfi-4 gnu) uses private define-bytevector-type from (srfi srfi-4)
	* module/srfi/srfi-4/gnu.scm: Re-use implementation of
	  define-bytevector-type from srfi-4.

	Remove private unused duplicate c32/c64vector definitions
	* module/srfi/srfi-4.scm: Remove vestigial definitions for c32vectors
	  and c64vectors.  Those are defined in (srfi srfi-4 gnu).

	SRFI-4 predicates, length accessors only accept bytevectors (not arrays)
	* module/srfi/srfi-4.scm (define-bytevector-type): For the predicates
	  and length accessors, only accept bytevectors.  Since arrays don't
	  work for u32vector-ref et al, they shouldn't pass u32vector?.

	Merge commit '9b5da400dde6e6bc8fd0e318e7ca1feffa5870db'
	Conflicts:
		libguile/vectors.c
		test-suite/tests/weaks.test

	Merge commit '1e3fd6a0c81bb3e9900a93a9d1923cc788de0f99'
	Conflicts:
		doc/ref/api-memory.texi
		libguile/weaks.c
		libguile/weaks.h
		module/ice-9/weak-vector.scm

	Merge commit '40a723a92236fe4e58feb89057b4182b1fc76810'

	Merge commit 'c8e839cfeb647aca034b9bcd5a321d419dedca1f'

	Merge commit '5e69ceb7a667377a61cb0c31d7ac20e245b3fafd'

	Merge commit '866af5da3d11ac4a9df44ee8c5b1781a0073c288'
	Removes the special arity handler, and instead relies on the procedure
	returning the correct number of values.

	Merge commit '34e89877342f20fdb8a531ad78dab34cfd2b0843'
	Conflicts:
		module/Makefile.am

	Merge commit '58147d67806e1f54c447d7eabac35b1a5086c3a6'

	Merge commit 'e6c1c5f6cb16913eadeb8758cd817c5a58d146b8'

	Merge commit 'ca5e0414e96886177d883a249edd957d2331db65'
	Conflicts:
		module/language/tree-il/primitives.scm

	Merge commit '60617d819d77a1b92ed6c557a0b49b8e9a8e97b9'
	Conflicts:
		libguile/continuations.c
		libguile/eval.c
		libguile/goops.c
		libguile/instructions.c

	Merge commit 'f6ddf827f8f192af7a8cd255bd8374a0d38bbb74'
	Conflicts:
		module/ice-9/boot-9.scm
		module/oop/goops.scm

	Merge commit '45a28515c13348dfd18e53038ad63dd091a5a3c1'

	Merge commit 'a5cbbaa66a2491453db0edff9b0cb592a98f61bf'

	Merge commit '8ca97482b01cf1a6aa538cc5a2d1f71fb60f080c'
	Conflicts:
		libguile/r6rs-ports.c

	Merge commit '122f24cc8a3637ed42d7792ad1ff8ec0c49c58df'
	Conflicts:
		libguile/fports.c
		libguile/ports.c

2014-02-07  Andy Wingo  <wingo@pobox.com>

	Add weak-vector-length, weak-vector-ref, weak-vector-set!
	* libguile/weak-vectors.h:
	* libguile/weak-vectors.c (scm_is_weak_vector, scm_c_weak_vector_length):
	  (scm_c_weak_vector_ref, scm_c_weak_vector_set_x): New interfaces for
	  dealing with weak vectors from C.
	  (scm_weak_vector_length, scm_weak_vector_ref, scm_weak_vector_set_x):
	  New Scheme interfaces to weak vectors; to be used instead of
	  vector-length, vector-ref, etc.

	* module/ice-9/weak-vector.scm: Export the new interfaces.

2014-02-07  Andy Wingo  <wingo@pobox.com>

	Deprecate vector-ref, vector-length, vector-set! on weak vectors
	* libguile/vectors.c (scm_vector_length, scm_c_vector_length):
	  (scm_c_vector_ref, scm_c_vector_set_x): Deprecate the use of these
	  procedures on weak vectors.

	* test-suite/tests/guardians.test:
	* test-suite/tests/weaks.test: Adapt test suites.

2014-02-07  Andy Wingo  <wingo@pobox.com>

	Add weak-vector-length, weak-vector-ref, weak-vector-set!
	* libguile/weaks.c (scm_is_weak_vector, scm_c_weak_vector_length):
	  (scm_c_weak_vector_ref, scm_c_weak_vector_set_x): New interfaces for
	  dealing with weak vectors from C.
	  (scm_weak_vector_length, scm_weak_vector_ref, scm_weak_vector_set_x):
	  New Scheme interfaces to weak vectors; to be used instead of
	  vector-length, vector-ref, etc.

	* module/ice-9/weak-vector.scm: Export the new interfaces.

	* doc/ref/api-memory.texi (Weak vectors): Document them.

2014-02-07  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix bad uses of base and lbnd on rank 1 arrays
	 * libguile/array-map.c
	   - rafill, ramap, rafe, racp: object from SCM_I_ARRAY_V always
	     has base 0, lbnd 0 and inc 1; make use of this.
	 * libguile/arrays.c
	   - array_handle_ref, array_handle_set: idem.
	   - array_get_handle: sanity check.
	 * libguile/generalized-vectors.c
	   - scm_c_generalized_vector_ref, scm_c_generalized_vector_set_x:
	     pos should be base when idx is lbnd. Furthermore, pos should be signed and
	     have its overflow checked; do this by handling the job to
	     scm_c_array_ref_1, scm_c_array_set_1_x.
	 * libguile/generalized-vectors.h
	   - fix prototypes.

2014-02-06  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Reorder arrays.test
	* test-suite/tests/arrays.test: dependence reordering: first sanity, then
	  make-array, then array-equal?, then make-shared-array, shared-array-root,
	  then the rest, many of which use make-shared-array.

	Don't use scm_is_generalized_vector in transpose-array
	* libguile/arrays.c (scm_transpose_array)
	  - Use scm_c_array_rank(), which contains an implicit is_array test.
	  - Handle the rank 0 case.
	* test-suite/tests/arrays.test
	  - Add test for rank 0 case.
	  - Add failure test for non array argument.

	Tests for transpose-array
	* test-suite/tests/arrays.test: test transpose-array for ranks 1, 2, 3.

	Don't use scm_is_generalized_vector in shared-array-root
	* libguile/arrays.c: (scm_shared_array_root): replace check for
	  scm_is_generalized_vector.

	Tests for shared-array-root
	* test-suite/tests/arrays.test: check shared-array-root against
	  make-shared-array, array-contents.

	Remove unnecessary conditions in array constructors
	* libguile/arrays.c: (scm_make_type_array, scm_from_contigous_typed_array,
	  scm_from_contigous_array): Remove conditions known to be true.

	Remove generalized-vectors.h includes
	* libguile/srfi-4.c, libguile/uniform.h: ditto.

2014-02-06  Andy Wingo  <wingo@pobox.com>

	Fix array-index-map refactor
	* libguile/ramap.c (array_index_map_1): Fix to use array handle
	  properly.

	Array-map refactors
	* libguile/array-map.c (scm_ra_matchp): Refactor logic a bit.
	  (array_index_map_1, array_index_map_n)
	  (scm_array_index_map_x): Internally refactor array-index-map! to use
	  separate implementations for rank 1 versus rank >1 arrays.

2014-02-06  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Don't use generalized-vector in array-map.c (II)
	* libguile/array-map.c
	  - replace scm_is_generalized_vector by scm_is_array && !SCM_I_ARRAY_P.
	  - replace scm_c_generalized_vector_length by scm_c_array_length.
	  - remove header.

	Don't use generalized-vector in array-map.c (I)
	* array-map.c: (AREF, ASET): Rename from GVREF, GVSET and use rank-1
	  array accessors.

2014-02-06  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Don't use generalized-vector functions in uniform.c
	* libguile/uniform.c (scm_is_uniform_vector): Replace
	  scm_is_generalized_vector and scm_generalized_vector_get_handle by
	  scm_is_array and manual rank check.
	  (scm_c_uniform_vector_length): Use scm_c_array_length.
	  (scm_c_uniform_vector_ref): Use scm_c_array_ref_1.
	  (scm_c_uniform_vector_set): Use scm_c_array_set_1_x.
	  (scm_uniform_vector_writable_elements): Use scm_array_get_handle, and
	  assert that the rank is 1.

	* test-suite/test/arrays.test: Rename the uniform-vector-ref block to
	  uniform-vector.  Exercise uniform-vector-length and shared arrays
	  remaining uniform.

	Modifications by Andy Wingo <wingo@pobox.com>.

2014-02-06  Andy Wingo  <wingo@pobox.com>

	Replace generalized-vector calls in array_handle_ref/set
	* libguile/arrays.c: (array-handle-ref, array-handle-set): Use the
	  rank-1 array accessors.

2014-02-06  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Replace scm_c_generalized_vector_length in arrays.c
	* libguile/arrays.c: (scm_array_contents, scm_make_shared_array):
	  arrays are known of rank 1 so replace by scm_c_array_length.

	Replace scm_c_generalized_vector_length in random.c
	* libguile/random.c: (random:solid-sphere!): array is of known
	  rank 1, so use scm_c_array_length() instead.

	Tests for array-copy!, empty case
	* test-suite/tests/ramap.test: test array-copy! with empty destination.
	  Fix uses of constant array as destination.

2014-02-06  Mark H Weaver  <mhw@netris.org>

	Remove outdated documentation of LTDL_LIBRARY_PATH.
	* doc/ref/guile-invoke.texi (Environment Variables): Remove
	  documentation of 'LTDL_LIBRARY_PATH'.

	Document 'equal?' in list of R6RS incompatibilities.
	* doc/ref/r6rs.texi (R6RS Incompatibilities): Mention that 'equal?'
	  may not terminate when applied to cyclic datums.

2014-02-05  Andy Wingo  <wingo@pobox.com>

	Various VM stack management fixes
	* libguile/vm.c (vm_increase_sp): New interface, to increase the SP to
	  some new level, possibly expanding the stack.
	  (vm_push_sp, vm_restore_sp): Intefaces to vm_increase_sp.
	  (vm_return_to_continuation): Don't throw an error if there's not
	  enough space; instead, expand.
	  (vm_reinstate_partial_continuation): Use the new helper.
	  (return_unused_stack_to_os): Avoid off-by-one error (sp points to
	  valid memory.)
	  (scm_call_n): Never write beyond the sp.

2014-02-04  Mark H Weaver  <mhw@netris.org>

	REPL Server: Remove unneeded error case in 'run-server'.
	* module/system/repl/server.scm (run-server): Remove case that handled
	  'interrupt' exceptions specially.  It is no longer needed since
	  e6c8e6047ed2e772cc4e1fb5ad4d389e5c616feb (REPL Server: Don't establish
	  a SIGINT handler.)

	REPL Server: Redirect warnings to client socket.
	* module/system/repl/server.scm (serve-client): Use parameterize.
	  Redirect warnings to client socket.

	Don't check HAVE_ALARM, which no longer exists.
	* libguile/scmsigs.c (scm_alarm): Remove check for HAVE_ALARM.
	  Conditionalize only on HAVE_DECL_ALARM.

	Update Gnulib to v0.1-77-gd9361da

2014-02-03  Mark H Weaver  <mhw@netris.org>

	define-values: Blackhole 'dummy'; work around lack of toplevel hygiene.
	* module/ice-9/boot-9.scm (define-values): Use 'generate-temporaries' to
	  generate a fresh name for 'dummy', to work around the lack of hygiene
	  for macro-introduced toplevel identifiers.  Blackhole 'dummy' to avoid
	  keeping garbage alive.  Add more comments.

2014-02-02  Andy Wingo  <wingo@pobox.com>

	Add VM and compiler support for calls to known procedures
	* module/language/cps.scm ($callk): New expression type, for calls to
	  known labels.  Part of "low CPS".
	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/verify.scm: Adapt call sites.

	* libguile/vm-engine.c (call-label, tail-call-label): New instructions.
	  Renumber the rest; this is an ABI change.

	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION):
	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.

	* doc/ref/compiler.texi (CPS in Guile): Document $callk.

2014-02-02  Andy Wingo  <wingo@pobox.com>

	Remove code to run GC more frequently as process image size increased
	* libguile/gc.c: Remove code that would try to run GC more frequently as
	  the process image size was increasing.  Before, it was often the case
	  that the heap was the main component of image size, but with
	  expandable stacks and statically allocated data that is no longer
	  true.  Also, once scm_gc_register_allocation was incorporated, we
	  don't need to be so conservative any more.  It seems this code was
	  simply causing too many gc's to run.  Removing it improves some
	  micro-benchmarks; time will tell.

2014-02-02  Andy Wingo  <wingo@pobox.com>

	Add thread-local lock-free, TLS-free freelists.
	* libguile/bdw-gc.h: Remove a needless compatibility hack.

	* libguile/gc-inline.h: New file, implementing thread-local freelists
	  providing faster allocation if we already have a scm_i_thread*
	  pointer.  Based on gc_inline.h from libgc.

	* libguile/threads.h (scm_i_thread): Add freelists here.
	* libguile/threads.c (guilify_self_1, guilify_self_2): Initialize
	  freelists.

	* libguile/vm.c: Include gc-inline.h.
	* libguile/vm-engine.c: Rename current_thread to thread.  Use
	  scm_inline_cons instead of scm_cons, scm_inline_cell instead of
	  scm_cell, and scm_inline_words instead of words.

2014-02-02  Andy Wingo  <wingo@pobox.com>

	Add dead slot map cache
	* libguile/vm.c (find_dead_slot_map, scm_i_vm_mark_stack): Use a little
	  cache for dead slot maps.  Helps when marking very deep recursive
	  stacks.

2014-02-02  Mark H Weaver  <mhw@netris.org>

	Implement R7RS 'define-values'.
	* module/ice-9/boot-9.scm (%define-values-arity-error): New procedure.
	  (define-values): New macro.

	* doc/ref/api-binding.texi (Binding Multiple Values): Add docs.

	* test-suite/tests/syntax.test: Add tests.

2014-02-01  Mark H Weaver  <mhw@netris.org>

	Implement SRFI-64 - A Scheme API for test suites.
	* module/srfi/srfi-64.scm: New file.
	* module/srfi/srfi-64/testing.scm: New file.
	* module/Makefile.am: Add rule for srfi-64.go dependency on
	  srfi-64/testing.scm.
	  (SRFI_SOURCES): Add srfi/srfi-64.scm.
	  (NOCOMP_SOURCES): Add srfi/srfi-64/testing.scm.
	* doc/ref/srfi-modules.texi (SRFI-64): New node.
	* test-suite/tests/srfi-64.test: New file.
	* test-suite/tests/srfi-64-test.scm: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add test-suite/tests/srfi-64.test.
	  (EXTRA_DIST): Add tests/srfi-64-test.scm.

	Implement SRFI-43 Vector Library.
	* module/srfi/srfi-43.scm: New file.
	* module/Makefile.am (SRFI_SOURCES): Add module/srfi/srfi-43.scm.
	* test-suite/tests/srfi-43.test: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add test-suite/tests/srfi-43.test.
	* doc/ref/srfi-modules.texi (SRFI-43, SRFI-43 Constructors)
	  (SRFI-43 Predicates, SRFI-43 Selectors, SRFI-43 Iteration)
	  (SRFI-43 Searching, SRFI-43 Mutators, SRFI-43 Conversion): New nodes.

	Compile numerical comparisons with more than 2 arguments to VM code.
	* module/language/tree-il/primitives.scm (chained-comparison-expander):
	  New procedure.
	  (*primitive-expand-table*): Add primitive expanders for '<', '>',
	  '<=', '>=', and '='.

2014-01-31  Andy Wingo  <wingo@pobox.com>

	Return unused parts of the stack to the OS
	* libguile/vm.h (struct scm_vm): Reorder fields.  Add "sp_max_since_gc"
	  field.
	* libguile/vm-engine.c (ALLOC_FRAME, RESET_FRAME):
	* libguile/vm.c (vm_return_to_continuation)
	  (vm_reinstate_partial_continuation, scm_call_n): In places where we
	  could increase the stack height, update sp_max_since_gc.
	  (vm_expand_stack): Relocate sp_max_since_gc on expansion.
	  (scm_bootstrap_vm): Record the page size using gnulib's getpagesize.
	  (return_unused_stack_to_os): New routine, run when marking stacks.

	Micro-optimization to scm_i_vm_mark_stack
	* libguile/vm.c (scm_i_vm_mark_stack): Micro-optimize GC_MARK_AND_PUSH
	  to cache the plausible heap bounds locally.

2014-01-31  Mark H Weaver  <mhw@netris.org>

	Revert "Primitive expand numerical comparisons with more than 2 arguments."
	This reverts commit 4dc4b86e858d391d20d0ea2551614a89fa3bd4d1.

2014-01-28  Mark H Weaver  <mhw@netris.org>

	Primitive expand numerical comparisons with more than 2 arguments.
	* module/language/tree-il/primitives.scm (chained-comparison-expander):
	  New procedure.
	  (*primitive-expand-table*): Add primitive expanders for '<', '>',
	  '<=', '>=', and '='.

	Add 'positive?' and 'negative?' as primitives.
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*)
	  (*effect-free-primitives*): Add 'positive?' and 'negative?'.
	  (*primitive-expand-table*): Add primitive expanders for 'positive?'
	  and 'negative?'.

2014-01-28  Andy Wingo  <wingo@pobox.com>

	Minor for-each speedup
	* module/ice-9/boot-9.scm (for-each): Minor speedup by unrolling
	  tortoise/hare loop.

	Minor for-each speedup
	* module/ice-9/boot-9.scm (for-each): Minor speedup by unrolling
	  tortoise/hare loop.

	Unnecessary VM_HANDLE_INTERRUPTS elision
	* libguile/vm-engine.c: Remove VM_HANDLE_INTERRUPTS before entering a
	  subr or foreign call.  The bytecode stub will have already done so
	  when entering the stub, and the return sequence handles doing so
	  before returning.

	Fix tracing
	* module/system/vm/trace.scm (print-return): Remove frame argument.
	  (trace-calls-to-procedure, trace-calls-in-procedure): Adapt callers.
	* module/system/vm/traps.scm (trap-in-procedure, trap-frame-finish):
	  (trap-calls-to-procedure): Since the pop continuation hook is now
	  called after the continuation is popped, we need to check the right
	  frame.  Fixes tail-calls in the trace root, and probably other things.

2014-01-26  Andy Wingo  <wingo@pobox.com>

	More precise stack marking via .guile.frame-maps section
	* module/language/cps/slot-allocation.scm (lookup-dead-slot-map)
	  (allocate-slots): For each non-tail call in a function, compute the
	  set of slots that are dead after the function has begun the call.

	* module/language/cps/compile-bytecode.scm (compile-fun): Emit the
	  `dead-slot-map' macro instruction for non-tail calls.

	* module/system/vm/assembler.scm (<asm>): Add `dead-slot-maps' member.
	  (dead-slot-map): New macro-instruction.
	  (link-frame-maps, link-dynamic-section, link-objects): Write dead
	  slots information into .guile.frame-maps sections of ELF files.
	* module/system/vm/elf.scm (DT_GUILE_FRAME_MAPS): New definition.

	* libguile/loader.h:
	* libguile/loader.c (DT_GUILE_FRAME_MAPS, process_dynamic_segment):
	  (load_thunk_from_memory, register_elf): Arrange to parse
	  DT_GUILE_FRAME_MAPS out of the dynamic section.
	  (find_mapped_elf_image_unlocked, find_mapped_elf_image): New helpers.
	  (scm_find_mapped_elf_image): Refactor.
	  (scm_find_dead_slot_map_unlocked): New interface.

	* libguile/vm.c (scm_i_vm_mark_stack): Mark the hottest frame
	  conservatively, as before.  Otherwise use the dead slots map, if
	  available, to avoid marking data that isn't live.

2014-01-26  Andy Wingo  <wingo@pobox.com>

	Add NEWS for Guile 2.2
	* NEWS: Update for 2.1.1.

	Document top-level pseudo-hygiene
	* doc/ref/api-macros.texi (Hygiene and the Top-Level): Add a section
	  documenting our pseudo-hygienic top-level names.

2014-01-24  Mark H Weaver  <mhw@netris.org>

	Implement SRFI-111 Boxes.
	* module/srfi/srfi-111.scm: New file.
	* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-111.scm.
	* test-suite/tests/srfi-111.test: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-111.test.
	* doc/ref/srfi-modules.texi (SRFI-111): New node.

2014-01-24  Mark H Weaver  <mhw@netris.org>

	Fix thread-unsafe lazy initializations.
	* libguile/backtrace.c (print_exception_var): New static variable.
	  (init_print_exception_var): New static function.
	  (scm_print_exception): Remove thread-unsafe lazy initialization.
	  Call 'init_print_exception_var' using 'scm_i_pthread_once'.
	  Use 'print_exception_var'.

	* libguile/continuations.c (call_cc): New static variable.
	  (init_call_cc): New static function.
	  (scm_i_call_with_current_continuation): Remove thread-unsafe lazy
	  initialization.  Call 'init_call_cc' using 'scm_i_pthread_once'.

	* libguile/debug.c (local_eval_var): New static variable.
	  (init_local_eval_var): New static function.
	  (scm_local_eval): Remove lazy initialization using mutexes.
	  Call 'init_local_eval_var' using 'scm_i_pthread_once'.
	  Use 'scm_variable_ref' instead of 'SCM_VARIABLE_REF'.

	* libguile/eval.c (map_var, for_each_var): New static variables.
	  (init_map_var, init_for_each_var): New static functions.
	  (scm_map, scm_for_each): Remove thread-unsafe lazy initializations.
	  Call 'init_map_var' (or 'init_for_each_var') using 'scm_i_pthread_once'.
	  Use 'map_var' (or 'for_each_var').

	* libguile/frames.c (frame_arguments_var): New static variable.
	  (init_frame_arguments_var): New static function.
	  (scm_frame_arguments): Remove thread-unsafe lazy initialization.
	  Call 'init_frame_arguments_var' using 'scm_i_pthread_once'.
	  Use 'frame_arguments_var'.  Use 'scm_variable_ref' instead of
	  'SCM_VARIABLE_REF'.

	* libguile/goops.c (delayed_compile_var): New static variable.
	  (init_delayed_compile_var): New static function.
	  (make_dispatch_procedure): Remove thread-unsafe lazy initialization.
	  Call 'init_delayed_compile_var' using 'scm_i_pthread_once'.
	  Use 'delayed_compile_var'.  Use 'scm_variable_ref' instead of
	  'SCM_VARIABLE_REF'.

	* libguile/instructions.c (instructions_by_name): New static variable.
	  (init_instructions_by_name): New static function.
	  (scm_lookup_instruction_by_name): Remove thread-unsafe lazy
	  initialization.  Call 'init_instructions_by_name' using
	  'scm_i_pthread_once'.

	* libguile/ports.c (current_warning_port_var)
	  (current_warning_port_once): New static variables.
	  (init_current_warning_port_var): New static function.
	  (scm_current_warning_port): Remove lazy initialization using mutexes.
	  Call 'init_current_warning_port_var' using 'scm_i_pthread_once'.
	  Use 'current_warning_port_var'.
	  (scm_set_current_warning_port): Remove thread-unsafe lazy initialization.
	  Call 'init_current_warning_port_var' using 'scm_i_pthread_once'.
	  Use 'current_warning_port_var'.

	* libguile/strings.c (null_stringbuf): New static variable.
	  (init_null_stringbuf): New static function.
	  (scm_i_make_string): Remove thread-unsafe lazy initialization.
	  Call 'init_null_stringbuf' using 'scm_i_pthread_once'.

	* libguile/strports.c (eval_string_var, k_module): New static variables.
	  (init_eval_string_var_and_k_module): New static function.
	  (scm_eval_string_in_module): Remove lazy initialization using mutexes.
	  Call 'init_eval_string_var_and_k_module' using 'scm_i_pthread_once'.
	  Use 'eval_string_var'.

	* libguile/throw.c (CACHE_VAR): Remove incorrect macro.
	  (catch_var, throw_var, with_throw_handler_var): New static variables.
	  (scm_catch, scm_catch_with_pre_unwind_handler): Remove thread-unsafe
	  lazy initialization.  Use 'catch_var'.
	  (init_with_throw_handler_var): New static function.
	  (scm_with_throw_handler): Remove thread-unsafe lazy initialization.
	  Call 'init_with_throw_handler_var' using 'scm_i_pthread_once'.
	  Use 'with_throw_handler_var'.
	  (scm_throw): Remove thread-unsafe lazy initialization.
	  Use 'throw_var'.
	  (scm_init_throw): Initialize 'catch_var' and 'throw_var'.

2014-01-23  Mark H Weaver  <mhw@netris.org>

	Improve correctness and consistency of 'eval-when' usage.
	* module/ice-9/boot-9.scm:
	* module/ice-9/i18n.scm:
	* module/ice-9/poll.scm:
	* module/ice-9/popen.scm:
	* module/ice-9/r6rs-libraries.scm:
	* module/oop/goops.scm:
	* module/oop/goops/compile.scm:
	* module/oop/goops/dispatch.scm:
	* module/srfi/srfi-88.scm:
	* module/system/foreign.scm:
	* module/texinfo/serialize.scm: Change most uses of 'compile' to
	  'expand', except where we must avoid it during initial bootstrap
	  before the module system is loaded.  Remove redundant uses of
	  'compile' where 'expand' is also given.  Standardize on the
	  "(expand load eval)" order of conditions.

	Improve docs for 'eval-when'.
	* doc/ref/api-macros.texi (Eval When): Explain in detail what each
	  condition means, including 'expand' which was previously undocumented.
	  Change the example to use (expand load eval) and recommend that set of
	  conditions, instead of (compile load eval) which was previously
	  recommended and shown in the example.

2014-01-21  Ludovic Courtès  <ludo@gnu.org>

	Buffered custom binary input ports correctly handle partial read requests.
	* libguile/r6rs-ports.c (cbip_fill_input): Always initialize 'read_pos'
	  when BUFFERED.
	* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports")["custom binary
	  input port buffered partial reads"]: New test.

2014-01-21  Mark H Weaver  <mhw@netris.org>

	Fix nested block comment example in manual.
	Reported by Chris K. Jester-Young <cky944@gmail.com>.

	* doc/ref/api-evaluation.texi (Block Comments): Fix example.

2014-01-21  Mark H Weaver  <mhw@netris.org>

	REPL Server: Don't establish a SIGINT handler.
	* module/system/repl/server.scm (call-with-sigint): Remove.
	  (accept-new-client): Don't wrap 'call-with-sigint' around call to
	  'accept'.

2014-01-21  Mark H Weaver  <mhw@netris.org>

	Write out HTTP Basic auth headers correctly.
	Fixes <http://bugs.gnu.org/14370>.
	Reported by Atom X Zane <atomx@deadlyhead.com>.

	* module/web/http.scm (write-credentials): Handle the Basic auth scheme
	  correctly.

	* test-suite/tests/web-http.test (pass-if-round-trip): Use
	  'pass-if-equal' for better error reporting.
	  ("request headers"): Add tests.

	* THANKS: Add "Atom X Zane" to bug fix section.

2014-01-21  Mark H Weaver  <mhw@netris.org>

	Merge branch 'stable-2.0'
	Conflicts:
		libguile/read.c
		test-suite/tests/web-response.test

2014-01-21  Andy Wingo  <wingo@pobox.com>

	Add support for content-disposition
	* module/web/http.scm ("Content-Disposition"): Add a parser and
	  serializer.  Defined in RFC2616 section 19.5.1.

	* test-suite/tests/web-http.test ("entity headers"): New test case.

2014-01-20  Mark H Weaver  <mhw@netris.org>

	Fix (port-conversion-strategy #f).
	Reported by Doug Evans <xdje42@gmail.com>.

	* libguile/ports.c (scm_port_conversion_strategy): Don't validate
	  that 'port' is an open port until after the (port == #f) case
	  has been handled.

2014-01-18  Ludovic Courtès  <ludo@gnu.org>

	Custom binary input ports support 'setvbuf'.
	* libguile/r6rs-ports.c (CBIP_BUFFER_SIZE): Adjust comment.  Set to 8KiB.
	  (SCM_SET_CBIP_BYTEVECTOR): New macro.
	  (cbip_setvbuf): New function.
	  (make_cbip): Set PORT's 'setvbuf' internal field.
	  (cbip_fill_input): Check whether PORT is buffered.  When unbuffered,
	  check whether BV can hold C_REQUESTED bytes, and allocate a new
	  bytevector if not; copy the data back from BV to c_port->read_pos.
	  Remove 'again' label, and don't loop there.
	* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports")["custom binary
	  input port unbuffered & 'port-position'", "custom binary input port
	  unbuffered & 'read!' calls", "custom binary input port, unbuffered
	  then buffered", "custom binary input port, buffered then unbuffered"]:
	  New tests.
	* doc/ref/api-io.texi (R6RS Binary Input): Document the buffering of
	  custom binary input ports, and link to 'setvbuf'.

	Prepare 'setvbuf' to support for non-file ports.
	* libguile/ports-internal.h (struct scm_port_internal): Add
	  setvbuf' field.  Change 'pending_eof' to a 1-bit unsigned char.
	* libguile/ports.c (scm_new_port_table_entry): Clear 'pti->setvbuf'.
	* libguile/fports.c (scm_setvbuf): Accept any open port, and error out
	  when PORT's setvbuf' field is NULL.  Remove explicit 'scm_gc_free' calls.
	  (scm_i_fdes_to_port): Set PORT's 'setvbuf' field.
	* test-suite/tests/ports.test ("setvbuf")["closed port", "string port"]:
	  New tests.
	* doc/ref/posix.texi (Ports and File Descriptors): Suggest that
	  'setvbuf' works for different port types.

2014-01-18  Andy Wingo  <wingo@pobox.com>

	Add support for content-disposition
	* module/web/http.scm ("Content-Disposition"): Add a parser and
	  serializer.  Defined in RFC2616 section 19.5.1.

	* test-suite/tests/web-http.test ("entity headers"): New test case.

2014-01-17  Arne Babenhauserheide  <arne_bab@web.de>

	doc: embedding example more readable.
	* doc/ref/guile.texi (A Sample Guile Main Program): Easier to read
	  example code and building split into 2 subsections.

2014-01-17  Ludovic Courtès  <ludo@gnu.org>

	Thank Sree Harsha.

2014-01-17  Ludovic Courtès  <ludo@gnu.org>

	Arrange so that 'file-encoding' does not truncate the encoding name.
	Fixes <http://bugs.gnu.org/16463>.
	Reported by Sree Harsha Totakura <sreeharsha@totakura.in>.

	* libguile/read.c (ENCODING_NAME_MAX_SIZE): New macro.
	  (SCM_ENCODING_SEARCH_SIZE): Change to 500 + ENCODING_NAME_MAX_SIZE.
	  (scm_i_scan_for_encoding): Return NULL if there's less than
	  ENCODING_NAME_MAX_SIZE bytes once "coding: *" has been read.
	* test-suite/tests/coding.test ("line
	  comment")["http://bugs.gnu.org/16463"]: New test.

2014-01-16  Andy Wingo  <wingo@pobox.com>

	Finish documenting the new compiler
	* doc/ref/compiler.texi (An Introduction to CPS): Reword.
	  (Compiling CPS): New sub-sub-section.
	  (Bytecode): New sub-section.

	Fix CPS doc typos
	* doc/ref/compiler.texi (CPS in Guile): Fix a couple typos.

2014-01-15  Ludovic Courtès  <ludo@gnu.org>

	web: Don't throw if a response is longer than its Content-Length says.
	* module/web/response.scm (make-delimited-input-port): Read at most LEN
	  bytes from PORT, instead of trying to read more and returning an error
	  if more is available.  Try again when 'get-bytevector-n!' return zero.
	* test-suite/tests/web-response.test (example-1): Add garbage after the
	  body itself.

	Custom binary input ports sanity-check the return value of 'read!'.
	* libguile/r6rs-ports.c (cbip_fill_input): Throw an exception when
	  C_OCTETS is greater than what was requested.
	* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports")["custom binary
	  input port 'read!' returns too much"]: New test.

2014-01-15  Mark H Weaver  <mhw@netris.org>

	Document that we support srfi-46 and add it to %cond-expand-features.
	* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-46.

	* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-46 to the list of core
	  features.
	  (SRFI-46): New node.

	* doc/ref/api-macros.texi (Syntax Rules): Mention that the custom
	  ellipsis identifier support is specified by SRFI-46.

	* test-suite/tests/syntax.test ("syntax-rules"): Add ellipsis hygiene
	  test from SRFI-46.

2014-01-15  Mark H Weaver  <mhw@netris.org>

	Document that we support srfi-87 and add it to %cond-expand-features.
	* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-87.

	* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-87 to the list of core
	  features.
	  (SRFI-87): New node.

2014-01-15  Mark H Weaver  <mhw@netris.org>

	Merge branch 'stable-2.0'

	print: In R7RS |...| symbols, print most graphic characters unescaped.
	* libguile/print.c (print_r7rs_extended_symbol): Print any unicode
	  graphic character other than '|' or '\' unescaped.  Escape any spacing
	  character other than ASCII space.

	Merge branch 'stable-2.0'
	Conflicts:
		libguile/print.c
		libguile/read.c
		test-suite/tests/print.test

2014-01-15  Mark H Weaver  <mhw@netris.org>

	print: Support R7RS |...| symbol notation.
	* libguile/print.c (scm_print_opts): Add 'r7rs-symbols' print option.
	  (symbol_has_extended_read_syntax): If the 'r7rs-symbols' option is
	  enabled, then disallow '|' and '\' from bare symbols.
	  (print_extended_symbol): Use 'scm_lfwrite' and 'scm_putc' instead of
	  'display_string' and 'display_character' when printing ASCII literals.
	  (print_r7rs_extended_symbol): New static function.
	  (scm_i_print_symbol_name): If the 'r7rs-symbols' option is enabled,
	  use 'print_r7rs_extended_symbol' instead of 'print_extended_symbol'.

	* libguile/private-options.h (SCM_PRINT_R7RS_SYMBOLS_P): New macro.
	  (SCM_N_PRINT_OPTIONS): Increment.

	* doc/ref/api-evaluation.texi (Scheme Write): Mention 'r7rs-symbols'
	  print option.

	* test-suite/tests/print.test ("write"): Add tests.

2014-01-15  Mark H Weaver  <mhw@netris.org>

	read: Support R7RS |...| symbol notation.
	* libguile/private-options.h (SCM_R7RS_SYMBOLS_P): New macro.
	  (SCM_N_READ_OPTIONS): Increment.

	* libguile/read.c (scm_read_opts): Add entry for 'r7rs-symbols'.
	  (t_read_opts): Add field for 'r7rs_symbols_p'.
	  (scm_read_string_like_syntax): New function based on earlier
	  'scm_read_string' that handles either string literals or R7RS quoted
	  symbols (delimited by vertical bars), depending on the value of 'chr'.
	  (scm_read_string): Reimplement based on 'scm_read_string_like_syntax'.
	  (scm_read_r7rs_symbol): New static function.

	* doc/ref/api-data.texi (Symbol Read Syntax): Briefly describe the R7RS
	  symbol syntax, mention the 'r7rs-symbols' read option, and give some
	  examples.

	* doc/ref/api-evaluation.texi (Scheme Read): Mention the 'r7rs-symbols'
	  read option.

	* test-suite/tests/reader.test ("reading"): Add test.

2014-01-14  Mark H Weaver  <mhw@netris.org>

	Document that we support srfi-62 and add it to %cond-expand-features.
	* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-62.

	* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-62 to the list of core
	  features.
	  (SRFI-62): New node.

2014-01-14  Mark H Weaver  <mhw@netris.org>

	Merge branch 'stable-2.0'
	Conflicts:
		libguile/chars.c
		libguile/read.c
		test-suite/tests/reader.test

	read: use 'c_tolower' instead of 'tolower' in 'try_read_ci_chars'.
	* libguile/read.c: Include <c-ctype.h>.
	  (try_read_ci_chars): Use 'c_tolower' instead of 'tolower'.

2014-01-14  Mark H Weaver  <mhw@netris.org>

	Recognize 'escape' character name, per R7RS.
	* libguile/chars.c (scm_r7rs_charnames, scm_r7rs_charnums):
	  New static constants.
	  (SCM_N_R7RS_CHARNAMES): New macro.
	  (scm_i_charname, scm_i_charname_to_char): Adapt to new R7RS
	  char names.

	* doc/ref/api-data.texi (Characters): Document #\escape.

	* test-suite/tests/reader.test ("reading"): Add test.

2014-01-14  Mark H Weaver  <mhw@netris.org>

	read: Accept "\|" in string literals.
	* libguile/read.c (scm_read_string): Accept "\|" in string literals.

	* doc/ref/api-data.texi (String Syntax): Add "\|" to the list of
	  supported backslash escapes.

	* test-suite/tests/reader.test ("reading"): Add test.

2014-01-14  Mark H Weaver  <mhw@netris.org>

	read: Support R7RS '#true' and '#false' syntax for booleans.
	* libguile/read.c (try_read_ci_chars): New static function.
	  (scm_read_boolean, scm_read_array): Use 'try_read_ci_chars'.

	* doc/ref/api-data.texi (Booleans): Update docs.

	* test-suite/tests/reader.test ("reading"): Add tests.

2014-01-14  Mark H Weaver  <mhw@netris.org>

	Add srfi-16 and srfi-30 to %cond-expand-features.
	* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-16 and
	  srfi-30.

	* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-16 and srfi-30 to the
	  list of core features.

	* module/srfi/srfi-16.scm: Remove call to 'cond-expand-provide'.

2014-01-14  Mark H Weaver  <mhw@netris.org>

	Merge branch 'stable-2.0'
	Conflicts:
		libguile/hash.c
		module/ice-9/psyntax-pp.scm
		module/ice-9/psyntax.scm
		test-suite/tests/r6rs-ports.test

2014-01-13  Ludovic Courtès  <ludo@gnu.org>

	'port-position' works on CBIPs that do not support 'set-port-position!'.
	* libguile/r6rs-ports.c (cbp_seek)[WHENCE == SEEK_CUR]: Break out of the
	  switch statement when OFFSET is zero.
	  Pass 'scm_wrong_type_arg_msg' a phrase suitable for use after
	  "expecting".
	* test-suite/tests/r6rs-ports.test ("7.2.7 Input Ports")["custom binary
	  input port supports `port-position', not `set-port-position!'"]: New
	  test.

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

	Finish CPS documentation
	* doc/ref/compiler.texi (Continuation-Passing Style): Flesh out the
	  documentation.

2014-01-12  Mark H Weaver  <mhw@netris.org>

	Fix 'exact-integer?' comment in numbers.test.
	* test-suite/tests/numbers.test: Fix 'exact-integer?' comment.

2014-01-12  Mark H Weaver  <mhw@netris.org>

	Fix hashing of empty vectors.
	Fixes a bug introduced in cc1cd04f8111c306cf48b93e131d5c1765c808a3
	"Fix hashing of vectors to run in bounded time."

	* libguile/hash.c (scm_hasher): Avoid division by zero.

	* test-suite/tests/hash.test ("hash"): Add tests.

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

	Rename $ktrunc to $kreceive
	* module/language/cps.scm ($kreceive): Rename from ktrunc.

	* module/language/cps/arities.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/dce.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/effects-analysis.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/simplify.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Adapt all users.

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

	Returning too many values to call-with-values raises a runtime error
	* module/language/cps/compile-bytecode.scm (compile-fun): Now that all
	  $call expressions continue to $ktail or $ktrunc, remove the $kargs
	  case, and make receive-values bail if too many values are returned.

2014-01-12  Mark H Weaver  <mhw@netris.org>

	Bump user-visible copyright years to 2014.
	* doc/ref/guile.texi: Add 2014 to list of copyright years in @copying
	  section.

	* module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to
	  2014.

	* module/system/repl/common.scm (*version*): Add 2014 to the range of
	  copyright years.

2014-01-12  Mark H Weaver  <mhw@netris.org>

	Fix hashing of vectors to run in bounded time.
	* libguile/hash.c (SCM_MIN): New macro.
	  (scm_hasher): In vector case, do nothing if d is 0.  Make sure to
	  recurse with a reduced d.  Move the loop out of the 'if'.

2014-01-11  Andy Wingo  <wingo@pobox.com>

	Insert explicit $ktrunc nodes everywhere that truncates multiple values
	* module/language/tree-il/compile-cps.scm (init-default-value, convert):
	  Explicitly insert $ktrunc nodes on all places that can truncate to
	  single values.

	Add simplification pass
	* module/Makefile.am:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/simplify.scm: New pass.

	Add DCE pass.
	* module/language/cps/dce.scm: New pass.
	* module/Makefile.am:
	* module/language/cps/compile-bytecode.scm: Wire up the new pass.

	Shuffle the first return value from truncating calls
	* module/language/cps/slot-allocation.scm (allocate-slots): For
	  truncating calls, shuffle the first return value (if any).  Avoids
	  frame size growth due to sparse locals, pegged where they were left by
	  procedure call returns.  With this patch, eval with $ktrunc nodes goes
	  from 31 locals to 18 (similar to the size before adding $ktrunc
	  nodes).

	All $values expressions go through allocate-values
	* module/language/cps/slot-allocation.scm (allocate-slots): Make all
	  $values expressions go through allocate-values, and refactor
	  allocate-values.

	Fix allocate-slots bug
	* module/language/cps/slot-allocation.scm (allocate-slots): Fix bug in
	  allocate!, whereby a previously hinted allocation would not be added
	  to the live set if a hint was not given later.

	More robust compute-hints
	* module/language/cps/slot-allocation.scm (allocate-slots): Allow the
	  compute-hints pass to traverse through $values with 0 or 1 value.

	Prefer "receive" over "receive-values"+"reset-frame"
	* module/language/cps/compile-bytecode.scm (compile-fun): Attempt to
	  emit "receive" instead of "receive-values"+"reset-frame" where
	  possible.

	Only emit receive-values if it is needed
	* module/language/cps/compile-bytecode.scm (compile-fun): Don't emit
	  receive-values unless there is a minimum or maximum number of values.

	Remove "pop" from $prompt
	* module/language/cps.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Remove "pop" member from
	  $prompt data type, as it is no longer used.

	Enable prompt analysis
	* module/language/cps/dfg.scm (compute-live-variables, visit-fun):
	  Use the new prompt analysis pass in analyze-control-flow instead of
	  always adding a link in the DFG.  Avoids problems if there are
	  parts of the prompt body that have no path to the pop.

	Add prompt analysis to the DFG's analyze-control-flow
	* module/language/cps/dfg.scm (compute-reachable, find-prompts)
	  (compute-interval, find-prompt-bodies, visit-prompt-control-flow): New
	  helpers.
	  (analyze-control-flow): Add a mode that adds on CFA edges
	  corresponding to non-local control flow in a prompt.

	compute-live-variables uses CFA analysis
	* module/language/cps/dfg.scm ($dfa): Store a CFA instead of a separate
	  k-map and order.
	  (dfa-k-idx, dfa-k-sym, dfa-k-count): Adapt.
	  (compute-live-variables): Use analyze-control-flow instead of rolling
	  out own RPO numbering.  Will allow us to fix some prompt-related
	  things in a central place.

	Internal analyze-control-flow refactor
	* module/language/cps/dfg.scm (reverse-post-order): Fold-all-conts is
	  now a required arg.
	  (analyze-control-flow): Reverse CFA adds forward-reachable
	  continuations to the numbering.

2014-01-11  Andy Wingo  <wingo@pobox.com>

	Fix constant-needs-allocation? for $values uses
	* module/language/cps/dfg.scm (constant-needs-allocation?): Use of a
	  constant in a $values expression of any arity does not cause slot
	  allocation.

	* module/language/cps/compile-bytecode.scm (compile-fun): Allow $values
	  with a constant value to be compiled in test context.  Really we
	  should fold these in a previous pass!

2014-01-11  Andy Wingo  <wingo@pobox.com>

	Add effects analysis pass on CPS
	* module/Makefile.am:
	* module/language/cps/effects-analysis.scm: New helper module.

2014-01-11  Andy Wingo  <wingo@pobox.com>

	Fix prim -> VM op mapping for u8/s8 bytevector ops
	* module/language/cps/primitives.scm (*instruction-aliases*): Fix
	  aliases for bytevector u8 / s8 operations.

	* module/language/cps/compile-bytecode.scm (compile-fun): Fix s8
	  operations.

2014-01-09  Mark H Weaver  <mhw@netris.org>

	Implement R7RS 'syntax-error'.
	* module/ice-9/psyntax.scm (syntax-error): New macro.
	  (syntax-rules): Handle 'syntax-error' templates specially
	  for improved error reporting.

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

	* doc/ref/api-macros.texi (Syntax Rules): Add new subsection "Reporting
	  Syntax Errors in Macros".

	* test-suite/tests/syntax.test: Add tests.

2014-01-09  Mark H Weaver  <mhw@netris.org>

	psyntax: custom ellipses using 'with-ellipsis' or R7RS syntax-rules.
	* module/ice-9/psyntax.scm (binding-type): Update the header comment
	  to mention the new 'ellipsis' binding type.
	  (macros-only-env): Preserve ellipsis bindings.
	  (ellipsis?): Add 'r' and 'mod' as arguments.  Search the lexical
	  environment for an ellipsis binding, and use it.
	  (gen-syntax): Adapt to the additional arguments of 'ellipsis?'.
	  (with-ellipsis): New core syntax.
	  (convert-pattern): Add unary 'ellipsis?' procedure as an argument.
	  (gen-clause): Adapt to the additional arguments of 'ellipsis?'.
	  Pass unary 'ellipsis?' procedure to 'convert-pattern'.
	  (syntax-case): Adapt to the additional arguments of 'ellipsis?'.
	  (syntax-local-binding): Support new 'ellipsis' binding type.
	  (syntax-rules): Add support for a custom ellipsis identifier as
	  the first operand, as per R7RS.  Collect common code within new
	  local procedure 'expand-syntax-rules'.

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

	* module/ice-9/local-eval.scm (analyze-identifiers): Add support for
	  'ellipsis' binding type.

	* doc/ref/api-macros.texi (Syntax Rules): Add docs for R7RS custom
	  ellipsis syntax.  Use @dots{}.
	  (Syntax Case): Add docs for 'with-ellipsis'.  Use @dots{}.
	  (Syntax Transformer Helpers): Update to include new 'ellipsis'
	  binding type.

	* test-suite/tests/syntax.test: Add tests.

2014-01-09  Mark H Weaver  <mhw@netris.org>

	psyntax: toplevel variable definitions discard previous syntactic binding.
	* module/ice-9/psyntax.scm (expand-top-sequence): When defining a
	  toplevel variable, use the value of the same-named imported
	  _variable_, if any.  Do _not_ use an existing syntactic binding.

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

2014-01-09  Mark H Weaver  <mhw@netris.org>

	Merge branch 'stable-2.0'
	Conflicts:
		module/system/vm/traps.scm
		test-suite/tests/peval.test

2014-01-09  Ian Price  <ianprice90@googlemail.com>

	Fix trap handlers to handle applicable structs.
	Reported by Jordy Dickinson <jordy.dickinson@gmail.com>.
	Fixes <http://bugs.gnu.org/15691>.

	* module/system/vm/traps.scm (frame-matcher): Extract procedure when
	  proc is an applicable struct.

2014-01-09  Mark H Weaver  <mhw@netris.org>

	Fix 'string-copy!' to work properly with overlapping src/dest.
	* libguile/srfi-13.c (scm_string_copy_x): Fix to work properly with
	  overlapping src/dest.

	* test-suite/tests/srfi-13.test ("string-copy!"): Add tests.

2014-01-09  Mark H Weaver  <mhw@netris.org>

	Implement 'exact-integer?' and 'scm_is_exact_integer'.
	* libguile/numbers.c (scm_exact_integer_p, scm_is_exact_integer):
	  New procedures.
	  (scm_integer_p): Improve docstring.

	* libguile/numbers.h (scm_exact_integer_p, scm_is_exact_integer):
	  New prototypes.

	* doc/ref/api-data.texi (Integers): Add docs.

	* test-suite/tests/numbers.test ("exact-integer?"): Add tests.

2014-01-09  Mark H Weaver  <mhw@netris.org>

	Fix doc that incorrectly claimed (integer? +inf.0) => #t.
	Fixes <http://bugs.gnu.org/16356>.
	Reported by Zefram <zefram@fysh.org>.

	* doc/ref/api-data.texi (Integers): Add docs.  Fix outdated example
	  that incorrectly showed (integer? +inf.0) => #t.

2014-01-09  Mark H Weaver  <mhw@netris.org>

	scm_primitive_load: Simplify code using 'scm_open_file_with_encoding'.
	* libguile/load.c (scm_primitive_load): Use
	  'scm_open_file_with_encoding'.

	boot-9: add comment about autoload thread-unsafety.
	* module/ice-9/boot-9.scm: Add comment about lack of thread-safety in
	  handling of autoloads.

	read: Avoid signed integer overflow in 'read_decimal_integer'.
	* libguile/read.c (read_decimal_integer): Avoid overflow.

	Increment SCM_N_READ_OPTIONS for 'curly-infix' option.
	* libguile/private-options.h (SCM_N_READ_OPTIONS): Increment to 8.
	  This should have been done when the 'curly-infix' was added.

2014-01-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	GNU lightning 2.0.3 release

2014-01-07  Ian Price  <ianprice90@googlemail.com>

	Fix inlining of tail list to apply.
	Fixes <http://bugs.gnu.org/15533>.

	* module/language/tree-il/peval.scm (peval): Final list argument to
	  `apply' should not be inlined if it is mutable.
	* test-suite/tests/peval.test ("partial evaluation"): Add test.

2013-12-21  Ludovic Courtès  <ludo@gnu.org>

	Thank Aleix.

2013-12-21  Aleix Conchillo Flaque  <aconchillo@gmail.com>

	allow specifying a required version in GUILE_PROGS
	* meta/guile.m4: GUILE_PROGS now takes an optional argument to specify a
	  required Guile version. By default, it requires Guile >= 2.0. A micro
	  version can also be specified (e.g. GUILE_PROGS([2.0.10])).

2013-12-17  Mark H Weaver  <mhw@netris.org>

	Revert "Fix bound-identifier=? to compare binding names, not just symbolic names."
	This reverts commit 70c74b847680d3b239e591afa2e99c51a712980c.

2013-12-16  Mark H Weaver  <mhw@netris.org>

	Fix bound-identifier=? to compare binding names, not just symbolic names.
	Fixes <http://bugs.gnu.org/16158>.

	* module/ice-9/psyntax.scm (bound-id=?): Use 'id-var-name' to compare
	  binding names (gensyms), not just symbolic names.

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

	* test-suite/tests/syntax.test: Add test.

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

	Hide EINTR returns from 'accept'.
	* libguile/socket.c (scm_accept): Wrap 'accept' call in 'SCM_SYSCALL'.

2013-12-13  Mark H Weaver  <mhw@netris.org>

	syntax-case: fix error reporting for misplaced ellipses.
	Reported by taylanbayirli@gmail.com (Taylan Ulrich B.).

	* module/ice-9/psyntax.scm (cvt*): Use 'syntax-case' to destructure
	  the pattern tail, instead of 'pair?', 'car', and 'cdr'.
	  (gen-clause): When checking for errors, check for misplaced ellipsis
	  before duplicate pattern variables, to improve the error message in
	  case of multiple misplaced ellipses.

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

	* test-suite/tests/syntax.test: Add tests.

2013-12-13  Mark H Weaver  <mhw@netris.org>

	THANKS Tom Tromey.
	* THANKS: Add Tom Tromey to fixes section.

	Merge branch 'stable-2.0'
	Conflicts:
		libguile/pairs.c
		libguile/vm.c
		test-suite/tests/control.test

2013-12-13  Tom Tromey  <tromey@redhat.com>

	Remove unused function scm_i_tag_name.
	* libguile/gc.c (scm_i_tag_name): Remove.

	Add missing FUNC_NAME defines for pair accessors.
	* libguile/pairs.c (scm_car, scm_cdr, scm_caar, scm_cadr, scm_cdar,
	  scm_cddr, scm_caaar, scm_caadr, scm_cadar, scm_caddr, scm_cdaar,
	  scm_cdadr, scm_cddar, scm_cdddr, scm_caaaar, scm_caaadr, scm_caadar,
	  scm_caaddr, scm_cadaar, scm_cadadr, scm_caddar, scm_cadddr,
	  scm_cdaaar, scm_cdaadr, scm_cdadar, scm_cdaddr, scm_cddaar,
	  scm_cddadr, scm_cdddar, scm_cddddr): Add missing FUNC_NAME defines.

2013-12-13  Tom Tromey  <tromey@redhat.com>

	Fix computation of LIBLOBJS.
	Fixes <http://bugs.gnu.org/14193>.

	* configure.ac (LIBLOBJS): Add prefix to computed .lo file name so
	  dependencies work properly.

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

	Fix section table writing for non-loadable sections
	* module/system/vm/linker.scm (add-elf-objects): Don't fill in the
	  sh_addr field if the section is not loadable.

	Quick documentation fixes.
	* doc/ref/compiler.texi: Make it build.

	Non-loadable sections should not have an sh_addr field set
	* module/system/vm/linker.scm (relocate-section-header):
	  (write-linker-object): Sections that are not loadable should not have
	  their sh_addr fields set.  Fix.

	Beginnings of CPS section in manual
	* doc/ref/compiler.texi (Continuation-Passing Style): Beginnings of this
	  section.  Will be finished when we fix implicit truncation.

	Fix cross-references in api-macros.texi
	* doc/ref/api-macros.texi (Macro Expansion): Fix cross-references.

2013-12-06  Andy Wingo  <wingo@pobox.com>

	Arities-fixing pass handles incoming $ktrunc with rest args
	* module/language/cps/arities.scm (fix-clause-arities): Allow $ktrunc
	  arities with rest arguments.

	Elide values primcalls with continuations with rest arguments
	* module/language/cps/elide-values.scm (elide-values): Elide values
	  primcalls when continuation has rest arguments.

2013-12-06  Andy Wingo  <wingo@pobox.com>

	(call-with-values foo (lambda (a . b) a)) avoids consing rest list
	* module/language/cps/slot-allocation.scm (allocate-slots): Don't
	  allocate slots to unused results of function calls.  This can allow us
	  to avoid consing a rest list for call-with-values with an ignored rest
	  parameter, and can improve the parallel move code.

	* module/language/cps/compile-bytecode.scm (compile-fun): Adapt to avoid
	  emitting bind-rest in values context if the rest arg is unused.

2013-12-05  Ludovic Courtès  <ludo@gnu.org>

	vm: Gracefully handle stack overflows.
	Fixes <http://lists.gnu.org/archive/html/guile-user/2013-12/msg00017.html>.
	Reported by rvclayton@verizon.net (R. Clayton).

	* libguile/vm.c (reinstate_stack_reserve): New function.
	  (vm_error_stack_overflow): Install it as an unwind handler.
	* test-suite/tests/control.test ("the-vm")["stack overflow reinstates
	  stack reserve"]: New test.

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

	compiler.texi tweaks
	* doc/ref/compiler.texi (Compiler Tower): Reword a couple things.
	  (Tree-IL): Add more vertical space, for readability in info.

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

	Doc updates to macroexpansion, compiled procs, and compiler.texi
	* doc/ref/api-macros.texi (Macro Expansion): New section.
	* doc/ref/api-procedures.texi (Compiled Procedures): Beginnings of a
	  revision.  Not finished.
	* doc/ref/compiler.texi (Compiling to the Virtual Machine): Beginnings
	  of a revision.  CPS and bytecode are not done yet.

2013-12-03  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	x86: Correct wrong x87 optimization.
		* lib/jit_x86-x87.c: Correct wrong optimization when
		loading the log(2) constant.

	x86: Ensure the x87 stack is empty when calling a function.
		* lib/jit_x86-cpu.c: Use the emms instruction before
		calling any function. This is particularly important
		when using c99 complex functions as it can easily
		overflow the x87 stack due to the way lightning uses
		the x87 stack as a flat register file.

2013-12-02  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	x86: Correct wrong x87 float indexed store code generation.
		* lib/jit_x86-x87.c: Correct wrong code generation due
		to comparing the base and not the value register with
		%st(0) in stxi_f.

2013-12-02  Andy Wingo  <wingo@pobox.com>

	Rename "RTL" to "bytecode"
	"RTL" didn't make any sense, and now that there's no other bytecode to
	disambiguate against, just call it bytecode.

	* module/Makefile.am:
	* module/ice-9/eval-string.scm:
	* module/language/bytecode.scm:
	* module/language/bytecode/spec.scm:
	* module/language/cps/arities.scm:
	* module/language/cps/compile-bytecode.scm:
	* module/language/cps/compile-rtl.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/primitives.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/spec.scm:
	* module/language/cps/specialize-primcalls.scm:
	* module/language/rtl.scm:
	* module/language/rtl/spec.scm:
	* module/scripts/compile.scm:
	* module/system/base/compile.scm:
	* module/system/repl/common.scm:
	* module/system/vm/assembler.scm:
	* module/system/vm/debug.scm:
	* module/system/vm/disassembler.scm:
	* module/system/vm/dwarf.scm:
	* test-suite/tests/cross-compilation.test:
	* test-suite/tests/dwarf.test:
	* test-suite/tests/rtl-compilation.test:
	* test-suite/tests/rtl.test:
	* test-suite/vm/run-vm-tests.scm: Fixups.

2013-12-02  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct wrong call in ldi_f if address does not fit in 32 bit.
	  This would only happen in x86_64, where x87 registers are not used
	neither "exported".

	x86: Use aligned offset for x87 to/from sse move.
		* lib/jit_x86-x87.c, lib/jit_x86.c: Use 8 bytes aligned
		stack offset for float/double x87 to/from sse move.

2013-12-02  Andy Wingo  <wingo@pobox.com>

	Fix brainfuck comment
	* module/language/brainfuck/parse.scm: Fix outdated comment.

	Fix brainfuck->scheme compiler.
	* module/language/brainfuck/compile-scheme.scm (compile-scheme): Fix
	  brainfuck compiler.

	Fix brainfuck comment
	* module/language/brainfuck/parse.scm: Fix outdated comment.

	Fix brainfuck->scheme compiler.
	* module/language/brainfuck/compile-scheme.scm (compile-scheme): Fix
	  brainfuck compiler.

2013-12-02  Mark H Weaver  <mhw@netris.org>

	GOOPS doc fix: #:dsupers is the init keyword for the dsupers slot.
	* doc/ref/goops.texi (Metaclasses): #:dsupers is the initialization
	  keyword for the dsupers slot, not #:supers.

2013-12-02  Mark H Weaver  <mhw@netris.org>

	Thread safe port properties.
	* libguile/ports.c (scm_i_port_property, scm_i_set_port_property_x):
	  Lock the port mutex while accessing the port alist.

	* libguile/read.c (set_port_read_option): Lock the port mutex
	  while modifying port read options.

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

	Add section to vm.texi about Guile's use of ELF
	* doc/ref/vm.texi (Object File Format): New section.

2013-11-30  Andy Wingo  <wingo@pobox.com>

	vm.texi tweak
	* doc/ref/vm.texi (Why a VM?): Small tense tweak.

	Update vm.texi's "Instruction Set" section.
	* doc/ref/vm.texi (Instruction Set): Update.

	Fix more vm-engine comments
	* libguile/vm-engine.c: Fix more comments.

	Remove slot-ref and slot-set! ops
	* libguile/vm-engine.c: Remove slot-ref and slot-set! ops.

2013-11-30  Andy Wingo  <wingo@pobox.com>

	Remove GOOPS-internal @slot-ref and @slot-set!
	* module/oop/goops.scm: Remove definitions of @slot-ref and @slot-set!.
	  They are equivalent to struct-ref and struct-set!.
	  (define-standard-accessor-method): Reimplement using syntax-case.
	  (bound-check-get, standard-get, standard-set): Replace @slot-ref and
	  @slot-set! uses with struct-ref and struct-set!.

	* module/language/cps/reify-primitives.scm (primitive-module): Remove
	  @slot-set! and @slot-ref references.

2013-11-30  Andy Wingo  <wingo@pobox.com>

	Beginning vm.texi updates
	* doc/ref/vm.texi: Updates.

	Fix vm-engine.c comments
	* libguile/vm-engine.c: Fix some comments.

	Unknown files print as (unknown file) in disassembler
	* module/system/vm/disassembler.scm (disassemble-buffer): Print unknown
	  files as "(unknown file)".

	,x disassembles nested programs too
	* module/system/vm/disassembler.scm (code-annotation):
	  (disassemble-buffer, disassemble-addr, disassemble-program): Arrange
	  to disassemble nested procedures.
	  (disassemble-image): Adapt.

	Update history.texi
	* doc/ref/history.texi (A Timeline of Selected Guile Releases, Status):
	  Update.

2013-11-29  Andy Wingo  <wingo@pobox.com>

	Remove outdated section of api-memory.texi
	* doc/ref/api-memory.texi (Memory Blocks): Remove section documenting
	  scm_must_malloc and friends.

2013-11-28  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

	Critical sections in guardians do not need to block asyncs
	* libguile/guardians.c: Critical sections here cannot cause an
	  async_tick, so they do not need to block asyncs.

	Merge commit 'd364a8971828e38e8f9112b711066f4962bb400e'
	Conflicts:
		libguile/deprecated.h
		libguile/gc.c

	Merge commit 'e7bd20f7d9b2110fdc0fa25db5a2bfe6b2214923'

	Merge commit '17330398d50524058c2ef488bd21ac5ec9c8b6e8'

	Merge commit 'a38024baaa32d1a6d91fdc81388c88bbb926c3ae'
	Conflicts:
		libguile/ports.h

	Merge commit '2437c7b2e8b4ab7786847ee1ce0b59e446a70fe2'
	Conflicts:
		libguile/guardians.c

	Merge commit '8571dbde639e0ee9885bad49c9e180474bd23646'
	Conflicts:
		libguile/procprop.c

	Merge commit '750ac8c592e792e627444f476877f282525b132e'
	Conflicts:
		.gitignore
		libguile/deprecated.c

	Merge commit 'c61be45084d04b1db792b7e232f5bd77099f3287'
	Conflicts:
		libguile/ports.c

	Merge commit 'd360671c1cca335600079f1c5714572d1c2e676d'

	Deprecate gc-live-object-stats
	* libguile/gc.h:
	* libguile/gc.c:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_gc_live_object_stats): Deprecate; it hasn't
	  worked in the whole 2.0 series.

	Avoid needless GC on startup due to scm_gc_register_allocation
	* libguile/gc.c (bytes_until_gc): Initialize to
	  DEFAULT_INITIAL_HEAP_SIZE, to avoid forced GC on the first
	  mallocation.

2013-11-28  Andy Wingo  <wingo@pobox.com>

	Remove private-gc.h
	* libguile/simpos.c (scm_getenv_int): Move here, from gc.c.

	* libguile/private-gc.h: Remove, unused.

	* libguile/simpos.h: Move scm_getenv_int declaration here.

	* libguile/vm.c:
	* libguile/gc.c: Adapt scm_getenv_int users.

	* libguile/gc-malloc.c:
	* libguile/load.c:
	* libguile/script.c: Remove private-gc includes from non-users of
	  scm_getenv_int.

	* libguile/Makefile.am: Adapt.

2013-11-28  Andy Wingo  <wingo@pobox.com>

	scm_i_tag_name internal to gc.c
	* libguile/gc.c (scm_i_tag_name): Make internal to gc.c.

	* libguile/private-gc.h: Remove from here.

2013-11-28  Andy Wingo  <wingo@pobox.com>

	More private-gc excisions
	* libguile/private-gc.h (SCM_DOUBLECELL_ALIGNED_P): Remove; unused.
	* libguile/filesys.c (MAX, MIN): Move definitions here, from
	  private-gc.h.
	  (scm_sendfile, scm_readdir): Adapt uses of SCM_MAX and SCM_MIN to use
	  MAX or MIN.

	Remove unused enum policy_on_error
	* libguile/private-gc.h (enum policy_on_error): Remove unused enum.

2013-11-28  Andy Wingo  <wingo@pobox.com>

	Tune initial heap size
	* libguile/fluids.c (new_fluid): Don't run an explicit GC for the first
	  fluid.

	* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE, scm_storage_prehistory):
	  Enlarge from 32 kB to 512 or 1024 kB, depending on word size.  Reduces
	  startup time by 10 or 15% by avoiding excessive
	  GC.

	* libguile/private-gc.h: Remove SCM_DEFAULT_INIT_HEAP_SIZE_2 definition
	  here.

2013-11-28  Andy Wingo  <wingo@pobox.com>

	Remove another GC 6.8 hack
	* libguile/gc.c (scm_storage_prehistory): Remove hack for BDW-GC 6.8.

	Fix "include" doc typo
	* doc/ref/api-evaluation.texi (Local Inclusion): Fix typo.

	Use version 2.2 in manual examples
	* doc/ref/api-evaluation.texi (Load Paths):
	* doc/ref/api-options.texi (Build Config):
	* doc/ref/guile-invoke.texi (Environment Variables):
	* doc/ref/libguile-parallel.texi (Parallel Installations): Use 2.2 in
	  examples, rather than 2.0.

	Fix some references to objcode in the manual
	* doc/ref/api-evaluation.texi (Compilation): Update references from
	  "objcode" to "rtl".

2013-11-27  Andy Wingo  <wingo@pobox.com>

	Remove nonfunctional gdb interface
	* libguile/gdb_interface.h:
	* libguile/gdbint.c:
	* libguile/gdbint.h: Remove.  These were last modified significantly in
	  1997 and I think they are unused.

	* libguile/guile.c: Remove use.
	* libguile.h: Remove inclusion.
	* libguile/Makefile.am: Remove reference.
	* libguile/init.c: Remove use.

2013-11-27  Andy Wingo  <wingo@pobox.com>

	Remove the restore-continuation-hook.
	* libguile/vm.h:
	* libguile/vm.c:
	* libguile/vm-engine.c:
	* module/system/vm/traps.scm:
	* module/system/vm/vm.scm: Remove the unused and redundant
	  restore-continuation-hook.

	Declare r6rs-ports functions
	* libguile/r6rs-ports.h:
	* libguile/r6rs-ports.c: Declare scm_unget_bytevector and
	  scm_i_make_transcoded_port.

	Fix uninitialized variable error in some peek-char error cases
	* libguile/ports.c (scm_peek_char): Don't require error cases to
	  set *len.  Fixes a bug caught by GCC whereby an EOF while reading a
	  multibyte character with iconv would leave len uninitialized.

	Declare scm_i_open_file to silence a warning
	* libguile/fports.c (scm_i_open_file): Declare.

	Remove generalized vector interface; deprecated in 2.0 already.
	* libguile/deprecated.c: Remove the generalized-vector interface,
	  deprecated since 2.0.8.

	Declare scm_nil_p
	* libguile/boolean.h: Declare scm_nil_p.

2013-11-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	ARM: Minor changes that should allow building on non gnu-linux/gcc.
		* configure.ac, lib/jit_arm-swf.c, lib/jit_arm.c: Add
		changes that should at least allow building lightning
		on Apple iOS7.

	Sync after regenerating version.texi.

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

	Build psyntax-pp serially after eval.go.
	* module/Makefile.am: Arrange to build psyntax-pp.go in serial mode,
	  after eval.go.  Before the expander is compiled, expanding all the
	  Scheme files dominates compile-time, even for larger files like
	  psyntax-pp.scm.  If we compile psyntax in parallel with other files,
	  it could be one of the other files finishes first, leading to two
	  consecutive compiles that have to use an uncompiled psyntax expander.
	  Ordering the compilation minimizes total real and user time, at least
	  locally on a 4-core machine.

	  Also take the opportunity to shuffle compile order for the rest of the
	  Scheme files, to build parts of the RTL compiler early.

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

	Contification converges more quickly
	* module/language/cps/contification.scm (compute-contification):
	  Converge more quickly by using the information we compute within a
	  compute-contification pass.

2013-11-25  Andy Wingo  <wingo@pobox.com>

	Compute-contification also visits body
	* module/language/cps/contification.scm (compute-contification): If we
	  decide to contify, don't forget to visit the body.  Should make
	  contification converge faster.

2013-11-23  Mark H Weaver  <mhw@netris.org>

	Make (ice-9 popen) thread-safe.
	Fixes <http://bugs.gnu.org/15683>.
	Reported by David Pirotte <david@altosw.be>.

	* module/ice-9/popen.scm: Import (ice-9 threads) and (srfi srfi-9).
	  (<pipe-info>): New record type.
	  (port/pid-table): Mark as deprecated in comment.
	  (port/pid-table-mutex): New variable.
	  (open-pipe*): Store the pid in the pipe-info record, and store the
	  pipe-info as a port property.  Guard the pipe-info instead of the
	  port.  Lock 'port/pid-table-mutex' while mutating 'port/pid-table'.
	  (fetch-pid): Removed.
	  (fetch-pipe-info): New procedure.
	  (close-process-quietly): Removed.
	  (close-pipe): Use 'fetch-pipe-info' instead of 'fetch-pid'.  Clear
	  the pid from the pipe-info.  Improve error messages.
	  (reap-pipes): Adapt to the fact that the pipe-info is now guarded
	  instead of the port.  Incorporate the 'waitpid' code that was
	  previously in 'close-process-quietly', but let the port finalizer
	  close the port.  Clear the pid from the pipe-info.

2013-11-23  Mark H Weaver  <mhw@netris.org>

	Stylistic improvements for (ice-9 popen).
	* module/ice-9/popen.scm (close-process, close-process-quietly): Accept
	  'port' and 'pid' as separate arguments.  Improve style.
	  (close-pipe, read-pipes): Improve style.

2013-11-23  Mark H Weaver  <mhw@netris.org>

	Make port properties accessible from Scheme.
	* libguile/ports.c (scm_i_port_alist, scm_i_set_port_alist_x): Removed.
	  (scm_i_port_property, scm_i_set_port_property_x): New procedures,
	  available from Scheme as '%port-property' and '%set-port-property!'.

	* libguile/ports.h (scm_i_port_alist, scm_i_set_port_alist_x): Removed.
	  (scm_i_port_property, scm_i_set_port_property_x): New prototypes.

	* libguile/read.c (set_port_read_option, init_read_options): Adapt to
	  use scm_i_port_property and scm_i_set_port_property_x.

2013-11-23  Mark H Weaver  <mhw@netris.org>

	Make guardians thread-safe.
	* libguile/guardians.c (t_guardian): Add mutex.
	  (finalize_guarded, scm_i_guard, scm_i_get_one_zombie): Lock mutex and
	  block system asyncs during critical sections.
	  (scm_make_guardian): Initialize mutex.

	Block system asyncs while 'overrides_lock' is held.
	* libguile/procprop.c (scm_set_procedure_property_x): Block system
	  asyncs while overrides_lock is held.  Use dynwind block in case
	  an exception is thrown.

2013-11-23  Mark H Weaver  <mhw@netris.org>

	Add mutex locking functions that also block asyncs.
	* libguile/async.h (scm_i_pthread_mutex_lock_block_asyncs,
	  scm_i_pthread_mutex_unlock_unblock_asyncs): New macros.

	* libguile/threads.c (do_unlock_with_asyncs): New static helper.
	  (scm_i_dynwind_pthread_mutex_lock_block_asyncs): New function.

	* libguile/threads.h (scm_i_dynwind_pthread_mutex_lock_block_asyncs):
	  Add prototype.

2013-11-23  Chris K. Jester-Young  <cky944@gmail.com>

	Convert test-suite/tests/exceptions.test to use hygienic macros.
	* test-suite/tests/exceptions.test (push): New syntax parameter.
	  (throw-test): Convert to a syntax-rules macro, using syntax parameters
	  to support the otherwise-unhygienic use of "push".

2013-11-22  Andy Wingo  <wingo@pobox.com>

	Expandable stacks.
	* libguile/vm-engine.c (CHECK_OVERFLOW): Call vm_expand_stack, not
	  vm_error_stack_overflow.
	* libguile/vm.c (hard_max_stack_size, default_max_stack_size): Recast
	  #defines as locals.  Have both hard and soft stack limits.
	  (initialize_default_stack_size): Set soft stack limit from
	  GUILE_STACK_SIZE.
	  (expand_stack, vm_expand_stack): Support for expanding stacks as
	  needed.  Whee!
	  (make_vm): Adapt limits.
	  (scm_call_n): Expand stack if needed.

	* libguile/vm.h (struct scm_vm): Add max_stack_size member.

2013-11-22  Andy Wingo  <wingo@pobox.com>

	VM copes with moving FP
	* libguile/_scm.h (SCM_ASYNC_TICK_WITH_GUARD_CODE): New macro.
	* libguile/vm-engine.c (VM_HANDLE_INTERRUPTS): Restore FP after
	  ticking.
	  (CACHE_FP): New macro.
	  (CHECK_OVERFLOW): Use CACHE_FP.
	  (BR_ARITHMETIC, RETURN_EXP, RETURN_ONE_VALUE, BINARY_INTEGER_OP):
	  (call, return-values, subr-call, foreign-call)
	  (resolve, define!, toplevel-box, module-box): Restore the FP from the
	  vp where needed.

	Simplify state sync in VM before potential bailout.
	* libguile/vm-engine.c (SYNC_IP): Remove calls to SYNC_BEFORE_GC, a
	  no-op.  Replace SYNC_REGISTER / SYNC_ALL calls with just SYNC_IP.

	More precise stack marking.
	* libguile/vm.c (scm_i_vm_mark_stack): Mark the stack more precisely.

2013-11-22  Andy Wingo  <wingo@pobox.com>

	Allocate stacks using mmap, and mark them via the thread marker
	* libguile/threads.c (thread_mark): Mark the VM stack, if we have one.
	  (on_thread_exit): Free the VM stack here.

	* libguile/vm.c (make_vm): Allocate the VM stack using mmap, and arrange
	  for it to be marked by the thread marker.
	  (scm_i_vm_mark_stack, scm_i_vm_free_stack): New internal interfaces.
	  (allocate_stack, free_stack): New helpers.

2013-11-22  Andy Wingo  <wingo@pobox.com>

	Add thread mark procedure
	* libguile/threads.c (thread_mark): A mark procedure for threads.
	  Eventually will mark the stack.
	  (guilify_self_1): Move initialization of VP earlier.  Allocate thread
	  using thread_gc_kind.
	  (scm_threads_prehistory): Initialize thread_gc_kind.

	Remove unused scm_i_thread fields
	* libguile/threads.h (scm_i_thread):
	* libguile/threads.c (guilify_self_1): Remove unused mark stack fields.

2013-11-22  Andy Wingo  <wingo@pobox.com>

	Remove tests and shims for pre-7.2 bdw-gc.
	* configure.ac: Remove checks for symbols present in bdw-gc 7.2.

	* libguile/finalizers.c:
	* libguile/gc-malloc.c:
	* libguile/gc.c:
	* libguile/guardians.c:
	* libguile/scmsigs.c:
	* libguile/threads.c: Remove shims.

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

	Add explicit nopcodes
	* libguile/vm-engine.c (VM_NAME): Add explicit nopcodes, later to be
	  interspersed with others.  This will allow us some extensibility
	  without always shuffling around opcodes.  Also avoid lazy
	  initialization; have the linker do it for us.

	* libguile/instructions.c (parse_instruction):
	  (scm_instruction_list): Rework instruction parsing to avoid using
	  malloc.  It would seem that this would fix some GC issue -- but who
	  knows!

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

	Setjmp before calling into the VM
	* libguile/vm-engine.c (CACHE_REGISTER): Remove an unneeded cast.
	  (VM_NAME):
	* libguile/vm.c (scm_call_n): Setjmp out here.  This leaves the VM
	  without any initialization work to do.  It also makes it possible to
	  restart the VM in another mode (with hooks, for example).

	scm_call_n sets up boot continuation frame for VM
	* libguile/vm-engine.c:
	* libguile/vm.c (scm_call_n): Move boot continuation setup to
	  scm_call_n, so that vm-engine takes all of its state from the vp.

	scm_call_n avoids double TLS lookup
	* libguile/vm-engine.c (VM_NAME): Take the current thread as an
	  argument.
	* libguile/vm.c (scm_i_capture_current_stack): Call thread_vm.
	  (thread_vm): New helper.
	  (scm_the_vm): Call thread_vm.
	  (scm_call_n): Call thread_vm.  Avoids a double TLS lookup.

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

	Remove scm_tc7_vm
	* libguile/tags.h (scm_tc7_vm): Return to pool.

	* libguile/goops.c:
	* libguile/gc.c (scm_i_tag_name):
	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/print.c (iprin1): Remove tc7_vm things.

	* libguile/vm.h (scm_the_vm_fluid): Remove stray declaration.  Remove
	  SCM_VM_P.  Remove SCM_VM_DATA.  Remove SCM_VALIDATE_VM.
	* libguile/vm.c (scm_i_vm_print): Remove.

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

	Remove last use of SCM vm
	* libguile/threads.h (scm_i_thread): Hold a struct scm_vm*, not a SCM
	  vm.
	* libguile/threads.c (guilify_self_2):
	* libguile/vm.c (make_vm): Adapt.

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

	scm_the_vm now returns raw struct scm_vm pointer
	* libguile/vm.h (scm_the_vm): Return struct scm_vm*.
	  (scm_c_vm_run): Remove.

	* libguile/control.c:
	* libguile/eval.c:
	* libguile/throw.c:
	* libguile/vm.c: Adapt.

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

	Prefer scm_call_n to scm_c_vm_run (scm_the_vm())
	* libguile/vm.c (scm_i_capture_current_stack): Cosmetic tweak.
	  (scm_call_n): Define here instead of in eval.c.  All callers of
	  scm_c_vm_run were passing scm_the_vm() as the VM.  Eventually
	  scm_call_n will replace scm_c_vm_run.

	* libguile/eval.c: Adapt all callers.

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

	scm_i_prompt_pop_abort_args_x takes struct scm_vm* as arg
	* libguile/control.h:
	* libguile/control.c (scm_i_prompt_pop_abort_args_x): Change to take VP
	  as an arg, not VM.

	* libguile/eval.c (eval):
	* libguile/throw.c (pre_init_catch): Adapt.

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

	Engine takes struct scm_vm* as argument
	* libguile/vm-engine.c:
	* libguile/vm.c (scm_c_vm_run): VM engine now takes struct scm_vm* as
	  argument, not SCM vm.

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

	One more SCM vm user: continuations.
	* libguile/continuations.c:
	* libguile/continuations.h (struct scm_t_contregs): Rename SCM vm member
	  to struct scm_vm *vp.
	  (scm_i_make_continuation): Take vp instead of vm.
	  (scm_i_contregs_vp): Rename from scm_i_contregs_vm, return vp.

	* libguile/vm-engine.c (continuation-call, call/cc): Fix remaining SCM
	  vm user.

	* libguile/vm.c (vm_return_to_continuation): Adapt prototype.

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

	Remove last use of SCM vm in VM
	* libguile/control.h:
	* libguile/control.c (reify_partial_continuation, scm_c_abort): Take
	  struct scm_vm *vp as an arg.

	* libguile/dynstack.h: Remove control.h include.

	* libguile/vm.c (vm_abort): Take struct scm_vm *vp as an arg.

	* libguile/vm-engine.c (abort): Adapt to vm_abort change.

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

	Remove use of SCM vm in compose-continuation
	* libguile/vm.c (vm_reinstate_partial_continuation): Take struct scm_vm
	  argument instead of SCM.
	* libguile/vm-engine.c (compose-continuation): Adapt.

	Dispatch hooks use "vp" rather than "vm"
	* libguile/vm.c (vm_dispatch_hook):
	  (vm_dispatch_apply_hook):
	  (vm_dispatch_push_continuation_hook):
	  (vm_dispatch_pop_continuation_hook):
	  (vm_dispatch_next_hook):
	  (vm_dispatch_abort_hook):
	  (vm_dispatch_restore_continuation_hook): Use scm_vm pointer instead of
	  Scheme vm object.

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

	Heap frame "stack holders" are raw scm_vm / scm_vm_cont pointers
	* libguile/frames.h (struct scm_frame): stack_holder is a void*.
	* libguile/frames.c (scm_i_frame_stack_base, scm_i_frame_offset): Expect
	  stack_holder to be the raw struct scm_vm or scm_vm_cont.

	* libguile/continuations.c (scm_i_continuation_to_frame):
	* libguile/stacks.c (scm_make_stack)
	* libguile/vm.c (vm_dispatch_hook): Adapt creators.

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

	Heap frames have a "frame kind" bit
	* libguile/frames.h (enum scm_vm_frame_kind, SCM_VM_FRAME_KIND)
	  (scm_c_make_frame): Add a "frame kind" bit to the first word.  This
	  will allow the "stack holder" to be a non-SCM object.

	* libguile/continuations.c (scm_i_continuation_to_frame):
	* libguile/frames.c (scm_c_make_frame, scm_frame_previous)
	* libguile/stacks.c (scm_make_stack):
	* libguile/vm.c (vm_dispatch_hook): Adapt frame creators to set the
	  frame kind bit.

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

	The dynamic stack records SP and FP values as offsets
	* libguile/dynstack.h:
	* libguile/dynstack.c (PROMPT_FP, PROMPT_SP):
	  (scm_dynstack_push_prompt, scm_dynstack_find_prompt): Prompts on the
	  dynstack are recorded as offsets from the base stack address in this
	  thread.

	* libguile/control.c (scm_c_abort):
	* libguile/eval.c (eval):
	* libguile/stacks.c (find_prompt, narrow_stack):
	* libguile/throw.c (pre_init_catch):
	* libguile/vm-engine.c (prompt): Adapt.

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

	Reorder struct scm_vm fields.
	* libguile/vm.h (struct scm_vm): Reorder fields, perhaps for better
	  locality.

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

	No more VM objects visible to Scheme
	* libguile/vm.h:
	* libguile/vm.c (scm_the_vm): Don't expose to Scheme.
	  (scm_vm_p): Remove, as it is not needed.

	* module/system/vm/vm.scm: Remove the-vm and vm? exports.

	* doc/ref/api-coverage.texi (Code Coverage):
	* test-suite/tests/coverage.test:
	* module/system/vm/coverage.scm (with-code-coverage): Don't take a VM
	  argument.  Adapt documentation and tests.

	* module/ice-9/command-line.scm: Remove the-vm autoload.

	* module/system/vm/trace.scm (trace-calls-to-procedure):
	  (trace-calls-in-procedure):
	  (trace-instructions-in-procedure):
	  (call-with-trace): Remove #:vm kwarg, and adapt to trap changes.

	* module/system/vm/trap-state.scm (the-trap-state): Rework to use a
	  parameter underneath instead of a weak key on (the-vm).

	* module/system/vm/traps.scm (new-disabled-trap):
	  (new-enabled-trap): Remove vm argument.
	  (trap-at-procedure-call):
	  (trap-in-procedure):
	  (trap-instructions-in-procedure):
	  (trap-at-procedure-ip-in-range):
	  (trap-at-source-location):
	  (trap-frame-finish):
	  (trap-in-dynamic-extent):
	  (trap-calls-in-dynamic-extent):
	  (trap-instructions-in-dynamic-extent):
	  (trap-calls-to-procedure):
	  (trap-matching-instructions): Remove vm keyword arguments.

	* test-suite/tests/control.test ("unwind"): Adapt test.

	* test-suite/tests/eval.test (test-suite): Remove the-vm import.

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

	VM accessors take VM as implicit argument, not explicit argument
	* libguile/vm.h:
	* libguile/vm.c:
	  (scm_vm_apply_hook, scm_vm_push_continuation_hook,
	  scm_vm_pop_continuation_hook, scm_vm_abort_continuation_hook,
	  scm_vm_restore_continuation_hook, scm_vm_next_hook,
	  scm_vm_trace_level, scm_set_vm_trace_level_x, scm_vm_engine,
	  scm_set_vm_engine_x, scm_c_set_vm_engine_x): The VM argument is now
	  implicit: the VM for the current thread.

	* doc/ref/api-debug.texi (VM Hooks): Try to adapt.

	* module/ice-9/command-line.scm:
	* module/statprof.scm:
	* module/system/vm/coverage.scm:
	* module/system/vm/trace.scm:
	* module/system/vm/trap-state.scm:
	* module/system/vm/traps.scm:
	* test-suite/tests/control.test:
	* test-suite/tests/eval.test: Adapt users that set hooks or ensure that
	  we have a debug engine.

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

	Change eval.c to use scm_c_vm_run instead of scm_call_with_vm.
	* libguile/eval.c (scm_apply_0, scm_apply_1, scm_apply_2, scm_apply_3)
	  (scm_map, scm_for_each, scm_apply): Change to prefer scm_apply_0, and
	  to have it call vm_run instead of call_with_vm.
	  (eval): Use scm_apply_0 and scm_call_0.

	* libguile/srfi-1.c (scm_srfi1_count): Use scm_apply_0.

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

	Remove unused vm:ip, vm:sp, vm:fp
	* libguile/vm.h:
	* libguile/vm.c (scm_vm_ip, scm_vm_fp, scm_vm_sp): Remove unused
	  functions.

	* module/system/vm/vm.scm: Remove exports.

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

	Remove make-vm; there will be one vm per thread now.
	* libguile/vm.h:
	* libguile/vm.c (scm_make_vm): Remove.

	* module/system/vm/vm.scm: Remove make-vm export.

	* test-suite/tests/control.test ("the-vm"):
	* test-suite/tests/coverage.test (%test-vm):
	* test-suite/tests/eval.test ("stack overflow"): Adapt tests.

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

	Scheme frame objects hold relative stack offsets
	* libguile/frames.h: Wrap the C interface to VM frames in
	  BUILDING_LIBGUILE.  Change VM frames to record relative offsets into a
	  stack held by some other object, so that if the stack moves they will
	  remain valid.
	* libguile/frames.c (scm_c_make_frame): Remove offset argument.
	  (scm_i_frame_offset): Instead, compute the offset from the stack
	  holder.
	  (scm_i_frame_stack_base): New helper.
	  (scm_frame_previous): Adapt.

	* libguile/stacks.c (scm_make_stack)
	* libguile/vm.c (vm_dispatch_hook):
	* libguile/continuations.c (scm_i_continuation_to_frame): Adapt.

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

	Prepare for moveable stacks in the VM.
	* libguile/vm-engine.c (CHECK_OVERFLOW, ALLOC_FRAME, vm_engine): Prepare
	  for moveable stacks.

	CHECK_OVERFLOW tweak
	* libguile/vm-engine.c (CHECK_OVERFLOW): Now that we aren't checking for
	  overflow on every push, fetch the stack limit from the vm instead of a
	  local.

2013-11-20  Andy Wingo  <wingo@pobox.com>

	Fix standalone tests
	* test-suite/vm/run-vm-tests.scm: Fix for objcode -> loader rename.

	vm-engine cosmetic cleanup
	* libguile/vm-engine.c: Reindent UNPACK macros.

	Remove unused resolve_variable helper
	* libguile/vm.c (resolve_variable): Remove unused helper.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Rework hook dispatch mechanism
	* libguile/vm-engine.c (RUN_HOOK, RUN_HOOK0, RUN_HOOK1): Rework to
	  dispatch through specific per-hook procedures.  Might reduce register
	  pressure in the VM.

	* libguile/vm.c (vm_dispatch_apply_hook):
	  (vm_dispatch_push_continuation_hook):
	  (vm_dispatch_pop_continuation_hook):
	  (vm_dispatch_next_hook):
	  (vm_dispatch_abort_hook):
	  (vm_dispatch_restore_continuation_hook): New internal helpers.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Remove VM_ENABLE_STACK_NULLING
	* libguile/vm.c: Remove code dependent on VM_ENABLE_STACK_NULLING.  This
	  defined didn't work and doesn't apply to the RTL model.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Rename objcodes?.{scm,c,h} to loader.{scm,c,h}
	* libguile/loader.c:
	* libguile/loader.h: Rename from objcodes.[ch].
	* module/system/vm/loader.scm: Rename from objcode.scm.

	* libguile/Makefile.am:
	* libguile/gsubr.c:
	* libguile/init.c:
	* libguile/procs.c:
	* libguile/vm.c:
	* module/Makefile.am:
	* module/ice-9/eval-string.scm:
	* module/language/rtl/spec.scm:
	* module/system/base/target.scm:
	* module/system/repl/command.scm:
	* module/system/repl/common.scm:
	* module/system/vm/debug.scm:
	* module/system/vm/disassembler.scm:
	* module/system/vm/objcode.scm:
	* test-suite/tests/compiler.test:
	* test-suite/tests/dwarf.test:
	* test-suite/tests/rtl-compilation.test:
	* test-suite/tests/rtl.test: Adapt.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Remove (oop goops) <objcode> export
	* module/oop/goops.scm (oop): Remove objcode export.

	Fix gsubr comment
	* libguile/gsubr.c: Update comment to excise RTL.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Lingering RTL excision in vm.c
	* libguile/vm-engine.c:
	* libguile/vm.c: Rework VM inclusion so that we don't define VM_ENGINE
	  and expect vm-engine.c to understand that -- since there is only
	  VM_USE_HOOKS, define that in vm.c directly.  Rename rtl_vm_foo to
	  vm_foo.

	* libguile/vm.h: Remove scm_t_vm_engine typedef.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Move RTL unpack macros to vm-engine.c
	* libguile/instructions.h: Remove SCM_UNPACK macros from here.
	* libguile/vm-engine.c: Add them here, without the RTL_, and without the
	  SCM_ prefix.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Change SCM_PACK_RTL macros to SCM_PACK_OP / SCM_PACK_OP_ARG
	* libguile/instructions.h: Guard in BUILDING_LIBGUILE.
	  (SCM_PACK_OP_24):
	  (SCM_PACK_OP_8_8_8):
	  (SCM_PACK_OP_8_16):
	  (SCM_PACK_OP_16_8):
	  (SCM_PACK_OP_12_12): Rename from SCM_PACK_RTL_*, and splice in the
	  opcode.
	  (SCM_PACK_OP_ARG_8_24): New helper.

	* libguile/vm.c:
	* libguile/gsubr.c:
	* libguile/foreign.c:
	* libguile/control.c:
	* libguile/continuations.c: Adapt.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	scm_rtl_op_* -> scm_op_*
	* libguile/instructions.h (scm_opcode): Rename from scm_rtl_opcode.
	  Rename opcodes from scm_rtl_op_* to scm_op_*.

	* libguile/continuations.c:
	* libguile/control.c:
	* libguile/foreign.c:
	* libguile/gsubr.c:
	* libguile/instructions.c:
	* libguile/vm.c: Adapt.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	(system vm instruction) rtl-instruction-list -> (language rtl) instruction-list
	* libguile/instructions.c (struct scm_instruction, fetch_instruction_table)
	  (scm_instruction_list): Remove rtl_ infix.
	* libguile/instructions.h: Adapt.

	* module/system/vm/instruction.scm: Remove.

	* module/language/rtl.scm: Export instruction-list from here.

	* module/Makefile.am:
	* module/language/cps/primitives.scm:
	* module/system/vm/assembler.scm:
	* module/system/vm/disassembler.scm:
	* module/system/vm/frame.scm:
	* module/system/vm/program.scm:
	* module/system/vm/trace.scm:
	* module/system/vm/traps.scm: Adapt.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Internal RTL excision in vm.c
	* libguile/vm.c (vm_boot_continuation, vm_boot_continuation_code):
	  Rename from rtl_boot_continuation[_code].
	  (scm_bootstrap_vm):
	* libguile/vm-engine.c (rtl_vm_engine): Adapt.

	Small comment fix.
	* libguile/vm-builtins.h: Rename RTL to VM in a comment.

	Rename DT_GUILE_VM_VERSION.
	* libguile/objcodes.c (DT_GUILE_VM_VERSION, process_dynamic_segment):
	* module/system/vm/elf.scm (DT_GUILE_VM_VERSION): Rename from
	  DT_GUILE_RTL_VERSION.
	* module/system/vm/assembler.scm (link-dynamic-section): Adapt.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Rename internal rtl-program-properties -> program-properties
	* module/system/vm/program.scm (program-properties): Rename from
	  rtl-program-properties.

	* libguile/programs.c (scm_i_program_properties): Adapt.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Excise "rtl-" from fallback program printer
	* libguile/programs.c (scm_i_program_print): Fallback printer uses
	  "program", not "rtl-program".

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Rename internals of (system vm program) program-minimum-arity
	* module/system/vm/debug.scm (find-program-minimum-arity): Rename from
	  program-minimum-arity.

	* module/system/vm/program.scm (program-minimum-arity): Rename from
	  rtl-program-minimum-arity.

	* libguile/programs.c (scm_i_program_arity): Adapt.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Rename (system vm program) internal functions to remove rtl-
	* module/system/vm/program.scm (program-name)
	  (program-documentation): Rename (removing rtl-).
	* libguile/programs.c (scm_i_program_name):
	  (scm_i_program_documentation): Adapt callers.

	Remove unused C scm_program_source.
	* libguile/programs.c (scm_program_source): Remove; not called.  (The
	  definition is in Scheme.)

	Reorganize programs.h.
	* libguile/programs.h: Reorganize.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	rtl-program-code -> program-code
	* libguile/programs.h:
	* libguile/programs.c (scm_program_code): Rename from
	  scm_rtl_program_code.  Also renames rtl-program-code to program-code.

	* module/statprof.scm:
	* module/system/repl/command.scm:
	* module/system/repl/debug.scm:
	* module/system/vm/coverage.scm:
	* module/system/vm/disassembler.scm:
	* module/system/vm/program.scm:
	* module/system/vm/traps.scm:
	* test-suite/tests/dwarf.test:
	* test-suite/tests/rtl.test: Adapt callers.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	rtl-program? -> program?
	* libguile/programs.c (scm_program_p): Rename from scm_rtl_program_p.
	  Changes name also from rtl-program? to program?.

	* libguile/programs.h:
	* module/ice-9/session.scm:
	* module/language/tree-il/analyze.scm:
	* module/statprof.scm:
	* module/system/repl/command.scm:
	* module/system/repl/debug.scm:
	* module/system/vm/coverage.scm:
	* module/system/vm/disassembler.scm:
	* module/system/vm/frame.scm:
	* module/system/vm/program.scm:
	* module/system/vm/traps.scm:
	* module/system/xref.scm: Adapt.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Remove make-rtl-program.
	* libguile/programs.h:
	* libguile/programs.c (scm_make_rtl_program): Remove.  Unused.

	* module/system/vm/program.scm (system): Remove make-rtl-program
	  export.  Unused.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	scm_i_rtl_program_* -> scm_i_program_*
	* libguile/programs.h (scm_i_make_program):
	* libguile/programs.c (scm_i_program_name):
	  (scm_i_program_documentation):
	  (scm_i_program_properties): Remove "rtl_" infix.

	* libguile/objcodes.c:
	* libguile/procprop.c:
	* libguile/vm.c: Adapt callers.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	scm_i_make_rtl_program in BUILDING_LIBGUILE
	* libguile/programs.h (scm_i_make_rtl_program): Enclose in a
	  BUILDING_LIBGUILE guard.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Remove RTL_ infix from macros
	* libguile/programs.h (SCM_PROGRAM_P):
	  (SCM_PROGRAM_CODE):
	  (SCM_PROGRAM_FREE_VARIABLES):
	  (SCM_PROGRAM_FREE_VARIABLE_REF):
	  (SCM_PROGRAM_FREE_VARIABLE_SET):
	  (SCM_PROGRAM_NUM_FREE_VARIABLES):
	  (SCM_VALIDATE_PROGRAM): Remove RTL_ infix.

	* libguile/continuations.c:
	* libguile/continuations.h:
	* libguile/control.c:
	* libguile/foreign.c:
	* libguile/frames.c:
	* libguile/gsubr.c:
	* libguile/gsubr.h:
	* libguile/procprop.c:
	* libguile/procs.c:
	* libguile/programs.c:
	* libguile/stacks.c:
	* libguile/vm-engine.c: Adapt.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	Rename scm_tc7_rtl_program to scm_tc7_program
	* libguile/tags.h (scm_tc7_program): Rename from scm_tc7_rtl_program.
	* libguile/continuations.c:
	* libguile/control.c:
	* libguile/evalext.c:
	* libguile/foreign.c:
	* libguile/goops.c:
	* libguile/gsubr.c:
	* libguile/print.c:
	* libguile/programs.c:
	* libguile/programs.h:
	* libguile/vm-engine.c: Adapt users.

	* module/system/vm/assembler.scm: Rename a tc7-rtl-program local to
	  tc7-program.
	* libguile/tags.h (scm_tc7_program): Rename from scm_tc7_rtl_program. * libguile/continuations.c: * libguile/control.c: * libguile/evalext.c: * libguile/foreign.c: * libguile/goops.c: * libguile/gsubr.c: * libguile/print.c: * libguile/programs.c: * libguile/programs.h: * libguile/vm-engine.c: Adapt users.

	* module/system/vm/assembler.scm: Rename a tc7-rtl-program local to
	  tc7-program.

2013-11-19  Andy Wingo  <wingo@pobox.com>

	All instruction pointers are now scm_t_uint32*
	* libguile/frames.h (SCM_FRAME_RTL_RETURN_ADDRESS)
	  (SCM_FRAME_SET_RTL_RETURN_ADDRESS): Remove.  The variants without _RTL
	  now work fine.
	  (struct scm_vm_frame): Change the return address to be a
	  scm_t_uint32*.
	  (struct scm_frame): Change IP to be scm_t_uint32*.

	* libguile/frames.c (scm_c_make_frame)
	* libguile/control.c (reify_partial_continuation, scm_c_abort)
	* libguile/dynstack.c (PROMPT_IP)
	  (scm_dynstack_push_prompt, scm_dynstack_find_prompt)
	* libguile/dynstack.h:
	* libguile/vm-engine.c (SYNC_IP, RETURN_ONE_VALUE)
	  (call, return-values, prompt): Adapt.

2013-11-19  Mark H Weaver  <mhw@netris.org>

	Web: accept "UTC" as the zone offset in date headers.
	Fixes <http://bugs.gnu.org/14128>.
	Reported by Aleix Conchillo Flaqué <aconchillo@gmail.com>.

	* module/web/http.scm (parse-zone-offset): Accept "UTC".

2013-11-19  Mark H Weaver  <mhw@netris.org>

	THANKS David Thompson
	* THANKS: Add David Thompson to list of contributors.

2013-11-19  David Thompson  <dthompson2@worcester.edu>

	Add procedures to convert alists into hash tables.
	* module/ice-9/hash-table.scm: New module.

	* test-suite/tests/hash.test ("alist conversion"): Add tests.

	* doc/ref/api-compound.texi (Hash Table Reference): Add docs.

2013-11-18  Mark H Weaver  <mhw@netris.org>

	Convert guile exceptions to R6RS conditions in R6RS exception handlers.
	* module/rnrs/exceptions.scm (&guile): New condition type.

	  (guile-condition-converters): New variable.

	  (convert-guile-condition, default-guile-condition-converter,
	  set-guile-condition-converter!, guile-common-conditions,
	  guile-lexical-violation-converter, guile-syntax-violation-converter,
	  guile-assertion-violation-converter, guile-system-error-converter,
	  guile-undefined-violation-converter, guile-error-converter,
	  guile-implementation-restriction-converter): New procedures.

	  (with-exception-handler): Catch all exceptions, not just R6RS
	  exceptions.  Convert native Guile exceptions to R6RS conditions,
	  preserving the original Guile exception information in the &guile
	  condition object.

	  (raise): If the condition includes a &guile condition, use 'throw' to
	  throw the original native guile exception instead of raising an R6RS
	  exception.

	* test-suite/tests/r6rs-exceptions.test ("guile condition conversions"):
	  Add tests.

2013-11-18  Mark H Weaver  <mhw@netris.org>

	Improve error when 'include' form with relative path is not in a file.
	Reported by Nala Ginrut <nalaginrut@gmail.com>.

	* module/ice-9/psyntax.scm (include): Give a proper error message when
	  given a relative file name, and when the form is not in a file.

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

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

	Frame pointer points to local 0 instead of local 1
	* libguile/frames.h: Change so that fp points at local 0 instead of
	  local 1, and clean up a bit.
	  (struct scm_vm_frame): Remove program, and rename stack to locals.
	  (SCM_FRAME_DATA_ADDRESS): Remove; it was redundant with
	  SCM_FRAME_LOWER_ADDRESS.
	  (SCM_FRAME_STACK_ADDRESS): Remove; replace with the new
	  SCM_FRAME_LOCALS_ADDRESS.
	  (SCM_FRAME_UPPER_ADDRESS): Remove; unused.
	  (SCM_FRAME_NUM_LOCALS, SCM_FRAME_PREVIOUS_SP): New defines.
	  (SCM_FRAME_BYTE_CAST, SCM_FRAME_STACK_CAST): Remove; unused;
	  (SCM_FRAME_LOCAL): New define, replaces SCM_FRAME_VARIABLE.
	  (SCM_FRAME_PROGRAM): Add cautionary commentary.

	* libguile/frames.c: Adapt static asserts.
	  (scm_frame_num_locals, scm_frame_local_ref, scm_frame_local_set_x):
	  Adapt.  This means that frame-local-ref 0 now returns the procedure.

	* libguile/vm-engine.c (ALLOC_FRAME, RESET_FRAME)
	  (FRAME_LOCALS_COUNT, LOCAL_REF, LOCAL_SET, RETURN_VALUE_LIST): Adapt
	  to change in fp.
	  (LOCAL_ADDRESS): New helper.
	  (POP_CONTINUATION_HOOK): Reimplement, taking the previous FP as an
	  argument.
	  (ABORT_CONTINUATION_HOOK): Reimplement, taking no arguments.
	  (RETURN_ONE_VALUE): Reimplement.
	  (RETURN_VALUE_LIST): Adapt to FP change.
	  (halt, return-values, subr-call, foreign-call, prompt)
	  (continuation-call, compose-continuation, call/cc, abort): Adapt to FP
	  change, mostly via using LOCAL_ADDRESS, etc abstractions instead of
	  using the raw frame pointer.

	* libguile/control.c (reify_partial_continuation): Update for fp
	  change.

	* libguile/vm.c (vm_reinstate_partial_continuation): Adapt to removal of
	  SCM_FRAME_UPPER_ADDRESS.

	* module/system/vm/frame.scm (frame-call-representation): Adapt to
	  frame-local-ref change.

	* module/system/vm/trace.scm (print-return): Remove unused
	  frame-num-locals call.

2013-11-17  Mark H Weaver  <mhw@netris.org>

	Add more entries to .gitignore
	* .gitignore: Add /lib/poll.h, /lib/sys/select.h, /lib/sys/times.h,
	  and /test-suite/standalone/test-scm-c-bind-keyword-arguments.

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

	Remove use of SCM_CRITICAL_SECTION in smob.c
	* libguile/smob.c (scm_make_smob_type): Use a mutex instead of a
	  critical section, which does an async tick.  Not important, just a
	  thing I saw.

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

	Remove MVRA from VM frames
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump for frame layout
	  change.

	* libguile/frames.c: Update some static checks.
	  (scm_frame_num_locals, scm_frame_local_ref, scm_frame_local_set_x):
	  Update to not skip over uninitialized frames, as that's not a thing
	  any more.

	* libguile/frames.h: Update to remove MVRA.  Woo!

	* libguile/vm-engine.c (ALLOC_FRAME, RETURN_ONE_VALUE):
	  (rtl_vm_engine): Update for 3 words per frame instead of 4.

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

	* module/language/cps/slot-allocation.scm (allocate-slots): 3 words per
	  frame, not 4.

	* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.  Also
	  remove a couple of tc7's that aren't around any more.

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

	Remove MVRA accessors in libguile
	* libguile/vm.c (scm_i_vm_capture_stack): Remove MVRA argument, in
	  preparation for removing MVRA from frames.
	  (scm_i_capture_current_stack): Adapt to scm_i_vm_capture_stack
	  change.
	  (vm_reinstate_partial_continuation): Remove references to MVRA.

	* libguile/vm.h (struct scm_vm_cont): Remove mvra member.

	* libguile/vm-engine.c (call): Set MVRA to 0.  Will remove later.
	  (return-values): Return to RA.
	  (call/cc): Remove MVRA from capture call.

	* libguile/frames.c:
	* libguile/frames.h (SCM_FRAME_MV_RETURN_ADDRESS)
	  (SCM_FRAME_RTL_MV_RETURN_ADDRESS, scm_frame_mv_return_address): Remove
	  accessors.

	* libguile/control.c (reify_partial_continuation): Adapt to
	  scm_i_vm_capture_stack change.

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

	Try to allocate arguments directly in call frames
	* module/language/cps/slot-allocation.scm (allocate-slots): Convert
	  cont-table to a vector, for ease of access.  Run a pass before
	  allocation that determines the set of variables whose slot allocation
	  can and should be delayed, so that they can ideally be allocated
	  directly in an argument slot.

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

	Rewrite slot allocation pass
	* module/language/cps/slot-allocation.scm ($allocation): Refactor
	  internal format of allocations.  Instead of an allocation being a hash
	  table of small $allocation objects, it is an $allocation object that
	  contains packed vectors.
	  (find-first-trailing-zero): Rework to not need a maximum.
	  (lookup-maybe-slot): New interface.
	  (lookup-slot): Raise an error if a var has no slot.
	  (lookup-call-allocation): New helper.
	  (lookup-constant-value, lookup-maybe-constant-value):
	  (lookup-call-proc-slot, lookup-parallel-moves): Adapt to $allocation
	  change

	  (allocate-slots): Rewrite so that instead of being recursive, it
	  traverses the blocks in CFA order.  Also, procedure call frames are
	  now allocated with respect to the live set after using arguments (and
	  killing any dead-after-use vars); this should make call frames more
	  compact but it does necessitate a parallel move solution.  Therefore
	  parallel moves are recorded for all calls, for arguments; also if the
	  continuation is a $ktrunc, the continuation gets parallel moves for
	  the results.

	  This rewrite is in preparation to allocating call args directly in the
	  appropriate slots, where possible.

	* module/language/cps/compile-rtl.scm (compile-fun): Adapt to slot
	  allocation changes, using lookup-maybe-slot where appropriate,
	  performing parallel moves when calling functions, and expecting return
	  moves to be associated with $ktrunc continuations.

2013-11-13  Andy Wingo  <wingo@pobox.com>

	Replace ($var sym) with ($values (sym)).
	* module/language/cps.scm: Remove $var.  Replaced by $values with one
	  value.

	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-rtl.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Adapt all the world.

2013-11-13  Ludovic Courtès  <ludo@gnu.org>

	i18n: Fix null pointer dereference when locale info is missing.
	* libguile/i18n.c (scm_nl_langinfo): Check whether C_RESULT is NULL
	  before calling 'strdup'.

2013-11-10  Andy Wingo  <wingo@pobox.com>

	Add specialize-primcalls pass; bump objcode version.
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

	* libguile/objcodes.c (process_dynamic_segment): Expect the minor
	  version to be present and, while we are still banging on the VM,
	  exactly equal to SCM_OBJCODE_MINOR_VERSION.

	* libguile/vm-engine.c: Renumber ops.  Remove the general make-vector.
	  Rename constant-FOO to FOO/immediate.  Remove struct-ref and
	  struct-set!, replace with struct-ref/immediate and
	  struct-set!/immediate.

	* module/Makefile.am:
	* module/language/cps/specialize-primcalls.scm: New pass, inlines FOO to
	  FOO/immediate -- e.g. vector-ref to vector-ref/immediate.

	* module/language/cps/arities.scm: Remove struct-set! case, now that
	  there is no struct-set! opcode.

	* module/language/cps/compile-rtl.scm (compile-fun): Remove dispatch to
	  constant-FOO versus FOO here -- that decision is made by
	  specialize-primcalls.
	  (optimize): Add specialize-primcalls pass.

	* module/language/cps/dfg.scm (constant-needs-allocation?): Adapt to
	  name changes.

	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*primitive-constructors*): Add allocate-struct.

	* module/system/vm/assembler.scm (*bytecode-major-version*):
	  (*bytecode-minor-version*, link-dynamic-section): Write minor version
	  into resulting image.

2013-11-10  Andy Wingo  <wingo@pobox.com>

	Effects analysis distinguishes between struct fields
	* module/language/tree-il/effects.scm (compile-time-cond):
	  (define-effects): Make the effects analysis more precise,
	  distinguishing between different kinds of mutable data.  On 64-bit
	  systems we take advantage of the additional bits to be even more
	  precise.
	  (make-effects-analyzer): Inline handlers for all "accessor" primitives
	  and their corresponding mutators.

	* module/language/tree-il/peval.scm (peval): Reflow to remove use of the
	  "accessor-primitive?" predicate.

	* module/language/tree-il/primitives.scm (accessor-primitive?): Remove.

2013-11-10  Andy Wingo  <wingo@pobox.com>

	Effects analysis sees match-error, throw-bad-structs as bailouts
	* module/language/tree-il/effects.scm (make-effects-analyzer): Allow
	  module-ref calls to be treated as bailouts, if the procedure has the
	  "definite-bailout?" property.  Perhaps this should be renamed.

	* module/ice-9/match.upstream.scm (match-error):
	* module/srfi/srfi-9.scm (throw-bad-struct): Give these procedures the
	  definite-bailout? property.

2013-11-09  Andy Wingo  <wingo@pobox.com>

	Binary search to find procedure properties.
	* module/system/vm/debug.scm (find-program-properties): Use binary
	  search.

	Fix RTL linking of procedure properties.
	* module/system/vm/assembler.scm (link-procprops): Fix procedure
	  property embedding in bytecode.

	Binary search to find docstrings.
	* module/system/vm/debug.scm (find-program-docstring): Use binary
	  search.

2013-11-09  Andy Wingo  <wingo@pobox.com>

	Finding a procedure's arity uses binary search
	* module/system/vm/assembler.scm (pack-arity-flags):
	  (write-arity-headers): Add a flag to indicate that an arity is part of
	  a case-lambda, so that we can use binary search to find arities.

	* module/system/vm/debug.scm (is-in-case-lambda?)
	  (arity-is-in-case-lambda?, find-first-arity): Use binary search.

2013-11-09  Andy Wingo  <wingo@pobox.com>

	Use binary search in find-elf-symbol
	* module/system/vm/debug.scm (binary-search): New helper.
	  (find-elf-symbol): Use binary search.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Fix run-vm-tests
	* test-suite/vm/run-vm-tests.scm: Fix for RTL.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Remove stack programs, objcode, and the old VM.
	* libguile/Makefile.am:
	* libguile/vm-i-loader.c:
	* libguile/vm-i-scheme.c:
	* libguile/vm-i-system.c: Remove the old VM files, and the rules to
	  build the .i files.

	* libguile/vm-engine.c:
	* libguile/vm.c: Remove the old VM.  Woot!

	* libguile/_scm.h (SCM_OBJCODE_COOKIE, SCM_OBJCODE_ENDIANNESS_OFFSET)
	  (SCM_OBJCODE_WORD_SIZE_OFFSET): Remove.

	* libguile/evalext.c (scm_self_evaluating_p): Remove objcode and program
	  cases.

	* libguile/frames.c (scm_frame_num_locals, scm_frame_previous): Remove
	  program cases.

	* libguile/gc.c (scm_i_tag_name): Remove objcode case.
	* libguile/goops.c (scm_class_of, create_standard_classes): Remove
	  objcode and program cases.

	* libguile/instructions.h:
	* libguile/instructions.c (scm_instruction_list, scm_instruction_p)
	  (scm_instruction_length, scm_instruction_pops, scm_instruction_pushes)
	  (scm_instruction_to_opcode, scm_opcode_to_instruction): Remove old VM
	  code.

	* libguile/objcodes.h:
	* libguile/objcodes.c: Remove the objcode data type, and handling for
	  objcode files.

	* libguile/print.c: Remove objcode and program printers.

	* libguile/procprop.c: Remove program cases.
	* libguile/procs.c:

	* libguile/programs.h:
	* libguile/programs.c: Remove old program code.

	* libguile/smob.c: Remove objcodes include.

	* libguile/snarf.h: Remove static program defines.

	* libguile/stacks.c: Remove program case.

	* libguile/tags.h: Remove program and objcode tc7s.

	* module/ice-9/session.scm (procedure-arguments)
	* module/language/tree-il/analyze.scm (validate-arity)
	* module/statprof.scm (get-call-data, procedure=?)
	* module/system/vm/frame.scm (frame-bindings)
	  (frame-call-representation): Remove old program cases.

	* module/system/repl/debug.scm (frame->module): Add a FIXME.

	* module/system/vm/instruction.scm: Remove old exports.

	* module/system/vm/program.scm: Remove old program code.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Miscellaneous fixups related to objcode removal.
	* module/scripts/compile.scm: Fix --help message.

	* module/system/repl/command.scm (disassemble): Fix error message.

	* module/system/vm/frame.scm: Remove objcode import.

	* module/system/vm/objcode.scm: Remove some exports related to the
	  objcode type.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Remove program-sources-pre-retire case for stack programs.
	* module/system/vm/program.scm (program-sources-pre-retire): Remove
	  stack program case.

	Remove (language objcode)
	* module/language/objcode.scm: Remove.  Seems to have been unused.

	Move assemble-program to test cases.
	* module/system/vm/assembler.scm (assemble-program): Remove.
	* test-suite/tests/rtl.test (assemble-program): Move here.

	Per-instruction tracing doesn't try to disassemble stack VM code
	* module/system/vm/trace.scm (trace-instructions-in-procedure): Don't
	  try to disassemble the procedure, for now.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	(system vm traps) support for rtl programs
	* module/system/vm/debug.scm: Export program-debug-info-size.

	* module/system/vm/traps.scm (frame-matcher): Remove stack program
	  case.  Use absolute frame-instruction-procedure to match if
	  match-code?.
	  (program-last-ip): Use (system vm debug) interfaces.
	  (program-sources-by-line): Use program-sources, as
	  program-sources-pre-retire will go away soon.  Return absolute
	  addresses.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Remove objcode language.
	* module/language/objcode/elf.scm:
	* module/language/objcode/spec.scm: Remove objcode language.

	* module/Makefile.am: Adapt.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Remove bytecode language.
	* module/language/bytecode/spec.scm: Remove.

	* module/Makefile.am: Adapt.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Remove assembly language.
	* module/system/repl/command.scm: Remove disassembly cases for stack
	  procedures.

	* module/system/vm/inspect.scm: Adapt to disassemble RTL programs.

	* module/language/assembly.scm:
	* module/language/assembly/compile-bytecode.scm:
	* module/language/assembly/decompile-bytecode.scm:
	* module/language/assembly/disassemble.scm:
	* module/language/assembly/spec.scm: Remove assembly language.

	* module/Makefile.am: Adapt.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Decompile goes from tree-il to scheme by default.
	* module/system/base/compile.scm (decompile): By default, go from
	  tree-il to Scheme, now that the assembly language is going away.

	Rewrite (system xref) to work with RTL programs
	* module/system/xref.scm (nested-procedures): New helper.
	  (program-callee-rev-vars): Rewrite using fold-program-code and
	  nested-procedures.
	  (add-sources, forget-sources): Use match instead of pmatch.  Use
	  nested-procedures.

	Add fold-program-code to (system vm disassembler)
	* module/system/vm/disassembler.scm (fold-code-range): New helper.
	  (fold-program-code): New interface.

	Remove GLIL language
	* module/Makefile.am:
	* module/language/glil.scm:
	* module/language/glil/compile-assembly.scm:
	* module/language/glil/spec.scm: Remove.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Remove tree-il->glil compiler
	* module/Makefile.am:
	* module/language/tree-il/compile-glil.scm: Remove.

	* module/language/tree-il/spec.scm: Remove tree-il->glil link.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Move useful parts of asm-to-bytecode.test to cross-compilation.test
	* test-suite/tests/cross-compilation.test: Rename from asm-to-bytecode,
	  and remove the bits testing assembly->bytecode but keep the
	  cross-compilation things.

	* test-suite/Makefile.am: Adapt.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Tree-IL warnings tests compile to CPS instead of "assembly"
	* test-suite/tests/tree-il.test ("warnings"): Change warnings test to
	  compile to CPS instead of assembly.

	Remove tree-il->glil test cases
	* test-suite/tests/tree-il.test: Remove GLIL test cases.  They have
	  never been helpful to me in the 2.0 series, so there is no loss.

	Remove a couple of uses of GLIL from the test suite.
	* test-suite/tests/cse.test ("cse"):
	* test-suite/tests/peval.test: Remove uses of GLIL.

	Fix program-minimum-arity to work better with case-lambda.
	* module/system/vm/debug.scm (program-minimum-arity): Be more precise
	  with case-lambdas.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Builtins have procedure properties
	* libguile/vm-builtins.h (FOR_EACH_VM_BUILTIN): Add arity information.
	  (enum scm_vm_builtins):
	* libguile/vm.c (scm_vm_builtin_ref):
	  (scm_vm_builtin_name_to_index):
	  (scm_vm_builtin_index_to_name): Adapt to macro interface change.
	  (scm_init_vm_builtin_properties): New helper, sets procedure
	  properties on builtins.
	  (scm_bootstrap_vm): Just define the builtins here.  Later in the
	  bootstrap we set their properties.
	  (scm_sym_apply): Move definition here from expand.c.

	* libguile/procprop.c (scm_init_procprop): Call
	  scm_init_vm_builtin_properties.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Fix procedure-arguments on RTL programs, and tweak session.test
	* module/ice-9/session.scm (procedure-arguments): Add an rtl-program?
	  case.

	* module/system/vm/debug.scm (arity-arguments-alist): Use the order that
	  session.test expects.

	* test-suite/tests/session.test ("procedure-arguments"): Adapt tests
	  with keywords for the new starting-with-the-procedure numbering of
	  locals.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Fix make-vector peval test
	* test-suite/tests/peval.test ("partial evaluation"): Fix to expect a
	  primcall.

	Fix case-lambda* dispatching to agree with manual.
	* module/system/vm/assembler.scm (kw-prelude): Emit br-if-npos-gt as
	  appropriate.

	Add br-if-npos-gt
	* libguile/vm-engine.c (br-if-npos-gt): New instruction (sigh!).  For
	  case-lambda* dispatching on the number of positional args, as the
	  manual describes.  Renumber other opcodes.

	Fix BR_NARGS data type width
	* libguile/vm-engine.c (BR_NARGS): Fix width of "expected".  Fixes bug
	  with > 65536 arguments in case-lambda clauses.

	Fix arity selection in compute-contification
	* module/language/cps/contification.scm (compute-contification): Fail as
	  soon as we see an arity with rest, optional, or keyword arguments.
	  Fixes ((case-lambda ((a . b) #t) ((a b) #f)) 1 2).

	Fix error message in lambda* eval closures with keywords
	* module/ice-9/eval.scm (primitive-eval): For ((lambda* (#:key foo) foo) 'bar),
	  give an "invalid keyword" error instead of a "wrong number of
	  arguments" error.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Fix reading and writing arities into DWARF.
	* libguile/gsubr.h:
	* libguile/gsubr.c (scm_i_primitive_call_ip):
	* libguile/programs.c (scm_primitive_call_ip): Adapt to return an
	  absolute address.

	* module/system/vm/assembler.scm (write-arity-headers): Adapt to write
	  byte addresses (relative to the text base).

	* module/system/vm/debug.scm (arity-low-pc, arity-high-pc): Return
	  absolute addresses, instead of word offsets relative to the text
	  base.
	  (find-first-arity): Adapt for absolute addresses.

	* module/system/vm/program.scm (program-arguments-alist): Adapt for
	  arity-low-pc / arity-high-pc absolute addresses.

2013-11-08  Andy Wingo  <wingo@pobox.com>

	Fix eval.test: stack involving a primitive
	* test-suite/tests/eval.test ("stacks"): Revert expect-fail introduced
	  in 27337b6373954e1a975d97d0bf06b5c03d65b64d.

	Fix coverage.test: instrumented-source-files
	* test-suite/tests/coverage.test ("instrumented-source-files"): Adapt to
	  new expectation that all files loaded on the system will be present in
	  the source information.

	Fix coverage.test: "procedure-execution-count: never"
	* test-suite/tests/coverage.test ("procedure-execution-count"): Adapt
	  test to new behavior of procedure-execution-count of an unseen
	  procedure: zero, not false.

	Fix coverage.test: "line-execution-counts: one proc hit, one proc unused"
	* test-suite/tests/coverage.test ("line-execution-counts"): Fix test for
	  even/odd? in letrec.  The test profiles the execution of even?, not
	  the letrec, so the last line is in fact not reached.

2013-11-07  Andy Wingo  <wingo@pobox.com>

	frame-instruction-pointer is absolute; rewrite (system vm coverage)
	* libguile/frames.c (scm_frame_source): Instead of assuming that
	  scm_frame_procedure is correct, use the IP to get the source.
	  (scm_frame_instruction_pointer): Return an absolute value instead of
	  assuming that slot 0 is correct.  (It isn't, when preparing for a tail
	  call.)

	* libguile/programs.h:
	* libguile/programs.c (scm_find_source_for_addr): New internal helper.

	* module/system/repl/debug.scm (print-registers): Readably print
	  absolute instruction pointers.

	* module/system/vm/coverage.scm: Complete rewrite to use absolute IP's.
	  We can't assume that frame-procedure is cheap if it is correct, or
	  correct if it is cheap.  Anyway using the address is better anyway.
	  (coverage-data->lcov): Disable per-function info temporarily.
	  (loaded-modules, module-procedures, closest-source-line)
	  (closed-over-procedures): Remove these.  Instead of going from
	  procedures to source info, now we go from ELF image to source info.

	* module/system/vm/debug.scm (debug-context-length): New interface.

	* module/system/vm/program.scm (source-for-addr): New internal helper.

2013-11-07  Andy Wingo  <wingo@pobox.com>

	scm_from_uintptr_t / scm_from_ptrdiff_t usage
	* libguile/frames.c:
	* libguile/programs.c: Use scm_from_ptrdiff_t and scm_from_uintptr_t
	  where appropriate.

2013-11-07  Andy Wingo  <wingo@pobox.com>

	Program sources are always pre-retire now
	* module/system/repl/debug.scm (<debug>): Remove for-trap?.  Backtraces
	  with RTL will always happen pre-retire on the top frame, source info
	  is pre-retire, and continuations will always have a source-marked
	  receive or receive-values or whatever with the right source marking,
	  so we can remove this complication.
	  (print-frame): Use frame-source.
	  (print-frames): Remove for-trap? kw.

	* module/system/repl/command.scm (define-stack-command, backtrace)
	  (up, down, frame): Remove for-trap? introduced local, and its uses.
	  (repl-pop-continuation-resumer): Adapt to make-debug change.

	* module/system/repl/error-handling.scm (call-with-error-handling):
	  Adapt to make-debug change.

	* module/system/vm/frame.scm (frame-next-source): Remove.  RTL sources
	  are pre-retire.

	* module/system/vm/trap-state.scm (add-ephemeral-stepping-trap!): Adapt
	  to use frame-source.  Still some work to do here.

2013-11-07  Andy Wingo  <wingo@pobox.com>

	add fold-all-debug-contexts, fold-source-locations
	* module/system/vm/objcode.scm:
	* libguile/objcodes.c (scm_all_mapped_elf_images): New proc.

	* module/system/vm/debug.scm (fold-all-debug-contexts):
	  (fold-source-locations): New public interfaces.

2013-11-07  Andy Wingo  <wingo@pobox.com>

	Fix DWARF source test now that we have more precise source info.
	* test-suite/tests/dwarf.test: Fix test after the $continue/$cont source
	  change, which reifies proper source info for the +.

	Fix line advance DWARF opcodes when line advance is exactly 128
	* module/system/vm/assembler.scm (link-debug): Fix off-by-one error in
	  which forward jumps of 128 were mis-rendered.

	Write DWARF files list in correct order.
	* module/system/vm/assembler.scm (link-debug): Fix order of writing the
	  source files list; it was being written backwards.

2013-11-07  Andy Wingo  <wingo@pobox.com>

	Source information goes on the $continue, not the $cont.
	* module/language/cps.scm ($continue, $cont): Put source information on
	  the $continue, not on the $cont.  Otherwise it is difficult for CPS
	  conversion to preserve source information.
	  ($fun): Add a src member to $fun.  Otherwise we might miss the source
	  info for the start of the function.

	* .dir-locals.el:
	* module/language/cps/arities.scm:
	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-rtl.scm:
	* module/language/cps/constructors.scm:
	* module/language/cps/contification.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/elide-values.scm:
	* module/language/cps/reify-primitives.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Update the whole CPS world
	  for this change.

2013-11-06  Andy Wingo  <wingo@pobox.com>

	Fix first find-program-sources result
	* module/system/vm/debug.scm (find-program-sources): Manually set the pc
	  of the first result in a function.

2013-11-05  Andy Wingo  <wingo@pobox.com>

	compiler.test fix for rtl compilation
	* test-suite/tests/compiler.test ("current-reader"): Fix the way we make
	  programs from objcode.

	fix docstring assembly and fetching
	* module/system/vm/assembler.scm (link-docstrs): Write pc offsets as
	  byte addresses.  Works better with native code.
	* module/system/vm/debug.scm (find-program-docstring): Fix the linear
	  search.  How embarassing!

	asm-labels is a hash table
	* module/system/vm/assembler.scm (make-assembler, label):
	  (link-data, process-relocs, process-labels): Change labels to be a
	  hash table.

	fix make-long-immediate, make-long-long-immediate for dst >= 256
	* libguile/vm-engine.c (make-long-immediate, make-long-long-immediate):
	  Fix declaration of "dst" variable.

	Re-add the list hack to compile-cps
	* module/language/tree-il/compile-cps.scm (convert): Re-add the list
	  hack.  Ideally these go into some tree-il pass.

	squish to primitive reification
	* test-suite/tests/tree-il.test: Update for primitive-ref reification
	  fix.

2013-11-05  Mark H Weaver  <mhw@netris.org>

	Don't use the identifier 'noreturn'.
	Fixes <http://bugs.gnu.org/15798>.
	Reported by Matt Sicker <boards@gmail.com>.

	* libguile/__scm.h (SCM_NORETURN): Use ((__noreturn__)) instead of
	  ((noreturn)).

	* libguile/throw.h (scm_ithrow): Rename formal parameter from 'noreturn'
	  to 'no_return'.

	* libguile/throw.c (scm_ithrow): Rename formal parameter from 'noreturn'
	  to 'no_return'.

2013-11-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	GNU lightning 2.0.2 release

2013-11-03  Andy Wingo  <wingo@pobox.com>

	Fix test case for uniform-array->bytevector on bitvectors
	* test-suite/tests/bytevectors.test ("uniform-array->bytevector"):
	  Bitvectors are accessed in 32-bit chunks.

2013-11-03  Andy Wingo  <wingo@pobox.com>

	RTL compiler supports static bitvectors
	* libguile/arrays.c (scm_from_contiguous_typed_array):
	* libguile/bytevectors.c (scm_uniform_array_to_bytevector): For
	  bitvectors, round up the length to 32-bit units, as they are stored
	  internally.  Otherwise I think this probably does the wrong thing for
	  the last word on big-endian systems.
	* libguile/bitvectors.c (BITVECTOR_LENGTH, BITVECTOR_BITS):
	  (scm_c_make_bitvector): Reorder the length and pointer words to match
	  the layout of bytevectors.

	* module/language/cps/primitives.scm (*branching-primcall-arities*):
	* module/system/vm/assembler.scm (br-if-bitvector):
	* module/system/vm/disassembler.scm (code-annotation): Add bitvector
	  test support.

	* module/system/vm/assembler.scm (<uniform-vector-backing-store>): Add
	  an element-size field.
	  (intern-constant): Adapt make-uniform-vector-backing-store call.  Use
	  uniform-array->bytevector, as the old compiler did.
	  (link-data): Add bitvector cases.

2013-11-03  Andy Wingo  <wingo@pobox.com>

	struct-set! returns a value, yuck
	* module/language/cps/arities.scm (fix-clause-arities): Add a hack to
	  ensure that (struct-set! OBJ POS VAL) evaluates to VAL.  Yuck.

	Correctness fix for vector constructor inlining.
	* module/language/tree-il/compile-cps.scm (convert): Don't inline the
	  vector constructor if any arg could capture the current continuation.

	Eval evaluates initializers before creating environment ribs.
	* module/ice-9/eval.scm (let-env-evaluator, primitive-eval): Evaluate
	  initializers of let expressions before creating the environment rib.
	  This prevents call/cc-related shenanigans.

	"length" is an interesting primitive
	* module/language/tree-il/primitives.scm (*effect-free-primitives*):
	  (*interesting-primitive-names*): Add "length", so that we can
	  constant-fold it.

2013-11-01  Andy Wingo  <wingo@pobox.com>

	Revert "Compile-time debugging"
	This reverts commit 6a37b7faaf150e9fb7945ef79969cb7671d17367.

	Fix call/cc with the RTL VM
	* libguile/vm.c (vm_return_to_continuation): The RTL VM saves the
	  registers for the caller of call/cc, but the caller will expect values
	  in the normal MV return location: above the frame.  Make it so, number
	  four!

	Fix order of evaluation in elisp lexer
	* module/language/elisp/lexer.scm (lex): Use let*, to ensure that the
	  port position is read before reading the next char.

	Fix contification of non-recursive closures
	* module/language/cps/contification.scm (compute-contification): When
	  eliding let-bound functions, also record the cont that declares the
	  function.
	  (apply-contification): Instead of reifying ($values ()) gotos instead
	  of the elided function, inline the body that binds the function
	  directly.  This ensures that the function gets contified in its own
	  scope.

2013-11-01  Andy Wingo  <wingo@pobox.com>

	RTL compilation sorts continuations topologically before visiting them
	* module/language/cps/compile-rtl.scm (compile-fun): Rewrite to visit
	  conts in reverse-post-order, which is a topological sort on the basic
	  blocks.

	* module/language/cps/slot-allocation.scm (allocate-slots): Expect a DFG
	  as an argument.

2013-11-01  Andy Wingo  <wingo@pobox.com>

	Failed match errors generate less code
	* module/ice-9/match.upstream.scm (match-next): Call out to an external
	  procedure on error, and use a begin instead of double-parens.  This
	  results in less generated code.

	Add compile-cps hack for vectors
	* module/language/tree-il/compile-cps.scm (convert): Add a special case
	  for "vector" primcalls.  Boo!

2013-10-31  Andy Wingo  <wingo@pobox.com>

	Better range checks in the assembler
	* module/system/vm/assembler.scm (pack-u8-u24, pack-u8-s24):
	  (pack-u1-u7-u24, pack-u8-u12-u12, pack-u8-u8-u16, pack-u8-u8-u8-u8):
	  Prevent adjacent fields from stompling each other.

2013-10-31  Andy Wingo  <wingo@pobox.com>

	Be smarter about capturing the environment for memoized code
	* libguile/memoize.h (SCM_M_CAPTURE_MODULE)
	* libguile/memoize.c (MAKMEMO_CAPTURE_MODULE, capture_env):
	  (maybe_makmemo_capture_module, memoize): Determine when to capture the
	  module on the environment chain at compile-time, instead of at
	  runtime.  Introduces a new memoized expression type, capture-module.
	  (scm_memoized_expression): Start memoizing with #f as the
	  environment.
	  (unmemoize): Add unmemoizer.
	  (scm_memoize_variable_access_x): Cope with #f as module, and treat as
	  the root module (captured before modules were booted).

	* libguile/eval.c (eval):
	* module/ice-9/eval.scm (primitive-eval): Adapt.

2013-10-31  Andy Wingo  <wingo@pobox.com>

	define! is an interesting primitive
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  Add define!.

	fix compilation of (let lp () (lp))
	* module/language/cps/dfg.scm (reverse-post-order): Add an optional
	  "fold-all-conts" argument.
	  (compute-live-variables): Take the function as an arg instead of the
	  start continuation, and implement fold-all-conts so that nodes that
	  never reach the tail also get liveness information.

	DFG: Export analyze-control-flow.
	* module/language/cps/dfg.scm ($cfa, $dominator-analysis): Remove
	  dominator things from $cfa, to break out to separate structure.
	  (cfa-k-idx, cfa-k-count, cfa-k-sym, cfa-predecessors): New public
	  accessors.
	  (analyze-control-flow): New public function.
	  (analyze-dominators): Adapt.

	static-patch! for pair and vector fields
	* module/system/vm/assembler.scm (intern-constant): Use static-patch!
	  for fields.

	Better REPL support for disassembling RTL images
	* module/system/repl/command.scm (load-image): New helper.
	  (compile, disassemble): Handle bytevectors.

2013-10-31  Andy Wingo  <wingo@pobox.com>

	Default to compiling to RTL
	* module/ice-9/eval-string.scm (eval-string)
	* module/language/tree-il/spec.scm (tree-il)
	* module/scripts/compile.scm (compile)
	* module/system/base/compile.scm (compile-file, read-and-compile)
	* module/system/repl/common.scm (repl-compile, repl-prepare-eval-thunk):
	  Default to compiling to RTL.

	* module/language/rtl/spec.scm (rtl->value): Add value compiler.

2013-10-31  Andy Wingo  <wingo@pobox.com>

	Avoid calling procedure-name when doing a make-procedure-with-setter
	* libguile/procs.c (scm_make_procedure_with_setter): Don't set the name
	  of the procedure.  Instead rely on procedure-name to look it up from
	  the wrapped procedure as needed.
	* libguile/procprop.c (scm_procedure_name): If there was no override and
	  the procedure is a procedure-with-setter, recurse on the procedure.

	Better aliased primcall compilation
	* libguile/vm-engine.c (define!): Rename from define.
	* module/language/cps/arities.scm (fix-clause-arities): If a prim
	  aliases an RTL instruction with a different name and we reify a
	  primcall, reify the instruction name.
	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Update
	  emit-define! for new name.
	* module/language/cps/primitives.scm (*rtl-instruction-aliases*): Add
	  bytevector native accessors.

	Better compiler support for bytevector ops
	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add emitters
	  for bytevector ops.  Add br-if-bytevector emitter.
	* module/language/cps/primitives.scm (*branching-primcall-arities*):
	  Mark bytevector? as a branching primitive.
	* module/system/vm/assembler.scm (br-if-bytevector): New instruction
	* module/system/vm/disassembler.scm (code-annotation): Add support for
	  bytevector?.

	Fix bytevector error messages.
	* libguile/vm-engine.c (BV_FIXABLE_INT_SET, BV_INT_SET):
	  (BV_FLOAT_SET): Fix instruction names in error messages.

2013-10-31  Andy Wingo  <wingo@pobox.com>

	Support serialization of uniform vector literals
	* libguile/uniform.h:
	* libguile/uniform.c (scm_uniform_vector_element_type_code): New
	  interface, returns a type code as an integer.

	* module/system/vm/assembler.scm (<uniform-vector-backing-store>)
	  (simple-vector?, uniform-array?, statically-allocatable?)
	  (intern-constant, link-data, link-constants): Support uniform arrays,
	  and punt on vectors aren't contiguous from 0.  Support for general
	  arrays will come later.

	* test-suite/tests/rtl.test ("load-constant"): Add tests.

2013-10-31  Andy Wingo  <wingo@pobox.com>

	Compile-time debugging
	* module/language/cps/compile-rtl.scm:
	* module/language/cps/contification.scm: Add some compile-time
	  printouts.  Will be removed later.

	DFG: $block no longer stores control-flow analysis
	* module/language/cps/dfg.scm ($block): Remove dominator-related things
	  from $block.
	  (reverse-post-order, convert-predecessors): Be more abstract, taking
	  arbitrary identifiers for nodes instead of assuming the nodes are
	  continuation names.
	  (make-block-mapping): New helper.
	  ($cfa): New data type, for dominator and loop analysis.  Not yet
	  public.
	  (analyze-control-flow): Rewrite to only compute the dominator tree in
	  one direction, but take that direction as an argument.  To be public
	  once there is some code that uses it.
	  ($dfa): Refactor function fields to be hash tables.
	  (dfa-k-idx, dfa-var-idx): Adapt to refactor.
	  (compute-live-variables): Adapt to refactor.

	static-patch! replaces link-procedure!
	* libguile/vm-engine.c (static-patch!): Replace link-procedure! with
	  this more versatile primitive.
	* module/system/vm/assembler.scm (intern-constant): Emit static-patch!
	  for static procedures and for strings.
	* module/system/vm/disassembler.scm (code-annotation): Remove annotation
	  for link-procedure!.  There can be no annotation for static-patch!, as
	  neither operand is guaranteed to be a SCM value.

	Fix primitive reification for class-of, bytevector-u8-ref, etc
	* module/language/cps/reify-primitives.scm (primitive-module): Not all
	  primitives are bound in (guile).

	DFG: Disable control-flow analysis.
	* module/language/cps/dfg.scm (visit-fun): Disable control-flow analysis
	  for now, as it is not used.

2013-10-31  Andy Wingo  <wingo@pobox.com>

	Add "pop" field to $prompt
	* module/language/cps.scm ($prompt): Add a "pop" field, indicating the
	  continuation at which this prompt is popped.  The body of the prompt
	  is dominated by the prompt, and post-dominated by the pop.  Adapt all
	  builders and users.

	* module/language/cps/closure-conversion.scm:
	* module/language/cps/compile-rtl.scm:
	* module/language/cps/slot-allocation.scm:
	* module/language/cps/verify.scm:
	* module/language/tree-il/compile-cps.scm: Adapt.

	* module/language/cps/dfg.scm (visit-fun): Add an arc from the pop to
	  the handler, to keep handler variables alive through the prompt body.

2013-10-29  Andy Wingo  <wingo@pobox.com>

	DWARF return arity fixen
	* module/system/vm/dwarf.scm (read-die-abbrev): Fix return arity.
	  (read-compilation-unit): Fix return arity of read-die.

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

	Dynamic-wind doesn't call thunk? on the out-guard.
	* module/ice-9/boot-9.scm (dynamic-wind): Remove the thunk? check of the
	  out-guard.

	Walk the stack to determine extent of partial continuation
	* libguile/control.c (reify_partial_continuation): Walk the stack to
	  determine the bottom of the captured stack.

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

	Resumable partial continuations in the RTL VM
	* libguile/vm-engine.c (receive-values): Bugfix for the case where we
	  want an exact number of values.
	  (abort): Advance the IP before capturing.  The captured SP is fp - 1,
	  not fp.

	* libguile/vm.c (vm_reinstate_partial_continuation): Don't push on a
	  number-of-values marker.

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

	VM has "builtins": primitives addressable by emitted RTL code
	* libguile/Makefile.am:
	* libguile/vm-builtins.h: New header, declaring stubs needed by the
	  compiler like values, apply, and abort-to-prompt.

	* libguile/vm.c: Adapt the apply and values stubs to conform to a
	  standard interface.  Add an abort-to-prompt stub.  Add call/cc and
	  call-with-values stubs.
	  (scm_vm_builtin_ref): New helper, for the builtin-ref opcode.
	  (scm_vm_builtin_name_to_index)
	  (scm_vm_builtin_index_to_name): New helpers, for the compiler and
	  disassembler, respectively.
	  (scm_init_vm_builtins, scm_bootstrap_vm): Allow the compiler helpers
	  to be loaded later into a module.
	* module/language/rtl.scm: Export builtin-index->name and
	  builtin-name->index.

	* libguile/vm-engine.c (RETURN_VALUE_LIST): Update to use new names of
	  "apply" and "values".
	  (tail-call/shuffle): New opcode.
	  (abort): Update to be a tail VM op, and reorder and renumber other
	  ops.
	  (builtin-ref): New opcode.

	* libguile/continuations.h:
	* libguile/continuations.c (scm_i_call_with_current_continuation):
	  Move this to vm.[ch], implemented as a builtin.

	* module/language/tree-il/compile-cps.scm (convert): Convert to
	  'abort-to-prompt calls, possibly with 'apply, effectively undoing the
	  tree-il transformation.

	* module/language/cps/reify-primitives.scm (builtin-ref): New helper.
	  (reify-primitives): Convert builtin primitives to builtin-ref.

	* module/language/cps/dfg.scm (constant-needs-allocation?):
	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add support
	  for compiling builtin-ref.

	* module/system/vm/disassembler.scm (code-annotation): Add annotation
	  for builtin-ref.

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

	Partial continuations are RTL stubs
	* libguile/control.c: Implement partial continuations as RTL programs.

	* libguile/programs.c (scm_i_rtl_program_minimum_arity): Add partial
	  continuation case.

	* libguile/vm-engine.c (compose-continuation): Fix to look for vm_cont
	  from the free variables.

	* libguile/vm-i-system.c (abort): Poison continuations captured in the
	  stack VM, as the can't be rewound by the RTL stubs.

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

	Fix toplevel-ref with named modules before boot in stack VM
	* libguile/vm.c (resolve_variable): Fix, as in
	  e23f9e4423bbbe8521d13e1c9a223612a5e86762.

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

	Memoized expressions are pairs, not SMOBs
	* libguile/memoize.c (MAKMEMO): Memoized objects are pairs now, not
	  SMOBs.  This lets eval.scm destructure them more efficiently.
	  (scm_print_memoized, scm_memoized_p, scm_memoized_expression_typecode)
	  (scm_memoized_expression_data): Remove these interfaces.
	  (unmemoize, scm_memoize_variable_access_x): Remove SMOB type checks.
	  (scm_init_memoize): Remove SMOB type definition.

	* libguile/memoize.h (scm_tc16_memoized, SCM_MEMOIZED_P)
	  (scm_memoized_expression_typecode, scm_memoized_expression_data)
	  (scm_memoized_p): Remove declarations.

	* libguile/validate.h (SCM_VALIDATE_MEMOIZED): Remove declaration.

	* libguile/eval.c (eval): Remove memoized type check, and inline the
	  inum unpacking.

	* module/ice-9/eval.scm (memoized-expression-case): Use car and cdr to
	  destructure memoized expressions.  A big win!

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

	Tree-IL->GLIL: Fix primitive-ref reification bug
	* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Fix a
	  bug whereby a primitive that is present in the compilation module but
	  not at runtime was getting compiled as a toplevel-ref.  This was
	  causing current-module to fail to resolve in R6RS modules.

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

	Mark current-module as an interesting primitive
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  Add current-module, to allow RTL compilation.

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

	New pass: elide-values
	* module/Makefile.am:
	* module/language/cps/elide-values.scm (elide-values): New pass.

	* module/language/cps/compile-rtl.scm (optimize): Call the new pass.

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

	Add make-vector, constant-make-vector instructions
	* libguile/vm-engine.c (rtl_vm_engine): Add make-vector and
	  constant-make-vector instructions and renumber.

	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Emit
	  constant-make-vector and make-vector as appropriate.

	* module/language/cps/dfg.scm (constant-needs-allocation?): In some
	  cases, make-vector doesn't need to allocate its index.

	*  module/language/tree-il/primitives.scm
	   (*interesting-primitive-names*, *primitive-constructors*): Add
	   make-vector.

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

	Emit constant-vector-ref, constant-vector-set! for known small indices
	* libguile/vm-engine.c (rtl_vm_engine): Add constant-vector-set!
	  instruction and renumber.

	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Emit
	  constant-vector-ref and constant-vector-set! as appropriate.

	* module/language/cps/dfg.scm (constant-needs-allocation?): In some
	  cases, vector-ref and vector-set! don't need to allocate their index.

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

	New pass: inline-constructors
	* module/Makefile.am:
	* module/language/cps/constructors.scm (inline-constructors): New pass.

	* module/language/cps/compile-rtl.scm (optimize): Call the new pass.

	* module/language/tree-il/compile-cps.scm (convert): Don't handle "list"
	  specially here.

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

	Compile variable-ref, variable-set!
	* libguile/vm-engine (box-ref, box-set!): Instead of aborting if a box
	  isn't a var, call out to vm_error_not_a_variable.  This makes these
	  instructions equivalent to variable-ref/variable-set!.
	  (vector-set!): Rename from vector-set.

	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add
	  variable-set! case, and adapt vector-set!.

	* module/language/cps/primitives.scm (*rtl-instruction-aliases*): Add
	  variable-ref / variable-set! aliases to box-ref / box-set!.

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

	Recognize tree-il variable? primitive
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*)
	  (*effect-free-primitives*, *effect+exception-free-primitives*): Add
	  variable?.  Fix nil? spelling.

	RTL compiler: Compile TC7 branches.
	* module/system/vm/assembler.scm:
	* module/system/vm/disassembler.scm (code-annotation):
	* module/language/cps/primitives.scm (*branching-primcall-arities*):
	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add support
	  for compiling symbol?, variable?, vector?, and string? branches.

	Fix primcall return arities
	* module/language/cps/arities.scm (fix-clause-arities): Primcalls of
	  known arity that continue to ktrunc should, if their return arity does
	  not match the ktrunc, adapt via a call to `values'.  This call may
	  later get removed.

	RTL compiler: Compile `wind' primcalls
	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add handler
	  for `wind'.

	RTL VM: Fix fluid-ref local addressing.
	* libguile/vm-engine.c (push-fluid): Fix variable addressing.

	RTL VM: Fix variable lookup before modules boot
	* libguile/vm-engine.c (toplevel-box, module-box): Handle the case where
	  the module system isn't booted yet.

	Add stringbuf printer
	* libguile/strings.h:
	* libguile/strings.c (scm_i_print_stringbuf):
	* libguile/print.c (iprin1): Add a printer for stringbufs.  The
	  disassembler can print a stringbuf.

	Peval: Fold `thunk?' in more cases.
	* module/language/tree-il/peval.scm (peval): Better folding of the
	  `thunk?' predicate.

	Setting procedure properties does not cause metadata lookup
	* libguile/procprop.c (scm_procedure_properties, scm_procedure_property)
	  (scm_set_procedure_properties_x, scm_set_procedure_property_x)
	  (scm_procedure_name, scm_procedure_documentation): Rework to treat the
	  overrides table as complementary to the RTL program properties.  In
	  this way setting a procedure property doesn't require loading up
	  the (system vm debug) module.

	Evaluator sets same procedure properties as compiler
	* libguile/memoize.c (MAKMEMO_LAMBDA, memoize): Instead of passing the
	  docstring in the memoized lambda, pass the meta as-is.  That way we
	  get all procedure properties, including "name".
	* module/ice-9/eval.scm (primitive-eval): Set procedure properties when
	  making lambdas.  Don't set the name when defining toplevel variables
	  -- before we did so only if the procedure didn't have a name
	  property, but I would like to avoid calls to procedure-property in
	  eval, because getting the name for an RTL function requires loading up
	  other modules.

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

	Evaluator uses two-dimensional environment
	* libguile/memoize.c (MAKMEMO_LEX_REF, MAKMEMO_LEX_SET): Change to
	  address lexicals by depth and width.
	  (try_lookup_rib, lookup_rib, make_pos): New helpers.
	  (lookup): Adapt to return a pair.
	  (memoize, unmemoize_bindings, unmemoize_lexical): Adapt.

	* libguile/eval.c (eval, prepare_boot_closure_env_for_eval):
	  (prepare_boot_closure_env_for_apply):
	* module/ice-9/eval.scm (make-fixed-closure, make-general-closure)
	  (eval): Adapt to new environment.

	This is currently a slight win for C, and a slight lose for Scheme --
	because the lookup loop is so poorly compiled by the stack VM.  I expect
	that the RTL-compiled eval will fix this.

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

	Always resolve-primitives in the root module.
	* module/language/tree-il/primitives.scm (resolve-primitives): If we are
	  compiling in the root module, ignore local definitions.

	RTL VM: Fix LOCAL_REF, LOCAL_SET for unsigned indices
	* libguile/vm-engine.c (LOCAL_REF, LOCAL_SET): Fix so to work with
	  unsigned 0.  Previously subtracting 1 was making the index wrap
	  around.

	Optimize closures with only required and rest arguments in eval
	* module/ice-9/eval.scm: Pregenerate closures with rest arguments, as we
	  do for fixed arguments.  This is important given the amount of (lambda
	  args (apply foo args)) that we are doing lately.

2013-10-22  Andy Wingo  <wingo@pobox.com>

	Fix assembler for keyword args
	* module/system/vm/assembler.scm (begin-kw-arity, kw-prelude): Fix
	  functions with keywords.

	CPS conversion doesn't automatically produce $values
	* module/language/tree-il/compile-cps.scm (convert): Don't convert
	  values primcalls to $values, because we don't know that the
	  continuation can accept that number of values.

	Contify returns via calls to "values"
	* module/language/cps/contification.scm: Returns from contified
	  functions should primcall to 'values, as in general the return
	  continuation is a multiple value context ($ktrunc or $ktail).  A later
	  pass can elide the primcall if appropriate.

2013-10-21  Andy Wingo  <wingo@pobox.com>

	CPS->RTL compiler: add push-fluid and pop-fluid
	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Add cases for
	  push-fluid and pop-fluid.

	DFG: Remove lift-definition!
	* module/language/cps/dfg.scm: Remove lift-definition!.

	Fix contification bugs
	* module/language/cps/contification.scm (compute-contification): Rewrite
	  to avoid mutating the DFG and the function while we are rewriting.
	  Instead we compute a contification, and if it is not empty, we apply
	  it and loop.

	More robust contification
	* module/language/cps/contification.scm (contify): It could be that
	  visiting pending contifications could enqueue more contifications, so
	  iterate to a fixed point.  Signal an error if there are any pending
	  contifications at the end of an iteration.

	add lookup-block-scope
	* module/language/cps/dfg.scm (lookup-block-scope): New interface.
	  (visit-fun): Give a bit more info if link-blocks! fails.

	DFG fixup.
	* module/language/cps/dfg.scm: Remove dead-after-def? and
	  dead-after-use? export.

2013-10-21  Andy Wingo  <wingo@pobox.com>

	RTL slot allocator uses more precise, correct liveness information
	* module/language/cps/dfg.scm (control-point?): New interface, replaces
	  branch?.
	  (dead-after-def?, dead-after-use?, dead-after-branch?): Remove these.
	  The first one was fine; dead-after-use? was conservative but OK; but
	  dead-after-branch? was totally bogus.  Instead we use precise liveness
	  information in the allocator.

	* module/language/cps/slot-allocation.scm ($allocation): Remove "def"
	  and "dead" slots.  We'll communicate liveness information in some
	  other way to the compiler.
	  (allocate-slots): Rework to use precise liveness information.

2013-10-21  Andy Wingo  <wingo@pobox.com>

	DFG: Add code to compute live variable sets.
	* module/language/cps/dfg.scm (compute-live-variables)
	  (compute-maximum-fixed-point, print-dfa): New code to compute live
	  variable sets.

	DFG: Use maps have variable names
	* module/language/cps/dfg.scm ($use-map): Add variable names to the use
	  maps.
	  (visit-fun, lookup-def, lookup-uses, constant-needs-allocation?)
	  (variable-free-in?, dead-after-def?, dead-after-use?)
	  (dead-after-branch?): Adapt to use-map change.

2013-10-20  Ian Price  <ianprice90@googlemail.com>

	Fix optional end argument in `uniform-vector-read!'.
	Fixes <http://bugs.gnu.org/15370>.
	Reported by Thien-Thi Nguyen <ttn@gnu.org>.

	* libguile/deprecated.c (scm_uniform_vector_read_x): Only multiply by
	  width when argument supplied.

2013-10-20  Ian Price  <ianprice90@googlemail.com>

	Doc: 'unfold-right' takes a tail not a tail generator.
	Reported by David Kastrup <dak@gnu.org>.

	* doc/ref/srfi-modules.texi (SRFI-1 Fold and Map): Change argument
	  name, and default value.

2013-10-18  Andy Wingo  <wingo@pobox.com>

	Continuations are RTL stubs
	* libguile/continuations.h:
	* libguile/continuations.c: Reimplement continuations and the call_cc
	  stub as RTL programs.

	* libguile/programs.c (scm_i_rtl_program_minimum_arity): Add a case for
	  continuations.

	* libguile/vm-engine.c (rtl_vm_debug_engine): Always call the abort
	  continuation hook with the number of non-procedure locals.  Fix
	  compose-continuation argument count.  Enable call/cc.

2013-10-18  Andy Wingo  <wingo@pobox.com>

	(language tree-il analyze) works better with RTL programs
	* module/system/vm/program.scm (program-arguments-alists): Export this
	  interface.  Fall back to grovelling through procedure-minimum-arity if
	  the program has no arities, as might be the case for continuations.

	* module/language/tree-il/analyze.scm (validate-arity): Use
	  program-arguments-alists instead of the program-arities interface, to
	  cover both stack VM and RTL programs.

2013-10-18  Andy Wingo  <wingo@pobox.com>

	Foreign procedures are RTL programs
	* libguile/foreign.c: Convert to using RTL stubs.  Because RTL code has
	  different GC characteristics than objcode -- it's mostly assumed that
	  RTL code will never go away -- we go ahead and pre-generate code for
	  100 arguments.  This is actually less memory than the stack VM code,
	  and doesn't require any relocations at load-time: bonus!  We'll cross
	  the >=100 args bridge if we ever come to it.
	  (get_foreign_stub_code) New function.
	  (scm_i_foreign_arity): New helper, like scm_i_primitive_arity.
	  (cif_to_procedure): Rework to make RTL programs.

	* libguile/foreign.h: Declare scm_pointer_to_scm and
	  scm_scm_to_pointer.  Declare new internal helpers.

	* libguile/gsubr.c (create_subr): Refactor to set the flags when the
	  object is allocated.

	* libguile/instructions.h: Define SCM_PACK_RTL_12_12.

	* libguile/programs.c (scm_i_rtl_program_minimum_arity): Dispatch to
	  scm_i_foreign_arity if the procedure has the FOREIGN flag.
	* libguile/programs.h (SCM_F_PROGRAM_IS_FOREIGN)
	  (SCM_PROGRAM_IS_FOREIGN): New interfaces.

	* test-suite/tests/foreign.test ("procedure->pointer"): Add a test for
	  foreign arities.

2013-10-18  Ian Price  <ianprice90@googlemail.com>

	Doc: mention vectors are self-quoting
	Reported by Dmitry Bogatov <KAction@gnu.org>.

	* doc/ref/api-compound.texi (Vector Syntax, Vector Creation): Mention
	  that vectors are self-quoting. Remove examples with quote signs.

2013-10-18  Andy Wingo  <wingo@pobox.com>

	Fix statprof-proc-call-data for recent changes
	* module/statprof.scm (statprof-proc-call-data): Fix statprof for recent
	  fixes.

2013-10-18  Andy Wingo  <wingo@pobox.com>

	Subrs are RTL programs
	* libguile/gsubr.c: Define RTL stubs instead of stack VM stubs.
	  (SUBR_STUB_CODE, get_subr_stub_code): Adapt to return a uint32_t*
	  pointer instead of a SCM value.
	  (create_subr): Create RTL procedures instead of stack VM procedures.
	  For RTL procedures, the function pointer, name, and generic address
	  pointer go inline to the procedure, as free variables.
	  (scm_i_primitive_arity, scm_i_primitive_call_ip): New helpers.
	  (scm_c_make_gsubr, scm_c_define_gsubr, scm_c_make_gsubr_with_generic)
	  (scm_c_define_gsubr_with_generic): Adapt to create_gsubr being renamed
	  to create_subr.

	  Remove gsubr test code.

	* libguile/gsubr.h (SCM_PRIMITIVE_P, SCM_PRIMITIVE_GENERIC_P): Only RTL
	  programs can be primitives now.
	  (SCM_SUBRF, SCM_SUBR_NAME, SCM_SUBR_GENERIC): These fields are now in
	  the RTL free variables, not the object table.

	* libguile/programs.c (scm_i_rtl_program_name):
	  (scm_i_rtl_program_documentation):
	  (scm_i_rtl_program_properties):
	  (scm_i_rtl_program_minimum_arity): Implement these appropriately for
	  primitives, which lack debugging information.
	  (scm_primitive_p, scm_primitive_call_ip): New helpers.

	* libguile/snarf.h: Remove static allocation for subrs.  Since there is
	  nothing to allocate besides the program itself, which needs runtime
	  relocation, static allocation is not a win.

	* system/vm/program.scm: Fix up various arity-related things for
	  primitives, which don't use ELF arity info.

	* test-suite/tests/eval.test ("stack involving a primitive"): Add an
	  XFAIL until we get just one VM.

2013-10-18  Andy Wingo  <wingo@pobox.com>

	(system vm debug): implement arity-low-pc, arity-high-pc
	* module/system/vm/debug.scm (arity-low-pc, arity-high-pc): Implement
	  these exports.

	class-of fix for RTL programs
	* libguile/goops.c (scm_class_of): Use the same logic for RTL programs
	  and stack VM programs.

2013-10-17  Andy Wingo  <wingo@pobox.com>

	Stack traces skip RTL boot frames
	* libguile/frames.c (frame-previous)
	* libguile/stacks.c (make-stack): Skip RTL boot frames.

	RTL engine can apply smobs and applicable structs w/o stack VM
	* libguile/vm-engine.c (rtl_vm_engine): Allow the RTL VM to handle the
	  dispatch for SMOBs and applicable structs.

	Fix subr-call
	* libguile/vm-engine.c (subr-call): Fix for locals count including the
	  procedure.

	Fix tail-apply bugs
	* libguile/vm-engine.c (tail-apply): Fix for old change that made
	  the procedure indexed 0 instead of -1.

	Better vm.c support for RTL programs
	* libguile/vm.c (scm_c_vm_run): Directly dispatch to the RTL VM for RTL
	  programs.
	  (scm_bootstrap_vm): Initialize the RTL program stubs early, and mark
	  the RTL boot program with the boot flag.

	Procedure traps work with RTL programs.
	* module/system/vm/traps.scm (frame-matcher): Work with RTL programs.

	minimal RTL program support in (system xref)
	* module/system/xref.scm (procedure-sources*): Work with RTL programs.

	(system vm coverage) works with RTL programs
	* module/system/vm/coverage.scm (hashq-proc, assq-proc)
	  (program-sources*, closed-over-procedures, coverage-data->lcov): Work
	  with RTl procedures.

	Statprof works better with RTL programs
	* module/statprof.scm (get-call-data, procedure=?): Work with RTL
	  programs.

	bind-rest works in the optional-and-rest-arg case.
	* libguile/vm-engine.c (bind-rest): If the sp is below the dst reg,
	  alloc the frame to ensure there is enough space, and to fill in
	  intermediate values with SCM_UNDEFINED.

2013-10-16  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add assertion to detect double patching.
	  This triggers the bug at the right point, otherwise, double patching
	may be quite hard to track.

2013-10-14  Ludovic Courtès  <ludo@gnu.org>

	'scm_c_read' goes through the fast path with ISO-8859-1 unbuffered ports.
	Discussed in <http://bugs.gnu.org/15368>.

	* libguile/ports.c (scm_c_read): Enter the 'swap_buffer' case when
	  pt->encoding is "ISO-8859-1".

2013-10-14  Ludovic Courtès  <ludo@gnu.org>

	doc: Update the section on SMOBs and memory management.
	* doc/ref/libguile-smobs.texi (Describing a New Type): Only list 'print'
	  and 'equalp' as compulsory.  Explain why 'mark' and 'free' are
	  optional.
	  (Creating Smob Instances): Remove paragraphs about allocations that
	  might fail etc.  Use 'scm_gc_malloc_pointerless' for the pixel
	  buffer.
	  (Garbage Collecting Smobs): Explain when the 'mark' and 'free'
	  functions are needed.
	  (Garbage Collecting Simple Smobs): Remove.

2013-10-14  Andy Wingo  <wingo@pobox.com>

	Refactor vm_abort
	* libguile/vm.c (vm_abort):
	* libguile/vm-i-system.c (abort): Refactor abort interface so that it is
	  more amenable to the RTL VM.

2013-10-14  Andy Wingo  <wingo@igalia.com>

	Reify call-thunk/no-inline.
	* module/language/cps/reify-primitives.scm (reify-primitives): Remove
	  call-thunk/no-inline in this late phase.

2013-10-14  Andy Wingo  <wingo@igalia.com>

	RTL: Compile prompts
	* libguile/vm-engine.c (prompt): Adapt to explicitly set the saved SP so
	  we know how many incoming values the handler will receive, and to make
	  escape-only? a flag.

	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): $prompt
	  should only be found in a "seq" context, as it just pushes on a prompt
	  and doesn't bind any values.  On the other hand it should emit
	  appropriate code for the handler to bind its values, so do that.

	* module/language/cps/slot-allocation.scm ($cont-allocation): Add a note
	  that proc-slot is used by prompts as well.
	  (allocate-slots): Compute the allocation of a prompt handler's args.

	* module/language/tree-il/compile-cps.scm (convert): Use "unwind"
	  instead of the nonexistent "pop-prompt".

	* module/system/vm/disassembler.scm (code-annotation): Adapt to change
	  in prompt VM op.

2013-10-14  Andy Wingo  <wingo@igalia.com>

	RTL VM: receive-values has allow-extra? flag
	* libguile/vm-engine.c (receive-values): Add an ALLOW-EXTRA? flag in
	  unused bits of the third word.  Without it, receive-values will check
	  for the exact number of incoming values.

	* libguile/vm.c (vm_error_wrong_number_of_values): New error case.

	* module/language/cps/compile-rtl.scm (emit-rtl-sequence): Adapt to add
	  the ALLOW-EXTRA? flag.

2013-10-14  Andy Wingo  <wingo@igalia.com>

	Add SCM_F_DYNSTACK_PROMPT_PUSH_NARGS prompt flag
	* libguile/dynstack.h (scm_t_dynstack_prompt_flags): New flag,
	  SCM_F_DYNSTACK_PROMPT_PUSH_NARGS, set if the continuation expects the
	  number of args to be pushed on the top of the stack.

	* libguile/control.c (scm_c_abort): Only push nargs if requested.

	* libguile/eval.c (eval):
	* libguile/throw.c (pre_init_catch):
	* libguile/vm-i-system.c (prompt): Set
	  SCM_F_DYNSTACK_PROMPT_PUSH_NARGS.

2013-10-14  Andy Wingo  <wingo@igalia.com>

	call-with-prompt always compiles to CPS $prompt
	* module/language/tree-il/compile-cps.scm (convert): For prompts without
	  inline handlers, eta-convert the handler.

2013-10-14  Andy Wingo  <wingo@igalia.com>

	Put the readline extension in the extensionsdir
	* GUILE-VERSION:
	* acinclude.m4:
	* guile-readline/LIBGUILEREADLINE-VERSION:
	* guile-readline/Makefile.am: Rename libguile-readline-v-18.so to
	  guile-readline.so, and install it to the extensions dir instead of the
	  libdir.

	* guile-readline/ice-9/readline.scm: Load guile-readline instead of
	  libguile-readline-v-18.

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

	More precise dead-after-use? for loop variables
	* module/language/cps/dfg.scm (dead-after-use?):
	  (dead-after-branch?): A symbol defined in the header block of a loop
	  is still within the same loop.

	RTL slot allocation: Don't kill variables that flow into loops
	* module/language/cps/dfg.scm (dead-after-use?): Don't kill a variable
	  if it was defined outside the current loop.
	  (dead-after-branch?): Likewise, but I don't think this helper is
	  correct yet :/

	Compute post-dominators
	* module/language/cps/dfg.scm ($block): Add pdom and pdom-level fields,
	  for post-dominators.
	  (reverse-post-order, convert-predecessors): Arrange to work either
	  way: for dominators or for post-dominators.
	  (analyze-control-flow!): Compute post-dominators.
	  (dominates?): Refactor.
	  (post-dominates?): New helper.

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

	Identify loops
	* module/language/cps/dfg.scm (compute-dom-edges)
	  (compute-join-edges, compute-reducible-back-edges)
	  (compute-irreducible-dom-levels, compute-nodes-by-level)
	  (mark-loop-body, mark-irreducible-loops, identify-loops): Identify
	  loops.  Irreducible loops are TODO.

	* test-suite/tests/rtl-compilation.test ("contification"): Add an
	  irreducible loop test.

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

	DFG refactorings
	* module/language/cps/dfg.scm ($block): Add "irreducible" field, format
	  TBD.
	  (reverse-post-order): Return a vector directly.
	  (convert-predecessors, compute-dom-levels, compute-idoms):
	  (analyze-control-flow!): Factor out control flow analsysis a bit
	  better.
	  (identify-loops): New helper.  Currently a NOP.
	  (visit-fun): Adapt to compute-dominator-tree rename to
	  analyze-control-flow!.

2013-10-11  Andy Wingo  <wingo@pobox.com>

	Replace conservatively-dominates? with a precise dominator lookup
	* module/language/cps/dfg.scm (dominates?): Use the dominator tree
	  instead of the scope tree.

	Compute a dominator tree
	* module/language/cps/dfg.scm (reverse-post-order, for-each/enumerate)
	  (convert-predecessors, finish-idoms, compute-dominator-tree): Compute
	  a dominator tree.  We don't use it yet.

2013-10-10  Andy Wingo  <wingo@pobox.com>

	DFG refactor to allow dominator tree construction
	* module/language/cps/dfg.scm: Refactor so that we can think about
	  building a dominator tree.  Split continuations out of use maps and
	  put them in a separate table, which will have more flow information.
	  (visit-fun): Mark clauses as using their bodies.
	  (lookup-predecessors, lookup-successors): New exports.
	  (find-defining-expression): Add an exception for clauses, now that
	  clauses are in the flow graph.
	  (continuation-bound-in?): Rename from variable-bound-in?, as it can
	  currently only be used for continuations.

	* module/language/cps/contification.scm (contify): Adapt to use
	  lookup-predecessors and continuation-bound-in?.

2013-10-10  Andy Wingo  <wingo@pobox.com>

	A couple of fixes when no source info is available
	* module/system/vm/assembler.scm (link-debug): If there was no debugging
	  info, reset the file register to 0 from its default value of 1 before
	  adding the final row.

	* module/system/vm/dwarf.scm (line-prog-scan-to-pc): If we rescanned
	  from the beginning and still found no source info for this pc, return
	  #f instead of the default value of the file register (1).

2013-10-10  Andy Wingo  <wingo@pobox.com>

	Fix peval bug with inlining and optional argument initializers
	* module/language/tree-il/peval.scm (peval): Fix a bug whereby inlined
	  function applications with default argument initializers were putting
	  the initializers in the wrong scope.

	* test-suite/tests/peval.test ("partial evaluation"): Add a test.

2013-10-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	PPC: Correct wrong ldxi_l simplification in 64 bit mode
		* lib/jit_ppc-cpu.c: Correct wrong shortcut for ldxi_l with
		a zero offset, that was calling ldr_i instead of ldr_l.

	ARM: Do not use ldrt/strt by default
		* include/lightning/jit_arm.h, lib/jit_arm-cpu.c: Do not use
		by default load/store instructions that map to ldrt/strt.
		There is already the long displacement version for positive
		offsets, and when using a (shorter) negative offset it does
		not map to ldrt/strt. At least on qemu strt may cause
		reproducible, but unexpected SIGILL.

	ARM: Correct wrong offset for load/store of floats.
		* lib/jit_arm-vfp.c: Correct wrong load/store offset
		calculation when the displacement is constant but too
		large to use an instruction with an immediate offset.

2013-10-07  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Rerun tests on supported backends after bogus self test correction
	2013-10-07 Paulo Andrade <pcpa@gnu.org>

		* check/self.c: Extend tests to validate jit_callee_save_p
		does not cause an assertion on valid arguments, and test
		extra registers defined on some backends.

		* configure.ac: Do not ignore environment CFLAGS when
		checking if need to test runtime configurable options,
		like use x87 when sse2 is available, arm instruction set
		instead of thumb, etc.

		* include/lightning/jit_arm.h: Correct wrong jit_f macro
		definition.

		* include/lightning/jit_ia64.h, include/lightning/jit_ppc.h:
		Correct wrong jit_r macro definition.

		* lib/jit_x86-x87.c, lib/jit_x86.c: Actually use the
		reserved stack space for integer to/from float conversion.
		The stack space was also changed to ensure it is 8 bytes
		aligned. Also, for Solaris x86 in 32 bit mode, an alternate
		truncr_d was implemented because for some reason it is
		failing with SIGILL if using the "fisttpl" instructions,
		that must be available on p6 or newer, but for the sake of
		making all tests pass, implement a 486 or newer sequence
		if "sun" is defined.

2013-10-05  Andy Wingo  <wingo@pobox.com>

	Fix slot allocation bug
	* module/language/cps/slot-allocation.scm (allocate-slots): Fix
	  dead-after-use computation to use the expression's label and not its
	  continuation.

2013-10-04  Andy Wingo  <wingo@pobox.com>

	better RTL debugging
	* libguile/frames.c (scm_frame_source, scm_frame_instruction_pointer):
	  Fix to work with RTL programs.

	* module/system/vm/debug.scm (find-debug-context): Allow for the
	  possibility of there being no ELF image.
	  (find-program-debug-info, find-program-arities)
	  (program-minimum-arity, find-program-docstring)
	  (find-program-properties, find-source-for-addr)
	  (find-program-die, find-program-sources): Don't bail if we couldn't
	  get the debug context.

	* module/system/vm/frame.scm (frame-next-source)
	  (frame-call-representation): Allow RTL programs.

	* module/system/vm/program.scm (program-arguments-alist): Placeholder
	  implementation for RTL programs.
	  (program-arguments-alists): Don't bail if we couldn't get the
	  arities.

2013-10-04  Andy Wingo  <wingo@pobox.com>

	Fix nested contification bugs
	* module/language/cps/contification.scm (contify): Exhaustively replace
	  contified tail continuations, to fix a bug in nested tail-recursive
	  contifications.  Likewise, call lookup-return-cont when searching for
	  common return continuations.

	Fix variable-bound-in?
	* module/language/cps/dfg.scm (variable-bound-in?): Fix to look up
	  correct variable.

	Fix verify-cps
	* module/language/cps/verify.scm (verify-cps): Fix visiting functions.

	Disassembling RTL prints source information.
	* module/system/vm/disassembler.scm (disassemble-buffer): Print source
	  information.

	add contification test
	* test-suite/tests/rtl-compilation.test ("contification"): Add
	  contification test where non-recursive call is not in tail position
	  relative to the letrec.

	Contify functions in the scope of their continuation.
	* module/language/cps/contification.scm (contify): Fix to contify
	  functions in the scope of their continuation.

2013-10-04  Andy Wingo  <wingo@pobox.com>

	dfg: variable-free-in?, add variable-bound-in?
	* module/language/cps/dfg.scm (variable-free-in?): Rename from
	  variable-used-in?, to match CWCC language.
	  (variable-bound-in?): New interface.

	* module/language/cps/contification.scm (contify): Adapt caller.  Add
	  more comments.

2013-10-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	MIPS: Build and pass all test cases on mips64.
		* include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
		lib/jit_mips-sz.c, lib/jit_mips.c, size: Build and
		pass all test cases on Irix big endian mips using
		the 64 bit abi.

2013-10-04  Mark H Weaver  <mhw@netris.org>

	Fix edge case in 'ash'.
	* libguile/numbers.c (left_shift_exact_integer): Fix edge case where
	  N is -1 and count is SCM_I_FIXNUM_BIT-1 to return the most negative
	  fixnum.  Previously this result was returned as a bignum.

	* test-suite/tests/numbers.test (ash): Add tests.

2013-10-04  Mark H Weaver  <mhw@netris.org>

	Revert "Fix edge case in 'ash'."
	This reverts commit 8df68898b9f6ba15171244f1f3549688f13d605f.

2013-10-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct source of the self test case and a missed check failure.

2013-10-03  Andy Wingo  <wingo@pobox.com>

	anonymous RTl functions print with source info
	* module/system/vm/debug.scm (find-program-sources): If there is no
	  source location before the low-pc of the procedure we're grovelling
	  for, we were skipping the source loc info.  Fix that.

	* module/system/vm/program.scm (write-program): Get source info for
	  anonymous RTL functions.
	  (program-sources, program-sources-pre-retire): Provide program
	  counters relative to the beginning of the procedure.

2013-10-03  Andy Wingo  <wingo@pobox.com>

	program-source / program-sources works with RTL programs
	* libguile/programs.c (scm_program_sources): Define as %program-sources,
	  and let Scheme export the program-sources proper.
	  (scm_program_source): Call out to Scheme.

	* module/system/vm/program.scm: Convert to use match instead of pmatch.
	  Adapt existing callers.
	  (program-sources, program-source): New Scheme implementations of these
	  functions.
	  (program-sources-pre-retire): Add RTL program case.

2013-10-03  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/deprecated.h
		libguile/programs.c
		libguile/programs.h

	Deprecate scm_c_program_source, as it has no internal users.
	* libguile/programs.c:
	* libguile/programs.h:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_c_program_source): Deprecate.

2013-10-03  Mark H Weaver  <mhw@netris.org>

	Fix edge case in 'ash'.
	* libguile/numbers.c (scm_ash): Fix (ash -1 SCM_I_FIXNUM_BIT-1) to
	  return a fixnum instead of a bignum.

	* test-suite/tests/numbers.test (ash): Add tests.

2013-10-03  Andy Wingo  <wingo@pobox.com>

	Add source location test
	* test-suite/tests/dwarf.test: New test, testing that source location
	  information survives the round-trip through the compiler, back out to
	  the (system vm debug) interfaces.

	Add (system vm debug) interface to source location information
	* module/system/vm/debug.scm (<source>, source-pre-pc)
	  (source-post-pc, source-file, source-line, source-column)
	  (source-line-for-user): New data type for source location
	  information.
	  (find-source-for-addr, find-program-sources): New procedures to get
	  source location information for a particular address.

	Add interface to read .debug_line data
	* module/system/vm/dwarf.scm (die-line-prog):
	  (line-prog-advance, line-prog-scan-to-pc): New public interfaces,
	  allowing clients to interpret the "statement programs" from
	  .debug_line DWARF sections.
	  (<meta>, elf->dwarf-context): Record the bounds of the .debug_line
	  section.

	Serialize source positions into .debug_line
	* module/system/vm/assembler.scm (link-debug): Generate a correct DWARF2
	  line program.  Tests come next.

2013-10-03  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct wrong dates in ChangeLog

	MIPS: Correct abi detection.
		* include/lightning/jit_mips.h: Add proper mips abi detection.

2013-10-01  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct misplaced check for already visited blocks

2013-09-30  Andy Wingo  <wingo@pobox.com>

	Emit a placeholder .debug_line section.
	* module/system/vm/assembler.scm (link-debug): Emit a .debug_line
	  section also.
	  (link-objects): Expect .debug_line.

2013-09-30  Andy Wingo  <wingo@pobox.com>

	Add new "source" macro instruction; compile-rtl emits it.
	* module/system/vm/assembler.scm (<asm>): Add "sources" field.
	  (make-assembler): Adapt to make-asm change.
	  (source): New macro assembler.

	* module/language/cps/compile-rtl.scm (emit-rtl-sequence):
	  (compile-fun): Emit source instructions as appropriate.

2013-09-30  Mark H Weaver  <mhw@netris.org>

	Fix minor mistakes in documentation.
	Fixes <http://bugs.gnu.org/15487>.
	Reported by Josep Portella Florit <jpf@primfilat.com>.

	* doc/ref/api-i18n.texi (i18n Introduction, Text Collation,
	  Internationalization, Internationalization):
	  LC_MESSAGE --> LC_MESSAGES.

	* doc/ref/api-procedures.texi (Compiled Procedures):
	  program-lambda-alist --> program-lambda-list.

	* THANKS: Fix alignment of Josep Portella Florit.

2013-09-30  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	X86: %r12 may be used as an index register.
		* lib/jit_x86-cpu.c: Correct not properly tested case of using
		%r12 as index register, what was causing an invalid assertion.
		%r12 is mapped to the "extra" JIT_R3 register, and test cases
		only test "standard" lightning registers.

2013-09-28  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	IA64: Force sync of instructions in get-jit-size build mode.

2013-09-28  Andy Wingo  <wingo@pobox.com>

	DWARF linker: encode strings using the correct form
	* module/system/vm/assembler.scm (link-debug): Encode strings using the
	  strp form.

	Emit minimal DWARF information
	* module/system/vm/assembler.scm (link-debug): New function, creates the
	  necessary DWARF debugging sections.
	  (link-objects): Emit debugging sections.

	add DWARF parser
	* module/Makefile.am:
	* module/system/vm/dwarf.scm: New module, a DWARF parser.

2013-09-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	ARM: Correct build when disassembler is disabled.

2013-09-25  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	IA64: Correct some wrong checks value range checks.
		* lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct some
		off by one range checks (that were only accepting values
		one less than the maximum allowed) and an invalid test
		condition check that was forcing it to always use
		indirect jumps even when reachable with an immediate
		displacement.

2013-09-24  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	GNU lightning 2.0.1 release

2013-09-24  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add code to calculate code buffer size based on devel time information.
		* lib/jit_aarch64-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
		lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
		lib/jit_s390x-sz.c, lib/jit_size.c, lib/jit_sparc-sz.c,
		lib/jit_x86-sz.c: New files implementing static tables
		with longest known instructions length generated to match
		a lightning instruction. These tables should make it easier
		to make it very unlikely to ever miscalculate, or by too
		much, the size of a code buffer.

		* lib/jit_size.c: New file that aids to either collect
		jit code size information, or use the information depending
		on build options.

		* size.c: New helper file that parses input for, and create
		an initial jit_$arch-sz.c file, that needs some minor edit
		for arches with multiple configurations.

		* configure.ac, Makefile.am: Add the new, devel mode only
		--enable-devel-get-jit-size configure option, that sets
		compile time flags to collect jit code size information,
		that will be used as input for the "noinst size program".

		* lib/jit_aarch64.c, lib/jit_arm.c, lib/jit_disasm.c,
		lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_memory.c,
		lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c,
		lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c: Minor
		changes for the --enable-devel-get-jit-size build mode,
		as well as the "production build mode" with jit code
		size information.

2013-09-14  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add the new jit_pointer_p predicate interface.
		* include/lightning.h, lib/lightning.c: Add the new
		jit_pointer_p interface, that returns a boolean value
		telling if the pointer argument is inside the jit
		code buffer. This is useful to avoid the need to add
		extra labels and calls to jit_address to figure bounds
		of code buffer, and still keep internal data private.

2013-09-13  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Make jit_get_note a public interface.
		* include/lightning.h, include/lightning/jit_private.h,
		lib/jit_note.c: Change the code argument of jit_get_note
		to a jit_pointer_t and make jit_get_note a public interface.
		It was intended so since start, as a way to map an offset
		in the code to a function name, file name and line number
		mapping.

2013-09-13  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		module/srfi/srfi-9.scm
		module/web/server.scm

2013-09-13  Mark H Weaver  <mhw@netris.org>

	Fix truncated documentation for 'put-char'.
	Fixes <http://bugs.gnu.org/15152>.
	Reported by Josep Portella Florit <jpf@primfilat.com>.

	* doc/ref/api-io.texi (R6RS Textual Output): Fix truncated docs
	  for 'put-char'.

	* THANKS: Add Josep Portella Florit to fixes section.

2013-09-13  Mark H Weaver  <mhw@netris.org>

	Web: Use functional setters in extend-request and extend-response.
	* module/web/client.scm (extend-request):
	* module/web/server.scm (extend-response): Reimplement using
	  functional setters.

2013-09-13  Mark H Weaver  <mhw@netris.org>

	Web client+server: Add Content-Length header for empty bodies.
	* module/web/client.scm (sanitize-request): Add a Content-Length
	  header if a body if given, even if the body is empty.

	* module/web/server.scm (sanitize-response): Add a Content-Length
	  header if a body if given, even if the body is empty.

2013-09-13  Mark H Weaver  <mhw@netris.org>

	Adapt srfi-9.test to error reporting improvements; update copyright dates.
	* module/srfi/srfi-9.scm: Add 2013 copyright date.

	* test-suite/tests/srfi-9.test: Adapt to recent error reporting
	  improvements to procedures defined by 'define-tagged-inlinable'.

2013-09-13  Mark H Weaver  <mhw@netris.org>

	Improve error reporting of procedures defined by define-inlinable.
	* module/ice-9/boot-9.scm (define-inlinable): Improve error reporting
	  when procedures defined using 'define-inlinable' are applied to the
	  wrong number of arguments.

	* module/srfi/srfi-9.scm (define-tagged-inlinable): Improve error
	  reporting when procedures defined using 'define-tagged-inlinable' are
	  applied to the wrong number of arguments.

2013-09-12  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct wrong example and mt unsafe code in the arm backend.
		* doc/body.texi: Correct reversed arguments in example of
		usage in a (possibly) multi threaded, multiple jit_state_t
		environments.

		* include/lightning/jit_arm.h, include/lightning/jit_private.h,
		lib/jit_arm-cpu.c, lib/jit_arm.c: Make a previously, non
		documented, global state private to the related jit_state_t
		generating code.

2013-09-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add the jit_callee_save_p interface and extra register definitions.
		* check/self.c, check/self.ok: New files implementing simple
		consistency check assertions. At first validating some macros
		that use values from different sources agree.

		* check/Makefile.am: Update for the new test case.

		* include/lightning.h,  lib/lightning.c: Add the new
		jit_callee_save_p() call, that is intended to be used when
		writing complex code using lightning, so that one does not
		need to verify what backend is being used, or have access to
		private data, to query if a register is callee save or not;
		on several backends the scratch registers are actually callee
		save.

		* include/lightning/jit_aarch64.h, include/lightning/jit_arm.h,
		include/lightning/jit_hppa.h, include/lightning/jit_mips.h,
		include/lightning/jit_ppc.h, include/lightning/jit_sparc.h,
		include/lightning/jit_x86.h: Add an explicit definition for
		JIT_R3-JIT_Rn, JIT_V3-JIT_Vn and JIT_F6-JIT_Fn when applicable.
		This allows one to write code based on "#if defined(JIT_XN)"
		and therefore, not need to check what is the current backend
		or have access to private data structures. This is particularly
		useful when writing virtual machines with several specialized,
		global registers.

		* lib/jit_ia64.c: Properly flag the callee save general
		purpose registers as such, so that jit_callee_save_p() works
		as intended.

2013-09-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Use the logic to workaround float NaN and Inf Hercules bug conditional
		* check/lightning.c, configure.ac: Conditionally use the
		code written to workaround a bug in the Hercules emulator,
		as isnan and isinf are not available at least on HP-UX ia64.
	 enter the commit message for your changes. Lines starting

	S390X: Correct values of float registers saved on stack.
		* lib/jit_s390x-cpu.c: Spill/reload correct callee save
		float registers.

	HPPA: Correct bogus logic when calling function pointers.
		* lib/jit_hppa-cpu.c: Correct code to call a function stored
		in a register or a patched function address.

	IA64: Correct code to save/restore r2 used as lightning JIT_FP.
		* lib/jit_ia64-cpu.c: Correct incorrect logic when restoring
		the value of the "r2" callee save register.

2013-09-10  Mark H Weaver  <mhw@netris.org>

	THANKS Alexandru Cojocaru
	* THANKS: Add Alexandru Cojocaru to fixes section.

	web client: HTTP methods are symbols, not strings.
	* module/web/client.scm (request, http-get, http-head, http-post,
	  http-put, http-delete, http-trace, http-options): HTTP methods are
	  symbols.

2013-09-10  Alexandru Cojocaru  <xojoc@gmx.com>

	Fix extend-request to preserve method and meta.
	* module/web/client.scm (extend-request): Preserve method and meta.

2013-09-10  Mark H Weaver  <mhw@netris.org>

	psyntax: cite the paper that psyntax is based on.
	* module/ice-9/psyntax.scm: cite the paper.

	Minor stylistic improvement to 'and-let*' macro.
	* module/ice-9/and-let-star.scm (%and-let*): Use 'and' instead of
	  'if'.  Suggested by Chris K. Jester-Young <cky944@gmail.com>.

	Rewrite SRFI-2 'and-let*' using syntax-case.
	* module/ice-9/and-let-star.scm (%and-let*): Helper macro.
	  (and-let*): Reimplement using syntax-case.

2013-09-10  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add missing jit_clear_state to documentation sample.

	Add fallback logic instead of error if cannot figure __WORDSIZE.
	This was an issue on FreeBSD 8.x, and the logic used is the same as
	FreeBSD 9.1 stdint.h.

2013-08-31  Andy Wingo  <wingo@pobox.com>

	Micro-optimize char_decimal_value.
	* libguile/numbers.c (char_decimal_value): A wee micro-optimization.

	Faster scm_from_port_stringn
	* libguile/strings.c (scm_from_port_stringn): Always inline to
	  scm_from_utf8_string if the byte sequence is valid utf-8.

	unread-char: inline conversion from codepoint to bytes
	* libguile/ports.c (scm_ungetc_unlocked): Inline the conversion from
	  codepoint to bytes for UTF-8 and latin-1 ports.  Speeds up a
	  numbers-reading test case by 100% (!).

2013-08-31  Andy Wingo  <wingo@pobox.com>

	Add contification pass
	* module/Makefile.am:
	* module/language/cps/contification.scm: New pass.

	* module/language/cps/compile-rtl.scm (optimize): Wire it into the
	  compiler.

2013-08-31  Andy Wingo  <wingo@pobox.com>

	Add CPS -> RTL compiler
	* module/Makefile.am:
	* module/language/cps/compile-rtl.scm:
	* module/language/cps/dfg.scm:
	* module/language/cps/slot-allocation.scm: New modules.

	* module/language/cps/spec.scm: Register the compiler.

	* test-suite/Makefile.am:
	* test-suite/tests/rtl-compilation.test: Add tests.

2013-08-31  Andy Wingo  <wingo@pobox.com>

	Add pass to reify primcalls without corresponding VM ops
	* module/Makefile.am:
	* module/language/cps/reify-primitives.scm: New pass.

	Add arity-adapting module
	* module/Makefile.am:
	* module/language/cps/arities.scm: New module.  Adapts call and return
	  arities, especially for primcalls.

	Add CPS primitives info module
	* module/Makefile.am:
	* module/language/cps/primitives.scm: New file.

	RTL language
	 * module/Makefile.am
	 * module/language/rtl.scm:
	 * module/language/rtl/spec.scm: Add a stub RTL language.

	Add closure conversion
	* module/Makefile.am
	* module/language/cps/closure-conversion.scm: New module, implementing a
	  closure conversion pass.

2013-08-31  Andy Wingo  <wingo@pobox.com>

	(compile foo #:to 'cps)
	* module/language/tree-il/compile-cps.scm: New module implementing CPS
	  conversion of Tree-IL.

	* module/Makefile.am:
	* module/language/tree-il/spec.scm:
	* module/language/cps/spec.scm: Integrate CPS in the build and language
	  system.

2013-08-31  Andy Wingo  <wingo@pobox.com>

	Add CPS language
	* module/Makefile.am:
	* module/language/cps.scm:
	* module/language/cps/verify.scm: Add CPS language.

	* .dir-locals.el: Add indentation rules for some CPS forms.

2013-08-29  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct wrong test and update of arm thumb offset information.
		* lib/jit_arm-cpu.c, lib/jit_arm.c: Correct wrong test and update
		of the thumb offset information, when checking if needing to
		patch a jump from arm to thumb mode. The problem would happen when
		remapping the code buffer, and the new address being lower than
		the previous one.

2013-08-29  Andy Wingo  <wingo@pobox.com>

	,xx for RTL images
	* module/scripts/disassemble.scm (disassemble):
	* module/system/vm/disassembler.scm (disassemble-file): Factor
	  disassemble-file out.

	* module/system/repl/command.scm (disassemble-file): Map ,xx to
	  disassemble RTL images.

2013-08-29  Andy Wingo  <wingo@pobox.com>

	add ability to disassemble ELF images
	* module/scripts/disassemble.scm (disassemble): Update to work with
	  RTl (and only RTL, as that's the future).

	* module/system/vm/debug.scm (for-each-elf-symbol): New public
	  interface.
	  (debug-context-from-image): New helper.
	  (find-debug-context): Use the helper.

	* module/system/vm/disassembler.scm (disassemble-image): New public
	  interface.

2013-08-29  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Avoid possible problem if built with gcc 4.8 or newer.
	The problem happens due to undefined behavior in post increment when
	accessing data through an union and the data being modified in the
	expression.

2013-08-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	test for zlib in configure.ac

2013-08-26  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct build and check on NetBSD amd64.
		* configure.ac: Extend FreeBSD test to also handle NetBSD.

		* lib/jit_x86-cpu.c: Correct wrongly defined offset type of
		ldxi_ui. Problem detected when building on NetBSD.

		* lib/lightning.c: Adjust code to handle NetBSD mremap,
		where arguments do not match Linux mremap.

2013-08-26  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct build and make check on gcc111 - AIX 7.1.
		lib/jit_ppc.c: Correct C sequence point problem miscalculating
		the actual function address in a function descriptor. Problem
		happens with gcc 4.8.1 at least.

	Correct build on FreeBSD/amd64

2013-08-24  Andy Wingo  <wingo@pobox.com>

	Export the assembler procedures
	* module/system/vm/assembler.scm (define-assembler):
	  (define-macro-assembler): Export the assemblers.

	rtl vm: box-set! binds no values
	* libguile/vm-engine.c (box-set!): Remove the OP_DST flag.

	RA == MVRA in disassembler
	* module/system/vm/disassembler.scm: Modify call disassembler to assume
	  RA == MVRA.

	assembler: give proper permissions to .data section
	* module/system/vm/assembler.scm (link-data): Give stringbufs the
	  "shared" flag already, so we don't attempt to set it at runtime.  Give
	  .data sections the SHF_WRITE flag.

2013-08-24  Andy Wingo  <wingo@pobox.com>

	compile-file adds #:to-disk? #t to opts
	* module/system/base/compile.scm (compile-file): Pass #:to-disk? as an
	  option to indicate that the result will be being loaded from disk.
	  Perhaps a linker might want to page-align in that case.

	* module/language/elisp/compile-tree-il.scm (process-options!): Accept
	  and ignore the #:to-file compiler option.

2013-08-24  Mark H Weaver  <mhw@netris.org>

	RTL: 'return-values' instruction assumes 'reset-frame' has been called.
	* libguile/vm-engine.c (return-values): Remove NVALUES operand.
	  Don't reset the frame.

	* test-suite/tests/rtl.test ("cached-toplevel-set!"): Adapt to the fact
	  that 'return-values' has no operand now, and that 'reset-frame' must
	  be done first.

2013-08-24  Mark H Weaver  <mhw@netris.org>

	RTL VM: Rename 'apply' instruction to 'tail-apply'.
	* libguile/vm-engine.c (apply, tail-apply): apply -> tail-apply.
	  (RETURN_VALUE_LIST): goto op_apply -> goto op_tail_apply.

	* libguile/vm.c (rtl_apply_code): scm_rtl_op_apply ->
	  scm_rtl_op_tail_apply.

2013-08-24  Mark H Weaver  <mhw@netris.org>

	RTL VM: fix multiple value returns.
	* libguile/vm-engine.c (halt): Fix off-by-one error in retrieving
	  multiple values from the frame.

	Convert branchable primitives into binary operations only.
	* module/language/tree-il/primitives.scm (maybe-simplify-to-eq): Wrap
	  within another lambda, binding the primitive name.  If there are less
	  than two arguments, expand to constant #t.  If there are more than two
	  arguments, convert into a conjunction of binary applications.
	  (expand-chained-comparisons): New procedure.
	  (*primitive-expand-table*): Add entries for (< <= = >= > eq?).

	Merge remote-tracking branch 'origin/stable-2.0'

2013-08-23  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	GNU lightning 2.0.0 release

2013-08-23  Mark H Weaver  <mhw@netris.org>

	Fix 'define-public' from (ice-9 curried-definitions).
	* module/ice-9/curried-definitions.scm (cdefine, cdefine*): Simplify,
	  and improve error reporting by making the patterns more strict.
	  (define-public): Fix bug in generated 'export' form.

2013-08-20  Mark H Weaver  <mhw@netris.org>

	Improve error checking in 'define-public' and 'module-add!'.
	* module/ice-9/boot-9.scm (module-add!): Check that the symbol argument
	  is actually a symbol.
	  (define-public): Expand into 'define' in such a way that curried
	  definitions will immediately fail.

2013-08-19  Ian Price  <ianprice90@googlemail.com>

	doc: `get-string-all' takes only one argument.
	* doc/ref/api-io.texi (R6RS Textual Input): Remove `count' argument.

	`write-request-line' always prints a path component.
	* module/web/http.scm (write-request-line): Always write "/" when path
	  is empty, regardless of query.
	* test-suite/tests/web-http.test ("write-request-line"): Add test.

2013-08-17  Mark H Weaver  <mhw@netris.org>

	In bytevector->uint-list et al, check that SIZE divides the bv length.
	Fixes <http://bugs.gnu.org/15100>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* libguile/bytevectors.c (INTEGERS_TO_LIST): Enforce the R6RS
	  requirement that SIZE divides the bytevector length.

	* test-suite/tests/bytevectors.test: Add test.  Remove tests that
	  assumes that this "divides" check is not enforced.

2013-08-17  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

2013-08-17  Mark H Weaver  <mhw@netris.org>

	Improved error checking in bytevector->uint-list and bytevector->sint-list.
	Partially fixes <http://bugs.gnu.org/15100>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* libguile/bytevectors.c (INTEGERS_TO_LIST): Make sure SIZE isn't 0.
	  Allow SIZE to be greater than the bytevector length, for consistency
	  with allowing extra bytes at the end when the bytevector length is
	  non-zero.  Use scm_from_size_t instead of scm_from_uint.

	* test-suite/tests/bytevectors.test: Add tests.  Remove a test that
	  checks for an exception when SIZE is greater than the bytevector
	  length.

2013-08-15  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

2013-08-15  Mark H Weaver  <mhw@netris.org>

	Improve run-time error reporting in (ice-9 match).
	* module/Makefile.am: match.go depends on match.upstream.scm.

	* module/ice-9/match.scm (error): Accept any number of arguments.

	* module/ice-9/match.upstream.scm (match-next): Call 'error' in non-tail
	  context, and include the value that failed to match in the call.

2013-08-14  Mark H Weaver  <mhw@netris.org>

	Adapt peval.test to recent associativity fixes of numeric ops.
	* test-suite/tests/peval.test ("partial evaluation"): Adapt tests to the
	  fact that arithmetic operators are now expanded into binary ops with
	  left-to-right associativity.

	Manual: clarify that 'append!' and 'reverse!' might not mutate.
	* doc/ref/api-compound.texi (Append/Reverse): Clarify that 'append!' and
	  'reverse!' are not required to modify anything.

	Manual: don't promise that 'append!' will modify the existing lists.
	* doc/ref/api-compound.texi (Append/Reverse): Say that 'append!' *may*
	  modify the given lists, but don't promise that it will.

2013-08-13  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

	Common numeric operations are left-to-right associative.
	* module/language/tree-il/primitives.scm (define-primitive-expander):
	  Use 'match-lambda*' instead of 'case-lambda' for pattern matching.
	  (*primitive-expand-table*): In primitive expanders for '+', '*', '-',
	  '/', 'logior', and 'logand', assume conventional left-to-right
	  associativity.

	Numerical comparisons are not negatable.
	* module/language/tree-il/primitives.scm (*negatable-primitives*):
	  Remove (< <= > >=) from the list of negatable primitives.

2013-08-12  Mark H Weaver  <mhw@netris.org>

	RTL VM: Fix SCM_PACK_RTL_* macros.
	* libguile/instructions.h (SCM_PACK_RTL_8_8_8): Fix typo.
	  (SCM_PACK_RTL_16_8): Fix erroneous shift offset.

	Merge remote-tracking branch 'origin/stable-2.0'

	Broken Turkish UTF-8 locale still unresolved in FreeBSD 9.1.
	* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved):
	  Disable tests of Turkish UTF-8 locale in FreeBSD 9.1.

2013-08-11  Mark H Weaver  <mhw@netris.org>

	Adapt ecmascript compiler to tree-il prompt changes, again.
	* module/language/ecmascript/compile-tree-il.scm (with-return-prompt):
	  The body of an escape-only prompt is no longer a thunk.  Adapt.

2013-08-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct license to properly advertise LGPLv3 and not GPLv3.

	Correct off by one bug on s390x subi.
		* lib/jit_s390x-cpu.c: Correct code checking if immediate
		fits instruction, but using the negated value.

2013-08-11  Andy Wingo  <wingo@pobox.com>

	Various RTL VM and calling convention tweaks
	* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): Allow for
	  five-word instructions, and for new instruction word types.

	* libguile/vm-engine.c (RETURN_ONE_VALUE): Instead of returning the
	  value in the fixed part of the call frame, return it in the same place
	  multiple-value returns go: from slot 1.
	  (BR_ARITHMETIC): Allow arithmetic tests to be negated.
	  (rtl_vm_engine): Change calling convention to use the same location
	  for single and multiple-value returns.  Renumber all instructions.

	  (halt, halt/values): Fold into a single instruction (halt).
	  (call): Take the location of the procedure instead of the location of
	  the call frame.  Also take the number of args, and reset the sp before
	  jumping to the procedure, so as to indicate the number of arguments.
	  (call/values): Remove, as the new calling convention has RA == MVRA.
	  (tail-call): Require the procedure to be shuffled down already, and
	  take "nlocals" as an arg instead of "nargs".
	  (receive, receive-values): New instructions, for receiving returned
	  values from calls.
	  (return-values): Rename from return/values.  Remove "values".
	  (alloc-frame): Rename from reserve-locals.
	  (reset-frame): New instruction.
	  (drop-locals): Remove.
	  (br-if-=, br-if-<, br-if-<=): Allow these instructions to be
	  negatable.
	  (br-if->, br-if->=): Remove.  Probably a bad idea, given NaN.
	  (box-ref): Don't bother trying to do a reverse lookup -- the
	  toplevel-box, module-box, and resolve instructions should handle
	  that.
	  (resolve): Add arg to check that the variable is bound.
	  (toplevel-box, module-box): New instructions, replacing toplevel-ref,
	  toplevel-set, module-ref, and module-set.

	* libguile/vm.c (rtl_boot_continuation_code, rtl_values_code): Adapt to
	  instruction set changes.

	* module/Makefile.am: Make the assembler and disassembler dependent on
	  vm-operations.h.

	* module/system/vm/assembler.scm:
	* module/system/vm/disassembler.scm: Adapt to instruction changes and
	  new instruction word kinds.

	* test-suite/tests/rtl.test: Adapt to instruction set changes.

2013-08-11  Andy Wingo  <wingo@pobox.com>

	Inline escape-only prompt bodies in the Tree-IL
	* module/language/scheme/decompile-tree-il.scm (do-decompile):
	* module/language/tree-il/analyze.scm (analyze-lexicals):
	* module/language/tree-il/canonicalize.scm (canonicalize):
	* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
	* module/language/tree-il/cse.scm (cse):
	* module/language/tree-il/peval.scm (peval):
	* test-suite/tests/peval.test ("partial evaluation"):  Partially revert
	  178a40928, so that escape-only prompts explicitly inline their bodies.

	remove peval abort-in-tail-position optimization
	* module/language/tree-il/peval.scm (peval): Remove abort optimization;
	  the CPS compiler will do much better here, and it is complicating
	  things in the meantime.

2013-08-10  Mark H Weaver  <mhw@netris.org>

	Fix inappropriate uses of scm_syserror in numbers.c.
	* libguile/numbers.c (mem2ureal, left_shift_exact_integer,
	  floor_right_shift_exact_integer, round_right_shift_exact_integer):
	  Use 'assert' instead of 'scm_syserror' to indicate a case that should
	  never happen.

2013-08-10  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Cosmetic removal of white spaces in end of lines.

2013-08-10  Mark H Weaver  <mhw@netris.org>

	dereference-pointer: check for null pointer.
	* libguile/foreign.c (scm_dereference_pointer): Check for attempts to
	  dereference a null pointer.

	* test-suite/tests/foreign.test ("null pointer"): Add test.

2013-08-09  Mark H Weaver  <mhw@netris.org>

	Fix numerator and denominator handling of signed zeroes and infinities.
	* libguile/numbers.c (scm_numerator, scm_denominator): Handle signed
	  zeroes and infinities in accordance with the corresponding R6RS flonum
	  procedures.

	* module/rnrs/arithmetic/flonums.scm (flnumerator, fldenominator):
	  Remove special handling of infinities.

	* test-suite/tests/numbers.test (numerator, denominator): Add tests.
	  Convert existing tests to use 'pass-if-equal'.

	* test-suite/tests/r6rs-arithmetic-flonums.test (flnumerator): Fix
	  broken test of (flnumerator -0.0).

2013-08-08  Mark H Weaver  <mhw@netris.org>

	Eliminate use of deprecated 'SCM_WTA_DISPATCH_2' in numbers.c.
	* libguile/numbers.c (scm_gcd): Use 'scm_wta_dispatch_2' not
	  'SCM_WTA_DISPATCH_2'.

2013-08-08  Mark H Weaver  <mhw@netris.org>

	Fix --without-threads and SCM_DEBUG_TYPING_STRICTNESS==2 builds.
	* libguile/hashtab.c (scm_hashv_ref, scm_hashv_set_x,
	  scm_hashv_remove_x, scm_hash_ref, scm_hash_set_x, scm_hash_remove_x):
	* libguile/strports.c (scm_mkstrport):
	* libguile/weak-vector.c (weak_vector_ref): Add missing SCM_UNPACK.

	* libguile/ports.c (lock_port, unlock_port): Cast MUTEX to the
	  expected type.

2013-08-07  Mark H Weaver  <mhw@netris.org>

	Decompiler: fix handling of empty 'case-lambda' expressions.
	* module/language/scheme/decompile-tree-il.scm (choose-output-names):
	  A <lambda> with no <lambda-case> decompiles into a 'case-lambda'
	  primitive.  Ensure that 'case-lambda' is not shadowed by a lexical.

	Adapt ecmascript compiler to recent tree-il changes for prompts.
	* module/language/ecmascript/compile-tree-il.scm (with-return-prompt):
	  Adapt to the changes in 178a40928ab5221f6ce57c5af1067abe30a342b3.
	  Prompt tree-il nodes now contain an explicit 'escape-only?' flag, and
	  the body and handler are now both lambdas.

2013-08-07  Mark H Weaver  <mhw@netris.org>

	String ports use UTF-8; ignore %default-port-encoding.
	* libguile/strports.c (scm_mkstrport): Use UTF-8; ignore
	  %default-port-encoding.  Rename 'str_len' and 'c_pos' to
	  'num_bytes' and 'c_byte_pos'.  Interpret 'pos' argument
	  as a character index instead of a byte index.

	* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-6 to the
	  list of core features.

	* module/srfi/srfi-6.scm (open-input-string, open-output-string): Simply
	  re-export these, since the core versions are now compliant.

	* doc/ref/api-io.texi (String Ports): Remove text that describes
	  non-compliant behavior of string ports with regard to encoding.

	* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-6 to the list of
	  core features.
	  (SRFI-6): Remove text that mentions non-compliant behavior of
	  core string ports.

	* module/ice-9/format.scm (format):
	* module/ice-9/pretty-print.scm (truncated-print):
	* module/rnrs/io/ports.scm (open-string-input-port,
	  open-string-output-port):
	* test-suite/test-suite/lib.scm (format-test-name):
	* test-suite/tests/chars.test ("combining accent is pretty-printed",
	  "combining X is pretty-printed"):
	* test-suite/tests/ecmascript.test (eread, eread/1):
	* test-suite/tests/rdelim.test:
	* test-suite/tests/reader.test (read-string):
	* test-suite/tests/regexp.test:
	* test-suite/tests/srfi-105.test (read-string): Don't set
	  %default-port-encoding before creating string ports.

	* benchmark-suite/benchmarks/ports.bm (%latin1-port): Use
	  'set-port-encoding!' to set the string port encoding.
	  (%utf8/ascii-port, %utf8/wide-port, "rdelim"): Don't set
	  %default-port-encoding before creating string ports.

	* test-suite/tests/r6rs-ports.test ("lookahead-u8 non-ASCII"): Don't set
	  %default-port-encoding before creating string ports.
	  ("put-bytevector with UTF-16 string port", "put-bytevector with
	  wrong-encoding string port"): Use 'set-port-encoding!' to set the
	  string port encoding.

	* test-suite/tests/print.test (tprint): Use 'set-port-encoding!' to set
	  the string port encoding.
	  ("truncated-print"): Use 'pass-if-equal'.

	* test-suite/tests/ports.test ("encoding failure leads to exception",
	  "%default-port-encoding is honored", "peek-char [latin-1]", "peek-char
	  [utf-8]", "peek-char [utf-16]"): Remove tests.
	  ("%default-port-encoding is ignored", "peek-char"): Add tests.
	  ("suitable encoding [latin-1]", "suitable encoding [latin-3]",
	  "wrong encoding, error", "wrong encoding, substitute",
	  "wrong encoding, escape"): Use 'set-port-encoding!' to set the
	  string port encoding.
	  ("%default-port-encoding, wrong encoding"): Rewrite to use
	  a file port instead of a string port.

2013-08-07  David Kastrup  <dak@gnu.org>

	Fix display of symbols containing backslashes.
	Fixes <http://bugs.gnu.org/15033>.

	* libguile/print.c (print_extended_symbol): Double print backslashes.

2013-08-06  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/numbers.c
		libguile/vm-i-scheme.c

	Add files from 'copysign' and 'isfinite' Gnulib modules.
	* lib/copysign.c:
	* lib/isfinite.c:
	* lib/isnanf-nolibm.h:
	* lib/isnanl-nolibm.h:
	* lib/signbitd.c:
	* lib/signbitf.c:
	* lib/signbitl.c:
	* m4/copysign.m4:
	* m4/isfinite.m4:
	* m4/signbit.m4: New files.

	RTL VM: Avoid untagging inums in 'logand' and 'logior'.
	* libguile/vm-engine.c (logand, logior): Avoid untagging.

	RTL VM: Avoid signed overflows in 'add1' and 'sub1'.
	* libguile/vm-engine.c (INUM_MIN, INUM_MAX): Redefine without making
	  assumptions about the representation.
	  (INUM_STEP): New macro.
	  (add1, sub1): Avoid signed overflows, and use INUM_STEP.

	RTL VM: ash: Use SCM_SRS and fix large right shifts in fast path.
	* libguile/vm-engine.c (ash): Use SCM_SRS, and handle large right
	  shifts properly.

	VM: ash: Use SCM_SRS and handle large right shift in fast path.
	* libguile/vm-i-scheme.c (ash): Use SCM_SRS.  Handle inum right shift by
	  more than SCM_I_FIXNUM_BIT-1 bits in fast path.

	Use Gnulib's 'isfinite' in numbers.c.
	* libguile/numbers.c (DOUBLE_IS_FINITE, DOUBLE_IS_POSITIVE_INFINITY,
	  DOUBLE_IS_NEGATIVE_INFINITY): Remove.
	  (scm_odd_p, scm_even_p, scm_finite_p, icmplx2str, scm_rational_p,
	  scm_inexact_to_exact): Use 'isfinite' instead of 'DOUBLE_IS_FINITE'.

	Use Gnulib's 'copysign' in numbers.c.
	* libguile/numbers.c (double_is_non_negative_zero): Remove.
	  (idbl2str, scm_max, scm_min, scm_angle, log_of_shifted_double,
	  scm_log10): Use 'copysign' to check signs of zeroes,
	  instead of 'double_is_non_negative_zero'.

	Import 'copysign' and 'isfinite' modules from Gnulib.
	* lib/Makefile.am:
	* m4/gnulib-cache.m4:
	* m4/gnulib-comp.m4: Add 'copysign' and 'isfinite' Gnulib modules.

2013-08-05  Mark H Weaver  <mhw@netris.org>

	VM: ASM_ADD and ASM_SUB for x86: clobber _CX not "rcx".
	* libguile/vm-i-scheme.c (ASM_ADD, ASM_SUB): Clobber _CX not "rcx".

	VM: Define ASM_MUL on ARM only if SMULL instruction is supported.
	* libguile/vm-i-scheme.c (ASM_MUL): Define only if the target
	  architecture is known to implement the SMULL instruction.

2013-08-04  Mark H Weaver  <mhw@netris.org>

	VM: Implement ASM_ADD, ASM_SUB, and ASM_MUL for ARM processors.
	* libguile/vm-i-scheme.c (ASM_ADD, ASM_SUB, ASM_MUL): Implement for ARM.

2013-08-03  Mark H Weaver  <mhw@netris.org>

	VM: Avoid untagging inums in 'logand' and 'logior'.
	* libguile/vm-i-scheme.c (logand, logior): Avoid untagging.

	VM: Add ASM_MUL for x86.
	* libguile/vm-i-scheme.c (ASM_MUL): New macro.
	  (mul): Use ASM_MUL if available.

	VM: Support 32-bit x86 in ASM_ADD and ASM_SUB.
	* libguile/vm-i-scheme.c (_CX): New macro.
	  (ASM_ADD, ASM_SUB): Replace references to "rcx" with _CX.

	VM: Add "cc" to the clobber list of ASM_ADD and ASM_SUB.
	* libguile/vm-i-scheme.c (ASM_ADD, ASM_SUB): Add "cc" to the clobber
	  list.  Suggested by Göran Weinholt <goran@weinholt.se>.

	VM: Avoid overflow in ASM_ADD when the result is most-positive-fixnum.
	* libguile/vm-i-scheme.c (ASM_ADD): Remove the tag from one of the
	  operands before adding, to avoid overflow when the result is the most
	  positive fixnum.

	VM: Avoid signed overflows in 'add1' and 'sub1'.
	* libguile/vm-i-scheme.c (INUM_STEP): New macro.
	  (add1, sub1): Avoid signed overflows, and use INUM_STEP.

	VM: Redefine INUM_MIN and INUM_MAX without assumptions.
	* libguile/vm-i-scheme.c (INUM_MIN, INUM_MAX): Redefine to avoid
	  assumptions about the representation of inums.

2013-08-02  Mark H Weaver  <mhw@netris.org>

	Add 'scm_i_from_double' and use it.
	* libguile/numbers.c (scm_i_from_double): New static function.
	  (scm_from_double): Just call 'scm_i_from_double'.
	  (scm_inf, scm_nan, scm_abs, scm_i_inexact_floor_quotient,
	  scm_i_inexact_floor_remainder, scm_i_inexact_floor_divide,
	  scm_i_inexact_ceiling_quotient, scm_i_inexact_ceiling_remainder,
	  scm_i_inexact_ceiling_divide, scm_i_inexact_truncate_quotient,
	  scm_i_inexact_truncate_remainder, scm_i_inexact_truncate_divide,
	  scm_i_inexact_centered_quotient, scm_i_inexact_centered_remainder,
	  scm_i_inexact_centered_divide, scm_i_inexact_round_quotient,
	  scm_i_inexact_round_remainder, scm_i_inexact_round_divide,
	  scm_max, scm_min, scm_sum, scm_difference, scm_product,
	  scm_divide, scm_truncate_number, scm_round_number, scm_floor,
	  scm_ceiling, scm_expt, scm_sin, scm_cos, scm_tan, scm_sinh,
	  scm_cosh, scm_tanh, scm_asin, scm_acos, scm_atan, scm_sys_asinh,
	  scm_sys_acosh, scm_sys_atanh, scm_real_part, scm_imag_part,
	  scm_magnitude, scm_angle, scm_exact_to_inexact, log_of_shifted_double,
	  log_of_fraction, scm_log10, scm_exp, scm_sqrt, scm_init_numbers):
	  Use 'scm_i_from_double' instead of 'scm_from_double'.

2013-07-28  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	New s390x port built on the hercules emulator and fedora 16 image.
		* include/lightning/jit_s390x.h, lib/jit_s390x-cpu.c,
		lib/jit_s390x-fpu.c, lib/jit_s390x.c: New files
		implementing the new s390x port.

		* configure.ac, include/lightning.h,
		include/lightning/Makefile.am,
		include/lightning/jit_private.h,
		lib/Makefile.am, lib/jit_disasm.c, lib/lightning.c:
		Minor adaptation for the new s390x backend.

		* check/float.tst: Update for the s390x result of
		truncating +Inf to integer.

		* check/qalu_mul.tst: Add extra test cases to better test
		high word of signed multiplication as the result is
		adjust from unsigned multiplication on s390x.

2013-07-28  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Do not assume cast of nan or inf double to float always work.
		* check/lightning.c: Do not assume casting a double NaN or
		Inf to float will produce the expected float NaN or Inf.
		This is not true at least under s390x.

	Properly check tests output.
		* check/check.arm.sh, check/check.sh, check/check.swf.sh,
		check/check.x87.sh: Properly check test programs output,
		not just rely on the test program self testing the results
		and not crashing.

	Cosmetic removal of unused macros.
		* lib/jit_aarch64.c: Remove unused macros left from cut&paste
		of jit_arm.c.

2013-07-21  Andy Wingo  <wingo@pobox.com>

	RTL instructions have no rest args
	* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE):
	* module/system/vm/assembler.scm (assembler):
	* module/system/vm/disassembler.scm (disassembler): Remove support for
	  RTL instructions with rest args.

2013-07-21  Andy Wingo  <wingo@pobox.com>

	Use allocate-struct in define-record-type implementations
	* module/ice-9/boot-9.scm (iota): Move up.
	  (make-record-type, define-record-type): Use allocate-struct and
	  struct-set!.

	* module/srfi/srfi-9.scm (%%set-fields, %define-record-type): Use
	  allocate-struct and struct-set!.

	Note that this makes the stack VM slower, but it will make RTL
	compilation faster.

2013-07-21  Andy Wingo  <wingo@pobox.com>

	add allocate-struct primitive and rtl opcode
	* libguile/struct.h:
	* libguile/struct.c (scm_allocate_struct): New interface: allocates a
	  struct.

	* libguile/vm-engine.c (allocate_struct): Instead of make-struct with a
	  rest arg, separate allocation from initialization.

2013-07-21  Andy Wingo  <wingo@pobox.com>

	abort is no longer an op with rest args
	* libguile/vm-engine.c (abort): No longer an op with rest args.

2013-07-21  Andy Wingo  <wingo@pobox.com>

	call is no longer a vararg instruction
	* libguile/vm-engine.c (push_frame, call): Separate out push_frame from
	  call, and expect the caller to arrange the proc and arguments.

	* test-suite/tests/rtl.test ("call"): Update tests.

2013-07-21  Andy Wingo  <wingo@pobox.com>

	RTL: Local 0 is the procedure
	* libguile/vm-engine.c: Change the RTL VM to number the procedure as
	  local 0, and other locals from 1.  In the future we will want the FP
	  to point to local 0 instead of local 1.  In the future also we can
	  elide the procedure for well-known closures (closures in which all
	  references are known call sites).
	  (make_closure, free_set): Instead of taking rest arguments, we add a
	  new free-set! op that initializes closures.
	  (free_ref): Take the closure as an argument.

	* libguile/vm.c (rtl_boot_continuation_code): Remove comments, which
	  were out of date.
	  (rtl_apply_code, rtl_values_code): Update comments.

	* module/system/vm/assembler.scm (intern-constant, emit-init-constants):
	  Adapt to locals numbering change.
	  (begin-kw-arity): For assert-nargs-ee purposes, nreq includes the
	  procedure.

	* module/system/vm/disassembler.scm (code-annotation): Adapt annotation
	  for assert-nargs-ee/locals.

	* test-suite/tests/rtl.test: Adapt tests.

2013-07-21  Andy Wingo  <wingo@pobox.com>

	rtl: propagate OP_DST to scheme
	* libguile/instructions.c (scm_rtl_instruction_list): Add an element to
	  the list to indicate that an instruction outputs to its first
	  argument.

	* module/system/vm/assembler.scm:
	* module/system/vm/disassembler.scm: Adapt.

2013-07-21  Andy Wingo  <wingo@pobox.com>

	free variable debugging access procedures for rtl
	* libguile/programs.c (scm_program_num_free_variables)
	  (scm_program_free_variable_ref, scm_program_free_variable_set_x): Add
	  support for RTL programs.

2013-07-21  Andy Wingo  <wingo@pobox.com>

	fix rtl program arity functions
	* libguile/programs.c (parse_arity): Lookup rtl-program-minimum-arity
	  from (system vm debug).

	* module/system/vm/debug.scm (find-first-arity): Fix the linear search.
	  Whoops!

2013-07-21  Mark H Weaver  <mhw@netris.org>

	Optimize R6RS bitwise operators.
	* module/rnrs/arithmetic/bitwise.scm (bitwise-if, bitwise-length,
	  bitwise-first-bit-set, bitwise-bit-field, bitwise-reverse-bit-field):
	  Replace these with aliases to the identical SRFI-60 operators
	  'bitwise-if', 'integer-length', 'first-set-bit', 'bit-field', and
	  'reverse-bit-field'.

	  (bitwise-copy-bit, bitwise-copy-bit-field, bitwise-rotate-bit-field):
	  Reimplement these based upon the similar SRFI-60 operators 'copy-bit',
	  'copy-bit-field', and 'rotate-bit-field'.

	* test-suite/tests/r6rs-arithmetic-bitwise.test (bitwise-copy-bit): Fix
	  test to conform to the specification, which requires the third
	  argument to be either 0 or 1.

	* test-suite/tests/r6rs-arithmetic-fixnums.test (fxcopy-bit): Fix test
	  to conform to the specification, which requires the third argument to
	  be either 0 or 1.

2013-07-21  Mark H Weaver  <mhw@netris.org>

	Fix incorrect rationalize tests.
	* test-suite/tests/fractions.test (fractions): Fix rationalize tests.

	Fix minor formatting error in 'rationalize'.
	* libguile/numbers.c (scm_rationalize): Fix formatting.

2013-07-21  Mark H Weaver  <mhw@netris.org>

	Rewrite 'rationalize' to fix bugs and improve efficiency.
	Fixes <http://bugs.gnu.org/14905>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* libguile/numbers.c (scm_rationalize): Rewrite.  Previously an
	  incorrect algorithm was used which failed in many cases.

	* test-suite/tests/numbers.test (rationalize): Add tests.

2013-07-18  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

	Modify SCM_UNPACK type check to avoid warnings in clang.
	* libguile/tags.h (SCM_UNPACK): Change (*(SCM*)0=(x)) to
	  (*(volatile SCM *)0=(x)), to avoid null-dereference warnings
	  from clang.  Reported by Shane Celis <shane.celis@gmail.com>.

2013-07-17  Ludovic Courtès  <ludo@gnu.org>

	Fix 'SCM_SYSCALL' to really swallow EINTR.
	* libguile/_scm.h (SCM_SYSCALL): Keep looping upon EINTR.
	  Reported at
	  <http://lists.gnu.org/archive/html/guile-devel/2013-06/msg00050.html>.

	build: Add `gdbinit' to the distribution.
	* Makefile.am (EXTRA_DIST): Add gdbinit.

2013-07-17  Mark H Weaver  <mhw@netris.org>

	Add support for HTTP proxies.
	* module/web/http.scm (http-proxy-port?, set-http-proxy-port?!): New
	  exported procedures.
	  (write-request-line): If we're using an http proxy, write an
	  absolute-URI in the request line.

	* module/web/client.scm: Import (web http).
	  (current-http-proxy): New exported parameter.
	  (open-socket-for-uri): If 'current-http-proxy' is not false,
	  connect to the proxy instead of the URI host, and use
	  'set-http-proxy-port?!' to make note of that fact.

	* doc/ref/web.texi (Web Client): Document 'current-http-proxy'.

2013-07-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	New aarch64 port built on the Foundation v8 emulator.
		* include/lightning/jit_aarch64.h, lib/jit_aarch64-cpu.c,
		lib/jit_aarch64-fpu.c, lib/jit_aarch64.c: New files
		implementing the new aarch64 port, as a new architecture,
		not as an expansion of the existing armv[4-7] port.

		* check/lightning.c: Add aarch64 support and a small
		change to recognize character constants as immediate
		values.

		* check/float.tst: Add aarch64 preprocessor conditionals
		to select proper expected value when converting [+-]Inf
		and NaN to integer.

		* include/lightning/jit_arm.h, lib/jit_arm.c: Minor changes
		to better match the new aarch64 files.

		* configure.ac, include/lightning.h,
		include/lightning/Makefile.am, include/lightning/jit_private.h,
		lib/Makefile.am, lib/lightning.c: Minor adjustments
		for the aarch64 port.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Fix R6RS 'fixnum-width'.
	Fixes <http://bugs.gnu.org/14879>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* module/rnrs/arithmetic/fixnums.scm (fixnum-width): Rewrite to avoid
	  inexact arithmetic, and correct the off-by-one error.

	* test-suite/tests/r6rs-arithmetic-fixnums.test (fixnum-width): Add
	  tests.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Update copyright dates of recently-changed R6RS bitwise/flonums files.
	* module/rnrs/arithmetic/bitwise.scm:
	  module/rnrs/arithmetic/flonums.scm:
	  test-suite/tests/r6rs-arithmetic-bitwise.test:
	  test-suite/tests/r6rs-arithmetic-flonums.test: Add 2013 to the
	  copyright dates.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Fix 'fxbit-count' for negative arguments.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* module/rnrs/arithmetic/fixnums.scm (fxbit-count): If the argument is
	  negative, return the 'bitwise-not' of the result of 'logcount', as per
	  R6RS.  Previously, 'fxbit-count' was identical to 'logcount'.

	* test-suite/tests/r6rs-arithmetic-fixnums.test (fxbit-count): Add test.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/numbers.c

2013-07-16  Mark H Weaver  <mhw@netris.org>

	gcd and lcm support inexact integer arguments.
	Fixes <http://bugs.gnu.org/14870>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* libguile/numbers.c (scm_gcd, scm_lcm): Support inexact integers.

	* test-suite/tests/numbers.test (gcd, lcm): Add tests.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	min and max: NaNs beat infinities, per R6RS errata.
	Fixes <http://bugs.gnu.org/14865>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* libguile/numbers.c (scm_min, scm_max): NaNs beat infinities, as per
	  the R6RS errata.

	* test-suite/tests/numbers.test (min, max): Update tests.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Flonum operations always return flonums.
	Fixes <http://bugs.gnu.org/14871>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* module/rnrs/arithmetic/flonums.scm (ensure-flonum): New procedure.
	  (fllog): Rewrite using case-lambda.  Handle negative zeroes.  Use
	  'ensure-flonum'.
	  (flatan): Rewrite using case-lambda.
	  (flasin, flacos, flsqrt, flexpt): Use 'ensure-flonum'.

	* test-suite/tests/r6rs-arithmetic-flonums.test
	  (fllog, flasin, flacos, flsqrt, flexpt): Add tests.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	flfinite? applied to a NaN returns false.
	Fixes <http://bugs.gnu.org/14868>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* module/rnrs/arithmetic/flonums.scm (flfinite?): If the argument is a
	  NaN, return false.

	* test-suite/tests/r6rs-arithmetic-flonums.test (flfinite?): Add test.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	flonum? returns false for complex number objects.
	Fixes <http://bugs.gnu.org/14866>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* module/rnrs/arithmetic/flonums.scm (flonum?): Use 'real?' instead of
	  'number?'.

	* test-suite/tests/r6rs-arithmetic-flonums.test (flonum?): Add tests.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Allow fl+ and fl* to accept zero arguments.
	Fixes <http://bugs.gnu.org/14869>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* module/rnrs/arithmetic/flonums.scm (fl+, fl*): Accept zero arguments.

	* test-suite/tests/r6rs-arithmetic-flonums.test (fl+, fl*): Add tests.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

	numbers.test: Fix inum/flonum comparison test on 32-bit machines.
	* test-suite/tests/numbers.test (<): Fix inum/flonum test.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/keywords.c
		libguile/vm.c

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Avoid lossy conversion from inum to double in numerical comparisons.
	* libguile/numbers.c (scm_less_p): Avoid converting inums to doubles.

	* test-suite/tests/numbers.test (<): Add tests.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	numbers.test: Avoid inexact arithmetic in computation of fixnum-bit.
	* test-suite/tests/numbers.test (fixnum-bit): Rewrite to avoid
	  inexact arithmetic.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Fix bugs in numerical equality predicate.
	* libguile/numbers.c (scm_num_eq_p): Fix bug comparing fractions to
	  infinities (reported by Göran Weinholt <goran@weinholt.se>).  Fix
	  erroneous comment describing the logic behind inum/flonum comparison.
	  Use similar logic for inum/complex comparison to avoid rounding
	  errors.  Make minor indentation fixes and simplifications.

	* test-suite/tests/numbers.test (=): Add tests.

2013-07-16  Mark H Weaver  <mhw@netris.org>

	Fix rounding in scm_i_divide2double for negative arguments.
	* libguile/numbers.c (INUM_LOSSLESSLY_CONVERTIBLE_TO_DOUBLE):
	  New macro.
	  (scm_i_divide2double): Use INUM_LOSSLESSLY_CONVERTIBLE_TO_DOUBLE to
	  determine if our fast path is safe.  Previously, negative arguments
	  were not checked properly.

	* test-suite/tests/numbers.test (exact->inexact): Add tests.

2013-07-14  Mark H Weaver  <mhw@netris.org>

	Fix VM 'ash' for right shifts by large amounts.
	Fixes <http://bugs.gnu.org/14864>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* libguile/vm-i-scheme.c (ash): Fallback to 'scm_ash' for right shifts
	  with counts >= SCM_I_FIXNUM_BIT, since '>>' is not guaranteed to work
	  correctly for large counts.

2013-07-14  Mark H Weaver  <mhw@netris.org>

	Fix 'bitwise-bit-count' for negative arguments.
	Fixes <http://bugs.gnu.org/14864>.
	Reported by Göran Weinholt <goran@weinholt.se>.

	* module/rnrs/arithmetic/bitwise.scm (bitwise-bit-count): If the
	  argument is negative, return the 'bitwise-not' of the result of
	  'logcount', as per R6RS.  Previously, 'bitwise-bit-count' was
	  identical to 'logcount'.

2013-07-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Second alpha release 1.99a

2013-07-06  Andy Wingo  <wingo@pobox.com>

	<prompt> body and handler are lambdas; add escape-only? field
	* module/language/tree-il.scm (<prompt>): Change to have the body and
	  handler be lambdas, and add an "escape-only?" field.  This will make
	  generic prompts work better in CPS or ANF with the RTL VM, as it
	  doesn't make sense in that context to capture only part of a frame.
	  Escape-only prompts can still be fully inlined.
	  (parse-tree-il, unparse-tree-il): Add escape-only? to the
	  serialization.
	  (make-tree-il-folder, pre-post-order): Deal with escape-only?.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Handle
	  escape-only?, and the new expectations for the body and handler.

	* module/language/tree-il/canonicalize.scm (canonicalize): Ensure that
	  the body of an escape-only continuation is a thunk, and that the
	  handler is always a lambda.
	* module/language/tree-il/debug.scm (verify-tree-il): Assert that
	  escape-only? is a boolean.

	* module/language/tree-il/cse.scm (cse):
	* module/language/tree-il/effects.scm (make-effects-analyzer):
	* module/language/tree-il/peval.scm (peval):
	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	* test-suite/tests/peval.test ("partial evaluation"):
	* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Adapt
	  to <prompt> change.

2013-06-28  Andy Wingo  <wingo@pobox.com>

	Simplify dynstack API to only wind one fluid at a time
	* libguile/dynstack.h (SCM_DYNSTACK_TYPE_WITH_FLUID): Rename from
	  with-fluids.
	* libguile/dynstack.c (scm_dynstack_push_fluid):
	  (scm_dynstack_unwind_fluid): Change API to only wind/unwind one
	  fluid binding.
	  (WITH_FLUID_WORDS): New define, always 2 words (fluid and value box).
	  (WITH_FLUID_FLUID, WITH_FLUID_VALUE_BOX): New macros to get offsets of
	  fluid and value box.
	  (scm_dynstack_push_rewinder, scm_dynstack_push_unwinder): Use
	  WINDER_WORDS.
	  (scm_dynstack_push_dynwind): Use DYNWIND_WORDS.
	  (scm_dynstack_wind_1): Update for scm_swap_fluid API change.

	* libguile/fluids.h:
	* libguile/fluids.c (scm_prepare_fluids): Remove; no longer needed.
	  (scm_swap_fluid): Update to just swap one fluid binding.
	  (scm_c_with_fluids, scm_c_with_fluid): Update to use
	  scm_dynstack_push_fluid.

	* libguile/memoize.c (do_push_fluid, do_pop_fluid): Adapt to API
	  change.
	* libguile/vm-engine.c (rtl_vm_engine): Change wind-fluids / unwind-fluids
	  to push-fluid / pop-fluid, and actually enable.  Woo!

	* libguile/vm-i-system.c (push-fluid, pop-fluid): Update to new API.

2013-06-28  Andy Wingo  <wingo@pobox.com>

	Remove with-fluids; replaced by with-fluid* and inlined push-fluid primops
	* libguile/vm-i-system.c (push-fluid, pop-fluid):
	* doc/ref/vm.texi (Dynamic Environment Instructions): Rename wind-fluids
	  to push-fluid, and unwind-fluids to pop-fluid.  They now only work on
	  one fluid binding at a time.

	* module/ice-9/boot-9.scm (with-fluid*): Implement in Scheme in terms of
	  primcalls to push-fluid and pop-fluid.
	  (custom-throw-handler, catch, with-throw-handler): Use with-fluid*
	  instead of with-fluids, as with-fluids is no longer available before
	  psyntax is loaded.
	  (with-fluids): Define in Scheme in terms of with-fluid*.

	* libguile/fluids.c (scm_with_fluid): Rename from scm_with_fluids, and
	  don't expose to Scheme.

	* libguile/eval.c (eval): Remove SCM_M_WITH_FLUIDS case.
	* libguile/expand.c (expand_with_fluids): Remove with-fluids syntax.
	  (DYNLET): Remove, no longer defining dynlet in the %expanded-vtables.
	* libguile/expand.h: Remove dynlet definitions.
	* module/ice-9/eval.scm (primitive-eval): Remove with-fluids case.
	* libguile/memoize.c (do_push_fluid, do_pop_fluid): New primitive
	  helpers, like wind and unwind.
	  (memoize): Memoize wind and unwind primcalls.  Don't memoize dynlet to
	  with-fluids.
	  (scm_init_memoize): Initialize push_fluid and pop_fluid here.
	* libguile/memoize.h (SCM_M_WITH_FLUIDS): Remove definition.

	* module/ice-9/psyntax.scm (build-dynlet): Remove; this just supported
	  with-fluids, which is now defined in boot-9.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	* doc/ref/compiler.texi (Tree-IL):
	* module/language/tree-il.scm:
	* module/language/tree-il/analyze.scm:
	* module/language/tree-il/canonicalize.scm:
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/cse.scm:
	* module/language/tree-il/debug.scm:
	* module/language/tree-il/effects.scm: Remove <dynlet>.  Add cases for
	  primcalls to push-fluid and pop-fluid in compile-glil.scm and
	  effects.scm.

	* module/language/tree-il/peval.scm (peval): Factor out
	  with-temporaries; probably a bad idea, but works for now.  Factor out
	  make-begin0 (a better idea).  Inline primcalls to with-fluid*, and
	  remove dynlet cases.

	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  Add with-fluid*.

2013-06-27  Andy Wingo  <wingo@pobox.com>

	replace <dynset> with primcalls to fluid-set!
	* doc/ref/compiler.texi (Tree-IL): Remove mention of <dynset>.
	* module/language/scheme/decompile-tree-il.scm (do-decompile):
	  (choose-output-names): Remove dynset.
	* module/language/tree-il.scm (<tree-il>, parse-tree-il):
	  (unparse-tree-il, make-tree-il-folder, pre-post-order): Remove
	  <dynset>.

	* module/language/tree-il/analyze.scm (analyze-lexicals):

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add
	  fluid-set!.
	  (flatten-lambda-case): Remove <dynset> case.

	* module/language/tree-il/cse.scm (cse):
	* module/language/tree-il/debug.scm (verify-tree-il): Remove <dynset>
	  cases.

	* module/language/tree-il/effects.scm (make-effects-analyzer): Remove
	  <dynset> case.  Add a primcall fluid-set! case.

	* module/language/tree-il/peval.scm (peval): Remove dynset cases.

	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Remove fluid-set! -> dynset transformation.

2013-06-27  Andy Wingo  <wingo@pobox.com>

	replace <dynref> with primcalls to fluid-ref
	* doc/ref/compiler.texi (Tree-IL): Remove mention of <dynref>.
	* module/language/scheme/decompile-tree-il.scm (do-decompile):
	  (choose-output-names): Remove dynref.
	* module/language/tree-il.scm (<tree-il>, parse-tree-il):
	  (unparse-tree-il, make-tree-il-folder, pre-post-order): Remove
	  <dynref>.

	* module/language/tree-il/analyze.scm (analyze-lexicals):

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add
	  fluid-ref.
	  (flatten-lambda-case): Remove <dynref> case.

	* module/language/tree-il/cse.scm (cse):
	* module/language/tree-il/debug.scm (verify-tree-il): Remove <dynref>
	  cases.

	* module/language/tree-il/effects.scm (make-effects-analyzer): Remove
	  <dynref> case.  Add a primcall fluid-ref case.

	* module/language/tree-il/peval.scm (peval): Remove dynref cases.

	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Remove fluid-ref -> dynref transformation.

2013-06-27  Andy Wingo  <wingo@pobox.com>

	dynamic-wind in terms of wind and unwind; remove <dynwind>, @dynamic-wind
	* doc/ref/compiler.texi: Remove mention of <dynwind>.
	* libguile/eval.c (eval): Remove SCM_M_DYNWIND case.
	* libguile/expand.c: Remove scm_sym_at_dynamic_wind.
	* libguile/memoize.c (do_wind, do_unwind): A couple of hacky subrs.  If
	  we see a wind or unwind primcall, we expand to a call of a quoted subr
	  value.  It works and removes a kind of memoized value from the
	  interpreter.  For the compiler,primcalls to wind and unwind are
	  handled specially.
	  (MAKMEMO_DYNWIND): Remove.
	  (scm_tc16_memoizer): Remove.  Yay!
	  (memoize): Remove speculative lookup for toplevels to see if they are
	  memoizers: there are no more memoizers.  Memoize calls to the wind and
	  unwind primitives.
	  (m_dynamic_wind): Remove.
	  (unmemoize): Remove dynwind case.
	  (scm_init_memoize): Add wind and unwind local definitions.

	* module/ice-9/boot-9.scm (dynamic-wind): Reimplement in terms of "wind"
	  and "unwind" primitives.  These primitives are not exposed to other
	  modules.

	* module/ice-9/eval.scm (primitive-eval): Remove dynwind case.
	* module/language/scheme/decompile-tree-il.scm (do-decompile):
	  (choose-output-names): Remove dynwind cases.

	* module/language/tree-il.scm: Remove <dynwind>.  Yaaay!

	* module/language/tree-il/analyze.scm (analyze-lexicals): Remove dynwind
	  cases.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add wind
	  and unwind.
	  (flatten-lambda-case): Remove dynwind case.  Yay!

	* module/language/tree-il/cse.scm (cse):
	* module/language/tree-il/debug.scm (verify-tree-il):
	* module/language/tree-il/effects.scm (make-effects-analyzer):
	* module/language/tree-il/peval.scm (singly-valued-expression?, peval):
	  Remove <dywind> cases.  Inline primcalls to dynamic-wind.  Add
	  constant folding for thunk?.

	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  Remove @dynamic-wind, and add procedure? and thunk?.
	  (*effect+exception-free-primitives*): Add procedure? and thunk?.
	  (*multiply-valued-primitives*): Remove @dynamic-wind.
	  Remove @dynamic-wind expander.

	* test-suite/tests/peval.test ("partial evaluation"): Update tests for
	  dynwind desugaring.

2013-06-27  Andy Wingo  <wingo@pobox.com>

	remove @call-with-values memoizer
	* libguile/memoize.h:
	* libguile/expand.c (scm_sym_at_call_with_values): Remove.

	* libguile/memoize.c (memoize, m_call_values, unmemoize): Adapt to
	  memoize call-with-values primcalls.

	* module/ice-9/boot-9.scm (call-with-values): Expand to a
	  call-with-values primcall.

	* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Expect
	  call-with-values primcall, without the @, and fall back to a normal
	  call.

	* module/language/tree-il/peval.scm (peval): Match bare
	  call-with-values.

	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*multiply-valued-primitives*): Remove @call-with-values.

2013-06-27  Andy Wingo  <wingo@pobox.com>

	remove @call-with-current-continuation memoizer
	* module/ice-9/boot-9.scm (call-with-current-continuation): Change to
	  primcall call-with-current-continuation.

	* libguile/memoize.h:
	* libguile/expand.c (scm_sym_atcall_cc): Remove.

	* libguile/memoize.c (memoize): Memoize call/cc primcalls to
	  SCM_M_CONT.
	  (m_call_cc): Remove.
	  (unmemoize): Unmemoize to call-with-current-continuation.

	* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Update
	  to call-with-current-continuation without @ prefix, and fix fallback
	  case.

	* module/language/tree-il/primitives.scm (*multiply-valued-primitives*):
	  (*interesting-primitive-names*): Remove
	  @call-with-current-continuation.
	  (call/cc): Expand to call-with-current-continuation.

	* test-suite/tests/tree-il.test ("call/cc"): Update to use and expect
	  call-with-current-continuation primcalls / toplevel refs.

2013-06-27  Andy Wingo  <wingo@pobox.com>

	remove apply:nconc2last
	* libguile/eval.c (scm_nconc2last): Remove, now unused.
	* doc/ref/api-evaluation.texi (Fly Evaluation): Remove docs.

2013-06-27  Andy Wingo  <wingo@pobox.com>

	remove @apply memoizer
	* libguile/memoize.c (memoize): Recognize a primcall to 'apply as
	  SCM_M_APPLY.
	  (@apply): Remove @apply memoizer.
	  (unmemoize): Unmemoize using "apply", not "@apply".

	* libguile/memoize.h:
	* libguile/expand.c (scm_sym_atapply): Remove.

	* module/ice-9/boot-9.scm (apply): Re-implement using apply primcall.
	  Use case-lambda, so as to give an appropriate minimum arity.

	* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
	  Compile a primcall of "apply" specially, not "@apply".

	* module/language/tree-il/peval.scm (peval): Match primcalls to "apply",
	  not "@apply".  Residualize "apply" primcalls.

	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*multiply-valued-primitives*): Remove @apply, and apply primitive
	  expander.

	* test-suite/tests/peval.test:
	* test-suite/tests/tree-il.test: Update tests to expect residualized
	  "apply".

	* test-suite/tests/procprop.test ("procedure-arity"): Update test for
	  better apply arity.

	* test-suite/tests/strings.test ("string"): Update expected error.

2013-06-27  Andy Wingo  <wingo@pobox.com>

	Remove @prompt memoizer
	* libguile/memoize.h:
	* libguile/memoize.c (MAKMEMO_CALL_WITH_PROMPT, memoize, unmemoize):
	  Remove the @prompt memoizer in favor of recognizing call-with-prompt
	  primcalls.  Rename SCM_M_PROMPT to SCM_M_CALL_WITH_PROMPT, and pass a
	  thunk instead of an expression so that it has normal applicative
	  order.

	* libguile/expand.c (PRIMITIVE_REF, PRIMCALL, expand): Produce primcalls
	  from forms whose car is a primitive.
	  (expand_atat): Recognize (@@ primitive FOO) as being a primitive-ref.

	* module/ice-9/boot-9.scm (call-with-prompt): Instead of dispatching to
	  the wonky @prompt memoizer, residualize a primcall to
	  call-with-prompt.  The memoizer will DTRT to allow call-with-prompt to
	  be interpreted correctly without needing an additional binding.

	* module/ice-9/eval.scm (primitive-eval): Change the 'prompt clause to a
	  call to call-with-prompt.

	* module/language/tree-il/primitives.scm: No more need to recognize
	  @prompt.

	* libguile/eval.c (eval): Adapt to SCM_M_PROMPT renaming to
	  SCM_M_CALL_WITH_PROMPT, and apply the thunk.

	* libguile/throw.c (pre_init_throw): Adapt to scm_abort_to_prompt_star
	  rename.

2013-06-25  Andy Wingo  <wingo@pobox.com>

	abort-to-prompt* instead of @abort
	* libguile/control.h:
	* libguile/control.c (scm_abort_to_prompt_star): Rename from
	  scm_at_abort.

	* module/ice-9/boot-9.scm (abort-to-prompt): Use abort-to-prompt*.

	* module/language/tree-il/primitives.scm: Handle abort-to-prompt*
	  instead of @abort.

2013-06-25  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct mips o32 abi that was broken when adding n32 abi support.
		* lib/jit_mips.c: Correct cut&paste error that caused wrong
		stack offset calculation for double arguments in stack in
		the o32 abi.
		Correct typo in the __LITTLE_ENDIAN macro name, that came
		from cut&paste error in the original typo in lib/jit_ppc.c.

		* lib/jit_ia64.c, lib/jit_ppc.c: Correct typo in the
		__LITTLE_ENDIAN macro name.

2013-06-23  Andy Wingo  <wingo@pobox.com>

	psyntax: ((@@ primitive NAME) ARG ...) in (guile) module is a primcall
	* ice-9/psyntax.scm (@@): Recognize new form, (@@ primitive NAME), which
	  in operator position expands to a primcall.  This expansion is only
	  available for forms in the (guile) module.  Added an argument to @@
	  and @ procedures, the module, for use by expanded syntax objects;
	  adapted callers.
	  (analyze-variable): Error when accessing a primitive for value.
	  (get-global-definition-hook): Primitives are not macros.
	  (syntax-type): A form with a primitive in the car is a
	  primitive-call.
	  (expand-expr): Residualize primitive calls as primcalls.
	  (syntax-local-binding): Return 'primitive as the type for primitives.

2013-06-23  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Build and pass all tests on big endian Irix mips using the n32 abi.
		* check/lightning.c, configure.ac, include/lightning.h,
		lib/lightning.c: Add tests and quirks to build/detect
		and/or work on Irix.

		* include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
		lib/jit_mips-fpu.c, lib/jit_mips.c: Adapt code to run
		in big endian mips, using the n32 abi.

2013-06-19  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct build and pass all tests on Solaris x86.
		* include/lightning.h: Minor extra preprocessor testing
		to "detect" byte order on x86 solaris, that now builds
		and pass all test cases.

2013-06-19  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct build and pass all tests on Solaris Sparc.
		* lib/jit_sparc-cpu.c: Correct compiler warning of value
		used before assignment. The usage is bogus as the api
		requires always patching jumps, but the random value used
		could cause an assertion due to invalid displacement.

		* lib/jit_sparc.c: Always load and store double arguments
		in stack as 2 float loads or stores, for safety, as unaligned
		access is not allowed in Sparc Solaris.

2013-06-17  Mark H Weaver  <mhw@netris.org>

	Fix bug in remqueue in threads.c when removing last element.
	Reported and debugged by Andrew Gaylard <ag@computer.org>.

	* libguile/threads.c (remqueue): When removing the last element from a
	  queue with more than one element, set (car q) to the previous element.

	* THANKS: Thank Andrew Gaylard.

2013-06-16  Ludovic Courtès  <ludo@gnu.org>

	Fix #ifdefery for `setegid'.
	* libguile/posix.c (scm_setegid): Change to #ifdef HAVE_SETEGID.

	tests: Don't rely on `scm_call_2' being visible.
	* test-suite/tests/coverage.test ("procedure-execution-count")["called
	  from C"]: Throw 'unresolved when `scm_call_2' cannot be resolved.
	  Reported by Eli Zaretskii <eliz@gnu.org>.

	Augment `.dir-locals.el'.

	tests: Remove symlink only when it exists.
	* test-suite/tests/filesys.test: Delete (test-symlink) only if it
	  exists---i.e., not on Windows.
	  Reported by Eli Zaretskii <eliz@gnu.org>.

	tests: Skip FFI tests that use `qsort' when it's not accessible.
	* test-suite/tests/foreign.test ("procedure->pointer")[qsort]: Wrap in
	  `false-if-exception'.
	  ["qsort", "qsort, wrong return type", "qsort, wrong arity"]: Throw
	  'unresolved when QSORT if #f.
	  Reported by Eli Zaretskii <eliz@gnu.org>.

2013-06-16  Andy Wingo  <wingo@pobox.com>

	<dynwind> no longer has "pre" or "post" fields
	* module/language/tree-il.scm (<tree-il>): Remove pre and post fields
	  from <dynwind>.  A dynwind now assumes that in normal entry and exit,
	  that the code runs the winders and unwinders using <seq> and
	  <let-values> and such things.
	  (parse-tree-il, unparse-tree-il, make-tree-il-folder, pre-post-order):
	  Adapt <dynwind> users.

	* module/language/tree-il/analyze.scm (analyze-lexicals):
	* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
	* module/language/tree-il/cse.scm (cse):
	* module/language/tree-il/debug.scm (verify-tree-il):
	* module/language/tree-il/effects.scm (make-effects-analyzer): Adapt.

	* module/language/tree-il/peval.scm (peval):
	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Produce tree-il that calls the winder and unwinder.  Recognize
	  singly-valued dynamic-wind expressions.

	* test-suite/tests/peval.test ("partial evaluation"): Add tests.

2013-06-16  Ludovic Courtès  <ludo@gnu.org>

	tests: Don't rely on $TMPDIR and /tmp on Windows.
	* test-suite/standalone/test-unwind.c (check_ports)[__MINGW32__]: Use
	  $TEMP, $TMP, or / as the value for TMPDIR.
	  Patch by Eli Zaretskii <eliz@gnu.org>.

	tests: Use double quotes around shell arguments, for Windows.
	* test-suite/standalone/test-system-cmds (test-system-cmd): Use double
	  quotes around shell arguments.
	  Reported by Eli Zaretskii <eliz@gnu.org>.

	Define `AF_UNIX' only when Unix-domain sockets are supported.
	* libguile/socket.c (scm_init_socket): Defined `AF_UNIX' only when
	  `HAVE_UNIX_DOMAIN_SOCKETS' is defined.
	  Reported by Eli Zaretskii <eliz@gnu.org>.

2013-06-16  Andy Wingo  <wingo@pobox.com>

	Reduce call-with-values to let for singly-valued producers
	* module/language/tree-il/peval.scm (singly-valued-expression?): Add
	  support for conditionals.  In the future we should add more
	  expressions here.
	  (peval): Don't inline values into the body of a dynwind, as that could
	  cause the consumer to run in the wrong dynamic context.
	  If the producer is singly-valued and the consumer just has a rest arg,
	  reduce to "let" and cons up a list in the consumer.  This may reduce
	  further.

	* test-suite/tests/peval.test ("partial evaluation"): Add a test.

2013-06-14  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Update ia64 port to work on HP-UX.
		* configure.ac: Force -mlp64 to CFLAGS on HP-UX ia64 port.
		It is the only supported mode, and expects gcc as C compiler.

		* include/lightning.h, lib/jit_ia64-cpu.c, lib/jit_ia64.c:
		Correct ia64 port to work on HP-UX that runs it in big endian
		mode.

2013-06-10  Andy Wingo  <wingo@pobox.com>

	Rewrite make-tree-il-folder to use the Wright matcher.
	* module/language/tree-il.scm (make-tree-il-folder): Rewrite to use the
	  Wright matcher instead of record-case.

	Rewrite unparse-tree-il to use the Wright matcher.
	* module/language/tree-il.scm (unparse-tree-il): Rewrite to use the
	  Wright matcher.

	Rewrite parse-tree-il to use the Wright matcher.
	* module/language/tree-il.scm (parse-tree-il): Rewrite to use match
	  instead of pmatch.  Remove pmatch import.

2013-06-10  Andy Wingo  <wingo@pobox.com>

	Implement tree-il-fold in terms of make-tree-il-folder.
	* module/language/tree-il.scm (tree-il-fold): Implement using
	  make-tree-il-folder.  This is an incompatible change: there is no more
	  "leaf" procedure, and tree-il-fold only works on tree-il and not
	  lists.

	* module/language/tree-il/analyze.scm (<tree-analysis>, analyze-tree):
	  Adapt to tree-il-fold change, losing the "leaf" handler.
	  (unused-variable-analysis, unused-toplevel-analysis)
	  (unbound-variable-analysis, arity-analysis): Adapt to tree-analysis
	  change.

	* module/language/tree-il/canonicalize.scm (tree-il-any)
	* module/language/tree-il/cse.scm (build-assigned-var-table)
	* module/language/tree-il/peval.scm (tree-il-any, build-var-table)
	  (peval): Adapt to tree-il-fold change.

	* test-suite/tests/tree-il.test ("tree-il-fold"): Adapt tests for new
	  interface and expectations.

2013-06-10  Andy Wingo  <wingo@pobox.com>

	Rewrite tree-il pre-post-order in terms of (ice-9 match)
	* module/language/tree-il.scm (pre-post-order): Re-implement in terms
	  of (ice-9 match), so that we standardize on one matcher (more or
	  less).

2013-06-10  Andy Wingo  <wingo@pobox.com>

	Pre-order tree-il rewrites are now non-destructive
	* module/language/tree-il.scm (pre-order): Re-implement in terms of
	  pre-post-order, and rename from pre-order!.

	* module/language/tree-il/primitives.scm (expand-primitives): Adapt to
	  pre-order change, and rename from expand-primitives!.

	* module/language/tree-il/optimize.scm (optimize): Adapt to
	  expand-primitives! change, and rename from optimize!.

	* module/language/tree-il/compile-glil.scm:
	* module/system/repl/common.scm:
	* test-suite/tests/cse.test:
	* test-suite/tests/peval.test:
	* test-suite/tests/tree-il.test: Adapt to expand-primitives and optimize
	  changes.

2013-06-10  Andy Wingo  <wingo@pobox.com>

	Tree-il post-order rewriter no longer destructive
	* module/language/tree-il.scm (pre-post-order): New helper, like
	  pre-order! and post-order! but not destructive.
	  (post-order): Implement in terms of pre-post-order, and rename from
	  post-order!.

	* module/ice-9/compile-psyntax.scm (squeeze-tree-il):
	* module/language/tree-il/canonicalize.scm (canonicalize):
	* module/language/tree-il/fix-letrec.scm (fix-letrec):
	* module/language/tree-il/primitives.scm (resolve-primitives): Use
	  post-order, and rename from the destructive
	  variants (squeeze-tree-il!, canonicalize!, etc).  Adapt callers.

	* test-suite/tests/tree-il.test (strip-source): Adapt to post-order.

	* test-suite/tests/cse.test:
	* test-suite/tests/peval.test:
	* module/language/tree-il/optimize.scm: Adapt callers.

2013-06-10  Andy Wingo  <wingo@pobox.com>

	Simplify let-values to let if consumer binds only one variable
	* module/language/tree-il/peval.scm (peval): let-values with a consumer
	  that has only one argument is the same as let.

	* test-suite/tests/peval.test ("partial evaluation"): Add test.

2013-06-10  Andy Wingo  <wingo@pobox.com>

	fix linker.test
	* test-suite/tests/linker.test (link-elf-with-one-main-section): Fix
	  test after string table change.

2013-06-10  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Remove redundancy in the hppa cache synchronization code.
		* lib/jit_hppa.c: Sanitize the cache synchronization inline
		assembly code that was doing twice the work and redundantly
		flushing the end address every loop iteration.

2013-06-10  Mark H Weaver  <mhw@netris.org>

	Allow #f as timeout argument to unlock-mutex and SRFI-18 mutex-unlock!
	Reported by Chaos Eternal <chaoseternal@shlug.org>
	Based on a patch by Nala Ginrut <nalaginrut@gmail.com>

	* libguile/threads.c (scm_unlock_mutex_timed): If 'timeout' argument
	  is false, interpret that as no timeout.

	* doc/ref/api-scheduling.texi (Mutexes and Condition Variables):
	  Update documentation.

2013-06-10  Mark H Weaver  <mhw@netris.org>

	Fix tests for 'scm_c_bind_keyword_arguments'.
	* test-suite/standalone/test-scm-c-bind-keyword-arguments.c (error_handler):
	  Remove function.
	  (unrecognized_keyword_error_handler, invalid_keyword_error_handler,
	  odd_length_error_handler): New functions.
	  (test_scm_c_bind_keyword_arguments): Use new error handler functions.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	procedure-properties for RTL functions
	* module/system/vm/assembler.scm (link-procprops, link-objects): Arrange
	  to write procedure property links out to a separate section.

	* libguile/procprop.c (scm_procedure_properties):
	* libguile/programs.h:
	* libguile/programs.c (scm_i_rtl_program_properties):
	* module/system/vm/debug.scm (find-program-properties): Wire up
	  procedure-properties for RTL procedures.  Yeah!  Fistpumps!  :)

	* module/system/vm/debug.scm (find-program-debug-info): Return #f if the
	  string is "", as it is if we don't have a name.  Perhaps
	  elf-symbol-name should return #f in that case...

	* test-suite/tests/rtl.test: Add some tests.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	procedure-documentation works on RTL procedures
	* libguile/procprop.h:
	* libguile/procprop.c (scm_procedure_documentation): Move here from
	  procs.c, and to make the logic more similar to that of procedure-name,
	  which allows RTL programs to dispatch to rtl-program-documentation.

	* libguile/programs.c (scm_i_rtl_program_documentation):
	* libguile/programs.h:
	* module/system/vm/program.scm (rtl-program-documentation): New
	  plumbing.

	* module/system/vm/debug.scm (find-program-docstring): New interface to
	  grovel ELF for a docstring.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	Write docstrings into RTL ELF images
	* module/system/vm/assembler.scm (link-docstrs): Write docstrings.
	  (link-objects): Link docstrings into the ELF.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	Wire up ability to print RTL program arities
	* libguile/procprop.c (scm_i_procedure_arity): Allow RTL programs to
	  dispatch to scm_i_program_arity.

	* libguile/programs.c (scm_i_program_print): Refactor reference to
	  write-program.
	  (scm_i_rtl_program_minimum_arity): New procedure, dispatches to
	  Scheme.
	  (scm_i_program_arity): Dispatch to scm_i_rtl_program_minimum_arity if
	  appropriate.

	* module/system/vm/debug.scm (program-minimum-arity): New export.

	* module/system/vm/program.scm (rtl-program-minimum-arity): New internal
	  function.
	  (program-arguments-alists): New helper, implemented also for RTL
	  procedures.
	  (write-program): Refactor a bit, and call program-arguments-alists.

	* test-suite/tests/rtl.test ("simply procedure arity"): Add tests that
	  arities make it all the way to cold ELF and back to warm Guile.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	(system vm debug) can read arity information
	* module/system/vm/debug.scm (<arity>): New object, for reading
	  arities.  Unlike <arity> in the assembler, this one only holds on to a
	  couple of pointers, and doesn't even load in argument names.  Unlike
	  the arity lists in (system vm program), it can load in names.  Very
	  early days but it does seem to work.
	  (find-program-arities, arity-arguments-alist): New higher-level
	  interfaces.

	RTL assembler writes arities information into separate section.
	* module/system/vm/assembler.scm: Write arities into a .guile.arities
	  section and associated .guile.arities.strtab.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	Beginnings of tracking of procedure arities in assembler
	* module/system/vm/assembler.scm (<meta>, <arity>): Assembler now tracks
	  arities of a function.
	  (begin-standard-arity, begin-opt-arity, begin-kw-arity, end-arity):
	  New macro-assemblers.

	* test-suite/tests/rtl.test: Adapt all tests to use begin-standard-arity
	  and end-arity.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	add procedure prelude macro-instructions
	* module/system/vm/assembler.scm (pack-flags): New helper.
	  (standard-prelude, opt-prelude, kw-prelude): New macro-instructions.

	* test-suite/tests/rtl.test: Update tests to use standard-prelude.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	begin-program takes properties alist
	* module/system/vm/assembler.scm (assert-match): New helper macro to
	  check argument types.
	  (<meta>): Add properties field.  Rename name field to "label" to
	  indicate that it should be unique.
	  (make-meta, meta-name): New helpers.
	  (begin-program): Take additional properties argument.
	  (emit-init-constants): Adapt to begin-program change.
	  (link-symtab): Allow for anonymous procedures.

	* test-suite/tests/rtl.test: Adapt tests.

2013-06-09  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Build and pass all test cases on a multiprocessor HP-UX.
		* configure.ac, check/Makefile.am, doc/Makefile.am: Do not
		explicitly link to -ldl, but instead autodetect the library
		with dlopen, dlsym, etc.

		* check/lightning.c: Add workaround to apparently buggy
		getopt in HP-UX that sets optind to the wrong index, and
		use RTLD_NEXT on HP-UX instead of RTLD_DEFAULT to dlsym
		global symbols.

		* include/lightning.h: Rework definitions of wordsize and
		byte order to detect proper values on HP-UX.

		* lib/lightning.c: Minor correction to use MAP_ANONYMOUS
		instead of MAP_ANON on HP-UX.

		* lib/jit_hppa.c: Float arguments must be passed on integer
		registers on HP-UX, not only for varargs functions.
		  Add code to properly clear instruction cache. This was
		not required on Debian hppa port, but may have been working
		by accident.

		* lib/jit_hppa-cpu.c: Follow pattern of HP-UX binaries and
		use bve,n instead of bv,n to return from functions.

		* lib/jit_hppa-fpu.c: For some reason "fst? frX,rX,(rY)" did
		not work on the tested computer	(HP-UX B.11.23 U 9000/785 HP-UX)
		so the code was changed, at first for __hpux only to add the
		base and offset register and use the instruction with an
		immediate (zero) offset.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	Add RTL disassembler
	* module/Makefile.am:
	* module/system/vm/disassembler.scm: New module.

	* module/system/repl/command.scm (disassemble): Work with RTL programs.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	RTL programs print with their name
	* libguile/print.c (iprin1): Use scm_i_program_print for RTL programs
	  too.

	* libguile/procprop.c (scm_procedure_name): For RTL programs, call
	  scm_i_rtl_program_name if there is no override.

	* libguile/programs.h:
	* libguile/programs.c (scm_i_rtl_program_name): New helper, dispatches
	  to (system vm program).
	  (scm_i_program_print): For RTL programs, the fallback prints the code
	  pointer too.

	* module/system/vm/program.scm (rtl-program-name): Use the debug info to
	  get an RTL program name.
	  (write-program): Work with RTL programs too.

	* test-suite/tests/rtl.test ("procedure name"): Add test.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	move procedure-name and procedure-source to procprop.c
	* libguile/procprop.h:
	* libguile/procprop.c (scm_procedure_name, scm_procedure_source): Move
	  these functions here, from debug.[ch].

2013-06-09  Andy Wingo  <wingo@pobox.com>

	Add runtime support for reading debug information from ELF
	* module/Makefile.am:
	* module/system/vm/debug.scm: New module.

	* module/system/vm/elf.scm (elf-section-by-name): New helper.
	  (elf-symbol-table-len): New helper.

	* test-suite/tests/rtl.test: Add test for finding debug info.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	Add RTL assembler
	* module/Makefile.am:
	* module/system/vm/assembler.scm: New module, implementing an assembler
	  for RTL.

	* test-suite/Makefile.am:
	* test-suite/tests/rtl.test: New test suite.

	* module/system/vm/elf.scm (make-elf-symbol*): Add constructor; export
	  as make-elf-symbol.
	  (elf-symbol-len): New export.
	  (write-elf32-symbol, write-elf64-symbol): New helpers.
	  (write-elf-symbol): New export.

2013-06-09  Andy Wingo  <wingo@pobox.com>

	linker string tables are stateful objects
	* module/system/vm/linker.scm (make-string-table): Rework to be a
	  stateful object instead of a function object.  Works better in this
	  case.  Adapt users.
	  (string-table-intern!): Rename from string-table-intern, and just
	  return the index of the string.
	  (link-string-table!): Rename from link-string-table, and set a flag to
	  prevent interning strings after linking, as that's not going to work
	  well.

	* module/language/objcode/elf.scm (bytecode->elf): Adapt.

2013-06-08  Andy Wingo  <wingo@pobox.com>

	const cleanups in instructions.c
	* libguile/instructions.c (fetch_rtl_instruction_table)
	  (fetch_instruction_table): Make the returned table const.  Adapt
	  callers.
	  (scm_rtl_instruction_list): Fix comment about format of return value.

2013-06-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Adjust lightning to work on ppc AIX.
	Many thanks to Trent Nelson from snakebite.org for giving access to a
	build farm with several different architectures and operating systems.

		* check/lightning.c, lib/jit_disasm.c, lib/jit_ppc-cpu.c,
		lib/jit_ppc-fpu.c, lib/jit_ppc.c, include/lightning.h,
		include/lightning/jit_ppc.h, include/lightning/jit_private.h:
		Adapt code to work on 32 bit AIX ppc using gcc. Most changes
		are basically to adapt the elf64 logic to 32 bit, as it does
		not use the same convention of 32 bit Darwin ppc.

		* check/stack.tst: Add a fake memcpy function to the test
		case if running under AIX, as it is not available to dlsym.

		* configure.ac: Check for getopt.h header, not available in
		AIX.

2013-06-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Prepare for the first alpha release of lightning 2.0.

2013-06-05  Ludovic Courtès  <ludo@gnu.org>

	Report the faulty keyword in errors raised by `scm_c_bind_keyword_arguments'.
	Reported by Mark H. Weaver.

	* libguile/keywords.c (scm_c_bind_keyword_arguments): Use
	  `scm_error_scm' instead of `scm_error'.  Pass the faulty keyword
	  enclosed in a list as the last argument.
	* test-suite/tests/optargs.test ("scm_c_bind_keyword_arguments"): New
	  test prefix.

2013-06-04  Ludovic Courtès  <ludo@gnu.org>

	Print the faulty object upon invalid-keyword errors.
	* libguile/vm.c (vm_error_kwargs_invalid_keyword,
	  vm_error_kwargs_unrecognized_keyword): Add parameter.  Pass it
	  enclosed in a list as the last argument to `scm_error_scm'.
	* libguile/vm-i-system.c (bind_kwargs): Adjust accordingly.
	* libguile/eval.c (error_invalid_keyword, error_unrecognized_keyword):
	  Add parameter.
	  (prepare_boot_closure_env_for_apply): Adjust accordingly.
	* module/ice-9/eval.scm (primitive-eval): Likewise.
	* libguile/error.c (scm_error_scm): Mention `keyword-argument-error' in
	  docstring.
	* module/ice-9/boot-9.scm (keyword-error-printer): New procedure; use it.
	* test-suite/tests/optargs.test (c&e, with-test-prefix/c&e): Remove.
	  ("define*")["unrecognized keyword"]: Test the value passed along the
	  `keyword-argument-error' exception.
	  ["invalid keyword"]: New test.
	* doc/ref/api-control.texi (Error Reporting): Update `scm-error'
	  description.

2013-06-01  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add functional hppa port. All tests pass.
		* include/lightning/jit_hppa.h, lib/jit_hppa-cpu.c,
		lib/jit_hppa-fpu.c, lib/jit_hppa.c: New files implementing
		the hppa port. Built on Debian Linux PA-RISC 2.0, 32 bit.

		* check/float.tst: Add preprocessor for hppa expected
		values when converting NaN and +-Inf to an integer.

		* check/ldst.inc: Ensure double load/store tests use an
		8 byte aligned address by default.

		* lib/lightning.c: Correct a bug found during tests in
		the new port, where qmul* and qdiv* were not properly
		setting one of the result registers as modified in the
		function, what would be a problem if the only "write"
		usage were the qmul* or qdiv*.

		* check/varargs.tst, check/varargs.ok: Add one extra
		interleaved integer/double test to validate proper code
		generation in the extra case.

		* check/lightning.c, configure.ac, include/lightning.h,
		include/lightning/Makefile.am,
		include/lightning/jit_private.h, lib/Makefile.am,
		lib/jit_disasm.c: Update for the hppa port.

2013-05-31  Andy Wingo  <wingo@pobox.com>

	add new rtl vm
	* libguile/vm-engine.c (rtl_vm_engine): Add new VM.
	  (vm_engine): Add support for calling RTL programs.

	* libguile/tags.h (scm_tc7_rtl_program): New type for procedures that
	  run on the new VM.
	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/goops.c (scm_class_of):
	* libguile/print.c (iprin1):
	* libguile/procprop.c (scm_i_procedure_arity):
	* libguile/procs.c (scm_procedure_p): Add hooks for the new tc7.

	* libguile/programs.h:
	* libguile/programs.c (scm_make_rtl_program, scm_i_rtl_program_print)
	  (scm_rtl_program_p, scm_rtl_program_code):
	* module/system/vm/program.scm: Add constructors and accessors for the
	  new "RTL programs".

	* libguile/vm.c (rtl_boot_continuation): Define a boot program.
	  (rtl_apply, rtl_values): New static RTL programs.

	* libguile/frames.c (scm_frame_num_locals): Adapt for frames of RTL
	  programs.

	* libguile/frames.h: Add description of RTL frames.

	* libguile/Makefile.am: Add rules to generate vm-operations.h.
	* .gitignore: Ignore vm-operations.h.
	* module/system/vm/instruction.scm:
	* libguile/instructions.c:
	* libguile/instructions.h: Use vm-operations.h to define enumerated
	  values for the new RTL opcodes.  Define some helper macros to pack and
	  unpack 32-bit instruction words.
	  (rtl-instruction-list): New function, exported by (system vm
	  instruction).

	* libguile/objcodes.c: Wire up the bits needed to detect the new RTL
	  bytecode and load it, as appropriate.

2013-05-30  Ludovic Courtès  <ludo@gnu.org>

	Do not assume `pthread_t' is an integer type.
	Fixes <http://bugs.gnu.org/14469>.
	Reported by Panicz Maciej Godek <godek.maciek@gmail.com>.

	* libguile/finalizers.c (finalization_thread_is_running): New variable.
	  (start_finalization_thread): Use it to determine whether
	  FINALIZATION_THREAD is up and running.
	  (stop_finalization_thread): Likewise.

2013-05-27  Andy Wingo  <wingo@pobox.com>

	refactor to resolve_variable
	* libguile/vm.c (resolve_variable): Slight refactor.

	cpp hygiene in the vm
	* libguile/vm-engine.c:
	* libguile/vm-i-scheme.c:
	* libguile/vm-i-system.c: CPP hygiene: the code that #defines, #undefs.
	  Makes things cleaner given the multiple inclusion dance we do.

2013-05-27  Andy Wingo  <wingo@pobox.com>

	pop-continuation abort-continuation hooks pass return vals directly
	* doc/ref/api-debug.texi (VM Hooks): Update documentation.

	* libguile/vm.c (vm_dispatch_hook):
	* libguile/vm-engine.c:  Rework the hook machinery so that they can
	  receive an arbitrary number of arguments.  The return and abort
	  hooks will pass the values that they return to their continuations.
	  (vm_engine): Adapt to ABORT_CONTINUATION_HOOK change.

	* libguile/vm-i-system.c (return, return/values): Adapt to
	  POP_CONTINUATION_HOOK change.

	* module/system/vm/frame.scm (frame-return-values): Remove.  The
	  pop-continuation-hook will pass the values directly.

	* module/system/vm/trace.scm (print-return):
	  (trace-calls-to-procedure):
	  (trace-calls-in-procedure): Update to receive return values
	  directly.

	* module/system/vm/traps.scm (trap-in-procedure)
	  (trap-in-dynamic-extent): Ignore return values.
	  (trap-frame-finish, trap-calls-in-dynamic-extent)
	  (trap-calls-to-procedure): Pass return values to the handlers.

2013-05-27  Andy Wingo  <wingo@pobox.com>

	Allow vm_engine caller to pass arguments on the stack.
	* libguile/vm-engine.c (vm_engine): Allow the caller to pass arguments
	  on the stack.

	vm-engine: remove register assignments
	* libguile/vm-engine.c: Remove the register assignments inherited from
	  the 1990s.  GCC does seem to allocate reasonably on systems with
	  enough registers (e.g. x86-64), and on system with too few (ia32) we
	  disabled manual allocation.  Anyway this code was never tested, so
	  it's better to leave the compiler to do its own thing, until proven
	  otherwise.  Also in the RTL VM we don't need to allocate a register to
	  the SP, because it isn't accessed as much.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	remove some configurability in vm-engine
	* libguile/vm-engine.c: Remove the ability for the VM to check object
	  access, free variable access, and the ip.  They were off by default.
	  Since they will be different in the RTL VM, their presence is just
	  making things confusing.

	* libguile/vm.c: Remove corresponding error helpers.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	minor vm-engine cleanups
	* libguile/vm-engine.c: Some very minor cleanups: indenting, use of
	  VM_ASSERT, commenting.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	remove CONS macro in VM; use scm_cons instead
	* libguile/vm-engine.c (CONS): Remove.  Callers should use scm_cons
	  instead, syncing registers beforehand.
	  (POP_LIST): Adapt, only synchronizing once.
	  (POP_LIST_MARK, POP_CONS_MARK): Remove unused macros.

	* libguile/vm-i-scheme.c (cons):
	* libguile/vm-i-system.c (push-rest, bind-rest): Adapt.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	inline vm-engine.h into vm-engine.c
	* libguile/vm-engine.h:
	* libguile/vm-engine.c: Fold vm-engine.h into vm-engine.c.

	* libguile/Makefile.am: Adapt.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	add (find-mapped-elf-image) procedure to (system vm objcode) module
	* libguile/objcodes.c (register_elf, scm_find_mapped_elf_image): New
	  interfaces that keep a list of all ELF mappings.  Exported from the
	  (system vm objcode) module.

	* module/system/vm/objcode.scm: Export find-mapped-elf-image.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	refactor and simplify ELF loader in objcodes.c
	* libguile/objcodes.c (sniff_elf_alignment, alloc_aligned)
	  (copy_and_align_elf_data): New helpers for portably re-aligning ELF
	  data from read(2) or from a bytevector.
	  (load_thunk_from_memory): Simplify!  Now there is only one procedure
	  that loads ELF, and it does less: it simply receives the whole image
	  in one array, hopefully from mmap.

	  (scm_load_thunk_from_file): Use new map_file_contents helper, and go
	  through load_thunk_from_memory.
	  (scm_load_thunk_from_memory): Pass load_thunk_from_memory a piece of
	  memory that it owns, and that is appropriately aligned.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	add scm_{to,from}_{u,}intptr_t
	* libguile/numbers.h (scm_to_intptr_t, scm_from_intptr_t)
	  (scm_to_uintptr_t, scm_from_uintptr_t): New defines.

	* libguile/foreign.c: Remove definitions here; adapt callers to use new
	  names with _t suffixes.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	refactor linker to lay out ELF files and memory in the same way
	* module/system/vm/linker.scm (make-linker-object):
	  (linker-object-section-symbol):
	  (linker-object-symbols*): Create a symbol to the start of a linker
	  object.  Hide it from the external linker-object-symbols* accessor.

	  (segment-kind, count-segments): Sections without SHF_ALLOC don't get
	  segments.
	  (collate-objects-into-segments): Allow for #f segment types.  If two
	  sections have the same type and flags, leave them in the same order.

	  (align): Allow for 0 alignment.

	  (add-elf-objects): New helper: puts the ELF data structures (header,
	  segment table, and section table) in sections of their own.  This
	  lends a nice clarity and conceptual unity to the linker.

	  (relocate-section-header, allocate-segment): Lay out segments with
	  congruent, contiguous addresses, so that we can just mmap the file and
	  if debugging sections that are not in segments are present, they can
	  be lazily paged in if needed by the kernel's VM system.

	  (link-elf): Refactor to use the new interfaces.

	* test-suite/tests/linker.test: Update to expect the additional sections
	  for the header and section table.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	elf: add accessors for header members that might need relocation
	* module/system/vm/elf.scm (elf-header-shoff-offset)
	  (elf-section-header-addr-offset, elf-section-header-offset-offset):
	  New accessors.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	ELF refactor and consequent linker simplifications
	* module/system/vm/elf.scm: Add commentary.
	  (make-elf): Add a constructor similar to make-elf-segment and
	  make-elf-section.
	  (write-elf32-header, write-elf64-header, write-elf-header): Take an
	  <elf> instead of all the fields separately.
	  (<elf-segment>, <elf-section>): Add "index" property.  Adapt
	  constructors accordingly.

	* module/language/objcode/elf.scm (bytecode->elf): Arrange to set the
	  section indexes when creating ELF sections.

	* module/system/vm/linker.scm (fold-values): New helper.
	  (alloc-segment, relocate-section-header): Arrange to set segment and
	  section indexes.
	  (find-shstrndx): New helper, replaces compute-sections-by-name.  Now
	  that sections know their indexes, this is easier.
	  (allocate-elf, write-elf): New helpers, factored out of link-elf.
	  Easier now that sections have indexes.
	  (link-elf): Simplify.  Check that the incoming objects have sensible
	  numbers.

	* test-suite/tests/linker.test: Update to set #:index on the linker
	  objects.

2013-05-23  Andy Wingo  <wingo@pobox.com>

	split linker out of elf module
	* module/Makefile.am:
	* module/system/vm/linker.scm: New file, split out of (system vm elf).
	  (make-string-table, string-table-intern): Export under their bare
	  names, instead of make-elf-string-table and elf-string-table-intern.

	* module/system/vm/elf.scm: Remove linking capabilities.
	  (string-table-ref): Export.

	* module/language/objcode/elf.scm (bytecode->elf): Adapt to use (system
	  vm linker).

	* test-suite/tests/linker.test: New test.

2013-05-02  Aleix Conchillo Flaque  <aconchillo@gmail.com>

	web: uri-encode hexadecimal percent-encoding is now uppercase
	* module/web/uri.scm (uri-encode): the hexadecimal percent-encoding %HH
	  is now uppercased as suggested by RFC3986:

	      "For consistency, URI producers and normalizers should use
	       uppercase hexadecimal digits for all percent-encodings."

	* test-suite/tests/web-uri.test ("encode"): update tests.

2013-04-28  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Remove remaining ia64 port debug code.

	Finish Itanium port, correcting remaining failing test cases.
		* check/varargs.tst: Correct misplaced .align directive
		that was causing the double buffer to not be aligned at
		8 bytes.
		* lib/jit_ia64-cpu.c:
		  Properly implement abi for excess arguments passed on
		stack.
		  Simplify load/store with immediate displacement argument
		with zero value.
		  Simplify some calls to "subi" changing to "addi" with
		a negative argument.
		  Remove some #if 0'ed code, that could be useful in
		special conditions, but the most useful one would be
		to "optimize" "static" jit functions, but for the sake
		of simplicity, jit functions are implemented in a way
		that can be passed back to C code as C function pointers.
		  Add an attribute to prototypes of several unused functions.
		These functions are defined for the sake of implementing all
		Itanium documented instructions, but a significant amount of
		them is not used by lightning.
		* lib/jit_ia64-fpu.c: Simplify load/store with zero immediate
		displacement and add unused attribute for functions not used
		by lightning, but required to provide macros implementing all
		Itanium documented instructions.
		* lib/jit_ia64.c: Update for the properly implemented abi
		for stack arguments.
		* lib/lightning.c: Mark an unused function as such.

2013-04-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct remaining test cases, but not yet ones with stack arguments.
		lib/jit_ia64-cpu.c:
		  Correct immediate range check of integer comparisons when
		inverting arguments.
		  Correct gei_u that was not decrementing immediate when
		inverting arguments.
		  Correct b?add* and b?sub* that were not properly updating
		the result register.

2013-04-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct the cvt.tst test case on Itanium.
		* lib/jit_ia64-cpu.c: Correct wrong mapping of 2 instructions
		in "M-, stop, M-, stop" translation, that was ignoring the
		last stop (implemented as a nop I- stop).

		* lib/jit_ia64-fpu.c: Properly implement fnorm.s and fnorm.d,
		as well as the proper integer to float or double conversion.

2013-04-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct all ldst test cases.
		* lib/jit_ia64-cpu.c: Correct bogus implementation of ldr_T
		for signed integers, that was using ld1.s, ld2.s and ld4.s.
		The ".s" stands for speculative load, not sign extend.

		* lib/jit_ia64-fpu.c: Correct bogus implementation of ldxr_T
		for float and double. The third (actually, second) argument
		is indeed added to the base register, but the base register
		is modified. The actual M7 implementation was already correct,
		just the ldxr_f and ldxr_d implementation that was kept in
		a prototype state, misinterpreting what M7 does.

2013-04-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct float division and LX with stop code generation.
		* lib/jit_ia64-cpu.c: Correct X2 pattern matching by preventing
		it to attempt to require a stop between the L and the X
		instruction; that is, check the registers and predicates
		before emitting the L instruction, not after.

		* lib/jit_ia64-fpu.c: Slightly simplify and correct
		divr_f and divrd_d implementation.

		* check/lightning.c: Add __ia64__ preprocessor define
		on Itanium.

		* check/alu.inc, check/clobber.tst, check/float.tst: Define
		several macros conditionally to __ia64__. This is required
		because __ia64__ jit generation can use way too many memory,
		due to not implementing instruction reordering to avoid
		as much as possible "stops", what causes way too many nops
		to be generated, as well as the fact that division and
		remainder requires function calls, and float division
		requires significant code to implement.

2013-04-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement fpr register arguments and minor extra fixes.
		* include/lightning.h: Add new backend specific movr_w_d,
		movr_d_w and movi_d_w codes as helpers to ia64 varargs
		functions arguments.

		* lib/jit_ia64-cpu.c:
		  Correct wrong encoding of A5 small integers.
		  Correct define of "mux" instruction modifiers.
		  Correct ordering of arguments and predicates of cmp_xy
		implementation with immediate arguments; like most other
		codes with an immediate, the immediate is the second, not
		the third argument.

		* lib/jit_ia64-fpu.c: Actual implementation of the code
		to move to/from gpr to/from fpr, to implement varargs abi.

		* lib/jit_ia64.c: Make fpr argument registers not allocatable
		as temporaries, no need for the extra checks when there are
		plenty registers.

		* lib/jit_print.c, lib/lightning.c: Minor updates for the
		new movr_w_d, movr_d_w and movi_d_w codes.

2013-04-27  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct race condition if register is written more than once
		* lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c: Correct code to
		also insert a stop to break an instruction group if a
		register is written more than once in the same group.
		This may happen if a register is argument and result of
		some lightning call (not a real instruction). The most
		common case should be code in the pattern:
			movl rn=largenum
			...
			mov rn=smallnum
		where "rn" would end up holding "largenum".
		But the problem possibly could happen in other circumstances.

	Correct jit implementation to pass several test cases.
		* include/lightning/jit_ia64.h, lib/jit_ia64-cpu.c,
		lib/jit_ia64-fpu.c, lib/jit_ia64.c:
		  Relocate JIT_Rn registers to the local registers, as, like
		float registers, div/rem and sqrt are implemented as function
		calls, and may overwrite non saved scratch registers.
		  Change patch_at to receive a jit_code_t instead of a
		jit_node_t, so that it is easier to "inline" patches when
		some instruction requires complex code to implement, e.g.
		uneq and ltgt.
		  Correct arguments to FMA and FMA like instructions that,
		due to a cut&paste error were passing the wrong argument
		to the related F- implementation function.
		  Rewrite ltgt to return the proper result if one (or both)
		of the arguments is unordered.

2013-04-26  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Properly split instruction groups for predicate registers.
		* include/lightning/jit_ia64.h, include/lightning/jit_private.h,
		lib/jit_ia64-cpu.c, lib/jit_ia64-fpu.c, lib/jit_ia64.c,
		lib/lightning.c: Rework code to detect need of a "stop" to
		also handle predicates, as if a predicate is written, it
		cannot be read in the same instruction group.
		  Use a single jit_regset_t variable for all registers when
		checking need for a stop (increment value by 128 for
		float registers).
		  Correct wrong "subi" implementation, as the code executed
		is r0=im-r1, not r0=r1-im.
		  Use standard lightning 6 fpr registers, and rework to
		use callee save float registers, that may be spill/reloaded
		in prolog/epilog. This is required because some jit
		instructions implementations need to call functions; currently
		integer div/mod and float sqrt, what may change the value of
		scratch float registers.
		  Rework point of "sync" of branches that need to return a
		patch'able address, because the need for a "stop" before a
		predicate read causes all branches to be the instruction
		in slot 0, as there is no template to "stop" and branch
		in the same instruction "bundle".

2013-04-26  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add basic Itanium port infrastructure.
		* include/lightning/jit_ia64.h, lib/jit_ia64-cpu.c,
		lib/jit_ia64-fpu.c, lib/jit_ia64.c: New files implementing
		the basic infrastructure of an Itanium port. The code
		compiles and can generate jit for basic hello world like
		functions.

		* check/lightning.c, configure.ac, include/lightning.h,
		include/lightning/Makefile.am, include/lightning/jit_private.h,
		lib/Makefile.am, lib/lightning.c: Update for the Itanium
		port.

		* lib/jit_mips-cpu.c, lib/jit_mips.c: Correct typo and
		make the jit_carry register local to the jit_state_t.
		This matches code reviewed in the Itanium port, that
		should use the same base logic to handle carry/borrow.

2013-04-14  Mark H Weaver  <mhw@netris.org>

	Manual: fix 'my-or' examples to use let-bound variable.
	Fixes <http://bugs.gnu.org/14203> reported by Nikita Karetnikov.

	* doc/ref/api-macros.texi (Defining Macros, Syntax Rules): Fix
	  definition of 'my-or' example macro to use the let-bound variable.

2013-04-14  Ludovic Courtès  <ludo@gnu.org>

	tests: Use shell constructs that /bin/sh on Solaris 10 can understand.
	Partly fixes <http://bugs.gnu.org/14042>.
	Reported by Marc Girod <marc.girod@gmail.com>

	* test-suite/standalone/test-language: Use a shell construct that
	  /bin/sh on Solaris 10 can understand.

2013-04-14  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		GUILE-VERSION
		libguile/array-map.c
		libguile/fports.h
		libguile/gc.h
		libguile/inline.h
		libguile/ports.c
		libguile/ports.h
		libguile/print.c
		libguile/r6rs-ports.c
		libguile/read.c
		test-suite/tests/00-socket.test

	Using 'pass-if-equal' in coding.test.
	* test-suite/tests/coding.test ("block comments", "line comments"):
	  Use 'pass-if-equal'.

	Adjust BOM tests to reflect the fact that big endian is used by default.
	* test-suite/tests/ports.test ("BOM not discarded unless at start of
	  UTF-16 stream", "BOM not discarded unless at start of UTF-32 stream"):
	  Adjust tests to reflect the fact that, in the absence of a BOM, big
	  endian will be used by default for the "UTF-16" and "UTF-32"
	  encodings.

2013-04-11  Mark H Weaver  <mhw@netris.org>

	Add 2012 and 2013 to copyright notice on numbers.test.
	* test-suite/tests/numbers.test: Add 2012 and 2013 to copyright notice.
	  It was modified both of those years.

2013-04-10  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Make it simpler to add support for more than 64 registers.
		* include/lightning/jit_private.h, lib/jit_arm.c,
		lib/jit_mips-cpu.c, lib/jit_mips.c, lib/jit_ppc-cpu.c,
		lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
		lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
		lib/lightning.c: Change all jit_regset macros to take
		a pointer argument, to avoid structure copies when
		adding a port to an architecture with more than 64
		registers.

2013-04-10  Mark H Weaver  <mhw@netris.org>

	Do not add $(EXEEXT) to guild or guile-tools.
	* meta/Makefile.am (install-exec-hook): Do not add $(EXEEXT) to guild or
	  guile-tools.

2013-04-10  Ludovic Courtès  <ludo@gnu.org>

	Mention `open-file' in NEWS.

	doc: Require libunistring 0.9.3 in `README'.
	* README: Require libunistring 0.9.3.  The <unitypes.h> header in 0.9.1
	  lacks the _UC_ATTRIBUTE_CONST definition, leading to build failures.

	build: Tell `gen-scmconfig' whether the system has `struct timespec'.
	* configure.ac: Reinstate `struct timespec' check removed in commit
	  7e7c6f6a937005b08fffd5aeccdf992459b07137, but define
	  `HAVE_SYSTEM_STRUCT_TIMESPEC' instead of `HAVE_STRUCT_TIMESPEC'.
	* libguile/gen-scmconfig.c (main): Change `HAVE_STRUCT_TIMESPEC' to
	  `HAVE_SYSTEM_STRUCT_TIMESPEC'.

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

	doc: Update `release.org'.
	* doc/release.org: Recommend "distcheck".  Add `makeinfo' to the
	  bootstrap tool list.

	stime: Remove #ifdef HAVE_*_H for headers provided by Gnulib.
	* libguile/stime.c: Remove #ifdef HAVE_SYS_TIMES_H, HAVE_SYS_TYPES_H,
	  and HAVE_STRING_H since those headers are always provided by Gnulib
	  when the corresponding macro is undefined.  Fixes a regression on
	  MinGW introduced by commit 40e2a31.

	Make `build-aux/gendocs.sh' executable.

2013-04-09  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 2.0.8.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	  (LIBGUILE_INTERFACE_CURRENT): Increment, to account for new C
	  functions `scm_c_bind_keyword_arguments' et al.
	  (LIBGUILE_INTERFACE_AGE): Increment.

	tests: Skip FFI tests involving `scm_is_pair' when `dynamic-func' fails.
	* test-suite/tests/foreign.test ("make-pointer")["equal? modulo
	  finalizer", "equal? modulo finalizer (set-pointer-finalizer!)"]: Wrap
	  `dynamic-func' in `false-if-exception' (static builds on NetBSD 5.1
	  raise "Symbol not found" here.)

	doc: Cosmetic change for `release.org'.
	* doc/release.org: Add #+STARTUP.

	Update `THANKS'.

2013-04-09  Andy Wingo  <wingo@pobox.com>

	update NEWS
	* NEWS: Updates.

	fix stime patch for HAVE_TIMES removal
	* libguile/stime.c (scm_init_stime): Fix previous patch.  At this point
	  in the source, we definitely have a run-time function, but don't
	  necessarily have a real-time function.

2013-04-09  Andy Wingo  <wingo@pobox.com>

	simplify configure checks for functionality provided by gnulib
	* configure.ac: Remove checks for pipe, stftime, times, and select, as
	  our Gnulib modules already ensure they are provided.

	* libguile/stime.c: Rely on gnulib providing `times'.

2013-04-09  Mark H Weaver  <mhw@netris.org>

	Minor 'THANKS' fix.

	Fix alignment in 'THANKS'.

	Update bug report section of 'THANKS'.

	Update 'THANKS'.

2013-04-09  Mark H Weaver  <mhw@netris.org>

	Manual: Don't promise to signal an error for an illegal 'letrec'.
	Reported by Nikita Karetnikov <nikita@karetnikov.org>.

	* doc/ref/api-binding.texi (Local Bindings): Remove the incorrect claim
	  that improperly accessing a letrec-bound variable during evaluation of
	  its initializers will necessarily cause an error to be signalled.

2013-04-09  Ludovic Courtès  <ludo@gnu.org>

	tests: Skip IPv6 socket tests when OS support is missing.
	Reported by Samuel Thibault <samuel.thibault@gnu.org>
	and Peter Simons <simons@cryp.to>.

	* test-suite/tests/00-socket.test ("AF_INET6/SOCK_STREAM"): Throw
	  `unresolved' when `bind' throws EADDRNOTAVAIL.

2013-04-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Ensure the end argument of __clear_cache is page aligned.
		* lib/jit_arm.c, lib/jit_ppc.c: Do not rely on __clear_cache
		aligning to the next page boundary the end argument. It may
		actually truncate it.

2013-04-08  Mark H Weaver  <mhw@netris.org>

	Update 'NEWS'.

	Update 'NEWS'.

	Consume a peeked EOF at the REPL.
	* module/system/repl/repl.scm (meta-reader): Consume peeked EOF.

2013-04-08  Mark H Weaver  <mhw@netris.org>

	Miscellaneous 'sendfile' fixes and improved tests.
	* libguile/filesys.c (scm_sendfile): In Linux-style sendfile(2) code, if
	  EINTR or EAGAIN occurs, set result to 1 (not 0) so that we actually
	  keep going.  In non-sendfile(2) code, deal gracefully with short reads
	  due to EOF.

	* test-suite/tests/filesys.test ("sendfile"): Use 'let*' to guarantee
	  the needed order of operations: write (test-file) and then read it.
	  Add code to check the written data (not just the returned length) in
	  all tests, including the cases that hit EOF prematurely.

2013-04-07  Mark H Weaver  <mhw@netris.org>

	Update 'NEWS'.

2013-04-07  Ludovic Courtès  <ludo@gnu.org>

	Change `sendfile' to loop until everything has been sent.
	* libguile/filesys.c (scm_sendfile)[HAVE_SYS_SENDFILE_H &&
	  HAVE_SENDFILE]: Compare RESULT with C_COUNT.  Loop until C_COUNT bytes
	  have been sent.
	* doc/ref/posix.texi (File System): Update the description.  Explain the
	  new semantics.
	* test-suite/tests/filesys.test ("sendfile"): Rewrite using
	  `pass-if-equal'.  Check the return value for all the tests.
	  ["file with offset past the end", "file with offset near the end"]:
	  New tests.

2013-04-07  Mark H Weaver  <mhw@netris.org>

	Remove outdated and misplaced "Included Guile Modules" node from manual.
	* doc/ref/api-modules.texi (Included Guile Modules): Remove.
	  (Using Guile Modules): Fix cross reference.

	Clarify 'file-encoding' docs: heuristics may be improved later.
	* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
	  Mention UTF-8 as another common encoding used for Scheme source files,
	  and that it is used by default.  Change the description to leave open
	  the possibility of adding additional heuristics in the future.
	  Mention that if the coding declaration is in a #!-style block comment,
	  it must be the first such comment in the file.  Mention the
	  '#:guess-encoding' keyword argument.

2013-04-07  Mark H Weaver  <mhw@netris.org>

	Add keyword arguments to file opening procedures.
	* libguile/fports.c (scm_open_file_with_encoding): New API function,
	  containing the code previously found in 'scm_open_file', but modified
	  to accept the new 'guess_encoding' and 'encoding' arguments.

	  (scm_open_file): Now just a simple wrapper that calls
	  'scm_open_file_with_encoding'.

	  (scm_i_open_file): New implementation of 'open-file' that accepts
	  keyword arguments '#:guess-encoding' and '#:encoding', and calls
	  'scm_open_file_with_encoding'.

	  (scm_init_fports_keywords): New initialization function that gets
	  called after keywords are initialized.

	* libguile/fports.h (scm_open_file_with_encoding,
	  scm_init_fports_keywords): Add prototypes.

	* libguile/init.c (scm_i_init_guile): Call 'scm_init_fports_keywords'.

	* module/ice-9/boot-9.scm: Add enhanced versions of 'open-input-file',
	  'open-output-file', 'call-with-input-file', 'call-with-output-file',
	  'with-input-from-file', 'with-output-to-file', and
	  'with-error-to-file', that accept keyword arguments '#:binary',
	  '#:encoding', and (for input port constructors) '#:guess-encoding'.

	* doc/ref/api-io.texi (File Ports): Update documentation.

	* test-suite/tests/ports.test ("keyword arguments for file openers"):
	  Add tests.

2013-04-07  Chris K. Jester-Young  <cky944@gmail.com>

	Add record type printer for srfi-41.
	* module/srfi/srfi-41.scm: Add record type printer for streams.
	  (stream-promise-visit): New helper for visiting stream promises.

	Add record type printer for srfi-45.
	* module/srfi/srfi-45.scm: Add record type printer for promises.
	  (promise-visit): New helper for visiting lazy promises.

2013-04-07  Mark H Weaver  <mhw@netris.org>

	Implement efficient 'scm_unget_bytes' and 'unget-bytevector'.
	* libguile/ports.c (scm_i_unget_bytes): New static function.
	  (scm_unget_bytes): New API function.
	  (scm_unget_byte): Rewrite to simply call 'scm_i_unget_bytes'.
	  (scm_ungetc, scm_peek_char, looking_at_bytes): Use 'scm_i_unget_bytes'.

	* libguile/ports.h: Add prototype for 'scm_unget_bytes'.

	* libguile/fports.c (scm_setvbuf): Use 'scm_unget_bytes'.

	* libguile/r6rs-ports.c (scm_unget_bytevector): New procedure.

	* module/ice-9/binary-ports.scm (unget-bytevector): New export.

	* doc/ref/api-io.texi (R6RS Binary Input): Add documentation.
	  (R6RS I/O Ports): Update brief description of (ice-9 binary-ports) to
	  reflect the new reality: it is no longer a subset of (rnrs io ports).

	* test-suite/tests/ports.test ("unget-bytevector"): Add test.

2013-04-07  Mark H Weaver  <mhw@netris.org>

	Remove byte-order mark check from 'scm_i_scan_for_encoding'.
	* libguile/read.c (scm_i_scan_for_encoding): Remove byte-order mark
	  check.

2013-04-07  Mark H Weaver  <mhw@netris.org>

	Do not scan for coding declarations in open-file.
	* libguile/fports.c (scm_open_file): Do not scan for coding
	  declarations.  Replace 'use_encoding' local variable with
	  'binary'.  Update documentation string.

	* module/ice-9/psyntax.scm (include): Add the same file-encoding
	  logic that's used in compile-file and scm_primitive_load.

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

	* doc/ref/api-io.texi (File Ports): Update docs.

	* test-suite/tests/ports.test: Change "open-file HONORS file coding
	  declarations" test to "open-file IGNORES file coding declaration".

	* test-suite/tests/coding.test (scan-coding): Use 'file-encoding' to
	  scan for the encoding, since 'open-input-file' no longer does so.

2013-04-07  Ludovic Courtès  <ludo@gnu.org>

	doc: Link exceptions and escape continuations.
	* doc/ref/api-control.texi (Prompt Primitives): Mention exceptions.
	  (Exception Terminology): Link to `call/ec'.

	doc: Warn against misuses of `file-name-separator-string'.
	* doc/ref/posix.texi (File System): Warn against misuses of
	  `file-name-separator-string'.

2013-04-07  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Don't use scm_generalized_vector_get_handle() in array-map.c
	* libguile/array-map.c: (rafill, racp, ramap, rafe): use
	  scm_array_get_handle() instead of scm_generalized_get_vector_handle().

2013-04-07  Mark H Weaver  <mhw@netris.org>

	Fix the recommendations for conversion of C string constants.
	* doc/ref/api-data.texi (Conversion to/from C, Symbol Primitives,
	  Keyword Procedures): Fix the recommendations for conversion of C
	  string constants.  The encoding of the source code is irrelevant in
	  modern compilers.  What is relevant is the execution character set.
	  Both GCC and clang use UTF-8 by default, so recommend the
	  'scm_from_utf8_*' functions when the argument is a C string constant.

	  Also fix the broken texinfo markup for 'scm_from_*_symbol' that
	  prevented them from being listed in the index.

2013-04-07  Mark H Weaver  <mhw@netris.org>

	Fix indentation in test-scm-c-bind-keyword-arguments.c.
	* test-suite/standalone/test-scm-c-bind-keyword-arguments.c
	  (test_invalid_keyword): Fix indentation.

2013-04-07  Mark H Weaver  <mhw@netris.org>

	Implement 'scm_c_bind_keyword_arguments'.
	* libguile/keywords.c (scm_keyword_argument_error): New variable.
	  (scm_c_bind_keyword_arguments): New API function.

	* libguile/keywords.h (enum scm_keyword_arguments_flags): New enum.
	  (scm_t_keyword_arguments_flags): New typedef.
	  (scm_c_bind_keyword_arguments): New prototype.

	* doc/ref/api-data.texi (Coding With Keywords, Keyword Procedures): Add
	  documentation.

	* test-suite/standalone/test-scm-c-bind-keyword-arguments.c: New file.

	* test-suite/standalone/Makefile.am: Add
	  test-scm-c-bind-keyword-arguments test.

2013-04-06  Andy Wingo  <wingo@pobox.com>

	NEWS tweaks
	* NEWS: Correct some errors.

2013-04-06  Mark H Weaver  <mhw@netris.org>

	Bump 'copyright-year' to 2013.
	* module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to
	  2013.

2013-04-06  Ian Price  <ianprice90@googlemail.com>

	Remove duplicate definitions of `call/ec' and `let/ec'.
	* module/language/tree-il/peval.scm (let/ec): Remove. Import
	  (ice-9 control).
	* module/sxml/match.scm (%call/ec-prompt, call/ec, let/ec):
	  Remove. Import (ice-9 control).

2013-04-06  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

	doc: Document `--language'.
	* doc/ref/guile-invoke.texi (Command-line Options): Document `--language'.

	doc: Document file name separator procedures.
	* doc/ref/posix.texi (File System): Document
	  `system-file-name-convention', `file-name-separator?',
	  `absolute-file-name?', and `file-name-separator-string'.

2013-04-06  Chris K. Jester-Young  <cky944@gmail.com>

	Use a fresh cons for %stream-null.
	* module/srfi/srfi-41.scm (%stream-null): Use a fresh cons rather than
	  a literal cons. You never know what peval constant-folding could do
	  with the latter, either now or in the future.

2013-04-05  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

2013-04-05  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Deprecate scm_array_fill_int()
	* libguile/array-map.h, libgule/array-map.c: move scm_array_fill_int
	  to the deprecated section.

	Remove double indirection in array-fill!
	* libguile/array-map.c: new function rafill, like scm_array_fill_int,
	  but factors GVSET out of the loop. Use it in scm_array_fill_x instead of
	  scm_array_fill_int.
	* test-suite/tests/arrays.test: add test for array-fill! with stride != 1.

	Tests for array-copy!
	* test-suite/tests/arrays.test: tests for arguments of rank 0, 1 and 2.

2013-04-05  Ludovic Courtès  <ludo@gnu.org>

	Add `call/ec' and `let/ec'.
	Based on a patch by Nala Ginrut <nalaginrut@gmail.com>,
	with suggestions from Mark H. Weaver.

	* module/ice-9/control.scm (call-with-escape-continuation, call/ec): New
	  procedures.
	  (let-escape-continuation, let/ec): New macros.
	* module/ice-9/futures.scm (let/ec): Remove.
	* test-suite/tests/control.test ("escape-only continuations")["call/ec",
	  "let/ec"]: New tests.
	* doc/ref/api-control.texi (Prompt Primitives): Document `call/ec',
	  `let/ec', and their long names.

2013-04-05  Ludovic Courtès  <ludo@gnu.org>

	tests: Add `pass-if-equal' support in `c&e'.
	* test-suite/test-suite/lib.scm (c&e): Add case for `pass-if-equal'.

2013-04-05  Mark H Weaver  <mhw@netris.org>

	Use 'c_strcasecmp' instead of 'strcasecmp'.
	* libguile/ports.c (scm_new_port_table_entry, get_codepoint,
	  scm_i_set_default_port_encoding, scm_i_port_iconv_descriptors,
	  scm_i_set_port_encoding_x):
	* libguile/print.c (display_string_using_iconv):
	* libguile/read.c (scm_i_scan_for_encoding): Use 'c_strcasecmp'.

	Import 'c-strcase' from Gnulib.
	* lib/Makefile.am:
	* m4/gnulib-cache.m4: Add 'c-strcase' Gnulib module.

2013-04-05  Chris K. Jester-Young  <cky944@gmail.com>

	Revert "Add record type printers for srfi-41 and srfi-45."
	This reverts commit 4a1cdc9d5d643d05fa7a18febc7c12070f3ef6d9, which was
	prematurely pushed.

	Add record type printers for srfi-41 and srfi-45.
	* module/srfi/srfi-41.scm: Add record type printer for streams.
	* module/srfi/srfi-45.scm: Add record type printer for promises.

2013-04-05  Mark H Weaver  <mhw@netris.org>

	Improve handling of Unicode byte-order marks (BOMs).
	* libguile/ports-internal.h (struct scm_port_internal): Add new members
	  'at_stream_start_for_bom_read' and 'at_stream_start_for_bom_write'.
	  (SCM_UNICODE_BOM): New macro.
	  (scm_i_port_iconv_descriptors): Add 'mode' parameter to prototype.

	* libguile/ports.c (scm_new_port_table_entry): Initialize
	  'at_stream_start_for_bom_read' and 'at_stream_start_for_bom_write'.
	  (get_iconv_codepoint): Pass new 'mode' parameter to
	  'scm_i_port_iconv_descriptors'.
	  (get_codepoint): After reading a codepoint at stream start, record
	  that we're no longer at stream start, and consume a BOM where
	  appropriate.
	  (scm_seek): Set the stream start flags according to the new position.
	  (looking_at_bytes): New static function.
	  (scm_utf8_bom, scm_utf16be_bom, scm_utf16le_bom, scm_utf32be_bom,
	  scm_utf32le_bom): New static const arrays.
	  (decide_utf16_encoding, decide_utf32_encoding): New static functions.
	  (scm_i_port_iconv_descriptors): Add new 'mode' parameter.  If the
	  specified encoding is UTF-16 or UTF-32, make that precise by deciding
	  what byte order to use, and construct iconv descriptors based on the
	  precise encoding.
	  (scm_i_set_port_encoding_x): Record that we are now at stream start.
	  Do not open the new iconv descriptors immediately; let them be
	  initialized lazily.

	* libguile/print.c (display_string_using_iconv): Record that we're no
	  longer at stream start.  Write a BOM if appropriate.

	* doc/ref/api-io.texi (BOM Handling): New node.

	* test-suite/tests/ports.test ("set-port-encoding!, wrong encoding"):
	  Adapt test to cope with the fact that 'set-port-encoding!' does not
	  immediately open the iconv descriptors.
	  (bv-read-test): New procedure.
	  ("unicode byte-order marks (BOMs)"): New test prefix.

2013-04-04  Mark H Weaver  <mhw@netris.org>

	Peeks do not consume EOFs.
	Fixes <http://bugs.gnu.org/12216>.

	* libguile/ports-internal.h (struct scm_port_internal): Add
	  'pending_eof' flag.

	* libguile/ports.c (scm_i_set_pending_eof, scm_i_clear_pending_eof): New
	  static functions.
	  (scm_new_port_table_entry): Initialize 'pending_eof'.
	  (scm_i_fill_input): Check for 'pending_eof'.
	  (scm_i_peek_byte_or_eof): Set 'pending_eof' flag before returning EOF.
	  (scm_end_input, scm_unget_byte, scm_seek, scm_truncate): Clear
	  'pending_eof'.
	  (scm_peek_char): Set 'pending_eof' flag before returning EOF.

	* test-suite/tests/ports.test ("pending EOF behavior"): Add tests.

2013-04-04  Mark H Weaver  <mhw@netris.org>

	Nicer docstring syntax for case-lambda.
	* module/ice-9/psyntax.scm (case-lambda, case-lambda*): Allow a
	  docstring to be placed immediately after the 'case-lambda' or
	  'case-lambda*'.

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

	* doc/ref/api-procedures.texi (Case-lambda): Update docs.

	* test-suite/tests/optargs.test ("case-lambda", "case-lambda*"):
	  Add tests.

2013-04-04  Mark H Weaver  <mhw@netris.org>

	Cross reference 'SRFI-9 Records' directly instead of 'SRFI-9'.
	* doc/ref/api-compound.texi (Record Overview, Records):
	  doc/ref/api-modules.texi (Included Guile Modules):
	  doc/ref/r6rs.texi (R6RS Records): Cross reference 'SRFI-9 Records'
	  directly instead of 'SRFI-9'.

2013-04-03  Mark H Weaver  <mhw@netris.org>

	Preserve the case of the user-specified port encoding string.
	* libguile/ports.c (scm_i_set_port_encoding_x): Always copy the
	  user-provided port encoding string, so that its case will be preserved
	  and returned exactly by subsequent calls to 'port-encoding'.

2013-04-03  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Remove double indirection for 1st arg of array-for-each
	* libguile/array-map.c: (rafe): factor GVREF out of rank-1 loop for ra0.

2013-04-03  Ludovic Courtès  <ludo@gnu.org>

	tests: Add `array-for-each' tests for one-dimensional traversals.
	* test-suite/tests/ramap.test ("array-for-each")["1 source"]: New test
	  prefix.

	tests: Use `pass-if-equal' in ramap.test.
	* test-suite/tests/ramap.test ("array-for-each"): Use `pass-if-equal'
	  instead of `(pass-if ... (equal? ...))'.

2013-04-03  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Remove double indirection in array-map! with <2 args
	* libguile/array-map.c: (ramap): factor GVSET/GVREF out of rank-1 loop
	  for ra0 and the first element of ras.

	Avoid per-element cons for 1-arg case of array-map!
	* libguile/array-map.c: (ramap): special case when ras is a 1-element list.

	Deprecate dead code in array-map.c
	* libguile/array-map.c, libguile/array-map.h: deprecate scm_ra_eqp,
	  scm_ra_lessp, scm_ra_leqp, scm_ra_grp, scm_ra_greqp, scm_ra_sum,
	  scm_ra_product, scm_ra_difference, scm_ra_divide, scm_array_identity.

2013-04-03  Mark H Weaver  <mhw@netris.org>

	Use 'strcasecmp' to compare encoding names.
	Reported by Ludovic Courtès <ludo@gnu.org>.

	* libguile/ports.c (scm_new_port_table_entry,
	  scm_i_set_default_port_encoding, scm_i_set_port_encoding_x):
	  libguile/read.c (scm_i_scan_for_encoding): Use 'strcasecmp' to compare
	  encoding names.

2013-04-03  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Remove double indirection in element access in array-copy!
	* libguile/array-map.c: (racp): factor scm_generalized_vector_ref,
	  scm_generalized_vector_set_x out of the rank-1 loop.

2013-04-03  Mark H Weaver  <mhw@netris.org>

	Remove BOM tests that depend on GNU iconv behavior.
	* test-suite/tests/ports.test ("unicode byte-order marks (BOMs)"):
	  Remove tests that depend on GNU iconv behavior.  We will add them back
	  when we have portable BOM support.

2013-04-03  Mark H Weaver  <mhw@netris.org>

	Rename 'scm_i_get_byte_or_eof' et al; mark them as SCM_API.
	* libguile/ports.c (scm_i_get_byte_or_eof, scm_i_peek_byte_or_eof):
	  Rename to 'scm_slow_get_byte_or_eof' and 'scm_slow_peek_byte_or_eof',
	  respectively.

	* libguile/ports.h (scm_i_get_byte_or_eof, scm_i_peek_byte_or_eof):
	  Rename to 'scm_slow_get_byte_or_eof' and 'scm_slow_peek_byte_or_eof',
	  respectively, and mark them as SCM_API.

	* libguile/inline.h (scm_get_byte_or_eof, scm_peek_byte_or_eof): Adjust
	  to use the new names.

2013-04-03  Mark H Weaver  <mhw@netris.org>

	Remove uses of GC_PTR in 'finalize_iconv_descriptors'.
	* libguile/ports.c (finalize_iconv_descriptors): Change GC_PTR to
	  (void *) in parameter types.

2013-04-02  Mark H Weaver  <mhw@netris.org>

	Rewrite get_iconv_codepoint to fix a bug involving byte-order marks.
	* libguile/ports.c (get_iconv_codepoint): Rewrite to fix a bug and
	  improve efficiency and clarity.  Previously, it incorrectly assumed
	  that iconv would never consume input without producing output, which
	  led to a buffer overrun and subsequent assertion failure.  This
	  happens when a byte-order mark is consumed by iconv at the beginning
	  of the stream when using the UTF-16 or UTF-32 encodings.

	* test-suite/tests/ports.test (unicode byte-order marks (BOMs)):
	  Add tests.

2013-04-02  Mark H Weaver  <mhw@netris.org>

	Move slow path out of 'scm_get_byte_or_eof' et al.
	Suggested by Andy Wingo.

	* libguile/inline.h (scm_get_byte_or_eof, scm_peek_byte_or_eof): Keep
	  only the fast path here, with fallback to 'scm_i_get_byte_or_eof' and
	  'scm_i_peek_byte_or_eof'.

	* libguile/ports.c (scm_i_get_byte_or_eof, scm_i_peek_byte_or_eof):
	  New internal functions.

	* libguile/ports.h (scm_i_get_byte_or_eof, scm_i_peek_byte_or_eof): Add
	  prototypes.

2013-04-02  Mark H Weaver  <mhw@netris.org>

	Add a static version of 'scm_fill_input' to ports.c.
	* libguile/ports.c (scm_i_fill_input): New static function, containing
	  the code that was previously in 'scm_fill_input'.
	  (scm_fill_input): Simply call 'scm_i_fill_input'.
	  (scm_c_read): Use 'scm_i_fill_input'.

2013-04-01  Mark H Weaver  <mhw@netris.org>

	Move the port alist from the hash table to the internal port structure.
	* libguile/ports-internal.h (struct scm_port_internal): Add 'alist'
	  member.

	* libguile/ports.c (scm_i_port_alist, scm_i_set_port_alist_x): New
	  internal functions.
	  (scm_i_port_weak_hash): Update comment: the hash table is no longer
	  used to store the port's alist.
	  (scm_new_port_table_entry): Initialize 'alist'.  Store SCM_BOOL_F in
	  the port weak hash, not SCM_EOL.

	* libguile/ports.h (scm_i_port_alist, scm_i_set_port_alist_x): Add
	  protoypes.

	* libguile/read.c (set_port_read_option, init_read_options): Access the
	  port's alist via 'scm_i_port_alist' and 'scm_i_set_port_alist_x'.

2013-04-01  Mark H Weaver  <mhw@netris.org>

	Optimize 'get-bytevector-some'; it may now read less than possible.
	* libguile/r6rs-ports.c (scm_get_bytevector_some): Rewrite to
	  efficiently take the contents of the read/putback buffers.  In the
	  docstring, clarify that it might not return all available bytes.

	* doc/ref/api-io.texi (R6RS Binary Input): Clarify that
	  'get-bytevector-some' might not return all available bytes.

	* test-suite/tests/r6rs-ports.test ("get-bytevector-some [only-some]"):
	  Remove bogus test, which requires more than the R6RS requires.

2013-04-01  Mark H Weaver  <mhw@netris.org>

	Refactor port encoding modes: utf-8 and iconv
	Based on 6c98257f2ead0855f218369ea7f9a823cdb9727e by Andy Wingo.

	* libguile/ports-internal.h (struct scm_port_internal): Add a flag
	  for the port encoding mode: UTF8 or iconv.  The iconv descriptors
	  are now in a separate structure so that we can avoid attaching
	  finalizers to the ports themselves in the future.
	  (enum scm_port_encoding_mode): New enum.
	  (struct scm_iconv_descriptors): New struct.
	  (scm_i_port_iconv_descriptors): Add prototype.

	* libguile/ports.c (finalize_port): Don't close iconv descriptors here.
	  (scm_new_port_table_entry): Adapt to the iconv descriptors being
	  moved.  Initialize 'encoding_mode'.
	  (scm_i_remove_port): Adapt to call 'close_iconv_descriptors'.
	  (close_iconv_descriptors): New static function.
	  (get_iconv_codepoint): Use 'scm_i_port_iconv_descriptors'.
	  (get_codepoint): Check the port 'encoding_mode'.
	  (finalize_iconv_descriptors, open_iconv_descriptors,
	  close_iconv_descriptors, scm_i_port_iconv_descriptors): New static
	  functions.
	  (scm_i_set_port_encoding_x): Adapt to iconv descriptors being moved
	  to separate structure, to set the 'encoding_mode' flag, and to use
	  'open_iconv_descriptors' and 'close_iconv_descriptors'.

	* libguile/print.c (display_string_using_iconv): Use
	  'scm_i_port_iconv_descriptors'.
	  (display_string): Use 'encoding_mode' flag.

2013-04-01  Mark H Weaver  <mhw@netris.org>

	Add internal-only port structure and move iconv descriptors there.
	* libguile/ports-internal.h: New file.

	* libguile/Makefile.am (noinst_HEADERS): Add ports-internal.h.

	* libguile/ports.h (scm_t_port): Add a comment mentioning that the
	  'input_cd' and 'output_cd' fields of the public structure are no
	  longer what they seem to be.

	* libguile/ports.c: Include ports-internal.h.

	  (finalize_port, scm_i_remove_port, get_iconv_codepoint, get_codepoint,
	  scm_i_set_port_encoding_x): Access 'input_cd' and 'output_cd' via the
	  new internal port structure.

	  (scm_new_port_table_entry): Allocate and initialize the internal port
	  structure.

	* libguile/print.c: Include ports-internal.h.

	  (display_string_using_iconv, display_string): Access 'input_cd' and
	  'output_cd' via 'internal' pointer.

2013-04-01  Mark H Weaver  <mhw@netris.org>

	Add 'scm_gc_typed_calloc' macro.
	* libguile/gc.h (scm_gc_typed_calloc): New macro.

	Fix broken texinfo markup in (ice-9 iconv) docs.
	* doc/ref/api-data.texi (Representing Strings as Bytes): Fix broken
	  @deffn syntax.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/r6rs-ports.c

	scm_string_join: properly sequence operations in ADD_TO_APPEND_LIST
	* libguile/srfi-13.c (scm_string_join): Properly sequence operations in
	  ADD_TO_APPEND_LIST macro.

	Optimize 'string-join'.
	* libguile/srfi-13.c (string-join): Rewrite to call 'scm_string_append'
	  only once.

	Make 'string-append' more efficient and robust.
	* libguile/strings.c (scm_string_append): Check for numerical overflow
	  while computing the length of the result.  Double-check that we don't
	  overflow the result string, and that it is the correct length in the
	  end (in case another thread changed the list).  When copying a narrow
	  string to a wide result, avoid calling 'scm_i_string_length' and
	  'scm_i_string_chars' on each character.

2013-04-01  Mark H Weaver  <mhw@netris.org>

	Fix typos in 'string-join' docs: 'string-infix' -> 'strict-infix'.
	* doc/ref/api-data.texi (String Constructors): In definition of
	  'string-join', change 'string-infix' -> 'strict-infix'.

	* libguile/srfi-13.c (scm_string_join): In docstring, change
	  'string-infix' -> 'strict-infix'.

2013-04-01  Mark H Weaver  <mhw@netris.org>

	Avoid unnecessary peeks for EOF in r6rs-ports.
	* libguile/r6rs-ports.c (scm_get_bytevector_n, scm_get_bytevector_n_x,
	  scm_get_bytevector_some, scm_get_bytevector_all): Avoid peeking for
	  EOF when we already know.

2013-03-31  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

2013-03-31  Mark H Weaver  <mhw@netris.org>

	Add -C command-line option to adjust %load-compiled-path.
	* module/ice-9/command-line.scm (compile-shell-switches):
	  Implement -C option.
	  (*usage*): Add -C option.

	* doc/ref/guile-invoke.texi (Command-line Options): Add docs.

2013-03-29  Ludovic Courtès  <ludo@gnu.org>

	Augment `.gitignore'.

2013-03-29  Ludovic Courtès  <ludo@gnu.org>

	build: Build and check (ice-9 popen) only when --enable-posix and HAVE_FORK.
	Fixes <http://bugs.gnu.org/13848>.
	Reported by Jan Schukat <shookie@email.de>.

	* configure.ac: Rename `HAVE_FORK' conditional to `BUILD_ICE_9_POPEN'.
	  Set it when both $enable_posix and $ac_cv_func_fork are true.
	* libguile/posix.c (scm_init_posix): Add the `fork' feature.
	* doc/ref/api-options.texi (Common Feature Symbols): Add `fork'.
	* doc/ref/posix.texi (Pipes): Add footnote mentioning the `fork'
	  feature.
	* module/Makefile.am (SCRIPTS_SOURCES): Make `scripts/autofrisk.scm' and
	  `scripts/scan-api.scm' conditional on `BUILD_ICE_9_POPEN'.
	* test-suite/tests/popen.test (if-supported): New macro.
	  Wrap body in `if-supported'.

2013-03-29  Ludovic Courtès  <ludo@gnu.org>

	build: Remove redundant check for `struct timespec'.
	* m4/gnulib-cache.m4: Add `time'.
	* lib/Makefile.am: Update, still from v0.0-7865-ga828bb2.
	* configure.ac: Remove check for `struct timespec', which was redundant
	  with Gnulib, and conflicted with pthread-win32's <pthread.h>:
	  <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00096.html>.

2013-03-29  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Do not start over jit generation if can safely grow buffer size.
		* include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_memory.c,
		lib/jit_mips.c, lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c,
		lib/lightning.c: Do not start over jit generation if can grow
		the code buffer with mremap without moving the base pointer.

2013-03-29  Mark H Weaver  <mhw@netris.org>

	doc: Use '@defvr' to introduce 'stream-null'.
	* doc/ref/srfi-modules.texi (SRFI-41): Use @defvr to introduce
	  'stream-null'.

	Revert "doc: Consider `stream-null' as a variable."
	This reverts commit 4a0821a8d5cfff50fef8c119a0d76355b6126009.

2013-03-29  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add a simple memory management wrapper.
		* lib/jit_memory.c: Implement a simple memory allocation wrapper
		to allow overriding calls to malloc/calloc/realloc/free, as well
		as ensuring all memory containing pointers is zero or points to
		allocated memory.

		* include/lightning.h, include/lightning/jit_private.h: Definitions
		for the memory allocation wrapper.

		* lib/Makefile.am: Update for new jit_memory.c file.

		* lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_note.c,
		lib/jit_ppc.c, lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c:
		Use the new memory allocation wrapper code.

2013-03-29  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

2013-03-28  Ludovic Courtès  <ludo@gnu.org>

	tests: Skip `test-pthread-create-secondary' except on Linux-based systems.
	* test-suite/standalone/test-pthread-create-secondary.c: Skip on
	  non-Linux-based systems.

	build: Require GMP >= 4.2.
	* NEWS, README: Update.

	tests: Fix file name canonicalization tests for when $srcdir contains symlinks.
	* test-suite/tests/ports.test ("%file-port-name-canonicalization"): Use
	  `pass-if-equal' instead of `pass-if'.
	  ["relative canonicalization from ice-9"]: Throw to `unresolved' when
	  %LOAD-PATH is not canonical.
	  ["absolute canonicalization from ice-9"]: Canonicalize the result.

	Add Gnulib commit ID in `NEWS'.

	Allow compilation with GMP < 5.0.0.
	* libguile/numbers.c (VARARG_MPZ_ITERATOR)[!HAVE_DECL_MPZ_INITS]: New
	  macro.
	  (mpz_inits, mpz_clears)[!HAVE_DECL_MPZ_INITS]: New functions.
	* configure.ac: Check for the declaration of `mpz_inits'.

	Fix erroneous `FUNC_NAME' for `scm_array_length'.
	* libguile/generalized-arrays.c (scm_array_length): Fix `FUNC_NAME'.

	doc: Consider `stream-null' as a variable.
	* doc/ref/srfi-modules.texi (SRFI-41): Use @var{stream-null}, not
	  @code{stream-null}.  Use @defvr to introduce `stream-null'.

2013-03-28  Ian Price  <ianprice90@googlemail.com>

	Document (system repl server)
	* doc/ref/api-evaluation.texi (REPL Servers): New Subsection.

2013-03-28  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		configure.ac
		libguile/deprecated.c
		libguile/deprecated.h
		libguile/filesys.h
		libguile/fluids.c
		libguile/fports.c
		libguile/gc.c
		libguile/guile.c
		libguile/numbers.c
		libguile/objcodes.c
		libguile/r6rs-ports.c
		libguile/smob.c
		libguile/socket.c
		libguile/threads.h
		module/language/scheme/decompile-tree-il.scm
		module/language/tree-il/peval.scm
		test-suite/tests/syncase.test

2013-03-28  Mark H Weaver  <mhw@netris.org>

	SRFI-41 stream-null is a Scheme Variable, not a Constant.
	Suggested by Ludovic Courtès <ludo@gnu.org>.

	* doc/ref/srfi-modules.texi (SRFI-41 Stream Primitives):
	  Label 'stream-null' as a Scheme Variable, not a Constant.

2013-03-27  Chris K. Jester-Young  <cky944@gmail.com>

	Use BT Templeton's preferred name.
	* THANKS: Use BT Templeton's preferred name.

2013-03-27  Mark H Weaver  <mhw@netris.org>

	Thanks Chris K. Jester-Young.
	* THANKS: Add Chris K Jester-Young to the list of contributors.

2013-03-27  Mark H Weaver  <mhw@netris.org>

	Add full documentation for SRFI-41.
	* doc/ref/misc-modules.texi (Streams): Add cross-reference to SRFI-41.

	* doc/ref/srfi-modules.texi (SRFI-41): Replace stub with full
	  documentation.
	  (SRFI-41 Stream Fundamentals, SRFI-41 Stream Primitives,
	  SRFI-41 Stream Library): New subsubsections.

2013-03-27  Chris K. Jester-Young  <cky944@gmail.com>

	Add SRFI-41.
	Incorporates suggestions from Mark H Weaver <mhw@netris.org>
	and Ian Price <ianprice90@googlemail.com>.

	* module/srfi/srfi-41.scm: New file.

	* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-41.scm.

	* test-suite/tests/srfi-41.test: New file.

	* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-41.test.

	* doc/ref/srfi-modules.texi (SRFI Support): Add SRFI-41.
	  (SRFI-41): New node which refers the reader to
	  <http://srfi.schemers.org/srfi-41/srfi-41.html>.

2013-03-27  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

2013-03-27  Ludovic Courtès  <ludo@gnu.org>

	futures: Limit the number of nested futures on the same stack.
	Fixes <http://bugs.gnu.org/13188>.
	Reported by Nala Ginrut <nalaginrut@gmail.com>.

	* module/ice-9/futures.scm (%nesting-level): Rename to...
	  (%nesting-level): ... this.  Default to 0 instead of #f.  Update
	  users.
	  (%max-nesting-level): New variable.
	  (touch): When FUTURE is queued and (%nesting-level) is above
	  %MAX-NESTING-LEVEL, abort to %FUTURE-PROMPT.
	* test-suite/tests/future.test ("nested futures")["loop"]: Remove
	  `compile' call.
	* test-suite/tests/threads.test ("par-map")["long list"]: New test.
	* doc/ref/api-scheduling.texi (Futures): Add a paragraph about stack
	  consumption.

2013-03-27  Ludovic Courtès  <ludo@gnu.org>

	Document `and=>'.
	* module/ice-9/boot-9.scm (and=>): Add docstring.
	* doc/ref/api-procedures.texi (Higher-Order Functions): Add `and=>'.

2013-03-27  Daniel Hartwig  <mandyke@gmail.com>

	web http: parse numeric time zones in headers
	* module/web/http.scm (parse-zone-offset, normalize-date): New
	  procedures.
	  (parse-rfc-822-date, parse-rfc-850-date, parse-date): Update.
	* test-suite/tests/web-http.test ("general headers"): Add test.

2013-03-27  Ludovic Courtès  <ludo@gnu.org>

	doc: Use a preferred naming convention in SRFI-9 examples.
	* doc/ref/api-compound.texi (SRFI-9 Records): Use "Scheme Syntax"
	  instead of "library syntax".  Remove `get-' from getter names, and add
	  an exclamation mark in setter names.  Change `employee-type' to
	  `<employee>'.

2013-03-27  Mark H Weaver  <mhw@netris.org>

	Manual: xref SRFI-45 from core Delayed Evaluation section.
	* doc/ref/api-evaluation.texi (Delayed Evaluation): Add cross-reference
	  to SRFI-45.

2013-03-27  Mark H Weaver  <mhw@netris.org>

	SRFI-45: add promise? predicate.
	* module/srfi/srfi-45.scm (promise?): Export.

	* doc/ref/srfi-modules.texi (SRFI-45): Update docs.

	* test-suite/tests/srfi-45.test: Add test.  Add FSF copyright for 2010
	  and 2013.  Add missing year to André van Tonder's copyright notice.

2013-03-27  Mark H Weaver  <mhw@netris.org>

	Revert "SRFI-45: Support multiple values; add promise? predicate."
	This reverts commit 1d64b4edb9da4011ad06c0fab1c6225ec20b0876.

2013-03-25  Ludovic Courtès  <ludo@gnu.org>

	SRFI-37: Fix infinite loop when processing short option with no required arg.
	Fixes <http://bugs.gnu.org/13176>.

	* module/srfi/srfi-37.scm (args-fold)[short-option-argument]: When ARGS
	  is a pair, always set it to its cdr.
	* test-suite/tests/srfi-37.test ("SRFI-37")["short option with optional
	  argument omitted", "short option with optional argument provided"]:
	  New tests.

2013-03-25  Ludovic Courtès  <ludo@gnu.org>

	getaddrinfo: Document the missing errno value for EAI_SYSTEM.
	In response to <http://bugs.gnu.org/13958>.
	Reported by Lluís Batlle i Rossell <viric@viric.name>.

	* doc/ref/posix.texi (Network Databases): Document the missing errno
	  value for EAI_SYSTEM.
	* libguile/net_db.c (scm_getaddrinfo): Likewise.

2013-03-25  Ludovic Courtès  <ludo@gnu.org>

	build: Use portable sed constructs.
	Partly fixes <http://bugs.gnu.org/14042>.
	Reported by Marc Girod <marc.girod@gmail.com>.

	* meta/Makefile.am (guile-config): Use separate "s" expressions to
	  accommodate Solaris sed.

2013-03-25  Ludovic Courtès  <ludo@gnu.org>

	sendfile: Make sure we have a Linux-style `sendfile'.
	* libguile/filesys.c (scm_sendfile): Change conditional to
	  HAVE_SYS_SENDFILE_H && HAVE_SENDFILE.

	sendfile: Check return value of `lseek'.
	* libguile/filesys.c (scm_sendfile): Check return value of
	  `lseek_or_lseek64', and use `SCM_SYSERROR' upon error.

	Skip relevant `sendfile' tests when thread support is lacking.
	* test-suite/tests/filesys.test ("sendfile")["pipe", "pipe with
	  offset"]: Throw to `unresolved' when not (provided? 'threads).

2013-03-22  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct wrong shift value for 32 bit

	Remove non optional gmp dependency.
		* configure.ac, include/lightning/jit_private.h, lib/lightning.c:
		Remove dependency on gmp. Only a simple bitmap was required, and
		that was not enough reason to force linking to gmp and possible
		complications caused by it.

2013-03-22  Ludovic Courtès  <ludo@gnu.org>

	tests: Add more `maybe-gc-flakiness'.
	Fixes <http://bugs.gnu.org/14001>.
	Reported by Dennis Clarke <dclarke@blastwave.org>.

	* test-suite/tests/gc.test ("gc")["Lexical vars are collectable"]: Wrap
	  in `maybe-gc-flakiness'.

2013-03-22  Ludovic Courtès  <ludo@gnu.org>

	Add bindings for `sendfile'.
	* configure.ac: Check for <sys/sendfile.h> and `sendfile'.
	* libguile/filesys.c (scm_sendfile): New function.
	* libguile/filesys.h (scm_sendfile): New declaration.
	* test-suite/tests/filesys.test ("sendfile"): New test prefix.
	* doc/ref/posix.texi (File System): Document `sendfile'.

	texinfo plain-text: Use `match' for `stexi->plain-text'.
	* module/texinfo/plain-text.scm (def)[list/spaces]: Remove.
	  (stexi->plain-text): Use `match' instead of `cond'.

	texinfo: Add whitespace after periods.
	* module/texinfo/string-utils.scm (end-of-sentence?): New procedure.
	  (make-text-wrapper): Append an extra space after LINE when it matches
	  `end-of-sentence?' and COLLAPSE-WHITESPACE? is false.
	* test-suite/tests/texinfo.serialize.test ("test-serialize"): Adjust
	  accordingly.
	* test-suite/tests/texinfo.string-utils.test ("text wrapping")["two
	  spaces after end of sentence"]: New test prefix.

	build: Adjust makefiles for `guile-procedures.txt'.
	* libguile/Makefile.am (all-local): New target.
	* Makefile.am (libguile/guile-procedures.txt): Output to $@.tmp first.
	  (CLEANFILES): New variable.

2013-03-21  Ludovic Courtès  <ludo@gnu.org>

	Build `guile-procedures.txt' using (texinfo) instead of `makeinfo'.
	* Makefile.am (schemelibdir, schemelib_DATA): New variables.
	  (libguile/guile-procedures.txt): New target.
	  (EXTRA_DIST): Add libguile/texi-fragments-to-docstrings.
	* libguile/Makefile.am (guile-procedures.txt): Remove target.
	  (schemelibdir, schemelib_DATA): Remove.
	* libguile/texi-fragments-to-docstrings: New file.

	texinfo plain-text: Properly render @dots{}.
	* module/texinfo/plain-text.scm (tag-handlers): Add `dot' handler.

	test suite: Fix typo in `texinfo.test'.
	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add missing
	  quote.

	texinfo: Recognize `@:'.
	* module/texinfo.scm (read-command-token): Recognize @:.
	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add test.

	texinfo: Allow markup in the arguments of `@pxref'.
	* module/texinfo.scm (texi-command-specs)[pxref]: Change to
	  `INLINE-TEXT-ARGS'.
	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo")["@pxref{Locales,
	  @code{setlocale}}"]: New test.

	test suite: Use `pass-if-equal' in texinfo.test.
	* test-suite/tests/texinfo.test: Replace occurrences of
	  `(pass-if (equal? ...))' by `pass-if-equal'.

2013-03-21  Mike Gran  <spk121@yahoo.com>

	Document quit and exit
	* doc/ref/posix.texi (Processes): document `quit' and `exit'
	* doc/ref/r6rs.texi (rnrs programs): xref exit

2013-03-21  Mark H Weaver  <mhw@netris.org>

	Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list.
	* module/ice-9/boot-9.scm (%cond-expand-features): Remove redundant list
	  of feature identifiers in the comment.  Explain more clearly what
	  belongs in this list.  Remove srfi-6.

	* module/srfi/srfi-4.scm, module/srfi/srfi-27.scm,
	  module/srfi/srfi-31.scm, module/srfi/srfi-38.scm,
	  module/srfi/srfi-39.scm, module/srfi/srfi-42.scm,
	  module/srfi/srfi-45.scm, module/srfi/srfi-67.scm: Add missing
	  'cond-expand-provide'.

	* module/srfi/srfi-69.scm: Fix erroneous 'cond-expand-provide'.

	* doc/ref/srfi-modules.texi (SRFI-0): Update the list of features in
	  Guile core.

2013-03-21  Mark H Weaver  <mhw@netris.org>

	Mention the non-conformance of the core SRFI-6 procedures in the manual.
	* doc/ref/srfi-modules.texi (About SRFI Usage): Use SRFI-13 as an
	  example of a module which is included in core Guile, instead of
	  SRFI-6.

	  (SRFI-6): Mention the non-conformance of the core 'open-input-string'
	  and 'open-output-string' procedures.  Remove the claim that importing
	  this module does nothing.  Recommend that users import the module.

2013-03-20  Mark H Weaver  <mhw@netris.org>

	Improve sqrt handling of large integers and large and small rationals.
	* libguile/numbers.c (exact_integer_is_perfect_square,
	  exact_integer_floor_square_root): New static functions.

	  (scm_sqrt): Use SCM_LIKELY.  Add 'scm_t_inum' variable in inum case to
	  reduce the number of uses of SCM_I_INUM.  Rename 'mpz_t' variable.
	  Remove unneeded sign check.  Handle bignums too large to fit in a
	  double.  Handle fractions too large or too small to fit in a
	  normalized double.

	* test-suite/tests/numbers.test ("sqrt"): Add tests.

2013-03-20  Mark H Weaver  <mhw@netris.org>

	Optimize inum case of exact-integer-sqrt.
	* libguile/numbers.c (scm_exact_integer_sqrt): Use GMP for inum
	  case.  It is faster than what we had before.

2013-03-20  Mark H Weaver  <mhw@netris.org>

	Sqrt returns exact results when possible.
	* libguile/numbers.c (scm_sqrt): Handle exact integers and rationals in
	  such a way that exact results are returned whenever possible.

	* test-suite/tests/numbers.test ("sqrt"): Add tests.

2013-03-20  Mark H Weaver  <mhw@netris.org>

	Optimize scm_i_divide2double for integers less than 2^DBL_MANT_DIG.
	* libguile/numbers.c (scm_i_divide2double): Optimize for common case
	  when both operands are less than 2^DBL_MANT_DIG (normally 2^53).

2013-03-19  Mark H Weaver  <mhw@netris.org>

	SRFI-45: Support multiple values; add promise? predicate.
	* module/srfi/srfi-45.scm (eager): Accept any number of arguments.
	  Store the list of arguments in the value record.  Previously, only one
	  argument was accepted, and that value was stored in the value record.
	  (delay): Support expressions that return any number of arguments.
	  (force): Return the list of values stored in the value record.
	  (promise?): Export.

	* doc/ref/srfi-modules.texi (SRFI-45): Update docs.  Remove typing
	  for simplicity in discussing multiple values.

	* test-suite/tests/srfi-45.test: Add tests.  Add FSF copyright for 2010
	  and 2013.  Add missing year to André van Tonder's copyright notice.

2013-03-19  Mark H Weaver  <mhw@netris.org>

	Use scientific notation only if there are enough trailing zeroes.
	* libguile/numbers.c (idbl2str): Print large numbers in scientific
	  notation only if the exponent is >= 7 and the least significant
	  non-zero digit has value >= radix^4.

	* test-suite/tests/numbers.test ("number->string"): Add tests.

2013-03-18  Ludovic Courtès  <ludo@gnu.org>

	Avoid rebuild of `guile.info' at the user's site.
	* configure.ac: Remove `doc/ref/effective-version.texi' from the
	  `AC_CONFIG_FILES'.
	* doc/ref/Makefile.am ($(srcdir)/effective-version.texi): New target.

	Use byte-oriented functions in `get-bytevector*'.
	* libguile/r6rs-ports.c (scm_get_bytevector_some, scm_get_bytevector_n,
	  scm_get_bytevector_n_x, scm_get_bytevector_all): Use
	  `scm_get_byte_or_eof' and `scm_peek_byte_or_eof' instead of their
	  `char' counterparts.
	  Reported by Chris K. Jester-Young.

	Define the new Linux-specific `SO_REUSEPORT'.
	* libguile/socket.c (scm_init_socket)[SO_REUSEPORT]: Define
	  `SO_REUSEPORT'.
	  (scm_setsockopt, scm_getsockopt): Update docstring.
	* doc/ref/posix.texi (Network Sockets and Communication): List
	  `SO_REUSEPORT'.

2013-03-17  Mark H Weaver  <mhw@netris.org>

	Reimplement idbl2str number printer.
	Fixes <http://bugs.gnu.org/13757>.

	* libguile/numbers.c (idbl2str): Reimplement.
	  (mem2decimal_from_point): Accept negative exponents larger than
	  SCM_MAXEXP that produce subnormals.
	  (SCM_MAX_DBL_PREC): Removed preprocessor macro.
	  (scm_dblprec, fx_per_radix): Removed static variables.
	  (init_dblprec, init_fx_radix): Removed static functions.
	  (scm_init_numbers): Remove initialization code for 'scm_dblprec'
	  and 'fx_per_radix'.

	* test-suite/tests/numbers.test ("number->string"): Restore tests that
	  previously failed.  Remove comments about problems in the number
	  printer that are now fixed.

2013-03-17  Mark H Weaver  <mhw@netris.org>

	Improve inexact division of exact integers.
	* libguile/numbers.c (scm_i_divide2double): New function.
	  (scm_i_divide2double_lo2b): New variable.
	  (scm_i_fraction2double, log_of_fraction): Use 'scm_i_divide2double'.
	  (do_divide): Removed.  Its code is now in 'scm_divide'.
	  (scm_divide2real): Removed.  Superceded by 'scm_i_divide2double'.
	  (scm_divide): Inherit code from 'do_divide', but without support for
	  forcing a 'double' result (that functionality is now implemented by
	  'scm_i_divide2double').  Add FIXME comments in cases where divisions
	  might not be as precise as they should be.
	  (scm_init_numbers): Initialize 'scm_i_divide2double_lo2b'.

	* test-suite/tests/numbers.test (dbl-epsilon-exact, dbl-max-exp): New
	  variables.
	  ("exact->inexact"): Add tests.
	  ("inexact->exact"): Add test for largest finite inexact.

2013-03-16  Daniel Hartwig  <mandyke@gmail.com>

	http: support IP-literal (IPv6 address) in Host header
	* module/web/http.scm ("Host"): Parse and write IP-literals treating
	  escapes as uri module does: remove brackets on parse, replace them on
	  write.
	* test-suite/tests/web-http.test ("request headers"): Add tests.

	add tests for read-request-line, etc.
	* test-suite/web/web-http.test ("read-request-line"):
	  ("write-request-line", "read-response-line", "write-response-line"):
	  Add.

2013-03-16  Daniel Hartwig  <mandyke@gmail.com>

	minor tweaks to web documentation
	* doc/ref/web.texi: Say `World Wide Web'; the hyphenated form is almost
	  never used (c.f. w3.org).

	  General predicate arguments are named `obj'.  Fill in arguments
	  omitted from some procedure definitions (e.g. `request-method').

	  Minor tweaks, such as using en-dash and missing markup as appropriate.
	  Wrap very long deffn lines.

	* module/web/*.scm: Expand texinfo markup in doc strings.  Synchronize
	  with changes in web.texi.

2013-03-15  Andy Wingo  <wingo@igalia.com>

	more NEWS
	* NEWS: Update.

	incremental NEWS work
	* NEWS: Checkpoint.

	fix doc build
	* doc/ref/api-data.texi (Bitwise Operations): Don't use @-commands in
	  @math.  Fixes doc build.
	* doc/ref/api-macros.texi (Syntax Rules): Fix example result.

2013-03-13  Andy Wingo  <wingo@igalia.com>

	very beginnings of NEWS
	* NEWS: A very very very rough start at 2.0.8 news

2013-03-13  Andy Wingo  <wingo@igalia.com>

	add #:resolve-syntax-parameters? kwarg to syntax-local-binding
	* doc/ref/api-macros.texi (Syntax Transformer Helpers): Document.

	* module/ice-9/psyntax.scm (syntax-local-binding): Add
	  #:resolve-syntax-parameters? kwarg.  Fixes bug 10991.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	* test-suite/tests/syncase.test ("syntax-local-binding"): Add test.

2013-03-13  Andy Wingo  <wingo@igalia.com>

	allow for spurious wakeups from pthread_cond_wait
	* libguile/threads.c (scm_call_with_new_thread, scm_spawn_thread): Allow
	  for spurious wakeups while waiting on cond variables.  Should fix bug
	  10641.

2013-03-13  Andy Wingo  <wingo@igalia.com>

	failing to load module in psyntax indicates an identifier is not macro
	* module/ice-9/boot-9.scm (false-if-exception): Add optional #:warning
	  TEMPLATE ARG... tail, which indicates that we should print a warning
	  on failure.
	  (load-in-vicinity): Use the new #:warning.
	  (make-autoload-interface): Surround the bits that load modules with a
	  false-if-exception with #:warning.  Fixes
	  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12202.

	* test-suite/tests/syncase.test ("missing autoloads do not foil
	  psyntax"): Add a test.

2013-03-12  Mark H Weaver  <mhw@netris.org>

	Reimplement 'inexact->exact' to avoid mpq functions.
	* libguile/numbers.c (scm_inexact_to_exact): Implement conversion of a
	  double to an exact rational without using the mpq functions.

	* test-suite/tests/numbers.test (dbl-mant-dig): Simplify initializer.
	  (dbl-epsilon, dbl-min-exp): New variables.
	  ("inexact->exact"): Add tests.  Fix broken "2.0**i to exact and back"
	  test, and change it to "2.0**i to exact", to avoid use of
	  'exact->inexact'.

2013-03-12  Mark H Weaver  <mhw@netris.org>

	Optimize logarithms using scm_i_big2dbl_2exp
	* libguile/numbers.c (log_of_exact_integer_with_size): Removed.

	  (log_of_exact_integer): Handle bignums too large to fit in a double
	  using 'scm_i_big2dbl_2exp' instead of 'scm_integer_length' and
	  'scm_ash'.

	  (log_of_fraction): Use 'log_of_exact_integer' instead of
	  'log_of_exact_integer_with_size'.

2013-03-12  Mark H Weaver  <mhw@netris.org>

	Simplify and improve scm_i_big2dbl, and add scm_i_big2dbl_2exp
	* libguile/numbers.c (scm_i_big2dbl_2exp): New static function.
	  (scm_i_big2dbl): Reimplement in terms of 'scm_i_big2dbl_2exp',
	  with proper rounding.

	* test-suite/tests/numbers.test ("exact->inexact"): Add tests.

2013-03-12  Mark H Weaver  <mhw@netris.org>

	Add 'round-ash', a rounding arithmetic shift operator
	* libguile/numbers.c (left_shift_exact_integer,
	  floor_right_shift_exact_integer, round_right_shift_exact_integer): New
	  static functions.

	  (scm_round_ash): New procedure.

	  (scm_ash): Reimplement in terms of 'left_shift_exact_integer' and
	  'floor_right_shift_exact_integer'.

	* libguile/numbers.h: Add prototype for scm_round_ash.  Rename the
	  second argument of 'scm_ash' from 'cnt' to 'count'.

	* test-suite/tests/numbers.test (round-ash, ash): Add new unified
	  testing framework for 'ash' and 'round-ash'.  Previously, the tests
	  for 'ash' were not very comprehensive; for example, they did not
	  include a single test where the number to be shifted was a bignum.

	* doc/ref/api-data.texi (Bitwise Operations): Add documentation for
	  'round-ash'.  Improve documentation for `ash'.

2013-03-12  Mark H Weaver  <mhw@netris.org>

	Optimize and simplify fractions code.
	* libguile/numbers.c (scm_exact_integer_quotient,
	  scm_i_make_ratio_already_reduced): New static functions.

	  (scm_i_make_ratio): Rewrite in terms of
	  'scm_i_make_ratio_already_reduced'.

	  (scm_integer_expt): Optimize fraction case.

	  (scm_abs, scm_magnitude, scm_difference, do_divide): Use
	  'scm_i_make_ratio_already_reduced'.

	* test-suite/tests/numbers.test (expt, integer-expt): Add tests.

2013-03-11  Mike Gran  <spk121@yahoo.com>

	Add standalone test for smob marking
	* test-suite/standalone/Makefile.am (TESTS, check_PROGRAMS): add test-smob-mark
	  (test_smob_mark_SOURCES, test_smob_mark_CFLAGS, test_smob_mark_LDADD): new variables
	* test-suite/standalone/test-smob-mark.c: new file

2013-03-10  Jason Earl  <jearl@notengoamigos.org>

	rely on gnulib for `poll'
	* configure.ac:
	* libguile/fports.c (fport_input_waiting):
	* libguile/poll.c (scm_primitive_poll): Rely on gnulib to provide poll
	  for us.

	import `poll' from gnulib
	* lib/Makefile.am:
	* lib/poll.c:
	* lib/poll.in.h:
	* m4/gnulib-cache.m4:
	* m4/gnulib-comp.m4:
	* m4/poll.m4:
	* m4/poll_h.m4: Add poll gnulib module.

2013-03-10  Andy Wingo  <wingo@pobox.com>

	guile.m4 allows selection of guile 2.0, 1.8, etc.
	* meta/guile.m4 (GUILE_PKG): New macro, chooses a version of Guile
	  against which to compile.
	  (GUILE_FLAGS, GUILE_PROGS): Rewrite to call GUILE_PKG as necessary, to
	  respect any previous call to GUILE_PKG, and to not require
	  guile-tools.

2013-03-10  Jason Earl  <jearl@notengoamigos.org>

	add %site-ccache-dir
	* libguile/load.h:
	* libguile/load.c (scm_sys_site_ccache_dir): New procedure.

	* doc/ref/scheme-using.texi (Installing Site Packages):
	* doc/ref/api-options.texi (Build Config): Add docs.

	Fixes bug 10326.

2013-03-10  Jason Earl  <jearl@notengoamigos.org>

	excise use of "iff" in the manual
	* doc/ref/api-compound.texi:
	* doc/ref/api-control.texi:
	* doc/ref/api-data.texi:
	* doc/ref/api-macros.texi:
	* doc/ref/api-modules.texi:
	* doc/ref/api-procedures.texi:
	* doc/ref/api-scheduling.texi:
	* doc/ref/api-smobs.texi:
	* doc/ref/api-undocumented.texi:
	* doc/ref/api-utility.texi:
	* doc/ref/compiler.texi:
	* doc/ref/intro.texi:
	* doc/ref/scheme-using.texi:
	* doc/ref/sxml.texi:
	* doc/ref/web.texi: Change uses of "iff" to "if, otherwise".  Fixes bug
	  10302.

	fix AC_CHECK_DECLS for `alarm'
	* configure.ac: Fix decl check for `alarm'.

	use chmod portably in (system base compile)
	* module/system/base/compile.scm (call-with-output-file/atomic): Call
	  chmod with the file name instead of the port.

2013-03-10  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Adapt PowerPC port to work in Darwin 32 bit and Linux 64 bit.
		* include/lightning.h: Add check for __powerpc__ defined
		in Linux, while Darwin defines __ppc__.

		* include/lightning/jit_ppc.h: Adjust register definitions
		for Darwin 32 bit and Linux 64 bit ppc usage and/or ABI.

		* include/lightning/jit_private.h: Add proper check for
		Linux __powerpc__ and an data definition for an workaround
		to properly handle code that starts with a jump to a "main"
		label.

		* lib/jit_disasm.c: Add extra disassembler initialization
		for __powerpc64__.

		* lib/jit_ppc-cpu.c: Add extra macros and functions, and
		correct/adapt previous ones to handle powerpc64.

		* lib/jit_ppc-fpu.c: Adapt for 64 bit wordsize. Basically
		add conversion from/to int32/int64 and proper handling of
		load/store offsets too large for 32 bit.

		* lib/jit_ppc.c: Add calls to 64 bit codes and adaptation
		for the PowerPC 64 bit Linux ABI.

		* lib/jit_arm.c, lib/jit_mips.c, lib/jit_sparc, lib/jit_x86.c,
		lib/lightning.c: Correct off by one error when restarting jit
		of a function due to finding too late that needs to spill/reload
		some register. Problem was found by accident on a very special
		condition during PowerPC 64 code adaptation.

2013-03-10  Jason Earl  <jearl@notengoamigos.org>

	fix response-body-port for responses without content-length
	* module/web/response.scm (response-body-port): Correctly handle cases
	  in which EOF terminates the body.

2013-03-09  Andy Wingo  <wingo@pobox.com>

	provide getlogin declaration if needed.
	* configure.ac: Check for getlogin decl.
	* libguile/posix.c: Declare getlogin if needed.

	fix mingw issues with posix.c
	* libguile/posix.c (scm_execl, scm_execlp, scm_execle)
	  (scm_open_process): Remove casts for ancient mingw.
	  (scm_utime): If we fall back to utime, assert that flags is 0.
	  (scm_getlogin): Rely on gnulib.

	add getlogin from gnulib
	* lib/Makefile.am:
	* lib/getlogin.c:
	* m4/getlogin.m4:
	* m4/gnulib-cache.m4: Add getlogin module.

2013-03-09  Andy Wingo  <wingo@pobox.com>

	don't provide scm_std_select on mingw and similar platforms
	* libguile/iselect.h: If we do not have sys/select.h, don't provide
	  scm_std_select, SELECT_TYPE, FD_SET, FD_ZERO, FD_ISSET, or FD_CLR.
	  Guile should not be setting these macros in public API.  This is an
	  incompatible change on mingw, but oh well.

	* libguile/threads.c: Rely on gnulib's select, and use that to implement
	  scm_std_select.

	* libguile/deprecated.h:
	* libguile/deprecated.c: Only provide scm_internal_select if we have
	  sys/select.h.

2013-03-09  Andy Wingo  <wingo@pobox.com>

	simplify posix.c
	* libguile/posix.c: Reorder includes to fix mingw include-order
	  problem.  Remove ttyname shims; gnulib is the place to fix that.
	  Remove winsock2 include, as gnulib seems to handle that OK.  Rely on
	  the new pipe-posix gnulib module.  Don't bother shimming getlogin, etc
	  on mingw; gnulib is the place for shims.

	simplify readline.c
	* guile-readline/readline.c: Remove all mingw special-casing, relying
	  instead on mingw / gnulib doing the right thing.

	simplify stime back-compat shims for tzname
	* libguile/stime.c: Remove tzname declarations for ancient mingw and SGI
	  RS6000.

	mingw include order for socket.c
	* libguile/socket.c: Reorder includes to fix include order on mingw.

	fix include-order problem in net_db.c for mingw
	* libguile/net_db.c: Reorder includes to avoid include-order problem on
	  mingw.

	silence mingw32 warning in i18n.c
	* libguile/i18n.c (scm_make_locale): Silence a warning.

	fports uses gnulib's select
	* libguile/fports.c: Reorder includes to put system includes first;
	  fixes windows/winsock2 include error problem.  Rely on Gnulib's
	  select module.
	  (fport_input_waiting): Use select instead of scm_std_select.

	simplify filesys.c via gnulib's select and fstat modules
	* libguile/filesys.c: Instead of using scm_std_select, just use select,
	  relying on gnulib to provide it to us.  Likewise, rely on fstat.

	if we have threads on windows, we have pthreads; inform bdw-gc of that
	* libguile/bdw-gc.h: If we have threads enabled on mingw32, explicitly
	  mark GC_WIN32_PTHREADS.  See
	  http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/5564
	  for more info.

	remove init.c iselect include
	* libguile/init.c: Remove iselect include.

	portability simplification with scmsigs.c and alarm
	* configure.ac (alarm): Check for decl.
	* libguile/scmsigs.c: Reorder includes to put system includes first.
	  Fixes include order on mingw.  Remove #define for alarm, as we will
	  use HAVE_DECL_ALARM.  Remove #defines for sleep and usleep, as they
	  are not used.
	  (scm_alarm): Only define if HAVE_DECL_ALARM.

	add gnulib fstat module explicitly
	* lib/Makefile.am:
	* m4/gnulib-cache.m4: Explicitly add fstat module.

	Import `pipe-posix' module from gnulib.
	* lib/Makefile.am:
	* lib/pipe.c:
	* m4/gnulib-cache.m4:
	* m4/gnulib-comp.m4:
	* m4/pipe.m4: Add pipe-posix module.

2013-03-09  Andy Wingo  <wingo@pobox.com>

	squish remove some mingw-specific code that is covered by gnulib
	* libguile/socket.c (scm_init_socket): Remove mingw-specific code.

	* libguile/fports.c: Remove ftruncate redefine; mingw is fine.
	  (scm_i_fdes_to_port): If we have no F_GETFL, just do an fstat.  The
	  right place for an F_GETFL replacement would be in gnulib.
	  (fport_input_waiting): Remove an outdated comment.

	* libguile/error.c (SCM_I_STRERROR, SCM_I_ERRNO): Remove, replacing uses
	  with strerror and errno.

	* libguile/win32-socket.c:
	* libguile/win32-socket.h: Remove.  Mingw has suitable replacements.

	* configure.ac:
	* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  (noinst_HEADERS): Update for win32-socket removal.

2013-03-09  Andy Wingo  <wingo@pobox.com>

	remove mingw32 implementations of {get,end,set}{serv,proto}ent
	* libguile/win32-socket.h:
	* libguile/win32-socket.c (getservent, endservent, setservent)
	  (getprotoent, endprotoent, setprotoent): Remove mingw32 wrappers.
	  Their place is in gnulib, if anywhere.

2013-03-09  Andy Wingo  <wingo@pobox.com>

	add check for struct pollfd
	* configure.ac: Add check for struct pollfd.

	* libguile/fports.c (fport_input_waiting):
	* libguile/poll.c (scm_primitive_poll): Require struct pollfd.  Fixes
	  bug 13903.

2013-03-09  Andy Wingo  <wingo@pobox.com>

	allow case-lambda expressions with no clauses
	* module/ice-9/psyntax-pp.scm:
	* module/ice-9/psyntax.scm (case-lambda, case-lambda*): Allow 0
	  clauses.

	* module/language/scheme/decompile-tree-il.scm (do-decompile):
	  (choose-output-names):
	* module/language/tree-il.scm (unparse-tree-il):
	  (tree-il-fold, post-order!, pre-order!):
	* module/language/tree-il/effects.scm (make-effects-analyzer):
	* module/language/tree-il/cse.scm (cse):
	* module/language/tree-il/debug.scm (verify-tree-il):
	* module/language/tree-il/peval.scm (peval): Allow for lambda-body to be
	  #f.

	* libguile/memoize.c (memoize):
	* module/language/tree-il/canonicalize.scm (canonicalize!): Give a body
	  to empty case-lambda before evaluating it or compiling it,
	  respectively.

	* test-suite/tests/optargs.test ("case-lambda", "case-lambda*"): Add
	  tests.

2013-03-09  Andy Wingo  <wingo@pobox.com>

	fix in-tree guile reference
	* meta/guile.in (GUILE): Add @EXEEXT@ for libguile/guile reference, for
	  MinGW compiles.

2013-03-08  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add missing __ppc__ definition.
		* check/lightning.c: Add missing ppc preprocessor definition.

2013-03-07  Mark H Weaver  <mhw@netris.org>

	Improve standards conformance of string->number.
	Fixes <http://bugs.gnu.org/11887>.

	* libguile/numbers.c (mem2ureal): New argument 'allow_inf_or_nan'.
	  Accept infinities and NaNs only if 'allow_inf_or_nan' is true and "#e"
	  is not present.  Check for "inf.0" or "nan." case-insensitively.  Do
	  not accept rationals with zero divisors.

	  (mem2complex): Pass new 'allow_inf_or_nan' argument to 'mem2ureal',
	  which is set if and only if a explicit sign was present.

	* test-suite/tests/numbers.test ("string->number"): Add tests.

2013-03-07  Stefan Israelsson Tampe  <stefan.itampe@gmail.com>

	add GUILE_STACK_SIZE environment variable
	* libguile/vm.c (initialize_default_stack_size): New helper.
	  (scm_bootstrap_vm): Call initialize_default_stack_size.

	* doc/ref/guile-invoke.texi (Environment Variables): Add docs.

	Based on a patch by Stefan Israelsson Tampe.

2013-03-07  Andy Wingo  <wingo@pobox.com>

	support calls and tail-calls with more than 255 formals
	* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
	  Support calls and tail-calls with more than 255 formals.

	* test-suite/tests/tree-il.test ("many args"): Add a test.

2013-03-07  Andy Wingo  <wingo@pobox.com>

	,option evaluates its right-hand-side
	* doc/ref/scheme-using.texi (System Commands): Better documentation for
	  ,option.

	* module/system/repl/command.scm (option): Evaluate the RHS when setting
	  an option.  Fixes bug 13076.

2013-03-07  Andy Wingo  <wingo@pobox.com>

	GUILE_INSTALL_LOCALE=1 during build
	* doc/ref/Makefile.am (autoconf-macros.texi):
	* libguile/Makefile.am (snarf2checkedtexi):
	* module/Makefile.am (ice-9/psyntax-pp.scm.gen, ice-9/psyntax-pp.go):
	* test-suite/Makefile.am (GUILE_AUTO_COMPILE):
	* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
	* test-suite/vm/Makefile.am (TESTS_ENVIRONMENT):
	* am/guilec (.scm.go): Set GUILE_INSTALL_LOCALE to 1 during the build.
	  Fixes bug 12887.

2013-03-07  Ludovic Courtès  <ludo@gnu.org>

	Install the current locale if GUILE_INSTALL_LOCALE is nonzero.
	* libguile/guile.c (get_integer_from_environment)
	  (should_install_locale): New functions.
	  (main): Add `setlocale' call.

	* doc/ref/guile-invoke.texi (Environment Variables): Add documentation.

2013-03-07  Andy Wingo  <wingo@pobox.com>

	structs with tail arrays are not simple
	* libguile/struct.h (SCM_VTABLE_FLAG_SIMPLE, SCM_VTABLE_FLAG_SIMPLE_RW):
	* libguile/struct.c (set_vtable_layout_flags): Vtable whose layouts
	  include a tail array are not simple.  Fixes bug 12808.

	fix compilation under mingw
	* libguile/load.c (is_absolute_file_name, search_path): Fix compilation
	  under mingw.

2013-03-07  Ludovic Courtès  <ludo@gnu.org>

	Make `SCM_LONG_BIT' usable in preprocessor conditionals.
	Reported by Jan Schukat <shookie@email.de>.
	Partly fixes <http://bugs.gnu.org/13848>.

	* libguile/__scm.h (SCM_LONG_BIT)[!defined LONG_BIT]: Use
	  SCM_SIZEOF_LONG since `sizeof' cannot be used in #if directives as
	  found in numbers.c.

2013-03-07  Ludovic Courtès  <ludo@gnu.org>

	Use `scm_is_eq' in load.c.
	* libguile/load.c (is_file_name_separator): Use `scm_is_eq' instead of `=='.

	doc: Allow compilation of r5rs.texi with Texinfo 5.0.
	* doc/r5rs/r5rs.texi: Remove extraneous @author.  Change @unnumbered to
	  @majorheading within @titlepage.

2013-03-06  Mark H Weaver  <mhw@netris.org>

	Verify that FLT_RADIX is 2.
	* libguile/numbers.c: Trigger a compilation error if FLT_RADIX is not 2.
	  This has long been assumed by code in numbers.c.

	Improve code in scm_gcd for inum/inum case
	* libguile/numbers.c (scm_gcd): Improve implementation of inum/inum case
	  to be more clear and efficient.

2013-03-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Minor updates when testing on a prototype, quadcore Loongson mips.
		* check/float.tst: Comment out the int to negative infinity
		test in mips for the moment because not all Loongson agrees
		on the result.

		* lib/jit_disasm.c: Add a test instead of an assertion
		when loading symbols for disassembly due to a failure with
		a simple binutils build in Debian mipsel64.

2013-03-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Rework to better describe what is used only during jit generation.
		* include/lightning/jit_private.h, lib/jit_arm-cpu.c,
		lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips-cpu.c,
		lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc-cpu.c,
		lib/jit_ppc.c, lib/jit_print.c, lib/jit_sparc-cpu.c,
		lib/jit_sparc.c, lib/jit_x86-cpu.c, lib/jit_x86.c,
		lib/lightning.c: Add an extra structure for data storage
		during jit generation, and release it after generating
		jit, to reduce a bit memory usage, and also to make it
		easier to understand what data is available during
		jit runtime.

	Make code and data buffer readonly.
		* lib/lightning.c: Make data and code buffer readonly.

2013-03-05  Mark H Weaver  <mhw@netris.org>

	Fix thread-unsafe lazy initializations.
	* libguile/debug.c (scm_local_eval):
	  libguile/ports.c (scm_current_warning_port):
	  libguile/strports.c (scm_eval_string_in_module): Perform
	  lazy-initialization while holding a mutex.  Use SCM_UNDEFINED as the
	  uninitialized value.  Use 'scm_c_*_variable'.

	* doc/ref/api-modules.texi (Accessing Modules from C): Fix
	  'my_eval_string' example to be thread-safe.

2013-03-04  Ludovic Courtès  <ludo@gnu.org>

	doc: Rename "Texinfo" node to "Texinfo Processing".
	* doc/ref/texinfo.texi (Texinfo): Rename to...
	  (Texinfo Processing): ... this.
	* doc/ref/guile.texi (Guile Modules): Update menu.

	Use `scm_is_eq' in filesys.c.
	* libguile/filesys.c (is_file_name_separator): Use `scm_is_eq' instead
	  of `=='.  Fixes <http://hydra.nixos.org/build/4261579>.

2013-03-02  Bake Timmons  <b3timmons@speedymail.org>

	Improve keyword notation of Texinfo function definitions.
	* doc/ref/api-debug.texi:
	* doc/ref/api-evaluation.texi:
	* doc/ref/api-modules.texi:
	* doc/ref/compiler.texi:
	* doc/ref/web.texi: Make Texinfo function headers more consistent.
	  Change lesser used keyword notation to the predominant form.

	* doc/ref/api-procedures.texi: Fix an argument name in a header that should
	  use repeated argument notation.

	* doc/ref/srfi-modules.texi: Update references in Texinfo function
	  definition body to match previously updated variable notation in
	  definition header.

2013-03-01  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix build with Texinfo 5.0.
	* doc/ref/api-control.texi (Handling Errors): Move misplaced description
	  for `scm_memory_error' & co.
	* doc/ref/r6rs.texi (rnrs base): Change `deffnx' of `let-syntax' and
	  `letrec-syntax' to fit on one line.

2013-03-01  Ludovic Courtès  <ludo@gnu.org>

	Allow the SMOB mark procedures to be called when libgc uses parallel markers.
	Fixes <http://bugs.gnu.org/13611>.
	Reported by Mike Gran <spk121@yahoo.com>.

	* libguile/smob.c (current_mark_stack_pointer,
	  current_mark_stack_limit): New variables.
	  (smob_mark): Use CURRENT_MARK_STACK_POINTER and
	  CURRENT_MARK_STACK_LIMIT instead of the same-named fields of
	  `SCM_I_CURRENT_THREAD'.
	  (scm_gc_mark): Likewise.
	  (scm_smob_prehistory): Initialize CURRENT_MARK_STACK_LIMIT and
	  CURRENT_MARK_STACK_POINTER.
	* libguile/threads.h (scm_i_thread): Add comment that
	  `current_mark_stack_ptr' and `current_mark_stack_limit' are no longer
	  used.

2013-03-01  Ludovic Courtès  <ludo@gnu.org>

	Use accessors instead of symbols deprecated in libgc 7.3.
	* configure.ac: Check for `GC_set_all_interior_pointers',
	  `GC_get_gc_no', and `GC_set_java_finalization'.
	* libguile/gc.c (scm_gc_stats)[HAVE_GC_GET_GC_NO]: Use `GC_get_gc_no'.
	  (scm_storage_prehistory)[HAVE_GC_SET_ALL_INTERIOR_POINTERS]: Use
	  `GC_set_all_interior_pointers'.
	* libguile/guardians.c (scm_init_guardians)[HAVE_GC_SET_JAVA_FINALIZATION]:
	  Use `GC_set_java_finalization'.

2013-03-01  Daniel Hartwig  <mandyke@gmail.com>

	test-suite: eq-ness of numbers, characters is unspecified
	* test-suite/tests/00-socket.test:
	* test-suite/tests/alist.test:
	* test-suite/tests/elisp.test:
	* test-suite/tests/encoding-iso88591.test:
	* test-suite/tests/encoding-iso88597.test:
	* test-suite/tests/encoding-utf8.test:
	* test-suite/tests/hash.test:
	* test-suite/tests/i18n.test:
	* test-suite/tests/modules.test:
	* test-suite/tests/ports.test:
	* test-suite/tests/srfi-35.test: Make tests use eqv? instead of eq? when
	  comparing numbers, characters.  Checked also for similar uses of
	  assq[-ref].

	* test-suite/tests/vlist.test ("vhash-delete honors HASH"): Change test
	  to use eqv-ness, not eq-ness, which should not impact its purpose as
	  these two are equivalent for strings.

2013-03-01  Mark H Weaver  <mhw@netris.org>

	Fix later-bindings-win logic in with-fluids.
	Based on a patch by David Kastrup <dak@gnu.org>.
	Fixes <http://bugs.gnu.org/13843>.

	* libguile/fluids.c (scm_i_make_with_fluids): Reverse direction of inner
	  loop that checks for duplicates, to properly handle more than two
	  bindings to the same fluid.

2013-02-28  Mark H Weaver  <mhw@netris.org>

	Fix duplicate removal of with-fluids.
	Based on a patch by David Kastrup <dak@gnu.org>.
	Fixes <http://bugs.gnu.org/13838>.

	* libguile/fluids.c (scm_i_make_with_fluids): Remove the duplicate
	  binding instead of the last binding.

	* test-suite/tests/fluids.test: Add test, and fix existing duplicate
	  tests.

	* THANKS: Thanks David Kastrup.

2013-02-28  Mark H Weaver  <mhw@netris.org>

	Support calling foreign functions of 10 arguments or more.
	* libguile/foreign.c (OBJCODE_HEADER, META_HEADER, META): Change these
	  into higher-order macros.
	  (GEN_CODE): New higher-order macro based on 'CODE'.
	  (M_STATIC, M_DYNAMIC): New macros.
	  (CODE): Reimplement using 'GEN_CODE' and 'M_STATIC'.
	  (make_objcode_trampoline): New static function.
	  (large_objcode_trampolines, large_objcode_trampolines_mutex): New
	  static variables.
	  (get_objcode_trampoline): New static function.
	  (cif_to_procedure): Use 'get_objcode_trampoline'.

	* test-suite/standalone/test-ffi-lib.c (test_ffi_sum_many):
	  New function.

	* test-suite/standalone/test-ffi: Add test.

2013-02-28  Ludovic Courtès  <ludo@gnu.org>

	Fix handling of the *-gnux32 target.
	* module/system/base/target.scm (triplet-pointer-size): Fix typo in the
	  x32 triplet name.
	* test-suite/tests/asm-to-bytecode.test (native-os): New procedure.
	  (test-target): Use (native-word-size) only when both the CPU and OS
	  match.

2013-02-28  David Kastrup  <dak@gnu.org>

	Let reverse! accept arbitrary types as second argument (new_tail)
	* libguile/list.c (scm_reverse_x): remove typecheck for 2nd arg.

2013-02-27  Ludovic Courtès  <ludo@gnu.org>

	Recognize the `x86_64.*-gnux32' triplet.
	* module/system/base/target.scm (triplet-pointer-size): Add case for
	  "^x64_64-.*-gnux32".
	* test-suite/tests/asm-to-bytecode.test ("cross-compilation"):
	  ["x86_64-unknown-linux-gnux32"]: New test.

	Check whether a triplet's OS part specifies an ABI.
	* module/system/base/target.scm (cpu-word-size): Rename to...
	  (triplet-pointer-size): ... this.  Update caller.  Take a triplet as
	  the argument.  Check the `triplet-os' part when checking for equality
	  with the host.  Add support "mips64.*-gnuabi64".
	* test-suite/tests/asm-to-bytecode.test ("cross-compilation")
	  [ "mips64el-unknown-linux-gnuabi64"]: New test.

	Recognize mips64* as having 32-bit pointers by default.
	* module/system/base/target.scm (cpu-word-size): Consider MIPS64 to
	  default to n32 or o32.
	* test-suite/tests/asm-to-bytecode.test ("cross-compilation")
	  ["mips64el-unknown-linux-gnu"]: New test.

	tests: Avoid missing missing-prototype warning with <fenv.h> on glibc 2.17.
	* test-suite/standalone/test-round.c: Avoid missing-prototype warning
	  with <fenv.h> on glibc 2.17.

	Fix cross-compilation of `c-tokenize.o'.
	* libguile/Makefile.am (c-tokenize.$(OBJEXT)): Pass -I$(top_builddir)
	  when cross-compiling.

2013-02-26  Mark H Weaver  <mhw@netris.org>

	Update copyright dates on random.c
	* libguile/random.c: Add 2012 and 2013 to the copyright notice.

2013-02-25  Mark H Weaver  <mhw@netris.org>

	random_state_of_last_resort: use getpid directly, instead of scm_getpid
	* libguile/random.c: Include <sys/types.h> and <unistd.h> (if present).
	  (random_state_of_last_resort): Use getpid directly.

	Revert "random_state_of_last_resort doesn't rely on HAVE_POSIX"
	This reverts commit eaf21539d4afb8df5d1b549215fd397b23004947.

	Revert "random-state-from-platform: simplify pid conditional, and clarify docs."
	This reverts commit 08904661a2b1c6d461b2f5abfe3226a4023453fb.

2013-02-25  Mark H Weaver  <mhw@netris.org>

	random-state-from-platform: simplify pid conditional, and clarify docs.
	* libguile/random.c (random_state_of_last_resort): Simplify optional
	  inclusion of PID in the random state.  Clarify in the comments that
	  the PID is only included where scm_getpid is present.

	* doc/ref/api-data.texi (Random): Clarify that
	  'random-state-from-platform' includes the PID in the random state only
	  if scm_getpid is present.

2013-02-24  Andy Wingo  <wingo@pobox.com>

	remove language/glil/decompile-assembly.scm
	* module/language/glil/decompile-assembly.scm: Remove.  This module
	  never worked, and even failed to compile.

	* module/language/glil/spec.scm:
	* module/Makefile.am: Remove references to (language glil
	  decompile-assembly).

2013-02-24  Andy Wingo  <wingo@pobox.com>

	deprecate (ice-9 mapping)
	* module/ice-9/mapping.scm: Add deprecation warning.

2013-02-24  Daniel Hartwig  <mandyke@gmail.com>

	fix and update (ice-9 mapping)
	* module/ice-9/mapping.scm (mapping-create-handle!): INIT is required.
	  (mapping-ref): Rewrite.  Fix problem with DFLT.
	  (hash-table-mapping-hooks): Drop DELETE-PROC, hash-table accessors
	  only use ASSOC-PROC.  Add INIT to create-handle hook.  Use correct
	  hash-table accessors.
	  (make-hash-table-mapping): Drop DELETE-PROC.
	  (hash-table-mapping): Rewrite.  Drop DELETE-PROC.

2013-02-24  Andy Wingo  <wingo@pobox.com>

	cleanup to filesys.c's handling of file name separators
	* libguile/filesys.c (is_file_name_separator): New helper, as in
	  load.c.
	  (scm_dirname, scm_basename, scm_i_relativize_path): Use
	  is_file_name_separator.

	simplify scm_stat on mingw
	* libguile/filesys.c (scm_stat): Don't munge the filename on MinGW;
	  gnulib does that for us.

	load.c uses same logic as boot-9 for file names
	* libguile/load.c (is_file_name_separator, is_drive_letter):
	  (is_absolute_file_name): New helpers, like the ones in boot-9.
	  Perhaps we should just define them in C.
	  (search_path, scm_try_auto_compile, canonical_suffix): Rewrite using
	  the new helpers.

	allow '/' in the prefix of UNC file names on windows
	* module/ice-9/boot-9.scm (absolute-file-name?) [WINDOWS]: Allow '/' as
	  well as '\' when detecting UNC names.
	  (load-in-vicinity): Add a comment about the purpose of
	  canonical->suffix.

	random_state_of_last_resort doesn't rely on HAVE_POSIX
	* libguile/random.c (random_state_of_last_resort): Add the PID as a seed
	  only if we have scm_getpid().

2013-02-21  Mike Gran  <spk121@yahoo.com>

	Update predefined character sets to Unicode 6.2
	* libguile/srfi-14.i.c (cs_graphic_ranges, cs_printing_ranges, cs_symbol_ranges)
	  (cs_designated_ranges): modified

2013-02-20  Andy Wingo  <wingo@pobox.com>

	net_db.c doesn't import winsock2.h
	* libguile/net_db.c: Don't include winsock2.h; gnulib handles this for
	  us as necessary.

	mkstemp uses O_BINARY
	* libguile/mkstemp.c (mkstemp): Add O_BINARY.  Since temp files are
	  empty at the beginning, we're not changing the behavior for reading
	  files.  For writing files `newline' and ~% can add \r elements as
	  needed.  So this is a reasonable thing to do, and it prevents mangling
	  of temp files for the compiler.

2013-02-20  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct SPARC optimized assembly example in documentation
		* doc/body.texi: Fool proof validate the examples of what
		an assembly-language programmer would write and correct the
		wrong sparc example.

2013-02-20  Andy Wingo  <wingo@pobox.com>

	fix compilation of functions with more than 255 local variables.
	* module/language/glil/compile-assembly.scm (glil->assembly): Fix case
	  where there are more than 255 local variables.  Whoops!

2013-02-20  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add updated sparc example from lightning 1.2c documentation.
		* doc/body.texi: Add back the SPARC code generation example.

2013-02-19  Andy Wingo  <wingo@pobox.com>

	fix an error message loading invalid bytecode
	* libguile/objcodes.c (make_objcode_from_file): Add correct error
	  message if full_read failed without an errno.

	copy-file and load-objcode use O_BINARY
	* libguile/filesys.c (scm_copy_file):
	* libguile/objcodes.c (scm_load_objcode): Use O_BINARY.  Thanks to Eli
	  Zaretskii for the patch.

2013-02-19  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Finish sparc port.
		* check/lightning.c: Remove state flag to work with partial
		sparc port, by just disassembling if there was incomplete
		code generation.

		* jit_sparc-cpu.c: Correct wrong range check for immediate
		integer constants (off by one bit shift).
		  Correct macro implementing equivalent "rd %y, rd" assembly.
		  Implement qmul* and qdiv*.

		* jit_sparc.c: Update for qmul* and qdiv* and remove logic
		to handle incomplete code generation during sparc port.

2013-02-19  Eli Zaretskii  <eliz@gnu.org>

	Fix startup of guile.exe on MS-Windows.
	* module/system/base/compile.scm (call-with-output-file/atomic):  Call
	  close-port before deleting the temporary file name, otherwise deletion
	  fails on MS-Windows (cannot delete a file that is still open).

2013-02-19  Andy Wingo  <wingo@pobox.com>

	add link to doc about UNC names
	* module/ice-9/boot-9.scm (compile-time-case): Add link to docs about
	  UNC names.

2013-02-19  Andy Wingo  <wingo@pobox.com>

	better handling of windows file name conventions
	* libguile/filesys.c (scm_system_file_name_convention): New function.
	  Exported to Scheme only.

	* module/ice-9/boot-9.scm (file-name-separator?, absolute-file-name?):
	  New predicates.
	  (file-name-separator-string): New global variable.
	  (in-vicinity): Use the new procedures.
	  (load-user-init, try-module-autoload): Use file-name-separator-string.
	  (load-in-vicinity): Update canonical->suffix.  Consistently use the
	  term "file name" throughout.

	* module/ice-9/psyntax.scm (include): Use global `absolute-file-name?'.

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

2013-02-19  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Pass all but the (not yet implemented) qmul and qdiv tests in sparc
		* check/float.tst: Add sparc to list of known NaN and +-Inf
		to integer conversion.

		* check/lightning.c: Define __sparc__ to preprocessor in
		the sparc backend.

		* include/lightning/jit_private.h: Correct wrong definition
		of emit_stxi_d, that has lived for a long time, but would
		cause problems whenever needing to spill/reload a float
		register.

		* include/lightning/jit_sparc.h: Can only use %g2,%g3,%g4
		for scratch variables, as other "global" registers are
		reserved for the system, e.g. libc.
		  Reorder float register naming to make it easier to
		access odd float registers, so that generating code for
		pusharg and getarg is easier for the IR.

		* lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c: Update to match
		new code in jit_sparc-cpu.c. It must call jit_get_reg
		with jit_class_nospill if using the register to move
		an unconditional branch address to it, as the reload
		will not happen (actually could happen in the delay
		slot...)

		* lib/jit_sparc-cpu.c: Correct wrong macro definition for
		ldxr_s.
		  Properly implement div* and implement rem. Div* needs
		to use the y register, and rem* needs to be synthesized.
		  Correct b?sub* macro definitions.

		* lib/jit_sparc-fpu.c: Correct reversed float to/from double
		conversion.
		  Correct wrong jit_get_reg call asking for a gpr and then
		using the fpr with that number.
		  Correct wrong branch displacement computation for
		conditional branches.

		* lib/jit_sparc.c: Correct getarg_d and pushargi_d implementation.
		  Add rem* entries to the switch converting IR to machine code.

		* lib/lightning.c: Correct a problem detected when adding
		the jit_class_nospill flag to jit_get_reg, that was caused
		when having a branch to an "epilog" node, what would cause
		the code to think all registers in unknown state were live,
		while in truth, all registers in unknown state in the
		"just after return" point are actually dead.

2013-02-19  Mark H Weaver  <mhw@netris.org>

	Remove flawed test that assumed (eq? 1/2 2/4) would return false.
	* test-suite/tests/hash.test ("hash-count"): Remove flawed test.

2013-02-18  Ludovic Courtès  <ludo@gnu.org>

	build: Fix compilation of `c-tokenize.c' with latest Gnulib.
	* libguile/c-tokenize.lex: Include <config.h>, to pull in Gnulib macro
	  definitions now required.

2013-02-18  Andy Wingo  <wingo@pobox.com>

	add gnulib `times' module
	* lib: Add `times' module.  Should fix socket.c on MinGW.  Thanks to Eli
	  Zaretskii for the report.

	Add gnulib `select' module.
	Should fix fport_input_waiting when neither poll nor select nor FIONREAD
	are available, which is the case on MinGW.  Thanks to Eli Zaretskii for
	the report.

	Update to gnulib 0.0.7865-a828.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/array-handle.c
		libguile/deprecated.h
		libguile/inline.c
		libguile/inline.h
		module/ice-9/deprecated.scm
		module/language/tree-il/peval.scm

2013-02-18  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Array documentation fixes
	* libguile/generalized-arrays.c: Fix wording of docstring for array-length.
	* doc/ref/api-compund.texi:
	  - Document scm_array_type(), scm_array_ref(), array-length,
	    scm_array_length(), scm_c_array_length().
	  - Fix wording of documentation for array-in-bounds?

2013-02-18  Andy Wingo  <wingo@pobox.com>

	deprecate generalized vectors in favor of arrays
	* libguile/generalized-arrays.h:
	* libguile/generalized-arrays.c (scm_c_array_length):
	  (scm_array_length): New functions.

	* module/ice-9/deprecated.scm:
	* libguile/generalized-vectors.c:
	* libguile/generalized-vectors.h:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_generalized_vector_p)
	  (scm_generalized_vector_length, scm_generalized_vector_ref)
	  (scm_generalized_vector_set_x, scm_generalized_vector_to_list):
	  Deprecate.

	* libguile/uniform.c (scm_uniform_vector_to_list): Use
	  scm_array_to_list.

	* module/ice-9/boot-9.scm (case): Arrays are generalized vectors.

	* module/srfi/srfi-4/gnu.scm (define-any->vector): Use the array
	  functions instead of the generalized-vector functions.

	* test-suite/tests/arrays.test: Remove generalized-vector->list test;
	  covered by array->list test.

	* test-suite/tests/bitvectors.test:
	* test-suite/tests/bytevectors.test:
	* test-suite/tests/srfi-4.test: Adapt to test using array interfaces
	  instead of generalized-vector interfaces.

	* doc/ref/api-compound.texi: Remove generalized vector docs.
	* doc/ref/api-data.texi:
	* doc/ref/srfi-modules.texi: Adapt.

2013-02-18  Andy Wingo  <wingo@pobox.com>

	optimize access to arrays of rank 1 or 2
	* libguile/array-handle.c (scm_array_handle_pos_1):
	  (scm_array_handle_pos_2): New functions.

	* libguile/generalized-arrays.c (scm_c_array_ref_1, scm_c_array_ref_2):
	  (scm_c_array_set_1_x, scm_c_array_set_2_x): New functions.
	  (scm_i_array_ref, scm_i_array_set_x): New subr bindings for array-ref
	  and array-set! that avoid consing for arrays of rank 1 or 2.

	* test-suite/tests/arrays.test ("array-set!"): Fix expected exception
	  for wrong number of indices.

2013-02-18  Andy Wingo  <wingo@pobox.com>

	array handle inline functions defined in array-handle.h.
	* libguile/inline.h:
	* libguile/array-handle.h (scm_array_handle_ref):
	  (scm_array_handle_set): Move definitions here from inline.h.

	* libguile/inline.c: Include array-handle.h.

2013-02-18  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add framework for sparc port.
		* include/lightning/jit_sparc.h, lib/jit_sparc-cpu.c,
		lib/jit_sparc-fpu.c, lib/jit_sparc.c: New files implementing
		the basic framework of the sparc port.

		* configure.ac, include/lightning.h, include/lightning/Makefile.am,
		include/lightning/jit_private.h, lib/jit_disasm.c: Update
		for the sparc port framework.

		* lib/jit_mips.c: Correct reversed retr/reti logic.

		* lib/jit_ppc.c: Correct misspelled __LITTLE_ENDIAN.

		* lib/lightning.c: Always do byte hashing in hash_data, because
		the logic to "compress" strings causes large pointers to not
		be guaranteed aligned at 4 byte boundaries.
		  Update for the sparc port framework.

2013-02-18  Daniel Hartwig  <mandyke@gmail.com>

	add hash-count for native tables
	* libguile/hashtab.c (scm_hash_count): New function.  Count the number
	  of elements in a hash table.

	* doc/ref/api-compound.texi (Hash Tables): Update examples and
	  reference.

	* test-suite/tests/hash.test (hash-count): New test.

2013-02-16  Ludovic Courtès  <ludo@gnu.org>

	Fix `getgroups' for when zero supplementary group IDs exist.
	* libguile/posix.c (scm_getgroups): Return the empty vector when NGROUPS
	  is zero.  Reported by Mike Gran <spk121@yahoo.com>.

2013-02-15  Andy Wingo  <wingo@pobox.com>

	local rewrite for apply to a let-bound rest list
	* module/language/tree-il/peval.scm (peval): Add a special-case inlining
	  pattern for apply to a let-bound rest arg that preserves effect
	  ordering.

	* test-suite/tests/peval.test ("partial evaluation"): Add a test, and
	  update an older test with a better result.

2013-02-15  Andy Wingo  <wingo@pobox.com>

	inline call-with-values consumers with optional and/or rest args
	* module/language/tree-il/peval.scm (peval): Inline call-with-values
	  whose consumers have optional and rest arguments.

	* test-suite/tests/peval.test ("partial evaluation"): Add test.

2013-02-15  Andy Wingo  <wingo@pobox.com>

	more rest argument inlining improvements
	* module/language/tree-il/peval.scm (peval): Correct comment on
	  find-definition, and allow a find-definition to fall back on a source
	  expression.  Avoid copying non-constant expressions.

	* test-suite/tests/peval.test ("partial evaluation"): Add a test that
	  inlining rest arguments works with complicated argument expressions,
	  and a test that order of effects in rest args is preserved.

2013-02-15  Andy Wingo  <wingo@pobox.com>

	better inlining of `apply' with rest arguments
	* module/language/tree-il/peval.scm (peval): Move up the find-definition
	  helper.  Use it to speculatively destructure conses and lists into the
	  tail position of an `apply' form.

	* test-suite/tests/peval.test ("partial evaluation"): Add tests.

2013-02-15  Andy Wingo  <wingo@pobox.com>

	procedures with rest arguments can get inlined
	* module/language/tree-il/peval.scm (peval): Allow inlining of
	  procedures with rest arguments.

	* test-suite/tests/peval.test ("partial evaluation"): Add a test.

2013-02-14  Andy Wingo  <wingo@pobox.com>

	peval can inline let-bound lambdas
	* module/language/tree-il/peval.scm (peval): Better inlining of
	  complicated operators.

	* test-suite/tests/peval.test ("partial evaluation"): Add a couple
	  tests.

2013-02-14  Daniel Hartwig  <mandyke@gmail.com>

	update old references in FFI doc
	* doc/ref/api-foreign.texi (Foreign Types): Replace references to the
	  old foreign->bytevector and bytevector->foreign with the new procedure
	  names using pointer.

2013-02-12  Andy Wingo  <wingo@pobox.com>

	allow (define-macro name (lambda ...))
	* module/ice-9/boot-9.scm (define-macro): Allow define-macro NAME
	  LAMBDA.  A bugfix.  Thanks to Akop Pogosian.

2013-02-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct regression with float arguments in arm hardp
		* lib/jit_arm.c: Correct jit_pushargi_f in the arm hardfp abi.
		Most of the logic uses even numbered register numbers, so that
		a float and a double can be used in the same register, but
		the abi requires packing the float arguments, so jit_pushargi_f
		needs to allocate a temporary register to modify only the
		proper register argument (or be very smart to push two
		immediate arguments if applicable).

2013-02-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add code to release all memory used by the jit state.
		* include/lightning.h, lib/lightning.c: Implement the new
		jit_clear_state and jit_destroy_state calls. jit_clear_state
		releases all memory not required during jit_execution; that
		is, leaves only the mmap'ed data and code buffers allocated.
		jit_destroy_state releases the mmap'ed buffers as well as
		the jit_state_t object itself, that holds pointers to the
		code and data buffers, as well as annotation pointers (for
		disassembly or backtrace) in the data buffer.

		* lib/jit_note.c: Correct invalid vector offset access.

		* check/ccall.c, check/lightning.c, doc/ifib.c, doc/incr.c,
		doc/printf.c, doc/rfib.c, doc/rpn.c: Use the new jit_clear_state
		and jit_destroy_state calls, to demonstrate the new code to
		release all jit memory.

		* doc/body.texi: Add basic documentation and usage description
		of jit_clear_state and jit_destroy_state.

2013-02-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Store all annotation information in the read only data buffer.
		* include/lightning/jit_private.h, lib/jit_note.c, lib/lightning.c:
		  Store all annotation information in the mmap'ed area reserved for
		read only data. This adds code to not allocate memory for jit_note_t
		objects, and to	relocate jit_line_t objects and its contents after
		calculating annotation information. The jit_line_t objects are
		relocated because it is not possible to always calculate before
		hand data layout because note information may be extended or
		redundant entries removed, as well as allowed to be added in
		non sequential order.
		  A bug was also corrected in _jit_set_note, that was causing it
		to allocate new jit_line_t objects when not needed. It was still
		working correctly, but allocating way more memory than required.

2013-02-09  Andy Wingo  <wingo@pobox.com>

	(texinfo): add a command-spec for @math{}.
	* module/texinfo.scm (texi-command-specs): Add `math' as inline-text.

	(texinfo docbook): informaltable is a block element.
	* module/texinfo/docbook.scm (*sdocbook-block-commands*): informaltable
	  is a block element.

	(texinfo plain-text): Pass @math{} through as-is.
	* module/texinfo/plain-text.scm (tag-handlers): Pass `math' through
	  as-is.

	(texinfo serialize): don't break words when wrapping
	* module/texinfo/serialize.scm (wrap): Don't break long words by
	  default; that could break @-commands.

2013-02-05  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement the "live" code to explicitly tell a register is live.
		*include/lightning.h, lib/lightning.c: Add the new jit_live code
		to explicitly mark a register as live. It is required to avoid
		assuming functions always return a value in the gpr and fpr return
		register, and to avoid the need of some very specialized codes
		that vary too much from backend to backend, to instruct the
		optimization code the return register is live.

		* lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,
		lib/jit_x86.c: Update for the new jit_live code.

		* check/ret.ok, check/ret.tst: New files implementing a simple
		test case that would previously fail at least in ix86/x86_64.

		* check/Makefile.am: Update for new "ret" test case.

2013-02-05  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct qmul and qdiv in ppc.
		* lib/jit_ppc-cpu.c, lib/jit_ppc.c: Validate and correct
		problems in the qmul and qdiv ppc implementation.

2013-02-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement the qmul and qdiv instructions.
	2013-02-04 Paulo Andrade <pcpa@gnu.org>

		* include/lightning.h, include/lightning/jit_private.h,
		lib/jit_arm-cpu.c, lib/jit_arm.c, lib/jit_mips-cpu.c,
		lib/jit_mips.c, lib/jit_ppc-cpu.c, lib/jit_ppc.c,
		lib/jit_x86-cpu.c, lib/jit_x86.c, lib/lightning.c:
		Implement the new qmul and qdiv instructions that return signed
		and unsigned lo/hi multiplication result and div/rem division result.
		These should be useful for jit translation of code that needs to
		know if a multiplication overflows (no branch opcode added) or if
		a division is exact (easy check if remainder is zero).

		* check/lightning.c, lib/jit_print.c, check/Makefile.am,
		check/all.tst: Update for the new qmul and qdiv instructions.

		* check/qalu.inc, check/qalu_div.ok, check/qalu_div.tst,
		check/qalu_mul.ok, check/qalu_mul.tst: New files implementing
		simple test cases for qmul and qdiv.

2013-02-02  Mark H Weaver  <mhw@netris.org>

	Add copyright notice to gen-scmconfig.c.
	* libguile/gen-scmconfig.c: Add copyright notice.

2013-02-02  Mark H Weaver  <mhw@netris.org>

	Add foreign types: ssize_t and ptrdiff_t.
	* libguile/foreign.c (sym_ssize_t, sym_ptrdiff_t): New symbols.
	  (scm_init_foreign): Add bindings for ssize_t and ptrdiff_t.

	* module/system/foreign.scm: Export ssize_t and ptrdiff_t.

	* doc/ref/api-foreign.texi (Foreign Types): Add docs.

2013-02-02  Mark H Weaver  <mhw@netris.org>

	Add scm_from_ptrdiff_t and scm_to_ptrdiff_t.
	* libguile/numbers.h (scm_from_ptrdiff_t, scm_to_ptrdiff_t):
	  New macros (function aliases).

	* doc/ref/api-data.texi: Add docs.

2013-02-02  Mark H Weaver  <mhw@netris.org>

	Fix typo in comment generated by gen-scmconfig.c.
	* libguile/gen-scmconfig.c (main): Fix typo in generated comment.

2013-02-01  Ludovic Courtès  <ludo@gnu.org>

	guild: Gracefully handle failures to install the locale.
	* meta/guild.in (main): Catch `system-error' when calling `setlocale',
	  and gracefully handle any error.

	Skip FFI tests that rely on `-export-dynamic' behavior when not available.
	* test-suite/tests/foreign.test ("make-pointer")["equal? modulo
	  finalizer", "equal? modulo finalizer (set-pointer-finalizer!)"]: Skip
	  when `scm_is_pair' cannot be found, as is the case on Cygwin.
	  Reported by "objc" <objcjohn@hotmail.com>.

2013-01-31  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		module/ice-9/psyntax-pp.scm
		module/ice-9/psyntax.scm
		module/language/bytecode/spec.scm
		module/language/tree-il/spec.scm

2013-01-31  Mark H Weaver  <mhw@netris.org>

	Do not defer expansion of internal define-syntax forms.
	* module/ice-9/psyntax.scm (expand-body): As required by R6RS, evaluate
	  the right-hand-sides of internal 'define-syntax' forms and add their
	  transformers to the compile-time environment immediately, so that the
	  newly-defined keywords may be used in definition context within the
	  same lexical contour.  Fixes #13509.

	Bump copyright year to 2013 in REPL greeting.
	* module/system/repl/common.scm: Add not only 2013, but also 2012 to the
	  copyright notice at the top of the file, since the file was changed in
	  2012.
	  (*version*): Bump copyright year to 2013 in REPL greeting.

2013-01-30  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct description of the jmpi instruction.
		* doc/body.texi: Correct "jmpi" description that incorrectly
		told it was possible to pass any address as jump target. The
		only way to do that is "movi+jmpr".

2013-01-30  Andy Wingo  <wingo@pobox.com>

	Revert "detect and consume byte-order marks for textual ports"
	This reverts commit b2cb557d75e4daf8c7c8cd43313f4cc51d9a3f1b, which was
	pushed accidentally.

2013-01-30  Andy Wingo  <wingo@pobox.com>

	add #:doctype-handler to xml->sxml
	* module/sxml/simple.scm (read-internal-doctype-as-string): New helper.
	  (xml->sxml): Add #:doctype-handler argument.

	* doc/ref/sxml.texi (Reading and Writing XML): Document
	  #:doctype-handler.  Fix some other examples, and fix the default value
	  of #:declare-namespaces?.

	* test-suite/tests/sxml.simple.test: Add all tests from the manual
	  here.

2013-01-30  Andy Wingo  <wingo@pobox.com>

	quick fix to ssax.scm
	* module/sxml/ssax.scm: Fix previous commit.

	fix ssax:warn to work as intended
	* module/sxml/ssax.scm (ssax:warn): Fix to make more sense.

2013-01-30  Andy Wingo  <wingo@pobox.com>

	detect and consume byte-order marks for textual ports
	* libguile/ports.h:
	* libguile/ports.c (scm_consume_byte_order_mark): New procedure.

	* libguile/fports.c (scm_open_file): Call consume-byte-order-mark if we
	  are opening a file in "r" mode.

	* libguile/read.c (scm_i_scan_for_encoding): Don't do anything about
	  byte-order marks.

	* libguile/load.c (scm_primitive_load): Add a note about the duplicate
	  encoding scan.

	* test-suite/tests/filesys.test: Add tests for UTF-8, UTF-16BE, and
	  UTF-16LE BOM handling.

2013-01-30  Andy Wingo  <wingo@pobox.com>

	require automake 1.12 for `serial-tests'.
	* configure.ac: Require automake 1.12 for `serial-tests'.

2013-01-30  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct C sequence point problem.
		* lib/jit_x86-cpu.c: Correct undefined behavior code.
		http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56143

2013-01-29  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add heuristic code to estimate space and resize if required jit buffer.

2013-01-28  Ludovic Courtès  <ludo@gnu.org>

	build: Allow use of Automake 1.13.
	Fixes <http://bugs.gnu.org/13558>.
	Reported by DNS <dns@rbose.org>.

	* configure.ac: Use the `serial-tests' Automake option to cope with
	  Automake 1.13, which uses `parallel-tests' by default.

2013-01-28  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded SMOB mark procedure in `memoize.c'.
	* libguile/memoize.c (scm_init_memoize): Remove unnecessary call to
	  `scm_set_smob_mark'.

2013-01-28  Ian Price  <ianprice90@googlemail.com>

	Fix argument count for various format string escape sequences.
	* module/language/tree-il/analyze.scm (format-string-argument-count):
	  Handle ~t and ~k options case-insensitively.
	  ~! ~| ~/ ~q and ~Q should not update the min-count or max-count.
	  ~^ returns the min-count and 'any
	  + - # and ' should not increase the argument count.
	* test-suite/tests/tree-il.test (*): Tests for new parameters.

2013-01-28  Andy Wingo  <wingo@pobox.com>

	xml->sxml argument can be a port or a string
	* module/sxml/simple.scm (xml->sxml): Allow the optional arg to be a
	  port or a string.
	* doc/ref/sxml.texi (Reading and Writing XML): Update docs.

2013-01-28  Andy Wingo  <wingo@pobox.com>

	make (sxml simple)'s xml->sxml more capable
	* module/sxml/simple.scm (xml->sxml): Add #:namespaces,
	  #:declare-namespaces?, #:entities, #:default-entity-handler, and
	  #:trim-whitespace? arguments.

	* doc/ref/sxml.texi (Reading and Writing XML): Document the new
	  options.

2013-01-28  Andy Wingo  <wingo@pobox.com>

	ssax: treat *DEFAULT* as a fallback handler in entity alist
	* module/sxml/upstream/SSAX.scm (ssax:handle-parsed-entity):
	  Interpret *DEFAULT* as being a default handler procedure for parsed
	  entities.  Includes test.

2013-01-28  Andy Wingo  <wingo@pobox.com>

	begin rewriting SXML docs
	* doc/ref/sxml.texi (SXML): Reorder and begin rewriting.  Fix formatting
	  throughout, provide a new introduction, and the beginning of proper
	  SSAX documentation.

	* doc/ref/sxml-match.texi:
	* doc/ref/texinfo.texi:
	* doc/ref/web.texi: Update references to new node names.

2013-01-27  Andy Wingo  <wingo@pobox.com>

	current-ssax-error-port is a parameter
	* module/sxml/ssax.scm (current-ssax-error-port): Change to be a
	  parameter.

2013-01-27  Mark H Weaver  <mhw@netris.org>

	Fix source annotation bug in psyntax 'expand-body'.
	* module/ice-9/psyntax.scm (expand-body): Apply source-annotation to an
	  expression, not to the expression's compile-time environment.

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

2013-01-27  Mark H Weaver  <mhw@netris.org>

	Add 'for-humans?' flag to <language> specifications.
	* module/system/base/language.scm (<language>): Add 'for-humans?'
	  field, and export new 'language-for-humans?' predicate.

	* doc/ref/compiler.texi (Compiler Tower): Document.

	* module/language/assembly/spec.scm, module/language/bytecode/spec.scm,
	  module/language/glil/spec.scm, module/language/objcode/spec.scm,
	  module/language/tree-il/spec.scm, module/language/value/spec.scm:
	  Mark these languages as 'for-humans?'.

2013-01-26  Ludovic Courtès  <ludo@gnu.org>

	Add tests for `--language'.
	* test-suite/standalone/Makefile.am (top_srcdir): Add `top_srcdir'.
	  (check_SCRIPTS, TESTS): Add `test-language'.
	  (EXTRA_DIST): Add `test-language.el' and `test-language.js'.
	* test-suite/standalone/test-language,
	  test-suite/standalone/test-language.el,
	  test-suite/standalone/test-language.js: New files.

	ecmascript: Fix conversion to boolean for non-numbers.
	* module/language/ecmascript/base.scm (->boolean): Call `zero?' and
	  `nan?' only when X is a number.
	* test-suite/tests/ecmascript.test ("compiler"): Add test case.

	Clarify the copyright status of GOOPS.
	* module/oop/goops.scm, module/oop/goops/active-slot.scm,
	  module/oop/goops/composite-slot.scm, module/oop/goops/describe.scm:
	  Add a copyright line for Érick Gallesio.  Mention the STk version
	  GOOPS was derived from.  Remove mentions of the ‘COPYRIGHTS’ file.
	  Thanks to Karl Berry <karl@freefriends.org> for pointing it out, and
	  to Michael Djurfeldt <mikael@djurfeldt.com>.

2013-01-24  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Update texinfo documentation to match current implementation.
		* check/Makefile.am: "make debug" target should pass only
		the main test tool program as argument for running gdb

		* configure.ac: Add the --enable-assertions options.

		* doc/Makefile.am, doc/body.texi, doc/lightning.texi:
		Major rewrite of the documentation to match the current
		implementation.

		* doc/version.texi: Automatic date update.

		* doc/ifib.c, doc/incr.c, doc/printf.c, doc/rfib.c, doc/rpn.c:
		Implementation of the documentation examples, that are also
		compiled during a normal build.

		* doc/p-lightning.texi, doc/porting.texi, doc/toc.texi,
		doc/u-lightning.texi, doc/using.texi: These files were
		renamed in the documentation rewrite, as the documentation
		was significantly trimmed due to full removal of the porting
		chapters. Better porting documentation should be added but
		for the moment it was just removed the documentation not
		matching the implementation.

2013-01-23  Mark H Weaver  <mhw@netris.org>

	Regenerate psyntax-pp.scm.
	* module/ice-9/psyntax-pp.scm: Regenerate.  This should have been done
	  in commit 84f5a8251710c7d2a01590aa083d9dd409a56279 (`include' relative
	  paths relative to including file).

2013-01-23  Andy Wingo  <wingo@pobox.com>

	oop goops save: fix compile-time availability of write-component
	* module/oop/goops/save.scm (write-component)
	  (write-component-procedure): Move definitions up so that syntax
	  definition is available when compiling the rest of the file.

	Merge remote-tracking branch 'origin/stable-2.0'

	Merge remote-tracking branch 'origin/stable-2.0'

	merge stable-2.0
	There are some bugs with command-line handling that will be sorted out
	with the next commit.

	fix regression in -l
	* module/ice-9/command-line.scm (compile-shell-switches): Fix regression
	  with -l argument, which was loading arg0 instead.

	load files from the command line relative to the cwd
	* module/ice-9/command-line.scm (load/lang): Load files from the command
	  line relative to the current working directory (fixes regression).

	Merge branch 'wip-peg-ownership'
	This merged branch has the correct author information for commit
	eee0877c3e6ade8f2fa243cfa696918451c67aff.

2013-01-23  Michael Lucy  <michaelglucy@gmail.com>

	add PEG parser generator
	* module/ice-9/peg.scm: New file.
	* module/Makefile.am: Add to build.

	* doc/ref/Makefile.am:
	* doc/ref/api-peg.texi:
	* doc/ref/guile.texi: Add documentation for PEG parser.

	* test-suite/Makefile.am:
	* test-suite/tests/peg.bench:
	* test-suite/tests/peg.test: Add tests, and a benchmark.

2013-01-23  Andy Wingo  <wingo@pobox.com>

	add --language argument
	* module/ice-9/command-line.scm (*usage*): Make usage of capitalization
	  and sentences consistent (lower-case and semicolons, as in ls
	  --help).
	  Be less specific about languages (Scheme is the default but not the
	  only language).
	  Document --language.
	  (load/lang, eval-string/lang): New helpers.
	  (compile-shell-switches): Parse a --language argument, and use it to
	  set (current-language).

	fix dynamic-call doc
	* doc/ref/api-foreign.texi (Foreign Functions): Fix doc: interrupts are
	  not deferred in a dynamic-call.

2013-01-22  Andy Wingo  <wingo@pobox.com>

	paameterize in read-and-compile
	* module/system/base/compile.scm (read-and-compile): Use
	  current-language parameter.

	docstring in rdelim
	* module/ice-9/rdelim.scm: Update docstring.

2013-01-22  Andy Wingo  <wingo@pobox.com>

	current-language is a parameter in boot-9
	* module/ice-9/boot-9.scm (current-language): New parameter.

	* module/system/base/language.scm (*current-language*): Pull fluid from
	  parameter.
	  (current-language): Now a re-exported parameter.

	* doc/ref/compiler.texi: Update reference from *current-language* fluid
	  to current-language parameter.

	* module/system/base/compile.scm (compile-and-load):
	* module/ice-9/top-repl.scm (top-repl): Default to the current language,
	  not to Scheme.

	* module/ice-9/eval-string.scm:
	* module/system/base/language.scm:
	* module/system/repl/command.scm:
	* module/system/repl/repl.scm: Update to use current-language parameter
	  and parameterize.

2013-01-22  Andy Wingo  <wingo@pobox.com>

	add fluid->parameter
	* module/ice-9/boot-9.scm (make-parameter): Add a docstring.
	  (fluid->parameter): New interface.  Use it when turning port fluids
	  into parameters.

	* doc/ref/api-scheduling.texi (Parameters): Deffn instead of defun for
	  make-parameter documentation.  Add docs for fluid->parameter.

2013-01-22  Andy Wingo  <wingo@pobox.com>

	add read-string and read-string! to (ice-9 rdelim)
	* module/ice-9/rdelim.scm (read-string!, read-string): New functions.
	* test-suite/tests/rdelim.test: Add tests.
	* doc/ref/api-io.texi: Add docs.

	* module/ice-9/iconv.scm:
	* module/rnrs/io/ports.scm:
	* module/web/uri.scm: Use the new functions.

2013-01-22  Andy Wingo  <wingo@pobox.com>

	`include' relative paths relative to including file
	* module/ice-9/psyntax.scm (include): Like `load', interpret relative
	  paths as being relative to the file that does the `include'.

	* doc/ref/api-evaluation.texi: Update docs.

2013-01-22  Andy Wingo  <wingo@pobox.com>

	libguile examples use scm_c_vector functions instead of SCM_SIMPLE_VECTOR_*
	* doc/ref/libguile-concepts.texi (Multi-Threading): Use functions in the
	  example instead of macros.  Performance is really not a concern with
	  this interface, especially now that scm_car and scm_cdr are inline
	  functions.

2013-01-22  Andy Wingo  <wingo@pobox.com>

	documentation recommends scm_new_smob instead of SCM_NEWSMOB
	* doc/ref/api-smobs.texi (Smobs): Document scm_new_smob and
	  scm_new_double_smob instead of the SCM_NEWSMOB / SCM_RETURN_NEWSMOB
	  family of macros.

	* doc/ref/libguile-smobs.texi (Creating Smob Instances): Use
	  scm_new_smob.

2013-01-22  Andy Wingo  <wingo@pobox.com>

	fix compilation of glil to assembly
	* libguile/vm-i-scheme.c (VM_VALIDATE_STRUCT): Fix the error message if
	  the value was not a struct.

	* module/system/base/compile.scm (find-language-joint): Default to
	  joining at the target language.
	  (default-language-joiner): Allow sequences of one compiled expression
	  to pass through.  Otherwise error as before.
	  (read-and-parse): New helper; actually parses.
	  (read-and-compile): Use read-and-parse, and fall back to
	  default-language-joiner.

	Thanks to Nala Ginrut for the report.

2013-01-21  Andy Wingo  <wingo@pobox.com>

	Fix http-get* deprecation note
	* module/web/client.scm (http-get*): Fix deprecation warning.  Thanks to
	  Daniel Hartwig for the report.

	add dynl.x dep on libpath.h
	* libguile/Makefile.am (dynl.x): Add dep on libpath.h.  Thanks to Bogdan
	  Marinescu for the report.

	read-and-compile closes input file after seeing EOF
	* module/system/base/compile.scm (read-and-compile): Close the input
	  port after we read all of its data.  Perhaps this cleans up some NFS
	  ghosts that David Pirotte was seeing.

2013-01-21  Andy Wingo  <wingo@pobox.com>

	fix try-module-autoload, which did not detect failure to find the file
	* libguile/load.c (scm_primitive_load_path): If the second argument is a
	  procedure, call it like a thunk.

	* doc/ref/api-evaluation.texi (Load Paths): Update docs.

	* module/ice-9/boot-9.scm (resolve-interface): Use `unless'.
	  (try-module-autoload): Use the new primitive-load-path to detect
	  failure to find an appropriate file.  Fixes a bug reported by Diogo
	  F. S. Ramos.  Thanks to Noah Lavine for tracking it down.

2013-01-20  Andy Wingo  <wingo@pobox.com>

	Fix attempt to get handle of weak table in (oop goops save)
	* module/oop/goops/save.scm (readable?): Fix.  Thanks to Andrew Gaylard
	  for the report.

	weak-table consolidation around scm_i_register_weak_gc_callback
	* libguile/weak-table.c (GC_move_disappearing_link)
	  (move_disappearing_links): Factor out stub, as in previous weak-set
	  commit.
	  (resize_table): As in weak-set commit, finalizers do not run within
	  allocators.
	  (do_vacuum_weak_table): Add comment about need for trylock.
	  (scm_c_make_weak_table): Use the new scm_i_register_weak_gc_callback.
	  Previously this was the case because of a mistyped check for a
	  "HAVE_GC_TABLE_START_CALLBACK" symbol, whereas the symbol was actually
	  HAVE_GC_SET_START_CALLBACK.  Anyway, it's better to call this after GC
	  anyway, as vacuuming might need to allocate weak links (on pre-7.3
	  libgc without GC_move_disappearing_link) or reallocate the backing
	  vector.

2013-01-20  Andy Wingo  <wingo@pobox.com>

	consolidate scm_i_register_weak_gc_callback, update weak-set to fit
	* libguile/finalizers.h:
	* libguile/finalizers.c (scm_i_register_weak_gc_callback): New internal
	  helper, from weak-set.c.

	  Relative to the previous weak-set.c version, prefer the
	  finalizer-based implementation.  Fix bug regarding confusion between
	  scm_before_gc_c_hook and scm_after_gc_hook.  Fix bug regarding
	  referencing weak values outside of the alloc lock.

	* libguile/weak-set.c (GC_move_disappearing_link): New stub.
	  GC_move_disappearing_link is only available in libgc 7.3.
	  (move_weak_entry): Use the new stub instead of ifdeffery.
	  (resize_set): Now that we run finalizers from a separate thread or
	  async, we can keep the lock while reallocating the set vector.
	  (do_vacuum_weak_set): For the same reason, always lock the set.
	  Remove implementation of scm_c_register_weak_gc_callback in preference
	  of the new copy in finalizers.c.
	  (scm_c_make_weak_set): Use the new scm_i_register_weak_gc_callback.

2013-01-20  Andy Wingo  <wingo@pobox.com>

	gc.c: assume gc 7.2 features are present
	* libguile/gc.c: Remove shims for GC_get_heap_usage_safe,
	  GC_get_free_space_divisor, and GC_set_finalize_on_demand.  Remove code
	  in the case in which we did not have GC_set_start_callback.

2013-01-18  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct reference to dangling pointer and better note bounds checking
		lib/jit_note.c: Correct bounds check and wrong code keeping
		a pointer that could be changed after a realloc call.

	Add the new jit_name call to mark function boundaries
		* check/3to2.tst, check/add.tst, check/allocai.tst, check/bp.tst,
		check/call.tst, check/ccall.c, check/clobber.tst, check/divi.tst,
		check/fib.tst, check/ldsti.tst, check/ldstr-c.tst, check/ldstr.tst,
		check/ldstxi-c.tst, check/ldstxi.tst, check/ldstxr-c.tst,
		check/ldstxr.tst, check/lightning.c, check/rpn.tst, check/stack.tst,
		check/varargs.tst, include/lightning.h,
		include/lightning/jit_private.h, lib/jit_arm.c, lib/jit_disasm.c,
		lib/jit_mips.c, lib/jit_note.c, lib/jit_ppc.c, lib/jit_print.c,
		lib/jit_x86.c, lib/lightning.c:	Extend the "jit_note" abstraction
		with the new "jit_name" call, that receives a string argument, and
		should usually be called to mark boundaries of functions of code
		generating jit (that is, it is not expected that the language
		generating jit map its functions to jit functions).

2013-01-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Make JIT_RET, JIT_FRET and JIT_SP private.
		* check/add.tst, check/allocai.tst, check/bp.tst, check/divi.tst,
		check/fib.tst, check/lightning.c, include/lightning/jit_arm.h,
		include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
		include/lightning/jit_private.h, include/lightning/jit_x86.h:
		Make JIT_RET, JIT_FRET and JIT_SP private. These should not be
		used in any operations due to frequently having special
		constraints (usually JIT_FRET). JIT_FP must be made available
		because it must be used as the base register to access stack
		space allocated with jit_allocai.

2013-01-17  Andy Wingo  <wingo@pobox.com>

	guile 2.2 will require libgc 7.2 or greater
	* configure.ac: Bump required libgc version to 7.2, released March
	  2012.

2013-01-17  Andy Wingo  <wingo@pobox.com>

	warn on multithreaded fork
	* libguile/posix.c (scm_fork): Issue a warning on a multithreaded fork.
	* doc/ref/posix.texi (Processes): Add note about multithreaded fork.

	* test-suite/tests/00-socket.test: Moved here, from socket.test, so as
	  to run before any threads are created.
	* test-suite/Makefile.am: Adapt.

2013-01-17  Andy Wingo  <wingo@pobox.com>

	warning instead of error on multithreaded fork
	* libguile/posix.c (scm_fork): Issue a warning instead of an error on a
	  multithreaded fork.
	* doc/ref/posix.texi (Processes): Add note about multithreaded fork.

2013-01-16  Andy Wingo  <wingo@pobox.com>

	trace: limit length of "| | | "... prefix
	* module/system/vm/trace.scm (build-prefix): New helper.
	  (print-application, print-return): Use the helper.
	  (trace-calls-to-procedure, trace-calls-in-procedure):
	  (trace-instructions-in-procedure, call-with-trace): Add #:max-indent
	  argument, defaulting to the terminal width less 40 characters.

	* doc/ref/scheme-using.texi: Update `trace' docs.

	Based on a patch by Nala Ginrut.

2013-01-16  Andy Wingo  <wingo@pobox.com>

	peval-introduced gensyms infix " "
	* module/language/tree-il/peval.scm (peval): Gensyms use whitespace as
	  an infix, not a dash.  Helps gensym?-like procedures like those in the
	  unused lexical analysis.

2013-01-16  Noah Lavine  <noah.b.lavine@gmail.com>

	Remove 'define-grammar-f'
	* module/ice-9/peg.scm: don't re-export 'define-grammar-f'
	* module/ice-9/peg/string-peg.scm: don't export 'define-grammar-f'

	PEG Renames
	* module/ice-9/peg.scm: rename 'peg-sexp-compile' to
	 'compile-peg-pattern'
	* module/ice-9/peg/codegen.scm: same
	* module/ice-9/peg/string-peg.scm: same
	* module/ice-9/peg/using-parsers.scm: same
	* doc/ref/api-peg.texi: same

	PEG Renames
	* module/ice-9/peg.scm: rename 'define-grammar' to
	 'define-peg-string-patterns'
	* module/ice-9/peg/string-peg.scm: same
	* doc/ref/api-peg.texi: same
	* test-suite/tests/peg.bench: same
	* test-suite/tests/peg.test: same

	PEG Renames
	* module/ice-9/peg.scm: rename 'define-nonterm' to 'define-peg-pattern'
	* module/ice-9/peg/using-parsers.scm: same
	* module/ice-9/peg/string-peg.scm: same
	* test-suite/tests/peg.test: same
	* doc/ref/api-peg.texi: same

	PEG Renames
	* module/ice-9/peg.scm: rename 'peg-parse' to 'match-pattern'
	* module/ice-9/peg/string-peg.scm: same
	* module/ice-9/peg/using-parsers.scm: same
	* doc/ref/api-peg.texi: same
	* test-suite/tests/peg.test: same
	* test-suite/tests/peg.bench: same

	PEG Renames
	* doc/ref/api-peg.texi: rename 'peg-match' to 'search-for-pattern'
	* module/ice-9/peg.scm: same
	* module/ice-9/peg/using-parsers.scm: same
	* test-suite/tests/peg.test: same

2013-01-16  Noah Lavine  <nlavine@haverford.edu>

	Document PEGs at Runtime
	doc/ref/api-peg.texi: suggest a cleaner method of generating PEG parsers
	  at runtime.

	Update PEG Documentation
	Change the PEG documentation to use the new style of s-expression PEGs.

	Comments in PEG
	module/ice-9/peg/string-peg.scm: add comments explaining the format of some
	  of the parsed PEG forms.

	Remove 'body' PEG
	module/ice-9/peg/string-peg.scm: update S-expression generators to use the
	  new *, +, ?, followed-by, and not-followed-by forms.
	module/ice-9/peg/codegen.scm: remove the 'body' form in the PEG s-expression
	  representation.

	Add 'not-followed-by' PEG
	The PEG s-expression syntax now uses '(not-followed-by ...)' instead of
	'(body ! ... 1)'.

	Add 'followed-by' PEG
	The PEG s-expression syntax now uses '(followed-by ...)' instead of
	'(body & ... 1)'.

	Add '?' PEG
	The PEG s-expression syntax now uses '(? ...)' instead of '(body lit ... ?)'.

	Add '+' PEG
	The PEG s-expression syntax now uses '(+ ...)' instead of '(body lit ... +)'.

	Add '*' PEG
	The s-expression representation of PEG grammars now uses a '(* ...)' form
	instead of '(body lit ... *)'.

	Clean Up PEG Codegen
	* module/ice-9/peg/codegen.scm: remove unnecessary literals in
	  peg-sexp-compile.

	Make PEG Files
	* module/ice-9/peg/using-parsers.scm: remove unnecessary dependency
	* module/ice-9/peg.scm: add comment about string-peg dependency
	* module/Makefile.scm: add PEG files to makefile

	Rearrange PEG Modules
	* module/ice-9/peg.scm: move code out of here
	* module/ice-9/peg/match-records.scm: remove this file
	* module/ice-9/peg/using-parsers.scm: make a new module with utilities for
	  using parsers. It contains the code from both peg.scm and match-records.scm
	* module/ice-9/peg/string-peg.scm: update to use new module

	PEG Cache Module
	* module/ice-9/peg/cache.scm: add module to hold cache logic for PEG
	   parsers
	* module/ice-9/peg.scm: move cache logic out of here

	Update String PEGs
	* module/ice-9/peg/string-peg.scm: use new interface for extending PEG
	   syntax
	* module/ice-9/peg.scm: remove peg-extended-compile

	Extensible PEG Syntax
	* module/ice-9/peg/codegen.scm: Make the PEG syntax extensible, and
	    move most of the current code generators to the new interface
	* doc/ref/api-peg.texi: Document PEG extensions in the PEG Internals
	    section of the manual

	Separate PEG Concerns
	* module/ice-9/peg/codegen.scm: peg-sexp-compile no longer knows about
	   string PEGs
	* module/ice-9/peg.scm: add a new function peg-extended-compile that
	   calls peg-sexp-compile or peg-string-compile on its argument as
	   appropriate

	Move define-nonterm
	* module/ice-9/peg/string-peg.scm: remove define-nonterm and make a simpler
	   macro called `define-sexp-parser' to make the PEG grammar
	* module/ice-9/peg.scm: move define-nonterm macro to this file
	* module/ice-9/peg/codegen.scm: move code to wrap a parser result nicely to
	   this file, under name `wrap-parser-for-users'

	Document PEG Internals
	 * doc/ref/api-peg.texi: add a manual section about the PEG internals.

	Remove eval-when
	 * module/ice-9/peg.scm: remove the eval-when statement

	Factor PEG Structure
	 * modules/ice-9/peg.scm: remove the part that defines a match structure
	 * modules/ice-9/peg/match-record.scm: and put it here

	Factor PEG Functions
	 * module/ice-9/peg.scm: take out the functions for simplifying trees
	 * module/ice-9/peg/simplify-tree.scm: and put them here

	Separate PEG Strings
	 * module/ice-9/peg.scm: remove functions dealing with PEGs as strings
	 * module/ice-9/peg/string-peg.scm: and put them here

	Make Macros Hygienic
	 * modules/ice-9/peg.scm: convert the unhygienic macros that generate code
	    for string PEGs to use hygiene.

	Rename in peg.scm
	 * module/ice-9/peg.scm: rename peg-parse-* functions to avoid confusion
	    with what PEGs do.

	Split peg.scm
	 * module/ice-9/peg.scm: move code generators to new module
	 * module/ice-9/peg/codegen.scm: new module for PEG code generators

2013-01-16  Andy Wingo  <wingo@pobox.com>

	reformat and reflow api-peg.texi
	* doc/ref/api-peg.texi: Reformat and reflow.

	peg: remove error-val
	* module/ice-9/peg.scm (error-val): Remove needless definition.

	peg: refactor peg-sexp-compile to operate on syntax directly
	* module/ice-9/peg.scm (cg-generic-ret): Remove unused for-syntax
	  argument.
	  (peg-sexp-compile): Take the pattern as syntax directly, and use
	  syntax-case to destructure it and dispatch to the code generators.
	  (cg-and, cg-and-int, cg-or, cg-or-int): Refactor to operate on syntax
	  instead of on s-expressions.
	  (cg-body): Likewise; though this was a larger refactor.
	  (define-nonterm, peg-match): Adapt to peg-sexp-compile calling
	  convention change.
	  (peg-string-compile): Likewise, and just take the grammar as a syntax
	  object.

	peg: cg-string, cg-peg-any, cg-range: remove needless for-syntax arg
	* module/ice-9/peg.scm (cg-string, cg-peg-any, cg-range): Remove
	  unnecessary for-syntax arg.
	  (peg-sexp-compile): Adapt.

	peg: change some instances of "match" to "pat"
	* module/ice-9/peg.scm (cg-string): Rename "match" to "pat".
	  (peg-sexp-compile, cg-body-test, cg-body, define-nonterm): Likewise.

	remove cggl, cg-generic-lambda
	* module/ice-9/peg.scm (cg-generic-lambda, cggl): Remove these helpers,
	  they are no longer needed.
	  (cg-generic-ret): Remove optimization for particular cg- routines, as
	  it's no longer needed.

	peg: more cggl / cggr excisions
	* module/ice-9/peg.scm (cg-peg-any): Don't use cggr.
	  (cg-range): Don't use cggl or cggr.

	peg: cg-string does not use cggr
	* module/ice-9/peg.scm (cg-string): Don't use cggr.  Interesting to see
	  what it actually generates.

	peg: cg-peg-any does not use cggl
	* module/ice-9/peg.scm (cg-peg-any): Don't use cggl.

	peg: cg-string without cggl
	* module/ice-9/peg.scm (cg-string): Refactor to not use cggl.

	peg: cg-string improvement
	* module/ice-9/peg.scm (cg-string): Use the more efficient string= with
	  range args, rather than string=? and substring.

	peg: helper macro docstrings
	* module/ice-9/peg.scm: Convert the helper macro comments into
	  docstrings.

	peg: module-ref cleanup
	* module/ice-9/peg.scm (cg-generic-ret, cg-and-int, cg-body-test):
	  Remove a few needless @ or @@ forms.

	peg: remove get-code debugging foo
	* module/ice-9/peg.scm (define-nonterm): Don't stash the code in a
	  symbol property.
	  (get-code): Remove.

	peg: more syntax helper cleanup
	* module/ice-9/peg.scm (single-filter, push-not-null!): Use
	  syntax-rules, and move outside the eval-when.

	peg: else for default cond clauses, not #t
	* module/ice-9/peg.scm: Change default cases of `cond' to use `else'
	  instead of #t.

	peg; syntax helper cleanups
	* module/ice-9/peg.scm (until, single?, push!): Move outside the
	  eval-when.  Use syntax-rules, and single? is faster now.

	peg: cleanups
	* module/ice-9/peg.scm (until): Rename from until-works, and be
	  functional (and faster).
	  (peg-match): Adapt.

	peg: define-module cleanup
	* module/ice-9/peg.scm: Fix up define-module block.

2013-01-16  Noah Lavine  <nlavine@haverford.edu>

	peg: let cleanups
	* module/ice-9/peg.scm (cg-string, cg-peg-any, cg-range): Remove some
	  unnecessary lets.

	peg: remove unhygienic safe-bind, safe-bind-f
	* module/ice-9/peg.scm (safe-bind, safe-bind-f): Remove.

	peg: remove unused nonhygienic expander helpers
	* module/ice-9/peg.scm (cggl, cggr): Remove, and rename the cggl-syn and
	  cggr-syn to take their place.

	peg: more helpers returning syntax
	* module/ice-9/peg.scm (cg-body, cg-body-success, cg-body-more)
	  (cg-body-ret): Return syntax instead of s-expressions.

	peg: cg-or, cg-or-int return syntax
	* module/ice-9/peg.scm (cg-or, cg-or-int): Return syntax instead of
	  s-expressions.
	  (peg-sexp-compile): Adapt.

	peg: hygiene in cg-and, cg-and-int
	* module/ice-9/peg.scm (cg-and, cg-and-int): Use cggr-syn instead of
	  cggr, and also return syntax now instead of s-expressions.

	peg: hygiene in cg-range
	* module/ice-9/peg.scm (cg-range): Use cggl-syn and cggr-syn.

	peg: hygiene in cg-peg-any
	* module/ice-9/peg.scm (cg-peg-any): Use cggl-syn and cggr-syn.

	peg: more hygiene in cg-string
	* module/ice-9/peg.scm (cggl-syn, cggr-syn): New functions, equivalent
	  to cggl and cggr except that they operate on syntax instead of
	  s-expressions.
	  (cg-string): Use them here.

	peg: lower datum->syntax in cg-range case
	* module/ice-9/peg.scm (cg-range): Datum->syntax here...
	  (peg-sexp-compile): ...instead of here.

	peg: lower datum->syntax in cg-peg-any case
	* module/ice-9/peg.scm (cg-peg-any): Datum->syntax here...
	  (peg-sexp-compile): ...instead of here.

	peg: lower datum->syntax in cg-string case
	* module/ice-9/peg.scm (cg-string): Return syntax instead of
	  s-expressions.
	  (peg-sexp-compile): No need for datum->string in cg-string case.

	peg: peg-sexp-compile datum->syntax refactor
	* module/ice-9/peg.scm (peg-sexp-compile): Push datum->syntax call
	  through cond expression in peg-sexp-compile. This is a preliminary
	  move so that I can convert the code-generating functions into
	  syntax-generating functions one by one.

	peg: compilers return syntax instead of s-expressions
	* module/ice-9/peg.scm (peg-sexp-compile, peg-string-compile): Return
	  syntax instead of s-expressions.

	peg: beginnings of hygiene
	* module/ice-9/peg.scm: Pass for-syntax argument to all of the
	  code-generating functions.

	peg: more syntax-for-non-cache-case cleanups
	* module/ice-9/peg.scm (syntax-for-non-cache-case): More cleanups.

	peg: clean up syntax-for-non-cache-case
	* module/ice-9/peg.scm (syntax-for-non-cache-case): Cleanups.

	peg: use quasisyntax instead of safe-bind
	* module/ice-9/peg.scm (syntax-for-non-cache-case): Use quasisyntax
	  instead of safe-bind.

	peg: define-nonterm returns syntax instead of s-expression
	* module/ice-9/peg.scm (define-nonterm, syntax-for-non-cache-case):
	  Returns syntax instead of an s-expression.

	peg: split define-nonterm into two functions for better readability.
	* module/ice-9/peg.scm (define-nonterm): Split for readability.

2013-01-16  Andy Wingo  <wingo@pobox.com>

	peg: add copyright header
	* module/ice-9/peg.scm: Add copyright header.

2013-01-16  Andy Wingo  <wingo@pobox.com>

	add PEG parser generator
	* module/ice-9/peg.scm: New file.
	* module/Makefile.am: Add to build.

	* doc/ref/Makefile.am:
	* doc/ref/api-peg.texi:
	* doc/ref/guile.texi: Add documentation for PEG parser.

	* test-suite/Makefile.am:
	* test-suite/tests/peg.bench:
	* test-suite/tests/peg.test: Add tests, and a benchmark.

2013-01-16  Andy Wingo  <wingo@pobox.com>

	an end to the generated-documentation experiment
	* doc/ref/statprof.texi:
	* doc/ref/sxml.texi:
	* doc/ref/texinfo.texi: New files, containing the documentation that was
	  previously generated from source and rendered into
	  standard-library.texi.  The documentation is still horrible, but at
	  least now it is user-editable.

	update make-struct docstring
	* libguile/struct.c (scm_make_struct): Remove reference to deprecated
	  make-vtable-vtable.

2013-01-15  Greg Benison  <gbenison@gmail.com>

	doc/ref/hierarchy.png: conform to hierarchy.txt and manual
	hierarchy.png (and .pdf, .eps) were changed to add one node
	to the graph, getting them in sync with hierarchy.txt
	(and the GOOPS section of the manual).

	Also added hierarchy.dot, a file to generate said figure
	using graphviz.

2013-01-15  Andy Wingo  <wingo@pobox.com>

	fix string->bytevector for utf-8 and non-error conversion strategies
	* module/ice-9/iconv.scm (call-with-encoded-output-string):
	  (string->bytevector, bytevector->string): Only call string->utf8 and
	  utf8->string if the conversion strategy is `error'.

	ASCII is not ISO-8859-1
	* libguile/ports.c (scm_i_set_default_port_encoding): An encoding of
	  ASCII is not the same as ISO-8859-1, because it does not allow
	  characters above 128.  Fix this.

	fix string->bytevector for utf-8 and non-error conversion strategies
	* module/ice-9/iconv.scm (call-with-encoded-output-string):
	  (string->bytevector, bytevector->string): Only call string->utf8 and
	  utf8->string if the conversion strategy is `error'.

	string->utf8 implementation uses scm_from_utf8_stringn
	* libguile/bytevectors.c (UTF_TO_STRING): Use scm_from_utf8_stringn.

	scm_from_stringn and scm_to_stringn encoding args are never NULL
	* libguile/strings.c (scm_from_stringn, scm_to_stringn): Encoding
	  argument cannot be NULL.  Instead check that the encoding was
	  ISO-8859-1.

	Port encodings cannot be NULL
	* libguile/ports.c (scm_c_read_unlocked, scm_ungetc_unlocked):
	* libguile/read.c (scm_read_character):
	* libguile/vports.c (sf_fill_input): Port encodings cannot be NULL any
	  more, now that encodings are canonicalized, so simplify these.

2013-01-15  Andy Wingo  <wingo@pobox.com>

	All r6rs ports are both textual and binary
	* module/rnrs/io/ports.scm (binary-port?): All ports are binary _and_
	  textual.  Bytevectors and strings may be written to or read from
	  either.
	  (port-transcoder): All textual ports (all ports) have transcoders of
	  some sort.

	* test-suite/tests/r6rs-ports.test ("8.2.6  Input and output ports"):
	  Remove test that binary ports don't have transcoders, because binary
	  ports are also textual.

2013-01-15  Andy Wingo  <wingo@pobox.com>

	Port encodings are case-insensitive, but normalized to upper-case.
	* libguile/ports.c (ascii_toupper, encoding_matches)
	  (canonicalize_encoding): New helpers.

	  (scm_c_make_port_with_encoding):
	  (scm_i_set_default_port_encoding):
	  (scm_i_set_port_encoding_x): Use the new helpers to be
	  case-insensitive and also to canonicalize the internal representation
	  to upper-case ASCII names.

	  (scm_i_default_port_encoding): Never return NULL.
	  (scm_port_encoding): The encoding is always a string.

	* libguile/read.c (scm_i_scan_for_encoding): Use a locale-independent
	  check instead of isalnum.  Don't upcase the result: the port code will
	  handle that.

	* test-suite/tests/web-response.test ("example-1"): Adapt test to expect
	  normalized (upper-case) encoding for the response port.

2013-01-15  Andy Wingo  <wingo@pobox.com>

	add scm_from_port_string and friends
	* doc/ref/api-data.texi (Conversion to/from C):
	* libguile/strings.h:
	* libguile/strings.c (scm_from_port_string, scm_from_port_stringn):
	  (scm_to_port_string, scm_to_port_stringn): New functions.

	* guile-readline/readline.c (internal_readline):
	* libguile/strports.c (scm_strport_to_string):
	* libguile/read.c (scm_read_number, scm_read_mixed_case_symbol):
	  (scm_read_number_and_radix, scm_read_character): Use the new
	  functions.

2013-01-15  Andy Wingo  <wingo@pobox.com>

	UTF-8 string ports in ecmascript test
	* test-suite/tests/ecmascript.test (eread, eread/1): Make sure we can
	  render the temporary string ports by specifying UTF-8.

2013-01-15  Andy Wingo  <wingo@pobox.com>

	fix bug where scm_from_utf8_stringn would not detect bad utf-8
	* libguile/strings.c (scm_from_utf8_stringn):
	* libguile/symbols.c (utf8_string_equals_wide_string): The "bad UTF8"
	  return from u8_mbtouc is a 0xfffd character, not a negative byte
	  length.  Fixes a bug in which invalid UTF-8 would not be caught.

	* libguile/bytevectors.c (scm_utf8_to_string): Use scm_from_utf8_stringn
	  directly.  Just a little cleanup.

	* test-suite/tests/iconv.test ("narrow non-ascii string"): Add test for
	  parsing bad utf-8 with substitution.

2013-01-15  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	There is a failing test due to a scm_from_utf8_stringn bug brought out
	by the iconv test that will be fixed in the next commit.

	Conflicts:
		libguile/deprecated.h
		module/ice-9/deprecated.scm

2013-01-14  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct off by one label/note name and add align argument to jit_data
	2013-01-14 Paulo Andrade <pcpa@gnu.org>

		* include/lightning.h, lib/lightning.c: Add an extra align
		argument to the jit_data call (that should be made private),
		so that it should not align strings at 8 bytes.
		  Correct the jit_note call to include the null ending byte
		when adding label/note names to the "jit data section".

2013-01-14  Andy Wingo  <wingo@pobox.com>

	case-lambda* clauses fail to match if too many positionals
	* doc/ref/api-procedures.texi (Case-lambda): Expand case-lambda*
	  documentation.

	* module/ice-9/eval.scm (primitive-eval):
	* libguile/eval.c (prepare_boot_closure_env_for_apply): Dispatch to the
	  next case-lambda clause if there are too many positionals.

	* doc/ref/vm.texi (Function Prologue Instructions):
	* libguile/vm-i-system.c (bind-optionals/shuffle-or-br): New
	  instruction, like bind-optionals/shuffle but can dispatch to the next
	  clause if there are too many positionals.

	* module/language/assembly/disassemble.scm (code-annotation):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/compile-bytecode.scm (compile-bytecode): Add
	  case for bind-optionals/shuffle-or-br.
	* module/language/glil/compile-assembly.scm (glil->assembly): If there
	  is an alternate, use bind-optionals/shuffle-or-br instead of
	  bind-optionals/shuffle.

	* test-suite/tests/optargs.test ("case-lambda*"): Add tests.

2013-01-11  Andy Wingo  <wingo@pobox.com>

	Docstrings in (ice-9 iconv)
	* module/ice-9/iconv.scm: Add docstrings.

2013-01-11  Andy Wingo  <wingo@pobox.com>

	Change iconv procedures to take optional instead of keyword arg
	* module/ice-9/iconv.scm (call-with-encoded-output-string):
	  (string->bytevector, bytevector->string): Take an optional instead of
	  a keyword argument.

	* doc/ref/api-data.texi (Representing Strings as Bytes): Adapt docs to
	  change, and fix a number of errors.  Thanks to Ludovic Courtès for the
	  pointers.

	* test-suite/tests/iconv.test ("wide non-ascii string"): Add a test for
	  the 'substitute path.

2013-01-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add filename and line number annotation abstraction.
		* lib/jit_note.c: New file implementing a simple string+integer
		annotation, that should be used to map filename and line number
		to offsets in the generated jit.

		* include/lightning.h, lib/lightning.c: Update for the new
		note code.
		  Add an extra mandatory argument to init_jit, that is used
		as argument to bfd_openr.
		  Change from generic void* to char* the argument to jit_note
		and add an extra integer argument, to map to filename and
		line number.

		* check/ccall.c, check/lightning.c, include/lightning/jit_private.h,
		lib/jit_arm.c, lib/jit_disasm.c, lib/jit_mips.c, lib/jit_ppc.c,
		lib/jit_print.c, lib/jit_x86.c: lib/Makefile.am: Update for the
		new annotation code.

		* configure.ac, check/Makefile.am: Update to work with latest
		automake.

2013-01-11  Andy Wingo  <wingo@pobox.com>

	Add http-post, http-put, et cetera
	* module/web/client.scm (ensure-uri): New helper.
	  (open-socket-for-uri): Accept a URI as a string or as a URI object.
	  (extend-request, sanitize-request): New helpers, like the
	  corresponding functions in (web server).
	  (decode-response-body): Add a reference to the HTTP/1.1 spec, and
	  use (ice-9 iconv).
	  (request): New helper, factoring all aspects of sending an HTTP
	  request and getting a response.
	  (http-get): Redefine in terms of http-get.  Deprecate the
	  #:extra-headers argument in favor of #:headers.  Allow a body.  Add a
	  #:streaming? argument, subsuming the functionality of http-get*.
	  (http-get*): Deprecate.
	  (http-head, http-post, http-put, http-delete, http-trace)
	  (http-options): Define interfaces for all HTTP verbs.

	* test-suite/tests/web-client.test: Add tests.

	* doc/ref/web.texi: Update documentation.

	Thanks to Gregory Benison for the initial patch.

2013-01-11  Andy Wingo  <wingo@pobox.com>

	read-response-body always returns bytevector or #f
	* module/web/response.scm (read-response-body): Fix to always return
	  either a bytevector or #f.  Previously, reading a 0-length body could
	  return the EOF object.

	remove (web http) TODO list
	* module/web/http.scm: Remove outdated TODO list.

	(web server) uses (ice-9 iconv)
	* module/web/server.scm (sanitize-response): Use the procedures
	  from (ice-9 iconv) to encode the response.

2013-01-11  Andy Wingo  <wingo@pobox.com>

	add bytevector->string and string->bytevector in new (ice-9 iconv) module
	* module/Makefile.am:
	* module/ice-9/iconv.scm: New module implementing procedures to encode
	  and decode representations of strings as bytes.

	* test-suite/Makefile.am:
	* test-suite/tests/iconv.test: Add tests.

	* doc/ref/api-data.texi: Add docs.

2013-01-10  Andy Wingo  <wingo@pobox.com>

	fix ice-9/slib
	* module/ice-9/slib.scm: Change to just load up slib.init directly.  The
	  recently submitted patch to slib-discuss and guile-user should make
	  this work correctly.

2013-01-10  Andy Wingo  <wingo@pobox.com>

	deprecate SCM_CHAR_CODE_LIMIT and char-code-limit
	* libguile/__scm.h:
	* libguile/deprecated.h (SCM_CHAR_CODE_LIMIT): Move declaration here
	  from __scm.h.

	* libguile/feature.c:
	* module/ice-9/deprecated.scm (char-code-limit): Move definition here.

	* test-suite/tests/regexp.test: Update to not use char-code-limit.

2013-01-09  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Rework {get,push}arg{,i,r}_{f,d} to a more descriptive name and usage.

2013-01-08  Andy Wingo  <wingo@pobox.com>

	slight open-pipe* / open-process refactor
	* libguile/posix.c (scm_open_process): Return the ports as values
	  instead of calling out to Scheme again to make-rw-port.  This
	  function is private to (ice-9 popen).

	* module/ice-9/popen.scm (open-pipe*): Adapt to change.

2013-01-07  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		GUILE-VERSION
		libguile/posix.c
		module/ice-9/eval.scm
		test-suite/tests/cse.test

2013-01-07  Andy Wingo  <wingo@pobox.com>

	http-get: don't shutdown write end of socket
	* module/web/http.scm ("Connection"): Write the "close" token in
	  lower-case.

	* module/web/client.scm (http-get): Don't shutdown the writing side of
	  the pipe if we are not doing a keepalive, as this may prevent the
	  request from being sent at all.  Prevented http://friendfeed.com/ from
	  being correctly fetched.

2013-01-07  Andy Wingo  <wingo@pobox.com>

	Fix partial commit of documentation update
	* doc/ref/api-procedures.texi (Compiled Procedures): Fix
	  partially-committed doc update.

2013-01-07  Andy Wingo  <wingo@pobox.com>

	More procedure-arguments-alist documentation and a bugfix
	* doc/ref/api-procedures.texi (Compiled Procedures): Expand
	  program-arguments-alist and program-lambda-list documentation.

	* module/system/vm/program.scm (arity->arguments-alist): Fix the rest
	  arg if there are also keyword args, a bug found while documenting!

	* test-suite/tests/session.test ("procedure-arguments"): Update.

2013-01-07  Cedric Cellier  <cedric.cellier@securactive.net>

	document program-arguments-alist and program-lambda-list

2013-01-07  Andy Wingo  <wingo@pobox.com>

	minor cleanup in values.c
	* libguile/values.c (scm_c_value_ref): Use scm_from_size_t to assimilate
	  a size_t.

2013-01-05  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add the new ccall test case to test interleaved C and jit function calls
		* check/cccall.c, check/ccall.ok: New test case to validate
		interleaved calls from/to C code and jit.

		* check/Makefile.am: Update for the new ccall test case.

		* include/lightning.h, lib/lightning.c: Add the new jit_address
		call that returns the real/final address of a "note" in the
		generated jit. It requires a jit_node_t as returned by the
		jit_note call, and is only valid after calling jit_emit.
		  Add an intermediate solution to properly handle arm
		soft and softfp modes that move a double to an integer register
		pair. Currently it just adds extra tests for the condition,
		but the proper solution should be to have extra lightning
		codes for these conditions, codes which should be only used
		by the backends that need it, and merged with the existing
		jit_pusharg*_{f,d}.

		* include/lightning/jit_private.h: Add new jit_state_t flag
		to know it finished jit_emit, so that calls to jit_address
		are valid.

		* lib/jit_mips.c: Correct abi implementation so that the
		new ccall test case pass. Major problem was using
		_jit->function.self.arg{i,f} as boolean values, but that
		would cause lightning.c:patch_registers() to incorrectly
		assume only one register was used as argument when calling
		jit_regarg_p(); _jit->function.self.arg{i,f} must be the
		number of registers used as arguments (in all backends).

		* lib/jit_x86.c: Add workaround, by marking %rax as used,
		to a special condition, when running out of registers and the
		allocator trying to spill and reload %rax, but %rax was used
		as a pointer to a function, what would cause the reload to
		destroy the return value. This condition can be better
		generalized, but the current solution is good enough.

		* include/lightning/jit_ppc.h, lib/jit_ppc-cpu.c, lib/jit_ppc.c:
		Rewrite logic to handle arguments, as the original code was
		written based on a SysV pdf about the generic powerpc ABI,
		what did "invent" a new abi for the previous test cases, but
		failed in the new ccall test in Darwin PPC. Now it properly
		handles 13 float registers for arguments, as well as proper
		computation of stack offsets when running out of registers
		for arguments.

2013-01-02  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Test and correct test cases in all current backends.

2012-12-29  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct wrong and confusing reverse float comparison logic
		* lib/lightning.c: Correct both, wrong and confusing logic
		to compute the reverse of a jump. Now it properly matches
		C semantics for "eq" (==) and "ne" (!=) and correct computation
		of reverse of "uneq" as "gt".

		* check/branch.tst: Update "ne" float branch check that
		previously happened to be wrongly tested with a NaN argument.

2012-12-29  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add new extensive float comparison and conversion test case
		* check/float.ok, check/float.tst: New test cases implementing
		extensive validation of float comparison and branch code
		generation as well as integer conversion, involving NaN and
		[+-]Inf.

		* lib/jit_arm-swf.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
		Correct bugs found by new float test case.

		* lib/jit_x86.c: Correct cut&paste error added in commit to
		convert jit_arg* return value to a jit_node_t*,	that would
		cause it to not properly handle double arguments in ix86.

		* check/Makefile.am: Update for the new test case.

2012-12-28  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Change type of return of jit_arg* and argument to jit_getarg*
		* check/lightning.c, include/lightning.h, lib/jit_arm.c,
		lib/jit_mips.c, lib/jit_ppc.c, lib/jit_print.c,	lib/jit_x86.c,
		lib/lightning.c: Change return value of jit_arg{,_f,_d} to
		a jit_node_t* object, that should be used as argument to
		jit_getarg_{c,uc,s,us,i,ui,l,f,d}. This just requires changing
		from jit_int32_t to jit_pointer_t (or jit_node_t*) the "handle"
		for the getarg calls, with the benefit that it makes it easy
		to implement patching of the stack address of non register
		arguments, this way allowing to implement variable size stack
		frames if applicable; useful if there are too many registers and
		jit functions uses only a few callee save registers.

2012-12-28  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct extra regressions found by the call.tst test case.
		* lib/jit_arm.c, lib/jit_mips-cpu.c, lib/jit_mips.c: Correct
		regressions when patching jit_calli for a forward function.

		* lib/jit_ppc-cpu.c: Correct wrong arguments to ANDI opcode
		in jit_getarg_u{c,s} implementation.

2012-12-23  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add simple test case to test argument and return values.
		* check/call.ok, check/call.tst: New test cases to validate
		simple typed argument and return values in function calls.

		* check/lightning.c: Properly handle jit_movi of labels for
		backward and forward code labels.

		* check/Makefile.am: Update for new test case.

2012-12-23  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add new carry test case.
		* check/carry.ok, check/carry.tst: New test case to validate
		carry condition handling.

		* check/Makefile.am: Update for new test case.

2012-12-22  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add missing jit_htonr to ppc backend.
		* lib/jit_ppc-cpu.c, lib/jit_ppc.c: Implement logic for
		jit_htonr for big endian, so that ppc (big endian) pass the
		new clobber.tst test case.

	Correct regressions with --with-float={soft,softfp} in the arm backend
		* lib/jit_arm.c: Correct use of wrong argument offset
		variable in armv7l or float/double argument for varargs
		function in armv7hl.
		  Correct jit_getarg* logic in software float mode to
		match expected behavior in other backends, that is, if
		a function is not called, it is safe to use a few lightning
		calls before a next jit_getarg* call, as done in the test
		case check/stack.tst. The proper solution should be to
		extend the parser in lib/lightning.c to check if there is
		some float operation that will call some (libgcc?) function,
		but software float arm should be a very uncommon backend for
		lightning, so, just load the already in place arguments
		saved to stack, assuming the register argument was clobbered
		(what should not be the case most times...).

2012-12-22  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add new register clobber detection test case.
		* check/clobber.ok, check/clobber.tst: New test case doing
		extensive validation tests to ensure registers not used in
		a operation are not clobbered.

		* check/Makefile.am: Update for new test case.

2012-12-22  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct bogus logic caused by wrong optimizations.
		* lib/lightning.c: Partially rewrite/revert code to compute
		initial	register live state at the start of a basic block.
		The original logic was corrupted when adding optimizations
		to do as few computations as possible in jit_update. The
		reglive field must be always a known set of live registers
		at the start of a basic block. The value that was incorrect
		was the regmask field, that must be the set of registers
		that are in unknown state, because they are not known live,
		neither set (or possibly not set) in the basic block, and
		*must* store the state at the start of the basic block.

2012-12-20  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct stack.tst test case on ppc. Now all tests pass in all backends.
		* include/lightning/jit_ppc.h: Correct mismatch of JIT_F{1,5}
		with enum codes, that were correct, and returned by jit_f().

		* lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: Properly
		implement and better describe values when generating stack
		frames.

2012-12-19  Ludovic Courtès  <ludo@gnu.org>

	tests: Remove leftover `pk'.
	* test-suite/tests/posix.test ("system*"): Remove `pk'.

2012-12-19  Ludovic Courtès  <ludo@gnu.org>

	Change `system*' to not leave dangling processes behind.
	Fixes <http://bugs.gnu.org/13166>.

	* libguile/simpos.c (scm_system_star): In the child, call `_exit'
	  instead of `SCM_SYSERROR' when `execvp' fails.
	* test-suite/tests/posix.test ("system*"): New test prefix.

2012-12-19  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add new test case to check stack integrity on complex stack frames.
		* check/stack.ok, check/stack.tst: New files to test data
		integrity on a deep chain of stack frames.

		* lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c,
		lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c,
		lib/jit_x86.c, lib/jit_x86-cpu.c: Calculate _jit->function->stack
		in the emit stage, otherwise it will calculate it wrong if
		need to jit_allocai space to spill registers.

		* lib/lightning.c: Correct wrong offset when updating the
		"current" jit function pointer in the code that may need to
		allocate stack space to spill registers.

		* check/lightning.c: Correct off by one data space check.

		* check/Makefile.am: Update for new test case.

2012-12-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add two extra test cases for float operations.
		* check/fop_abs.ok, check/fop_abs.tst, check/fop_sqrt.ok,
		check/fop_sqrt.tst: New files implementing simple test cases
		for the extra float operations.

		* check/Makefile.am: Update for new test cases.

		* check/alu.inc: Add an extra macro to check for unordered
		equality on tests where it is expected to use NaN as an
		argument.

		* check/lightning.c: Minor change for proper/common argument
		syntax handling ommiting arguments to options.

2012-12-17  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Simplify listing of test cases with alternate jit generation options
		* check/Makefile.am: Automatically generate pattern list
		of tests with alternate jit generation options. This should
		prevent typos and needing to change multiple places after
		a change.

2012-12-17  Ludovic Courtès  <ludo@gnu.org>

	web: Correctly detect "No route to host" conditions.
	* module/web/client.scm (open-socket-for-uri): Delete addrinfos
	  with the same address.  Always open SOCK_STREAM/IPPROTO_IP sockets.
	  Fix the error handler's condition to determine what to do.
	  Reported by Nikita Karetnikov <nikita.karetnikov@gmail.com> at
	  <http://lists.gnu.org/archive/html/bug-guix/2012-12/msg00150.html>.

2012-12-15  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add support to test different/alternate code generation setups.
		* check/lightning.c: Remove the ".cpu name value" syntax,
		as it was not able to do proper changes before the jit
		internal data structure was initialized. Now it supports
		several getopt options to force using different jit
		generation options, effectively replacing the previous
		syntax.

		* check/run-test: Add simple extra logic to handle differently
		named test scripts, used to test things like x87 coprocessor
		in ix86, and arm instruction set or software float in armv7l.

		* configure.ac: Add some AC_RUN_IFELSE calls to figure at
		compile time if can test different code generation options,
		and update Makefile generation accordingly.

		* check/Makefile.am, lib/jit_arm.c, lib/jit_x86.c: Update to
		properly work with the test tool updating the jit_cpu global
		information.

		* check/check.arm.sh, check/check.swf.sh, check/check.x87.sh:
		New wrapper files passing -mthumb=0, mvfp=0 and -mx87=1 to
		the test tool, if applicable, so that it can validate alternate
		code generation options on test hosts that support them.

2012-12-14  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct test cases to work with x87 in ix86.
		* lib/jit_x86-x87.c, lib/jit_x86.c: Correct test cases in ix86
		when using the x87 coprocessor instead of sse2+.

	Make it clear stdarg like abstraction is not supported.
		* include/lightning.h, include/lightning/jit_private.h,
		lib/jit_arm.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_x86.c,
		lib/lightning.c: Make jit_ellipsis implementation not
		backend specific. It is not intended to handle va_list
		like objects at runtime, as jit_arg* and jit_getarg*
		return constant values resolved at parse time, so, effectively
		it is not possible to create printf like jit functions, as
		there is no va_start, va_arg, va_end, etc, abstraction. This
		limitation should be kept for the sake of making new ports
		easier.

	Remove most type casts and compile test tool silently with -Wall

2012-12-13  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add new varargs test and correct related test case failures in all ports.

2012-12-13  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add jit_ellipis and remove jit_prepare argument.
		* include/lightning.h, lib/jit_arm.c, lib/jit_mips.c,
		lib/jit_ppc.c, lib/jit_x86.c, lib/lightning.c: Change jit_prepare
		to no longer receive an argument. If receiving an argument, it
		should be an ABI specifier, not a boolean if varargs or not,
		and add the new jit_ellipsis call, to specify where the
		ellipsis is in the C prototype of the function being called.
		Note that currently it is not supported to define varargs
		functions and it will be ignored if calling jit_ellipsis not
		in a prepare/finish* block, but this should be addressed.

		* check/allocai.tst, check/alu_add.tst, check/alu_and.tst,
		check/alu_com.tst, check/alu_div.tst, check/alu_lsh.tst,
		check/alu_mul.tst, check/alu_neg.tst, check/alu_or.tst,
		check/alu_rem.tst, check/alu_rsh.tst, check/alu_sub.tst,
		check/alu_xor.tst, check/alux_add.tst, check/alux_sub.tst,
		check/bp.tst, check/branch.tst, check/cvt.tst, check/divi.tst,
		check/fib.tst, check/ldsti.tst, check/ldstr-c.tst,
		check/ldstr.tst, check/ldstxi-c.tst, check/ldstxi.tst,
		check/ldstxr-c.tst, check/ldstxr.tst, check/rpn.tst,
		check/lightning.c: Update for the change to jit_prepare and
		addition of jit_ellipsis.

2012-12-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Make all current test cases pass in Darwin PowerPC.
		* lib/jit_ppc-cpu.c: Make movr a function that checks arguments
		so that other code can safely assume it is a noop if src and dst
		are the same register.
		  Implement rem{r,i}{,_u} as a div{,u}/mul/sub.
		  Correct ANDIS, ORIS and XORIS calls to cast the argument to
		unsigned before the shift to avoid an assertion if the argument
		had the topmost bit set.
		  Implement lshi, rshi and rshi_u as functions to test for a
		zero argument, that would otherwise trigger an assertion when
		computing the shift value.
		  Do a simple implementation of bm{s,c}{r,i} with a temporary,
		"andr" of arguments and jump based on comparison with zero.
		  Correct typo in ldxi_c.

		* lib/jit_ppc-fpu.c: Correct wrong arguments to FDIV* and STF*.

		* lib/jit_ppc.c: Correct wrong check for 6 instead of 8 integer
		arguments in registers. If calling a varargs function and
		passing a float or double argument, also either store the
		value in the stack or in integer registers, as varargs functions
		do not fetch it from float registers.
		  Add "case" for new functions and incorrectly missing ones.
		  Call libgcc's __clear_cache, that should know what to do
		if the hardware needs flushing cache before execution.

		* lib/lightning.c: Do a simple/trivial logic in jit_regset_scan1,
		that should make it easier for the compiler to optimize it, and
		that also corrects the previously wrong code for big endian, and
		that was causing problems in ppc due to not saving all callee save
		registers as it was not "finding" them in the regset due to the
		little endian assumption bug.

2012-12-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add better ppc support code, but still not functional.
		* configure.ac: Only default to using the builtin disassembler
		if on GNU/Linux. This should be temporary, due to requiring
		/proc/self/exe.
		  Correctly check $target_cpu for powerpc.

		* include/lightning/jit_ppc.h: Correctly implement jit_v_num.

		* include/lightning/jit_private.h: Declare proper prototype
		for jit_init_debug and jit_finish_debug.

		* lib/jit_ppc-cpu.c: Remove code to save/restore callee save
		float registers, as it is not required since those float
		registers are not usable currently.
		  Change prolog and epilog generation to, at least comparing
		code, match what gcc generates in "gcc -O0", but it is still
		failing in Darwin PPC, apparently due to the __clear_cache
		call not being enough, as frequently it will also fail to
		execute, and the code buffer is all zeroes.

		* lib/lightning.c: Do not fail in jit_regset_scan1 calls due
		to passing 64 as argument on computers with 64 registers.

2012-12-11  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct test cases in the mips backend.
		* lib/jit_mips-cpu.c: Correct all current test cases.
		  Call the "xori" not the "XORI" macro for jit_xori implementation,
		as the XORI macro handles only 16 bit unsigned values.
		  Call the "movr" macro, not the "movi" macro in the special
		case of adding or subtracting zero.
		  Use the proper temporary register in the jit_andr implementation.

2012-12-10  Ludovic Courtès  <ludo@gnu.org>

	build: Require Automake 1.11.2 or later.
	* configure.ac: Require Automake 1.11.2 or later.
	  Reported by Sjoerd van Leent Privé <svanleent@gmail.com>
	  in <http://bugs.gnu.org/13117>.

2012-12-10  Daniel Hartwig  <mandyke@gmail.com>

	repl: add repl-option for customized print
	Closes <http://bugs.gnu.org/13077>.

	* module/system/repl/common.scm (repl-default-options)
	  (repl-print): Add option to use customized print procedure.
	* doc/ref/scheme-using.texi (REPL Commands): Update.

2012-12-10  Ludovic Courtès  <ludo@gnu.org>

	test-suite: Skip `EACCES' test of `file-system-fold' when run as root.
	* test-suite/tests/ftw.test ("file-system-fold")["EACCES"]: Use
	  `pass-if-equal'.  Throw `unresolved' when run as root.
	  Reported by Andreas Enge <andreas@enge.fr> at
	  <http://lists.gnu.org/archive/html/bug-guix/2012-12/msg00073.html>.

	Verify the value of `SHUT_RD' and related constants.
	* libguile/socket.c: Add `verify' clauses for the values of `SHUT_RD',
	  `SHUT_WR', and `SHUT_RDWR'.

	doc: Update `release.org'.
	* doc/release.org (Use porter boxes): Mention Snakebite.

2012-12-09  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add several arithmetic and branch tests cases.
		* check/alu.inc, check/alu_add.ok, check/alu_add.tst,
		check/alu_and.ok, check/alu_and.tst, check/alu_com.ok,
		check/alu_com.tst, check/alu_div.ok, check/alu_div.tst,
		check/alu_lsh.ok, check/alu_lsh.tst, check/alu_mul.ok,
		check/alu_mul.tst, check/alu_neg.ok, check/alu_neg.tst,
		check/alu_or.ok, check/alu_or.tst, check/alu_rem.ok,
		check/alu_rem.tst, check/alu_rsh.ok, check/alu_rsh.tst,
		check/alu_sub.ok, check/alu_sub.tst, check/alu_xor.ok,
		check/alu_xor.tst, check/alux_add.ok, check/alux_add.tst,
		check/alux_sub.ok, check/alux_sub.tst, check/branch.ok,
		check/branch.tst: New test cases for arithmetic and branch
		tests.

		* check/Makefile.am: Update for new test cases.

		* include/lightning/jit_private.h: Make the jit_reg_free_p
		macro shared by all backends. Previously was added for the
		arm backend, but is useful in the x86_64 backend when checking
		state of "special purpose register".
		Also add the new jit_class_named register class, that must be
		or'ed with the register value if calling jit_get_reg expecting
		an specific value, because the specific register value may be
		zero, that previously was treated as no register requested.

		* lib/jit_arm-cpu.c: Correct argument order for T2_MVN.

		* lib/jit_arm-swf.c: Call the proper function for double
		divide. The "software float" implementation just calls
		libgcc functions.

		* lib/jit_arm.c: Return float/double values in the float
		register if using the hard float ABI.

		* lib/jit_x86-cpu.c: Change the can_sign_extend_int_p macro
		to not include -0x80000000L, because there is code that
		"abuses" it and thinks it can negate the immediate value
		after calling that macro.
		  Correct implementation of jit_subi that had a wrong code
		patch logic doing subtraction with reversed arguments.
		  Correct REX prefix calculation in the jit_muli implementation.
		  Correct logic to get/unget %*ax and %*dx registers in divremr
		and divremi.
		  Correct divremi that was using the symbolic, unique %*ax
		value in on place (not using the _REGNO name suffix).
		  Correct cut&paste error causing it to use "xor" instead of
		"or" in one code path of the jit_ori implementation.
		  Correct several flaws when clobbering registers and/or when
		one of the arguments was %*cx in the rotshr wrapper function
		implementing most shift operations.

		* lib/lightning.c: No longer expect that the backend be smart
		enough to know what to do when asking for a named register
		if that register is already an argument or is live. It fails
		if it is an argument, or if register is live, fails if cannot
		spill.
		  No longer incorrectly assume that eqr_{f,d} and ltgr_{f,d} are
		safe to inverse value tests in jump thread optimization.

2012-12-07  Mark H Weaver  <mhw@netris.org>

	Thanks Jozef Chraplewski.
	* THANKS: Jozef Chraplewski.

2012-12-07  Mark H Weaver  <mhw@netris.org>

	Avoid signed integer overflow in scm_product
	* libguile/numbers.c (scm_product): Avoid signed integer overflow, which
	  modern C compilers are allowed to assume will never happen, thus
	  allowing them to optimize out our overflow checks.

	* test-suite/tests/numbers.test (*): Add tests.

2012-12-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add new test case for int/float to/from conversion.
		* check/Makefile.am, check/cvt.ok, check/cvt.tst: Add new
		"cvt" test case to test conversion from/to int/float types.

		* check/lightning.c: Only define truncr_{f,d}_l in 64 bit mode.

		* include/lightning.h: Correct typo that caused it to define
		jit_truncr_{f,d}_l in 32 bit mode.

		* lib/jit_arm-cpu.c: Avoid assertion failure in the signed/unsigned
		extend opcodes generation as it shares an interface for 3 argument
		opcode generation.

		* lib/jit_x86-cpu.c: Correct wrong argument passed to
		jit_unget_reg in the andi implementation and wrong byte
		unsigned extend code generation.

		* lib/jit_x86-sse.c: Correct conversion from "word" to float or
		double as is dependent on wordsize.

2012-12-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add new ldst variant test cases to check base/index register clobber.
		* check/ldstr-c.ok, check/ldstr-c.tst, check/ldstxi-c.ok,
		check/ldstxi-c.tst, check/ldstxr-c.ok, check/ldstxr-c.tst:
		New test case files testing load clobbering the base and/or
		index register;

		* check/ldst.inc: New file with common definition for all the
		ldst* test cases.

		check/Makefile.am, check/ldsti.tst, check/ldstr.tst,
		check/ldstxi.tst, check/ldstxr.tst: Update for new common
		definitions file and new register clobber ldst tests.

2012-12-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct testcases in the mips backend.
		* lib/jit_mips-fpu.c: Correct wrong register order in stxr_{f,d}
		in the mips backend.

	Make current test cases pass in armv7l.
		* lib/jit_arm-vfp.c: Correct regression found in armv7l with
		latest test cases.

2012-12-06  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct test cases in i586 build.
		* check/ldstxi.tst, check/ldstxr.tst: Correct wrong argument
		order for 32 bit mode tests.

		* configure.ac: Correct check for ix86 target_cpu.

2012-12-05  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add new test cases to exercise memory load/store.
		* check/ldstr.ok, check/ldstr.tst, check/ldsti.ok,
		check/ldsti.tst, check/ldstxr.ok, check/ldstxr.tst,
		check/ldstxi.ok, check/ldstxi.tst:
		New test case files exercising a very large amount of
		register combinations to verify load/store implementation.

		* check/Makefile.am: Update for new test cases.

		* lib/jit_x86-cpu.c: Correct wrong argument order when
		computing REX prefix for {ld,st}r_T codes;

2012-12-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement sqrt codes in mips.
		* lib/jit_mips-fpu.c, lib/jit_mips.c: Implement missing mips
		jit_sqrtr_{f,d} codes.

		* check/all.tst, include/lightning.h, lib/jit_print.c: Change
		declaration order and call order in all.tst of {add,sub}c and
		{add,sub}x. *c must be called before to set the carry and *x
		second to use the carry and keep it set. The wrong call order
		was causing all.tst to fail in mips, where a register is
		allocated to keep a global carry state.

2012-12-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct mips backend implementation to pass initial tests.
		* include/lightning/jit_mips.h, lib/jit_mips-cpu.c,
		lib/jit_mips-fpu.c, lib/jit_mips.c: Correct float/double
		argument handling and make the mips backend pass the initial
		test cases.

		* include/lightning.h, ib/jit_print.c, lib/lightning.c:
		Add extra enum values for argument handling functions that
		could not be abstracted to the current codes, that is, when
		float values need to move from/to gpr from/to fpr. It would
		be more tempting to add such primitives, but they would have
		wordsize limitations, and it is not expected to add codes
		with one gpr argument for 64 bit and two for 32 bit.

		* lib/jit_ppc.c: Check _jit->function before calling jit_epilog()
		to avoid a runtime exception.

2012-12-04  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Make mips backend compile on a qemu image.
		* include/lightning/jit_mips.h, lib/jit_mips.c: Update to
		make the mips backend compile in a qemu image.

		* lib/jit_ppc.c: Minor adaptations to help in having the
		ppc backend compilable.

2012-12-03  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Update code to build and pass test cases in the arm port.
		* configure.ac, include/lightning/jit_private.h, lib/jit_arm-cpu.c,
		lib/jit_arm-swf.c, lib/jit_arm.c, check/Makefile.am: Correct
		implementation of the arm backend port to build and pass the
		current test cases. Tested on armv7 with softfp abi.

		* lib/jit_disasm.c: Rename and change prototype of static
		disassemble function as in the arm backend it is required
		to access state information stored in the jit_state_t object.

		* check/3to2.tst, check/add.tst: Correct test case code assuming
		JIT_RO and JIT_RET are the same, and even if they are the same,
		the logic was incorrect because it must always call jit_retval*
		to fetch a function call return before any other instruction.
		The arm backend hash a special condition if jit_retval is not
		called, because "r0" is not JIT_R0, but is JIT_RET and *also*
		the first argument for a called function, so JIT_RET must be
		only used as an argument to jit_retval.

		* TODO: New file listing important tasks to be resolved.

2012-12-03  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct implementation problems on ix86.
		* check/all.tst, check/lightning.c: Only declare or use 64 bit
		interfaces on 64 bit builds.

		* check/fib.tst: Use simpler logic to not need preprocessor
		conditionals for 32 or 64 bit.

		* include/lightning.h: Only declare 64 bit macros on a 64 bit
		build. Code using lightning must know about wordsize and the
		jit generation limitations, also, this way it generates a
		compile time failure, not a runtime assertion.

		* include/lightning/jit_x86.h: Correct typo in macro name.

		* lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c,
		lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c,
		lib/jit_x86.c, lib/jit_x86-cpu.c: Correct wrong code to get
		current jit function pointer.

		* lib/lightning.c: Move call to the simplify() optimization
		to after register liveness is known. Previous code did work
		by accident but now with proper test cases the problem was
		noticed.

		* lib/jit_disasm.c: Always cast bfd_vma to long long when
		passing it as printf argument.

2012-12-03  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct make distcheck.
	2012-12-03 Paulo Andrade <pcpa@gnu.org>

		* configure.ac, check/Makefile.am, check/check.sh,
		doc/Makefile.am, include/lightning/Makefile.am,
		lib/Makefile.am: Correct make distcheck.

2012-12-03  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Correct integer multiplication and add extra test case.
		* lib/jit_ppc.c: Assign copyright ownership to FSF.

		* lib/jit_x86-cpu.c: Correct integer multiplication that was
		generating code with reversed register arguments.

		* check/rpn.ok, check/rpn.tst: New test case file.

2012-12-03  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add extra files implementing different jit backends.
	2012-12-02 Paulo Andrade <pcpa@gnu.org>

		* lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c:
		Actually change copyright owner to FSF as avertised.

		*  lib/jit_arm-cpu.c,  lib/jit_arm-swf.c,
		lib/jit_arm-vfp.c, lib/jit_arm.c,
		lib/jit_mips-cpu.c, lib/jit_mips-fpu.c, lib/jit_mips.c,
		lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: New
		files implementing initial code different jit backends.

		* include/lightning/jit_private.h: Add extra field to the
		private jit_patch_t type, required by the arm port.

		* lib/Makefile.am: Update for the new backend implementation
		files.

2012-12-02  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add proper make clean rule to the check subdir.
	2012-12-02 Paulo Andrade <pcpa@gnu.org>

	        * check/Makefile.am: Add proper "make clean" rule and missing
	        check.sh to EXTRA_DIST.

2012-12-02  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Add make rule to build test case dependencies.
		* .gitignore: Update pattern of ignored files.

		* check/Makefile.am: Add rule to build liblightning.la dependency
		in case of running "make check" before building the library.

2012-12-02  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Remove previous macro files as they are no longer used.
		* lightning/Makefile.am, lightning/asm-common.h,
		lightning/core-common.h, lightning/fp-common.h,
		lightning/funcs-common.h, lightning/i386/Makefile.frag,
		lightning/i386/asm-32.h, lightning/i386/asm-64.h,
		lightning/i386/asm.h, lightning/i386/core-32.h,
		lightning/i386/core-64.h, lightning/i386/core.h,
		lightning/i386/fp-32.h, lightning/i386/fp-64.h,
		lightning/i386/fp.h, lightning/i386/funcs.h,
		lightning/ppc/asm.h, lightning/ppc/core.h,
		lightning/ppc/fp.h, lightning/ppc/funcs.h,
		lightning/sparc/asm.h, lightning/sparc/core.h,
		lightning/sparc/fp.h, lightning/sparc/funcs.h:
		Removed. The core logic is used in the new code, and new mips
		and arm ports will be added. At first, sparc will not be
		supported as it has not yet been ported to the new engine.

2012-12-02  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Big merge with new lightning semantics aiming for lightning 2.0.
	2012-12-02 Paulo Andrade <pcpa@gnu.org>

		* tests/Makefile.am, tests/3to2.c, tests/3to2.ok, tests/add.c,
		tests/add.ok, tests/allocai.c, tests/allocai.ok, tests/bp.c,
		tests/bp.ok, tests/divi.c, tests/divi.ok, tests/fib.c, tests/fib.ok,
		tests/fibdelay.c, tests/fibdelay.ok, tests/fibit.c, tests/fibit.ok,
		tests/funcfp.c, tests/funcfp.ok, tests/incr.c, tests/incr.ok,
		tests/ldst.c, tests/ldst.ok, tests/ldxi.c, tests/ldxi.ok,
		tests/modi.c, tests/modi.ok, tests/movi.c, tests/movi.ok,
		tests/printf.c, tests/printf.ok, tests/printf2.c, tests/printf2.ok,
		tests/ret.c, tests/ret.ok, tests/rpn.c, tests/rpn.ok, tests/rpnfp.c,
		tests/rpnfp.ok, tests/sete.c, tests/sete.ok, tests/testfp.c,
		tests/testfp.ok, tests-run-test: Removed previous test suite, in
		favor of a newer one in the check subdirectory.

		* check/3to2.ok, check/3to2.tst, check/add.ok, check/add.tst,
		check/allocai.ok, check/allocai.tst, check/bp.ok, check/bp.tst,
		check/divi.ok, check/divi.tst, check/fib.ok, check/fib.tst:
		New sample input for the new test program, loosely matching
		several of the previous test cases.

		* check/Makefile.am: New test suite makefile.

		* check/check.sh, check/run-test: New wrapper files for the
		new test suite.

		* check/lightning.c: New file. The main driver of the new test
		suite, that compiles to a parser of a very simple assembly like
		language, generates jit and executes it.

		* check/all.tst: New file. A generic debug and sample test file
		with a directive to prevent it from being executed, and useful to
		read disassembly of all possible instructions, using a fixed set
		of registers.

		* include/Makefile.am, include/lightning.h,
		include/lightning/Makefile.am, include/lightning/jit_arm.h,
		include/lightning/jit_mips.h, include/lightning/jit_ppc.h,
		include/lightning/jit_private.h, include/lightning/jit_x86.h,
		lib/Makefile.am, lib/jit_disasm.c, lib/jit_print.c,
		lib/jit_x86-cpu.c, lib/jit_x86-sse.c, lib/jit_x86-x87.c,
		lib/jit_x86.c, lib/lightning.c: New files. These files are
		written from scratch, only by <pcpa@gnu.org>, and have now
		copyright assignment to the FSF. This is the core of the new
		lightning rework. Previously it was integrated in code with
		a garbage collector and several custom types like vectors and
		hash tables, so this first code merge with lightning converts
		that code into a library extracting only the jit bits, and at
		first only for x86_64 GNU/Linux.

		* lightning.h, m4/lightning.m4: Removed. These are no longer
		required in the new lightning code.

		.gitignore, Makefile.am, configure.ac: Update for the new
		lightning code.

2012-12-02  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Extra cleanup before update to new codebase.
	2012-12-02 Paulo Andrade <pcpa@gnu.org>
		* .cvsignore: Removed for extra cleanup.

		* build-aux: Rename directory to m4.

		* m4: Renamed to "default" name and for consistency with merge
		with code rework to be imported in lightning.

		* .gitignore, configure.ac, Makefile.am, doc/Makefile.am:
		Update for build-aux to m4 rename.

2012-12-01  pcpa  <paulo.cesar.pereira.de.andrade@gmail.com>

	Cleanup on preparation for lightning rework.
	2012-12-01 Paulo Andrade <pcpa@gnu.org>

		* opcode/Makefile.am, opcode/Makefile.in, opcode/ansidecl.h,
		opcode/bfd.h, opcode/dis-asm.h, opcode/dis-buf.c, opcode/disass.c,
		opcode/i386-dis.c, opcode/i386.h, opcode/ppc-dis.c, opcode/ppc-opc.c,
		opcode/ppc.h, opcode/sparc-dis.c, opcode/sparc-opc.c, opcode/sparc.h,
		opcode/sysdep.h: Removed. Do not bundle GNU binutils files.

		* aclocal.m4, configure, Makefile.in, config.h.in, doc/Makefile.in,
		lightning/Makefile.in, tests/Makefile.in: Removed. Do not maintain
		autogenerated files that also generate too much diff noise when
		regenerated in git.

		* build-aux/help2man, build-aux/texinfo.tex, build-aux/texi2dvi:
		Removed. Buildenvironment must have an up to date version from
		upstream installed.

		* build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
		build-aux/install-sh build-aux/mdate-sh build-aux/missing: Removed.
		Do not maintain a copy of automake files in git. Release tarballs
		must use an up to date version.

		* lightningize.in, doc/lightningize.1: Removed. Do not encourage
		bundling lightning in other packages. It should use a system package
		or a proper thirdy part subdirectory.

		* INSTALL: Removed. Autoreconf removes it and creates a symlink
		when regenerating files, so, avoid conflicts in git and let
		automake create the symlink.

		* .gitignore: Add INSTALL and autogenerated files.

		* configure.ac, Makefile.am: Update for removal of opcode subdir,
		auto generated files and lightningize.

		* tests/Makefile.am, tests/3to2.c, tests/add.c, tests/bp.c,
		tests/fib.c, tests/fibdelay.c, tests/fibit.c, tests/funcfp.c,
		tests/incr.c, tests/printf.c, tests/rpn.c, tests/rpnfp.c,
		tests/sete.c, tests/testfp.c: Update for removal of opcode subdir.

		* doc/Makefile.am: Update for removal of lightningize.

		* configure.ac, lightning/ppc/funcs.h, lightning/sparc/funcs.h,
		lightning/i386/fp.h, lightning/i386/core.h, lightning/i386/asm.h,
		tests/3to2.c, tests/add.c, tests/bp.c, tests/fib.c, tests/fibdelay.c,
		tests/fibit.c, tests/funcfp.c, tests/incr.c, tests/printf.c,
		tests/rpn.c, tests/rpnfp.c, tests/sete.c, tests/testfp.c:
		Remove LIGHTNING_CROSS, it is half supported and incomplete.

		* tests/3to2.c, tests/funcfp.c, tests/rpnfp.c: Remove preprocessor
		check on JIT_FPR. If no hardware registers are available, the backend
		must provide an alternative for software float.

		* lightning/ppc/core.h, lightning/sparc/core.h, tests/Makefile.am:
		Remove JIT_NEED_PUSH_POP. It is absolutely not trivial to implement
		properly on some backends due to stack alignment constraints, and
		whenever it is required, using jit_allocai and using a properly
		aligned stack vector, or a heap buffer, is better.

		* tests/push-pop.c, tests/push-pop.ok: Removed due to
		JIT_NEED_PUSH_POP no longer available.

2012-11-30  Daniel Hartwig  <mandyke@gmail.com>

	doc: remove more references to hash-tables-as-vectors
	* doc/ref/api-compound.texi (Hash Tables): Update.

2012-11-30  Ludovic Courtès  <ludo@gnu.org>

	doc: Update `release.org'.
	* doc/release.org: Fix typos, and update.

	NEWS: Add "R6RS SRFI support" text.
	* NEWS: Add proper text for "R6RS SRFI support", by Ian Price and
	  Mark Weaver.

	Bump version number for 2.0.7.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	  (LIBGUILE_INTERFACE_CURRENT): Increment, to account for new C
	  function `scm_make_vtable_vtable'.
	  (LIBGUILE_INTERFACE_AGE): Increment.

2012-11-29  Mark H Weaver  <mhw@netris.org>

	NEWS: Add entry for new GUILE_LOAD_PATH (et al) ellipsis handling.
	* NEWS: Add entry for new GUILE_LOAD_PATH (et al) ellipsis handling.

	NEWS: Mention par-for-each, alongside par-map, being fixed to use all cores
	* NEWS: Mention par-for-each, alongside par-map, being fixed to use all
	  cores.

	Minor fixes in NEWS
	* NEWS: Minor fixes to the descriptions.

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

	Update `NEWS'.
	* NEWS: Add news for 2.0.7.

	futures: Remove circular dependency with (ice-9 threads).
	* module/ice-9/futures.scm: Remove now-useless import of (ice-9 threads)
	  introduced in commit be05b336.

	doc: Document nested futures.
	* doc/ref/api-scheduling.texi (Futures): Mention nested futures.
	  Explain what happens upon `touch'.

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

	doc: Remove example use of vectors as hash tables.
	Fixes <http://bugs.gnu.org/13022>.
	Reported by Daniel Hartwig <mandyke@gmail.com>.

	* doc/ref/api-compound.texi (Hash Table Examples): Remove example use of
	  vectors as hash tables.

2012-11-29  Mark H Weaver  <mhw@netris.org>

	Add parse-path-with-ellipsis, and use it for GUILE_LOAD_PATH et al.
	* libguile/load.c (scm_ellipsis): New Variable.
	  (scm_parse_path_with_ellipsis): New procedure.
	  (scm_init_load): Initialize 'scm_ellipsis'.
	  (scm_init_load_path): Use 'scm_parse_path_with_ellipsis' to
	  handle GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH.

	* libguile/load.h (scm_parse_path_with_ellipsis): Add prototype.

	* doc/ref/guile-invoke.texi (Environment Variables):
	  doc/ref/api-evaluation.texi (Load Paths): Add documentation.
	  Correct description of default load path to reflect reality.
	  Remove 'GUILE_LOAD_PATH' from the concept index; it is already
	  in the variable index.  Add cross references between these two
	  sections of the manual.

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

	Remove definition of the `SHARED_LIBRARY_PATH_VARIABLE' C macro.
	This is a follow-up to fc32c44.

	* configure.ac: Remove definition of `SHARED_LIBRARY_PATH_VARIABLE',
	  which was added in e66ff09a.

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

	web: Add `http-get*'.
	* module/web/client.scm (http-get*): New procedure.
	* doc/ref/web.texi (Web Client): Document it.

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

	web: Add `response-body-port'.
	* module/web/response.scm (make-delimited-input-port,
	  response-body-port): New procedures.
	  (read-response-body): Use `response-body-port'.

	* test-suite/tests/web-response.test ("example-1")["response-body-port"]:
	  New test.
	  ("example-2")["response-body-port"]: New test.

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

	web: Export `text-content-type?'.
	* module/web/client.scm (text-type?): Remove.
	  (decode-response-body): Use `text-content-type?'.
	* module/web/response.scm (text-content-type?): New procedure.
	* doc/ref/web.texi (Responses): Document it.

	tests: Use `pass-if-equal' in `web-response.test'.
	* test-suite/tests/web-response.test: Cleanup whitespace.  Use
	  `pass-if-equal' when appropriate.

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

	eval: Store docstrings for lambdas.
	Fixes <http://bugs.gnu.org/12173>.
	Reported by Ian Price <ianprice90@googlemail.com>.

	* libguile/memoize.c (MAKMEMO_LAMBDA): New `docstring' parameter.  Add
	  it as the second argument of `SCM_M_LAMBDA'.  Update caller.
	  (memoize)[SCM_M_LAMBDA]: Extract docstring from EXP; when `memoize'
	  returns, add the docstring to the lambda's arguments.
	  (unmemoize)[SCM_M_LAMBDA]: Adjust to new argument layout of
	  `SCM_M_LAMBDA'.
	* libguile/eval.c (BOOT_CLOSURE_NUM_REQUIRED_ARGS,
	  BOOT_CLOSURE_HAS_REST_ARGS, BOOT_CLOSURE_IS_REST,
	  BOOT_CLOSURE_PARSE_FULL): Adjust to new argument layout of
	  `SCM_M_LAMBDA'.
	* module/ice-9/eval.scm (primitive-eval)[make-general-closure]:
	  Likewise.
	  [eval]: When EXP is a lambda, match its docstring; when the docstring
	  is not #f, add it to the closures procedure properties.
	* test-suite/tests/eval.test ("docstrings"): New test prefix.

	* libguile/procs.c (sym_documentation): Rename to...
	  (scm_sym_documentation): ... this.  Make it global.
	* libguile/procs.h (scm_sym_documentation): New declaration.

2012-11-28  Mark H Weaver  <mhw@netris.org>

	Fix library search order and don't change LD_LIBRARY_PATH
	* libguile/dynl.c (system_extensions_path): New static variable.
	  (sysdep_dynl_link): If 'lt_dlopenext' fails, manually search
	  in 'system_extensions_path'.
	  (augment_env): Remove.
	  (sysdep_dynl_init): Don't change LD_LIBRARY_PATH, and don't use
	  lt_dladdsearchdir if GUILE_SYSTEM_EXTENSIONS_PATH is set.  Instead,
	  initialize 'system_extensions_path' from GUILE_SYSTEM_EXTENSIONS_PATH
	  (or if it's unset: <SCM_LIB_DIR>:<SCM_EXTENSIONS_DIR>), and rely on
	  sysdep_dynl_link to search those directories manually.

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

	vlist: Remove Texinfo markup from docstrings.
	* module/ice-9/vlist.scm: Remove Texinfo markup from docstrings with
	  sed -e"s/@var{\([a-z0-9?!-]\+\)}/\U\1/g ; s/@code{\([^}]\+\)}/‘\1’/g".

2012-11-27  Daniel Hartwig  <mandyke@gmail.com>

	web client: correctly handle uri-query, etc. in relative URI headers
	* module/web/uri.scm (uri-pat): Make scheme part optional.
	  (string->uri*): New private procedure to also parse relative URIs.
	* module/web/http.scm (declare-relative-uri-header!): Use that.

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

	web client: Support relative URIs in some headers.
	Fixes <http://bugs.gnu.org/12827>.

	* module/web/http.scm (declare-relative-uri-header!): New procedure.
	  ("Content-Location", "Referer"): Use it.
	  Based on discussions with Daniel Hartwig <mandyke@gmail.com>.

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

	Have `load-in-vicinity' look for `.go' files in %LOAD-COMPILED-PATH.
	Fixes <http://bugs.gnu.org/12519>.

	* module/ice-9/boot-9.scm (load-in-vicinity)[fresh-compiled-file-name]:
	  New `scmstat' parameter; use it.
	  [sans-extension]: New procedure.
	  [load-absolute]: Call (stat ABS-PATH) from here.  Search a `.go' file
	  from %LOAD-COMPILED-PATH before searching %COMPILE-FALLBACK-PATH.

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

	Split `load-in-vicinity' into small procedures.
	* module/ice-9/boot-9.scm (load-in-vicinity)[compiled-extension]: New
	  variable.
	  [compiled-file-name]: Rename to...
	  [fallback-file-name]: ... this; update caller.  Use COMPILED-EXTENSION.
	  [more-recent?, compile, warn-about-exception]: New procedures.
	  [fresh-compiled-file-name]: Use them.

2012-11-26  Ian Price  <ianprice90@googlemail.com>

	Update thanks
	* THANKS: Add Sjoerd Van Leent

	Fix docs for `hashtable-copy'
	* doc/ref/r6rs.texi (rnrs hashtables): a true mutable argument means a
	  mutable copy.

2012-11-25  Ian Price  <ianprice90@googlemail.com>

	R6RS srfi library names should ignore first identifier after the :n
	* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface):
	  (srfi :n name ids ...) -> (srfi srfi-n ids ...)
	* test-suite/tests/rnrs-libraries.test ("srfi"): Add test.

2012-11-24  Daniel Hartwig  <mandyke@gmail.com>

	(web uri): document that uri-port is an integer
	* doc/ref/web.texi (URIs):
	* module/web/uri.scm (build-uri): Document that uri-port is an integer.

2012-11-24  Daniel Hartwig  <mandyke@gmail.com>

	syncronize web module docstrings with manual
	* doc/ref/web.texi: Fix spacing.  Update with a few missing function
	  descriptions.

	* module/web/client.scm:
	* module/web/http.scm:
	* module/web/request.scm:
	* module/web/server.scm:
	* module/web/uri.scm: Update docstrings from manual (reworked by Ludovic
	  Courtès).

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

	Augment `.dir-locals.el'.
	* .dir-locals.el: Add more `scheme-indent-function' rules.

	Turn on the `case' warnings in auto-compilation.
	* module/ice-9/boot-9.scm (%auto-compilation-options): Add
	  `duplicate-case-datum' and `bad-case-datum'.

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

	Add tests for `-Wduplicate-case-datum' and `-Wbad-case-datum'.
	* test-suite/tests/tree-il.test (%opts-w-duplicate-case-datum,
	  %opts-w-bad-case-datum): New variables.
	  ("warnings")["duplicate-case-datum", "bad-case-datum"]: New tests.

	doc: Mention the `duplicate-case-datum' and `bad-case-datum' warnings.
	* doc/ref/api-evaluation.texi (Compilation): List the
	  `duplicate-case-datum' and `bad-case-datum' warnings.

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

	Remove reference to `scm_init_popen' when `fork' is unavailable.
	Fixes <http://bugs.gnu.org/12477>.
	Reported by lin ray <lin.wei.ray@gmail.com>.

	* configure.ac: Define the `HAVE_FORK' Automake conditional.
	* module/Makefile.am (ICE_9_SOURCES): Add `ice-9/popen.scm' only when
	  HAVE_FORK.
	* libguile/posix.c (scm_init_posix): Register `scm_init_popen' only when
	  HAVE_FORK.

2012-11-22  Ian Price  <ianprice90@googlemail.com>

	R6RS `string-for-each' should accept multiple string arguments
	* module/rnrs/base.scm (string-for-each): Rewrite.
	* test-suite/tests/r6rs-base.test ("string-for-each"): Add tests.

2012-11-21  Ludovic Courtès  <ludo@gnu.org>

	cse: Fix out-of-bounds access to the database.
	Fixes <http://bugs.gnu.org/12883>.

	* module/language/tree-il/cse.scm (cse)[find-dominating-lexical]: Fix
	  computation of the last argument passed to `unroll'.
	  Patch by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.
	* test-suite/tests/cse.test ("cse")["http://bugs.gnu.org/12883"]: New
	  test.

2012-11-21  Ludovic Courtès  <ludo@gnu.org>

	Update `par-map' to use nested futures.
	This allows it to actually use all CPU cores, instead of having the main
	thread stuck on a `wait-condition-variable'.

	* module/ice-9/threads.scm (par-mapper): Add a `cons' argument; update
	  callers accordingly.  Rewrite using nested futures.

2012-11-21  Ludovic Courtès  <ludo@gnu.org>

	futures: Allow nested futures; put the main thread to work.
	* module/ice-9/futures.scm (%futures-waiting, %within-future?,
	  %future-prompt): New variables.
	  (let/ec): New macro.
	  (process-future!): Run FUTURE's thunk in a prompt; capture FUTURE's
	  continuation when it aborts, and add it to %FUTURES-WAITING.  Set
	  %WITHIN-FUTURE? in the dynamic extent of the call FUTURE's thunk.
	  (process-futures): Move loop body to...
	  (process-one-future): ... here.  New procedure.
	  (notify-completion): New procedure.
	  (touch)[work, loop]: New procedures.
	  When %WITHIN-FUTURE? and FUTURE is started, abort; if not
	  %WITHIN-FUTURE, call `work' while waiting.
	  When FUTURE is queued, call `work' too.

	* test-suite/tests/future.test ("nested futures"): New tests.

2012-11-21  Ludovic Courtès  <ludo@gnu.org>

	futures: Add a record printer.
	* module/ice-9/futures.scm: Add a record printer for <future>.

	futures: Keep futures unlocked while they are processing.
	* module/ice-9/futures.scm (<future>)[completion]: New field.
	  [done?]: Rename to...
	  [state]: ... this.  Change `set-future-done?!' to
	  `set-future-state!', and `future-done?' to `future-state'.
	  (make-future): Initialize the `completion' field to 'queued.
	  (with-mutex): New macro.
	  (process-future!): Remove `set-future-done?!' call.
	  (process-futures): Check `future-state'.  Unlock FUTURE's mutex before
	  processing it.  Broadcast FUTURE's `completion' cond. var. when done.
	  (touch): Likewise.

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

	Update Gnulib to v0.0-7695-g26c0590.
	* gnulib-local/m4/canonicalize.m4.diff: Remove.
	* Makefile.am (EXTRA_DIST): Adjust accordingly.

	doc: Strengthen the case for pattern matching.
	* doc/ref/api-compound.texi (Pairs): Warn against `cadr' & co., and add
	  a link to "Pattern Matching".
	* doc/ref/match.texi (Pattern Matching): Add example with nested lists.
	  Add paragraph comparing `match' expressions and hand-written code.

	doc: Fix typo in `set-record-type-printer!' doc.
	* module/srfi/srfi-9/gnu.scm (set-record-type-printer!): Change the
	  parameter name to `proc'.
	* doc/ref/api-compound.texi (SRFI-9 Records): Update accordingly.

2012-11-15  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

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

	Add missing R6RS `open-file-input/output-port' procedure
	* module/rnrs/io/port.scm (r6rs-open): New internal helper procedure for
	  opening files.
	  (open-file-input-port, open-file-output-port): Make use of
	  `r6rs-open'.
	  (open-file-input/output-port): Implement in terms of `r6rs-open',
	  add to exported identifiers list.

	* module/rnrs.scm (open-file-input/output-port): Add to exported
	  identifiers.

	* test-suite/tests/r6rs-ports.test (test-input-file-opener): New
	  procedure, collects several tests for opening file input ports.
	  ("7.2.7 Input Ports"): Use `test-input-file-opener' for checking
	  `open-file-input-port'.
	  (test-output-file-opener): New procedure, collects several tests for
	  opening file output ports.
	  ("8.2.10 Output ports"): Use `test-output-file-opener' for checking
	  `open-file-output-port'.
	  ("8.2.13 Input/output ports"): New test prefix, making use of both
	  `test-input-file-opener' and `test-output-file-opener' to check
	  `open-file-input/output-port'.

2012-11-12  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

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

	doc: Update argument order of SRFI-9 `set-field'.
	* doc/ref/api-compound.texi (SRFI-9 Records): Change argument order for
	  `set-field'.

2012-11-11  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

	srfi-9.test: avoid symbols of the form ':bar' for more robust checking.
	* test-suite/tests/srfi-9.test ("incompatible field paths"): Rename
	  ':bar' to 'bar' to avoid the possibility of the symbol name being
	  printed with #{...}# notation.

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

	doc: Document SRFI-9 functional setters.
	* doc/ref/api-compound.texi (Functional ``Setters''): New section.

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

	doc: Move SRFI-9 records under "Compound Data Types".
	Suggested by Mark Weaver.

	* doc/ref/srfi-modules.texi (SRFI-9): Keep the node, but move contents
	  to...
	* doc/ref/api-compound.texi (SRFI-9 Records): ...here.
	  (Record Overview): New section.

2012-11-10  Mark H Weaver  <mhw@netris.org>

	Change the argument order of 'set-fields' to match that of 'set-fields'.
	* module/srfi/srfi-9/gnu.scm (set-fields): Swap order of first two
	  arguments.

	* test-suite/tests/srfi-9.test: Update tests.

2012-11-10  Mark H Weaver  <mhw@netris.org>

	Add system/base/ck.scm to SYSTEM_BASE_SOURCES in module/Makefile.am.
	* module/Makefile.am (SYSTEM_BASE_SOURCES): Add system/base/ck.scm.

	Futures: Avoid creating the worker pool more than once.
	* module/ice-9/futures.scm (%create-workers!): Use 'with-mutex' in case
	  an exception is thrown.  Within the critical section, check to make
	  sure the worker pool hasn't already been created by another thread.

2012-11-10  Mark H Weaver  <mhw@netris.org>

	Improve error for set-fields paths leading to different types.
	* module/system/base/ck.scm: New module.

	* module/srfi/srfi-9.scm: Import (system base ck).

	  (getter-type, getter-index, getter-copier): Convert incoming argument
	  convention to CK form.

	  (define-tagged-inlinable): Convert return value convention for key
	  lookup to CK form.

	* module/srfi/srfi-9/gnu.scm: Import (system base ck).
	  Rename '%set-fields-unknown-getter' to 'unknown-getter'.

	  (c-list, c-same-type-check): New macros.

	  (%set-fields): Using the CK abstract machine, arrange to check (at
	  macro expansion time) that all of the getters in head position
	  correspond to the same record type.

	* test-suite/tests/srfi-9.test: Add test.

2012-11-10  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

2012-11-10  Mark H Weaver  <mhw@netris.org>

	Improve error messages for invalid record definitions.
	* module/srfi/srfi-9.scm (%define-record-type): Accept additional 'form'
	  parameter which contains the original form of 'define-record-type' or
	  'define-immutable-record-type'.  Add elaborate pattern guard which
	  raises descriptive syntax errors for specific errors, and a fallback
	  pattern to catch anything else.
	  (define-record-type): Pass 'form' parameter to %define-record-type.

	* module/srfi/srfi-9/gnu.scm (define-immutable-record-type): Pass 'form'
	  parameter to %define-record-type.

	* test-suite/tests/srfi-9.test: Add tests.

2012-11-10  Mark H Weaver  <mhw@netris.org>

	Fix non-toplevel srfi-9 compile-time error tests to actually be non-toplevel.
	* test-suite/tests/srfi-9.test: Move non-toplevel record definitions to be
	  within the expression passed to 'compile'.

	Use 'pass-if-equal' to check syntax-error exceptions in srfi-9.test.
	* test-suite/tests/srfi-9.test: Convert detailed syntax-error exception
	  tests to use 'pass-if-equal'.

2012-11-09  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

	Fix record constructor in getopt-long.
	* module/ice-9/getopt-long.scm (%make-option-spec): Fix the formal
	  argument list to match the actual fields present.
	  (make-option-spec): Update to match the fixed %make-option-spec.

	Merge remote-tracking branch 'origin/stable-2.0'

2012-11-09  Mark H Weaver  <mhw@netris.org>

	Implement functional record setters.
	Written in collaboration with Ludovic Courtès <ludo@gnu.org>

	* module/srfi/srfi-9.scm: Internally, rename 'accessor' to 'getter'
	  and 'modifier' to 'setter'.

	  (define-tagged-inlinable, getter-type, getter-index, getter-copier,
	  %%on-error, %%set-fields): New macros.

	  (%define-record-type): New macro for creating both mutable and
	  immutable records, and containing a substantially rewritten version of
	  the code formerly in 'define-record-type'.

	  (define-record-type): Now just a wrapper for '%define-record-type'.

	  (throw-bad-struct, make-copier-id): New procedures.

	* module/srfi/srfi-9/gnu.scm (define-immutable-record-type, set-field,
	  and set-fields): New exported macros.

	  (collate-set-field-specs): New procedure.

	  (%set-fields-unknown-getter, %set-fields): New macros.

	* test-suite/tests/srfi-9.test: Add tests.  Rename getters and setters
	  in existing tests to make the functional setters look better.

2012-11-05  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/validate.h

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

	Fix invalid assertion about mutex ownership in threads.c.
	* libguile/threads.c (do_thread_exit): Don't assert m->owner == t->handle
	  since that is not the case when MUTEX was abandoned by T.  Reported by Mark
	  Weaver and others.

	Have `SCM_NUM2FLOAT' and `SCM_NUM2DOUBLE' use `scm_to_double'.
	* libguile/validate.h (SCM_NUM2FLOAT, SCM_NUM2DOUBLE): Use
	  `scm_to_double' instead of the deprecated functions.  Reported by
	  Aleix Conchillo Flaqué <aconchillo@gmail.com>.

	Fix copyright years in `futures.scm'.
	* module/ice-9/futures.scm: Update copyright years.

2012-11-05  Mark H Weaver  <mhw@netris.org>

	Preserve additional R6RS library name components after srfi :n
	* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface):
	  (srfi :n ...) -> (srfi srfi-n ...) instead of (srfi srfi-n).

2012-11-03  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'

2012-11-03  Ludovic Courtès  <ludo@gnu.org>

	futures: Have workers work when futures are available.
	Reported by David Pirotte.

	* module/ice-9/futures.scm (process-futures): Wait on %FUTURES-AVAILABLE
	  only when %FUTURES is empty.

	  The problem was obvious when running (begin (use-modules (ice-9
	  threads)) (par-map 1+ (iota 400000))) : eventually, only the main
	  thread would do the work, while the others would remain idle, waiting
	  on %FUTURES-AVAILABLE.

2012-11-03  Ludovic Courtès  <ludo@gnu.org>

	Fix `generalized-vector->list' indexing bug with shared arrays.
	Fixes <http://bugs.gnu.org/12465>.
	Reported by Daniel Llorens <daniel.llorens@bluewin.ch>.

	* libguile/generalized-vectors.c (scm_generalized_vector_to_list): Fix
	  initial value of POS; pass the `h.base + pos', not just `pos' as the
	  `vref' argument.

	* test-suite/tests/arrays.test ("array->list")["http://bugs.gnu.org/12465
	  - ok", "http://bugs.gnu.org/12465 - bad]: New tests.
	  ("generalized-vector->list"): New test prefix.

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

	test-suite: Add a nameless form of `pass-if-equal'.
	* test-suite/test-suite/lib.scm (pass-if-equal): Add a nameless pattern.
	* test-suite/tests/arrays.test ("array->list"): Use `pass-if-equal'.

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

	scandir: Use `lstat' instead of `stat'.
	* module/ice-9/ftw.scm (scandir): Use `lstat', not `stat'.

	* test-suite/tests/ftw.test ("scandir")["symlink to directory"]: New
	  test.

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

	test-suite: Use `pass-if-equal' in `ftw.test'.
	* test-suite/tests/ftw.test ("file-system-fold")["test-suite (never
	  enter)", "test-suite/lib.scm (flat file)"]: Use `pass-if-equal'
	  instead of `pass-if'.

	test-suite: Add `pass-if-equal'.
	* test-suite/test-suite/lib.scm (pass-if-equal): New macro.
	  (run-test): Upon `fail', pass ARGS to REPORT.

2012-10-31  Mark H Weaver  <mhw@netris.org>

	Merge remote-tracking branch 'origin/stable-2.0'
	Moved scm_i_struct_hash from struct.c to hash.c and made it static.

	The port's alist is now a field of 'scm_t_port'.

	Conflicts:
		libguile/arrays.c
		libguile/hash.c
		libguile/ports.c
		libguile/print.h
		libguile/read.c

2012-10-31  Mark H Weaver  <mhw@netris.org>

	Fix formatting of comments in scm_read_array.
	* libguile/read.c (scm_read_array): Fix formatting of comments.

	scm_read_shebang: handle non-ascii characters properly.
	* libguile/read.c (scm_read_shebang): Abort scan for reader directive
	  if a character other than [-a-z0-9] is encountered.

2012-10-30  Mark H Weaver  <mhw@netris.org>

	Test number-theoretic division by -0.0.
	* test-suite/tests/numbers.test ("Number-theoretic division"): Fix typo
	  so that we actually test for division by -0.0.

	Minor tweaks to srfi-105.test
	* test-suite/tests/srfi-105.test ("curly-infix"): Minor tweaks.

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

	Implement SRFI-105 curly infix expressions.
	* libguile/private-options.h: Add SCM_CURLY_INFIX_P macro, and increment
	  SCM_N_READ_OPTIONS.

	* libguile/read.c (sym_nfx, sym_bracket_list, sym_bracket_apply): New
	  variables.
	  (scm_read_opts): Add curly-infix reader option.  Reformat to comply
	  with GNU coding standards.
	  (scm_t_read_opts): Add curly_infix_p and neoteric_p fields.
	  (init_read_options): Initialize new fields.
	  (CHAR_IS_DELIMITER): Add '{', '}', '[', and ']' as delimiters if
	  curly_infix_p is set.

	  (set_port_square_brackets_p, set_port_curly_infix_p): New functions.

	  (read_inner_expression): New function which contains the code that was
	  previously in 'scm_read_expression'.  Handle curly braces when
	  curly_infix_p is set.  If curly_infix_p is set and square_brackets_p
	  is unset, follow the Kawa convention: [...] => ($bracket-list$ ...)

	  (scm_read_expression): New function body to handle neoteric
	  expressions where appropriate.

	  (scm_read_shebang): Handle the new reader directives: '#!curly-infix'
	  and the non-standard '#!curly-infix-and-bracket-lists'.

	  (scm_read_sexp): Handle curly infix lists.

	* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-105 feature
	  identifier.

	* doc/ref/srfi-modules.texi (SRFI-105): Add stub doc for SRFI-105.

	* doc/ref/api-evaluation.texi (Scheme Read): Add documentation for the
	  'curly-infix' read option, and the '#!curly-infix' and
	  '#!curly-infix-and-bracket-lists' reader directives.

	* doc/ref/api-options.texi (Runtime Options): Add 'curly-infix' to the
	  list of read options.

	* test-suite/Makefile.am: Add tests/srfi-105.test.

	* test-suite/tests/srfi-105.test: New file.

2012-10-26  Mark H Weaver  <mhw@netris.org>

	Implement #!fold-case and #!no-fold-case reader directives.
	* libguile/read.c (set_port_case_insensitive_p): New function.

	  (scm_read_shebang): Handle #!fold-case and #!no-fold-case.

	* doc/ref/api-evaluation.texi (Case Sensitivity, Scheme Read): Document
	  the #!fold-case and #!no-fold-case reader directives.

	* test-suite/tests/reader.test ("per-port-read-options"): Add tests.

2012-10-26  Mark H Weaver  <mhw@netris.org>

	Implement per-port read options.
	* libguile/read.c (scm_t_read_opts): Update comment to mention the
	  per-port read options.

	  (sym_port_read_options): New variable.

	  (set_port_read_option): New function.

	  (init_read_options): Add new 'port' parameter, and consult the
	  per-port read option overrides when initializing the 'scm_t_read_opts'
	  struct.  Move to bottom of file.

	  (scm_read): Pass 'port' parameter to init_read_options.

2012-10-24  Mark H Weaver  <mhw@netris.org>

	Repurpose scm_i_port_weak_hash to associate an alist with each port.
	* libguile/ports.c (scm_i_port_weak_hash): Document that the values in
	  this hash table will now be alists.  Previously the value slots were
	  unused.

	  (scm_new_port_table_entry): Change the initial value of the entry in
	  scm_i_port_weak_hash from SCM_BOOL_F to SCM_EOL.

2012-10-24  Mark H Weaver  <mhw@netris.org>

	Generalize scm_read_shebang to handle other reader directives.
	* libguile/read.c (READER_DIRECTIVE_NAME_MAX_SIZE): New C macro.
	  (scm_read_shebang): Rewrite to handle arbitrary reader directives.

	Add source properties to more datum types in scm_read_sharp_extension.
	* libguile/read.c (scm_read_sharp_extension): Attach source properties
	  to the result of a custom token reader if the returned datum is not
	  immediate.  Previously, source properties were added to pairs only.

2012-10-24  Mark H Weaver  <mhw@netris.org>

	Change reader to pass read options to helpers via explicit parameter.
	* libguile/read.c (enum t_keyword_style, struct t_read_opts,
	  scm_t_read_opts): New types.
	  (init_read_options): New function.

	  (CHAR_IS_DELIMITER): Look up square-brackets option via local 'opts'.

	  (scm_read): Call 'init_read_options', and pass 'opts' to helpers.

	  (flush_ws, maybe_annotate_source, read_complete_token, read_token,
	  scm_read_bytevector, scm_read_character,
	  scm_read_commented_expression, scm_read_expression,
	  scm_read_guile_bit_vector, scm_read_keyword,
	  scm_read_mixed_case_symbol, scm_read_nil, scm_read_number,
	  scm_read_number_and_radix, scm_read_quote, scm_read_sexp,
	  scm_read_sharp, scm_read_sharp_extension, scm_read_shebang,
	  scm_read_srfi4_vector, scm_read_string, scm_read_syntax,
	  scm_read_vector, scm_read_array): Add 'opts' as an additional
	  parameter, and use it to look up read options.  Previously the global
	  read options were consulted directly.

2012-10-24  Mark H Weaver  <mhw@netris.org>

	Minor tweaks to delimiter handling in read.c
	* libguile/read.c (CHAR_IS_R5RS_DELIMITER, CHAR_IS_DELIMITER): Move the
	  '[' and ']' delimiters from CHAR_IS_R5RS_DELIMITER to
	  CHAR_IS_DELIMITER.  Parenthesize all references to the macro
	  parameter.  Don't check the global square-brackets read option until
	  after we know the character is '[' or ']'.
	  (scm_read_sexp): Don't check the global square-brackets read option
	  until after we know the character is ']'.

2012-10-24  Mark H Weaver  <mhw@netris.org>

	Move array reader from arrays.c to read.c
	* libguile/arrays.c (read_decimal_integer): Move to read.c.
	  (scm_i_read_array): Remove.  Incorporate the code into the
	  'scm_read_array' static function in read.c.

	* libguile/arrays.h (scm_i_read_array): Remove prototype.

	* libguile/read.c (read_decimal_integer): Move here from read.c.
	  (scm_read_array): Incorporate the code from 'scm_i_read_array'.  Call
	  'scm_read_vector' and 'scm_read_sexp' instead of 'scm_read'.

2012-10-18  Ian Price  <ianprice90@googlemail.com>

	Fix typo in scheme-using.texi
	* doc/ref/scheme-using.texi (System Commands): Fix typo.

	Fix @@ usage in --listen option
	* module/ice-9/command-line.scm (compile-shell-switches): Fix usage of
	  @@, which no longer supports arbitrary expressions, only identifiers.

2012-10-17  Mark H Weaver  <mhw@netris.org>

	Remove prototype for scm_read_token, which does not exist.
	* libguile/read.h: Remove prototype for scm_read_token.

	Improve formatting of options help given long option names
	* module/ice-9/boot-9.scm (define-option-interface): When printing
	  options help, e.g. for (read-options 'help), expand the width of the
	  first column by another tab stop, to accommodate option names of up to
	  23 characters.

2012-10-13  Ludovic Courtès  <ludo@gnu.org>

	web: Fix possible file descriptor leak in `open-socket-for-uri'.
	* module/web/client.scm (open-socket-for-uri): Always close S in the
	  `system-error' handler.

2012-10-12  Ludovic Courtès  <ludo@gnu.org>

	web: Pass `AI_NUMERICSERV' when given a port number.
	* module/web/client.scm (open-socket-for-uri)[addresses]: Pass
	  AI_NUMERICSERV as the `getaddrinfo' hint when (uri-port URI) is true.

	web: Change `http-get' to try all the addresses for the given URI.
	* module/web/client.scm (open-socket-for-uri): Try all the addresses
	  returned by `getaddrinfo' until one succeeds.

2012-10-12  Ludovic Courtès  <ludo@gnu.org>

	Implement `hash' for structs.
	* libguile/hash.c (scm_hasher): Call `scm_i_struct_hash' upon
	  `scm_tcs_struct'.
	* libguile/struct.c (scm_i_struct_hash): New function.
	* libguile/struct.h (scm_i_struct_hash): New declaration.

	* test-suite/tests/structs.test ("hash"): New test prefix.

2012-10-12  Mark H Weaver  <mhw@netris.org>

	Thanks Daniel Hartwig.
	* THANKS (Contributors since the last release): Add Daniel Hartwig.

2012-10-12  Daniel Hartwig  <mandyke@gmail.com>

	In string-split, add support for character sets and predicates.
	* libguile/srfi-13.c (string-split): Add support for splitting on
	  character sets and predicates, like string-index and others.
	* test-suite/tests/strings.test (string-split): Add tests covering
	  the new argument types.
	* doc/ref/api-data.texi (string-split): Update.

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

	Revert "Preserve keyword identifier in 'syntax-rules' and 'define-syntax-rule'"
	This reverts commit 3e3d32dd9b2d71ffb0703dedc4d47387e981c9b5.

2012-10-08  Mark H Weaver  <mhw@netris.org>

	Preserve keyword identifier in 'syntax-rules' and 'define-syntax-rule'
	* module/ice-9/psyntax-pp.scm (syntax-rule, define-syntax-rule):
	  Preserve the keyword identifier.

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

2012-10-08  Mark H Weaver  <mhw@netris.org>

	Simplify calls to 'eqv?' when one argument is an immediate constant.
	* module/language/tree-il/primitives.scm (maybe-simplify-to-eq): New
	  helper procedure shared by expanders for 'eqv?' and 'equal?'.
	  (*primitive-expand-table*): Add expansion rule for 'eqv?'.

	* test-suite/tests/tree-il.test ("primitives"): Add tests.

2012-10-08  Mark H Weaver  <mhw@netris.org>

	Don't simplify 'equal?' to 'not' or 'null?'.
	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Don't simplify 'equal?' to 'not' or 'null?', but only to 'eq?'.

	* test-suite/tests/tree-il.test ("primitives"): Adjust tests.

2012-10-08  Mark H Weaver  <mhw@netris.org>

	Don't simplify 'equal?' to 'eq?' when constant is an *inexact* small integer.
	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Refine test for fixnums to verify that the small integer is exact.

	* test-suite/tests/tree-il.test ("primitives"): Add test.

2012-10-06  Ludovic Courtès  <ludo@gnu.org>

	Simplify calls to `equal?' when one argument is a constant.
	* module/language/tree-il/primitives.scm (*primitive-expand-table*): Add
	  expansion rules for `equal?', when called with one constant and
	  another argument.

	* test-suite/tests/tree-il.test (pass-if-primitives-resolved): New
	  macro.
	  ("primitives"): New test prefix.

2012-10-06  Mark H Weaver  <mhw@netris.org>

	Improve error reporting in 'append!'
	* libguile/list.c (scm_append_x): Report correct argument number when
	  validating arguments.  Validate that the last cdr of each argument is
	  null or nil.  Rename formal rest argument from 'lists' to 'args'.

	* test-suite/tests/list.test (append!): Update tests to expect correct
	  handling of improper lists.

2012-10-04  Mark H Weaver  <mhw@netris.org>

	Change inappropriate uses of expect-fail X to pass-if not X in chars.test
	* test-suite/tests/chars.test (basic char handling): Change
	  inappropriate uses of 'expect-fail' to 'pass-if' with 'not' applied to
	  the test.

2012-09-26  Chris K. Jester-Young  <cky944@gmail.com>

	In fold-matches, set regexp/notbol unless matching string start.
	* module/ice-9/regex.scm (fold-matches): Set regexp/notbol if the
	  starting position is nonzero.
	* test-suite/tests/regexp.test (fold-matches): Check that when
	  matching /^foo/ against "foofoofoofoo", only one match results.

2012-09-11  Ludovic Courtès  <ludo@gnu.org>

	Don't stat(2) and access(2) the .go location before using it.
	* module/system/base/compile.scm (ensure-directory): Rename to...
	  (ensure-directory): ... this.  Update callers.  When ERRNO is EEXIST,
	  assume DIR is a writable directory instead of calling `stat' and
	  `access?' again.  Fixes UID/EUID mismatches for setuid binaries.
	  Reported by rixed@happyleptic.org at
	  <http://lists.gnu.org/archive/html/guile-user/2012-06/msg00023.html>.

2012-09-11  Ludovic Courtès  <ludo@gnu.org>

	Rewrite SRFI-31 in terms of `syntax-rules'.
	* module/srfi/srfi-31.scm: Use `#:export' instead of `#:export-syntax'.
	  (rec): Rewrite using `syntax-rules'.

	* test-suite/tests/srfi-31.test ("rec special form"): Change exception
	  type to EXCEPTION:SYNTAX-PATTERN-UNMATCHED.

2012-09-06  Ian Price  <ianprice90@googlemail.com>

	Document (ice-9 curried definitions)
	* doc/ref/Makefile.am (guile_TEXINFOS): Add curried.texi to list
	* doc/ref/curried.texi: New file.
	* doc/ref/guile.texi (Guile Modules): Add "Curried Definitions" to menu.
	* doc/ref/scheme-ideas.texi (Lambda Alternatives): Refer to "Curried Definitions"
	  from the `define' section.

	`define-public' is no a longer curried definition by default.
	* module/ice-9/boot-9.scm (define-public): Remove currying functionality.
	* module/ice-9/curried-definitions.scm (define-public): New export.

2012-09-03  Ludovic Courtès  <ludo@gnu.org>

	build: Fix race between installing `guild' and the `guile-tools' symlink.
	Fixes <http://bugs.gnu.org/12015>.
	Report and patch by Song.Li <Song.Li@windriver.com>.

	* meta/Makefile.am (install-data-hook): Rename to...
	  (install-exec-hook): ... this.

2012-09-03  Ludovic Courtès  <ludo@gnu.org>

	doc: Use scm_{to,from}_double instead of old API in example.
	Fixed <http://bugs.gnu.org/12241>.
	Reported by Kurt W. Gochko <kgochko@comcast.net>.

	* doc/ref/tour.texi (Writing Guile Extensions): Change example to use
	  scm_{to,from}_double instead of the pre-1.8 API.

2012-09-03  Ludovic Courtès  <ludo@gnu.org>

	build: Use Automake's `color-tests'.
	* configure.ac: Use Automake's `color-tests'.

2012-08-27  Ian Price  <ianprice90@googlemail.com>

	ISO 8601 time format specifies zero padding for hours, not blank padding.
	* doc/ref/srfi-modules.texi ("SRFI-19 Date to string"): Fix iso 8601 format strings.
	* module/srfi/srfi-19.scm (directives): Fix iso 8601 format strings.

2012-08-27  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix description of regexp/locale encoding interaction.
	* doc/ref/api-regex.texi (Regexp Functions): Update paragraph that
	  mentions locale encoding and strings-as-bytes.

	* test-suite/tests/regexp.test ("nonascii locales")["match structures
	  refer to char offsets, non-ASCII pattern"]: New test.

2012-08-26  Ludovic Courtès  <ludo@gnu.org>

	Update `texinfo.test' to match latest change.
	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo")["@url{arg}"]:
	  Update test as a follow-up to
	  dc7a9cefbf5434b6e7e503fe83faa07b24a1a6cd ("more robust texinfo alias
	  handling").

2012-08-26  Ian Price  <ianprice90@googlemail.com>

	Fix uri-encoding for strings with no unreserved chars
	* module/web/uri.scm (uri-encode): Change test to check for unreserved
	  chars instead of reserved chars.
	* test-suite/tests/web-uri.test ("encode"): Add test.

	Fix uri-encoding for octets 0-15
	* module/web/uri.scm (uri-encode): All encoded octets should be of the
	  form % HEXDIGIT HEXDIGIT.
	* test-suite/tests/web-uri.test ("encode"): Add test.

2012-08-25  Andy Wingo  <wingo@pobox.com>

	more robust texinfo alias handling
	* module/texinfo.scm (command-spec): Resolve aliases here.
	  (complete-start-command, make-command-parser):
	  (make-dom-parser, parse-environment-args): Reload command after
	  resolving spec, so we get the alias target.

2012-08-21  Ludovic Courtès  <ludo@gnu.org>

	Micro-optimize (ice-9 format).
	* module/ice-9/format.scm (format): Use `call-with-output-string'
	  instead of `with-output-to-string'.

2012-08-20  Ludovic Courtès  <ludo@gnu.org>

	Optimize `scm_lfwrite_substr', used by `scm_simple_format'.
	Fixes <http://bugs.gnu.org/12033>.
	Reported by nalaginrut <nalaginrut@gmail.com>.

	* libguile/print.c (scm_i_display_substring): New function.
	* libguile/print.h (scm_i_display_substring): New internal declaration.
	* libguile/ports.c (scm_lfwrite_substr): Use it instead of `scm_display'
	  + `scm_c_substring'.

2012-08-17  Andy Wingo  <wingo@pobox.com>

	reinstate type check to scm_to_utf8_stringn
	* libguile/strings.c (scm_to_utf8_stringn): Re-add missing type check,
	  inadvertantly removed in e3d4597469a543d97c4997b128509c2ceb13ca2b.

2012-08-08  Mark H Weaver  <mhw@tines.lan>

	Revert "Add tests for 'exp' and 'expt' that should produce complex NaNs"
	This reverts commit cc26b9de1d3c21cb4be49cc61c4b5872b8f607c5.

	Revert "Avoid cexp, whose C standard definition is mathematically incorrect"
	This reverts commit ecbded71bb423a6055c541d6272796aefd1486f9.

2012-08-01  Mark H Weaver  <mhw@netris.org>

	Avoid cexp, whose C standard definition is mathematically incorrect
	* libguile/numbers.c (scm_exp): Do not use cexp.

2012-07-28  Mark H Weaver  <mhw@netris.org>

	Add tests for 'exp' and 'expt' that should produce complex NaNs
	* test-suite/tests/numbers.test (exp, expt): Add tests that should
	  produce complex NaNs, but apparently don't on all systems.

2012-07-28  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/struct.c
		libguile/struct.h

	set struct names for <standard-vtable>, etc
	* libguile/struct.c (scm_init_struct): Set the struct names for
	  <standard-vtable>, <applicable-struct-vtable>, and
	  <applicable-struct-with-setter-vtable>.

2012-07-28  Andy Wingo  <wingo@pobox.com>

	update tests after vtable-vtable deprecation
	* test-suite/tests/goops.test ("classes for built-in types"): Use a
	  vtable instead of a vtable-vtable.

	* test-suite/tests/structs.test (ball-root)
	  ("low-level struct procedures", "make-struct"): Rework to use normal
	  vtables instead of making new vtable-vtable.

2012-07-28  Andy Wingo  <wingo@pobox.com>

	deprecate make-vtable-vtable
	* libguile/struct.h:
	* libguile/struct.c (scm_make_vtable_vtable): Deprecate, as you can
	  handle most of the use cases with make-vtable, and we don't want to
	  promote the creation of new roots to the type hierarchy.
	  (scm_i_make_vtable_vtable): The internal replacement.

	improve documentation for structs
	* doc/ref/api-compound.texi (Structures): Update to describe
	  <standard-vtable>, to remove documentation for make-vtable-vtable, to
	  describe meta-vtables, and to add a long example.

	update structure documentation
	* doc/ref/api-compound.texi (Records): Add a link to SRFI-9 records.
	  (Structures): Add a link to Records.  Describe tail arrays as
	  deprecated, and add a rationale and some details.

	1;3202;0cMerge remote-tracking branch 'origin/stable-2.0'

	improve documentation for structs
	* doc/ref/api-compound.texi (Structures): Update to describe
	  <standard-vtable>, to remove documentation for make-vtable-vtable, to
	  describe meta-vtables, and to add a long example.

	set struct names for <standard-vtable>, etc
	* libguile/struct.c (scm_init_struct): Set the struct names for
	  <standard-vtable>, <applicable-struct-vtable>, and
	  <applicable-struct-with-setter-vtable>.

2012-07-28  Mark H Weaver  <mhw@netris.org>

	Angle of -0.0 is pi, not zero
	* libguile/numbers.c (scm_angle): Check the sign of an inexact real
	  zero, to ensure that (angle -0.0) => pi and (angle 0.0) => 0.0.

	* test-suite/tests/numbers.test (angle): Add tests, and increase
	  precision of tests where the angle should be pi.

2012-07-24  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		GUILE-VERSION

	update structure documentation
	* doc/ref/api-compound.texi (Records): Add a link to SRFI-9 records.
	  (Structures): Add a link to Records.  Describe tail arrays as
	  deprecated, and add a rationale and some details.

2012-07-11  Noah Lavine  <noah.b.lavine@gmail.com>

	Document (ice-9 and-let-star)
	* doc/ref/srfi-modules.texi: note that (srfi srfi-2) is the same as
	  (ice-9 and-let-star).

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

	build: Use `AM_PROG_AR'.
	* configure.ac: Use `AM_PROG_AR', as suggested by Automake
	  1.12.1 ("warning: 'libguilereadline-v-@LIBGUILEREADLINE_MAJOR@.la':
	  linking libtool libraries using a non-POSIX archiver requires
	  'AM_PROG_AR' in 'configure.ac'").

	Fix typos in `NEWS'.
	* NEWS: Fix typos.

	Bump version number for 2.0.6.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	  (LIBGUILE_INTERFACE_CURRENT): Increment, to account for new C
	  functions like `scm_c_nvalues', `scm_to_pointer', etc.
	  (LIBGUILE_INTERFACE_AGE): Increment.

	Store the `git-version-gen' patch.
	* gnulib-local/build-aux/git-version-gen.diff: New file.
	* Makefile.am (EXTRA_DIST): Add it.

	Work around `gl_CANONICALIZE_LGPL' bug when cross-compiling to GNU/Hurd.
	* gnulib-local/m4/canonicalize.m4.diff: New file.
	* Makefile.am (EXTRA_DIST): Add it.

	Work around `gl_CANONICALIZE_LGPL' bug when cross-compiling.
	* gnulib-local/m4/canonicalize.m4.diff: New file.
	* Makefile.am (EXTRA_DIST): Add it.

	Add missing `m4/clock_time.m4'.

2012-07-06  Ludovic Courtès  <ludo@gnu.org>

	Use `clock-time' directly from Gnulib, but with a local patch.
	This is equivalent to the previous situation, but more easily
	maintainable.

	* acinclude.m4 (gl_CLOCK_TIME): Remove.

	* configure.ac: Remove explicit use of `gl_CLOCK_TIME'.

	* m4/gnulib-cache.m4 (gl_MODULES): Add `clock-time'.

	* gnulib-local/m4/clock_time.m4.diff: New file.
	* Makefile.am (EXTRA_DIST): Add it.

2012-07-06  Ludovic Courtès  <ludo@gnu.org>

	Update Gnulib to v0.0-7509-g98a2286.
	* Makefile.am (EXTRA_DIST): Add `m4/gnulib-cache.m4'.
	* build-aux/git-version-gen: Keep unchanged.

2012-07-06  Andy Wingo  <wingo@pobox.com>

	add http/1.1 transfer codings to the NEWS
	* doc/ref/web.texi (Transfer Codings): Add a note about modules.
	* NEWS: Add NEWS for transfer codings.

2012-07-06  Ian Price  <ianprice90@googlemail.com>

	Document and export `declare-opaque-header!'
	* module/web/http.scm (declare-opaque-header!): Add docstring. New export.
	* doc/ref/web.texi (HTTP): Add documentation.

2012-07-06  Ian Price  <ianprice90@googlemail.com>

	Add HTTP Chunked Encoding support to web modules.
	* doc/ref/web.texi(Transfer Codings): New subsection for transfer codings.
	* module/web/http.scm(make-chunked-input-port,
	  make-chunked-output-port): New procedures.
	* module/web/response.scm (read-response-body): Handle chunked responses.
	* test-suite/tests/web-response.test: Add test.
	* test-suite/tests/web-http.test: Add tests.

	afd

2012-07-06  Mark H Weaver  <mhw@netris.org>

	Fix @ and @@ to not capture lexicals; new @@ @@ form for R6RS libraries
	* module/ice-9/psyntax.scm (@): Return top-wrap instead of the wrap
	  applied to the '@' form, so that the symbol will be interpreted as a
	  top-level identifier and never refer to any lexical variable.

	  (@@): Change the syntax used to support R6RS 'library' forms to:
	  (@@ @@ (mod ...) body).  Change the behavior of the documented
	  (@@ (mod ...) id) form to be the same as that of @, except for the use
	  of 'private' instead of 'public' in the psyntax mod: use syntax->datum
	  on the identifier, and return top-wrap instead of the wrap applied to
	  the '@@' form.

	  This fixes <http://bugs.gnu.org/10756> reported by Ludovic Courtès.

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

	* module/ice-9/r6rs-libraries.scm (library): Use '@@ @@' syntax instead
	  of the older '@@' syntax.

	* test-suite/tests/syncase.test (changes to expansion environment): Use
	  '@@ @@' syntax.

	* module/Makefile.am: Add explicit dependencies for boot-9.go on the
	  files that it includes: quasisyntax.scm and r6rs-libraries.scm.

2012-07-06  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	This anticipates deprecation of make-vtable-vtable in stable-2.0, which
	hasn't happened yet.

	Conflicts:
		libguile/deprecated.c
		libguile/deprecated.h
		libguile/print.c
		libguile/struct.c

2012-07-06  Andy Wingo  <wingo@pobox.com>

	simplify %condition-type-vtable
	* module/srfi/srfi-35.scm (%condition-type-vtable): Use make-vtable
	  instead of make-vtable-vtable.

	record-type-vtable is not a new root of the vtable hierarchy
	* module/ice-9/boot-9.scm (record-type-vtable): Simplify to use
	  make-vtable instead of make-vtable-vtable.

	Scheme standard-vtable-fields binding
	* libguile/struct.c (scm_init_struct): Export standard-vtable-fields to
	  Scheme.

	add Scheme binding for scm_standard_vtable_vtable
	* libguile/struct.c (scm_init_struct): Export <standard-vtable> to
	  Scheme.

	simplify scm_init_print
	* libguile/print.c (scm_init_print): Simplify creation of print-state
	  vtable.

	deprecate struct-vtable-tag
	* libguile/deprecated.c:
	* libguile/deprecated.h:
	* libguile/struct.c:
	* libguile/struct.h:
	* doc/ref/api-compound.texi: Deprecate struct-vtable-tag.

	disable some uri tests if --disable-networking
	* test-suite/tests/web-uri.test: Disable some tests if we don't have
	  inet-pton.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/expand.c
		libguile/hashtab.c
		libguile/ports.c
		libguile/vectors.c
		libguile/weaks.c
		module/language/ecmascript/compile-tree-il.scm
		module/language/tree-il/effects.scm
		module/language/tree-il/fix-letrec.scm
		module/language/tree-il/peval.scm
		test-suite/tests/peval.test

	add --match pattern to git-version-gen
	* configure.ac: Add --match pattern so we only get v2.0.x tagx.

	git-version-gen: add --match argument
	* build-aux/git-version-gen (Options): Add --match argument.
	  (v_from_git): Remove path without --match.

	update git-version-gen from gnulib
	* build-aux/git-version-gen: Import from gnulib.

2012-07-06  Daniel Krueger  <keenbug@gmail.com>

	fixed repl command ,describe to also handle syntax

2012-07-06  Dagobert Michelsen  <dam@opencsw.org>

	Add alignment for Sun Studio 12

2012-07-06  Andy Wingo  <wingo@pobox.com>

	more uri-related ipv6 fixes
	* module/web/uri.scm (ipv6-regexp): IPv6 numeric addresses do not have
	  brackets.  It's only in URIs that they have them.
	  (ipv6-host-pat, authority-regexp, parse-authority): Refactor ipv6
	  detection to fix a bug with |, and to extract IPv6 hosts from their
	  brackets.  This way we can pass the uri-host directly to inet-pton.
	  (uri->string): If the host contains a `:', assume it is ipv6 and add
	  brackets.

	* test-suite/tests/web-uri.test ("build-uri"): Adapt tests to assume
	  that the address returned by uri-host and passed to build-uri #:host
	  does not have brackets.

2012-07-06  Daniel Hartwig  <mandyke@gmail.com>

	enhance IPv6 support
	* module/web/uri.scm (valid-host?): Support dotted-quad notation
	  in IPv6 addresses.
	  (parse-authority): Support IPv6 literals.
	* test-suite/tests/web-uri.test: Add and fix tests.

	support URIs with domain names starting with numbers
	* module/web/uri.scm (valid-host?): Fix regexp to support
	domain names starting with numbers.
	* test-suite/tests/web-uri.scm: Add tests for above and
	IP literals.

2012-07-06  Andy Wingo  <wingo@pobox.com>

	fix typo in web.texi
	* doc/ref/web.texi (HTTP Headers): Fix typo in example.  Fixes
	  http://bugs.gnu.org/10890.

2012-07-06  Andy Wingo  <wingo@pobox.com>

	better procedure-arguments for interpreted procs with opt, rest, kwargs
	* module/ice-9/session.scm (procedure-arguments): Arrange to interpret
	  numbers in the "req" and "opt" positions of an 'arglist as N arguments
	  with unknown name.

	* module/ice-9/eval.scm (primitive-eval): Set 'arglist on "complex"
	  procedures.  Fixes http://bugs.gnu.org/10922.

	* test-suite/tests/session.test ("procedure-arguments"): Add a test.

2012-07-06  Andy Wingo  <wingo@pobox.com>

	add check for fchmod
	* configure.ac: Add a check for fchmod.

	* libguile/filesys.c (scm_chmod): Guard the fchmod case with
	  HAVE_FCHMOD.

2012-07-06  Andy Wingo  <wingo@pobox.com>

	remove mkdir alias in filesys.c for mingw
	* libguile/filesys.c (mkdir): Remove alias, as gnulib handles this for
	  us.

	fix warnings in mingw in expand.c
	* libguile/expand.c (VOID_, CONST_): Add trailing underscores to avoid
	  name conflicts on MinGW.

	fix warning about vsnprintf on mingw
	* libguile/deprecation.c: Remove a vsnprintf alias for mingw, now that
	  gnulib handles it correctly.

	be sure to include time.h for struct timespec
	* libguile/gen-scmconfig.c: The GNU libc manual says that struct
	  timespec is defined in time.h.  So, just include both sys/time.h and
	  time.h, if they are available.

2012-07-05  Andy Wingo  <wingo@pobox.com>

	fix `vector' instruction emission for big vectors
	* module/language/glil/compile-assembly.scm (dump-constants): Only use
	  the `vector' instruction for vectors whose length can fit in 16 bits.

	  Fixes http://bugs.gnu.org/11087.

2012-07-05  Andy Wingo  <wingo@pobox.com>

	fix-letrec uses effects.scm for effects analysis
	* module/language/tree-il/fix-letrec.scm: Use effects.scm for effects
	  analysis, instead of primitives.scm.
	  (simple-expression?, partition-vars): Adapt.

2012-07-05  Andy Wingo  <wingo@pobox.com>

	simplify one kind of degenerate prompt
	* module/language/tree-il/peval.scm (<operand>): Instead of having a
	  `residualize?' field, have it be a use count.
	  (peval): Adapt to <operand> change.  Add function to kill uses of an
	  operand.  Use it in the <prompt> inliner.  Add another kind of
	  degenerate prompt to elide.  We should really switch to CPS though, as
	  that will allow us to contify more aggressively.

	* test-suite/tests/peval.test ("partial evaluation"): Adapt (while #t
	  #t) test, which was sensitive to how far the recursive inlining got.
	  Add a test for the degenerate prompt elision.

2012-07-05  Andy Wingo  <wingo@pobox.com>

	fix bugs in effects analysis of "effect+exception-free-primitives"
	* module/language/tree-il/effects.scm (make-effects-analyzer): Be more
	  precise regarding the effects of the so-called
	  effect+exception-free-primitives: now we check their arities.

	* test-suite/tests/cse.test ("cse"): Add a test that we don't
	  elide (cons 1 2 3) in effect context.

2012-07-05  Andy Wingo  <wingo@pobox.com>

	optimize (apply foo 0 (list 1 2)) => (foo 0 1 2)
	* module/language/tree-il/peval.scm (peval): Inline applications where
	  we know the contents of the tail.

	* test-suite/tests/peval.test ("partial evaluation"): Add tests.

2012-07-05  Andy Wingo  <wingo@pobox.com>

	compile ecmascript's `return' as an abort
	* module/language/ecmascript/compile-tree-il.scm (current-return-tag):
	  (with-return-prompt, comp): Compile `return' as an abort instead of a
	  primcall to `return'.  Fixes beta-reduction by the optimizer -- it
	  doesn't make sense for `return' to move from one function to another!

	fix goops compilation when current language is not scheme
	* module/oop/goops/dispatch.scm (compute-dispatch-procedure): Set source
	  language to Scheme, not (current-language).

2012-07-04  Andy Wingo  <wingo@pobox.com>

	add scm_c_nvalues to news
	* NEWS: Add scm_c_nvalues.

2012-07-04  Andy Wingo  <wingo@pobox.com>

	add scm_c_nvalues with docs; also, docs for scm_c_values
	* libguile/values.h:
	* libguile/values.c (scm_c_nvalues): New function.

	* doc/ref/api-control.texi (Multiple Values): Add docs for scm_c_values
	  and scm_c_nvalues.

	Fixes http://bugs.gnu.org/11764.

2012-07-04  Andy Wingo  <wingo@pobox.com>

	add scm_{to,from}_pointer docs
	* doc/ref/api-foreign.texi: Add documentation for scm_to_pointer and
	  scm_from_pointer.

2012-07-02  Andy Wingo  <wingo@pobox.com>

	update NEWS
	* NEWS: Update.

	dead code elimination
	* module/ice-9/psyntax.scm: Remove commented-out definitions of `do' and
	  `case'.

	remove docs for smob-call instruction
	* doc/ref/vm.texi (Trampoline Instructions): Remove docs for smob-call.

	typo fix in web.texi
	* doc/ref/web.texi (URIs): Fix a typo/thinko.

2012-07-02  Ludovic Courtès  <ludo@gnu.org>

	Have `procedure-arguments' always return the `allow-other-keys?' pair.
	Fixes <http://bugs.gnu.org/10938>.
	Based on a patch by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.

	* module/ice-9/session.scm (procedure-arguments): When the 'arglist
	  property is available, emit the `allow-other-keys?' pair.  Use
	  `match-lambda'.

	* test-suite/tests/session.test ("procedure-arguments")["aok? is
	  preserved"]: New test.

2012-07-02  Ludovic Courtès  <ludo@gnu.org>

	Add tests for `procedure-arguments'.
	* test-suite/tests/session.test ("procedure-arguments"): New test
	  prefix.

	Update `THANKS'.

2012-07-02  Ludovic Courtès  <ludo@gnu.org>

	Remove backward-compatible `GC_PTR' definition.
	Fixes <http://bugs.gnu.org/11500>.
	Reported by Kevin J. Fletcher <dev@kjfletch.co.uk>.

	* libguile/bdw-gc.h (GC_PTR)[(defined GC_VERSION_MAJOR)
	  && (GC_VERSION_MAJOR >= 7)]: Remove.

2012-07-02  Ludovic Courtès  <ludo@gnu.org>

	Use `void *' instead of `GC_PTR' internally.
	* libguile/finalizers.c, libguile/foreign.c, libguile/guardians.c,
	  libguile/hashtab.c, libguile/numbers.c, libguile/ports.c,
	  libguile/smob.c, libguile/struct.c, libguile/vectors.c,
	  libguile/weaks.c: Use `void *' instead of `GC_PTR'.

2012-07-02  Ludovic Courtès  <ludo@gnu.org>

	doc: Remove reference to `closure?', now deprecated.
	Fixed <http://bugs.gnu.org/11611>.

	* doc/ref/api-procedures.texi (Procedure Properties): Remove reference
	  to `closure?'.  Suggested by David Jaquay <djaquay@gmail.com>.

2012-06-22  Andy Wingo  <wingo@pobox.com>

	instead of our custom .go format, use elf
	* libguile/objcodes.c: Change to expect objcode on disk to be embedded
	  in ELF instead of having the funky cookie.

	  (to_native_order): Use already existing SCM_BYTE_ORDER style byte
	  order instead of chars.
	  (bytecode_to_objcode): No need for word_size arg.
	  (scm_bytecode_to_objcode, scm_objcode_to_bytecode): Take optional
	  endianness arg instead of sometimes using target-endianness.
	  (scm_load_objcode, scm_write_objcode, scm_bytecode_to_native_objcode):
	  Remove.

	* libguile/objcodes.h: Adapt.

	* libguile/vm.c (scm_load_compiled_with_vm): Use
	  scm_load_thunk_from_file.
	  (make_boot_program): Adapt to use scm_bytecode_to_objcode with
	  endianness arg.

	* module/Makefile.am (OBJCODE_LANG_SOURCES): Add (language objcode
	  elf).
	* module/language/objcode/elf.scm: New module, embeds objcode in ELF.

	* module/language/bytecode/spec.scm (compile-objcode):
	  (decompile-objcode): Use (target-endianness).

	* module/language/objcode/spec.scm: use (language objcode elf) for
	  write-objcode.

	* module/scripts/disassemble.scm (disassemble):
	* module/system/repl/command.scm (disassemble-file): Use
	  load-thunk-from-file.

	* module/system/vm/objcode.scm: Remove load-objcode and write-objcode.

	* test-suite/tests/asm-to-bytecode.test (test-target): Adapt to the new
	  ELF world.

2012-06-22  Andy Wingo  <wingo@pobox.com>

	add ELF loader
	* libguile/objcodes.h:
	* libguile/objcodes.c (scm_load_thunk_from_file)
	  (scm_load_thunk_from_memory): New procedures.

	* libguile/elf.h: Import from glibc.  Not installed.

	* libguile/Makefile.am: Adapt for elf.h.

	* module/system/vm/objcode.scm: (load-thunk-from-file)
	  (load-thunk-from-memory): New exports.

2012-06-22  Andy Wingo  <wingo@pobox.com>

	add elf parser and linker
	* module/Makefile.am:
	* module/system/vm/elf.scm: New file.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/deprecated.c
		libguile/ports.c
		libguile/ports.h
		libguile/strports.c
		test-suite/tests/cse.test

	add char->integer, number->string etc to interesting primitives
	* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
	  (*effect-free-primitives*): Add string->number, number->string,
	  integer->char, and char->integer to allow for constant folding and
	  better effects analysis.

	update version-etc copyright year
	* module/ice-9/command-line.scm (version-etc): Update copyright year to
	  2012.

2012-06-22  Andy Wingo  <wingo@pobox.com>

	cse: expressions evaluated for effect do not provide predicates
	* module/language/tree-il/cse.scm (cse): When trying to fold
	  conditionals, only look at entries in the database that were added in
	  test context.

	* test-suite/tests/cse.test ("cse"): Add a test case.

2012-06-22  Andy Wingo  <wingo@pobox.com>

	scandir: select? takes basenames, operates on (sub)dirs also
	* module/ice-9/ftw.scm (scandir): Run the select? procedure on all
	  items, including subdirs and the `.' and `..' entries.  Pass it the
	  basename of the file in question instead of the full name.

	* test-suite/tests/ftw.test ("scandir"): Adapt expectation for the .test
	  selector.  Add test for a selector that rejects everything.

2012-06-20  Ludovic Courtès  <ludo@gnu.org>

	Fix possible deadlock upon `encoding-error' in `open-input-string'.
	Partly addresses <http://bugs.gnu.org/11197>.

	* libguile/strports.c (scm_mkstrport): Call `scm_port_non_buffer', set
	  Z's cell type and stream, and release `scm_i_port_table_mutex' early.
	  Reacquire `scm_i_port_table_mutex' once BUF, C_BUF, and STR_LEN are
	  initialized.

	* test-suite/tests/ports.test ("string ports")["encoding failure leads
	  to exception"]: New test.

2012-06-20  Ludovic Courtès  <ludo@gnu.org>

	Make SRFI-6 string ports Unicode-capable.
	Partly addresses <http://bugs.gnu.org/11197>.
	Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>.

	* module/srfi/srfi-6.scm (open-input-string, open-output-string): New
	  procedures.

	* test-suite/tests/srfi-6.test ("open-input-string")["read-char,
	  Unicode"]: New test.
	  ("open-output-string")["λ"]: New test.

2012-06-20  Ludovic Courtès  <ludo@gnu.org>

	Update `THANKS'.

2012-06-20  Ludovic Courtès  <ludo@gnu.org>

	Fix cross-compilation of GOOPS-using code.
	Fixes <http://bugs.gnu.org/11645>.
	Reported by Bogdan A. Marinescu <bogdan.a.marinescu@intel.com>.

	* module/oop/goops/dispatch.scm (compute-dispatch-procedure)[comp]:
	  Wrap `compile' call in (with-target %host-type ...).

2012-06-09  Sjoerd van Leent  <svanleent@gmail.com>

	Fix unbound variables and unbound values
	* module/language/ecmascript/base.scm: fix two wrong variable names and a wrong
	  number of arguments in a function call.

2012-06-08  Ludovic Courtès  <ludo@gnu.org>

	Fix invalid use of `SCM' as a Boolean.
	* libguile/deprecated.c (scm_sym2var): Check `scm_is_true (definep)'.

2012-06-08  Ludovic Courtès  <ludo@gnu.org>

	Update (ice-9 match) from Chibi-Scheme.
	Fixes <http://bugs.gnu.org/10651>.

	* module/ice-9/match.upstream.scm: Update.

2012-05-31  Ludovic Courtès  <ludo@gnu.org>

	Make `substitute' conversion strategy test portable.
	* test-suite/tests/foreign.test ("pointer<->string")["%default-port-conversion-strategy
	  is soft"]: Split into the following tests.
	  ["%default-port-conversion-strategy is escape",
	  "%default-port-conversion-strategy is substitute"]: New tests.  In the
	  latter, add the escape form returned on FreeBSD 8.2 and Darwin 10.8.0.

2012-05-31  Ludovic Courtès  <ludo@gnu.org>

	Fix port test that assumed string ports use the `error' conversion strategy.
	This is a followup to 9f6e3f5a997f484548bd03e7e7573c38a95c8d09 ("Have
	string ports honor `%default-port-conversion-strategy'.").

	* test-suite/tests/r6rs-ports.test ("7.2.11 Binary
	  Output")["put-bytevector with wrong-encoding string port"]: Set
	  %DEFAULT-PORT-CONVERSION-STRATEGY to 'error.  Return #f when no
	  exception is raised.
	  ("8.2.6  Input and output ports")["transcoded-port [error handling
	  mode = raise]"]: Return #f when no exception is raised.

2012-05-31  Ludovic Courtès  <ludo@gnu.org>

	Have string ports honor `%default-port-conversion-strategy'.
	* libguile/strports.c (scm_mkstrport): Remove initialization of
	  `pt->ilseq_handler'.

	* module/ice-9/pretty-print.scm (truncated-print)[ellipsis]: Set
	  %DEFAULT-PORT-CONVERSION-STRATEGY to 'error.

	* test-suite/tests/ports.test ("string
	  ports")["%default-port-conversion-strategy is honored"]: New test.
	  ["wrong encoding"]: Rename to...
	  ["wrong encoding, error"]: ... this.  Explicitly set
	  %DEFAULT-PORT-CONVERSION-STRATEGY to 'error.  Return #f when no
	  exception is raised.

2012-05-31  Ludovic Courtès  <ludo@gnu.org>

	Add the `%default-port-conversion-strategy' fluid.
	Fixes <http://bugs.gnu.org/11468>.

	* libguile/ports.c (scm_conversion_strategy): Remove.
	  (default_conversion_strategy_var, sym_error, sym_substitute,
	  sym_escape): New variables.
	  (scm_i_get_conversion_strategy, scm_i_set_conversion_strategy_x):
	  Remove.
	  (scm_i_default_port_conversion_handler,
	  scm_i_set_default_port_conversion_handler): New functions.
	  (scm_port_conversion_strategy): Use
	  `scm_i_default_port_conversion_handler' when PORT is #f.
	  (scm_set_port_conversion_strategy_x): Use SYM_ERROR, SYM_SUBSTITUTE,
	  and SYM_ESCAPE.  Use `scm_i_set_default_port_conversion_handler' when
	  PORT is #f.
	  (scm_init_ports): Initialize DEFAULT_CONVERSION_STRATEGY_VAR.

	* libguile/ports.h: Update declarations accordingly.

	* libguile/foreign.c: Change
	  `scm_i_get_conversion_strategy (SCM_BOOL_F)' to
	  `scm_i_default_port_conversion_handler ()'.
	* libguile/strings.c: Likewise.

	* test-suite/tests/ports.test ("%default-port-conversion-strategy"): New
	  test prefix.

	* test-suite/tests/foreign.test ("pointer<->string")["%default-port-conversion-strategy
	  is error", "%default-port-conversion-strategy is soft"]: New tests.

	* test-suite/test-suite/lib.scm (exception:encoding-error): Allow the
	  regexp to match `scm_to_stringn' error messages.

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

2012-05-31  Ludovic Courtès  <ludo@gnu.org>

	Access `pt->ilseq_handler' directly when needed.
	* libguile/print.c (PORT_CONVERSION_HANDLER): New macro.
	  (print_extended_symbol, iprin1, write_character, scm_write_char): Use
	  it instead of `scm_i_get_conversion_strategy'.

	* libguile/strports.c (scm_mkstrport): Assign `pt->ilseq_handler'
	  directly instead of via `scm_i_set_conversion_strategy_x'.

2012-05-31  Ludovic Courtès  <ludo@gnu.org>

	coverage: Add test for applicable structs.
	* test-suite/tests/coverage.test ("procedure-execution-count")["applicable
	  struct"]: New test.

2012-05-23  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	This commit removes code that was newly deprecated in stable-2.0.

	Conflicts:
		libguile/deprecated.c
		libguile/deprecated.h
		libguile/modules.c
		module/ice-9/boot-9.scm
		module/ice-9/deprecated.scm

2012-05-23  Andy Wingo  <wingo@pobox.com>

	finish deprecating eval closures
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_eval_closure_lookup)
	  (scm_standard_eval_closure, scm_standard_interface_eval_closure)
	  (scm_eval_closure_module): Deprecate these, as they are unused.

	* libguile/modules.h:
	* libguile/modules.c: Remove deprecated code.

	* module/oop/goops/util.scm (top-level-env, top-level-env?): Deprecate.

	* module/ice-9/deprecated.scm (set-system-module!): Deprecate.
	  (module-eval-closure): Deprecate, by overriding the core definition to
	  return a fresh eval closure.

	* module/ice-9/boot-9.scm (make-module): Don't set an eval closure on
	  the module.
	  (the-root-module, the-scm-module): Don't call set-system-module!.

2012-05-23  Andy Wingo  <wingo@pobox.com>

	deprecate lookup closures
	* libguile/deprecated.h (SCM_TOP_LEVEL_LOOKUP_CLOSURE):
	* libguile/deprecated.c (scm_lookup_closure_module):
	  (scm_module_lookup_closure):
	  (scm_current_module_lookup_closure): Deprecate this part of the eval
	  closure interface.  It was unused internally, after the scm_sym2var
	  refactor.

	* libguile/eval.h:
	* libguile/modules.c:
	* libguile/modules.h: Remove deprecated code.

	* libguile/goops.c (scm_ensure_accessor): Use scm_module_variable
	  instead of calling the lookup closure.  However I'm not sure that this
	  code is used at all.

2012-05-23  Andy Wingo  <wingo@pobox.com>

	deprecate scm_sym2var
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_sym2var): Deprecate this function.

	* libguile/modules.h:
	* libguile/modules.c (scm_module_ensure_local_variable): New public
	  function, replacing scm_sym2var with a true definep, without going
	  through eval closures (which are deprecated).
	  (scm_current_module): Rework to do something sensible before modules
	  are booted.
	  (scm_module_lookup, scm_lookup): Refactor to use scm_module_variable.
	  (scm_module_define, scm_define): Refactor to use
	  scm_module_ensure_local_variable.

	* libguile/vm-i-system.c (define!): Use scm_define.

	* libguile/vm.c (resolve_variable): Use scm_module_lookup.

	* libguile/macros.c (scm_make_syntax_transformer): Use
	  scm_module_variable.

	* libguile/gdbint.c (gdb_binding): Use scm_define.

	* doc/ref/api-modules.texi (Accessing Modules from C): Add docs for
	  scm_module_ensure_local_variable.

2012-05-21  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/master'

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		module/language/tree-il/analyze.scm
		module/language/tree-il/effects.scm
		module/language/tree-il/fix-letrec.scm
		module/language/tree-il/peval.scm
		test-suite/tests/cse.test
		test-suite/tests/peval.test

	fix arity check for applicable structs
	* module/language/tree-il/analyze.scm (validate-arity): Fix for
	  applicable structs.  Applicable structs are procedures, but not every
	  struct has a first slot, and not every struct with a procedure in its
	  first slot is applicable.  Besides, the approach in this patch gives
	  better errors.

	rearrange scheme compilation order
	* module/Makefile.am (SOURCES): Move vlists, srfi-1, peval, and cse up
	  in the compilation order.  These are exercised a lot in the compiler.

	vm.c: remove a useless check
	* libguile/vm.c: Remove a check for modules being booted.  If the module
	  passed in is true, that is guaranteed to have been the case.  Passes a
	  fresh bootstrap.

2012-05-21  Ken Raeburn  <raeburn@raeburn.org>

	Fix FFI struct sizing to account for trailing padding.
	* libguile/foreign.c (scm_sizeof): Make sure the overall size is a
	  multiple of the alignment of the structure.
	* test-suite/tests/foreign.test: Test size of { double, int8 }.

	Fix lock handling bug in commit aac980de43a0466b968a56607664f5ebbca6b751.
	* libguile/weak-set.c (resize_set): When releasing a lock temporarily to do
	  an allocation, re-lock it afterwards, instead of unlocking again.
	* libguile/weak-table.c (resize_table): Likewise.

2012-05-17  Andy Wingo  <wingo@pobox.com>

	inline scm_cons, scm_car, scm_cdr
	* libguile/pairs.h (scm_cons, scm_car, scm_cdr): Define these as inline
	  functions.
	  (scm_is_pair): Move here from inline.h.
	* libguile/pairs.c: Remove definitions here, and define gsubrs.

	* libguile/inline.h: Remove scm_is_pair implementation.
	* libguile/inline.c: Include pairs.h to residualize inlines from
	  pairs.h.

2012-05-17  Andy Wingo  <wingo@pobox.com>

	add guile-2.2 feature
	* module/ice-9/boot-9.scm (%cond-expand-features): Add guile-2.2
	  feature.

2012-05-15  Ludovic Courtès  <ludo@gnu.org>

	Add more `%file-port-name-canonicalization' tests.
	* test-suite/tests/ports.test ("%file-port-name-canonicalization")["relative
	  canonicalization with /", "relative canonicalization from ice-9",
	  "absolute canonicalization from ice-9"]: New tests.

2012-05-15  Ludovic Courtès  <ludo@gnu.org>

	Fix relative file name canonicalization with empty %LOAD-PATH entries.
	* libguile/filesys.c (scm_i_relativize_path): Don't attempt to
	  canonicalize when encountering an entry of IN_PATH that is the empty
	  string.

	* test-suite/tests/ports.test (with-load-path): New macro.
	  ("%file-port-name-canonicalization"): New test prefix.

2012-05-15  Andy Wingo  <wingo@pobox.com>

	fix the cse tests
	* test-suite/tests/cse.test (pass-if-cse): Fix-letrec and canonicalize
	  the output, so that unreferenced failure continuations get trimmed.
	  ("cse"): Fix the two tests regarding bailout info.

	cse passes a lookup procedure to the effects analyzer
	* module/language/tree-il/cse.scm (cse): Arrange to pass a lookup
	  procedure to compute-effects, for better effects analysis.

	better effects analysis for calls to lexically bound procedures
	* module/language/tree-il/effects.scm (make-effects-analyzer): The
	  analyzer will take an optional second argument, a lookup procedure of
	  type sym -> exp.  This can let the analyzer dig into calls to
	  lexically bound procedures.

	fix-letrec tweak
	* module/language/tree-il/fix-letrec.scm (make-sequence*, fix-letrec!):
	  When turning unreferenced bindings into sequences, don't bother
	  emitting trivially constant expressions in effect position.

	CSE in tail position
	* module/language/tree-il/cse.scm (singly-valued-expression?, cse):
	  Allow CSE to propagate lexicals to tail positions, if the expression
	  is singly-valued.

2012-05-15  Andy Wingo  <wingo@pobox.com>

	stronger conditional optimization
	* module/language/tree-il/peval.scm (peval): If we can lift one common
	  test, see if we can lift others as well.

	* test-suite/tests/peval.test: Add a test.

2012-05-15  Andy Wingo  <wingo@pobox.com>

	optimization for chain of if expressions with common tests
	* module/language/tree-il/peval.scm (peval): Optimize common tests in
	  chains of "if" expressions, like those generated by matchers.

	* test-suite/tests/peval.test ("partial evaluation"): Add a test.

2012-05-15  Andy Wingo  <wingo@pobox.com>

	mvoe tree-il=? and tree-il-hash to tree-il.scm
	* module/language/tree-il.scm (tree-il=?, tree-il-hash): Move these
	  helpers here, from cse.scm.  Export them.

	* module/language/tree-il/cse.scm (cse): Adapt accordingly.

2012-05-14  Ludovic Courtès  <ludo@gnu.org>

	Honor $(program_transform_name) for the `guile-tools' symlink.
	Fixes <http://bugs.gnu.org/11451>.
	Reported by Cyprien Nicolas <c.nicolas@gmail.com>.

	* meta/Makefile.am (install-data-hook): Honor $(program_transform_name).

2012-05-12  Ludovic Courtès  <ludo@gnu.org>

	Have `-Wformat' remain quiet for any procedure called `_' or `N_'.
	* module/language/tree-il/analyze.scm (proc-ref?)[special?]: New
	  procedure.
	  Return #t for any toplevel-ref of `_'.

	* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
	  format string using gettext as top-level _"): New test.

2012-05-12  Ludovic Courtès  <ludo@gnu.org>

	Have `-Warity-mismatch' handle applicable structs.
	* module/language/tree-il/analyze.scm (arity-analysis): Honor applicable
	  structs.

	* test-suite/tests/tree-il.test ("warnings")["arity
	  mismatch"]("top-level applicable struct", "top-level applicable struct
	  with wrong arguments"): New tests.

2012-05-12  Ludovic Courtès  <ludo@gnu.org>

	Improve special-casing of `_' in `-Wformat'.
	* module/language/tree-il/analyze.scm (proc-ref?): Check for
	  SPECIAL-NAME in the <module-ref> and <lexical-ref> cases too.

	* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
	  format string using gettext as module-ref _", "non-literal format
	  string using gettext as lexical _"): New tests.

2012-05-11  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

	fix more assumptions that the frame-procedure is a procedure
	* libguile/frames.c (scm_frame_source, scm_frame_previous):
	* libguile/stacks.c (scm_make_stack):
	* module/ice-9/boot-9.scm (exception-printers):
	* module/system/vm/frame.scm (frame-call-representation): Fix more
	  assumptions that frame-procedure is a program, or even a procedure.

2012-05-10  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0' into stable-2.0

	Merge remote-tracking branch 'local-2.0/stable-2.0'
	Conflicts:
		libguile/vm-engine.c
		libguile/vm-i-system.c
		libguile/vm.c

2012-05-10  Andy Wingo  <wingo@pobox.com>

	refactor vm application of non-programs; boot continuation refactor
	* libguile/frames.c (scm_frame_instruction_pointer):
	* module/system/vm/frame.scm (frame-bindings):
	  (frame-next-source, frame-call-representation): Fix a few locations
	  that thought that the frame-procedure will always be a VM
	  procedure.  This will not not be the case when traversing the stack of
	  an application of a non-procedure.

	* libguile/vm-i-system.c (call, tail-call, mv-call): Instead of
	  special-casing structs and smobs at these call sites, just set up the
	  stack, and jump to a generic apply loop if the proc is not a program.

	* libguile/vm-engine.c: The generic apply loop is here.  Also, the boot
	  program is now simply a boot continuation, and can handle any number
	  of arguments.

	* libguile/vm.c (make_boot_program): Update the code that makes the boot
	  continuation.

2012-05-08  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/ports.c
		libguile/ports.h
		libguile/read.c
		libguile/vm-i-system.c

2012-05-08  Ludovic Courtès  <ludo@gnu.org>

	Add missing `SCM_API' for `scm_take_from_input_buffers'.
	* libguile/ports.h (scm_take_from_input_buffers): Add `SCM_API'.

2012-05-08  Ludovic Courtès  <ludo@gnu.org>

	Fix `setvbuf' to leave the line/column number unchanged.
	* libguile/fports.c (scm_setvbuf): Use `scm_take_from_input_buffers'
	  directly instead of `scm_drain_input'; use `scm_unget_byte' instead of
	  `scm_unread_string' to put the drained input back to PORT.  This
	  leaves PORT's line/column numbers unchanged, whereas they'd previously
	  be decreased by the `scm_unread_string' call.

	* libguile/ports.c (scm_take_from_input_buffers): Update description and
	  variable names to refer to "bytes", not "chars".

	* test-suite/tests/ports.test ("setvbuf"): New test prefix.

2012-05-08  Andy Wingo  <wingo@pobox.com>

	docbook->texi fix
	* module/texinfo/docbook.scm (*sdocbook->stexi-rules*): Only convert
	  ulink to uref if there is a URL attribute.

2012-05-07  Andy Wingo  <wingo@pobox.com>

	(texinfo docbook) support for @acronym
	* module/texinfo/docbook.scm (*sdocbook->stexi-rules*): Recognize
	  "acronym" as parsing to the @acronym texinfo command.

2012-05-07  Andy Wingo  <wingo@pobox.com>

	add support for texinfo parsed arguments, like @acronym
	* module/texinfo.scm (texi-command-specs): Add a new kind of texinfo
	  command, inline-text-args, a sort of a cross between inline-args,
	  which are unparsed, and inline-text, which is.  Perhaps this should
	  supersede inline-args at some point.  In any case, add acronym as an
	  inline-text-args element.
	  (inline-content?, arguments->attlist, complete-start-command)
	  (parse-inline-text-args, make-dom-parser): Adapt for
	  inline-text-args.

	* module/texinfo/serialize.scm (inline-text-args): Add serialization for
	  @acronym.

	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add some
	  tests.

2012-05-07  Andy Wingo  <wingo@pobox.com>

	Add a missing SYNC_ALL in variable-ref
	* libguile/vm-i-system.c (variable-ref): Add a missing SYNC_ALL.

2012-05-07  Ludovic Courtès  <ludo@gnu.org>

	Optimize `scm_read_string'.
	According to the new benchmarks, this leads a 5% speed improvement when
	reading small strings, and a 27% improvement when reading large strings.

	* libguile/read.c (READER_STRING_BUFFER_SIZE): Change to 128; update
	  comment to mention codepoints.
	  (scm_read_string): Make `str' a list of strings, instead of a string.
	  Store characters read in buffer `c_str'.  Cons to STR when C_STR is
	  full, and concatenate/reverse at the end.

	* benchmark-suite/benchmarks/read.bm (small, large): New variables.
	  Set %DEFAULT-PORT-ENCODING to "UTF-8".
	  ("read")["small strings", "large strings"]: New benchmarks.

2012-05-06  Ludovic Courtès  <ludo@gnu.org>

	Make `scm_unget_byte' public.
	* libguile/ports.h (scm_unget_byte): Make `SCM_API' instead of
	  `SCM_INTERNAL'.

	read: Avoid `void *' pointer arithmetic.
	* libguile/read.c (read_complete_token): Make `new_buf' a `char *' to
	  avoid pointer arithmetic on `void *'.

	Build with `-Wpointer-arith' when available.
	* configure.ac (POTENTIAL_GCC_CFLAGS): Add `-Wpointer-arith'.

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

	Correct typing of assertion in the `wind' instruction.
	* libguile/vm-i-system.c (wind): Check `scm_to_bool (scm_thunk_p (x))'
	  instead of `scm_thunk_p'.

2012-05-04  Ludovic Courtès  <ludo@gnu.org>

	Simplify the reader's `read_complete_token'.
	* libguile/read.c (read_token): Remove unneeded `const' before `size_t'.
	  (read_complete_token): Remove `overflow_buffer' parameter; return
	  `char *' instead of `int'.  Allocate the overflow buffer with
	  `scm_gc_malloc_pointerless' instead of `scm_malloc'.  Return either
	  the overflow buffer or BUFFER.
	  (scm_read_number, scm_read_mixed_case_symbol,
	  scm_read_number_and_radix): Rename `buffer' to `local_buffer', and
	  `overflow_buffer' to `buffer'.  Remove `overflow'.  Adjust code to new
	  `read_complete_token'.

2012-04-30  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/vm-engine.c
		libguile/vm-i-system.c

2012-04-30  Andy Wingo  <wingo@pobox.com>

	push error handlers out of line in the vm
	* libguile/vm.c:
	  (vm_error):
	  (vm_error_bad_instruction):
	  (vm_error_unbound):
	  (vm_error_unbound_fluid):
	  (vm_error_not_a_variable):
	  (vm_error_not_a_thunk):
	  (vm_error_apply_to_non_list):
	  (vm_error_kwargs_length_not_even):
	  (vm_error_kwargs_invalid_keyword):
	  (vm_error_kwargs_unrecognized_keyword):
	  (vm_error_too_many_args):
	  (vm_error_wrong_num_args):
	  (vm_error_wrong_type_apply):
	  (vm_error_stack_overflow):
	  (vm_error_stack_underflow):
	  (vm_error_improper_list):
	  (vm_error_not_a_pair):
	  (vm_error_not_a_bytevector):
	  (vm_error_not_a_struct):
	  (vm_error_no_values):
	  (vm_error_not_enough_values):
	  (vm_error_continuation_not_rewindable):
	  (vm_error_bad_wide_string_length):
	  (vm_error_invalid_address):
	  (vm_error_object):
	  (vm_error_free_variable): New internal helpers, implementing VM error
	  handling.

	* libguile/vm-engine.h (VM_ASSERT): New helper macro.
	  (ASSERT, CHECK_OBJECT, CHECK_FREE_VARIABLE):
	  (PRE_CHECK_UNDERFLOW, PUSH_LIST): Use the new helper.

	* libguile/vm-i-loader.c:
	* libguile/vm-i-scheme.c:
	* libguile/vm-i-system.c: Use VM_ASSERT and the out-of-line error
	  handlers.

	* libguile/vm-engine.c (vm_engine): Remove inline error handlers, and
	  remove a couple of local vars.  Use VM_ASSERT.  Have halt handle the
	  return itself.

2012-04-30  Andy Wingo  <wingo@pobox.com>

	add internal SCM_NOINLINE definition
	* libguile/_scm.h (SCM_NOINLINE): New internal define, for things that
	  we definitely don't want the compiler to inline.

	add scm_c_values helper
	* libguile/values.h:
	* libguile/values.c (scm_c_values): New public helper.

	fix peval test for recent merge
	* test-suite/tests/peval.test: Fix test for master.

2012-04-26  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		test-suite/tests/cse.test

	Merge commit 'f66cbb99ee096186837536885d3436bb334df34d'

	Merge commit '1cd63115be7a25d0ea18aaa0e1eff5658d8db77a'
	Conflicts:
		module/language/tree-il/peval.scm
		test-suite/tests/peval.test

	Merge commit 'de1eb420a5a95b17e85b19c4d98c869036e9ecb0'
	Conflicts:
		module/language/tree-il/primitives.scm
		test-suite/tests/tree-il.test

	Merge commit 'd10f7b572c0ca1ccef87f9c46069daa30946e0cf'
	Conflicts:
		libguile/smob.c
		libguile/smob.h
		test-suite/tests/tree-il.test

2012-04-24  Noah Lavine  <noah.b.lavine@gmail.com>

	Clean up stack tests
	* test-suite/tests/eval.test: remove duplicate code.

	make-stack handles prompt tags better
	* libguile/stacks.c: update make-stack and narrow_stack to handle
	  prompt tags that are not symbols.
	* test-suite/tests/eval.test: add tests for trimming a stack with
	  a prompt tag.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	vlist performance improvements; allocate vhash data inline
	* module/ice-9/vlist.scm (make-block): If we are making a hash table,
	  allocate it inline with the contents.  Otherwise don't even add a
	  pointer to the block.
	  (block-hash-table?): New internal accessor.
	  (block-ref*): Remove.  Vhash entries are no longer wrapped.
	  (block-ref):
	  (block-hash-table-next-offset):
	  (block-hash-table-set-next-offset!):
	  (block-hash-table-ref):
	  (block-hash-table-set!):
	  (block-hash-table-add!): Adapt to take content vector explicitly, and
	  to expect the hash table inline with the contents.  Some of these
	  accessors are new.  Adapt callers.
	  (assert-vlist): New helper.
	  (vlist-cons): Update comment.
	  (vhash?): Update scheme to allocate the hash table and chain links
	  inline with the contents.
	  (%vhash-fold*, %vhash-assoc): Rewrite to be more performant.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	avoid emitting degenerate aliases in peval
	* module/language/tree-il/peval.scm (<operand>, make-operand)
	  (make-bound-operands, peval): Avoid emitting needless aliases in
	  degenerate cases of let.
	  (visit-operand): If we visit an operand with a fresh counter and have
	  to abort, record that fact.

	* test-suite/tests/peval.test ("partial evaluation"): Add a test.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	vlist-cons micro-optimizations
	* module/ice-9/vlist.scm (set-block-next-free!): Define this instead of
	  increment-block-next-free!.
	  (block-append!): Refactor to take an offset, and only append if the
	  offset is the next free value, and there is space in the block.
	  (block-cons): Refactor to not be a loop.  The partial evaluator would
	  have to understand effects analysis in order to be able to unroll it,
	  and there's at most one recursion.

	  Recovers the performance loss resulting from the previous commit.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	slight vlist refactor
	* module/ice-9/vlist.scm: Use define-inlinable instead of define-inline,
	  to ensure strict argument evaluation.  There is a slight performance
	  penalty, but I hope subsequent hacks make it up.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	new pass: cse
	* module/language/tree-il/cse.scm: New pass, some simple common
	  subexpression elimination with effects analysis.

	* test-suite/tests/cse.test: New test.

	* test-suite/Makefile.am:
	* module/Makefile.am: Adapt.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	minor tweaks to a peval test
	* test-suite/tests/peval.test: Update mutable var test to really ensure
	  that the function can't inline.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	fix replacement of CSE with lexical-ref
	* module/language/tree-il/cse.scm (cse): Fix dominator unrolling for
	  lexical propagation.

	* test-suite/tests/cse.test ("cse"): Add test.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	peval uses effects analysis
	* module/language/tree-il/peval.scm: Use effects analysis from (language
	  tree-il effects) instead of our own constant-expression?.  Eagerly
	  mark assigned lexicals as non-copyable.

	cse hashing tweak
	* module/language/tree-il/cse.scm (cse): Minor tweak to hash depth based
	  on time profile of compiling peval.scm.

	more inlining in effects.scm
	* module/language/tree-il/effects.scm (define-effects)
	  (&no-effects, &all-effects-but-bailout):
	  (cause, &depends-on, &causes, depends-on-effects?)
	  (causes-effects?, effects-commute?): Add ham-fisted inlining.

	better primitives support for bit operations
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Add lognot.
	  (*effect-free-primitives*): Add ash, logand, logior, logxor, and
	  lognot.
	  (logior, logand): Define associative expanders.

	disable optimizations in goops dispatch procedures
	* module/oop/goops/dispatch.scm: Disable peval and cse.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	enable cse
	* module/language/tree-il/optimize.scm: Enable CSE unless #:cse? #f is
	  passed.

	* test-suite/tests/tree-il.test: Disable CSE for one test.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	add effects
	* module/language/tree-il/effects.scm: New module, for effects
	  analysis.
	* module/Makefile.am: Adapt.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	peval tests into separate file
	* test-suite/tests/tree-il.test ("partial evaluation"):
	* test-suite/tests/peval.test ("partial evaluation"): Separate peval
	* tests.

	* test-suite/Makefile.am: Adapt.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	add more primitives and predicates to (language tree-il primitives)
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Add number? and char?.  Add more
	  numeric predicates.  Add character comparators.  Add throw, error, and
	  scm-error.
	  (*primitive-accessors*): Remove struct-vtable.  Though the vtable's
	  contents may change (through redefinition), its identity does not
	  change.
	  (*effect-free-primitives*): Put struct-vtable, number?, and char?
	  here.
	  (*multiply-valued-primitives*): Instead of listing singly-valued
	  primitives, list multiply-valued primitives.
	  (*bailout-primitives*): New list.
	  (*negatable-primitives*): New alist.
	  (*bailout-primitive-table*, *multiply-valued-primitive-table*)
	  (*negatable-primitive-table*): New tables.
	  (singly-valued-primitive?): Adapt to
	  use *multiply-valued-primitive-table*.
	  (bailout-primitive?, negate-primitive): New exported procedures.

2012-04-23  Andy Wingo  <wingo@pobox.com>

	move (test-suite lib) to lower dir; cleans up uninstalled paths.
	* check-guile.in:
	* test-suite/Makefile.am:
	* test-suite/test-suite/lib.scm:

	* benchmark-guile.in:
	* benchmark-suite/Makefile.am:
	* benchmark-suite/benchmark-suite/lib.scm: Lower the lib modules in the
	  source tree.  This lets us remove top_srcdir and top_builddir from the
	  uninstalled paths.

	* test-suite/tests/asm-to-bytecode.test:
	* test-suite/tests/brainfuck.test:
	* test-suite/tests/compiler.test:
	* test-suite/tests/ftw.test:
	* test-suite/tests/gc.test:
	* test-suite/tests/match.test:
	* test-suite/tests/rnrs-libraries.test:
	* test-suite/tests/rnrs-test-a.scm:
	* test-suite/tests/sxml.match.test: Adapt to not expect that module
	  names be prefixed with "test-suite".

2012-04-23  Andy Wingo  <wingo@pobox.com>

	modernize (benchmark-suite lib)
	* benchmark-suite/benchmark-suite/lib.scm: Rewrite to be more modern,
	  using parameters, records, and higher precision timers.  Since this
	  file was never installed, this is an acceptable interface change.
	  (run-benchmark): Run the thunk once before going into the benchmark.
	  Adapt to new `report' interface.
	  (report): Change to expect only one argument, a <benchmark-result>
	  object.
	  (print-result): Adapt.  The result is in the same format as before.
	  (print-user-result): Adapt.  The result is different from before, but
	  as this is just printed on stdout and not logged, there should be no
	  problem.
	  (calibrate-benchmark-framework): Pull initialization into a function.

	avoid inexact iteration count in benchmarks
	* benchmark-suite/benchmarks/arithmetic.bm:
	* benchmark-suite/benchmarks/r6rs-arithmetic.bm: Use #e1e7 for the
	  iteration count, instead of the flonum 1e7.

2012-04-22  Ludovic Courtès  <ludo@gnu.org>

	Thank Klaus.

2012-04-22  Ludovic Courtès  <ludo@gnu.org>

	bytevectors: Fix IEEE-754 endianness conversion.
	Fixes <http://bugs.gnu.org/11310>.
	Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>.

	* libguile/ieee-754.h: Remove.
	* libguile/Makefile.am (noinst_HEADERS): Remove `ieee-754.h'.

	* libguile/bytevectors.c (scm_ieee754_float, scm_ieee754_double): New
	  unions.
	  (float_to_foreign_endianness, float_from_foreign_endianness,
	  double_to_foreign_endianness, double_from_foreign_endianness): Rewrite
	  in terms of the new unions.

	* test-suite/tests/bytevectors.test ("2.8 Operations on IEEE-754
	  Representations")["single, little endian", "single, big endian",
	  "double, little endian", "double, big endian"]: New tests.

2012-04-22  Ludovic Courtès  <ludo@gnu.org>

	Fix and clarify documentation of `sorted?'.
	Fixed <http://bugs.gnu.org/11262>.
	Reported by Alexei Matveev <alexei.matveev@gmail.com>.

	* libguile/sort.c (scm_sorted_p): Fix and clarify docstring.
	* doc/ref/api-utility.texi (Sorting): Update accordingly.

2012-04-22  Ludovic Courtès  <ludo@gnu.org>

	Remove duplicate test in `tree-il.test'.
	* test-suite/tests/tree-il.test ("partial evaluation"): Remove duplicate
	  test for `(cons 0 (cons 1 (cons 2 (list 3 4 5))))'.

2012-04-12  Ludovic Courtès  <ludo@gnu.org>

	Avoid use of `GC_PTR' in "smob.h".
	Commit c46fee438cf9f4a3449e8d04e7a54805517fd092 removed the "bdw-gc.h"
	include from "smob.h", so better avoid `GC_PTR'.

	* libguile/smob.c (scm_i_finalize_smob): Use `void *' instead of `GC_PTR'.
	* libguile/smob.h (scm_i_finalize_smob): Update declaration accordingly.

2012-04-10  Ludovic Courtès  <ludo@gnu.org>

	SRFI-9: Set the `record-constructor' slot of the RTD.
	Fixed <http://bugs.gnu.org/11196>.
	Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>.

	* module/srfi/srfi-9.scm (define-record-type): Define the contructor
	  before TYPE-NAME.  Set RTD's constructor field.

	* test-suite/tests/srfi-9.test ("record compatibility"): New test
	  prefix.

2012-04-05  Mark H Weaver  <mhw@netris.org>

	Fix scm_to_utf8_stringn once and for all; optimize; add tests
	* libguile/strings.c (scm_to_utf8_stringn): Fix another new bug in this
	  recent comedy of errors: pass the size of the preallocated buffer to
	  u32_to_u8.  Arrange to call 'scm_i_string_wide_chars' and
	  'scm_i_string_length' only once each.  Rename local variables for
	  improved code clarity.

	* test-suite/standalone/test-conversion.c (test_to_utf8_stringn): New
	  function to test scm_to_utf8_stringn.

2012-04-03  Mark H Weaver  <mhw@netris.org>

	Fix scm_to_utf8_stringn to NUL-terminate properly
	* libguile/strings.c (scm_to_utf8_stringn): NUL-terminate using the
	  correct pointer.

2012-04-03  Mark H Weaver  <mhw@netris.org>

	Fix scm_to_utf8_stringn to return the length in bytes, et al
	* libguile/strings.c (u32_u8_length_in_bytes): Internal static function
	  renamed from u32_u8_strlen, whose name was potentially confusing.  For
	  added safety, handle everything that can be encoded in the more
	  general UTF-8 encoding: up to six bytes for each code point, with code
	  points up to 2^31-1.

	  (scm_to_utf8_stringn): NUL-terminate only if (lenp == NULL).
	  If (lenp != NULL) return the length in bytes in *lenp.

2012-04-01  Andy Wingo  <wingo@pobox.com>

	fix scm_to_utf8_stringn for wide strings to NUL-append the strings
	* libguile/strings.c (u32_u8_strlen, scm_to_utf8_stringn): Sigh, fix the
	  u32-to-u8 optimization to ensure that the utf8 string is
	  NUL-terminated.

2012-04-01  BT Templeton  <bpt@hcoop.net>

	length's argument is a sequence
	* module/language/elisp/boot.el (length): Use `length' if the argument
	  is a list or `generalized-vector-length' otherwise.

2012-03-26  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/procprop.c
		libguile/smob.c
		libguile/smob.h
		libguile/vm.c
		module/language/tree-il/primitives.scm

2012-03-24  BT Templeton  <bpt@hcoop.net>

	primitive resolution for public refs
	* module/language/tree-il/primitives.scm (resolve-primitives!): Resolve
	  public module-refs to primitives.

	* test-suite/tests/tree-il.test: New tests for primitive resolution.

2012-03-22  Andy Wingo  <wingo@pobox.com>

	add bad-request printer
	* module/web/request.scm (bad-request-printer): Add printer for these
	  exceptions.

	add exception printers for bad-header, bad-header-component
	* module/web/http.scm (bad-header-component): Throw
	  'bad-header-component instead of 'bad-header.
	  (bad-header-printer, bad-header-component-printer): Add exception
	  printers.

2012-03-22  Andy Wingo  <wingo@pobox.com>

	micro-optimizations to string-trim-both, and to (web http)
	* libguile/srfi-13.c (scm_string_trim, scm_string_trim_right)
	  (scm_string_trim_both): Take the whitespace fast-path if the char_pred
	  is scm_char_set_whitespace.

	* module/web/http.scm (read-header, split-and-trim, parse-quality-list):
	  (parse-param-component, parse-credentials, "Content-Type"):
	  (read-request-line, read-response-line): Use char-set:whitespace
	  instead of char-whitespace?.  It avoids recursing into the VM.

2012-03-18  Andy Wingo  <wingo@pobox.com>

	make applicable smob calls cheaper, and fix a memory leak
	* libguile/vm.c (prepare_smob_call): New helper.  Now, instead of making
	  a per-smob trampoline, we will shuffle the smob into the args and use
	  a gsubr.  This prevents a memory leak in which the trampolines, which
	  were values in a weak-key table, were preventing the smobs from being
	  collected.

	* libguile/vm-i-system.c (call, tail-call, mv-call): Adapt to new smob
	  application mechanism.
	  (smob-call): Remove this instruction.

	* libguile/smob.h (scm_smob_descriptor): Rename apply_trampoline_objcode
	  to apply_trampoline.

	* libguile/smob.c: Remove our own objcode trampolines in favor of using
	  scm_c_make_gsubr.
	  (scm_smob_prehistory): No more trampoline weak map.

	* libguile/procprop.c (scm_i_procedure_arity): Adapt to applicable smob
	  representation change.

2012-03-18  Andy Wingo  <wingo@pobox.com>

	fix to procedure-arity in previous patch
	* libguile/procprop.c (scm_i_procedure_arity): Fix infinite loop.

2012-03-18  Andy Wingo  <wingo@pobox.com>

	make applicable smob calls cheaper, and fix a memory leak
	* libguile/vm.c (prepare_smob_call): New helper.  Now, instead of making
	  a per-smob trampoline, we will shuffle the smob into the args and use
	  a gsubr.  This prevents a memory leak in which the trampolines, which
	  were values in a weak-key table, were preventing the smobs from being
	  collected.

	* libguile/vm-i-system.c (call, tail-call, mv-call): Adapt to new smob
	  application mechanism.
	  (smob-call): Remove this instruction.

	* libguile/smob.h (scm_smob_descriptor): Rename apply_trampoline_objcode
	  to apply_trampoline.

	* libguile/smob.c: Remove our own objcode trampolines in favor of using
	  scm_c_make_gsubr.
	  (scm_smob_prehistory): No more trampoline weak map.

	* libguile/procprop.c (scm_i_procedure_arity): Adapt to applicable smob
	  representation change.

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

	Merge remote-tracking branch 'origin/stable-2.0'

	Merge branch 'master' of git.sv.gnu.org:/srv/git/guile

	web http: fix Ma -> Mar
	* module/web/http.scm (write-date): Fix serialization of Mar.  Oops.

2012-03-11  Andy Wingo  <wingo@pobox.com>

	fix bad-request-printer
	* module/web/request.scm (bad-request-printer): Fix printer to expect
	  args as a list.

	Merge remote-tracking branch 'local-2.0/stable-2.0'
	Conflicts:
		configure.ac

	add bad-request printer
	* module/web/request.scm (bad-request-printer): Add printer for these
	  exceptions.

	web server http: 400 Bad Request on bad requests
	* module/web/server/http.scm (bad-request, http-read): If an exception
	  is raised while reading a response, write out a 400 Bad Request
	  response before closing the port.

	add exception printers for bad-header, bad-header-component
	* module/web/http.scm (bad-header-component): Throw
	  'bad-header-component instead of 'bad-header.
	  (bad-header-printer, bad-header-component-printer): Add exception
	  printers.

2012-03-08  Andy Wingo  <wingo@pobox.com>

	more libgc 7.1 compat
	* configure.ac:
	* libguile/gc.c (GC_set_finalize_on_demand): Check for this function,
	  and shim if it isn't present.

2012-03-08  BT Templeton  <bpt@hcoop.net>

	elisp rng
	* module/language/elisp/boot.el (random): New function.

	elisp i/o
	* module/language/elisp/boot.el (send-string-to-terminal)
	  (read-from-minibuffer, prin1-to-string): New functions.

	elisp: symbol-name, intern
	* module/language/elisp/boot.el (symbol-name, intern): New functions.

	elisp: when, unless
	* module/language/elisp/boot.el (when, unless): New macros.

	elisp sequence functions
	* module/language/elisp/boot.el (nreverse, assoc, assq, rplaca, rplacd)
	  (caar, cadr, cdar, cddr, dolist, stringp, string-equal, string=)
	  (substring, upcase, downcase, string-match, make-vector, mapc, aref)
	  (aset, concat): New functions.

	integerp, wholenump return nil for non-numbers
	* module/language/elisp/boot.el (integerp, wholenump): Call `integer?'
	  before `exact?' so that these predicates return nil for non-numbers
	  instead of signalling an error.

2012-03-08  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'local-2.0/stable-2.0'
	Conflicts:
		configure.ac
		libguile/finalizers.c
		libguile/finalizers.h
		libguile/gc.c
		libguile/gc.h
		libguile/inline.c
		libguile/inline.h
		libguile/ports.c
		libguile/smob.c
		libguile/smob.h
		module/ice-9/deprecated.scm
		module/ice-9/r4rs.scm

2012-03-08  Andy Wingo  <wingo@pobox.com>

	run finalizers asynchronously in asyncs
	* libguile/finalizers.c: New excitement!  We'll be running finalizers
	  asynchronously, from asyncs.  This will make it safer to allocate
	  while holding a mutex.
	  (GC_set_finalizer_notifier): Add back-compat shim.

	* libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism
	  during boot.

	* libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing
	  on demand.
	  (scm_gc): Explicitly run finalizers here.

	* libguile/threads.c (guilify_self_2): Run finalizers here if
	  queue_finalizer_async happened to run during guilify_self_1.

	* configure.ac: Add check for GC_set_finalizer_notifier.

2012-03-08  Andy Wingo  <wingo@pobox.com>

	use the new finalizer helpers
	* libguile/foreign.c (scm_set_pointer_finalizer_x)
	* libguile/ports.c (finalize_port)
	* libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob)
	* libguile/struct.c (scm_i_alloc_struct)
	* libguile/numbers.c (make_bignum): Use the new API.

2012-03-08  Andy Wingo  <wingo@pobox.com>

	add scm_i_set_finalizer, scm_i_add_finalizer, scm_i_add_resuscitator
	* libguile/finalizers.h:
	* libguile/finalizers.c: New files.

	* libguile.h:
	* libguile/Makefile.am: Add to build.

2012-03-08  Andy Wingo  <wingo@pobox.com>

	scm_new_smob, scm_new_double_smob inline functions
	* libguile/smob.h (scm_new_smob, scm_new_double_smob): New constructors,
	  which do what SCM_NEWSMOB / SCM_NEWSMOB3 had done, but with inline
	  functions instead of macros.  They also bail to scm_i_new_smob /
	  scm_i_new_double_smob in either the mark or the free case, so that the
	  inline definition doesn't reference other internal details like libgc
	  stuff.
	  (SCM_SMOB_TYPE_MASK et al): Move definitions up so the new_smob see
	  them as already being declared.
	  (SCM_NEWSMOB, SCM_RETURN_NEWSMOB, SCM_NEWSMOB2, SCM_RETURN_NEWSMOB2):
	  (SCM_NEWSMOB3, SCM_RETURN_NEWSMOB3): Reimplement in terms of the new
	  inline functions.

	  Remove now-unneeded bdw-gc include.

	* libguile/smob.c (finalize_smob): Rename from scm_i_finalize_smob, and
	  make static.
	  (scm_i_new_smob, scm_i_new_double_smob): Slow-path allocators.
	  (scm_i_finalize_smob, scm_i_new_smob_with_mark_proc): Add
	  back-compatibility shims to preserve ABI.

	* libguile/inline.c: Include smob.h, so as to reify scm_new_smob and
	  scm_new_double_smob.

2012-03-08  Andy Wingo  <wingo@pobox.com>

	scm_cell, scm_double_cell, scm_words back to gc.h
	* libguile/inline.h:
	* libguile/gc.h (scm_cell, scm_double_cell, scm_words): Move
	  declarations and definitions back here, from inline.h.  It's more
	  natural.

	* libguile/inline.c: Include gc.h as well.

2012-03-08  Andy Wingo  <wingo@pobox.com>

	simplify inline function infrastructure
	* libguile/__scm.h (SCM_C_EXTERN_INLINE): Move this definition here,
	  from inline.h.  We'd like to support inline function definitions in
	  more header files: not just inline.h.
	  (SCM_CAN_INLINE, SCM_INLINE, SCM_INLINE_IMPLEMENTATION): New
	  definitions.

	* libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Define these
	  wrappers, which redirect to the GC_MALLOC macros when building Guile,
	  and the scm_gc_malloc functions otherwise.  A step towards getting
	  BDW-GC out of Guile's API.

	* libguile/inline.h: Simplify, using SCM_INLINE,
	  SCM_INLINE_IMPLEMENTATION, and SCM_IMPLEMENT_INLINES.  Also use the
	  new SCM_GC_MALLOC macros.

2012-03-08  Ian Price  <ianprice90@googlemail.com>

	Fix flush on soft ports, so that it actually runs.
	* libguile/vports.c (sf_flush): Remove conditional testing the
	  position in the port's write_buf, as it is no longer used.

2012-03-07  Ludovic Courtès  <ludo@gnu.org>

	Change `scm_words' to accept a 32-bit word number.
	Fixes <http://bugs.gnu.org/10914>.
	Reported by Tobias Brandt <tob.brandt@googlemail.com>.

	* libguile/gc.h (scm_words): Change `n_words' to be `scm_t_uint32'.
	* libguile/inline.h: Update extraneous declaration.

2012-03-07  Ludovic Courtès  <ludo@gnu.org>

	Improve port benchmark.
	* benchmark-suite/benchmarks/ports.bm (sequence): New macro, formerly
	  local to the "rdelim" benchmark prefix.
	  (large-string): New procedure.
	  (%latin1-port, %utf8/ascii-port, %utf8/wide-port): Use it.
	  ("peek-char", "char-ready?", "read-char"): Use `sequence'.

2012-03-07  Giuseppe Scrivano  <giuseppe@southpole.se>

	Fix a segfault when /dev/urandom is not accessible
	* libguile/init.c (scm_i_init_guile): Call `scm_init_random' before
	`scm_init_macros'.

2012-03-07  Andy Wingo  <wingo@pobox.com>

	faster (make-prompt-tag); default-prompt-tag is a parameter
	* module/ice-9/boot-9.scm (default-prompt-tag): Once parameters have
	  booted, redefine as a parameter.
	  (make-prompt-tag): Change from a gensym to a list.  Thanks to Mark
	  Weaver for the suggestion.

	* doc/ref/api-control.texi (Prompt Primitives): Update docs.

2012-03-07  Andy Wingo  <wingo@pobox.com>

	call-with-{input,output}-string implemented in scheme
	* module/ice-9/boot-9.scm (call-with-input-string)
	  (call-with-output-string): Implement in Scheme.

	* libguile/strports.c (scm_call_with_output_string):
	  (scm_call_with_input_string): Dispatch to Scheme.

2012-03-07  Andy Wingo  <wingo@pobox.com>

	micro-optimizations to string-trim-both, and to (web http)
	* libguile/srfi-13.c (scm_string_trim, scm_string_trim_right)
	  (scm_string_trim_both): Take the whitespace fast-path if the char_pred
	  is scm_char_set_whitespace.

	* module/web/http.scm (read-header, split-and-trim, parse-quality-list):
	  (parse-param-component, parse-credentials, "Content-Type"):
	  (read-request-line, read-response-line): Use char-set:whitespace
	  instead of char-whitespace?.  It avoids recursing into the VM.

2012-03-07  Andy Wingo  <wingo@pobox.com>

	names of encodings are ascii
	* libguile/ports.c (scm_mode_bits): Parse the mode bits as latin1.
	  (scm_i_set_default_port_encoding, open_iconv_descriptors)
	  (scm_port_encoding, scm_set_port_encoding_x): Restrict the names of
	  encodings to ASCII.

2012-03-07  Andy Wingo  <wingo@pobox.com>

	dynstack: pushing a prompt no longer allocates memory
	* libguile/control.h: Remove scm_t_prompt_registers and
	  scm_c_make_prompt_registers.
	  (scm_c_abort): Take a pointer to a jmpbuf instead of a cookie.  It
	  will serve the same purpose.
	* libguile/control.c (reify_partial_continuation, scm_at_abort): Adapt
	  to new prompt representation.

	* libguile/dynstack.h:
	* libguile/dynstack.c (scm_dynstack_push_prompt): Prompts now have 5
	  words instead of 2, as they now push the fp, sp, ip, and jmpbuf on the
	  stack separately.  This avoids allocation.
	  (scm_dynstack_find_prompt): Likewise, add return values for fp, sp,
	  etc.
	  (scm_dynstack_wind_prompt): Replaces scm_dynstack_relocate_prompt.

	* libguile/eval.c (eval):
	* libguile/stacks.c (find_prompt):
	* libguile/throw.c (pre_init_catch): Adapt to the new prompt mechanism.

	* libguile/vm-engine.c (vm_engine): Setjmp an on-stack jmpbuf every time
	  the VM enters.  We can then re-use that jmpbuf for all prompts in that
	  invocation.

	* libguile/vm-i-system.c (partial_cont_call): Adapt to change in prompt
	  representation.  We don't need to wind here any more, since we pass in
	  the prompt's jmpbuf.
	  (prompt): Adapt to scm_dynstack_push_prompt change.
	  (abort): Adapt to vm_abort change.

	* libguile/vm.h (struct scm_vm): No more cookie.

	* libguile/vm.c (vm_abort): Adapt to scm_c_abort change.
	  (vm_reinstate_partial_continuation): Rewind the dynamic stack here,
	  now that we do have a valid jmpbuf.
	  (make_vm): No need to initialize a cookie.

2012-03-06  Andy Wingo  <wingo@pobox.com>

	micro-optimization in (web server)
	* module/web/server.scm (extend-response): Micro-optimize to not mutate
	  data, and to copy as little as possible.

	ports.c: inline get_codepoint
	* libguile/ports.c (get_codepoint): Add inline keyword.  It showed up
	  high in benchmarks, and it's static, so it's probably important to
	  inline.

2012-03-06  Andy Wingo  <wingo@pobox.com>

	optimize symbol printing
	* libguile/print.h: Remove internal declaration of
	  scm_i_print_symbol_name.

	* libguile/print.c (symbol_has_extended_read_syntax): Optimize to avoid
	  calling symbol_to_string if we know the symbol cannot be mistaken for
	  a number.
	  (print_normal_symbol): Optimize to call display_string directly,
	  instead of jumping through scm_display.
	  (print_symbol): Rename from scm_i_print_symbol_name.
	  (scm_print_symbol_name, iprin1): Adapt to print_symbol name change.

2012-03-06  Andy Wingo  <wingo@pobox.com>

	shuffle r4rs procedures into boot-9
	* module/ice-9/boot-9.scm: Refine a comment about low-level port
	  functions.  Move call-with-foo-port, with-input-from-foo, etc later in
	  the file, and define using `parameterize' instead of `dynamic-wind'.
	  Somewhat cleaner, and avoids thunk? checks for "swaports" in the old
	  implementation.

	load parameters earlier in boot-9
	* module/ice-9/boot-9.scm: Move parameters earlier in the boot process.
	  The new with-output-to-port code will use it.

	slight tweak to file-exists?, file-is-directory?
	* module/ice-9/boot-9.scm (file-exists?, file-is-directory?): For the
	  fallback cases, use open-input-file instead of open-file with
	  OPEN_READ.

	bootstrapping shenanigans in `warn'
	* module/ice-9/boot-9.scm (warn): Don't use with-output-to-port, as
	  we'll move that definition after the psyntax boot.

	more clear comments in boot-9.scm
	* module/ice-9/boot-9.scm: Update comment header for language
	  primitives.

	remove deprecated close-io-port
	* module/ice-9/boot-9.scm (close-io-port): Remove proc that was
	  deprecated in 2.0.

2012-03-06  Andy Wingo  <wingo@pobox.com>

	inline ice-9/r4rs.scm into ice-9/boot-9.scm
	* module/ice-9/boot-9.scm: Inline r4rs.scm, in anticipation of more
	  refactorings.

	* module/ice-9/r4rs.scm: Remove.
	* module/Makefile.am: Update.

2012-03-06  BT Templeton  <bpt@hcoop.net>

	use #nil as default for elisp rest parameters
	* module/langauge/elisp/compile-tree-il.scm (compile-lambda): Bind the
	  rest parameter to `#nil' instead of `()' by default.

2012-03-05  Andy Wingo  <wingo@pobox.com>

	deprecate close-io-port
	* module/ice-9/r4rs.scm:
	* module/ice-9/deprecated.scm (close-io-port): Deprecate.

2012-03-05  BT Templeton  <bpt@hcoop.net>

	Merge branch 'bt/elisp'
	Conflicts:
		am/guilec
		libguile/_scm.h
		libguile/vm-i-scheme.c
		module/language/elisp/compile-tree-il.scm
		module/language/elisp/runtime.scm
		module/language/elisp/runtime/macros.scm
		module/language/tree-il/compile-glil.scm
		module/language/tree-il/primitives.scm

2012-03-05  Mark H Weaver  <mhw@netris.org>

	Don't call SYMBOL_STRINGBUF on a string
	* libguile/strings.c (scm_i_make_symbol): Use STRING_STRINGBUF
	  instead of SYMBOL_STRINGBUF to get the stringbuf of a string.

	Remove documentation of internal static string comparison functions
	* doc/ref/api-data.texi (String Comparison): Remove documentation for
	  scm_i_string{,_ci}_{equal,less,leq,gr,geq}_p, which are not only
	  internal functions but static, and thus unusable by external code.

2012-03-04  Mark H Weaver  <mhw@netris.org>

	Comment out unused definitions of 'do' and 'case' in psyntax.scm
	* module/ice-9/psyntax.scm (do, case): Comment out these definitions,
	  which are never used and immediately replaced by definitions in
	  boot-9.scm.

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

2012-03-04  Mark H Weaver  <mhw@netris.org>

	Fix syntax wrap comments; remove old unused cruft
	* module/ice-9/psyntax.scm (subst-rename?, rename-old, rename-new,
	  rename-marks, make-rename): Remove these unused syntax rules.
	  Fix description of syntax wraps to match current reality.

	Merge branch 'stable-2.0'
	Conflicts:
		module/ice-9/psyntax-pp.scm
		module/language/tree-il.scm

2012-03-04  Mark H Weaver  <mhw@netris.org>

	Minimize size of embedded syntax objects in psyntax-pp.scm
	* module/ice-9/compile-psyntax.scm: Minimize syntax object literals
	  embedded in psyntax-pp.scm.

	* module/ice-9/psyntax.scm: Rename a few variables so that syntax
	  objects embedded in macros have no lexical bindings, so that their
	  minimized syntax objects will have no embedded labels.  These labels
	  were the last remaining gensym counters in psyntax-pp.scm.

	* module/ice-9/psyntax-pp.scm: Regenerate.  It is now less than one
	  quarter of its previous size!  More importantly, this file no longer
	  contains any gensym counters, which means that in the future, local
	  changes to psyntax.scm will usually result in only local changes to
	  psyntax-pp.scm.

2012-03-04  Mark H Weaver  <mhw@netris.org>

	tree-il->scheme improvements
	* module/language/tree-il.scm (tree-il->scheme): New implementation that
	  simply calls 'decompile-tree-il'.

	* module/language/scheme/decompile-tree-il.scm (choose-output-names,
	  do-decompile): New internal procedures.

	  (decompile-tree-il): New and improved implementation.  Print source
	  identifiers where possible, otherwise add minimal numeric suffixes.
	  Previously we printed the gensyms.  Avoid 'begin' in contexts that
	  provide an implicit 'begin'.  Produce 'cond', 'case', 'and', 'or',
	  'let*', named let, and internal defines where appropriate.  Recognize
	  keyword arguments in 'opts' to disable the production of these derived
	  syntactic forms, and to optionally strip numeric suffixes from
	  variable names.

	* module/ice-9/compile-psyntax.scm: Disable partial evaluation, letrec
	  fixing, and primitive expansion when producing psyntax-pp.scm, in
	  order to produce output as close to the original source as practical.
	  Disable production of derived syntactic forms as needed during
	  bootstrap.  Strip numeric suffixes from variable names.  Adjust
	  pretty-printing parameters.

	* module/ice-9/psyntax-pp.scm: Regenerate.  It is now less than half
	  of the original size.

2012-03-03  Andy Wingo  <wingo@pobox.com>

	optimize dynamic-wind when we know winders are thunks
	* libguile/vm-i-system.c (wind):
	* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
	  Instead of making `wind' call `scm_thunk_p' on the winder and unwinder
	  at runtime, make it the responsibility of the compiler to emit code to
	  call thunk? and error, but only if the compiler cannot prove them to
	  be thunks.

	* libguile/vm-engine.c (vm_engine): Remove a now-unused error block.

2012-03-03  Andy Wingo  <wingo@pobox.com>

	remove out-of-date comment
	* libguile/dynwind.c (scm_dynwind_end): Remove out-of-date comment.

2012-03-03  Andy Wingo  <wingo@pobox.com>

	the dynamic stack is really a stack now, instead of a list
	* libguile/dynstack.h:
	* libguile/dynstack.c: New files, implementing the dynamic stack as a
	  true stack instead of a linked list.  This lowers the cost of
	  dynwinds: frames, winders, prompts, with-fluids, and dynamic-wind.
	  For the most part, we allocate these items directly on the stack.

	* libguile/dynwinds.h:
	* libguile/dynwinds.c: Adapt all manipulators of the wind stack to use
	  interfaces from dynstack.c.  Remove heap-allocated winder and frame
	  object types.
	  (scm_dowinds, scm_i_dowinds): Remove these.  The first was exported,
	  but it was not a public interface.

	* libguile/continuations.c:
	* libguile/continuations.h (scm_t_contregs): Continuation objects
	  reference scm_t_dynstack* values now.  Adapt to the new interfaces.

	* libguile/control.c:
	* libguile/control.h: There is no longer a scm_tc7_prompt kind of object
	  that can be allocated on the heap.  Instead, the prompt flags, key,
	  and registers are pushed on the dynwind stack.  (The registers are
	  still on the heap.)  Also, since the vm_cont will reference the
	  dynwinds, make the partial continuation stub take just one extra arg,
	  instead of storing the intwinds separately in the object table.

	* libguile/fluids.c:
	* libguile/fluids.h: No more with-fluids objects; instead, the fluids go
	  on the dynstack.  The values still have to be on the heap, though.
	  (scm_prepare_fluids, scm_swap_fluids): New internal functions,
	  replacing scm_i_make_with_fluids and scm_i_swap_with_fluids.

	* libguile/print.c: Remove prompt and with-fluids printers.

	* libguile/tags.h: Revert prompt and with-fluids tc7 values to what they
	  were before they were allocated.

	* libguile/vm-i-system.c (partial_cont_call): Just pop the vmcont, the
	  intwinds will not be passed as a second arg.  Rewind the dynamic stack
	  from within the VM, so that any rewinder sees valid prompt entries.
	  (call_cc, tail_call_cc): Adapt to pass the dynstack to
	  scm_i_vm_capture_stack.
	  (prompt, wind, unwind, wind_fluids, unwind_fluids): Adapt to the new
	  interfaces.

	* libguile/vm.h (scm_i_capture_current_stack): Rename from
	  scm_i_vm_capture_continuation.
	  (scm_i_vm_capture_stack): Take a dynstack as an argument.
	* libguile/vm.c (vm_reinstate_partial_continuation): Don't wind here, as
	  that could result in winders seeing invalid prompts.

	* libguile/eval.c:
	* libguile/root.c:
	* libguile/stacks.c:
	* libguile/threads.c:
	* libguile/threads.h:
	* libguile/throw.c: Adapt other users of dynwinds to use the dynstack.

2012-03-03  Mark H Weaver  <mhw@netris.org>

	pretty-print: allow max-expr-width to be set; recognize more keywords
	* module/ice-9/pretty-print.scm (pretty-print): Add new keyword argument
	  '#:max-expr-width'.

	  (generic-write): Add new argument 'max-expr-width'.  Previously this
	  was internally defined to the constant value 50.

2012-03-03  Mark H Weaver  <mhw@netris.org>

	Fix typos in psyntax.scm
	* module/ice-9/psyntax.scm (gen-syntax-case): #'pad --> #'pat
	  (define*): #'x --> #'id

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

2012-03-02  Andy Wingo  <wingo@pobox.com>

	comment formatting in ports.c
	* libguile/ports.c: Fix comment.

2012-03-02  Andy Wingo  <wingo@pobox.com>

	hash-set! on weak tables returns the value
	* libguile/weak-table.h:
	* libguile/weak-table.c (scm_weak_table_putq_x)
	  (scm_weak_table_remq_x, scm_weak_table_clear_x)
	  (scm_weak_table_for_each): Declare these as returning void instead of
	  SCM.
	* libguile/hashtab.c (scm_hashq_set_x, scm_hashq_remove_x)
	  (scm_hashv_set_x, scm_hashv_remove_x)
	  (scm_hash_set_x, scm_hash_remove_x)
	  (scm_hashx_set_x, scm_hashx_remove_x):
	  (scm_hash_for_each): For weak tables, have the set! functions return
	  the values, as they used to do.  Have remove! functions return #f,
	  indicating the lack of a handle.  Shim around for-each to return
	  unspecified, even though that wasn't yet a problem.

	* test-suite/tests/weaks.test: Add a test.

2012-03-02  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

2012-03-02  Andy Wingo  <wingo@pobox.com>

	tweaks to -Wformat's gettext detection
	* module/language/tree-il/analyze.scm (proc-ref?): Change to use less
	  false-if-exception and more variable-bound?.  If a variable is present
	  in the local module but not bound, assume that it is gettext if it has
	  the right name.  This is to allow for (define _ gettext).

	* test-suite/tests/tree-il.test ("warnings"): Update (_ "foo") example.

2012-03-02  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	There are a some failures currently:

	    FAIL: tree-il.test: warnings: format: non-literal format string with forward declaration
	    ERROR: srfi-18.test: current-exception-handler: current handler returned at top level - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>)))
	    ERROR: srfi-18.test: current-exception-handler: multiple levels of handler nesting - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>)))
	    ERROR: srfi-18.test: current-exception-handler: exception handler installation is thread-safe - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>)))

	Conflicts:
		module/language/tree-il/peval.scm
		module/language/tree-il/primitives.scm
		test-suite/tests/tree-il.test

2012-03-02  Andy Wingo  <wingo@pobox.com>

	peval: inline applications of lambda to rest args
	* module/language/tree-il/peval.scm (peval): Add optimization to
	  hoist the inner procedure out of e.g.
	    (lambda args (apply (lambda ...) args))
	  This commit restores the ability to detect escape-only prompts at
	  compile-time.

	* test-suite/tests/tree-il.test: Update test for prompt with a lambda,
	  and add a specific test for lambda application.

2012-03-02  Andy Wingo  <wingo@pobox.com>

	tree-il: fix `canonicalize!' for prompts
	* module/language/tree-il/canonicalize.scm (canonicalize!): Fix a bug in
	  which the sense of `escape-only?' was reversed.  We never saw this
	  though, because for other reasons, no prompts were being identified as
	  escape-only.

	more general treatment of call-with-prompt
	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Don't limit the call-with-prompt to <prompt> transition to lambda
	  expressions.  Instead we can lexically bind the handler, and rely on
	  peval to propagate a lambda expression.

2012-03-01  Mark H Weaver  <mhw@netris.org>

	pmatch: always wrap with let, even if the expression appears atomic
	* module/system/base/pmatch.scm (pmatch): Always wrap with 'let', even
	  if the expression appears atomic, because in the presence of
	  'identifier-syntax', we cannot know what an atomic expression will
	  later expand to.  Also use '#:export-syntax' instead of '#:export'
	  to export 'pmatch'.

2012-03-01  Mark H Weaver  <mhw@netris.org>

	Fix <TAG>vector-length when applied to other uniform vector types
	* module/srfi/srfi-4.scm, module/srfi/srfi-4/gnu.scm
	  (define-bytevector-type): Fix definition of <TAG>vector-length when
	  applied to uniform vectors of different element sizes.  Thanks to
	  Tobias Brandt <tob.brandt@googlemail.com> for reporting this bug.

	* test-suite/tests/srfi-4.test: Add tests.

2012-02-27  Ludovic Courtès  <ludo@gnu.org>

	Avoid failure when `format-analysis' stumbles upon unbound variables.
	* module/language/tree-il/analyze.scm (proc-ref?): Wrap `variable-ref'
	  in `false-if-exception'.

	* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
	  format string with forward declaration"): New test.

2012-02-24  Andy Wingo  <wingo@pobox.com>

	port i/o optimizations for iso-8859-1
	* libguile/ports.h (scm_t_port_encoding_mode):
	* libguile/ports.c (scm_c_make_port_with_encoding):
	  (scm_i_set_port_encoding_x): Add special treatment for latin1
	  encoding.
	  (get_latin1_codepoint, get_codepoint): Add latin1 fast-path.

	* libguile/print.c (display_string_as_latin1): Add latin1 fastpath.

2012-02-24  Andy Wingo  <wingo@pobox.com>

	fixes to threaded finalizers
	* libguile/finalizers.c (finalization_thread_proc):
	  (run_finalization_thread):
	  (start_finalization_thread):
	  (stop_finalization_thread): Use pthreads + scm_with_guile instead of
	  scm_spawn_thread, to avoid deadlocks.

	srfi-18 test fix
	* test-suite/tests/srfi-18.test: Enclose the tests in a begin instead of
	  an and.  Before, they were not being run, for some reason I don't
	  fully understand.

	slight cleanup to run-test
	* test-suite/lib.scm (run-test): Slight cleanup.

	srfi-18 cleanup
	* module/srfi/srfi-18.scm (with-exception-handler):
	  (thread-join!, mutex-lock!, mutex-unlock!): Avoid useless invocations
	  of `apply'.

	statically initialize the pthread mutex in fat mutexen
	* libguile/threads.c (make_fat_mutex): Remove smob free function.
	  Because we use normal mutexen, we can just blit the mutex to
	  initialize it.

2012-02-24  Andy Wingo  <wingo@pobox.com>

	run finalizers asynchronously (in asyncs and/or pthreads)
	* libguile/finalizers.c: New excitement!  We'll be running finalizers in
	  threads, if that's available.  If it's not available, during early
	  boot, we can run finalizers in asyncs.  This will make it safer to
	  allocate while holding a mutex.

	* libguile/posix.c (scm_fork): Shut down the finalizer thread before
	  forking.

	* libguile/init.c (scm_i_init_guile): Init the async finalizer mechanism
	  during boot and, if available, initialialize the finalizer thread at
	  the very end.

	* libguile/gc.c (scm_storage_prehistory): Tell libgc we'll be finalizing
	  on demand.
	  (scm_gc): Explicitly run finalizers here.  If you're calling this
	  function, you probably want synchronous GC.

2012-02-24  Andy Wingo  <wingo@pobox.com>

	signal an error on multithreaded fork
	* libguile/posix.c (scm_fork): Signal an error if a `fork' is attempted
	  after threads have been spawned.

	* test-suite/tests/00-socket.test: Moved here, from socket.test, so as
	  to run before any threads are created.
	* test-suite/Makefile.am: Adapt.

2012-02-23  Andy Wingo  <wingo@pobox.com>

	remove atfork on revealed mutex in fports.c
	* libguile/fports.c: Remove atfork call.

	Revert "add pthread_atfork helpers to our threading shims"
	This reverts commit 2f745b64a1eb06e9e175a1b497d5270bebff9097.

	Revert "with a threaded guile, lock weak sets and tables during a fork"
	This reverts commit f609480611cfd1585409fd6b1b90beb730b026cf.

	Revert "install pthread_atfork handlers for guile's static mutexen"
	This reverts commit 6a97b1f93aace5c7c976aef51d36b3ae9cfd5630.

	Revert "wrap iconv_open / iconv_close with a lock to help in thread/fork issues"
	This reverts commit 8dfb7bbfd908ca883d0fdd0d868e13e6b20803ae.

	Merge remote-tracking branch 'local-2.0/stable-2.0'
	Conflicts:
		module/language/tree-il/analyze.scm

2012-02-23  Andy Wingo  <wingo@pobox.com>

	rewrite open-process in C, for robustness
	* libguile/posix.c (scm_open_process): Rewrite in C, so as to avoid
	  allocations and other calls that are not async-signal-safe.
	  (scm_init_popen, scm_init_posix): Register popen extension.

	* module/ice-9/popen.scm: Load the popen extension, to get open-process.

2012-02-22  Andy Wingo  <wingo@pobox.com>

	microoptimizations in (web uri)
	* module/web/uri.scm (valid-host?): Micro-optimizations.

	add test for recent quick fix
	* test-suite/tests/web-uri.test ("string->uri"): Add test for
	  string->uri with hosts beginning in digits.

2012-02-21  Andy Wingo  <wingo@pobox.com>

	quick fix the quick fix

	quick fix to uri parser
	* module/web/uri.scm: Quick fix to not throw an error on e.g.
	  http://2012.jsconf.us.

2012-02-20  Noah Lavine  <noah.b.lavine@gmail.com>

	Optimize Equality Primitives
	* module/language/tree-il/primitives.scm: add equality-primitive?,
	  which is true for eq?, eqv?, and equal?
	* module/language/tree-il/peval.scm: if an equality primitive is
	  applied to the same variable twice, fold it to #t
	* test-suite/tests/tree-il.test: add tests for pevaling equality
	  primitives

2012-02-19  Ludovic Courtès  <ludo@gnu.org>

	Have `-Wformat' recognize `ngettext' calls.
	* module/language/tree-il/analyze.scm (gettext?): Rename to...
	  (proc-ref?): ... this.  Add `proc' and `special-name' parameters.
	  (gettext?): Define in terms of `proc-ref?'.
	  (ngettext?): New procedure.
	  (const-fmt): Recognize `ngettext' calls.
	  (format-analysis)[<down>](check-format-args]: Check
	  constant-but-non-string 2nd argument in the (not (const-fmt ...))
	  case.
	  [check-simple-format-args]: Use `const-fmt'.

	* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
	  format string using ngettext", "non-literal format string using
	  ngettext as N_"): New tests.
	  ("simple-format")["unsupported, ngettext"]: New test.

2012-02-19  Ludovic Courtès  <ludo@gnu.org>

	Have `-Wformat' better recognize the `gettext' procedure.
	Fixes <http://bugs.gnu.org/10846>.
	Reported by Bruno Haible <bruno@clisp.org>.

	* module/language/tree-il/analyze.scm (gettext?): New procedure.
	  (const-fmt): Add `env' parameter; update callers.  Use `gettext?'.
	  (format-analysis)[check-simple-format-args]: Actually support
	  gettextized format strings.

	* test-suite/tests/tree-il.test ("warnings")["format"]("non-literal
	  format string using gettext"): Use `gettext' as the procedure name.
	  ("non-literal format string using gettext as _"): New test.
	  ["simple-format"]("unsupported, gettext"): New test.

2012-02-19  Andy Wingo  <wingo@pobox.com>

	use the new finalizer helpers
	* libguile/foreign.c (scm_set_pointer_finalizer_x)
	* libguile/ports.c (finalize_port, scm_c_make_port_with_encoding)
	  (open_iconv_descriptors)
	* libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob)
	* libguile/struct.c (scm_i_alloc_struct)
	* libguile/weak-set.c (weak_gc_finalizer)
	  (scm_c_register_weak_gc_callback)
	* libguile/weak-table.c (scm_c_register_weak_gc_callback)
	  (weak_gc_finalizer)
	* libguile/numbers.c (make_bignum): Use the new API.

2012-02-19  Andy Wingo  <wingo@pobox.com>

	add scm_i_set_finalizer, scm_i_add_finalizer, scm_i_add_resuscitator
	* libguile/finalizers.h:
	* libguile/finalizers.c: New files.

	* libguile.h:
	* libguile/Makefile.am: Add to build.

2012-02-19  Andy Wingo  <wingo@pobox.com>

	better hysteresis in weak-set, weak-table
	* libguile/weak-set.c:
	* libguile/weak-table.c: Attempt to avoid bouncing between sizes when
	  growing the vector causes elements to be removed from the set/table.

	tune default hash table sizes
	* libguile/modules.c: In my current image, there are 1790 bindings in
	  the root module, which tips over to the next hash vector size, so
	  declare that to prevent rehashing.
	* libguile/srcprop.c (scm_init_srcprop): Don't preallocate a big
	  source_whash table, as we might not need it (if everything is
	  compiled, for example).
	* module/ice-9/boot-9.scm (make-module): Don't preall-cate big hash
	  tables for imported bindings.  Instead trust that resizing works
	  correctly.

2012-02-19  Andy Wingo  <wingo@pobox.com>

	move revealed-count mechanism to fports.c
	* libguile/fports.c (scm_revealed_count, scm_port_revealed)
	  (scm_set_port_revealed_x, scm_adjust_port_revealed_x): Move these APIs
	  here, and only operate on fports.  To keep revealed ports alive, now
	  we will just keep them in a data structure that the GC knows about --
	  a static list.

	* libguile/fports.h: Add revealed count to scm_t_fport, and move decls
	  of revealed-count functions here.

	* libguile/ports.h:
	* libguile/ports.c: Adapt to change.  Remove SCM_REVEALED and
	  SCM_SETREVEALED; since they only apply to fports now, keeping them
	  around would be inviting type errors.
	  (finalize_port): We don't need to worry about resuscitating ports
	  here.

	* libguile/init.c: Use the scm_set_port_revealed_x function to set the
	  revealed counts on stream ports.

2012-02-19  Andy Wingo  <wingo@pobox.com>

	ice-9/poll optimization
	* module/ice-9/poll.scm (poll-set-add!): Use fileno instead of
	  port->fdes, to avoid manipulating revealed counts.

2012-02-18  Ludovic Courtès  <ludo@gnu.org>

	Don't fail when locale env. vars specify a dot-less locale name.
	Fixes <http://bugs.gnu.org/10742>.
	Reported by Alírio Eyng <alirioeyng@ig.com.br>.

	* gnulib-local/lib/localcharset.c.diff (environ_locale_charset): Change
	  to set CODESET to "" when LOCALE lacks a dot.  Return "ISO-8859-1"
	  when CODESET is the empty string.

	* lib/localcharset.c: Update.

	* test-suite/standalone/Makefile.am (check_SCRIPTS): Add
	  `test-command-line-encoding2'.
	  (TESTS): Likewise.

	* test-suite/standalone/test-command-line-encoding2: New file.

2012-02-17  Andy Wingo  <wingo@pobox.com>

	wrap iconv_open / iconv_close with a lock to help in thread/fork issues
	* libguile/bytevectors.c (STRING_TO_UTF, scm_string_to_utf8)
	  (UTF_TO_STRING):
	* libguile/ports.c (open_iconv_descriptors, close_iconv_descriptors):
	* libguile/strings.c (scm_from_stringn, scm_to_stringn): Wrap operations
	  that acquire and destroy iconv contexts with a mutex.  While iconv is
	  threadsafe, internally it uses a lock, and we need to make sure when
	  we fork() that no one has that lock -- so we surround it with another
	  one.  Gross.

	install pthread_atfork handlers for guile's static mutexen
	* libguile/async.c:
	* libguile/deprecation.c:
	* libguile/fluids.c:
	* libguile/gc.c:
	* libguile/instructions.c:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/strings.c:
	* libguile/threads.c: Use the SCM_PTHREAD_ATFORK_LOCK_STATIC_MUTEX
	  mechanism to lock a number of static mutexen.

2012-02-17  Andy Wingo  <wingo@pobox.com>

	add pthread_atfork helpers to our threading shims
	* libguile/null-threads.h:
	* libguile/pthread-threads.h (SCM_DEFINE_ATFORK_HANDLERS_FOR_MUTEX)
	  (scm_i_pthread_atfork): Define a pthread_atfork shim, and a helper to
	  declare procedures to lock and unlock a mutex.

	* libguile/threads.h (SCM_PTHREAD_ATFORK_LOCK_STATIC_MUTEX): New macro,
	  causes the snarfer to emit a pthread_atfork call to lock a mutex, if
	  threads are enabled.

2012-02-17  Andy Wingo  <wingo@pobox.com>

	with a threaded guile, lock weak sets and tables during a fork
	* libguile/weak-set.c (make_weak_set):
	* libguile/weak-table.c (make_weak_table): If we have a threaded Guile,
	* keep a weak set (table) of weak sets (tables).  Use this and the
	  pthread_atfork mechanism to lock and unlock weak sets and weak tables
	  during a fork().

	* libguile/weak-set.h (scm_weak_set_prehistory): New internal API.
	* libguile/init.c: Add call to scm_weak_set_prehistory().

2012-02-17  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'local-2.0/stable-2.0'
	Conflicts:
		libguile/read.c
		libguile/srcprop.c
		module/ice-9/psyntax-pp.scm

2012-02-15  Andy Wingo  <wingo@pobox.com>

	remove deprecated features test
	* test-suite/tests/procprop.test ("procedure-arity"): Remove a test of
	  deprecated features.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		module/ice-9/psyntax-pp.scm

2012-02-15  Mark H Weaver  <mhw@netris.org>

	Add tests to verify that 'read' sets source properties when appropriate
	* test-suite/tests/srcprop.test (source properties): Add tests.

2012-02-15  Mark H Weaver  <mhw@netris.org>

	Add support for source properties on non-immediate numbers
	* libguile/read.c (scm_read_number): Set source properties on
	  non-immediate numbers if the 'positions' reader option is set.

	* doc/ref/api-debug.texi (Source Properties): Update manual.

2012-02-15  Mark H Weaver  <mhw@netris.org>

	psyntax: access source properties for all supported objects
	* module/ice-9/psyntax.scm (decorate-source): Set source properties on
	  any object that satisfies 'supports-source-properties?'.  Previously
	  we used 'pair?' as the predicate.

	  (source-annotation): Apply 'source-properties' to _any_ kind of source
	  expression, where previously only pairs were queried.  If the argument
	  is a syntax-object, apply the source-properties to the syntax-object's
	  expression.

	  In the peculiar case of a syntax-object whose expression is also a
	  syntax-object: previously we would iterate, but with this commit we
	  now call 'syntax-object-expression' only once.

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

2012-02-15  Mark H Weaver  <mhw@netris.org>

	Add 'supports-source-properties?' predicate
	* libguile/srcprop.c (scm_supports_source_properties_p): New procedure.
	  (supports_source_props): New static C function.

	* libguile/srcprop.h (scm_supports_source_properties_p): Add prototype.

	* doc/ref/api-debug.texi (Source Properties): Add documentation.

2012-02-15  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

2012-02-15  Mark H Weaver  <mhw@netris.org>

	Relax validation of source property accessors
	* libguile/srcprop.c (scm_source_properties, scm_source_property,
	  scm_i_has_source_properties): Relax validation to allow _any_ object
	  to be queried for source properties.

2012-02-15  Mark H Weaver  <mhw@netris.org>

	syntax-violation: prefer 'subform' for source info, with 'form' as fallback
	* module/ice-9/psyntax.scm (syntax-violation): Look for source
	  properties of 'subform' first.  If 'subform' has none, 'form' is used.
	  Previously, the source information of 'form' was used unless 'form'
	  _itself_ was '#f', in which case 'subform' was used.

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

2012-02-15  Mark H Weaver  <mhw@netris.org>

	Fix psyntax bugs that would cause bad source annotations
	* module/ice-9/psyntax.scm (rebuild-macro-output): Fix two bugs that
	  would cause bogus source properties to be added to vectors and
	  macro-introduced syntax objects.  These bugs were masked by the
	  limitation that only pairs can be decorated with source properties.
	  Due to a typo, each vector in the macro output was decorated using the
	  vector itself as its source.  Due to accidental variable capture, each
	  syntax-object introduced by the macro had its expression decorated
	  with its own wrap-subst.

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

2012-02-15  Mark H Weaver  <mhw@netris.org>

	Fix typo in comment in message.scm: 'know' to 'known' warning types
	* module/system/base/message.scm (%warning-types): Fix typo.

2012-02-14  Andy Wingo  <wingo@pobox.com>

	better handling for exceptions in close-port and port finalizers
	* libguile/fports.c (close_the_fd, fport_close): Arrange to always close
	  the fd, even if the flush procedure throws an exception.  Perhaps the
	  port machinery should do this for us, though.  Don't wrap the close
	  call in SCM_SYSCALL, EINTR leaves the fd in an unspecified state.
	  Don't bother freeing buffers, the collector will handle that; simply
	  drop references via scm_port_non_buffer.

	* libguile/ports.c (do_free, finalize_port): Catch exceptions caused by
	  the free procedure.  Don't bother setting the stream to 0 at all.
	  (scm_close_port): Ensure that exceptions thrown by the "close"
	  procedure don't prevent the port from being marked as closed.

2012-02-14  Andy Wingo  <wingo@pobox.com>

	web server: fix spurious warning
	* module/web/server.scm (sanitize-response): Quick fix to the
	  304-has-no-body sanitizer.

	scm_from_stringn utf8 optimization
	* libguile/strings.c (scm_from_stringn): Optimize scm_from_stringn for
	  utf-8.

	fix buggy scm_from_utf8_stringn (!)
	* libguile/strings.c (scm_from_utf8_stringn): Embarassingly, my
	  scm_from_utf8_stringn implementation was buggy for non-ascii
	  characters, since October (41d1d984).  Fixed.  Will be tested with the
	  next patch.

2012-02-14  Andy Wingo  <wingo@pobox.com>

	ports: avoid adding port table entries and finalizers if possible
	* libguile/ports.h (scm_t_port_type_flags, scm_t_ptob_descriptor): Add
	  flags to ptob descriptors.

	* libguile/ports.c (scm_set_port_flush): Set the SCM_PORT_TYPE_HAS_FLUSH
	  flag here.
	  (scm_c_make_port_with_encoding): Only add ports to the table if
	  SCM_PORT_TYPE_HAS_FLUSH is set.  Only add finalizers to ports if there
	  is a free function.
	  (scm_close_port): Inline scm_i_remove_port here.  Only remove from the
	  weak set if SCM_PORT_TYPE_HAS_FLUSH is set.
	  (scm_set_port_revealed_x): Add a comment.

2012-02-14  Andy Wingo  <wingo@pobox.com>

	refactor port encoding modes: utf-8 and iconv
	* libguile/ports.h (struct scm_t_port): Add a flag for the port encoding
	  mode: UTF8 or iconv.  The iconv descriptors are now in a separate
	  structure so that we can avoid attaching finalizers to the ports
	  themselves, in some cases.

	* libguile/ports.c (scm_c_make_port_with_encoding): Init the encoding
	  mode.
	  (scm_i_remove_port): Adapt to call close_iconv_descriptors.
	  (finalize_iconv_descriptors, open_iconv_descriptors):
	  (close_iconv_descriptors): New infrastructure to manage iconv
	  descriptors.
	  (scm_i_port_iconv_descriptors): New internal helper.
	  (scm_i_set_port_encoding_x): Use open_iconv_descriptors, if needed.
	  (get_iconv_codepoint): Use pt->iconv_descriptors.
	  (get_codepoint): Check the port encoding mode flags.

	* libguile/print.c (display_string_using_iconv): Use
	  scm_i_port_iconv_descriptors.
	  (display_string): Use pt->encoding_mode flag.

2012-02-14  Andy Wingo  <wingo@pobox.com>

	string ports simplification
	* libguile/strports.c (st_fill_input): Rename from stfill_buffer, and
	  remove an unneeded scm_return_first_int.
	  (st_resize_port): Minor variable renaming.
	  (st_write): Keep read_pos updated to be the same as write_pos.  If we
	  need to resize, do so only once.
	  (st_seek): No more need to flush.
	  (st_truncate): Update read_pos here too.
	  (scm_mkstrport): No need to flush here.
	  (scm_strport_to_string): Just call scm_from_stringn; rely on it to
	  detect the latin1 case.
	  (scm_make_stptob): No more flush function.

2012-02-13  Andy Wingo  <wingo@pobox.com>

	weaks: move an allocation outside a critical section
	* libguile/weak-set.c (resize_set):
	* libguile/weak-table.c (resize_table): Drop the set/table lock while
	  allocating the new vector.  Fixes a bug in which a finalizer could
	  recursively try to grab the port table lock.

2012-02-12  Mark H Weaver  <mhw@netris.org>

	Fix manual: scm_foreign_to_bytevector to scm_pointer_to_bytevector
	* doc/ref/api-foreign.texi (Void Pointers and Byte Access): Fix outdated
	  function name: scm_foreign_to_bytevector to scm_pointer_to_bytevector.

2012-02-12  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

2012-02-12  Andy Wingo  <wingo@pobox.com>

	web server: do not provide a response body where it is not permitted
	* module/web/response.scm (response-must-not-include-body?): New
	  function.

	* doc/ref/web.texi: Doc the function.

	* module/web/server.scm (sanitize-response): Error if we have a body,
	  but the response type does not permit a body.  If we are responding to
	  a HEAD request, silently drop the body.

2012-02-11  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

	web server: print backtrace on errors when run in batch mode
	* module/web/server.scm (read-client, handle-request, write-client):
	  When run in batch mode, give a full backtrace for errors.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/read.c
		test-suite/tests/tree-il.test

2012-02-10  Andy Wingo  <wingo@pobox.com>

	more efficient scm_string_to_utf8, scm_string_to_utf32
	* libguile/bytevectors.c (scm_string_to_utf8): More efficient
	  implementation.
	  (scm_string_to_utf32): Likewise.

	more efficient scm_to_utf8_stringn, scm_to_utf32_stringn
	* libguile/strings.c (scm_to_utf8_stringn): More efficient
	  implementation than calling scm_to_stringn.
	  (scm_to_utf32_stringn): Likewise.

2012-02-08  Mark H Weaver  <mhw@netris.org>

	Support => within case, and improve error messages for cond and case
	* module/ice-9/boot-9.scm (cond, case): Reimplement using syntax-case,
	  with improved error messages and support for '=>' within 'case' as
	  mandated by the R7RS.  Add warnings for duplicate case datums and
	  case datums that cannot be meaningfully compared using 'eqv?'.

	* module/system/base/message.scm (%warning-types): Add 'bad-case-datum'
	  and 'duplicate-case-datum' warning types.

	* test-suite/tests/syntax.test (cond, case): Update tests to reflect
	  improved error reporting.  Add tests for '=>' within 'case'.

	* test-suite/tests/tree-il.test (partial evaluation): Update tests to
	  reflect changes in how 'case' is expanded.

	* doc/ref/api-control.texi (Conditionals): Document '=>' within 'case'.

2012-02-08  Mark H Weaver  <mhw@netris.org>

	Add source properties to many more types of data
	* libguile/read.c (scm_read_array): New internal helper that
	  calls scm_i_read_array and sets its source property if the
	  'positions' reader option is set.

	  (scm_read_string): Set source properties on strings if the 'positions'
	  reader option is set.

	  (scm_read_vector, scm_read_srfi4_vector, scm_read_bytevector,
	  scm_read_guile_bitvector, scm_read_sharp): Add new arguments for the
	  'line' and 'column' of the first character of the datum being read.
	  Set source properties if the 'positions' reader option is set.

	  (scm_read_expression): Pass 'line' and 'column' to scm_read_sharp.

	* doc/ref/api-debug.texi (Source Properties): Update manual.

2012-02-08  Mark H Weaver  <mhw@netris.org>

	Unoptimize 'read' to return freshly allocated empty strings
	* libguile/read.c (scm_read_string): Return a freshly allocated string
	  every time, even for empty strings.  The motivation is to allow source
	  properties to be added to all strings.  Previously, the shared global
	  'scm_nullstr' was returned for empty strings.  Note that empty strings
	  still share a common global 'null_stringbuf'.

	* test-suite/tests/srfi-13.test (substring/shared): Fix tests to reflect
	  the fact that empty string literals are no longer guaranteed to be
	  'eq?' to each other.

2012-02-08  Mark H Weaver  <mhw@netris.org>

	Optimize empty substring case of scm_i_substring_copy
	* libguile/strings.c (scm_i_substring_copy): When asked to create an
	  empty substring, use 'scm_i_make_string' to make use of its
	  optimization for empty strings that reuses the global null_stringbuf.

	Add and use maybe_annotate_source helper in read.c
	* libguile/read.c (maybe_annotate_source): New static helper function.
	  (scm_read_sexp, scm_read_quote, scm_read_syntax): Use
	  'maybe_annotate_source'.

	Remove inline and register attributes from read.c
	* libguile/read.c: Remove all 'inline' and 'register' attributes.

	Remove incorrect comment in read.c
	* libguile/read.c (scm_read_sharp): Remove incorrect comment that
	  claims that scm_read_boolean might return a SRFI-4 vector.

2012-02-08  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

	i18: avoid freelocale (NULL)
	* libguile/i18n.c (smob_locale_free): Don't freelocale (NULL).

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		GUILE-VERSION
		libguile/gc-malloc.c
		libguile/ports.c

2012-02-05  Andy Wingo  <wingo@pobox.com>

	Fix --enable-debug-malloc
	* libguile/gc-malloc.c (do_realloc, do_calloc, do_gc_malloc)
	  (do_gc_malloc_atomic, do_gc_realloc, do_gc_free): Wrap the allocators
	  in helper methods.  The non-GC allocators call
	  scm_gc_register_allocation, and the GC allocators ensure that
	  gc_malloc returns a nonzero value.
	  (scm_realloc, scm_calloc): Allow NULL return for malloc(0).  It is
	  permitted by POSIX.  Don't wrap in a SCM_SYSCALL; the only possible
	  errno is ENOMEM.
	  (scm_gc_malloc_pointerless, scm_gc_malloc, scm_gc_calloc):
	  (scm_gc_realloc, scm_gc_free, scm_gc_strndump): Use the wrappers.
	  Don't call the debug-malloc registrations and deregistrations, as it
	  is neither mandatory nor advised to call scm_gc_free.  Fixes
	  compilation with debug-malloc.
	  (scm_must_free): Don't scm_malloc_unregister.

2012-02-04  Ludovic Courtès  <ludo@gnu.org>

	i18n: Skips ~h `format' tests when digit grouping info is missing.
	* test-suite/tests/i18n.test ("format ~h"): Skip tests when
	  `locale-digit-grouping' returns '().

2012-02-04  BT Templeton  <bpt@hcoop.net>

	function binding fixes
	* module/language/elisp/bindings.scm (bindings): Add `function-bindings'
	  field.
	  (make-bindings): Initialize the `function-bindings' field.
	  (get-function-binding, with-function-bindings): New functions.

	  (access-variable, reference-variable, set-variable!): Remove the
	  `module' argument and only handle references to the value cell. All
	  callers changed. Callers passing `function-slot' as the module changed
	  to use the corresponding functions for the function cell instead.

	  (access-function, reference-function, set-function!): New procedures.

	  (compile-flet, compile-labels): Use `with-function-bindings' instead
	  of `with-lexical-bindings'.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	sharpsign-colon for uninterned symbols
	* module/language/elisp/lexer.sm (lex): Add support for `#:' syntax for
	  uninterned symbols.

	elisp I/O
	* module/language/elisp/boot.el (princ, print, terpri, format*): New
	  functions.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	improve management of global special variables
	* module/language/elisp/bindings.scm (bindings): Remove `globals'
	  field. (global?, mark-global!, map-globals): Remove. All callers
	  changed.

	* module/language/elisp/compile-tree-il.scm (generate-ensure-global,
	  ensuring-globals): Remove. All callers changed.

	  (global?, ensure-globals!): New procedures.

	  (bind-lexically?): Use new `global?'.

	  (compile-lambda, compile-let, compile-let*): Use `ensure-globals!'.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	more lexical declarations
	* module/language/elisp/boot.el (condition-case, catch): Add `lexical'
	  declarations in macro expansions.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	signal an error for uncaught throws
	* module/language/elisp/boot.el (%catch): New variable.

	  (catch): Bind `%catch' to `t' during the evaluation of `body'. Call
	  `throw' instead of signalling an exception directly.

	  (throw): Signal a `no-catch' error if there is no `catch' to throw to.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	`catch' in terms of `condition-case'
	* module/language/elisp/boot.el (throw): Define an `error-conditions'
	  property for this symbol.

	  (catch): Define in terms of `condition-case' instead of using Guile
	  exceptions directly.

	  (throw): Signal a `throw' condition instead of throwing a Guile
	  exception directly.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	standard error symbols
	* module/language/elisp/boot.el (error, wrong-type-argument, no-catch,
	  invalid-function): Define `error-conditions' properties for these
	  standard error symbols.

	`%plist-member' fix
	* module/language/elisp/boot.el (%plist-member): Use recursion to avoid
	  using `catch' and `throw'.

	condition-case
	* module/language/elisp/boot.el (signal): Accept only two arguments, and
	  throw an `elisp-condition' exception instead of an `elisp-error'
	  exception.
	  (condition-case): New macro.

	elisp `member' subrs
	* module/language/elisp/boot.el (%member, member, memql, memq): New
	  functions.

	use `dynlet' for dynamic binding
	* module/language/elisp/compile-tree-il.scm (let-dynamic): Remove. All
	  callers changed to use `dynlet' instead.

	inline `generate-let' and `generate-let*'
	* module/language/elisp/compile-tree-il.scm (generate-let, compile-let):
	  Inline the former into the latter.
	  (generate-let*, compile-let*): Likewise.

	define `flet' directly
	* module/language/elisp/compile-tree-il.scm (compile-flet): Compile
	  `flet' directly instead of using `generate-let'.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	lexical binding macros
	* module/language/elisp/boot.el (lexical-let, lexical-let*): New macros.

	* module/language/elisp/compile-tree-il.scm (bind-lexically?): Remove
	  the check for a `lexical' flag, since `lexical-let' and `lexical-let*'
	  are no longer special operators.

	  (compile-lexical-let, compile-lexical-let*): Remove.

	* module/language/elisp/runtime/function-slot.scm: Update module
	  definition.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	use `lexical' declarations in "boot.el"
	* module/language/elisp/boot.el (prog1, cond, or, catch): Use `let' with
	  `lexical' declarations instead of `lexical-let'.
	  (%plist-put): Use `let' instead of `lexical-let', since "boot.el" now
	  uses lexical binding by default.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	elisp `while' macro
	* module/language/elisp/compile-tree-il.scm (compile-while): Remove.

	* module/language/elisp/boot.el (while): New macro.

	* module/language/elisp/runtime/function-slot.scm: Update module
	  definition.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	elisp `labels'
	* module/language/elisp/compile-tree-il.scm (compile-labels): New
	  special operator.

	* module/language/elisp/runtime/function-slot.scm: Update module
	  definition.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	fix `flet' syntax
	* module/language/elisp/compile-tree-il.scm (process-let-bindings):
	  Remove.

	  (parse-let-binding, parse-flet-binding): New procedures.

	  (generate-let, generate-let*): Now takes an association list mapping
	  symbols to values for the `bindings' argument.

	  (compile-let, compile-let*, compile-lexical-let)
	  (compile-lexical-let*): Parse the bindings list with
	  `parse-let-binding'.

	  (compile-flet): Parse the bindings list with `parse-flet-binding'.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	elisp binding declarations
	* module/language/elisp/compile-tree-il.scm (bind-lexically?): Accept a
	  new `decls' argument and check it for `lexical' declarations.
	  Establish the same kind of binding whether or not a lexical binding
	  for `sym' exists, whereas previously the presence of a lexical binding
	  would cause newly-established bindings to be lexical bindings as well.

	  (split-let-bindings): Remove. All callers changed.

	  (generate-let, generate-let*, compile-lambda): Pass the declarations
	  list to `bind-lexically?'.

	* test-suite/tests/elisp-compiler.test: Explicitly disable the
	  lexical-binding mode. Add `lexical' declarations where necessary.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	declaration parsing
	* module/language/elisp/compile-tree-il.scm (parse-body-1, parse-body)
	  (parse-lambda-body, parse-declaration): New procedures.
	  (generate-let, generate-let*): Use `parse-body'.
	  (compile-lambda): Use `parse-lambda-body'.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	elisp lambda list parsing
	* module/language/elisp/compile-tree-il.scm (split-lambda-arguments):
	  Remove.

	  (parse-lambda-list, make-simple-lambda): New procedures.

	  (compile-lambda): Use `parse-lambda-list' and `make-simple-lambda'.
	  Set empty rest arguments to the empty list instead of `#nil'.

	* test-suite/tests/elisp-compiler.test ("Lambda Expressions")["rest
	  argument"]: Use Elisp `null' instead of a Scheme equality check.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	elisp function subrs
	* module/language/elisp/boot.el (null, consp, listp, car, cdr)
	  (make-symbol, signal): Use `%funcall' instead of `funcall' or `fset'.
	  (symbolp, symbol-function, eval): Use `%funcall', since `funcall' now
	  calls these functions.

	  (functionp, %indirect-function): New functions.
	  (funcall): Define in terms of `%funcall' and `%indirect-function'.
	  (apply): New function. Previously defined in
	  "module/language/elisp/runtime/subrs.scm".

	  (fset): If `definition' is not a function, set the function cell of
	  `symbol' to an falias for `definition'.

	* module/language/elisp/falias.scm: New file.

	* module/language/elisp/subrs.scm: Remove file.
	  (apply): Remove. Now defined in "boot.el".
	* module/language/elisp/runtime/function-slot.scm: Update module
	  definition.

	* module/Makefile.am: Update.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	remove dynamic function binding
	* module/language/elisp/compile-tree-il.scm (find-operator): Assume that
	  `name' is lexically bound.
	* module/language/elisp/runtime.scm (symbol-fbound?, fmakunbound!):
	  Assume that `symbol' is lexically bound.
	  (defspecial): Bind special operators lexically.

	elisp nil equality
	* module/language/elisp/boot.el (eq, equal): Return `#t' if both
	  arguments are nil.
	  (eql): New function.

	use lexical binding in boot.el
	* module/language/elisp/boot.el: Use lexical binding.

	remove unused code
	* module/language/elisp/compile-tree-il.scm (runtime-error): Remove.
	* module/language/elisp/runtime.scm (macro-error, runtime-error,
	  elisp-bool, prim): Remove.

	new elisp special form `%funcall'
	* module/language/elisp/compile-tree-il.scm (compile-%funcall): New
	  procedure.
	* module/language/elisp/runtime/function-slot.scm: Update module
	  definition.

	rewrite `eval' and `load' in elisp
	* module/language/elisp/subrs.scm (eval, load): Rewrite in Elisp and
	  move to...
	* module/language/elisp/boot.el (eval, load): ...here.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	evaluate the function position correctly
	* module/language/elisp/compile-tree-il (compile-pair): Use `function'
	  to perform functional evaluation. Previously, if the operator of a
	  compound form was not a symbol, the operator would be evaluated as a
	  normal expression. This happened to work only because there is a
	  `lambda' macro. The compiler will now signal an error if the operator
	  is neither a function name nor a lambda expression.

	* test-suite/tests/elisp-compiler.test ("Lambda Expressions")["optional
	  argument"]: Remove an erroneous use of `function' in the function
	  position.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	purify elisp symbol cell modules
	* module/language/elisp/runtime/function-slot.scm:
	* module/language/elisp/runtime/value-slot.scm: Define these as pure modules.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	record elisp function names
	* language/elisp/compile-tree-il.scm (compile-lambda): Add a `meta'
	  argument for the procedure's properties.

	  (compile-function, compile-defmacro, compile-defun): Update
	  accordingly, passing a `name' property to `compile-lambda' where
	  possible.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	elisp variable aliases
	* module/language/elisp/boot.el (defvaralias): New function.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	simplify elisp symbol accessors
	* module/language/elisp/boot.el (fset, symbol-value, symbol-function)
	  (set, makunbound, fmakunbound, boundp, fboundp): Use procedures in
	  `(language elisp runtime)'.
	  (symbolp): New function.

	* module/language/elisp/compile-tree-il.scm (set-variable!): Use
	  `set-symbol-function!'.

	* module/language/elisp/runtime.scm (reference-variable, set-variable!):
	  Remove.
	  (symbol-fluid, set-symbol-fluid!): New procedure.
	  (symbol-value, set-symbol-value!, symbol-function)
	  (set-symbol-function!, symbol-bound?, symbol-fbound?, makunbound!)
	  (fmakunbound!): Moved from `(language elisp subrs)' and updated to
	  avoid using `reference-variable' and `set-variable!'.

	* module/language/elisp/runtime/subrs.scm (symbol-value)
	  (symbol-function, set, fset, makunbound, fmakunbound, boundp)
	  (fboundp): Move to `(language elisp runtime)'.
	  (apply): Use `symbol-function'.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	elisp property lists
	* module/language/elisp/boot.el (%plist-member, %plist-get, %plist-put)
	  (plist-get, plist-put, plist-member, lax-plist-get, lax-plist-put)
	  (symbol-plist, setplist, get, put): New functions.
	  (plist-function): New variable.

	simplify `mark-global!'
	* module/language/elisp/bindings.scm (mark-global!): Use `lset-adjoin'.

	remove `flet*' elisp special form
	* module/language/elisp/compile-tree-il.scm (compile-flet*): Remove.
	* module/language/elisp/runtime/function-slot.scm: Update module
	  definition.
	* test-suite/tests/elisp-compiler.test
	  ("Lambda Expressions")["flet and flet*"]: Remove `flet*' test.

	remove `with-always-lexical' elisp special form
	* module/language/elisp/compile-tree-il.scm: (always-lexical): Remove.
	  All uses changed.
	  (with-added-symbols): Remove.
	  (compile-with-always-lexical): Remove.
	  (process-options!): Remove support for the `#:always-lexical' option.
	* module/language/elisp/runtime/function-slot.scm: Update import and
	  re-export lists.
	* test-suite/tests/elisp-compiler.test: Remove or update tests using
	  `with-always-lexical'.

	emacs-compatible lexical binding
	* module/language/elisp/bindings.scm (global?): New function.
	* module/language/elisp/compile-tree-il.scm (lexical-binding): New
	  variable.
	  (bind-lexically?): If lexical binding is enabled, bind lexically
	  unless a special binding exists.
	  (compile-%set-lexical-binding-mode): New function.
	* module/language/elisp/lexer.scm (lexical-binding-regexp): New
	  variable.
	  (lex): Return a `set-lexical-binding-mode!' token if a comment is
	  found while reading the first line.
	* module/language/elisp/parser.scm (get-expression): Add support for
	  `set-lexical-binding-mode!' tokens.
	* module/language/elisp/runtime/function-slot.scm: Import and re-export
	  the `%set-lexical-binding-mode' special form.
	* test-suite/tests/elisp-compiler.test
	  ("Let and Let*")["lambda args inside lexical-let"]: Update.

	remove `bind-arg-lexical?'
	* module/language/elisp/compile-tree-il.scm (bind-arg-lexical?): Remove.
	  All callers changed to use `bind-lexically?'.

	fix elisp `catch'
	* module/language/elisp/boot.el (catch): Only catch exceptions of type
	  `elisp-exception'.

	implement `throw' in elisp
	* module/language/elisp/runtime/subrs.scm (throw): Rewrite in Elisp and
	  move to...
	* module/language/elisp/boot.el (throw): ...here.

	rewrite `map-globals'
	* module/language/elisp/bindings.scm (map-globals): Use `append-map' and
	  `map' instead of explicit iteration with named `let'.

	use srfi-9 for elisp bindings records
	* module/language/elisp/bindings.scm: Use `(srfi srfi-9)'.
	  (bindings-type): Remove low-level record type definition and replace
	  with...
	  (bindings): ...this, an SRFI-9 record type. All uses changed.
	  (mark-global-needed!): Rename to...
	  (mark-global!): ...this. All callers changed.
	  (map-globals-needed): Rename to...
	  (map-globals): ...this. All callers changed.

	fix compilation of elisp forms with empty bodies
	* module/language/elisp/compile-tree-il.scm (generate-let)
	  (generate-let*, compile-lambda, compile-with-added-symbols)
	  (compile-progn, compile-if): Return nil if the form's body is empty.
	* test-suite/tests/elisp-compiler.test ("Sequencing")["empty progn"]:
	  New test.
	  ("Conditionals")["if with no else"]: New test.
	  ("Let and Let*")["empty let, empty let*"]: New test.
	  ("Lambda Expressions")["empty lambda"]: New test.

	rewrite elisp macros in elisp
	* module/language/elisp/runtime/macros.scm: Remove.
	  (macro-lambda, macro-prog1, macro-prog2, macro-cond, macro-and,
	  macro-or, macro-catch, macro-unwind-protect): Rewrite in Elisp and
	  move to...
	* module/language/elisp/boot.el (lambda, prog1, prog2, cond, and, or,
	  catch, unwind-protect): ...here.
	  (eval-and-compile): New macro.
	  (funcall, fset, null, consp, listp, car, cdr, make-symbol-signal):
	  Wrap definitions in an `eval-and-compile' form so that they can be
	  used by the rewritten macros.
	* module/language/elisp/runtime.scm: Remove `built-in-macro'.
	* module/language/elisp/Makefile.am: Remove
	  module/language/elisp/runtime/macros.scm from `ELISP_LANG_SOURCES'.

	new elisp special form `eval-when-compile'
	* module/language/elisp/compile-tree-il.scm (compile-eval-when-compile):
	  New function.
	* module/language/elisp/runtime/function-slot.scm: Update module
	  definition.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	remove unnecessary elisp macros
	* module/language/elisp/runtime/macros.scm (when, unless, dotimes)
	  (dolist, pop, push): Remove. (They are not special forms in Emacs.)

	* module/language/elisp/runtime/function-slot.scm: Update import and
	  export lists.

	* test-suite/tests/elisp-compiler.test ("Conditionals")["failing when"]
	  ["succeeding when", "failing unless", "succeeding unless"]: Remove.
	  ("Iteration")["dotimes", "dolist"]: Remove.
	  ("List Built-Ins")["pop", "push"]: Remove.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	elisp test fixes
	* test-suite/tests/elisp-compiler.test ("Exceptions")["catch and
	  throw"]: Use a freshly-consed object instead of a literal object. This
	  test previously assumed that similar literal objects are never
	  identical, which no longer true.
	  ("Equivalence Predifcates")["eq"]: Likewise.

	new `string' and `mapcar' elisp subrs
	* module/language/elisp/boot.el (string, mapcar): New functions.

	rewrite elisp subrs in elisp
	* module/language/elisp/runtime/subrs.scm (%, *, +, -, /=, 1+, 1-, <)
	  (<=, =, >, >=, abs, append, atom, car, car-safe, cdr, cdr-safe, cons)
	  (consp, eq, equal, fceiling, ffloor, float, floatp, fround, ftruncate)
	  (funcall, integerp, length, list, listp, make-list, max, min, nlistp)
	  (nth, nthcdr, null, numberp, reverse, setcar, setcdr, wholenump)
	  (zerop): Rewrite in Elisp and move to...
	* module/language/elisp/boot.el: ...here. Some functions have stricter
	  type checking, and `elisp-bool' is not currently used (so some
	  predicate functions now return `#f' instead of `#nil').
	  (boundp, eval, fboundp, fmakunbound, fset, load, makunbound, set)
	  (symbol-function, symbol-value, throw): New functions; they call their
	  existing implementations in subrs.scm.
	  (@): New macro.
	* module/language/elisp/runtime.scm (built-in-func): Remove. All uses
	  changed.
	* module/language/elisp/runtime/function-slot.scm: Update module
	  definition.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	remove unnecessary elisp subrs
	* module/language/elisp/runtime/subrs.scm (copy-tree, number-sequence):
	  Remove. (They are not subrs in Emacs.)

	* test-suite/tests/elisp-compiler.test ("List Built-ins")["copy-tree",
	  "number-sequence"]: Remove.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	`atomp' -> `atom'
	* module/language/elisp/runtime/subrs.scm (atomp) Rename to...
	  (atom): ...this. All callers changed.

	use `nil?' for elisp conditionals
	* module/language/elisp/compile-tree-il.scm (compile-if): Use the `nil?'
	  primitive for conditionals.

2012-02-04  BT Templeton  <bpt@hcoop.net>

	add `nil?' primitive
	* libguile/boolean.c (scm_nil_p): New function.

	* libguile/vm-i-scheme.c (nilp, not_nilp):
	* libguile/vm-i-system.c (br_if_nil, br_if_not_nil): New instructions.
	  Renumber other ops.

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

	* module/language/assembly/compile-bytecode.scm (compile-bytecode): Add
	  support for writing `br-if-nil' and `br-if-not-nil' instructions.

	* module/language/assembly/disassemble.scm (code-annotation): Add
	  `br-if-nil' and `br-if-not-nil' to the list of branch instructions.

	* module/language/tree-il/compile-glil.scm: Add `nil?' to
	  `*primcall-ops*'.
	  (flatten): Use the new branch instructions for `nil?' conditionals.

	* module/language/tree-il/primitives.scm: Add `nil?' to
	  `*interesting-primitive-names*', `*effect-free-primitives', and
	  `*effect+exception-free-primitives*'.

2012-02-04  Andy Wingo  <wingo@pobox.com>

	fix check for when libc already has clock_gettime / clock_getcpuclockid
	* acinclude.m4 (gl_CLOCK_TIME): If both clock_gettime and
	  clock_getcpuclockid are present without -lrt and -lposix4, don't add
	  any libs to LIB_CLOCK_GETTIME.  Thanks to taylanbarirli@gmail.com.

2012-02-04  Bake Timmons  <b3timmons@speedymail.org>

	Improve consistency of definitions of C functions in manual.
	* doc/ref/api-compound.texi
	* doc/ref/api-evaluation.texi
	* doc/ref/api-foreign.texi
	* doc/ref/api-io.texi
	* doc/ref/posix.texi
	* doc/ref/srfi-modules.texi: Add missing parentheses and commas to definitions
	  of C functions.

	* doc/ref/api-data.texi: Change from @deffn to @deftypefn for C function
	  with arguments not of SCM type.

2012-02-04  Andy Wingo  <wingo@pobox.com>

	fix compilation of control.c, continuations.c when SCM_ALIGNED is not defined
	* libguile/control.c:
	* libguile/continuations.c: Fix for the case in which SCM_ALIGNED is not
	  defined.  Though I wonder, perhaps we should just error out in those
	  cases.

2012-02-04  Bake Timmons  <b3timmons@speedymail.org>

	Make notation for Scheme repeated arguments more consistent in manual.
	* doc/ref/api-compound.texi
	* doc/ref/api-control.texi
	* doc/ref/api-data.texi
	* doc/ref/api-debug.texi
	* doc/ref/api-evaluation.texi
	* doc/ref/api-macros.texi
	* doc/ref/api-memory.texi
	* doc/ref/api-modules.texi
	* doc/ref/api-procedures.texi
	* doc/ref/api-regex.texi
	* doc/ref/api-scheduling.texi
	* doc/ref/api-utility.texi
	* doc/ref/goops.texi
	* doc/ref/match.texi
	* doc/ref/misc-modules.texi
	* doc/ref/posix.texi
	* doc/ref/r6rs.texi
	* doc/ref/scheme-using.texi
	* doc/ref/srfi-modules.texi
	* doc/ref/sxml-match.texi: Make notation for Scheme repeated arguments more
	  consistent in manual.

2012-02-03  Ludovic Courtès  <ludo@gnu.org>

	i18n: Provide default values for when Gnulib has no replacement.
	This reverts parts of a0919aefee7512686c3374876df2c549fd47e071 ("i18n:
	Use Gnulib's `nl_langinfo' module.").

	* module/ice-9/i18n.scm (define-simple-langinfo-mapping): Re-add
	  `default' parameter, and update users accordingly.

2012-02-03  Ludovic Courtès  <ludo@gnu.org>

	Augment `-Wformat' analysis with support for `~:h'.
	* module/language/tree-il/analyze.scm (format-string-argument-count):
	  Add support for ~h.

	* test-suite/tests/tree-il.test ("warnings")["format"]("~h", "~:h with
	  locale object", "~:h without locale object"): New tests.

2012-02-03  Ludovic Courtès  <ludo@gnu.org>

	format: Add specifier ~h for localized number output.
	* doc/ref/misc-modules.texi (Formatted Output): Document ~h.  Recommend
	  use of ~h instead of ~:d.

	* module/ice-9/format.scm (format): Add support for ~h.

	* test-suite/tests/format.test ("~h localized number"): New test prefix.

	* test-suite/tests/i18n.test (%american-english-locale-name,
	  %american-english-locale): New variables.
	  (under-american-english-locale-or-unresolved): New procedure.
	  ("format ~h"): New test prefix.

2012-02-03  Ludovic Courtès  <ludo@gnu.org>

	i18n: Add a couple of tests for `monetary-amount->locale-string'.
	* test-suite/tests/i18n.test ("monetary-amount->locale-string"): New
	  test prefix.

2012-02-03  Ludovic Courtès  <ludo@gnu.org>

	i18n: Use Gnulib's `nl_langinfo' module.
	* configure.ac: Remove checks for <langinfo.h> and <nl_types.h>, and
	  `nl_langinfo'.

	* libguile/i18n.c: Remove #ifdefs for HAVE_LANGINFO_H, HAVE_NL_TYPES_H,
	  HAVE_NL_ITEM, and HAVE_LANGINFO_CODESET.
	  (SCM_VALIDATE_OPTIONAL_LOCALE_COPY): Use `SCM_UNBNDP'.

	* m4/gnulib-cache.m4 (gl_MODULES): Add `nl_langinfo'.

	* module/ice-9/i18n.scm (define-vector-langinfo-mapping): Remove
	  `defaults' parameter; assume (provided? 'nl-langinfo) is always true.
	  Update users accordingly.
	  (define-simple-langinfo-mapping): Likewise.
	  (define-monetary-langinfo-mapping): Likewise, but do not assume
	  LOCAL-ITEM and INTL-ITEM are always defined.

2012-02-03  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `regex' module.
	This should help with regex portability, as reported in
	<http://bugs.gnu.org/10684> for Darwin 8.11.

	* m4/gnulib-cache.m4 (gl_MODULES): Add `regex'.

	* configure.ac: Remove header checks for regex.h, rxposix.h, and
	  rx/rxposix.h.  Remove check for the `regcomp' function.  Remove
	  definition of `HAVE_REGCOMP'.  Define `ENABLE_REGEX'.

	* libguile/init.c: Check for `ENABLE_REGEX' instead of `HAVE_REGCOMP'.

	* libguile/regex-posix.c: Always include <regex.h>.  Remove #ifdefs for
	  rxposix.h and co.

2012-02-03  Ludovic Courtès  <ludo@gnu.org>

	tests: Have `getaddrinfo' test work for Darwin 8.
	* doc/ref/posix.texi (Network Databases): Update description of
	  `EAI_NODATA' to mention that Darwin provides it.

	* libguile/net_db.c (scm_getaddrinfo): Likewise.

	* test-suite/tests/net-db.test ("getaddrinfo")["wrong service name"]:
	  Accept `EAI_NODATA' too.  Reported by David Fang <fang@csl.cornell.edu>,
	  see <http://bugs.gnu.org/10684>.

2012-02-03  Ludovic Courtès  <ludo@gnu.org>

	tests: Work around erroneous tr_TR locale in Darwin 8.
	* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved):
	  Add exception for Darwin 8.  Reported by David Fang <fang@csl.cornell.edu>,
	  see <http://bugs.gnu.org/10684>.

2012-02-03  Mike Gran  <spk121@yahoo.com>

	Update srfi-14 test for Unicode 6.1
	Some Latin-1 symbols have been reclassified as punctuation

	* test-suite/tests/srfi-14.test: updated

2012-02-03  Mark H Weaver  <mhw@netris.org>

	Implement scm_to_pointer
	* libguile/foreign.c, libguile/foreign.h (scm_to_pointer):
	  New C function.

	* test-suite/standalone/test-loose-ends.c: Add test.

2012-02-02  Andy Wingo  <wingo@pobox.com>

	revert r5rs changes
	* doc/r5rs/r5rs.texi: Reverts the recent changes to r5rs.texi.

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

	Fix `SCM_I_ERROR' definition for MinGW without networking.
	* libguile/error.c (SCM_I_ERROR)[__MINGW32__]: Conditionalize on
	  `HAVE_NETWORKING'.

2012-02-02  Bake Timmons  <b3timmons@speedymail.org>

	Fix case in identifiers starting sentences in doc/r5rs/r5rs.texi
	* doc/r5rs/r5rs.texi: Use proper case of characters in identifiers starting
	  sentences.

	Improve the usage of variable names in Scheme docstrings.
	* module/ice-9/boot-9.scm:
	* module/ice-9/popen.scm:
	* module/ice-9/pretty-print.scm:
	* module/ice-9/r4rs.scm:
	* module/rnrs/io/ports.scm:
	* module/texinfo/string-utils.scm:
	* module/web/http.scm:
	* module/web/request.scm:
	* module/web/response.scm:
	* test-suite/vm/run-vm-tests.scm: Make the variable names in Scheme docstrings more
	  consistent.  Replace a few instances of @var with @code when appropriate.

	Improve the usage of variable names in C docstrings.
	* libguile/alist.c:
	* libguile/array-map.c:
	* libguile/arrays.c:
	* libguile/bitvectors.c:
	* libguile/filesys.c:
	* libguile/foreign.c:
	* libguile/generalized-arrays.c:
	* libguile/hashtab.c:
	* libguile/ioext.c:
	* libguile/load.c:
	* libguile/numbers.c:
	* libguile/ports.c:
	* libguile/posix.c:
	* libguile/print.c:
	* libguile/procprop.c:
	* libguile/promises.c:
	* libguile/simpos.c:
	* libguile/socket.c:
	* libguile/srfi-1.c:
	* libguile/srfi-13.c:
	* libguile/srfi-14.c:
	* libguile/stacks.c:
	* libguile/stime.c:
	* libguile/strings.c:
	* libguile/struct.c:
	* libguile/symbols.c:
	* libguile/threads.c:
	* libguile/weak-table.c:
	* libguile/weak-vector.c: Make the variable names in the C docstrings more
	  consistent.  Replace a few instances of @var with @code when appropriate.

2012-02-02  Andy Wingo  <wingo@pobox.com>

	Remove unused doc/sources/
	* doc/sources: Remove.  It is not used at all, presumably because all it
	  had to offer was already incorporated in the manual.

2012-02-02  Bake Timmons  <b3timmons@speedymail.org>

	Make consistent the usage of variable names in the function definitions found in the Texinfo docs.
	* doc/r5rs/r5rs.texi:
	* doc/ref/api-compound.texi:
	* doc/ref/api-data.texi:
	* doc/ref/api-debug.texi:
	* doc/ref/api-evaluation.texi:
	* doc/ref/api-io.texi:
	* doc/ref/api-modules.texi:
	* doc/ref/api-procedures.texi:
	* doc/ref/api-scheduling.texi:
	* doc/ref/api-smobs.texi:
	* doc/ref/compiler.texi:
	* doc/ref/misc-modules.texi:
	* doc/ref/posix.texi:
	* doc/ref/scheme-using.texi:
	* doc/ref/srfi-modules.texi:
	* doc/ref/vm.texi:
	* doc/ref/web.texi:
	* doc/sources/env.texi: Make usage of variable names of function definitions
	  more consistent.

	Fix unbalanced parentheses in docs.
	* doc/ref/sxml-match.texi (sxml-match-let, sxml-match-let*): Remove
	  extraneous parenthesis at end of Texinfo function definition header.

2012-02-02  Mike Gran  <spk121@yahoo.com>

	Update srfi-14 character sets to Unicode 6.1
	* libguile/srfi-14.i.c (cs_lower_case_ranges, cs_lower_case)
	  (cs_upper_case_ranges, cs_upper_case, cs_letter_ranges, cs_letter)
	  (cs_digit_ranges, cs_digit, cs_letter_plus_digit_ranges, cs_letter_plus_digit)
	  (cs_graphic_ranges, cs_graphic, cs_printing_ranges, cs_printing)
	  (cs_punctuation_ranges, cs_punctuation, cs_symbol_ranges, cs_symbol)
	  (cs_designated_ranges, cs_designated): modified
	* doc/ref/api-data.texi: modified

2012-02-02  Mark H Weaver  <mhw@netris.org>

	Fix search_path to fill stat_buf when given an absolute pathname
	* libguile/load.c (search_path): When the provided 'filename' is an
	  absolute pathname, perform a 'stat' on that pathname to fill the
	  'stat_buf'.  Previously, 'stat_buf' was left uninitialized in this
	  case, even though 'scm_primitive_load_path' assumes that 'stat_buf'
	  will be filled.  Update the header comment to explicitly specify that
	  'stat_buf' will be filled.  Also 'goto end' in a few failure cases
	  instead of replicating its code.

2012-02-02  Andy Wingo  <wingo@pobox.com>

	leniency in the "unused modules are removed" gc.test
	* libguile/foreign.h: Remove comment about the finalizer bit, as I don't
	  think that is the case any more.

	* test-suite/tests/gc.test: Ignore flakiness in the gc-modules test.

2012-01-31  Andy Wingo  <wingo@pobox.com>

	Revert "add SCM_HEAP_OBJECT_BASE"
	This reverts commit 47ed8656db8800f3ad20a40eb2c4e9ef3dc891e3.

	Conflicts:

		libguile/foreign.c

2012-01-31  Ludovic Courtès  <ludo@gnu.org>

	Augment `Libs.private' in `guile-2.0-uninstalled.pc'.
	Followup to 58f86505d658359508732c8f187bc37d010074d0 ("Augment
	`Libs.private' with for non-GNU platforms.").

	Reported by Eli Zaretskii <eliz@gnu.org>.

	* meta/guile-2.0-uninstalled.pc.in (Libs): Add all the optional
	  libraries, as done in commit 58f86505d658359508732c8f187bc37d010074d0.

2012-01-31  Andy Wingo  <wingo@pobox.com>

	an experiment: clearing the C stack in gc tests
	* test-suite/lib.scm (clear-stale-stack-references): New helper.
	* test-suite/tests/gc.test:
	* test-suite/tests/threads.test: Use the new helper.

	I removed the "unresolved" throw, as I'd like to see what the bots do
	with this.

2012-01-30  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

2012-01-30  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 2.0.4/2.0.5.
	Version 2.0.4 was pushed with the version info of 2.0.3, which is
	incorrect.  Version 2.0.5 fixes that.

	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	  (LIBGUILE_INTERFACE_CURRENT): Increment to account for new C functions
	  `scm_c_value_ref', `scm_call', etc.
	  (LIBGUILE_INTERFACE_AGE): Increment.

2012-01-30  Ludovic Courtès  <ludo@gnu.org>

	Amend `NEWS'.
	* NEWS: Mention `-Wformat' change.  Remove intermediate/minor bug fixes.

	Remove stale test file.
	* test-suite/tests/srfi-42.test: Delete "tmp1" at the end.

	doc: Add "warnings" to the concept index.
	* doc/ref/api-evaluation.texi (Compilation): Add "warnings" to the
	  concept index.

2012-01-30  Andy Wingo  <wingo@pobox.com>

	"fix" local-eval for introduced toplevels
	* module/ice-9/local-eval.scm: Fix for introduced toplevel identifiers.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/debug.h
		module/ice-9/psyntax-pp.scm
		module/ice-9/psyntax.scm
		module/language/tree-il/peval.scm
		module/language/tree-il/primitives.scm

	Merge commit '3d51e57cfb0404db568a6adfde2a346d3fd9907e'
	Conflicts:
		libguile/foreign.c
		libguile/hashtab.c
		module/ice-9/psyntax-pp.scm
		module/language/tree-il/compile-glil.scm

	Merge commit '9b0975f1dc41ddd10d81fb5b0965b9e9a54ef37a'
	Conflicts:
		libguile/foreign.c
		module/ice-9/psyntax-pp.scm
		module/ice-9/psyntax.scm

	fix hook invocation during thread guilification
	* libguile/gc.c (run_before_gc_c_hook): Don't run pre-GC hooks from a
	  thread that is in the process of guilification.

2012-01-30  Mark H Weaver  <mhw@netris.org>

	Rename scm_call_varargs -> scm_call
	* libguile/eval.c, libguile/eval.h, doc/ref/api-evaluation.texi,
	  test-suite/standalone/test-loose-ends.c, NEWS: Rename
	  scm_call_varargs -> scm_call

	Suggested by Ludovic Courtès <ludo@gnu.org>

2012-01-30  Mark H Weaver  <mhw@netris.org>

	Implement scm_call_varargs and scm_call_{7,8,9}
	* libguile/eval.c (scm_call_7, scm_call_8, scm_call_9,
	  scm_call_varargs): New functions.

	* libguile/eval.h: Add prototypes.

	* doc/ref/api-evaluation.texi: Add documentation.

	* test-suite/standalone/test-loose-ends.c: Add tests.

	* NEWS: Add news entry.

2012-01-30  Mark H Weaver  <mhw@netris.org>

	Fix primitive-eval to return #<unspecified> for definitions
	* module/ice-9/eval.scm (primitive-eval): Return #<unspecified> for
	  definitions.  Previously the variable object was returned.

	* test-suite/tests/eval.test (evaluator): Add test.

	* NEWS: Add news entry.

2012-01-30  Mark H Weaver  <mhw@netris.org>

	Fix 'local-eval' when the specified environment is a module
	* module/ice-9/local-eval.scm (local-wrap): Fix the (module? e) case, to
	  reference the expression 'x' instead of the non-existent variable
	  'exp', as was previously done.  Also use quasisyntax instead of
	  quasiquote, so that the introduced 'lambda' is an identifier instead
	  of a bare symbol, so that this will work in modules that have rebound
	  'lambda' to something else.

	* test-suite/tests/eval.test (local-eval): Make sure to test both
	  'local-eval' and 'local-compile' when the specified environment is a
	  module.

2012-01-30  Mark H Weaver  <mhw@netris.org>

	Update user-visible copyright dates in manual and REPL to 2012
	* doc/ref/guile.texi, module/system/repl/common.scm: Update
	  user-visible copyright dates to 2012.

2012-01-30  Ludovic Courtès  <ludo@gnu.org>

	Augment `Libs.private' with for non-GNU platforms.
	Reported by Eli Zaretskii <eliz@gnu.org>.

	* meta/guile-2.0.pc.in (Libs.private): Add all the optional libraries
	  that may be pulled via Gnulib on non-GNU platforms.

2012-01-29  Andy Wingo  <wingo@pobox.com>

	paper over some "lexical vars are collectable" flakiness
	* test-suite/tests/gc.test ("gc"): Hack around flakiness in "lexical
	  vars are collectable" on some architectures.

2012-01-29  Andy Wingo  <wingo@pobox.com>

	Revert "vm-i-scheme.c slight refactor"
	This reverts commit c0e4449908eee84bcb293ec21c10fec646bde45d.

	This refactor was needed for the introduction of DEAD(), which does not
	appear to have been necessary.

2012-01-29  Andy Wingo  <wingo@pobox.com>

	Revert "attempt to clear stale references on VM C stack"
	This reverts commit 04b2d773548c57b6eadd1808a8d15cce47af9630.

	Since it wasn't fixing the "lexical vars are collectable" test, it added
	complexity with no benefit.

2012-01-29  Ludovic Courtès  <ludo@gnu.org>

	Revert "Work around instruction reordering on SPARC and HPPA in the VM."
	This reverts commit 2b264d7e4fb649955ade1814527b6eb6f34f4e18, which is
	unnecessary after commit f5ea0499a411309014475dc7f7983e827f431af2
	("Build with `-fno-strict-aliasing' when available.").

2012-01-28  Chris K. Jester-Young  <cky944@gmail.com>

	Fix double-free error on non-GNU systems.
	* libguile/i18n.c (scm_make_locale): Null out c_locale_name after it's
	  freed, so it doesn't get freed again. While this only has effect if
	  USE_GNU_LOCALE_API is unset, the nulling out happens in both cases,
	  to be consistent and robust.
	  (scm_nl_langinfo): Free c_result in all switch cases, in particular
	  P_SIGN_POSN, N_SIGN_POSN, INT_P_SIGN_POSN, and INT_N_SIGN_POSN.

2012-01-28  Andy Wingo  <wingo@pobox.com>

	mention new manual sections in NEWS
	* NEWS: Mention new sections.

2012-01-27  Ludovic Courtès  <ludo@gnu.org>

	Build with `-fno-strict-aliasing' when available.
	* configure.ac (POTENTIAL_GCC_CFLAGS): Add `-fno-strict-aliasing'.
	  Suggested by Mark H. Weaver.

2012-01-27  Andy Wingo  <wingo@pobox.com>

	attempt to clear stale references on VM C stack
	* libguile/vm-engine.h (DEAD): New macro, nulls out a value.

	* libguile/vm-i-system.c:
	* libguile/vm-i-loader.c:
	* libguile/vm-i-scheme.c: Use DEAD when variables become dead.

	Later we can #ifdef this out, but I want to give the buildbots a try
	with this patch to make sure it's correct.

2012-01-27  Andy Wingo  <wingo@pobox.com>

	vm-i-scheme.c slight refactor
	* libguile/vm-i-scheme.c: Refactor the RETURN macro to not include
	  NEXT.  Adapt all uses to NEXT on their own.

	document `include', `include-from-path'
	* doc/ref/api-evaluation.texi (Local Inclusion): New section.

2012-01-27  Andy Wingo  <wingo@pobox.com>

	more documentation on the process of loading source and compiled files
	* doc/ref/api-evaluation.texi (Load Paths): Move documentation of
	  %load-path and related procedures here, from Build Config.  Add docs
	  for %load-compiled-path.

	* doc/ref/api-foreign.texi:
	* doc/ref/api-modules.texi:
	* doc/ref/api-options.texi:
	* doc/ref/scheme-using.texi: Update xrefs.

2012-01-27  Mark H Weaver  <mhw@netris.org>

	Fix error messages involving definition forms
	* module/ice-9/psyntax.scm (syntax-type): Return an additional value
	  that contains the entire form in _all_ cases, including for definition
	  forms.  Previously, the entire form was not returned for definition
	  forms.

	  (expand-expr): Add an additional argument that contains the entire
	  form in _all_ cases, including for definition forms.  Use it to
	  include the entire form in error messages, notably for definitions in
	  expression context.  Include the source location information, which
	  was previously missing from these errors when the rhs expression was
	  an atom.  Improve the "definition in expression context" error message
	  to be more comprehensible for Scheme beginners.

	  (expand-top-sequence, expand, expand-body): Adjust as needed to handle
	  the additional return value from 'syntax-type' and the additional
	  argument to 'expand-expr'.

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

	* NEWS: Update.

2012-01-26  Andy Wingo  <wingo@pobox.com>

	update NEWS
	* NEWS: Update.

	fix test-loose-ends
	* test-suite/standalone/test-loose-ends.c (test_scm_local_eval): Use
	  ice-9 local-eval to get (the-environment).

	update local-eval docs
	* doc/ref/api-evaluation.texi (Local Evaluation): Update docs, add some
	  examples.

2012-01-26  Andy Wingo  <wingo@pobox.com>

	more readable gensyms
	* module/language/tree-il/peval.scm (peval):
	* module/language/tree-il/primitives.scm (dynamic-wind): When you make a
	  gensym that just has to be compared against other gensyms, it will be
	  unique if the prefix doesn't end in something that can be interpreted
	  as a number.  There's no reason to make that character something
	  difficult like " ".  So change to use a dash in that case.

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

2012-01-26  Andy Wingo  <wingo@pobox.com>

	globally unique marks and labels using syntax-session-id
	* libguile/macros.c (scm_init_macros): Add definition of new
	  syntax-session-id helper.

	* module/ice-9/psyntax.scm: Capture a reference to syntax-session-id at
	  boot time.  Uniquify marks and labels using the session id.

	* module/ice-9/boot-9.scm: Shunt syntax-session-id off to (system
	  syntax) once we finished booting.

	* module/ice-9/compile-psyntax.scm: Override syntax-session-id when
	  remaking psyntax to avoid spurious diffs.

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

2012-01-26  Andy Wingo  <wingo@pobox.com>

	Revert "Universally-unique gensyms"
	This reverts commit ad432bc8317c33899efc29854550b67f3d7babf7.

	Not all gensyms need to be universally-unique: most of them just need to
	be unique within some portion of a Guile session.  We'll take a
	different tack on this problem in the next commit.

2012-01-26  Andy Wingo  <wingo@pobox.com>

	Implement `local-eval', `local-compile', and `the-environment'
	* module/ice-9/local-eval.scm: New module (ice-9 local-eval) which
	  exports `the-environment', `local-eval', and `local-compile'.

	* libguile/debug.c (scm_local_eval): New C function that calls the
	  Scheme implementation of `local-eval' in (ice-9 local-eval).

	* libguile/debug.h (scm_local_eval): Add prototype.

	* doc/ref/api-evaluation.texi (Local Evaluation): Add documentation.

	* test-suite/tests/eval.test (local evaluation): Add tests.

	* test-suite/standalone/test-loose-ends.c (test_scm_local_eval):
	  Add test.

	* module/Makefile.am: Add ice-9/local-eval.scm.

	Based on a patch by Mark H Weaver <mhw@netris.org>.

2012-01-26  Ludovic Courtès  <ludo@gnu.org>

	Fix a couple of warnings.
	* module/scripts/list.scm: Use SRFI-1.
	* module/system/repl/error-handling.scm: Use (ice-9 format).

	Fix typo in `-Wformat'.
	* module/language/tree-il/analyze.scm (format-analysis): Call `warning',
	  not `warn'.

2012-01-26  Ludovic Courtès  <ludo@gnu.org>

	Add warnings for unsupported `simple-format' options.
	* module/language/tree-il/analyze.scm
	  (format-analysis)[check-simple-format-args]: New procedure.  Use it.
	  Add support for applications of <module-ref>.

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

	* module/language/scheme/spec.scm (scheme)[make-default-environment]:
	  Use `simple-format' as the default `format'.

	* test-suite/tests/tree-il.test ("warnings")["format"]: Explicitly use
	  (@ (ice-9 format) format) where needed.
	  ("simple-format"): New test prefix.

2012-01-25  Ludovic Courtès  <ludo@gnu.org>

	Import Gnulib's `setenv' module, for MinGW.
	Reported by Eli Zaretskii <eliz@gnu.org>.

	* m4/gnulib-cache.m4 (gl_MODULES): Add `setenv'.

2012-01-25  Andy Wingo  <wingo@pobox.com>

	new syntax procedures to (system syntax)
	* module/ice-9/boot-9.scm:
	* module/ice-9/psyntax.scm (syntax-module, syntax-local-binding)
	  (syntax-locally-bound-identifiers): After boot, move these definitions
	  to a new (system syntax) module.

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

	* doc/ref/api-macros.texi: Add some words about syntax-module and
	  friends being in (system syntax).

2012-01-25  Andy Wingo  <wingo@pobox.com>

	add syntax-module
	* module/ice-9/psyntax.scm (syntax-module): New accessor for syntax
	  objects.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	* module/ice-9/boot-9.scm: Declare syntax-module.

	* doc/ref/api-macros.texi: Document it.

2012-01-25  Andy Wingo  <wingo@pobox.com>

	add syntax-locally-bound-identifiers
	* module/ice-9/boot-9.scm (syntax-locally-bound-identifiers): Declare
	  variable.
	* module/ice-9/psyntax.scm: Add locally-bound-identifiers helper, and
	  define syntax-locally-bound-identifiers.
	* module/ice-9/psyntax-pp.scm: Regenerated.
	* doc/ref/api-macros.texi: Document the new procedure.

	fix "lexical vars are collectable" test
	* test-suite/tests/gc.test ("gc"): Fix "lexical vars are collectable"
	  test.  (Previously, the binding was getting inlined, so we weren't
	  testing what we meant to test.  Besides that, the value was a
	  constant, not a closure, so it wasn't collectable in the first place!)

	better function prologue disassembly
	* module/language/assembly/disassemble.scm (code-annotation): Add an
	  annotation for assert-nargs-ee/locals and assert-nargs-ge/locals.

	add another case in which to fold (values FOO) to FOO, for some FOO
	* module/language/tree-il/peval.scm (peval): Fold (values
	  'singly-valued-expression) to 'singly-valued-expression in contexts
	  that expect multiple values, in addition to those that expect single
	  values.

	fix values miscompilation in push context with RA
	* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Fix
	  miscompilation of `values' in a push context with RA.
	* test-suite/tests/tree-il.test: Add low-level test for this
	  miscompilation.

2012-01-24  Ludovic Courtès  <ludo@gnu.org>

	Work around instruction reordering on SPARC and HPPA in the VM.
	Fixes part of <http://bugs.gnu.org/10520>.
	Reported by Bruno Haible <bruno@clisp.org>.

	* libguile/vm-i-system.c (COMPILER_BARRIER): New macro.
	  (halt, return, return_values): Insert compiler barrier after each
	  assignment to `fp'.

2012-01-24  Ludovic Courtès  <ludo@gnu.org>

	vlist: Use (ice-9 format).
	* module/ice-9/vlist.scm: Use (ice-9 format).

2012-01-23  Ludovic Courtès  <ludo@gnu.org>

	FFI: Fix `set-pointer-finalizer!' to leave the type cell unchanged.
	This is a followup to 690a0112e55823aa8b862daeddcf44cea97e7917 ("Remove
	the "has finalizer?" bit from pointer objects.")

	* libguile/foreign.c (scm_set_pointer_finalizer_x): Leave the type cell
	  unchanged.  Before, `equal?' would break on pointers on which
	  `set-pointer-finalizer!' had been called.

	* test-suite/tests/foreign.test ("make-pointer")["equal? modulo
	  finalizer (set-pointer-finalizer!)"]: New test.

2012-01-23  Ludovic Courtès  <ludo@gnu.org>

	guile-readline: Clean `.go' files.
	* guile-readline/Makefile.am (CLEANFILES): Add *.go.

2012-01-23  Andy Wingo  <wingo@pobox.com>

	current-filename canonicalizes path, remove add-to-path
	* module/ice-9/boot-9.scm (current-filename): Canonicalize the path, so
	  that the result is independent of the current directory, and so
	  that `dirname' can traverse up the file system, as in the
	  add-to-load-path example.
	  (add-to-path): Remove.  The eval-when semantics make this macro too
	  tricky to explain -- people will start using it on other path-like
	  things, in lexical contours, whereas it only really makes sense with
	  load-like paths at the toplevel.

	* doc/ref/api-evaluation.texi (Loading): Fix link to load-with-path
	  docs, and remove add-to-path docs.

2012-01-23  Ludovic Courtès  <ludo@gnu.org>

	Adjust tests that relied on the output of the hash table printer.
	* libguile/hashtab.c (scm_i_hashtable_print): Use `SCM_UNPACK', not
	  `SCM2PTR'.

	* test-suite/tests/hash.test: Adjust tests that rely on the output of
	  the printer to just check for the suffix of the hash table's external
	  representation.

2012-01-23  Ludovic Courtès  <ludo@gnu.org>

	Print the address of hash tables.
	* libguile/hashtab.c (scm_i_hashtable_print): Print the address of EXP.

2012-01-22  Ludovic Courtès  <ludo@gnu.org>

	Augment `release.org'.
	* doc/release.org: Mention debbugs and `platform-testers@gnu.org'.

2012-01-22  Ludovic Courtès  <ludo@gnu.org>

	Parenthesize and type `SCM_FRAME' macros; check layout of `scm_vm_frame'.
	* libguile/frames.c: Add compile-time assertions on the layout of
	  `struct scm_vm_frame'.
	  (RELOC): Parenthesize and type VAL.

	* libguile/frames.h (SCM_FRAME_STRUCT): Write in terms of
	  `SCM_FRAME_DATA_ADDRESS'.
	  (SCM_FRAME_DATA_ADDRESS): Parenthesize and type FP.
	  (SCM_FRAME_SET_DYNAMIC_LINK): Write in terms of
	  `SCM_FRAME_DYNAMIC_LINK'.

	* libguile/vm.c (RELOC): Parenthesize and type SCM_P.

2012-01-22  Ludovic Courtès  <ludo@gnu.org>

	Relax `asm-to-bytecode.test' for when target CPU == native CPU.
	* test-suite/tests/asm-to-bytecode.test (native-cpu, native-word-size):
	  New procedures.
	  (test-target): When the target is the native CPU, use the native word
	  size instead of WORD-SIZE.

2012-01-21  Mark H Weaver  <mhw@netris.org>

	Universally-unique gensyms
	* libguile/symbols.c (scm_gensym): Make the gensym counter a 128-bit
	  thread-local, initialized to a random number upon the first call to
	  `gensym' within a given thread.  This counter is rendered as a 22 byte
	  suffix of mostly base64 digits.

	* libguile/threads.h (scm_i_thread): Add a thread-local gensym_counter.

	* libguile/threads.c (guilify_self_1): Initialize gensym_counter to NULL.

2012-01-21  Mark H Weaver  <mhw@netris.org>

	Add `random-state-from-platform' and `scm_i_random_bytes_from_platform'
	* libguile/random.c (scm_random_state_from_platform): New procedure.
	  (scm_i_random_bytes_from_platform): New internal function.

	* libguile/random.h (scm_random_state_from_platform,
	  scm_i_random_bytes_from_platform): Add prototypes.

	* doc/ref/api-data.texi (Random): Add documentation.

2012-01-21  Andy Wingo  <wingo@pobox.com>

	add current-filename, add-to-path, add-to-load-path
	* module/ice-9/boot-9.scm (current-filename, add-to-path)
	  (add-to-load-path): New syntaxen.

	* doc/ref/api-evaluation.texi (Loading): Move load-path related
	  procedures to a new section:
	  (Load Paths): Hither.  Document add-to-path and add-to-load-path.

	* doc/ref/api-debug.texi (Source Properties): Document
	  current-source-location and current-filename.

	* doc/ref/api-modules.texi:
	* doc/ref/guile-invoke.texi:
	* doc/ref/scheme-using.texi: Update @ref for Load Paths change.

2012-01-20  Andy Wingo  <wingo@pobox.com>

	remove duplicate when/unless definitions
	* module/rnrs/control.scm:
	* module/sxml/ssax.scm:
	* test-suite/lalr/common-test.scm: Remove local `when'/`unless'
	  definitions.

2012-01-20  Andy Wingo  <wingo@pobox.com>

	add when, unless
	* module/ice-9/boot-9.scm (when, unless): New forms.

	* doc/ref/api-control.texi (Conditionals): Add docs.  Rename this
	  node from "if cond case".

	* doc/ref/r6rs.texi:
	* doc/ref/scheme-ideas.texi:
	* doc/ref/srfi-modules.texi: Update referrers.

2012-01-19  Andy Wingo  <wingo@pobox.com>

	avoid gensym when making labels in psyntax
	* module/ice-9/psyntax.scm (gen-label): Avoid gensym, as we don't need
	  to make symbols.

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

2012-01-19  Andy Wingo  <wingo@pobox.com>

	add syntax-local-binding
	* module/ice-9/boot-9.scm (syntax-local-binding): New binding.

	* module/ice-9/psyntax.scm: Locally define a fluid that holds the
	  "transformer environment".  with-transformer-environment calls a
	  procedure with the transformer environment, or raises an error if
	  called outside the extent of a transformer.  Bind
	  transformer-environment in expand-macro.
	  (resolve-identifier): Backport this helper from master.
	  (syntax-local-binding): New procedure to return binding information of
	  a bound identifier (a lexical, macro, a pattern variable, a displaced
	  lexical, a global, or some other form).

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

	* doc/ref/api-macros.texi (Syntax Transformer Helpers): Add docs for
	  syntax-local-binding, and syntax-source, and move some other
	  descriptions to this new section.

2012-01-19  Mark H Weaver  <mhw@netris.org>

	Add `scm_c_value_ref' to allow access to multiple returned values from C
	Based on a patch by Julian Graham <julian@member.fsf.org>

	* libguile/values.c, libguile/values.h (scm_c_value_ref): New function.
	* doc/ref/api-control.texi (Multiple Values): Add documentation.
	* test-suite/standalone/test-scm-values.c: New test program.
	* test-suite/standalone/Makefile.am: Add test-scm-values test.

2012-01-16  Ludovic Courtès  <ludo@gnu.org>

	Update Gnulib to v0.0-6827-g39c3009; use the `dirfd' module.
	* m4/gnulib-cache.m4: Use `dirfd'.

	* libguile/filesys.c: Include Gnulib's <dirent.h> directly.
	  (dirfd): Remove.  Suggested by Bruno Haible <bruno@clisp.org>.

2012-01-16  Ludovic Courtès  <ludo@gnu.org>

	Improve wording in README regarding `pkg-config'.
	* README: Mention $PKG_CONFIG_PATH, and make it clear that $BDW_GC_LIBS,
	  etc. aren't normally needed.

	Fix typo in threads.c on IA64.
	* libguile/threads.c (guilify_self_1)[__ia64__]: Fix typo.  Reported by
	  Bruno Haible <bruno@clisp.org>.

	Skip `tr_TR' tests on Solaris 2.10.
	* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved):
	  Special-case Solaris 2.10.

2012-01-15  Chris K. Jester-Young  <cky944@gmail.com>

	Add #ifdefs for langinfo items that don't exist on OpenBSD.
	* libguile/i18n.c (define_langinfo_items): Add #ifdefs for ERA_* and
	  ALT_DIGITS, as those constants don't exist on OpenBSD.

	Call scm-error with the correct argument order.
	* module/ice-9/boot-9.scm (catch, with-throw-handler): Switch the order
	  of the error key and function name arguments.

2012-01-14  Ludovic Courtès  <ludo@gnu.org>

	Have `statprof.test' fail gracefully when samples could not be collected.
	* test-suite/tests/statprof.test ("statistical sample counts within
	  expected range"): Throw unresolved when one of A-DATA, B-DATA, and
	  C-DATA is #f, which means samples were not collected for this one.

	Avoid non-portable `tail' argument in `test-guile-snarf'.
	* test-suite/standalone/test-guile-snarf (strip_first_line): New
	  function.
	  (snarf): Use it.

	Fix signed/unsigned pointer mismatches.
	* libguile/foreign.c (scm_pointer_to_bytevector,
	  scm_bytevector_to_pointer): Use pointers of the same signedness.

2012-01-14  Mark H Weaver  <mhw@netris.org>

	Don't diverge when serializing cyclic lists during compilation
	* module/language/glil/compile-assembly.scm (scheme-list?): Don't
	  diverge when serializing cyclic lists.

2012-01-14  Mark H Weaver  <mhw@netris.org>

	Fix serialization of #nil-terminated lists during compilation
	* module/language/glil/compile-assembly.scm (scheme-list?): New
	  predicate, like `list?' but requires that the last cdr must be '(),
	  not #nil.

	  (dump-object, dump-constants): Use `list' opcode to create a list only
	  if it is terminated by '().  If it's terminated by #nil, we must use
	  the more general `cons' opcode.

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

	fix array printing
	* libguile/print.c (iprin1): Fix unmatched ENTER_NESTED_DATA.  Fixes
	  http://debbugs.gnu.org/10482.  Thanks to Daniel Llorens for the
	  report.

	update NEWS
	* NEWS: Minor edits.  Remove a THANKS; we need to assemble a larger
	  THANKS for this release.

2012-01-12  Ludovic Courtès  <ludo@gnu.org>

	Make sure `scm_spawn_thread' returns a thread.
	* libguile/threads.c (scm_spawn_thread): Add an assertion that
	  DATA.thread is a thread.  This assertion is sometimes hit on
	  x86_64-freebsd8.2.

	Disable statprof tests on platforms that lack `ITIMER_PROF' support.
	* test-suite/tests/statprof.test (when-implemented): New macro.
	  ("statistical sample counts within expected range", "accurate call
	  counting"): Use it.

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

	update NEWS
	* NEWS: Update.

	print-options doc update
	* doc/ref/api-evaluation.texi (Scheme Write): Update print-options.

	fluids.c docstring
	* libguile/fluids.c (scm_make_fluid_with_default): Update docstring.

	Move parameters documentation to core
	* doc/ref/api-scheduling.texi (Fluids and Dynamic States): Update for
	  default values.
	  (Parameters): Move here from srfi-39, and adapt.

	add docs for scm_gc_register_allocation
	* doc/ref/api-memory.texi: Update for scm_gc_register_allocation.
	  Remove docs for scm_gc_{un,}register_collectable_memory.

2012-01-10  Mark H Weaver  <mhw@netris.org>

	Remove docs `procedure-environment', which no longer exists
	* doc/ref/api-procedures.texi (Procedure Properties): Remove the entry
	  for `procedure-environment', which no longer exists.

	Use a common null stringbuf in `scm_i_make_string'
	* libguile/strings.c (scm_i_make_string): Use a common null stringbuf
	  for newly-allocated empty strings.

	Empty substrings no longer reference the original stringbuf
	* libguile/strings.c (scm_i_substring, scm_i_substring_read_only,
	  scm_i_substring_shared): When asked to create an empty substring,
	  return a freshly allocated null string.  Previously, an empty
	  substring needlessly held a reference to the original stringbuf.

	scm_i_substring_copy tries to narrow the substring
	* libguile/strings.c (scm_i_substring_copy): Try to narrow the substring
	  if it came from a wide string.

	Avoid calling `u32_conv_from_encoding' on the null string
	* libguile/strings.c (scm_from_stringn): Avoid calling
	  `u32_conv_from_encoding' on the null string, by using the same
	  fast-path code used if (encoding == NULL).  This is an optimization,
	  and also avoids any possible encoding errors.

2012-01-10  Mike Gran  <spk121@yahoo.com>

	Typo in documentation of local-boxed-set
	* doc/ref/vm.texi: modified

2012-01-10  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/__scm.h
		libguile/array-map.c
		libguile/procprop.c
		libguile/tags.h
		module/ice-9/deprecated.scm
		module/ice-9/psyntax-pp.scm
		module/ice-9/psyntax.scm
		test-suite/standalone/test-num2integral.c
		test-suite/tests/regexp.test

2012-01-10  Mark H Weaver  <mhw@netris.org>

	Remove null string optimization from scm_from_stringn
	* libguile/strings.c (scm_from_stringn): Always return a freshly
	  allocated string from scm_from_stringn, even when asked to construct
	  the null string, in accordance with the R5RS.  Previously, we
	  optimized the null string case by returning a reference to a global
	  null string object (scm_nullstr).

2012-01-10  Andy Wingo  <wingo@pobox.com>

	Merge commit 'f78a1ccede02ccad89d6c91a6b297f1f14a30907'

	Merge commit 'cc8afa2b361635953dfba7f10e4193b1f243a50f'
	Conflicts:
		module/ice-9/psyntax-pp.scm
		module/language/tree-il/peval.scm

2012-01-09  Daniel Hartwig  <mandyke@gmail.com>

	permit non-date values for Expires header
	* module/web/http.scm ("Expires"): Permit (some) non-date values.

2012-01-09  Ludovic Courtès  <ludo@gnu.org>

	Have `cpu-word-size' error out on unknown CPUs; add support for MIPSEL.
	* module/system/base/target.scm (cpu-word-size): Add support for
	  `mipsel'.  Call `error' when CPU is unknown.

	Make sure `regexp-quote' tests use Unicode-capable string ports.
	* test-suite/tests/regexp.test (with-unicode): New macro.
	  ("regexp-quote"): Wrap all `regexp-quote' calls in it.  This fixes
	  tests on machines where the default port encoding is US-ASCII.

	Fix incorrect use of `SCM_UNPACK'.
	* libguile/arrays.c (scm_i_make_array): Cast the result of
	  `scm_gc_malloc' directly to `scm_t_bits'.

	i18n: Fix gc_malloc/free mismatch on non-GNU systems.
	* libguile/i18n.c (scm_i_locale_free): Remove.
	  (smob_locale_free): Define only when USE_GNU_LOCALE_API.
	  (scm_make_locale)[!USE_GNU_LOCALE_API]: Allocate
	  `c_locale->locale_name' with `scm_gc_strdup', not `malloc'.

	i18n: Disable Turkish locale tests on FreeBSD 8.
	* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved):
	  Check %HOST-TYPE and throw `unresolved' on FreeBSD 8.

	Fix loose typing in `test-scm-spawn-thread.c'.
	* test-suite/standalone/test-scm-spawn-thread.c (inner_main): Use
	  `SCM2PTR' instead of a cast.

2012-01-09  Andy Wingo  <wingo@pobox.com>

	allocate a tc7 to bitvectors
	* libguile/tags.h (scm_tc7_bitvector): Allocate a tc7 to bitvectors.

	* libguile/print.c (iprin1):
	* libguile/goops.c:
	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/eq.c (scm_equal_p): Add cases for bitvectors.

	* libguile/bitvectors.h: Declare internal print and equal? helpers.

	* libguile/bitvectors.c: Use a tc7 instead of a smob type.

2012-01-09  Andy Wingo  <wingo@pobox.com>

	allocate a tc7 to arrays
	* libguile/tags.h (scm_tc7_array): Allocate a tag for arrays.
	* libguile/arrays.h (SCM_I_ARRAYP): Change to use scm_tc7_array.  The
	  previous definition was not externally usable because scm_i_tc16_array
	  was internal.
	  (scm_i_print_array): Declare, though internally.

	* libguile/arrays.c (scm_i_make_array): Use scm_cell with the tc7
	  instead of NEWSMOB.
	  (scm_i_print_array): Make not static.
	  (SCM_ARRAY_IMPLEMENTATION): Adapt.
	  (scm_init_arrays): Remove array smob declaration.

	* libguile/eq.c (scm_equal_p): Refactor to put the string, pointer, and
	  bytevector cases in the switch.  Add a case for arrays.

	* libguile/goops.c: Add <array> declarations.

	* libguile/print.c (iprin1): Call scm_i_print_array as needed.

	* libguile/evalext.c (scm_self_evaluating_p): Add a case for arrays.

2012-01-09  Andy Wingo  <wingo@pobox.com>

	primitive-load returns the value(s) of the last expression
	* libguile/load.c (scm_primitive_load): Return the values yielded from
	  evaluating the last expression in the file.

	* test-suite/tests/load.test ("return value of `load'"): Add tests.

2012-01-09  Rob Browning  <rlb@defaultvalue.org>

	Define _GNU_SOURCE to fix the GNU/kFreeBSD build.
	Author: Petr Salinger <Petr.Salinger@seznam.cz>
	Closes: #401168

	Fix the SRFI 60 copy-bit documentation.

2012-01-09  Andy Wingo  <wingo@pobox.com>

	test-pthread-create-secondary: gc/gc.h, not gc/gc_version.h
	* test-suite/standalone/test-pthread-create-secondary.c: Include
	  gc/gc.h.  It works on libgc from git, and on 7.1.

2012-01-09  Mark H Weaver  <mhw@netris.org>

	Avoid calling scm_i_string_start_writing if no chars will be mutated
	* libguile/srfi-13.c (scm_string_copy_x, scm_substring_fill_x,
	  string_upcase_x, string_downcase_x, string_titlecase_x,
	  string_reverse_x, scm_string_xcopy_x): Avoid calling
	  `scm_i_string_start_writing' if the range of indices to be modified is
	  empty.  This avoids the error that would be raised by
	  `scm_i_string_start_writing' if the string is not mutable.
	  Thanks to Bruce Korb <bkorb@gnu.org> for reporting this problem
	  and suggesting the fix.

2012-01-08  Andy Wingo  <wingo@pobox.com>

	no need to warn people off of s_FOO generated by SCM_DEFINE
	* doc/ref/libguile-snarf.texi (Function Snarfing): The s_FOO binding
	  isn't deprecated; no need to warn people to stop using it.  Thanks to
	  Peter Brett for the hint.

	allow scm_display_error to use a stack as the first argument
	* libguile/backtrace.c (scm_display_error): Allow a deprecated use of
	  this function to pass a stack as the first argument.  Thanks to Peter
	  Brett for pointing it out, in
	  http://lists.gnu.org/archive/html/guile-user/2011-06/msg00000.html.

2012-01-08  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in `test-num2integral.c'.
	* test-suite/standalone/test-num2integral.c (out_of_range_handler): Use
	  `scm_is_eq' when comparing KEY.

2012-01-08  Ludovic Courtès  <ludo@gnu.org>

	ftw: Add an `error' parameter to `file-system-fold'.
	* module/ice-9/ftw.scm (errno-if-exception): New macro.
	  (file-system-fold): Add an `error' parameter.  Wrap `opendir' and STAT
	  calls in `errno-if-exception' and call ERROR when appropriate.
	  (file-system-tree): Provide an `error' procedure.  Return #f when
	  FILE-NAME is unreadable.
	  (scandir): Provide an `error' procedure.

	* test-suite/tests/ftw.test (%top-builddir): New variable.
	  (make-file-tree, delete-file-tree): New procedures.
	  (with-file-tree): New macro.
	  ("file-system-fold"): Update tests to add an `error' procedure.
	  ["ENOENT", "EACCES", "dangling symlink and lstat", "dangling symlink
	  and stat"]: New tests.
	  ("file-system-tree")["ENOENT"]: New test.
	  ("scandir")["EACCES"]: New test.

	* doc/ref/misc-modules.texi (File Tree Walk): Update `file-system-fold'
	  documentation.

2012-01-08  Andy Wingo  <wingo@pobox.com>

	fix SCM_ASRTGO deprecation
	* libguile/__scm.h (SCM_ASRTGO): Whoops, actually remove the ASRTGO
	  definitions here.
	* libguile/deprecated.h: Fix type of scm_i_deprecated_asrtgo.

	syntax parameters doc formatting
	* doc/ref/api-macros.texi (Syntax Parameters): Some copy-editing on
	  Ian's lovely syntax-parameters documentation.

2012-01-08  Andy Wingo  <wingo@pobox.com>

	deprecate SCM_ASRTGO
	* libguile/deprecated.h: Mark scm_immutable_cell and
	  scm_immutable_double_cell as being SCM_DEPRECATED, not SCM_API.
	  Deprecate SCM_ASRTGO.

	* libguile/deprecated.c (scm_i_deprecated_asrtgo): New support
	  procedure.

	* doc/ref/api-control.texi (Handling Errors): Remove ASRTGO docs.

2012-01-08  Ian Price  <ianprice90@googlemail.com>

	document syntax parameters
	* doc/ref/api-macros.texi (Macros): Add subsection for "Syntax Parameters"

2012-01-07  Mark H Weaver  <mhw@netris.org>

	Fix bugs related to mutation-sharing substrings
	* libguile/strings.c (scm_i_is_narrow_string, scm_i_try_narrow_string,
	  scm_i_string_set_x): Check to see if the provided string is a
	  mutation-sharing substring, and do the right thing in that case.
	  Previously, if such a string was passed to these functions, they would
	  behave very badly: while trying to fetch and/or mutate the cell
	  containing the stringbuf, they were actually fetching or mutating the
	  cell containing the original shared string.  That's because
	  mutation-sharing substrings store the original string in CELL_1,
	  whereas all other strings store the stringbuf there.

	Make scm_nullstr mutable
	* libguile/strings.c (scm_init_strings): Make scm_nullstr mutable.  It
	  is still usable as a common object, because of course it contains no
	  characters to mutate anyway.  It is returned by several procedures
	  that are specified to return mutable strings, and string mutators
	  raise errors when passed an immutable string, even if it is the null
	  string.

2012-01-07  Andy Wingo  <wingo@pobox.com>

	don't leak file descriptors when mmaping objcode
	* libguile/objcodes.c (make_objcode_from_file): Close the mmap'd file,
	  so that we don't leak the descriptor.  I was previously under the
	  mistaken impression that closing the fd unmapped the memory, which is
	  not the case.  Thanks to Cedric Cellier for the tip!

2012-01-07  Ian Price  <ianprice90@googlemail.com>

	`write-request-line' writes absolute paths, not absolute URIs.
	* module/web/http.scm (write-request-line): RFC 2616 says that absolute
	  paths are used to identify resources on an origin server.

2012-01-07  Andy Wingo  <wingo@pobox.com>

	remove duplicate write-uri definition
	* module/web/http.scm: Remove duplicate write-uri definition.

	update api-modules.texi
	* doc/ref/api-modules.texi (Modules): Add subsection for "Modules and
	  the File System".  Move "Included Guile Modules" to the end.  Move
	  "Module System Reflection" after "Variables", as we need to know about
	  variables.  Flesh out "Module System Reflection" a bit, with docs on
	  module-ref, module-variable, and other bindings.  General editing.

2012-01-06  Andy Wingo  <wingo@pobox.com>

	deprecate fluid-let-syntax in favor of syntax-parameterize
	* module/ice-9/psyntax.scm (syntax-parameterize): Rename from
	  fluid-let-syntax.

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

	* module/ice-9/boot-9.scm (define-inlinable): Use syntax-parameterize
	  (and define-syntax-parameter).

	* module/ice-9/deprecated.scm (fluid-let-syntax): Add deprecated shim.

2012-01-06  Andy Wingo  <wingo@pobox.com>

	add define-syntax-parameter, same as define-syntax
	* module/ice-9/psyntax.scm (define-syntax-parameter): New toplevel form.
	  Will be used to implement syntax parameters, following Barzilay,
	  Culpepper, and Flatt's 2011 SFP workshop paper, "Keeping it Clean with
	  syntax-parameterize".  Adds a new binding type and definition form.

	Conflicts:

		module/ice-9/psyntax.scm

2012-01-05  Ludovic Courtès  <ludo@gnu.org>

	Fix the exception type of the (begin) test.
	* test-suite/tests/syntax.test (exception:zero-expression-sequence): New
	  variable.
	  ("begin")["legal (begin)"]: Rename to "valid (begin)".
	  ["illegal (begin)"]: Ditto.  Expect `exception:zero-expression-sequence'.

	Placate a number of `syntax-check' verifications.
	  - "filesystem" -> "file system"
	  - remove doubled words
	  - use EXIT_* macros instead of literal numbers
	  - update `syntax-check' exclusion files

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

	Fix erroneous check in `set-procedure-properties!'.
	* libguile/procprop.c
	  (scm_set_procedure_properties_x)[SCM_ENABLE_DEPRECATED == 1]: Pass arguments
	  to `scm_assq' in the right order, and check its return value with
	  `scm_is_true'.  Reported by Mike Gran <spk121@yahoo.com>.

2012-01-05  Ludovic Courtès  <ludo@gnu.org>

	Raise an error for (begin) when `--disable-deprecated'.
	* module/ice-9/psyntax.scm (define-expansion-constructors)[begin-form]:
	  Emit a syntax-violation error for empty sequences when
	  --disable-deprecated.

	* test-suite/tests/syntax.test (pass-if-syntax-error): Fix typo in error
	  message.

2012-01-04  Mark H Weaver  <mhw@netris.org>

	Fix docs of string mutators to do so on a mutable string
	* doc/ref/api-data.texi (String Modification): Change
	  (define y "abcdefg") => (define y (string-copy "abcdefg"))
	  before mutating the string bound to y in the example code.

2012-01-04  Mike Gran  <spk121@yahoo.com>

	Rework c-api.test to use test lib
	The failure path for the c-api.test had been to call the undefined function
	'fail', instead of logging the error like the other tests.

	* test-suite/tests/c-api.test: modified

2012-01-03  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix typo in `define-wrapped-pointer-type' example.
	* doc/ref/api-foreign.texi (Void Pointers and Byte Access): Fix typo in
	  `define-wrapped-pointer-type' example.

2011-12-31  Mark H Weaver  <mhw@netris.org>

	Fix documentation for vhash-fold and vhash-fold-right
	* doc/ref/api-compound.texi (VHashes): Add missing `init' parameter in
	  documentation for vhash-fold and vhash-fold-right, and also improve
	  description.

	* module/ice-9/vlist.scm (vhash-fold, vhash-fold-right): Rename formal
	  parameter `seed' to `init', to match documentation.  Improve
	  docstrings.

2011-12-31  Mark H Weaver  <mhw@netris.org>

	Fix comment summarizing allocation table
	* module/language/tree-il/analyze.scm (analyze-lexicals): Fix comment,
	  which describes the compiler's allocation table, to match reality.

	Update comment: ~/.guile-ccache => ~/.cache/guile/ccache
	* module/system/base/compile.scm: Update comment to match
	  where the ccache dir now lives: ~/.cache/guile/ccache

2011-12-22  Daniel Llorens  <daniel.llorens@bluewin.ch>

	New array-map! and array-for-each tests
	* ramap.test: New tests.
	  - array-map! with noncompact arrays and more than one argument.
	  - array-for-each with noncompact arrays and more than two arguments.

2011-12-22  Andy Wingo  <wingo@pobox.com>

	fix generalized-vector-{ref,set!} for slices
	* libguile/generalized-vectors.c (scm_c_generalized_vector_ref):
	  (scm_c_generalized_vector_set_x): Fix for the case in which base was
	  not 1, lbnd was not 0, or inc was not 1.

	* test-suite/tests/arrays.test (array): Add a test.  Thanks to Daniel
	  Llorens for the report.

2011-12-22  Andy Wingo  <wingo@pobox.com>

	freebsd itanium support
	* libguile/threads.c (scm_ia64_register_backing_store_base)
	  (scm_ia64_ar_bsp): Provide implementation of these itanium helpers on
	  freebsd.  Thanks to Jim Pryor.

	freebsd implementation of get_thread_stack_base
	* configure.ac: Check for pthread_np.h and pthread_attr_get_np.  Patch
	  by Jim Pryor.
	* libguile/threads.c (get_thread_stack_base): Provide an implementation
	  for FreeBSD.

2011-12-22  Andy Wingo  <wingo@pobox.com>

	stdlib.h, not malloc.h
	* configure.ac: Remove check for malloc.h.

	* libguile/gc-malloc.c:
	* libguile/gc.c:
	* libguile/mallocs.c:
	* libguile/smob.c: Use stdlib instead of malloc.h.

2011-12-22  Andy Wingo  <wingo@pobox.com>

	Make the "Dia Primitives" section of the manual more clear.
	* doc/ref/libguile-program.texi (Dia Primitives): Use
	  scm_assert_smob_type, and update the text.

2011-12-22  Andy Wingo  <wingo@pobox.com>

	HTTP: Fix qstring writing of cache-extension values
	* module/web/http.scm ("Cache-Control"): Write string values using the
	  default val writer, to get quoting correct.

	* test-suite/tests/web-http.test (pass-if-round-trip): New helper.
	  ("general headers"): Check that cache-extensions round trip properly.

2011-12-22  Daniel Hartwig  <mandyke@gmail.com>

	Extend handling of "Cache-Control" header.
	* module/web/http.scm ("Cache-Control"): Value for `max-stale' is
	  optional.  Strict validation for value-less directives (`no-store',
	  etc.).  String values optional for "cache-extension" directives.
	* test-suite/tests/web-http.test: Value for `max-stale' is optional.

2011-12-22  Andy Wingo  <wingo@pobox.com>

	peval fix: (cons 1 #nil) is not (list 1)
	* module/language/tree-il/peval.scm (peval): (cons FOO #nil) is not
	  (cons FOO '()).

	* test-suite/tests/tree-il.test ("partial evaluation"): Add a test.

2011-12-22  Andy Wingo  <wingo@pobox.com>

	peval minor tweak
	* module/language/tree-il/peval.scm (peval): Record residual values in
	  both value and values contexts.  No test cases, it just seemed like a
	  good idea.

2011-12-22  Andy Wingo  <wingo@pobox.com>

	document invalidity of (begin) as expression; add back-compat shim
	* doc/ref/api-control.texi (begin): Update to distinguish between
	  splicing begin and sequencing begin.

	* module/ice-9/psyntax.scm (expand-expr): Add a back-compatibility shim
	  for `(begin)'.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	* test-suite/tests/syntax.test: Update to run illegal (begin) test only
	  if we are not including deprecated features.

2011-12-19  Ludovic Courtès  <ludo@gnu.org>

	ftw: Include sub-directories in the result of `scandir'.
	* module/ice-9/ftw.scm (scandir)[skip]: Keep NAME in the resulting list.

	* test-suite/tests/ftw.test ("scandir")["top-srcdir"]: New test.

2011-12-19  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/feature.c
		m4/gnulib-cache.m4
		module/ice-9/deprecated.scm
		module/language/tree-il/peval.scm

	fix scm_protects deprecation warning
	* libguile/gc.c: Fix warning about scm_protects being deprecated.

	fix peval to preserve effects when folding (values) forms
	* module/language/tree-il/peval.scm (singly-valued-expression?): New
	  helper.
	  (truncate-values): Use the helper.
	  (make-operand): Minor refactor.
	  (set-operand-residual-value!): Try to undo the effects of (values
	  FOO), if the continuation will check itself for the correct number of
	  values.
	  (peval): Fold helpers into fold-constant.  Add a constant-expression?
	  case for (values FOO).  Add a new context: "values", for contexts in
	  which multiple values are allowed, either because of being in a tail
	  context relative to a function, or because of let-values.  "value" is
	  now for single values.  Don't visit operands for "values", as their
	  binding form truncates to one value.  Add a case to fold (values ...)
	  forms.  Fix folding of (lambda), to process the cases in values
	  context instead of tail context (which could have been "value", which
	  would cause the procedure to truncate).

2011-12-19  Ludovic Courtès  <ludo@gnu.org>

	ftw: Fix typos/thinkos in `file-system-fold' and `scandir'.
	* module/ice-9/ftw.scm (file-system-fold): Fix reference to STAT instead
	  of ST.
	  (scandir)[enter?]: Change the argument name to `dir', to avoid
	  confusion.
	  [skip]: Return RESULT, not #f.

2011-12-19  Ludovic Courtès  <ludo@gnu.org>

	ftw: Clarify the behavior of `scandir' for flat files and unreadable dirs.
	* module/ice-9/ftw.scm (scandir)[leaf]: Only add NAME when RESULT is a
	  pair.
	  [down]: Ignore RESULT.
	  Start with #f instead of the empty list.

	* test-suite/tests/ftw.test ("scandir")["flat file"]: New test.

	* doc/ref/misc-modules.texi (File Tree Walk): Update `scandir'
	  documentation accordingly.

2011-12-19  Christian Persch  <chpe@gnome.org>

	Add a deprecated alias for $expt
	* module/ice-9/deprecated.scm: Add alias for $expt. $expt was removed
	  in commit 6fc4d0124d633d1b3ddc5af82967f23bd17556f8 but no deprecated
	  alias was added in ad79736c68a803a59814fbfc0cb4b092c2b4cddf like for
	  all the other deprecated $sin, $cos, ... functions.

2011-12-19  Andreas Schwab  <schwab@linux-m68k.org>

	FFI: Properly unpack small integer return values in closure call.
	Fixes <http://debbugs.gnu.org/10203>.

	* libguile/foreign.c (unpack): Add parameter return_value_p.
	  Properly store integer return values smaller than int.
	  (scm_i_foreign_call): Update call to unpack.
	  (invoke_closure): Likewise.

2011-12-18  Ludovic Courtès  <ludo@gnu.org>

	doc: Add link from `opendir' to (ice-9 ftw).
	* doc/ref/posix.texi (File System): Add link to "File Tree Walk".

	doc: Use `@deffn {Scheme Procedure}' in `misc-modules.texi'.
	* doc/ref/misc-modules.texi: Use `@deffn {Scheme Procedure}' instead of
	  `@defun'.

2011-12-18  Ludovic Courtès  <ludo@gnu.org>

	ftw: Add `scandir'.
	Suggested by Nala Ginrut <nalaginrut@gmail.com>.

	* module/ice-9/ftw.scm (scandir): New procedure.
	* test-suite/tests/ftw.test ("scandir"): New test prefix.
	* doc/ref/misc-modules.texi (File Tree Walk): Document `scandir'.

2011-12-18  Ludovic Courtès  <ludo@gnu.org>

	ftw: Add an optional `stat' parameter to `file-system-fold' and `-tree'.
	* module/ice-9/ftw.scm (file-system-fold): Add an optional `stat'
	  parameter.  Use it instead of `lstat'.  Handle the case where (STAT child)
	  fails.
	  (file-system-tree): Likewise, and pass it to `file-system-fold'.

	* doc/ref/misc-modules.texi (File Tree Walk): Update the documentation
	  of these functions.

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

	Arrange to convert command-line arguments from the right encoding.
	This is a temporary workaround for the 2.0 stable series.  The next
	stable series should have an implicit `setlocale (LC_ALL, "")' call,
	which will make this unnecessary.

	* libguile/feature.c (progargs_fluid): Rename to...
	  (scm_program_arguments_fluid): ... this.  Update users.

	* libguile/feature.h (scm_program_arguments_fluid): New internal
	  declaration.

	* libguile/init.c (invoke_main_func): Call
	  `scm_i_set_boot_program_arguments' instead of
	  `scm_set_program_arguments'.

	* libguile/script.c (locale_arguments_to_string_list,
	  scm_i_set_boot_program_arguments): New functions.
	  (scm_compile_shell_switches): Use `locale_arguments_to_string_list'.

	* libguile/script.h (scm_i_set_boot_program_arguments): New internal
	  declaration.

	* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add
	  `test-command-line-encoding'.
	* test-suite/standalone/test-command-line-encoding: New file.

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

	Use Gnulib's `localcharset', with local patches.
	This follows Bruno Haible's suggestion at
	<http://lists.gnu.org/archive/html/guile-devel/2011-11/msg00055.html>.

	* m4/gnulib-cache.m4: Add `gl_LOCAL_DIR'; use `localcharset'.

	* Makefile.am (EXTRA_DIST): Add gnulib-local/lib/localcharset.[ch].diff.
	  (TESTS_ENVIRONMENT): New variable.

	* gnulib-local/lib/localcharset.c.diff,
	  gnulib-local/lib/localcharset.h.diff: New files.

	* test-suite/Makefile.am (TESTS_ENVIRONMENT): Add
	  @LOCALCHARSET_TESTS_ENVIRONMENT@.
	* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Likewise.

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

	Augment `.gitignore'.

	Update Gnulib to v0.0-6703-g4e0358a.

	Use `alignof_type' instead of `alignof'.
	* libguile/foreign.c: Use `alignof_type' instead of `alignof'; the
	  latter was removed from Gnulib's <alignof.h> in
	  408e170e3ae81f73fb65686c5834693d89a96594 (Nov. 1 2011).
	* libguile/vm-i-scheme.c: Likewise.

	doc: Set document encoding to UTF-8; typeset my surname correctly.
	* doc/ref/guile.texi: Add @documentencoding.
	* doc/ref/history.texi: Always write "Court@`es".
	* doc/ref/preface.texi (Contributors): Likewise.

2011-12-13  Ludovic Courtès  <ludo@gnu.org>

	Add `file-system-fold' and `file-system-tree' to (ice-9 ftw).
	* module/ice-9/ftw.scm (file-system-fold, file-system-tree): New
	  procedures.

	* test-suite/tests/ftw.test (%top-srcdir, %test-dir): New variables.
	  ("file-system-fold", "file-system-tree"): New test prefixes.

	* doc/ref/misc-modules.texi (File Tree Walk): Document
	  `file-system-tree' and `file-system-fold'.

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

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		configure.ac

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

	add an apropos-hook to ice-9 session
	* module/ice-9/session.scm: #:keyword-ify the define-module form, and
	  export apropos-hook.
	  (apropos-hook): New hook.
	  (apropos, apropos-fold): Run the apropos-hook.

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

	current-input-port et al are srfi-39 parameters
	* libguile/ports.c (scm_init_ports): Export the port fluids to Scheme,
	  temporarily.

	* module/ice-9/boot-9.scm (fluid->parameter): Turn `current-input-port'
	  et al into srfi-39 parameters, backed by the exported fluids, then
	  remove the fluids from the guile module.
	  (%cond-expand-features): Add srfi-39.

	* module/srfi/srfi-39.scm: Re-export features from boot-9.

	* test-suite/tests/parameters.test: Add tests.

2011-12-08  Chris K. Jester-Young  <cky944@gmail.com>

	fix compilation with gc 7.1
	* configure.ac: Add checks for GC_gcollect_and_unmap and
	  GC_get_unmapped_bytes.
	* libguile/gc-malloc.c (scm_realloc): GC_gcollect() if we don't have
	  GC_gcollect_and_unmap.
	* libguile/gc.c (GC_get_heap_usage_safe): Likewise, don't
	  GC_get_unmapped_bytes if the function doesn't exist.

2011-12-06  Ludovic Courtès  <ludo@gnu.org>

	Add an exception printer for `getaddrinfo-error'.
	* module/ice-9/boot-9.scm (getaddrinfo-error-printer): New procedure.
	  Use it as the `getaddrinfo-error' exception printer.

2011-12-06  Ludovic Courtès  <ludo@gnu.org>

	peval: Truncate multiple values when extending the environment.
	Reported by Cédric Cellier <rixed@happyleptic.org>.

	* module/language/tree-il/peval.scm (truncate-values): New procedure.
	  (make-operand): Call `truncate-values' SOURCE.

	* test-suite/tests/tree-il.test ("partial evaluation"): New tests for
	  multiple value truncation.

2011-12-06  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/deprecation.c
		libguile/load.c
		libguile/print.c

	enable port locking
	* libguile/ports.c (scm_c_make_port_with_encoding): Enable port
	  locking.

	fix scm_adjust_port_revealed_x FUNC_NAME
	* libguile/ports.c (scm_adjust_port_revealed_x): Fix FUNC_NAME.

	fix asm-to-bytecode.test
	* test-suite/tests/asm-to-bytecode.test (%objcode-cookie-size)
	  (test-target): The objcode version embedded in the cookie is not an
	  effective version, so elide it from the test.

2011-12-06  Andy Wingo  <wingo@pobox.com>

	port locking refactor
	* libguile/ports.h (struct scm_t_port): Make the lock into a pointer
	  field instead of an inline field.  It should be possible to make
	  unlocked ports by having a NULL lock field.
	  (scm_c_lock_port, scm_c_try_lock_port): Return the mutex if the port
	  was actually locked.
	  (scm_c_unlock_port): Remove.

	* libguile/ports.c (scm_c_make_port_with_encoding): For now, leave
	  `lock' set to 0.
	  Change scm_c_lock_port callers to pay attention to the new API.

	* libguile/print.c (scm_write, scm_display): Fix call to
	  dynwind-lock-port for ports-with-print-states.

2011-12-06  Andy Wingo  <wingo@pobox.com>

	allow URIs of the form file:///etc/hosts
	* module/web/uri.scm (parse-authority): Allow empty authorities, so that
	  we accept URIs of the form, file:///etc/hosts.
	* test-suite/tests/web-uri.test ("string->uri"): Add tests.

	Update a comment in (web client)
	* module/web/client.scm: Update a comment.

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

	warnings written to warning port
	* libguile/deprecation.c (scm_c_issue_deprecation_warning):
	* libguile/load.c (auto_compile_catch_handler):
	  (scm_sys_warn_auto_compilation_enabled, scm_primitive_load_path):
	* module/ice-9/boot-9.scm (warn, %load-announce, duplicate-handlers)
	  (load-in-vicinity):
	* module/system/base/message.scm (warning): Write to the warning port.
	  (*current-warning-port*): Alias the warning port.

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

	add current-warning-port
	* libguile/ports.h:
	* libguile/ports.c (scm_current_warning_port)
	  (scm_set_current_warning_port): New functions, wrapping the Scheme
	  parameter.

	* module/ice-9/boot-9.scm (current-warning-port): New parameter,
	  defining a port for warnings.

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

	setting a parameter returns the previous value
	* module/ice-9/boot-9.scm (make-parameter): Setting a parameter by
	  invoking it with an argument now returns the previous value.

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

	add srfi-39 parameters to boot-9
	* module/ice-9/boot-9.scm (<parameter>, make-parameter, parameter?)
	  (parameter-fluid, parameter-converter, parameterize): New top-level
	  bindings, implementing SRFI-39 parameters.  Currently,
	  current-input-port and similar procedures are not yet parameters.

	* test-suite/Makefile.am:
	* test-suite/tests/parameters.test: Add tests, taken from srfi-39
	  tests.

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

	ice-9/poll: verify sizeof(struct pollfd)
	* libguile/poll.c (scm_init_poll): Define %sizeof-struct-pollfd.
	* module/ice-9/poll.scm: Check %sizeof-struct-pollfd.

	new print option escape-newlines, defaults to #t
	* libguile/private-options.h (SCM_PRINT_ESCAPE_NEWLINES_P):
	* libguile/print.c: Add new escape-newlines print option, defaulting to
	  on.
	  (write_character): For newlines, if SCM_PRINT_ESCAPE_NEWLINES_P, then
	  print them as \n.
	  (scm_init_print): Refactor print options initialization.

	,language at REPL sets current-language
	* module/system/repl/command.scm (language): Set the
	  *current-language*.
	* module/system/repl/repl.scm (start-repl): Create a new dynamic scope
	  for *current-language*.

2011-12-02  Andy Wingo  <wingo@pobox.com>

	fix `free' of mpz_to_str
	* libguile/numbers.c (scm_number_to_string): Don't `free' the result of
	  mpz_get_str; use the mp free function.

	scm_gc_register_collectable_memory calls scm_gc_register_allocation
	* libguile/gc-malloc.c (scm_gc_register_collectable_memory): Call
	  scm_gc_register_allocation.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/guile.c
		libguile/numbers.c

2011-12-02  Andy Wingo  <wingo@pobox.com>

	install gmp memory functions that let libgc know about allocations
	* libguile/numbers.c (custom_gmp_malloc, custom_gmp_realloc,
	  custom_gmp_free): New static functions used by GMP for allocation.
	  These are just wrappers for scm_malloc, scm_realloc, and free.

	  (scm_init_numbers): If scm_install_gmp_memory_functions is nonzero,
	  use mp_set_memory_functions to configure GMP to use
	  custom_gmp_{malloc,realloc,free} for memory allocation.

	  (scm_bigprint): Ask gmp for the function used to deallocate the string
	  returned by mpz_get_str.

	* libguile/numbers.h: Declare scm_install_gmp_memory_functions.

	* libguile/guile.c: When running the Guile binary, install the
	  gmp_memory_functions.

	Based on a patch by Mark H Weaver <mhw@netris.org>.

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

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		configure.ac
		libguile/fluids.c
		libguile/gc.c
		libguile/gc.h
		libguile/objcodes.c
		libguile/procprop.c
		libguile/vm.c
		module/ice-9/psyntax-pp.scm
		module/ice-9/psyntax.scm

	fix deadlock in before-gc-hook on certain 7.2alpha gc versions
	* libguile/gc.c (scm_init_gc): Only adjust gc frequency in the gc start
	  hook if we know that it won't take a lock.

2011-11-29  Andy Wingo  <wingo@pobox.com>

	attempt to handle steady-state mallocations better
	* libguile/gc-malloc.c (scm_realloc): Call the new
	  scm_gc_register_allocation() here.  If we have to collect, do a
	  GC_gcollect_and_unmap.

	* libguile/gc.c (scm_gc_register_allocation): Add a routine to track
	  steady-state mallocation, and cause gc to run if there is a high
	  mallocation rate.
	  (adjust_gc_frequency): Reset the bytes-until-GC countdown timer.

2011-11-29  Andy Wingo  <wingo@pobox.com>

	collect a little in call-with-new-thread
	* libguile/threads.c (scm_call_with_new_thread): Collect a little before
	  making a new thread.  Our adjust_gc_frequency hack doesn't work well
	  if the main allocation load is thread creation, as in
	  https://savannah.gnu.org/bugs/?34140.  This does not appreciably
	  affect the speed of the test in that bug, but does effectively limit
	  the image size.

	adjust_gc_frequency before gc, for more precision
	* libguile/gc.c (scm_init_gc): Run the adjust_gc_frequency from the
	  before-gc-hook, not the after-gc-hook.  More precise, this way.

	fix uninitialized variable in gc.c
	* libguile/gc.c (get_image_size): Fix use of uninitialized variable.

	switch off debugging flag that was mistakenly left on
	* libguile/gc.c (HEURISTICS_DEBUG): Whoops, switch this off.

	increase garbage collection rate if the process is growing
	* configure.ac: Check for GC_get_free_space_divisor.
	* libguile/gc.c (GC_get_free_space_divisor): Define an implementation,
	  if needed.
	  (accumulate_gc_timer): Fix indentation.
	  (get_image_size): New terrible hack.  Needs implementations on other
	  platforms.
	  (adjust_gc_frequency): Attempt to adjust the GC frequency based on
	  process image growth.  Needs more comments.
	  (scm_init_gc): Add the adjust_gc_frequency to the after_gc_c_hook.

2011-11-28  Andy Wingo  <wingo@pobox.com>

	get heap stats with GC_get_heap_usage_safe, if available.
	* configure.ac: Check for GC_get_heap_usage_safe.
	* libguile/gc.c (SCM_DEFINE): Use GC_get_heap_usage_safe.

2011-11-26  Ludovic Courtès  <ludo@gnu.org>

	FFI: Hold a weak reference to the procedure passed to `procedure->pointer'.
	* libguile/foreign.c (scm_procedure_to_pointer): Keep a weak reference
	  to PROC.

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

2011-11-24  Andy Wingo  <wingo@pobox.com>

	support for new GC_move_disappearing_link
	* configure.ac: Check for GC_move_disappearing_link.
	* libguile/weak-set.c (move_weak_entry):
	* libguile/weak-table.c (move_disappearing_links):
	  (move_weak_entry): Use GC_move_disappearing_link if available.

	remove scm_si_name_access
	* libguile/goops.h (scm_si_name_access): Remove alias for
	  scm_si_getters_n_setters.

	remove unused <class> slot: keyword-access
	* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, scm_si_keyword_access):
	* libguile/goops.c (build_class_class_slots): Remove unused
	  keyword-access slot from classes.

	deprecate make-vtable-vtable
	* libguile/struct.h:
	* libguile/struct.c (scm_make_vtable_vtable): Deprecate, as you can
	  handle most of the use cases with make-vtable, and we don't want to
	  promote the creation of new roots to the type hierarchy.
	  (scm_i_make_vtable_vtable): The internal replacement.

	simplify %condition-type-vtable
	* module/srfi/srfi-35.scm (%condition-type-vtable): Use make-vtable
	  instead of make-vtable-vtable.

	record-type-vtable is not a new root of the vtable hierarchy
	* module/ice-9/boot-9.scm (record-type-vtable): Simplify to use
	  make-vtable instead of make-vtable-vtable.

	Scheme standard-vtable-fields binding
	* libguile/struct.c (scm_init_struct): Export standard-vtable-fields to
	  Scheme.

	add Scheme binding for scm_standard_vtable_vtable
	* libguile/struct.c (scm_init_struct): Export <standard-vtable> to
	  Scheme.

	remove public scm_protects export
	* libguile/gc.h:
	* libguile/gc.c: Remove scm_protects from the API.  It is deprecated on
	  stable-2.0.

	no gc_register_root in scm_init_print
	* libguile/print.c (scm_init_print): No need to gc_register_root here.

	remove object protection from options.c
	* libguile/options.c (change_option_setting, scm_init_options): Rely on
	  the options being allocated in GC-able memory, as in static memory.
	  Therefore there is no need for the gc-protect dance.

	simplify scm_init_print
	* libguile/print.c (scm_init_print): Simplify creation of print-state
	  vtable.

2011-11-23  Daniel Hartwig  <mandyke@gmail.com>

	web-http.test validates headers
	* test-suite/tests/web-http.test (pass-if-parse): Validate header values
	  as well.

	fix validators for various list-style headers
	* module/web/http.scm (default-val-validator): Valid with no value.
	  (key-value-list?): Keys are always symbols, do not accept strings.
	  (validate-param-list): Apply `valid?' to list elements.
	  (validate-credentials): Validate param for Basic scheme, which
	  is parsed as a string.
	  (declare-symbol-list-header!): `list-of?' args were in wrong order.
	  ("Cache-Control"): Replace `default-val-validator' with more
	  specific procedure.
	  ("Accept"): Validate on first param which has no value.

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

	Update cross-compilation instructions.
	* README (Cross building Guile): Update.

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

	configure: Make sure $GUILE_FOR_BUILD is suitable.
	* acinclude.m4 (GUILE_CHECK_VERSION, GUILE_CHECK_GUILE_FOR_BUILD): New
	  macros.

	* configure.ac: Remove $GUILE_FOR_BUILD tests.  Use
	  `GUILE_CHECK_GUILE_FOR_BUILD'.

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

	Allow $GUILE_FOR_BUILD to use its own environment when cross-compiling.
	* am/guilec (.scm.go): Use `-L' to specify the search path.
	* module/Makefile.am (ice-9/psyntax-pp.go): Likewise.

	* meta/uninstalled-env.in (top_builddir): Leave $GUILE_LOAD_PATH,
	  $GUILE_SYSTEM_PATH, and $GUILE_SYSTEM_EXTENSIONS_PATH unchanged when
	  cross-compiling.

2011-11-23  Andy Wingo  <wingo@pobox.com>

	Use default value for make-fluid in Scheme files
	* module/ice-9/boot-9.scm (%exception-handler)
	  (%running-exception-handlers, read-eval?, *repl-stack*)
	  (make-mutable-parameter):
	* module/ice-9/getopt-long.scm (%program-name):
	* module/language/elisp/runtime.scm (built-in-macro, defspecial):
	* module/srfi/srfi-39.scm (make-parameter/helper):
	* module/system/base/language.scm (*current-language*):
	* module/system/base/message.scm (*current-warning-port*):
	  (*current-warning-prefix*):
	* module/system/base/target.scm (%target-type, %target-endianness)
	  (%target-word-size):
	* module/texinfo/plain-text.scm (*indent*, *itemizer*):
	* benchmark-suite/lib.scm (prefix-fluid):
	* test-suite/lib.scm (prefix-fluid): Give fluids a useful default
	  value.

	use new scm_make_fluid_with_default
	* libguile/load.c (scm_init_load):
	* libguile/ports.c (scm_init_ports):
	* libguile/read.c (scm_init_read): Use scm_make_fluid_with_default.

2011-11-23  Andy Wingo  <wingo@pobox.com>

	optional default-value arg to make-fluid
	* libguile/fluids.c (grow_dynamic_state, new_fluid): Arrange for the
	  default value in the dynamic-state vector to be SCM_UNDEFINED instead
	  of SCM_BOOL_F.  If the value in the dynamic-state is #f, default to a
	  value attached to the fluid instead.  This allows useful default
	  values.
	  (scm_make_fluid_with_default): New function, allows the user to
	  specify a default value for the fluid.  Defaults to #f.  Bound to
	  `make-fluid' on the Scheme side.
	  (scm_make_unbound_fluid): Use SCM_UNDEFINED as the default in all
	  threads.
	  (scm_fluid_unset_x): Also unset the default value.  Not sure if this
	  is the right thing.
	  (fluid_ref): Update to the new default-value strategy.

	* libguile/threads.c (scm_i_reset_fluid): Reset to SCM_UNDEFINED.
	* libguile/threads.h: Remove extra arg to scm_i_reset_fluid.
	* libguile/vm-i-system.c (fluid-ref): Update to new default-value
	  strategy.

	* module/ice-9/vlist.scm (block-growth-factor): Default to 2 in all
	  threads.  Fixes http://debbugs.gnu.org/10093.

2011-11-22  BT Templeton  <bpt@hcoop.net>

	load boot.el
	* am/guilec: Add support for compiling Elisp files.
	* module/Makefile.am: New variable ELISP_SOURCES.
	* module/language/elisp/boot.el: New file.
	* module/language/elisp/spec.scm: Load boot.el.

	remove void-checking cruft
	* module/language/elisp/compile-tree-il.scm: Don't export
	  `compile-without-void-checks', which was removed. Remove unused
	  `disable-void-check' variable. Update comments.

2011-11-22  Ludovic Courtès  <ludo@gnu.org>

	Install the current locale when Guile is invoked directly.
	* libguile/guile.c (main): Add `setlocale' call.

	Add Gnulib `largefile' module.
	It will really be added next time we run "gnulib-tool --update".

	Leave $GUILE_LOAD_COMPILED_PATH unchanged when cross-compiling.
	* meta/uninstalled-env.in: Don't define $GUILE_LOAD_COMPILED_PATH when
	  cross-compiling.

	Build `psyntax-pp.go' with `--target=$(host)'.
	* module/Makefile.am (ice-9/psyntax-pp.go): Pass `--target=$(host)'.

	Run `guild compile' with `--target=$(host)'.
	* am/guilec (.scm.go): Run `guild compile' with `--target=$(host)'.

2011-11-22  Ludovic Courtès  <ludo@gnu.org>

	Add a `--target' option to `guild compile'.
	* module/scripts/compile.scm (%options)["--target"]: New option.
	  (show-version): Update copyright year.
	  (compile): Use `with-target' to install the target.

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

2011-11-22  Ludovic Courtès  <ludo@gnu.org>

	Add missing implicit `SCM_API' for `scm_c_make_objcode_slice'.
	* libguile/objcodes.h (scm_c_make_objcode_slice): Add implicit `SCM_API'.

2011-11-22  Ludovic Courtès  <ludo@gnu.org>

	Complete cross-compilation support.
	* module/system/base/target.scm (%target-endianness, %target-word-size):
	  New fluids.
	  (%native-word-size): New variable.
	  (with-target): Set these fluids.
	  (cpu-endianness, cpu-word-size, triplet-cpu, triplet-vendor,
	  triplet-os): New procedures.
	  (target-cpu, target-vendor, target-os): Use them.
	  (target-endianness, target-word-size): Refer to the corresponding
	  fluid.

	* libguile/objcodes.c (target_endianness_var, target_word_size_var): New
	  global variables.
	  (NATIVE_ENDIANNESS): New macro.
	  (target_endianness, target_word_size, to_native_order): New functions.
	  (make_objcode_from_file): Use `scm_bytecode_to_native_objcode' instead
	  of `scm_bytecode_to_objcode'.
	  (bytecode_to_objcode): New function, based on `scm_bytecode_to_objcode',
	  with the addition of an `endianness' and `word_size' parameters.
	  (scm_bytecode_to_objcode): Use it.
	  (scm_bytecode_to_native_objcode): New function.
	  (scm_write_objcode): Use `target_word_size' and `target_endianness'.
	  Convert OBJCODE's len and meta-len to native byte order.
	  (scm_init_objcodes): Initialize `target_endianness_var' and
	  `target_word_size_var'.

	* libguile/objcodes.h (scm_bytecode_to_native_objcode): New declaration.

	* libguile/vm.c (really_make_boot_program): Use
	  `scm_bytecode_to_native_objcode' instead of `scm_bytecode_to_objcode'.

	* test-suite/tests/asm-to-bytecode.test (%objcode-cookie-size): New
	  variable.
	  (test-target): New procedure.
	  ("cross-compilation"): Add `test-target' calls and the "unknown
	  target" test.

2011-11-22  Ludovic Courtès  <ludo@gnu.org>

	Fix `validate-target' in (system base target).
	* module/system/base/target.scm (validate-target): Accept any tuple with
	  at least 3 parts.

	* test-suite/tests/asm-to-bytecode.test (test-triplet): New procedure.
	  ("cross-compilation"): New test prefix.

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

	deprecate direct scm_protects access
	* libguile/gc.h:
	* libguile/gc.c: Deprecate direct access to scm_protects.

2011-11-20  Ludovic Courtès  <ludo@gnu.org>

	Allow overlapping regions to be passed to `bytevector-copy!'.
	Reported by Dmitry Chestnykh <dmitry@codingrobots.com>.
	Fixes <http://debbugs.gnu.org/10070>.

	* libguile/bytevectors.c (scm_bytevector_copy_x): Use `memmove', not
	  `memcpy'.

	* test-suite/tests/bytevectors.test ("2.2 General
	  Operations")["bytevector-copy! overlapping"]: New test.

	* doc/ref/api-data.texi (Bytevector Manipulation): Mention possible
	  overlapping.

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

	eval.test work
	* test-suite/tests/eval.test ("stacks"): Enable another test, fix to use
	  with-throw-handler, and remove a duplicate test, now that there is no
	  difference between subrs and gsubrs.

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

	FFI: Hold a weak reference to the CIF made by `procedure->pointer'.
	* libguile/foreign.c (scm_procedure_to_pointer): Keep a weak reference
	  to CIF so that it is not reclaimed before POINTER.  Before that it
	  could be reclaimed and typically reused to store the CIF of another
	  procedure with the same arity, leading to obscure wrong-type-arg
	  errors.

	FFI: Add a `procedure->pointer' test.
	* test-suite/tests/foreign.test ("procedure->pointer")["procedures
	  returning a pointer"]: New test.

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

	fix urls in docs
	* doc/ref/intro.texi (Introduction):
	* doc/ref/scheme-reading.texi (Further Reading):
	* doc/ref/srfi-modules.texi (SRFI Support): Fix some urls.  Thanks to
	  Henrik Sandklef for the report.

	fix web.texi typo
	* doc/ref/web.texi (HTTP Headers): Fix a typo.  Thanks to Brian Gough
	  for the report.

	hack the port-column of current-output-port after printing a prompt
	* module/ice-9/boot-9.scm (repl-reader): Reset the output-column to 0
	  after printing the prompt.  Fixes bug 9664.

	eval-when tidying up
	* module/ice-9/psyntax.scm: Rename expand-when-list to parse-when-list,
	  and simplify to compare literal values.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	psyntax: s/chi/expand/g
	* module/ice-9/psyntax.scm: Rename all instances of "chi" to "expand".
	  Addded a hack to expand-eval-when that will be fixed later.
	* module/ice-9/psyntax-pp.scm: Regenerated.

	fix bug in make-repl when lang is actually a language
	* module/system/repl/common.scm (make-repl): Fix to accept language
	  objects in addition to symbols.  Fixes http://debbugs.gnu.org/9857.
	  Thanks to Tristan Colgate for the report.

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

	Re-enable a couple of evaluator tests.
	These tests had been disabled as part of
	b7742c6b7132544b9d6cd9cb32c09e2084ad9e52 ("new evaluator, y'all").

	* test-suite/tests/eval.test ("define set procedure-name")["closure"]:
	  Change to `pass-if' since it now works, as a result of
	  ee15aa46e3fb29e609bd7c431e8f2676f6573d57 ("set names of functions
	  defined at the toplevel from `eval'").
	  ("stacks")["arguments of a gsubr stack frame"]: Remove (throw
	  'unresolved).

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

	memoize: booleanify the rest arg
	* libguile/memoize.c (memoize): Turn the rest arg into a boolean.  Fixes
	  an error when rest gets passed to set-procedure-minimum-arity!.

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

	set names of functions defined at the toplevel from `eval'
	* module/ice-9/eval.scm (primitive-eval): Set the name of
	  toplevel-defined functions.

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

	better debuggability for interpreted procedures
	* libguile/procprop.c (scm_set_procedure_minimum_arity_x): New
	  function, allows a user to override a function's arity.
	  (scm_i_procedure_arity): Look up in the overrides table first.

	* libguile/procprop.h: Add scm_set_procedure_minimum_arity_x.

	* module/ice-9/eval.scm (primitive-eval): Override arity of "general
	  closures".

	* test-suite/tests/procprop.test ("procedure-arity"): Add tests.

	Based on a patch from Stefan Israelsson Tampe.  Test based on work by
	Patrick Bernaud.

2011-11-11  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

	update letrec compilation test
	* test-suite/tests/tree-il.test ("letrec"): Update to clear the
	  temporary `let' bindings.

	Merge remote-tracking branch 'origin/stable-2.0'

2011-11-10  Andy Wingo  <wingo@pobox.com>

	fix bit-set*! bug (!)
	* libguile/bitvectors.c (scm_bit_set_star_x): Fix a long-standing (since
	  2005) bug in which instead of using the kv bitvector, we actually use
	  the `v' bitvector.  Also, change to allow `kv' being shorter than
	  `v'.

	* test-suite/tests/bitvectors.test ("bit-set*!"): Add tests.

2011-11-09  Andy Wingo  <wingo@pobox.com>

	when leaving a non-tail let, allow bound vals to be collected
	* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Clear
	  lexical stack slots at the end of a non-tail let, letrec, or fix.
	  Fixes http://debbugs.gnu.org/9900.

	* test-suite/tests/gc.test ("gc"): Add test.

2011-11-09  Andy Wingo  <wingo@pobox.com>

	disable port locking
	* libguile/ports.h (scm_c_lock_port, scm_c_try_lock_port)
	  (scm_c_unlock_port): Disable port locking until I have time to sort
	  out the bugs that are coming up.

2011-11-09  Andy Wingo  <wingo@pobox.com>

	inline dynwind guards for normal control flow
	* module/language/tree-il.scm (<tree-il>): Add `pre' and `post' fields
	  to <dynwind>, so that we can inline the guard bodies in the normal
	  control-flow case.  It also avoids duplicating code in compile-glil,
	  which probably hides more bugs in 2.0.
	  (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold)
	  (make-tree-il-folder, post-order!, pre-order!): Update.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Update.

	* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Update
	  to use `pre' and `post' instead of compiling code twice.

	* module/language/tree-il/debug.scm (verify-tree-il): Update.

	* module/language/tree-il/peval.scm (peval): Update.  Instead of doing
	  complicated things in <dynwind>, handle 'dynamic-wind primcalls.

	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Remove 'dynamic-wind mess.  Adapt '@dynamic-wind.

	* test-suite/tests/tree-il.test ("partial evaluation"): Update tests.

2011-11-09  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		module/language/tree-il/peval.scm
		module/language/tree-il/primitives.scm
		test-suite/tests/tree-il.test

	simplify primitives.scm for dynwind
	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Remove a dynwind hack, as we have a good inliner now.

2011-11-09  Andy Wingo  <wingo@pobox.com>

	peval: fix dynwind bug.
	* module/language/tree-il/peval.scm (peval): The <dynwind> compiler will
	  copy the winder and unwinder values, so make sure that they are
	  constant, and if not, create lexical bindings.  Fixes
	  http://debbugs.gnu.org/9844.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add a couple
	  <dynwind> tests.

2011-11-09  Andy Wingo  <wingo@pobox.com>

	fix <dynwind> serialization.
	* module/language/tree-il.scm (unparse-tree-il): Fix <dynwind>
	  serialization.

	peval: don't copy assigned lexical bindings
	* module/language/tree-il/peval.scm (peval): Since constant-expression?
	  is used to determine whether to copy values, return #f if any lexical
	  is assigned.

2011-11-08  Andy Wingo  <wingo@pobox.com>

	lock ports in `write' and `display'
	* libguile/print.c (scm_write, scm_display): Lock the port during
	  `display' and `write' calls.  Fixes
	  https://savannah.gnu.org/bugs/?33996.

	add scm_dynwind_lock_port
	* libguile/ports.h:
	* libguile/ports.c (scm_dynwind_lock_port): New function.

	locking for write, lfwrite
	* libguile/ports.c (scm_c_write_unlocked, scm_c_write)
	  (scm_lfwrite_unlocked, scm_lfwrite): Add locking and _unlocked
	  variants.  Change uses to _unlocked.

	locking for putc, puts
	* libguile/ports.c (scm_putc, scm_puts):
	* libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into
	  _unlocked and locked variants.  Change all callers to use the
	  _unlocked versions.

2011-11-08  Andy Wingo  <wingo@pobox.com>

	locking on port buffering operations
	* libguile/ports.c (scm_fill_input_unlocked, scm_fill_input)
	  (scm_end_input, scm_end_input_unlocked, scm_flush)
	  (scm_flush_unlocked): Add locking and _unlocked variants.

	* libguile/filesys.c:
	* libguile/fports.c:
	* libguile/gdbint.c:
	* libguile/r6rs-ports.c:
	* libguile/read.c:
	* libguile/rw.c: Adapt callers to use _unlocked variants.

2011-11-08  Andy Wingo  <wingo@pobox.com>

	locking on unget_byte, ungetc, ungets
	* libguile/ports.h:
	* libguile/ports.c (scm_unget_byte_unlocked, scm_unget_byte)
	  (scm_ungetc_unlocked, scm_ungetc, scm_ungets_unlocked, scm_ungets):
	  Add locking and _unlocked variants.

	* libguile/arrays.c:
	* libguile/rdelim.c:
	* libguile/read.c:
	* libguile/vports.c: Adapt callers to use the _unlocked variants.

2011-11-08  Andy Wingo  <wingo@pobox.com>

	locking on scm_c_read, scm_getc
	* libguile/ports.c (scm_c_read_unlocked, scm_c_read, scm_getc_unlocked)
	  (scm_getc): Split getc and read operations into locked and unlocked
	  variants.  Change most uses to use the _unlocked version.

2011-11-08  Andy Wingo  <wingo@pobox.com>

	threadsafe get-byte-or-eof, peek-byte-or-eof
	* libguile/ports.h (scm_get_byte_or_eof_unlocked):
	  (scm_peek_byte_or_eof_unlocked): Rename, adding _unlocked.
	* libguile/ports.c (scm_get_byte_or_eof, scm_peek_byte_or_eof): Add
	  locking implementations.  Adapt callers to use _unlocked variants;
	  they will do locking.

	* libguile/read.c (read_token, scm_read_semicolon_comment)
	  (scm_read_shebang): Use unlocked variants.  We will add locking
	  later.

2011-11-08  Andy Wingo  <wingo@pobox.com>

	threadsafe port revealed counts
	* libguile/ports.h:
	* libguile/ports.c (scm_revealed_count, scm_set_port_revealed_x): Make
	  threadsafe.
	  (scm_adjust_port_revealed_x): New function, to adjust a port's
	  revealed count in a threadsafe way.

	scm_c_lock_port takes a port
	* libguile/ports.h (scm_c_lock_port, scm_c_try_lock_port)
	  (scm_c_unlock_port): Take a port instead of an entry.

2011-11-07  Andy Wingo  <wingo@pobox.com>

	ports implementation reordering
	* libguile/ports.h: Slight reorder.
	* libguile/ports.c: Reorder ports implementation to match the header
	  file.  This will make it easier to add locking and _unlocked
	  variants.

2011-11-07  Andy Wingo  <wingo@pobox.com>

	threadsafe access to scm_ptobs
	* libguile/ports.h (SCM_PORT_DESCRIPTOR): New macro, to get at a port
	  descriptor in the third word of a port instead of looking it up in a
	  table.
	  (scm_c_port_type_ref, scm_c_port_type_add_x): New API for working with
	  numbered ptob descriptors.
	  (SCM_PTOBNAME): Implement in terms of scm_c_port_type_ref.
	  (scm_get_byte_or_eof, scm_peek_byte_or_eof): Use SCM_PORT_DESCRIPTOR.

	* libguile/ports.c (scm_c_num_port_types, scm_c_port_type_ref)
	  (scm_c_port_type_add_x, scm_make_port_type): Protect scm_ptobs access
	  with a mutex.  Have it be an array of pointers instead of an array of
	  structures.  Adapt users to the new APIs.
	  (scm_c_make_port_with_encoding): Allocate ports with three words.  The
	  third word is the ptob descriptor.

	* libguile/backtrace.c:
	* libguile/goops.c:
	* libguile/ioext.c:
	* libguile/print.c: Adapt to use scm_c_port_type_ref and
	  SCM_PORT_DESCRIPTOR.

2011-11-07  Andy Wingo  <wingo@pobox.com>

	reorder ports.h declarations
	* libguile/ports.h: Reorder declarations.

	remove scm_markstream
	* libguile/ports.h:
	* libguile/ports.c (scm_markstream): Remove obsolete definition.  Moved
	  around a couple of other declarations.

	ports.h: remove unimplemented declarations
	* libguile/ports.h (scm_grow_port_cbuf, scm_pt_size, scm_pt_member):
	  Remove declarations of unimplemented functions.  Move a couple of
	  other definitions around.

	inlined port functions to ports.h
	* libguile/inline.h:
	* libguile/ports.h (scm_get_byte_or_eof, scm_peek_byte_or_eof)
	  (scm_putc, scm_puts): Move definitions here, from inline.h.

2011-11-07  Andy Wingo  <wingo@pobox.com>

	add lock to scm_t_port
	* libguile/ports.h (scm_c_lock_port, scm_c_try_lock_port)
	  (scm_c_unlock_port): New inline functions.
	  (scm_t_port): Add a lock field, if threads are enabled.  This is a
	  first step towards threadsafe ports.

	* libguile/ports.c (scm_c_make_port_with_encoding): Init the port's
	  lock.

	* libguile/inline.c: Residualize the inline functions from ports.h.

2011-11-07  Andy Wingo  <wingo@pobox.com>

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

	add tests for hygienic name introduction
	* test-suite/tests/syntax.test ("top-level define"): Add tests for
	  hygienic introduction of names.

	hygienically rename macro-introduced bindings, reproducibly
	* module/ice-9/psyntax.scm (chi-top-sequence): Detect bindings to
	  identifiers introduced by macros.  In that case, in order to preserve
	  hygiene, uniquify the variable's name, but in a way that is
	  reproduceable (i.e., yields the same uniquified name after a
	  recompile).

	fix scope bug in <module> definition in boot-9
	* module/ice-9/boot-9.scm (define-record-type): Fix scope bug when
	  generating identifiers.

	another scoping test
	* test-suite/tests/syntax.test ("top-level define"): Add another test
	  for scoping.

	resolve-identifier for toplevel definitions resolves by module
	* module/ice-9/psyntax.scm (id-var-name): For mapping identifiers to
	  toplevel definitions, also compare against the module.
	  (resolve-identifier): Pass the module to id-var-name when looking up
	  identifiers.
	  (free-id=?): Adapt to id-var-name change.
	  (chi-top-sequence): When adding a mapping from the given identifier
	  to a toplevel definition, make the name be a pair.

	add scoping test
	* test-suite/tests/syntax.test ("top-level define"): Add a test for
	  module scoping of introduced identifiers.

	defined identifiers scoped in the current module
	* ice-9/psyntax.scm (chi-top-sequence): Wrap defined identifiers with
	  the current module.  Fixes http://savannah.gnu.org/bugs/?31472.

	syntax parameters implemented properly
	* module/ice-9/psyntax.scm (resolve-identifier): Take an additional
	  argument, indicating whether syntax parameters should be resolved or
	  not.  Just return three values: the binding type and value, and the
	  module for resolving toplevels.
	  (chi-install-global): Take an extra arg, the type.  If we are defining
	  a syntax parameter, construct a pair for the binding.
	  (chi-body): Syntax parameters now use a per-parameter unique value (a
	  pair) as a key in the expansion-time environment `r'.
	  (syntax-parameterize): Don't allow parameterization of
	  non-parameters.  This is an incompatible change, but it is for the
	  better; you don't want to allow users to parameterize `lambda', after
	  all.

2011-11-07  Andy Wingo  <wingo@pobox.com>

	syntax-parameterize, not fluid-let-syntax
	* module/ice-9/psyntax.scm (syntax-parameterize): Rename from
	  fluid-let-syntax.

	* module/ice-9/boot-9.scm (define-inlinable): Use syntax-parameterize
	  (and define-syntax-parameter).

2011-11-07  Andy Wingo  <wingo@pobox.com>

	add define-syntax-parameter, same as define-syntax
	* module/ice-9/psyntax.scm (define-syntax-parameter): New toplevel form.
	  Will be used to implement syntax parameters, following Barzilay,
	  Culpepper, and Flatt's 2011 SFP workshop paper, "Keeping it Clean with
	  syntax-parameterize".  Adds a new binding type and definition form.

	psyntax: resolve-identifier refactor
	* module/ice-9/psyntax.scm (id-var-name): Add a nice long comment.
	  (lookup): Remove, as it is no longer used.
	  (resolve-identifier): New helper, replaces most uses of id-var-name
	  then `lookup'.
	  (syntax-type, syntax, set!, fluid-let-syntax): Adapt to use
	  resolve-identifier.
	  (free-id=?): Adapt to id-var-name returning syntax objects.

2011-11-04  Andy Wingo  <wingo@pobox.com>

	chi-top-sequence refactor
	* module/ice-9/psyntax.scm (chi-top-sequence): Reimplement, more like
	  chi-body.  Instead of adding empty definitions to the toplevel, add
	  toplevel definitions to the wrap shared by all forms in the sequence.

2011-11-04  Andy Wingo  <wingo@pobox.com>

	minor psyntax refactors
	* module/ice-9/psyntax.scm (syntax-type): Remove redundant lexical
	  case.
	  (syntax-rules, define-syntax-rule): Use `_' instead of `dummy' for the
	  keyword.

	* module/ice-9/boot-9.scm (define-syntax-rule): Remove redundant
	  definition.

2011-11-04  Andy Wingo  <wingo@pobox.com>

	peval doesn't resolve primitives
	* module/language/tree-il/peval.scm (peval): Don't resolve primitives,
	  as resolve-primitives! handles that already.

	* test-suite/tests/tree-il.test (pass-if-peval): Always resolve and
	  expand primitives.
	  ("partial evaluation"): Update tests to assume expanded primitives.

2011-11-04  Andy Wingo  <wingo@pobox.com>

	resolve-primitives! does not primitivize local definitions
	* module/language/tree-il/primitives.scm (resolve-primitives!): Don't
	  resolve toplevels defined in the same compilation unit to primitives,
	  as it could be that the module doesn't have those bindings yet.

	more robust scm_exit_status
	* libguile/throw.c (scm_exit_status): In one of my bogus patches, I
	  managed to make #<unspecified> reach this function, causing a segfault
	  on SCM_CAR.  Refactor to be more robust.

2011-11-01  Ian Price  <ianprice90@googlemail.com>

	Fix R6RS `fold-left' so the accumulator is the first argument.
	* module/rnrs/lists.scm (fold-left): New procedure.

	* module/rnrs/records/syntactic.scm (define-record-type): Fix to use
	  corrected `fold-left'.

	* test-suite/tests/r6rs-lists.test: Add tests.

2011-10-28  Andy Wingo  <wingo@pobox.com>

	refactor chi-top-sequence
	* module/ice-9/psyntax.scm (chi-top-sequence): Refactor slightly.
	* module/ice-9/psyntax-pp.scm: Regenerate.

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

2011-10-28  Andy Wingo  <wingo@pobox.com>

	add string-length, string-ref, vector-length instructions
	* libguile/_scm.h (SCM_OBJCODE_MAJOR_VERSION): Bump the major version,
	  indicating the first incompatibility between 2.0 and 2.2.

	* libguile/vm-i-scheme.c (string-length, string-ref, vector-length): New
	  instructions.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add
	  primcall ops for the new instructions.

2011-10-28  Andy Wingo  <wingo@pobox.com>

	add vector-length primitive
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*, *effect-free-primitives*): Recognize
	  vector-length as an effect-free primitive.

	simplify primitives.scm
	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Remove a hack to compensate for the lack of a good inliner, now that
	  we do have a good inliner.

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

	fix the peval merge and a test
	* module/language/tree-il/peval.scm (peval): Accessor primitives applied
	  to constants are pure if the call type-checks.  Also, fold constants
	  in accessor primcalls.

	* test-suite/tests/tree-il.test ("partial evaluation"): Fix the "yo"
	  test.

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

	fix hash of zero-length vectors
	* libguile/hash.c (scm_raw_ihash): Fix for zero-length vectors.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		GUILE-VERSION
		libguile/deprecated.c
		libguile/gc-malloc.c
		module/language/tree-il/peval.scm

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

	update `hash'
	* libguile/hash.c (scm_raw_ihash): Rename from `hasher'.  Remove the
	  modulo argument; we expect the caller to deal with that.  Use
	  scm_i_hashq for immediates and non-immediate integers.  Use
	  scm_raw_ihashq on pointers too.  Update the vector and pairs hashing
	  code.  There is still some work to do here.
	  (scm_ihashv, scm_ihash): Adapt.

	don't downcase characters before hashing them
	* libguile/hash.c (hasher, scm_ihashv): Don't downcase characters before
	  hashing them.  That is silly.

	scm_hasher is static
	* libguile/hash.c (hasher): Make static.
	* libguile/hash.h: Remove scm_hasher.

	add thomas wang's integer hash function; use it for hashq, hashv
	* libguile/hash.c (scm_raw_ihashq): Add Thomas Wang's integer hash
	  function, from http://www.cris.com/~Ttwang/tech/inthash.htm.
	  (scm_ihashq, scm_ihashv): Use it here.

	symbols.h reindent
	* libguile/symbols.h: Reindent.

	use bob jenkins' hashword2 hash from lookup3.c for our string hash
	* libguile/hash.c (JENKINS_LOOKUP3_HASHWORD2, narrow_string_hash)
	  (wide_string_hash, scm_string_hash, scm_i_string_hash)
	  (scm_i_latin1_string_hash): Replace our lame string hash with Bob
	  Jenkins' hash, treating each codepoint as a word, for the purposes of
	  the algorithm.  There are probably more optimal hashes for our use
	  cases.
	  (scm_i_locale_string_hash): Remove optimization, as it wasn't used.
	  (scm_i_utf8_string_hash): Add a specialized implementation for utf8.
	  It's tricky but mostly just cut-and-paste.

	fix a vhash test
	* test-suite/tests/vlist.test ("vhash"): As far as I can tell this test
	  was not testing the right thing.

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

	optimize scm_from_utf8_stringn
	* libguile/strings.c (decoding_error): Factor out of scm_from_stringn,
	  properly handling errno.
	  (scm_from_stringn): Adapt.
	  (scm_from_utf8_stringn): Inline the conversion here, to avoid going
	  through iconv.

	most uses of scm_from_locale_symbol become scm_from_utf8_symbol
	* libguile/array-handle.c:
	* libguile/chars.c:
	* libguile/expand.c:
	* libguile/feature.c:
	* libguile/goops.c:
	* libguile/gsubr.c:
	* libguile/instructions.c:
	* libguile/load.c:
	* libguile/macros.c:
	* libguile/memoize.c:
	* libguile/modules.c:
	* libguile/options.c:
	* libguile/print.c:
	* libguile/smob.c:
	* libguile/snarf.h: Change most uses of scm_from_locale_symbol to
	  scm_from_utf8_symbol, as the symbols really are not locale-dependent.

	optimize utf8 symbol lookup
	* libguile/symbols.c (utf8_string_equals_wide_string)
	  (utf8_lookup_predicate_fn, lookup_interned_utf8_symbol): Optimize
	  utf8 symbol lookup.

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

	slight scm_procedure_p, scm_i_procedure_arity refactor
	* libguile/procs.c (scm_procedure_p):
	* libguile/procprop.c (scm_i_procedure_arity): Refactor.

	remove CELL_P macro
	* libguile/private-gc.h: Remove private CELL_P macro.

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

	add SCM_HEAP_OBJECT_BASE
	* libguile/tags.h (SCM_HEAP_OBJECT_BASE): New macro.  Given a SCM,
	  returns a pointer to the start of its memory area on the heap.

	* libguile/bytevectors.c:
	* libguile/fluids.c:
	* libguile/foreign.c:
	* libguile/gc.h:
	* libguile/guardians.c:
	* libguile/numbers.h:
	* libguile/ports.c:
	* libguile/smob.c:
	* libguile/struct.c:
	* libguile/weak-set.c:
	* libguile/weak-table.c:
	* libguile/weak-vector.c: Use it.

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

	add SCM_HEAP_OBJECT_P
	* libguile/tags.h (SCM_HEAP_OBJECT_P): New macro, an alias for
	  SCM_NIMP.

	* libguile/arrays.c:
	* libguile/debug.c:
	* libguile/foreign.c:
	* libguile/gdbint.c:
	* libguile/guardians.c:
	* libguile/list.c:
	* libguile/modules.c:
	* libguile/options.c:
	* libguile/smob.c:
	* libguile/validate.h:
	* libguile/weak-set.c:
	* libguile/weak-table.c:
	* libguile/weak-vector.c: Use it instead of SCM_NIMP or !SCM_IMP.

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

	boot_closure_print cleanup
	* libguile/eval.c (boot_closure_print): Get at the bits directly.

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

	add SCM_{PACK,UNPACK}_POINTER
	* libguile/tags.h (SCM_UNPACK_POINTER, SCM_PACK_POINTER): New macros.
	  The old SCM2PTR and PTR2SCM were defined in such a way that
	  round-tripping through a pointer could lose precision, even in the
	  case in which you weren't interested in actually dereferencing the
	  pointer, it was simply that you needed to plumb a SCM through APIs
	  that take pointers.  These new macros are more like SCM_PACK and
	  SCM_UNPACK, but for pointer types.  The bit representation of the
	  pointer should be the same as the scm_t_bits representation.

	* libguile/gc.h (PTR2SCM, SCM2PTR): Remove support for (old) UNICOS
	  pointers.  We are going to try tagging the SCM object itself in the
	  future, and I don't think that keeping this support is worth its
	  cost.  It probably doesn't work anyway.

	* libguile/backtrace.c:
	* libguile/bytevectors.c:
	* libguile/continuations.c:
	* libguile/fluids.c:
	* libguile/foreign.c:
	* libguile/gc.h:
	* libguile/guardians.c:
	* libguile/hashtab.c:
	* libguile/load.c:
	* libguile/numbers.c:
	* libguile/ports.c:
	* libguile/smob.c:
	* libguile/strings.c:
	* libguile/symbols.c:
	* libguile/vm.c:
	* libguile/weak-set.c:
	* libguile/weak-table.c:
	* libguile/weak-vector.c: Update many sites to use the new macros.

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

	refactor tc7 and tc16 checks
	* libguile/tags.h (SCM_HAS_TYP7, SCM_HAS_TYP7S, SCM_HAS_TYP16): New
	  macros.

	* libguile/bytevectors.h (SCM_BYTEVECTOR_P):
	* libguile/control.h (SCM_PROMPT_P):
	* libguile/filesys.h (SCM_DIRP):
	* libguile/fluids.h (SCM_WITH_FLUIDS_P, SCM_FLUID_P)
	  (SCM_I_DYNAMIC_STATE_P):
	* libguile/foreign.h (SCM_POINTER_P):
	* libguile/fports.h (SCM_FPORTP):
	* libguile/frames.h (SCM_VM_FRAME_P):
	* libguile/hashtab.h (SCM_HASHTABLE_P):
	* libguile/inline.h (scm_get_byte_or_eof):
	* libguile/numbers.h (SCM_REALP, SCM_BIGP, SCM_COMPLEXP, SCM_FRACTIONP):
	* libguile/objcodes.h (SCM_OBJCODE_P):
	* libguile/ports.h (SCM_OUTPUT_PORT_P):
	* libguile/programs.h (SCM_PROGRAM_P):
	* libguile/smob.h (SCM_SMOB_PREDICATE):
	* libguile/srfi-14.h (SCM_CHARSETP):
	* libguile/strings.c (IS_STRING):
	* libguile/strports.h (SCM_STRPORTP):
	* libguile/symbols.h (scm_is_symbol):
	* libguile/variable.h (SCM_VARIABLEP):
	* libguile/vectors.h (SCM_I_IS_VECTOR, SCM_I_IS_NONWEAK_VECTOR):
	* libguile/vm-i-system.c (call, tail-call, mv-call)
	* libguile/vm.h (SCM_VM_P, SCM_VM_CONT_P):
	* libguile/weak-set.c (SCM_WEAK_SET_P):
	* libguile/weak-table.c (SCM_WEAK_TABLE_P):
	* libguile/weak-vector.h (SCM_I_WVECTP): Use them.

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

	check for pairs with scm_is_pair, not scm_nimp
	* libguile/array-map.c (scm_ra_matchp, scm_ramapc):
	* libguile/dynwind.c (scm_swap_bindings):
	* libguile/hooks.c (hook_print, scm_c_run_hook, scm_c_run_hookn):
	* libguile/objprop.c (scm_object_property, scm_set_object_property_x):
	  Use !scm_is_pair as the termination condition, not scm_imp.

	de-inline cons in scm_acons
	* libguile/alist.c (scm_acons): Don't inline the conses.

	remove mutex in make-object-property
	* module/ice-9/boot-9.scm (make-object-property): Remove the mutex; weak
	  tables are now threadsafe.

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

	remove weak pairs, rewrite weak vectors
	* libguile/weak-vector.c:
	* libguile/weak-vector.h: Renamed from weaks.[ch].  Remove weak pairs.
	  They were not safe to access with `car' and `cdr'.  Remove weak alist
	  vectors, as we have weak tables and sets.  Reimplement weak vectors,
	  moving the implementation here.

	* libguile/vectors.c:
	* libguile/vectors.h: Remove the extra header word.  Use
	  scm_c_weak_vector_ref / scm_c_weak_vector_set_x to access weak
	  vectors.

	* libguile/snarf.h: Remove the extra header word in vectors.

	* libguile/threads.c (do_thread_exit, fat_mutex_lock, fat_mutex_unlock):
	  Instead of weak pairs, store thread-owned mutexes in a list of
	  one-element weak vectors.

	* libguile/guardians.c (finalize_guarded): Similarly, store object
	  guardians in a list of one-element weak vectors.

	* libguile/modules.c (scm_module_reverse_lookup): We no longer need to
	  handle the case of weak references.

	* libguile/print.c (iprin1): Use the standard vector accessor to print
	  vectors.

	* libguile.h:
	* libguile/Makefile.am:
	* libguile/gc-malloc.c:
	* libguile/gc.c:
	* libguile/goops.c:
	* libguile/init.c:
	* libguile/objprop.c:
	* libguile/struct.c: Update includes.

	* module/ice-9/weak-vector.scm: Load weak vector definitions using an
	  extension instead of %init-weaks-builtins.

	* test-suite/tests/weaks.test: Use the make-...-hash-table names instead
	  of the old alist vector names.

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

	remove a stale comment
	* module/system/foreign.scm (define-wrapped-pointer-type): Remove stale
	  comment.

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

	convert internal weak hash table users to use the weak table api
	The weak table API isn't public yet.  It could be after some review.
	But we can go ahead and use it now internally.

	* libguile/foreign.c:
	* libguile/goops.c:
	* libguile/objprop.c:
	* libguile/procprop.c:
	* libguile/smob.c:
	* libguile/srcprop.c: Update weak table users to new API.  No locking
	  needed!

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

	reimplement hashtab.c's weak hash tables in terms of weak-table.c
	* libguile/hashtab.c:
	* libguile/hashtab.h: Reimplement the weak hash table implementation in
	  terms of weak tables.  All is well except for the horrific hack for
	  hashx tables.

	* libguile/weak-table.h:
	* libguile/weak-table.c (scm_make_weak_key_hash_table)
	  (scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table)
	  (scm_weak_key_hash_table_p, scm_weak_value_hash_table_p)
	  (scm_doubly_weak_hash_table_p): Move these definitions here.

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

	add weak table implementation
	* libguile/weak-table.c:
	* libguile/weak-table.h: New files, implementing open-addressed weak
	  hash tables, similar to the implementation of weak sets.  This will
	  let us remove weak pairs.

	* libguile.h:
	* libguile/Makefile.am:
	* libguile/evalext.c:
	* libguile/gc.c:
	* libguile/init.c:
	* libguile/print.c:
	* libguile/tags.h: Update all the pieces for the new files and tc7.

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

	add scm_c_make_port; the port table is now a weak set
	* libguile/ports.c (scm_c_make_port_with_encoding, scm_c_make_port): New
	  functions, to replace scm_new_port_table_entry.  Use a weak set
	  instead of a weak table.
	  (scm_i_remove_port):
	  (scm_c_port_for_each, scm_port_for_each): Adapt to use weak set.
	  (scm_i_void_port): Use scm_c_make_port.
	  (scm_init_ports): Make a weak set.

	* libguile/fports.c:
	* libguile/ioext.c:
	* libguile/r6rs-ports.c:
	* libguile/strports.c:
	* libguile/vports.c: Adapt to use the new scm_c_make_port API.

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

	symbols.c uses weak sets
	* libguile/symbols.c (lookup_interned_symbol)
	  (lookup_interned_latin1_symbol, intern_symbol): Adapt to use weak sets
	  instead of weak-key hash tables.

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

	add weak sets
	* libguile/weak-set.c:
	* libguile/weak-set.h: New files, implementing weak sets, for use in the
	  symbol table and port set.  Eventually we will be able to remove weak
	  pairs.

	* libguile.h:
	* libguile/Makefile.am: Add new files.

	* libguile/evalext.c:
	* libguile/gc.c:
	* libguile/init.c:
	* libguile/print.c:
	* libguile/tags.h: Add support for the new types.

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

	Update `NEWS'.

	Fix compilation of `deprecated.c' with SCM_DEBUG_TYPING_STRICTNESS=2.
	* libguile/deprecated.c (init_module_stuff,
	  scm_primitive_make_property): Use `scm_is_false' instead of direct
	  comparison to SCM_BOOL_F'.
	  (maybe_close_port, scm_close_all_ports_except): Use `SCM2PTR' and
	  `PTR2SCM' instead of wild casts.

	Bump version number for 2.0.3.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	  (LIBGUILE_INTERFACE_CURRENT): Increment to account for new C functions
	  `scm_is_exact' etc.
	  (LIBGUILE_INTERFACE_AGE): Increment.

	Update Gnulib to v0.0-6523-gb3609c1.

	doc: Document the `sitedir' and `extensiondir' pkg-config variables.
	* doc/ref/libguile-parallel.texi (Parallel Installations): Document the
	  `sitedir' and `extensiondir' pkg-config variables.  This fixes
	  <https://savannah.gnu.org/bugs/index.php?32515>, reported by
	  Dale. P. Smith.

2011-10-22  Bake Timmons  <b3timmons@speedymail.org>

	Fix compilation with `--enable-debug-malloc'.
	* libguile/gc-malloc.c (scm_gc_register_collectable_memory): Add the
	  missing second argument in the call to scm_malloc_register.

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

	Initialize `get_internal_run_time' before it is used.
	* libguile/init.c (scm_i_init_guile): Call `scm_init_stime' before
	  `scm_init_gc'.  Fixes <https://savannah.gnu.org/bugs/?34616> reported
	  by Bake Timmons.

2011-10-22  BT Templeton  <bpt@hcoop.net>

	set width for `,trace' command
	* module/system/repl/command.scm (trace): Set trace width to terminal
	  width by default.

2011-10-21  Andy Wingo  <wingo@pobox.com>

	fix segfault in goops if class fields are redefined
	* libguile/goops.c (map, filter_cpl, remove_duplicate_slots): Use
	  scm_is_pair instead of !scm_is_null, given that we use accessor
	  macros.
	  (check_cpl, build_slots_list): Check that descendents of <class> can't
	  redefine slots of <class>.

	* test-suite/tests/goops.test ("defining classes"): Add a test.

	Patch originally by Stefan Israelsson Tampe.

2011-10-20  Andy Wingo  <wingo@pobox.com>

	fix misallocation of some <fix> procedures
	* module/language/tree-il/analyze.scm (analyze-lexicals): When stepping
	  into a non-tail form, we know that labels allocation will be invalid,
	  so use an empty labels set.  Fixes http://debbugs.gnu.org/9769.

	* test-suite/tests/tree-il.test ("labels allocation"): Add a test.

2011-10-19  Andy Wingo  <wingo@pobox.com>

	slight frames.h refactor
	* libguile/frames.h: Instead of doing a lot of nasty pointer match and
	  casts here, simply define a struct that aliases the contents of a
	  stack frame.  There are some naming issues here, that the SCM_FRAME
	  macros access the scm_vm_frame structure, but SCM_VM_FRAME macros
	  access scm_frame; oh well.

2011-10-18  Ludovic Courtès  <ludo@gnu.org>

	doc: Add `libguile-parallel.texi' to the distribution.
	This is a followup to d32df1325dfe5f550cf1262dc7e90ba86b526a7c ("manual:
	reorganize autoconf, pkg-config info").

	* doc/ref/Makefile.am (guile_TEXINFOS): Add `libguile-parallel.texi'.

2011-10-17  Andy Wingo  <wingo@pobox.com>

	fix (web http) write-date for mondays
	* module/web/http.scm (write-date): Fix bug on Mondays.  Jeez!

2011-10-16  Ludovic Courtès  <ludo@gnu.org>

	doc: Complete renaming of `autoconf.texi'.
	This is a followup to d32df1325dfe5f550cf1262dc7e90ba86b526a7c ("manual:
	reorganize autoconf, pkg-config info").

	* doc/ref/Makefile.am: Replace references to `autoconf.texi' by
	  `libguile-autoconf.texi'.

2011-10-16  Ludovic Courtès  <ludo@gnu.org>

	Update (ice-9 match) from Chibi-Scheme.
	* module/ice-9/match.scm (match): Remove macro.

	* module/ice-9/match.upstream.scm: Update from Chibi-Scheme, which fixes
	  <http://debbugs.gnu.org/9567>.

	* test-suite/tests/match.test.upstream: Likewise.

2011-10-15  Ludovic Courtès  <ludo@gnu.org>

	coverage: Add tests for `case-lambda'.
	* test-suite/tests/coverage.test
	  ("line-execution-counts")["case-lambda"]: New test.
	  ("procedure-execution-count")["case-lambda"]: New test.

	doc: Mention the partial evaluator next to `define-inlinable'.
	* doc/ref/api-procedures.texi (Inlinable Procedures): Mention inlining
	  performed by the partial evaluator.

	coverage: Add test with `eval'.
	* test-suite/tests/coverage.test (test-procedure): New procedure.
	  ("procedure-execution-count")["called from eval"]: New test.

2011-10-15  Cedric Cellier  <cedric.cellier@securactive.net>

	Default to using poll(2) in `fport_input_waiting'.
	* libguile/fports.c (fport_input_waiting): Use poll(2) instead of
	  select(2) when possible.  Cosmetic changes by Ludovic Courtès.

2011-10-15  Andy Wingo  <wingo@pobox.com>

	revise comments in libguile/tags.h
	* libguile/tags.h: Revise the comments to reflect libgc reality.

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

	update NEWS for 2.0.3
	* NEWS: Update.

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

	add "Installing Site Packages"
	* doc/ref/scheme-using.texi (Installing Site Packages): Add a new
	  section about where to install .scm, .go, and .so files.

	* doc/ref/tour.texi: Reference it here.
	* doc/ref/guile.texi: Add new section.

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

	update tour.texi for site modules and extensions
	* doc/ref/tour.texi (Putting Extensions into Modules)
	  (Writing new Modules): In the examples, show the files as being in the
	  "site" dirs.

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

	manual: reorganize autoconf, pkg-config info
	* doc/ref/libguile-parallel.texi: New file, documenting parallel
	  installation and the use of pkg-config.

	* doc/ref/libguile-linking.texi: Adapt.

	* doc/ref/libguile-autoconf.texi: Rename from autoconf.texi.  Lower
	  sections, and integrate in the "Programming in C" chapter.

	* doc/ref/guile.texi: Adapt.

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

	remove documentation on autofrisk foo
	* doc/ref/autoconf.texi: Remove documentation on autofrisk facility,
	  given that we do not ship those macros, and to my knowledge, never
	  have.

	add (web client) docs
	* doc/ref/web.texi (Web Client): New doc section.

2011-10-10  Andy Wingo  <wingo@pobox.com>

	fold constants with accessors
	* module/language/tree-il/peval.scm (peval): Factor constant folding out
	  to a helper.  Use it in the accessor case in addition to the normal
	  effect-free-primitive case.

	* test-suite/tests/tree-il.test: Add a test.

2011-10-10  Andy Wingo  <wingo@pobox.com>

	recognize string primitives
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Add string?, string-length, and ref
	  and set.
	  (*primitive-accessors*): Add string-ref.
	  (*effect-free-primitives*): Add string-length and string?
	  (*effect+exception-free-primitives*): Add string?.
	  (*singly-valued-primitives*): Add string-length and ref and set.

2011-10-10  Andy Wingo  <wingo@pobox.com>

	add ,expand and ,optimize
	* module/system/repl/command.scm (*command-table*, expand, optimize):
	  New meta-commands.
	* module/system/repl/common.scm (repl-expand, repl-optimize): New
	  helpers.

	* doc/ref/scheme-using.texi (Compile Commands): Document.

2011-10-10  Andy Wingo  <wingo@pobox.com>

	regenerate psyntax-pp.scm
	* module/ice-9/psyntax-pp.scm: Regenerate, now with optimizations.

2011-10-10  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Does not include psyntax regeneration.

	Conflicts:
		module/ice-9/psyntax-pp.scm
		module/language/tree-il/peval.scm
		test-suite/tests/tree-il.test

2011-10-10  Andy Wingo  <wingo@pobox.com>

	regenerate psyntax-pp.scm
	* module/ice-9/psyntax-pp.scm: Regenerate, now with inlined letrec
	  bindings.  Whee!!

2011-10-10  Andy Wingo  <wingo@pobox.com>

	peval support for memq and memv
	* module/language/tree-il/peval.scm (peval): Add special handlers for
	  memq and memv, as inline.scm used to have.  This is important for
	  `case' clauses.  It is very ugly, though.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add tests.

2011-10-10  Andy Wingo  <wingo@pobox.com>

	add accessor-primitive?, peval uses it
	* module/language/tree-il/primitives.scm (*primitive-accessors*): New
	  set of primitives: those that access mutable memory, but are otherwise
	  pure.  Include bytevector references here.
	  (accessor-primitive?): New public predicate.

	* module/language/tree-il/peval.scm (peval): Refactor to distinguish
	  constructor-primitive? from accessor-primitive?.

2011-10-10  Andy Wingo  <wingo@pobox.com>

	peval: visit operands on-demand, to inline mutually recursive bindings
	This commit changes to use <operand> structures to hold the context
	needed to visit lexical bindings lazily, in context, instead of eagerly
	visiting them for value.  This laziness enables inlining of mutually
	recursive bindings.

	* module/language/tree-il/peval.scm (<var>): Remove comment about copy
	  propagation having to run build-var-table; things don't work like that
	  any more.
	  (build-var-table): Build <var> entries for all variables, even
	  unreferenced variables.
	  (alpha-rename): Remove.  We will rename bindings on-demand now.

	  (peval lookup-var): New helper, to fetch the <var> of a gensym.

	  (peval fresh-gensyms): Fold here, under peval, and in it, handle
	  updating the store to record a mapping between new names and <var>
	  entries from the source program.

	  (peval record-source-expression): Don't call build-var-table on the
	  new expression, as alpha-renaming happens on-demand now.

	  (peval prune-bindings): Rewrite to work with mutually-recursive
	  bindings, while optionally preserving binding order.

	  (peval extend-env): New helper.

	  (peval loop): OK, here goes... Remove the `operand' context, as now we
	  visit operands lazily.  Add a `call' context, which does not
	  copy-propagate lambda expressions, used to residualize a call after
	  aborting an inlining attempt.  Change the `env' to be a mapping of
	  gensym to <operand>.  Instead of looking up the operand's binding then
	  alpha-renaming it, just rely on the fact that visiting the operand
	  will rename it if necessary.

	  If we residualize a lexical, do so with the fresh name from the
	  environment.  If we visit an operand and it doesn't turn out to be
	  constant, we will never be able to copy it, and so cache that fact in
	  the operand.  If we residualize a binding and we know what the value
	  should be, record that binding so that prune-bindings won't have to
	  visit it again.  If the operand folds to a constant, cache that too,
	  to save effort when unrolling loops.

	  For let, letrec, fix, and lambda-case, instead of visiting the
	  bindings eagerly for value, simply record the source expressions and
	  environments in an <operand> and rely on copy-propagation to visit
	  them later in the right context.  In the case of letrec and fix, this
	  allows mutually-recursive bindings to be inlined.

	  Refactor folding of "constructors" (which still need renaming) to
	  avoid visiting operands twice in some contexts.

	  For applications, if we have to abort, process the procedure in call
	  context, which allows some folding but avoids copying lambdas.  If we
	  find a recursive procedure, mark intervening counters as recursive
	  too, to allow for mutual recursion at the top level.

	  For lambdas, if we are processing for value, record the source
	  expression so we can detect recursion.  This was previously done in
	  the lexical-ref copy propagator.

	* test-suite/tests/tree-il.test ("partial evaluation"): Remove unused
	  recursive lexicals in a couple of cases.  Add a couple test cases for
	  pruning.  Add a few recursive binding cases.

2011-10-10  Andy Wingo  <wingo@pobox.com>

	peval: add operand structure
	* module/language/tree-il/peval.scm (<operand>): Add operand structure,
	  to be used by peval.

	peval: refactor logging
	* module/language/tree-il/peval.scm: Make it easier to turn on logging.

2011-10-10  Mike Gran  <spk121@yahoo.com>

	New functions scm_is_exact and scm_is_inexact
	* doc/ref/api-data.texi (Exact and Inexact Numbers): doc for scm_is_exact
	  and scm_is_inexact
	* libguile/numbers.c (scm_is_exact, scm_is_inexact): new functions
	* libguile/numbers.h: declarations for scm_is_exact and scm_is_inexact
	* test/suite/standalone/test-conversion.c (test_is_exact, test_is_inexact):
	  new tests

2011-10-09  Mike Gran  <spk121@yahoo.com>

	Document SCM_ASSERT_TYPE and SCM_ASRTGO macros
	* doc/ref/api-control.texi (Signalling Type Errors): document macros

2011-10-08  Andy Wingo  <wingo@pobox.com>

	peval: logging
	* module/language/tree-il/peval.scm: Define a quick and dirty
	  infrastructure for logging.  Use it in peval.

2011-10-07  Andy Wingo  <wingo@pobox.com>

	peval: bugfix in constant-expression?
	* module/language/tree-il/peval.scm (constant-expression?): Correctly
	  handle lambda-case alternates.

	optimizer verifies its output
	* module/language/tree-il/optimize.scm: Verify the result of partial
	  evaluation.

	add tree-il verifier
	* module/Makefile.am: Add debug.scm.
	* module/language/tree-il/debug.scm: New file, a verifier for tree-il.

2011-10-06  Andy Wingo  <wingo@pobox.com>

	peval refactor
	* module/language/tree-il/peval.scm (peval): Refactor the for-value, etc
	  helpers.

	comment peval.scm
	* module/language/tree-il/peval.scm: Add comments.  Move alpha-rename
	  later in the file.

2011-10-05  Andy Wingo  <wingo@pobox.com>

	fix reading of #||||#
	* libguile/read.c (scm_read_r6rs_block_comment):
	* test-suite/tests/reader.test ("reading"): Fix reading of #||||#,
	  originally reported in bug debbugs.gnu.org/9672, by Bruno Haible.
	  Thanks, Bruno!

2011-09-30  Ludovic Courtès  <ludo@gnu.org>

	peval: Add test for possible infinite recursion.
	* test-suite/tests/tree-il.test ("partial evaluation"): Add test.

	Add link to the (ice-9 match) bug.
	* module/ice-9/match.scm: Add comment.

2011-09-30  Ludovic Courtès  <ludo@gnu.org>

	peval: Recognize module-refs to primitives.
	* module/language/tree-il/optimize.scm (peval): Handle module-refs to
	  primitives.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add test, using
	  `pmatch'.

2011-09-29  Andy Wingo  <wingo@pobox.com>

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

2011-09-29  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	This was a pretty big merge involving a fair amount of porting,
	especially to peval and its tests.  I did not update psyntax-pp.scm,
	that comes in the next commit.

	Conflicts:
		module/ice-9/boot-9.scm
		module/ice-9/psyntax-pp.scm
		module/language/ecmascript/compile-tree-il.scm
		module/language/tree-il.scm
		module/language/tree-il/analyze.scm
		module/language/tree-il/inline.scm
		test-suite/tests/tree-il.test

2011-09-28  Andy Wingo  <wingo@pobox.com>

	generate psyntax-pp in canonical form
	* module/ice-9/compile-psyntax.scm (source): Canonicalize after
	  optimizing.  The optimizer should be a little more clever, but
	  currently fix-letrec outputs some non-canonical forms.

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

2011-09-28  Andy Wingo  <wingo@pobox.com>

	separate peval and a new canonicalization pass into their own modules
	* module/language/tree-il/peval.scm: Move to its own file.  Remove the
	  bits about <prompt> thunk-application bodies, as they are not
	  optimizations, simply expectations of the compiler.  `canonicalize'
	  handles that now.

	* module/language/tree-il/optimize.scm: Use peval from its module.
	  Don't call `inline!', as that's useless now.

	* module/language/tree-il/canonicalize.scm: New file, implementing a
	  pass that `compile-tree-il' runs on the result from the optimizer.
	  The compiler currently expects a <let> form to have bindings, for
	  example, and this pass turns a <let> without bindings into its body.

	* module/language/tree-il/inline.scm: Deprecate, as `peval' does
	  everything this function ever did.

	* module/language/tree-il/compile-glil.scm: Canonicalize after
	  optimizing.  This should allow us to skip the optimizer entirely, if
	  we want.

	* module/Makefile.am: Update and reorder a little bit.

2011-09-28  Andy Wingo  <wingo@pobox.com>

	regenerate psyntax-pp.scm, with optimizations
	* module/ice-9/psyntax-pp.scm: Regenerate.

	((lambda ...) ...) fix
	* module/language/tree-il/optimize.scm (peval): If it's a lambda in the
	  operator position, inline without a nested counter, as it's not
	  possible to increase code size.

	peval: more effective binding pruning
	* module/language/tree-il/optimize.scm (peval): Factor prune-bindings
	  out of `let' and company.  Have it process unreferenced bindings in
	  effect context instead of always residualizing non-constant
	  expressions.

	don't propagate pure primcalls that might not type-check
	* module/language/tree-il/optimize.scm (types-check?): New helper, to
	  determine if a primcall will apply without throwing an exception.
	  (peval): constant-expression? returns #f for expressions that don't
	  types-check?.  Effect-free primitives that type-check are void.

	fix unparse-tree-il of <dynset>
	* module/language/tree-il.scm (unparse-tree-il): Fix printing of
	  `dynset'.

	peval works on all expressions
	* module/language/tree-il/optimize.scm (alpha-rename, peval): Add
	  <dynset> cases.  Allow any kind of <application>.  Remove the `catch'
	  wrapper as now peval handles all kinds of expressions.

2011-09-28  Andy Wingo  <wingo@pobox.com>

	peval: elide make-prompt-tag in effect context
	* module/language/tree-il/optimize.scm (peval): Fix a duplicate
	  traversal for constructors in effect or test context.  Add support for
	  eliding make-prompt-tag.

	* test-suite/tests/tree-il.test ("partial evaluation"): Update the test
	  for make-prompt-tag elision.

2011-09-28  Andy Wingo  <wingo@pobox.com>

	peval: add support for <prompt> and <abort>
	* module/language/tree-il/optimize.scm (alpha-rename, peval): Handle
	  <prompt> and <abort>.  Attempt to remove the prompt if the tag is
	  otherwise unreferenced.

	* module/language/tree-il/primitives.scm (*primitive-constructors*): Add
	  make-prompt-tag as a constructor.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add a test that
	  an prompt whose tag is unreferenced is removed.

2011-09-28  Andy Wingo  <wingo@pobox.com>

	peval: fix algorithmic behavior of `cons'
	* module/language/tree-il/optimize.scm (peval): Fix treatment of `cons'
	  to not process the value twice, leading to n^2 work.  This prevented
	  primitives.scm from compiling in a reasonable amount of time, because
	  it contained a `(foo ... ,@bar) form that resulted in a long sequence
	  of nested conses, and no effort counter was in place as it was not
	  within an inlining attempt.

2011-09-27  Ludovic Courtès  <ludo@gnu.org>

	doc: (ice-9 match) doesn't have `__1'.
	* doc/ref/match.texi (Pattern Matching): Remove `__1', which doesn't
	  exist.  Thanks to Chris K. Jester-Young.

	doc: Update (ice-9 match) reference.
	* doc/ref/match.texi (Pattern Matching): Document `***', `..1', and
	  `__1'; remove `..k' and `__k'.  Reported by Chris K. Jester-Young.

	doc: Fix typesetting of function definitions in "Accessing Modules from C".
	* doc/ref/api-modules.texi (Accessing Modules from C): Use the phrase "C
	  Function" instead of "C Procedure".  Enclose multiple-word type names
	  in braces.  Reported by Dale P. Smith.

2011-09-27  Andy Wingo  <wingo@pobox.com>

	peval: more strict accounting
	* module/language/tree-il/optimize.scm (transfer!, make-nested-counter):
	  (make-recursive-counter, peval): Limit the algorithm's time to be
	  strictly O(N) by transferring effort and size counters of recursive
	  inlining attempts from containing counters.

	* test-suite/tests/tree-il.test ("partial evaluation"): Update
	  expectations for the ((lambda (x) (x x)) (lambda (x) (x x))) case, as
	  the new accounting policy will cause the entire inlining attempt to
	  abort.

2011-09-26  Andy Wingo  <wingo@pobox.com>

	peval: fix inlining of lambda* with #:optional
	* module/language/tree-il/optimize.scm (peval): Fix calculation of how
	  many init expressions to drop when inlining lambdas.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add tests.

2011-09-26  Andy Wingo  <wingo@pobox.com>

	remove unused peval helpers
	* module/language/tree-il/optimize.scm (peval): Remove a couple unused
	  helpers.

2011-09-25  Andy Wingo  <wingo@pobox.com>

	peval: simpler and more precise treatment of mutability
	* module/language/tree-il/optimize.scm (peval): The old approach of
	  optimistically producing constants and then de-constifying them at
	  their uses was not only cumbersome but incorrect: it both failed to
	  preserve identity in some cases and failed to retain immutable
	  constant values.  Instead, now we only produce constants if they
	  really are constant and immutable.  The constant folder has to have a
	  few more algebraic cases to be as effective as it was, to destructure
	  (car (cons _ _)) appropriately.  On the plus side, now constructors
	  and deconstructors can handle impure cases more generally.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add constructor
	  and destructuring tests.  Adapt other tests to new expectations.

2011-09-25  Andy Wingo  <wingo@pobox.com>

	peval: add a bunch of missing maybe-unconst calls
	* module/language/tree-il/optimize.scm (peval): Add missing
	  maybe-unconst calls.  Things are getting ugly.  They will get better
	  in the next commit though.

2011-09-25  Andy Wingo  <wingo@pobox.com>

	peval uses effort counters, propagates lambdas more effectively
	* module/language/tree-il/optimize.scm (code-contains-calls?): Remove
	  this helper, we will deal with recursion when it happens, not after
	  the fact.
	  (peval): Add keyword args for various size and effort limits.  Instead
	  of keeping a call stack, keep a chain of <counter> records, each with
	  an abort continuation.  If ever an inlining attempt is taking too
	  long, measured in terms of number of trips through the main loop, the
	  counter will abort.  Add new contexts, `operator' and `operand'.  They
	  have different default size limits.  In the future we should actually
	  use the size counter, instead of these heuristics.

	  The <lexical-ref> case is smarter now, and tries to avoid propagating
	  too much data.  Perhaps it should be dumber though, and use a
	  counter.  That would require changes to the environment structure.

	  Inline <lambda> applications to <let>, so that we allow residual
	  lexical references to have bindings.  Add a `for-operand' helper, and
	  use it for the RHS of `let' expressions.  A `let' is an inlined
	  `lambda'.

	  `Let' and company no longer elide bindings if the result is a
	  constant, as the arguments could have effects.  Peval will still do as
	  much as it can, though.

	* test-suite/tests/tree-il.test ("partial evaluation"): Update the tests
	  for the new expectations.  They are uniformly awesomer, with the
	  exception of two cases in which pure but not constant data is not
	  propagated.

2011-09-24  Andy Wingo  <wingo@pobox.com>

	prune unused letrec bindings
	* module/language/tree-il/optimize.scm (peval): Prune unused `letrec'
	  bindings.

	more peval refactoring
	* module/language/tree-il/optimize.scm (peval): Rename `var-table' to
	  `store', as we're going to put some more things in it.  Rename
	  `record-lexical-bindings' to `record-source-expression', which also
	  takes the original, pre-renaming expression.  Keep a mapping from new
	  expressions to original expressions, available using the
	  `source-expression' helper.

	add helpers for effort counters
	* module/language/tree-il/optimize.scm (<counter>, abort-counter)
	  (record-effort!, record-size!, find-counter, make-top-counter)
	  (make-nested-counter, make-recursive-counter): New helpers, as yet
	  unused, but which will implement fixed effort bounds on the inlining
	  algorithm.

	peval refactor
	* module/language/tree-il/optimize.scm (peval): Add for-value, for-test,
	  for-effect, and for-tail helpers.  Use them.

2011-09-24  Andy Wingo  <wingo@pobox.com>

	attempt to prune unreferenced bindings
	* module/language/tree-il/optimize.scm (peval): Rename `record-lexicals'
	  to `record-lexical-bindings'.  Record residualized lexical
	  references.  Record lexical references in maybe-unlambda.
	  Unfortunately this has the disadvantage that the speculative mapping
	  of lambda expressions to lexical references records that reference,
	  even if we are not going to residualize it.  After processing a `let',
	  prune pure unreferenced bindings.  (We can do better than this in the
	  future: we can simply process them for effect.)

	* test-suite/tests/tree-il.test (pass-if-peval): More debugging.
	  ("partial evaluation"): Update to reflect the fact that the `y'
	  binding won't be emitted.

2011-09-24  Andy Wingo  <wingo@pobox.com>

	peval handles lexical-set
	* module/language/tree-il/optimize.scm (alpha-rename, peval): Add
	  support for lexical-set, while avoiding copy propagation and pruning
	  of assigned variables.

	peval: pre-analyze mutated or reffed-once lexicals
	* module/language/tree-il/optimize.scm (<var>, build-var-table, peval):
	  Before going into peval, build a table indicating refcounts and a set?
	  flag for all lexicals.  Add to the table when introducing new bindings
	  (via alpha-renaming).

2011-09-24  Andy Wingo  <wingo@pobox.com>

	peval: don't propagate expressions that access memory
	* module/language/tree-il/optimize.scm (peval): Rename
	  `pure-expression?' to `constant-expression?', in the sense of GCC's
	  `pure' and `const'.  A <toplevel-ref> is not constant, because it can
	  be mutated.  A <dynref> isn't constant either, for the same reason.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add a test, and
	  update existing tests that assumed that toplevel-ref would propagate.

2011-09-24  Andy Wingo  <wingo@pobox.com>

	context-specific folding for peval in test and effect contexts
	* module/language/tree-il/optimize.scm (peval): Add a "test" context,
	  which folds statically decidable values to <const>.  Fold pure
	  expressions to <void> in "effect" contexts.  Adapt the <conditional>
	  and <sequence> tests to simply look for <const> or <void> expressions,
	  respectively.

	thread a context through peval
	* module/language/tree-il/optimize.scm (peval): Thread a "context"
	  through the evaluator.

2011-09-24  Andy Wingo  <wingo@pobox.com>

	paper around `match' bug
	* module/ice-9/match.scm (match): Always introduce a lexical binding, to
	  avoid http://debbugs.gnu.org/9567.  Real fix ongoing.  Patch and
	  original report by Stefan Israelsson Tampe.

	* test-suite/tests/match.test: Add test.

2011-09-24  Andy Wingo  <wingo@pobox.com>

	peval: various bugfixes
	* module/language/tree-il/optimize.scm (alpha-rename): Rename the
	  init
	  expressions of a <lambda-case>.
	  (peval): Coalesce the <let-values> clauses.
	  Fix pure-expression? matching of <lambda> clauses.
	  Loop over and maybe-unconst the inits of a <lambda-case>.

	tree-il-any bugfix
	* module/language/tree-il/optimize.scm (tree-il-any): Fix to be called
	  on all values, including leaves.  It didn't matter for the use case,
	  though.

	minor peval style tweak
	* module/language/tree-il/optimize.scm (peval): Minor refactor to
	  <lexical-ref> copy propagation.

	fix alpha-rename for kwargs
	* module/language/tree-il/optimize.scm (alpha-rename): Fix
	  alpha-renaming of keyword arguments.

2011-09-23  Ludovic Courtès  <ludo@gnu.org>

	peval: Add test for multiple-value returns.
	* test-suite/tests/tree-il.test (pass-if-peval): Support the
	  `resolve-primitives' keyword.
	  ("partial evaluation"): Add test for `call-with-values'.

	peval: Rectify style.
	* module/language/tree-il/optimize.scm (peval): Rename `src' to
	  `lv-src', and `src2' to `src'; pass `make-let-values' the right source
	  locations.  Reindent `let*'.

2011-09-23  Andy Wingo  <wingo@pobox.com>

	prevent propagation for memory-dependent operations like `car'
	* module/language/tree-il/primitives.scm (*primitive-constructors*):
	  Record car, cdr, vector-ref, and struct-ref as "constructors".
	  Comment to come later.
	  (*effect-free-primitives*): Update.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add tests.

2011-09-21  Andy Wingo  <wingo@pobox.com>

	peval comment & reindentation
	* module/language/tree-il/optimize.scm (peval): Add a comment regarding
	  failure modes, and reindent one clause.

	fix comment regarding alpha-renaming
	* module/language/tree-il/optimize.scm (peval): Fix comment regarding
	  alpha-renaming: it's not simply the allocator that needs unique names;
	  rather, all transformations depend on it.

	better pure-expression?
	* module/language/tree-il/optimize.scm (peval): Allow dynref, fix, and
	  let-values to be pure expressions.

	more alpha-rename robustness
	* module/language/tree-il/optimize.scm (alpha-rename): Handle all kinds
	  of tree-il, with the current exceptions of lexical set!, prompt, and
	  abort.

	more robust alpha-renaming
	* module/language/tree-il/optimize.scm (fresh-gensyms): New helper.
	  (alpha-rename): Name the new gensyms using the old names as templates,
	  not the old gensyms.  This prevents accidental collisions between
	  gensyms, if #{x 1}# becomes #{x 12}# instead of #{x 2}#.

	peval: inlining of let-values
	* module/language/tree-il/optimize.scm (peval): Add support for
	  let-values.  Try to inline the consumer into the body of the producer,
	  if there is only one return point, and we can figure out how many
	  values are being returned, and that number is compatible with the
	  consumer.

	peval support for more forms
	* module/language/tree-il/optimize.scm (peval): Add support for fix,
	  dynwind, dynlet, dynref, module-set, and toplevel-set.  (Mutating a
	  variable directly is similar to calling a function that does so behind
	  our backs, so this presents no additional problem.)

	add singly-valued-primitive?
	* module/language/tree-il/primitives.scm (singly-valued-primitive?): New
	  predicate, for primitives that return exactly one value.

	more optimize.scm factoring
	* module/language/tree-il/optimize.scm (vlist-any): New helper.
	  (peval): Use it here.

	optimize.scm refactor
	* module/language/tree-il/optimize.scm (let/ec, tree-il-any): New
	  helpers.
	  (code-contains-calls?): Use them here.

2011-09-21  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix compilation of untyped arrays of rank not 1
	* module/language/glil/compile-assembly.scm: vector-fold2 expects vector.

2011-09-19  Julian Graham  <julian@navigator.(none)>

	Remove extraneous semicolon from `SCM_STATIC_SUBR_OBJVECT' to prevent ISO C90 warning.
	* snarf.h (SCM_STATIC_SUBR_OBJVECT): Remove semicolon at end of macro
	  definition.

2011-09-18  Ludovic Courtès  <ludo@gnu.org>

	peval: Abort inlining when the residual code contains recursive calls.
	* module/language/tree-il/optimize.scm (code-contains-calls?): New
	  procedure.
	  (peval): Use it and abort inlining if the residual code of a procedure
	  application contains recursive calls.  Suggested by Wingo, Waddell,
	  and Dybvig.  Fixes <http://debbugs.gnu.org/9542>.

	* test-suite/tests/tree-il.test ("partial evaluation"): Update 2 tests
	  that relied on the previous behavior.  Add 1 another test.

2011-09-18  Ludovic Courtès  <ludo@gnu.org>

	peval: Improve alpha-renaming test.
	* test-suite/tests/tree-il.test ("partial evaluation")["inlined lambdas
	  are alpha-renamed"]: Rewrite.

2011-09-18  Ludovic Courtès  <ludo@gnu.org>

	Arrange so that stack-cleaning loops in GC tests are not optimized out.
	* test-suite/tests/gc.test (stack-cleanup): New procedure.
	  ("Unused modules are removed"): Use it.

	* test-suite/tests/threads.test (stack-cleanup): Likewise.
	  ("mutex with owner not retained (bug #27450)"): Use it.

2011-09-17  Ludovic Courtès  <ludo@gnu.org>

	peval: Typo.
	* module/language/tree-il/optimize.scm (peval)[maybe-unlambda]: Fix
	  typo in comment.

2011-09-17  Ludovic Courtès  <ludo@gnu.org>

	peval: Alpha-rename anonymous lambdas that are duplicated.
	* module/language/tree-il/optimize.scm (alpha-rename): New procedure.
	  (peval)[maybe-unlambda]: Use it.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add two test
	  cases for <https://lists.gnu.org/archive/html/bug-guile/2011-09/msg00019.html>.

2011-09-15  Andy Wingo  <wingo@pobox.com>

	Revert "SCM is a union"
	This reverts commit 8787d7a17029a8add20bb8e652ec744bc5d4e6c4.

2011-09-15  Andy Wingo  <wingo@pobox.com>

	Revert "SCM is either a union or scm_t_bits"
	This reverts commit 80125469ef95f6d8d46a26619fb2f85151f32719.

	Conflicts:

		libguile/__scm.h

2011-09-13  Ludovic Courtès  <ludo@gnu.org>

	peval: Use `resolve-primitives!'.
	* module/language/tree-il/optimize.scm (peval): Add `cenv' optional
	  argument; caller updated.
	  Use `resolve-primitives!' to resolve <primitive-ref> expressions.

	peval: Clarify `pure-expression?'.
	* module/language/tree-il/optimize.scm (peval)[pure-expression?]:
	  Clarify the comment.

2011-09-13  Ludovic Courtès  <ludo@gnu.org>

	peval: Inline thunks.
	* module/language/tree-il/optimize.scm (peval): Inline thunks.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add test.

2011-09-13  Ludovic Courtès  <ludo@gnu.org>

	peval: Use the right scope when replacing a lambda by a lexical-ref.
	* module/language/tree-il/optimize.scm (peval)[maybe-unlambda]: New
	  procedures.
	  Use it to de-duplicate named lambdas.  This fixes the scoping bug
	  described at <https://lists.gnu.org/archive/html/bug-guile/2011-09/msg00019.html>.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add tests to
	  reproduce the bug.

2011-09-13  Ludovic Courtès  <ludo@gnu.org>

	peval: Add tests for inlining with both static & dynamic arguments.
	* module/language/tree-il/optimize.scm (peval): Improve comment on the
	  inlining heuristics.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add two tests.

2011-09-11  Ludovic Courtès  <ludo@gnu.org>

	peval: Propagate only pure expressions to lambdas.
	* module/language/tree-il/optimize.scm (peval): Propagate ARGS to BODY
	  only when all of ARGS are pure.  Change APP to use `maybe-unconst' for
	  its arguments.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add tests for
	  mutability preservation and non-propagation of non-constant arguments
	  to lambdas.

2011-09-11  Ludovic Courtès  <ludo@gnu.org>

	peval: Try hard to preserve mutability.
	* module/language/tree-il/optimize.scm (peval)[make-values]: Distinguish
	  between 1 or another number of values.
	  [mutable?, make-value-construction, maybe-unconst]: New procedures.
	  Use it in <let>, <letrec>, <toplevel-define>, and <lambda-case>.

	* test-suite/tests/tree-il.test ("partial evaluation"): Add tests
	  for mutability preservation.

2011-09-11  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix typo regarding vhashes.
	* doc/ref/api-compound.texi (VHashes): s/vlist-/alist-/.

2011-09-10  Andy Wingo  <wingo@pobox.com>

	fix scm_to_latin1_stringn for substrings
	* libguile/strings.c (scm_to_latin1_stringn): Fix for substrings.

	* test-suite/standalone/Makefile.am:
	* test-suite/standalone/test-scm-to-latin1-string.c: Add test case.

	  Thanks to David Hansen for the bug report and test case, and Stefan
	  Israelsson Tampe for the fix.

2011-09-10  Ian Price  <ianprice90@googlemail.com>

	RFC 822 allows single digit days of the month
	* module/web/http.scm (parse-rfc-822-date): Add single digit day
	  conditional.
	* test-suite/tests/web-http.test("general headers"): Add test.

	Fix --listen option to allow other ports
	* module/ice-9/command-line.scm (compile-shell-switches): Fix
	  off-by-one error in 'substring', and swap branches of conditional.

2011-09-09  Ludovic Courtès  <ludo@gnu.org>

	Unoptimize the busy loop of `statprof.test'.
	This is a followup to f9c1b8278dbf1992d83f91f91391ee39e714d364 ("Tweak
	`statprof.test' for faster machines.").

	* test-suite/tests/statprof.test ("statistical sample counts within
	  expected range"): Compile with `#:partial-eval? #f'.

2011-09-09  Ludovic Courtès  <ludo@gnu.org>

	Remove unused macro in `tree-il.test'.
	* test-suite/tests/tree-il.test (assert-scheme->glil): Remove.

	doc: Use fashionable terminology for macros.
	* doc/ref/api-macros.texi (Macros): Mention EDSLs.

2011-09-09  Ludovic Courtès  <ludo@gnu.org>

	Clarify `--debug' vs. `--no-debug'.
	* module/ice-9/command-line.scm (*usage*): Attempt to suggest that
	  `--no-debug' doesn't inhibit debugging support.

	* doc/ref/guile-invoke.texi (Command-line Options): Make it clear that
	  `--no-debug' doesn't inhibit debugging support.  Reported by Manuel
	  Serrano.

2011-09-09  Ludovic Courtès  <ludo@gnu.org>

	Tweak `statprof.test' for faster machines.
	* test-suite/tests/statprof.test ("statistical sample counts within
	  expected range"): Increase NUM-CALLS and the frequency so that they
	  are at least a few samples on my new 2.6 GHz laptop.

2011-09-09  Ludovic Courtès  <ludo@gnu.org>

	Add a partial evaluator for use in the compiler.
	Thanks to William R. Cook for his excellent tutorial,
	<http://softlang.uni-koblenz.de/dsl11/>.

	* module/language/tree-il/optimize.scm (optimize!): Call `peval' unless
	  the #:partial-eval? option asks otherwise.
	  (peval): New procedure.

	* module/language/tree-il/inline.scm: Add comment.

	* module/language/tree-il/primitives.scm (*primitive-constructors*): New
	  variable.
	  (*effect-free-primitives*): Use it.
	  (constructor-primitive?): New primitive.

	* test-suite/tests/tree-il.test (assert-tree-il->glil): Extend to
	  support `with-partial-evaluation', `without-partial-evaluation', and
	  `with-options'.
	  (peval): New binding.
	  (pass-if-peval): New macro.
	  ("lexical refs"): Run tests without partial evaluation.
	  ("letrec"): Likewise.
	  ("the or hack"): Likewise.
	  ("conditional"): Likewise, for some tests.
	  ("sequence"): Adjust to new generated code.
	  ("partial evaluation"): New test prefix.

2011-09-06  Ludovic Courtès  <ludo@gnu.org>

	Use (ice-9 match) instead of `record-case' where it improves readability.
	* module/language/tree-il/analyze.scm (goops-toplevel-definition, const-fmt):
	  Replace `record-case' by `match'.
	  (format-analysis): Likewise, partially.

2011-09-03  Ludovic Courtès  <ludo@gnu.org>

	Fix misdiagnoses of deprecated `+nan.[^0]' forms.
	* libguile/numbers.c (mem2ureal): Check the result of `mem2uinteger'
	  against `SCM_INUM0', not 0.
	  (mem2uinteger): Add comment.

	doc: Augment "Pattern Matching" section.
	* doc/ref/match.texi (Pattern Matching): Mention records.  Add an
	  example showing record matching and the `=' pattern.  Point users to
	  `match.upstream.scm'.

2011-09-03  Ludovic Courtès  <ludo@gnu.org>

	Update (ice-9 match) from Chibi-Scheme.
	* module/ice-9/match.scm (slot-ref, slot-set!, is-a?): New macros.

	* module/ice-9/match.upstream.scm: Update from Chibi-Scheme.

	* test-suite/Makefile.am (SCM_TESTS): Add `tests/match.test.upstream'.

	* test-suite/tests/match.test (rtd-2-slots, rtd-3-slots): New record
	  types.
	  ("matches")["records"]: New test prefix.
	  ("doesn't match")["records"]: New test prefix.
	  Include `match.test.upstream'.

	* test-suite/vm/t-match.scm (matches?): Fix `$' example.

2011-09-03  Ludovic Courtès  <ludo@gnu.org>

	Remove Front-Cover and Back-Cover text from the manual.
	* doc/ref/guile.texi: Remove Front-Cover and Back-Cover text.

2011-09-03  Andy Wingo  <wingo@pobox.com>

	deprecate +nan.1
	* libguile/numbers.c (mem2ureal): Deprecate nan values that are not
	  "+nan.0".

2011-09-02  Andy Wingo  <wingo@pobox.com>

	fix srfi-67 compilation
	* module/srfi/srfi-67/compare.scm: Fix define-syntax-rule conversion.

	fix some cache consistency issues with goops and extended generics
	* module/oop/goops.scm (extended-by!, not-extended-by!)
	  (upgrade-accessor, merge-generics): Invalidate the method cache after
	  munging "extends" or "methods" fields.
	  (invalidate-method-cache!): A new wrapper around
	  %invalidate-method-cache!, that will also invalidate the caches of
	  "extended-by" generics.
	  (internal-add-method!, remove-class-accessors!): Use the new
	  invalidate-method-cache!.

	document define-syntax-rule
	* doc/ref/api-macros.texi (Syntax Rules): Add define-syntax-rule.

	more define-syntax-rule usage
	* module/ice-9/boot-9.scm:
	* module/ice-9/control.scm:
	* module/ice-9/futures.scm:
	* module/ice-9/optargs.scm:
	* module/ice-9/poll.scm:
	* module/ice-9/receive.scm:
	* module/ice-9/threads.scm:
	* module/ice-9/vlist.scm:
	* module/language/assembly/compile-bytecode.scm:
	* module/language/ecmascript/compile-tree-il.scm:
	* module/language/tree-il.scm:
	* module/oop/goops.scm:
	* module/oop/goops/simple.scm:
	* module/oop/goops/stklos.scm:
	* module/srfi/srfi-1.scm:
	* module/srfi/srfi-35.scm:
	* module/srfi/srfi-39.scm:
	* module/srfi/srfi-45.scm:
	* module/srfi/srfi-67/compare.scm:
	* module/sxml/match.scm:
	* module/system/repl/error-handling.scm:
	* module/system/repl/repl.scm:
	* module/system/vm/inspect.scm:
	* module/texinfo.scm:
	* module/web/server.scm: Use define-syntax-rule, where it makes sense.

2011-09-02  Andy Wingo  <wingo@pobox.com>

	psyntax uses define-syntax-rule
	* module/ice-9/psyntax.scm: Use define-syntax-rule.

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

2011-09-02  Andy Wingo  <wingo@pobox.com>

	add define-syntax-rule
	* module/ice-9/psyntax.scm (define-syntax-rule): Add this new helper
	  macro, to define a syntax-rules macro with one clause.

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

2011-08-31  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/bytevectors.c
		libguile/bytevectors.h
		libguile/objcodes.c
		libguile/r6rs-ports.c
		libguile/strings.c
		libguile/vm.c

2011-08-29  Andy Wingo  <wingo@pobox.com>

	fix scm_gc_strdup invocation
	* libguile/i18n.c (get_current_locale): Fix scm_gc_strdup invocation.

	texinfo: add paragraphindent
	* module/texinfo.scm (texi-command-specs): Add paragraphindent.

2011-08-23  Andy Wingo  <wingo@pobox.com>

	module-stexi-documentation #:docs-resolver keyword arg
	* module/texinfo/reflection.scm (module-stexi-documentation): Make
	  #:docs-resolver a keyword argument.  Provide back compat with
	  docs-resolver as an optional argument, though.

2011-08-23  Andy Wingo  <wingo@pobox.com>

	texinfo: alias `url' to `uref'.
	* module/texinfo.scm (texi-command-specs, complete-start-command):
	  Upstream texinfo has aliased `url' to `uref'.  Let's do the same.

	* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add a test.

2011-08-19  Andy Wingo  <wingo@pobox.com>

	better guild help FOO
	* module/scripts/help.scm (show-help, show-summary, show-usage): Grovel
	  for %synopsis and %help variables as well, and show them
	  appropriately.  Export these routines for other script modules to
	  use.  Needs documentation.

2011-08-18  Andy Wingo  <wingo@pobox.com>

	fix order of importing modules and resolving duplicates handlers
	* module/ice-9/boot-9.scm (define-module*): Resolve duplicates handlers
	  only after importing modules.  Fixes a bug in which a module with
	  #:use-module (oop goops) but whose merge-generics handler got resolved
	  to noop instead of the real merge-generics handler.  I can't think of
	  an easy way to test this, though.

	  Thanks to David Pirotte for the report!

2011-08-18  Andy Wingo  <wingo@pobox.com>

	fix a couple of leaks
	* libguile/bytevectors.h:
	* libguile/bytevectors.c (scm_c_take_gc_bytevector): Rename this
	  internal function, from scm_c_take_bytevector.  This indicates that
	  unlike the other scm_take_* functions, this one takes GC-managed
	  memory.

	* libguile/objcodes.c (scm_objcode_to_bytecode):
	* libguile/vm.c (really_make_boot_program): Use
	  scm_gc_malloc_pointerless, not scm_malloc.  Thanks to Stefan
	  Israelsson Tampe!

	* libguile/r6rs-ports.c:
	* libguile/strings.c: Adapt to renames.

2011-08-18  Andy Wingo  <wingo@pobox.com>

	reword open-file docs
	* doc/ref/api-io.texi (File Ports): Refactor open-file docs.  Thanks to
	  Bake Timmons for the report.

2011-08-17  Andy Wingo  <wingo@pobox.com>

	fix scm_tmpfile leak
	* libguile/posix.c (scm_tmpfile): Fix to actually close the new
	  tmpfile, causing its deletion, while keeping an fd to the file open.
	  Fixes a leak both in memory and disk space on POSIX systems; MINGW
	  systems will leak however.  A FIXME for later.

	fix r6rs `map'
	* module/rnrs/base.scm (map): Define a version of map that is safe for
	  multiple returns, though slower.

	check that srfi-1 procedure arguments are procedures
	* module/srfi/srfi-1.scm (check-arg, wrong-type-arg): Refactor arg type
	  checkers to be macros, and do the minimal amount of work in the
	  functions themselves.  Use these checkers consistently for all
	  procedure arguments in this module.  This catches user errors early;
	  see bug 33628.

	fix recursive define-inlinable expansions
	* module/ice-9/boot-9.scm (define-inlinable): Prevent expansion from
	  diverging by using fluid-let-syntax, as Dybvig suggests.

	srfi-9 record compatibility with boot-9 records
	* module/srfi/srfi-9.scm (define-record-type): Instead of defining the
	  RTD using make-vtable, use make-struct with the record-type-vtable,
	  and record the type name and fields names in the vtable.  This way
	  SRFI-9 records are compatible with boot-9 records.  Also we use a
	  generic printer, instead of generating one anew.

2011-08-16  Andy Wingo  <wingo@pobox.com>

	fix leak in get_current_locale()
	* libguile/i18n.c (get_current_locale): Hold the locale name in a
	  GC-managed string, not a mallocated string.  Thanks to Stefan
	  Israelsson Tampe for the report.

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

	fix take-right and drop-right for improper lists
	* libguile/srfi-1.h:
	* libguile/srfi-1.c (scm_srfi1_drop_right, scm_srfi1_take_right): Remove
	  these internal functions, replacing with Scheme implementations.

	* module/srfi/srfi-1.scm (take-right, drop-right): Add these impls from
	  the reference code.  They do the right thing for improper lists,
	  according to the spec, but they diverge for circular lists.  Oh well.

	* test-suite/tests/srfi-1.test ("drop-right", "take-right"): Add more
	  tests.

2011-08-04  Andy Wingo  <wingo@pobox.com>

	fix tree-il->scheme test
	* module/language/tree-il.scm (tree-il->scheme): Fix incorporation of
	  `lambda' in a `case-lambda'.

	* test-suite/tests/tree-il.test ("tree-il->scheme"): Add a test.

2011-08-04  Andy Wingo  <wingo@pobox.com>

	(web http): locale-independent parsing and serialization of dates
	* module/web/http.scm (parse-month, parse-rfc-822-date):
	  (parse-rfc-850-date, parse-asctime-date, parse-date):
	  (write-date): Parse and write dates without regard to the current
	  locale, using a custom parser.  Also permits parsing of the deprecated
	  RFC 850 and asctime() date formats.

2011-08-04  Andy Wingo  <wingo@pobox.com>

	srfi-19 refactor
	* module/srfi/srfi-19.scm (priv:locale-number-separator, priv:locale-am)
	  (priv:locale-am): Inline definitions.

	  Strip priv: prefix from module vars, as it's unnecessary, except for
	  in a couple cases.

2011-08-03  Andy Wingo  <wingo@pobox.com>

	avoid duplicate stats when searching for files in a path
	* libguile/load.c (search_path): Extract from scm_search_path, to
	  give the caller the stat buffer of the found path.
	  (scm_search_path, scm_sys_search_load_path): Adapt accordingly.
	  (compiled_is_fresh): Take the stat buffers directly.
	  (scm_primitive_load_path, scm_init_eval_in_scheme): Adapt to
	  search_path / compiled_is_fresh changes to avoid duplicate states in
	  search-path.

	fix unnecessary call to canonicalize_path in load-path fast case
	* libguile/load.c (scm_primitive_load_path): Don't canonicalize the
	  filename unless we need to look in the fallback path.  Fixes a stat
	  explosion; see http://savannah.gnu.org/bugs/?33815.

2011-07-29  Andy Wingo  <wingo@pobox.com>

	simplify narrow_stack.
	* libguile/stacks.c (narrow_stack): Simplify outer narrowing by a number
	  of frames.  Thanks to
	  http://article.gmane.org/gmane.lisp.guile.devel/12685.

	style fix in read.c
	* libguile/read.c (scm_read_sexp): No need to assign to tmp here.

	minor style fix in bytevectors.c
	* libguile/bytevectors.c (SCM_BYTEVECTOR_HEADER_BYTES): Use sizeof
	  scm_t_bits, not sizeof SCM.  It's the same, but it seems like the
	  right thing.

	fix a leak on startup from script.c
	* libguile/script.c (scm_get_meta_args): Free nargv.  Thanks to
	  http://article.gmane.org/gmane.lisp.guile.devel/12685.  We leak narg
	  though.

2011-07-28  Andy Wingo  <wingo@pobox.com>

	fix read beyond end of hashtable size array in hashtab.c
	* libguile/hashtab.c (make_hash_table): Fix read beyond end of
	  hashtable_size array.  Thanks to
	  http://article.gmane.org/gmane.lisp.guile.devel/12685.

	fix write beyond array end in arrays.c
	* libguile/arrays.c (scm_i_read_array): Fix write past end of array
	  while reading array type tag.  Fix non-ascii type tag elements.
	  Thanks to http://article.gmane.org/gmane.lisp.guile.devel/12685.

	fix list validation bug in @abort
	* libguile/control.c (scm_at_abort): Fix to ensure that we store the
	  return of scm_ilength in a signed integer, even if later we copy it to
	  an unsigned.  See
	  http://article.gmane.org/gmane.lisp.guile.devel/12685.

	remove dead code in scm_ceiling_quotient
	* libguile/numbers.c (scm_ceiling_quotient): Remove dead code.  See
	  http://article.gmane.org/gmane.lisp.guile.devel/12685.

	fix scm_i_tag_name
	* libguile/gc.c (scm_i_tag_name): Fix to work as intended, though it was
	  not called.  See http://article.gmane.org/gmane.lisp.guile.devel/12685.

2011-07-26  Andy Wingo  <wingo@pobox.com>

	export <macro> from goops, to appease texinfo reflection
	* module/oop/goops.scm (<macro>): Actually define this class.  Also,
	  group the export with the other SMOB types.

2011-07-25  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		GUILE-VERSION
		test-suite/tests/srfi-4.test

	fix GC_get_suspend_signal on Mac OS
	* libguile/scmsigs.c (GC_get_suspend_signal): Fix the back-compatibility
	  shim for this function to work on some other cases; I hadn't realized
	  that gcconfig.h could set SIG_SUSPEND.  Thanks to Aleix Conchillo
	  Flaqué for the report.

2011-07-23  Ludovic Courtès  <ludo@gnu.org>

	guild: Close over `$bindir/guile'.
	* configure.ac: Substitute `guile_program_name'.

	* meta/guild.in: Use `@bindir@/@guile_program_name@' by default.

	* meta/uninstalled-env.in: Define $GUILE.

2011-07-23  Ludovic Courtès  <ludo@gnu.org>

	Change `guild --help' and `--version' output to be more GNUish.
	* meta/guild.in (display-version): Display the version, not the
	  effective version.

	* module/scripts/help.scm (list-commands)[help]: Add proper footer, as
	  per the GCS.

2011-07-23  Ludovic Courtès  <ludo@gnu.org>

	doc: Remove redundant footnote about the former name of `guild'.
	* doc/ref/scheme-using.texi (Using Guile Tools): Remove redundant
	  footnote introduced in e108c961fed2ffdedddcd10bad9c6aae44491b1e.
	  Mention the version where the new name was introduced.

	Export `main' from (scripts help).
	* module/scripts/help.scm: Export `main'.

2011-07-23  Andy Wingo  <wingo@pobox.com>

	add support for guild help FOO
	* module/scripts/help.scm (main): Add support for guild help FOO.

2011-07-23  Andy Wingo  <wingo@pobox.com>

	add (scripts help)
	* meta/guild.in (display-version): Use (ice-9 command-line)'s
	  version-etc.
	  (main): Dispatch --help to guild help.

	* module/scripts/help.scm: New file, a copy of list.scm, but with a
	  better name.

	* module/Makefile.am: Add help.scm to the list.

	* module/scripts/list.scm: Change to be an alias to "help".
	  (list-scripts): Restore this API.

2011-07-23  Andy Wingo  <wingo@pobox.com>

	more work on "guild list"
	* module/scripts/: Add %summary entries, and in many cases,
	  %include-in-guild-list entries to inhibit a script from appearing in
	  "guild list".  Update list.scm to respect this new variable.

2011-07-23  Andy Wingo  <wingo@pobox.com>

	remove scripts PROGRAM
	* module/scripts/PROGRAM.scm: Remove this useless template, which was
	  cluttering `guild list'.  We'll perhaps cull the list a bit more in
	  2.2.

	* module/Makefile.am: Adapt.

2011-07-23  Andy Wingo  <wingo@pobox.com>

	a prettier `guild list'
	* module/scripts/list.scm (strip-extensions): Don't list programs
	  without extensions.
	  (main): Be prettier.  Parse out a %summary from modules, for a brief
	  synopsis.

2011-07-21  Andy Wingo  <wingo@pobox.com>

	add a site dir to %load-compiled-path
	* libguile/Makefile.am (libpath.h): Define SCM_SITE_CCACHE_DIR.  Defined
	  as site-ccache/ instead of site/ccache/ to indicate that we don't expect
	  further subdirectories, and also to avoid confusion about whether
	  extensions/ is a site-specific or not.

	* libguile/load.c (scm_init_load_path): Add SCM_SITE_CCACHE_DIR to the
	  default load-compiled path.

2011-07-21  Andy Wingo  <wingo@pobox.com>

	open-socket-for-url returns port in latin1 encoding
	* module/web/client.scm (open-socket-for-uri): Set port encoding to
	  latin1, to see if this fixes Nalin Garut's problems.

2011-07-18  Andy Wingo  <wingo@pobox.com>

	fix web-request.test
	* test-suite/tests/web-request.test ("example-1"): Fix expected format
	  of `host' header.

2011-07-15  Andy Wingo  <wingo@pobox.com>

	ensure presence of Host header in HTTP/1.1 requests
	* module/web/request.scm (build-request): Make sure that HTTP/1.1
	  requests have the Host header set, per RFC 2616 section 9.

	* test-suite/tests/web-request.test ("example-1"): Add test.

2011-07-15  Andy Wingo  <wingo@pobox.com>

	add (web client)
	* module/web/client.scm: New module, a simple synchronous web client.

	* module/Makefile.am (WEB_SOURCES): Add to the build.

2011-07-13  Ludovic Courtès  <ludo@gnu.org>

	Fix `open' mode bits on GNU/Hurd.
	* libguile/filesys.c (scm_open): Fix check for read-write flags for
	  systems such as GNU/Hurd, where O_RDWR == (O_WRONLY | O_RDONLY)
	  and O_RDONLY != 0.

	Define `O_NOTRANS' on GNU/Hurd.
	* libguile/filesys.c (scm_init_filesys): Define `O_NOTRANS' when
	  available.

	Disable TLS on NetBSD up to 5.x included.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Disable TLS on
	  `x86_64-unknown-netbsd5.1' too.

	Add document describing the release process.
	* doc/release.org: New file.

2011-07-07  Andy Wingo  <wingo@pobox.com>

	fix CPL of <extended-generic-with-setter> and <extended-accessor>
	* libguile/goops.c (fix_cpl): Fix bug in placement of debug assertion.
	  (create_standard_classes): Put <extended-generic> before
	  <generic-with-setter> in <extended-generic-with-setter>'s direct
	  supers, so that the slot allocation is a superset of
	  <generic-with-setter>, which results in the `setter' being allocated
	  in the same place.

	  Likewise fix <extended-accessor> to place <extended-generic> before
	  <generic-with-setter>, not just <generic>.

2011-07-07  Andy Wingo  <wingo@pobox.com>

	fix invocation of duplicate handlers for merge-generics
	* libguile/modules.c (resolve_duplicate_binding): Fix unbound -> #f
	  conversion for the imported bindings.  Pass the existing entry in the
	  import obarray as the resolved var (7th arg), and properly pass #f as
	  the value (8th arg) if there is no such binding.  Fixes
	  merge-generics; before, the <boolean> type test (indicating no
	  previous value) was not being triggered.  This bug has been present
	  since 2007 at least, though it was not in 1.8.

	* test-suite/tests/modules.test ("duplicate bindings"): Add a test that
	  the var and val are both #f.  These types are used by GOOPS.

2011-07-07  Andy Wingo  <wingo@pobox.com>

	goops.scm cleanups
	* module/oop/goops.scm (make-generic, make-extended-generic):
	  (ensure-generic, make-accessor, ensure-accessor): Use optional
	  arguments for #:name.  `make-extended-generic' also accepts empty
	  extension lists.

	more precision for ,time
	* module/system/repl/command.scm (time): Use the high-precision timers
	  instead of stime(2).  Changes the output format of `,time' too;
	  perhaps there is a better way.

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

	Fix typo in (language tree-il spec).
	* module/language/tree-il/spec.scm (join): Use EXPS in the error case.

	Export `<macro>' from (oop goops).
	* module/oop/goops.scm: Export `<macro>'.

2011-07-06  Ludovic Courtès  <ludo@gnu.org>

	doc: Fix `merge-generics' example.
	* doc/ref/goops.texi (Merging Generics): Change (my-module) example to
	  use (oop goops) and use the right syntax for #:duplicates.  Reported
	  by David Pirotte <david@altosw.be>.

	configure: Build a `tar.xz' in addition to `tar.gz'.
	* configure.ac: Explicitly require Automake 1.11.  Add Automake option
	  `dist-xz'.

2011-07-06  Ludovic Courtès  <ludo@gnu.org>

	VM: Keep jump table address in a register.
	* libguile/vm-engine.c (VM_NAME)[HAVE_LABELS_AS_VALUES]: Rename
	  `jump_table' to `jump_table_pointer'.  Add `jump_table' as a local
	  variable, initialize it.

	* libguile/vm-engine.h (JT_REG): New macro.

2011-07-01  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 2.0.2.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	  (LIBGUILE_INTERFACE_CURRENT): Increment to account for new C function
	  `scm_peek_byte_or_eof'.
	  (LIBGUILE_INTERFACE_AGE): Increment.

	Update `NEWS'.

	Revert "Fix lock ordering in `fat_mutex_lock' to match that of `do_thread_exit'."
	This reverts commit ccb80964cd7cd112e300c34d32f67125a6d6da9a, which
	introduced a race condition, with a small window during which a mutex
	could be held by a thread without being part of its `mutexes' list,
	thereby violating the invariant tested at line 667.

	Update Gnulib to v0.0-5874-g7170ee0.

	Type-check the OWNER argument of `lock-mutex'.
	* libguile/threads.c (scm_lock_mutex_timed): Type-check OWNER.

2011-07-01  Ludovic Courtès  <ludo@gnu.org>

	Add type and range checks to the complex generalized vector accessors.
	* libguile/bytevectors.c (COMPLEX_ACCESSOR_PROLOGUE, COMPLEX_NATIVE_REF,
	  COMPLEX_NATIVE_SET): New macros.
	  (bytevector_ref_c32, bytevector_ref_c64): Defined in terms of
	  `COMPLEX_NATIVE_REF'.
	  (bytevector_set_c32, bytevector_set_c64): Defined in terms of
	  `COMPLEX_NATIVE_SET'.
	  (bytevector_ref_fns): Make `static'.

	* test-suite/tests/srfi-4.test ("c32 vectors")["generalized-vector-ref",
	  "generalized-vector-set!", "generalized-vector-ref, out-of-range",
	  "generalized-vector-set!, out-of-range"]: New tests.
	  ("c64 vectors")["generalized-vector-ref", "generalized-vector-set!",
	  "generalized-vector-ref, out-of-range",
	  "generalized-vector-set!, out-of-range"]: New tests.

2011-07-01  Ludovic Courtès  <ludo@gnu.org>

	Fix unaligned accesses for bytevectors of complex numbers.
	* libguile/bytevectors.c (bytevector_ref_c32, bytevector_ref_c64,
	  bytevector_set_c32, bytevector_set_c64): Use `memcpy' to avoid
	  unaligned accesses.  This fixes SIGBUS on SPARC and possibly other
	  alignment-sensitive platforms.

	i18n: Don't use `!=' to compare SCMs.
	* libguile/i18n.c (install_locale)[!USE_GNU_LOCALE_API]: Use
	  `SCM_UNBNDP' instead of `!='.

2011-07-01  Andy Wingo  <wingo@pobox.com>

	fix '(a #{.} b)
	* libguile/read.c (scm_read_sexp): Don't confuse `#{.}#' with `.' for
	  the purpose of reading dotted pairs.  Thanks to CRLF0710 for the
	  report.

	* test-suite/tests/reader.test ("#{}#"): Add test.

2011-07-01  Andy Wingo  <wingo@pobox.com>

	fix r6rs-records-syntactic.test to not shadow a literal
	* test-suite/tests/r6rs-records-syntactic.test (*parent-rtd): Fix test
	  to not shadow a literal.

2011-07-01  Andy Wingo  <wingo@pobox.com>

	defining a smob or port type no longer mucks exports of (oop goops)
	* libguile/goops.c (DEFVAR): Remove this helper macro, replacing its
	  uses with scm_module_define, but without scm_module_export.
	  (create_basic_classes, scm_init_goops_builtins): Update callers.
	  (make_class_from_template, make_class_from_symbol): Change to not
	  define variables for classes.  This affects ports, struct classes, and
	  smob classes.

	* module/oop/goops.scm: Explicitly list our exports, so there is no more
	  trickery happening in C.
	  (find-subclass): Private helper to grub the class hierarchy, so we can
	  define bindings for smobs, ports, etc.  Use to define the classes that
	  goops.c used to define -- probably a subset, but it's better to have
	  them listed.

2011-06-30  Ludovic Courtès  <ludo@gnu.org>

	Fix `on_thread_exit' for canceled threads.
	* libguile/threads.c (on_thread_exit): Clear `t->guile_mode' upon
	  entry.  This fixes a bug whereby `t->base' would be incorrect for
	  canceled threads, leading to a misdiagnosed VM stack overflow.
	  See <http://lists.gnu.org/archive/html/bug-guile/2011-06/msg00068.html>
	  for details.
	  (scm_leave_guile_cleanup): Remove because it's unused.

	Add `guile-invoke.texi' to the distribution.
	* doc/ref/Makefile.am (guile_TEXINFOS): Add `guile-invoke.texi'.

2011-06-30  Andy Wingo  <wingo@pobox.com>

	fix generation of auto-compiled file names on mingw systems
	* libguile/load.c (canonical_to_suffix, scm_primitive_load_path):
	* module/ice-9/boot-9.scm (load-in-vicinity):
	* module/system/base/compile.scm (compiled-file-name): If the canonical
	  path of a file is a DOS-style path with a drive letter, turn it into a
	  path suffix it by removing the colon and prefixing a "/".

	Inspired by a patch from Jan Nieuwenhuizen.

2011-06-30  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/lexical-literals'
	Conflicts:
		module/ice-9/psyntax-pp.scm

	Merge remote-tracking branch 'local-2.0/stable-2.0'
	Conflicts:
		libguile/deprecated.c
		module/ice-9/psyntax-pp.scm

2011-06-30  Mark Harig  <idirectscm@aim.com>

	better invocation documentation
	* doc/ref/guile.texi (Programming in Scheme):
	* doc/ref/scheme-scripts.texi (Guile Scripting): Moved "Invoking Guile"
	  to its own file.

	* doc/ref/guile-invoke.texi (Invoking Guile): Initial revision. This
	  file contains the former section "Invoking Guile" that was included in
	  the chapter "Programming in Scheme" as a subsection named
	  "Command-line Options." It also includes a new subsection "Environment
	  Variables," which describes those variables that can be set in the
	  operating system before Guile is started and which affect Guile's
	  run-time behavior.

2011-06-30  Andy Wingo  <wingo@pobox.com>

	%load-hook not just for primitive-load
	* libguile/load.c (scm_primitive_load_path):
	* module/ice-9/boot-9.scm (load-in-vicinity): Call %load-hook as needed.

2011-06-30  Andy Wingo  <wingo@pobox.com>

	fix --disable-modules build
	* configure.ac (HAVE_MODULES): Define HAVE_MODULES iff
	  --enable-modules.

	* libguile/deprecated.c (scm_dynamic_args_call)
	* libguile/extensions.c (load_extension):
	* libguile/init.c (scm_i_init_guile): Use HAVE_MODULES in a few places.

2011-06-30  Andy Wingo  <wingo@pobox.com>

	HAVE_POSIX warning fix
	* libguile/filesys.c (scm_dir_free, scm_dir_print): Don't compile when
	  not HAVE_POSIX.

2011-06-28  Ludovic Courtès  <ludo@gnu.org>

	Fix lock ordering in `fat_mutex_lock' to match that of `do_thread_exit'.
	Original Helgrind report:

	==14160== Thread #57: lock order "0x47F6B90 before 0x7C25A28" violated
	==14160==    at 0x4C27730: pthread_mutex_lock (in /.../valgrind-3.6.0/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
	==14160==    by 0x4EFF87E: do_thread_exit (threads.c:664)
	==14160==    by 0x4E87B89: c_body (continuations.c:512)
	==14160==    by 0x4F16C21: vm_regular_engine (vm-i-system.c:960)
	==14160==    by 0x4E90F92: scm_call_4 (eval.c:506)
	==14160==    by 0x4E88372: scm_i_with_continuation_barrier (continuations.c:450)
	==14160==    by 0x4E88424: scm_c_with_continuation_barrier (continuations.c:546)
	==14160==    by 0x51CA3AF: GC_call_with_gc_active (pthread_support.c:1128)
	==14160==    by 0x4EFF2E0: with_guile_and_parent (threads.c:206)
	==14160==    by 0x51C46B4: GC_call_with_stack_base (misc.c:1505)
	==14160==    by 0x4EFF447: scm_with_guile (threads.c:917)
	==14160==    by 0x51C46B4: GC_call_with_stack_base (misc.c:1505)
	==14160==   Required order was established by acquisition of lock at 0x47F6B90
	==14160==    at 0x4C27730: pthread_mutex_lock (in /.../valgrind-3.6.0/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
	==14160==    by 0x4F00262: fat_mutex_lock (threads.c:1362)
	==14160==    by 0x4F004DA: scm_lock_mutex_timed (threads.c:1462)
	==14160==    by 0x4F16C09: vm_regular_engine (vm-i-system.c:898)
	==14160==    by 0x4E90F4D: scm_call_3 (eval.c:499)
	==14160==    by 0x4EFFA4C: really_launch (threads.c:975)
	==14160==    by 0x4E87B89: c_body (continuations.c:512)
	==14160==    by 0x4F16C21: vm_regular_engine (vm-i-system.c:960)
	==14160==    by 0x4E90F92: scm_call_4 (eval.c:506)
	==14160==    by 0x4E88372: scm_i_with_continuation_barrier (continuations.c:450)
	==14160==    by 0x4E88424: scm_c_with_continuation_barrier (continuations.c:546)
	==14160==    by 0x4EFF289: with_guile_and_parent (threads.c:874)
	==14160==   followed by a later acquisition of lock at 0x7C25A28
	==14160==    at 0x4C27730: pthread_mutex_lock (in /.../valgrind-3.6.0/lib/valgrind/vgpreload_helgrind-amd64-linux.so)
	==14160==    by 0x4F00352: fat_mutex_lock (threads.c:1374)
	==14160==    by 0x4F004DA: scm_lock_mutex_timed (threads.c:1462)
	==14160==    by 0x4F16C09: vm_regular_engine (vm-i-system.c:898)
	==14160==    by 0x4E90F4D: scm_call_3 (eval.c:499)
	==14160==    by 0x4EFFA4C: really_launch (threads.c:975)
	==14160==    by 0x4E87B89: c_body (continuations.c:512)
	==14160==    by 0x4F16C21: vm_regular_engine (vm-i-system.c:960)
	==14160==    by 0x4E90F92: scm_call_4 (eval.c:506)
	==14160==    by 0x4E88372: scm_i_with_continuation_barrier (continuations.c:450)
	==14160==    by 0x4E88424: scm_c_with_continuation_barrier (continuations.c:546)
	==14160==    by 0x4EFF289: with_guile_and_parent (threads.c:874)

	* libguile/threads.c (fat_mutex_lock): In the `m->level == 0' case,
	  release M's lock before taking T's `admin_mutex'.

2011-06-23  Andy Wingo  <wingo@pobox.com>

	don't spawn the signal delivery thread in a thread-exit handler
	* libguile/threads.c (do_thread_exit): Remove needless spawn of the
	  signal delivery thread.

	allow gc <= 7.1 to stop the signal delivery thread
	* configure.ac: Add a check for GC_get_suspend_signal().
	* libguile/scmsigs.c (GC_get_suspend_signal): Define a fallback
	  implementation if one isn't available.
	  (signal_delivery_thread): Unmask the suspend signal so that GC can
	  stop the world.  Fixes test-pthread-create on libgc 7.1 and earlier.
	  Thanks to Frank Terbeck <ft@bewatermyfriend.org> for the report.

2011-06-21  Stefan Israelsson Tampe  <stefan.itampe@gmail.com>

	psyntax: enable dotted tail patterns
	* module/ice-9/psyntax.scm (syntax-case): enabled the use of a
	  general last cdr instead of just '() in matching with both
	  a ellipsis (p ...) and a last rest pattern (. q)

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

2011-06-20  Andy Wingo  <wingo@pobox.com>

	update stack growth direction check
	* configure.ac: Pull stack growth direction check from upstream
	  autoconf.  See
	  http://lists.gnu.org/archive/html/bug-autoconf/2011-06/msg00035.html
	  for a discussion.

2011-06-20  Ludovic Courtès  <ludo@gnu.org>

	Placate GCC in `test-ffi-lib.c'.
	This fixes warnings saying "this decimal constant is unsigned only in
	ISO C90".

	* test-suite/standalone/test-ffi-lib.c (test_ffi_u32_, test_ffi_u32_u8,
	  test_ffi_u32_s64, test_ffi_s64_s64, test_ffi_u64_u8,
	  test_ffi_u64_s64): Mark constants as unsigned.

2011-06-19  Ian Price  <ianprice90@googlemail.com>

	Fix hygiene issues with `define-record-type'
	* module/rnrs/records/syntactic.scm (define-record-type0, process-fields):
	  Preserve hygiene of record clauses.

	* test-suite/tests/r6rs-records-syntactic.test ("record hygiene"):
	  Add tests.

2011-06-19  Ludovic Courtès  <ludo@gnu.org>

	Comment on the Gnulib `clock-gettime' workaround.
	* acinclude.m4: Remove `clock_time.m4' serial.

	* configure.ac: Add URL of the discussion about `clock-gettime'.

2011-06-19  Ludovic Courtès  <ludo@gnu.org>

	configure: Factorize code checking for `iconveh_' constants; use the cache.
	* configure.ac: Remove code that determines the values of the `iconveh_'
	  constants.  Use `GUILE_UNISTRING_ICONVEH_VALUES'. instead.

	* acinclude.m4 (GUILE_UNISTRING_CONSTANT,
	  GUILE_UNISTRING_ICONVEH_VALUES): New macros.

2011-06-18  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'local-2.0/stable-2.0'
	Conflicts:
		module/ice-9/psyntax-pp.scm
		module/language/tree-il/compile-glil.scm

2011-06-18  Andy Wingo  <wingo@pobox.com>

	fix tree-il->scheme bug for seq
	* module/language/tree-il.scm (tree-il->scheme): Fix bug for `seq'.

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

2011-06-17  Andy Wingo  <wingo@pobox.com>

	current-language really defaults to Scheme.
	* module/system/base/language.scm (current-language): Default to 'scheme
	  here, rather than relying on *current-language* always being bound.

	Thanks to 亚光唐 <texnician@gmail.com> for the report.

2011-06-17  Andy Wingo  <wingo@pobox.com>

	fix invalid transformation of (values x) -> x, (+ x) -> x, etc
	* module/language/tree-il/primitives.scm (+, *, cons*): In the case of
	  just one argument (the identity case), expand to (values x) instead of
	  just x.  Fixes values truncation in that case.
	  (values): Likewise remove (values x) -> x translation, as the compiler
	  will do it for us, and this fixes (values (values 1 2)).

	* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Handle
	  `values' in a push context here.

	* test-suite/tests/tree-il.test ("values"): Add some tests.

2011-06-17  Andy Wingo  <wingo@pobox.com>

	add -Wformat to %auto-compilation-options
	* module/ice-9/boot-9.scm (%auto-compilation-options): Add -Wformat to
	  the default warning set.

	better messages on failed autocompilation
	* libguile/load.c (auto_compile_catch_handler):
	* module/ice-9/boot-9.scm (load-in-vicinity): Nicer messages when
	  autocompilation fails.

2011-06-17  Andy Wingo  <wingo@pobox.com>

	fix self tail recursion to different case-lambda clauses
	http://savannah.gnu.org/bugs/?33362

	* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Rename
	  from flatten, as it really just takes a particular case.  Instead of
	  iteratively compiling lambda cases through `comp', tail-call through
	  flatten-lambda-case.  This allows code to see which case it's being
	  compiled in.  Take advantage of that to limit the self-tail-call
	  optimization to self-calls to the same case -- otherwise we might be
	  jumping to a label without having reserved the right number of
	  locals.
	  (flatten-lambda): Adapt the caller.

	* test-suite/tests/compiler.test ("case-lambda"): Add a test.

2011-06-17  Andy Wingo  <wingo@pobox.com>

	fix AC_LANG_SOURCE warnings
	* configure.ac: Fix annoying AC_LANG_SOURCE warnings.

	check for clock_getcpuclockid in gl_CLOCK_TIME
	* acinclude.m4 (gl_CLOCK_TIME): It could be that clock_gettime is in
	  libc but clock_getcpuclockid is not, so check for that explicitly.

2011-06-17  Andreas Rottmann  <a.rottmann@gmx.at>

	Silence warnings for variables created by `generate-temporaries'
	* module/ice-9/psyntax.scm (generate-temporaries): Give temporaries the
	  current module, so that they may be bound at the top level.

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

2011-06-17  Andy Wingo  <wingo@pobox.com>

	remove win32-dirent.[ch]
	* libguile/win32-dirent.c:
	* libguile/win32-dirent.h: Remove these files.  MinGW has opendir and
	  readdir support, I hear.

	* configure.ac:
	* libguile/filesys.c:
	* libguile/Makefile.am: Adapt.

2011-06-17  Jan Nieuwenhuizen  <janneke@gnu.org>

	mingw: use $APPDATA as a possible root for cachedir.
	* libguile/load.c (scm_init_load_path) [MINGW32]: Fall back to using
	$LOCALAPPDATA or $APPDATA if $XDG_CACHE_HOME and $HOME aren't set.

2011-06-16  Andy Wingo  <wingo@pobox.com>

	add `rename' gnulib module
	This should fix `rename' on mingw32.

2011-06-16  Mark H Weaver  <mhw@netris.org>

	Fix several POSIX functions to use the locale encoding
	* libguile/strings.c (scm_i_allocate_string_pointers): Encode strings
	  using the current locale.  Previously, Latin-1 was used.  Indirectly,
	  this affects the encoding of strings in `system*', `execl', `execlp',
	  `execle', `environ', and `dynamic-args-call'.

	  (scm_makfromstrs): In header comment, clarify that the C strings are
	  interpreted according to the current locale encoding.

	* NEWS: Add NEWS entry.

2011-06-16  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'local-2.0/stable-2.0'

	O_CLOEXEC usage
	* libguile/objcodes.c (scm_load_objcode):
	* libguile/scmsigs.c (start_signal_delivery_thread):
	* libguile/threads.c (guilify_self_1): Use O_CLOEXEC.

2011-06-16  Andy Wingo  <wingo@pobox.com>

	gnulib update
	Added pipe2 and open modules, to get O_CLOEXEC.

	* libguile/Makefile.am (guile_filter_doc_snarfage$(EXEEXT)): Add gnulib
	  here, in the native build case, for rpl_fflush if needed.

	foo

2011-06-16  Andy Wingo  <wingo@pobox.com>

	fix initial values of reallocated fluids
	* libguile/threads.h:
	* libguile/threads.c (scm_i_reset_fluid): New internal function, resets
	  the binding of a fluid for all threads.  Needed for fluid GC.

	* libguile/fluids.c (new_fluid): Call scm_i_reset_fluid here.

2011-06-16  Andy Wingo  <wingo@pobox.com>

	more NEWS
	* NEWS: More updates.

	update NEWS
	* NEWS: Update for 2.0.2.

	add docs for shift and reset
	* doc/ref/api-control.texi (Prompt Primitives): Break call-with-prompt
	  and abort-to-prompt out into a subsubsection.
	  (Shift and Reset): New subsubsection.

	fix hash-set! on weak tables
	* test-suite/tests/weaks.test: Add tests.
	* libguile/hashtab.c (scm_hash_fn_set_x): Fix updates to weak-value hash
	  tables to not deadlock inside the alloc lock.

2011-06-09  Andreas Rottmann  <a.rottmann@gmx.at>

	Fix likely crash in `stable-sort!'
	* libguile/sort.c (scm_stable_sort_x): Properly handle zero-length
	  vectors.
	* test-suite/tests/sort.test ("stable-sort"): Add test for this case.

2011-06-08  Ludovic Courtès  <ludo@gnu.org>

	doc: Mention the former name of `guild'.
	* doc/ref/scheme-using.texi (Using Guile Tools): Add a footnote
	  mentioning that `guild' used to be `guile-tools'.

	* doc/ref/tools.texi (Executable Modules): Nitpicks.

2011-06-02  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'local-2.0/stable-2.0'
	Conflicts:
		meta/Makefile.am

2011-06-02  Andy Wingo  <wingo@pobox.com>

	sequence of expressions -> seq of head and tail
	* libguile/expand.h:
	* module/language/tree-il.scm: Rename "sequence" to "seq", and instead
	  of taking a list of expressions, take a head and a tail.

	* module/language/tree-il/analyze.scm:
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/fix-letrec.scm:
	* module/language/tree-il/spec.scm:
	* module/language/elisp/compile-tree-il.scm:
	* module/ice-9/psyntax.scm:
	* module/ice-9/psyntax-pp.scm:
	* module/ice-9/eval.scm:
	* libguile/memoize.h:
	* libguile/memoize.c:
	* libguile/expand.c:
	* libguile/eval.c: Adapt to the new seq format.

2011-06-02  Andy Wingo  <wingo@pobox.com>

	add <primcall> to tree-il
	* libguile/expand.c:
	* libguile/expand.h (SCM_EXPANDED_PRIMCALL_TYPE_NAME):
	  (SCM_EXPANDED_PRIMCALL_FIELD_NAMES):
	  (SCM_EXPANDED_PRIMCALL_SRC):
	  (SCM_EXPANDED_PRIMCALL_NAME):
	  (SCM_EXPANDED_PRIMCALL_ARGS):
	  (SCM_MAKE_EXPANDED_PRIMCALL): Add "primcall" Tree-IL type.

	* doc/ref/compiler.texi (Tree-IL): Update docs.

	* libguile/memoize.c (memoize): Memoizer for primcalls.

	* module/ice-9/psyntax.scm: Build primcalls, sometimes.  Also change
	  build-primref to just make a primitive-ref.

	* module/language/tree-il.scm: Add primcall to the exports, parsers,
	  serializers, etc.

	* module/language/tree-il/analyze.scm:
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/fix-letrec.scm:
	* module/language/tree-il/inline.scm:
	* module/language/tree-il/primitives.scm:
	* module/language/elisp/compile-tree-il.scm: Add primcall support.

	* test-suite/tests/tree-il.test: Use primcalls sometimes.

2011-06-02  Andy Wingo  <wingo@pobox.com>

	rename <application> to <call>
	* doc/ref/compiler.texi (The Scheme Compiler): Update docs.

	* libguile/expand.h:
	* libguile/expand.c:
	* module/language/tree-il.scm: Rename <application> to <call>.  Change
	  the external representation from (apply proc arg ...) to (call proc
	  arg ...).

	* libguile/memoize.c:
	* module/ice-9/psyntax-pp.scm:
	* module/ice-9/psyntax.scm:
	* module/language/brainfuck/compile-tree-il.scm:
	* module/language/ecmascript/compile-tree-il.scm:
	* module/language/elisp/compile-tree-il.scm:
	* module/language/tree-il/analyze.scm:
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/fix-letrec.scm:
	* module/language/tree-il/inline.scm:
	* module/language/tree-il/primitives.scm:
	* test-suite/tests/tree-il.test: Update all callers.

2011-05-31  Andy Wingo  <wingo@pobox.com>

	add guild docs
	* doc/ref/scheme-using.texi (Using Guile Tools): Add some optimistic
	  guild docs.

2011-05-31  Andy Wingo  <wingo@pobox.com>

	rename `guile-tools' to `guild'
	* configure.ac: Look for ln -s.  Write out `guild' instead of
	  `guile-tools'.

	* meta/Makefile.am (install-data-hook): Link the installed `guild' to
	  the backward-compatible `guile-tools' name.
	  (bin_SCRIPTS, EXTRA_DIST): Fix up for guild change.

	* meta/guild.in: Moved here from `guile-tools.in'.

	* doc/ref/Makefile.am (autoconf-macros.texi):
	* doc/ref/api-evaluation.texi (Compilation):
	* doc/ref/autoconf.texi (Autofrisk, Using Autofrisk):
	* doc/ref/mod-getopt-long.texi (getopt-long Reference):
	* doc/ref/tools.texi (Miscellaneous Tools, Executable Modules): Minimal
	  doc update.

	* .gitignore:
	* am/guilec (.scm.go):
	* libguile/Makefile.am (snarf2checkedtexi):
	* module/Makefile.am (ice-9/psyntax-pp.go): Update makefiles, etc.

	* module/scripts/README:
	* module/scripts/lint.scm:
	* module/scripts/list.scm: Update commentaries.

2011-05-31  Andy Wingo  <wingo@pobox.com>

	write-objcode uses target-endianness, target-word-size
	* libguile/_scm.h (SCM_OBJCODE_ENDIANNESS_OFFSET):
	  (SCM_OBJCODE_WORD_SIZE_OFFSET): New defines.
	* libguile/objcodes.c (scm_write_objcode): Use target-endianness and
	  target-word-size when writing the objcode cookie.

	compile-bytecode uses target-endianness
	* module/language/assembly/compile-bytecode.scm (compile-bytecode):
	  Use target-endianness, from (system base target).

	add (system base target)
	* module/Makefile.am:
	* module/system/base/target.scm: Add a minimal module to parameterize
	  the target system type and inspect properties on it like cpu, vendor,
	  os, endianness, and word size.

2011-05-30  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

2011-05-30  Andy Wingo  <wingo@pobox.com>

	fix subtle and bad scm_internal_hash_fold bug for weak tables
	* libguile/hashtab.c (scm_internal_hash_fold): Don't try to unlink
	  deleted weak pairs.  Our previous code was buggy (`prev' should have
	  only been updated in the case of a successful traversal), but more
	  than that, we're not in the alloc lock.

	  Thanks very much to Michael Wells for the report, and the debugging!

2011-05-27  Andreas Rottmann  <a.rottmann@gmx.at>

	Tweak R6RS transcoded ports flushing
	* libguile/r6rs-ports.c (tp_flush): Only operate on the underlying port
	  when it is open.

2011-05-27  Andreas Rottmann  <a.rottmann@gmx.at>

	rnrs io ports: fix port encoding when opening file ports
	* module/rnrs/io/ports.scm (open-file-input-port)
	  (open-file-output-port): Ensure the resulting ports are binary when no
	  transcoder is specified.

	* test-suite/tests/r6rs-ports.test: Remove superfluous global change of
	  `%default-port-encoding' and accompanying comment.
	  ("7.2.7 Input Ports"): Add test ensuring `open-file-input-port' opens
	  a binary port when no transcoder is specified.
	  ("8.2.10 Output ports"): Strengthen existing `open-file-output-port'
	  binary-ness test by setting `%default-port-encoding' to "UTF-8".

2011-05-27  Andreas Rottmann  <a.rottmann@gmx.at>

	Add some tests for the R6RS I/O libraries
	* test-suite/tests/r6rs-ports.test
	  (call-with-bytevector-output-port/transcoded): New helper procedure.
	  ("8.2.6 Input and output ports"): Use that helper procedure.
	  (encoding-error-predicate): New helper procedure.
	  ("8.2.12 Textual Output"): Add tests for `put-char' and `put-string'
	  exception behavior on encoding errors.

2011-05-26  Neil Jerram  <neil@ossau.uklinux.net>

	Doc for getopt-long's new stop-at-first-non-option option
	* doc/ref/mod-getopt-long.texi (getopt-long): Mention optional keyword
	  parameters.

	  (getopt-long Reference): Document #:stop-at-first-non-option.

2011-05-26  Neil Jerram  <neil@ossau.uklinux.net>

	Remove unused script-getopt.texi
	* doc/ref/Makefile.am (guile_TEXINFOS): Remove script-getopt.texi.

	* doc/ref/script-getopt.texi: Deleted.  This file wasn't included in
	  the manual, and its content is now duplicated identically in
	  scheme-scripts.texi.

2011-05-26  Neil Jerram  <neil@ossau.uklinux.net>

	Emit a 1-based line number in error messages
	* module/ice-9/boot-9.scm (exception-printers): Add 1 to the 0-based
	  line number.

2011-05-26  Neil Jerram  <neil@ossau.uklinux.net>

	Reveal guile-tools's inner simplicity...
	...by not using its own-rolled getopt, and moving the `list' function
	to a separate script

	* meta/guile-tools.in: Use (ice-9 getopt-long).

	  (directory-files, strip-extensions, unique, find-submodules,
	  list-scripts): Deleted (and moved to new `list.scm' file).

	  (getopt): Deleted.

	  (main): Use getopt-long.  Default to calling the `list' script if no
	  script is specified.

	* module/scripts/list.scm: New script.

	* module/Makefile.am (SCRIPTS_SOURCES): Add list.scm.

2011-05-26  Neil Jerram  <neil@ossau.uklinux.net>

	Implement #:stop-at-first-non-option option for getopt-long
	(For use by guile-tools)

	* module/ice-9/getopt-long.scm: Use (ice-9 optargs) so we can use
	  define*.

	  (process-options): Add stop-at-first-non-option parameter.  When
	  this is true, stop processing when we hit a non-option (so long as
	  that non-option isn't something that resulted from the unclumping of
	  a short option group).

	  (getopt-long): Add #:stop-at-first-non-option keyword; pass it on to
	  process-options.

	* test-suite/tests/getopt-long.test ("stop-at-first-non-option"): New
	  test (for the above).

2011-05-26  Neil Jerram  <neil@ossau.uklinux.net>

	Handle short option unclumping progressively, instead of all upfront
	This is needed as a prerequisite for the following change that
	introduces the stop-at-first-non-option option, because when that
	option is used we don't know upfront how far through the command
	line we should proceed with unclumping.

	* module/ice-9/getopt-long.scm (expand-clumped-singles): Delete.

	  (process-options): Add a loop variable to indicate how many elements
	  at the start of `argument-ls' are known not to be clumped.  When we
	  see a short option and this variable is <= 0, perform unclumping
	  (using code that used to be in expand-clumped-singles) and loop with
	  the variable > 0.

	  (getopt-long): Don't call expand-clumped-singles upfront here.

2011-05-26  Neil Jerram  <neil@ossau.uklinux.net>

	Simplify getopt-long handling of option values, esp with multiple occurrences
	Basically, accumulate values in the `process-options' loop variables,
	instead of using set-option-spec-value!

	* module/ice-9/getopt-long.scm (option-spec): Delete the `value' slot.

	  (process-options): Delete `val!loop' and just use `loop' everywhere
	  instead.  When adding an option spec to `found', add the
	  corresponding value too; hence `found' becomes an alist, where it
	  was previously a list of specs.

	  (getopt-long): Use assq-ref to get values out of `found'.  Remove
	  unhittable error condition for detecting an option that requires an
	  explicit value, where a value wasn't supplied.  This condition is
	  actually caught and handled in `process-options'.  Rewrite the end
	  of the procedure much more simply.

2011-05-26  Neil Jerram  <neil@ossau.uklinux.net>

	Fix "occurrances" typos in getopt-long code and test
	* module/ice-9/getopt-long.scm (process-options, getopt-long): Change
	  to "occurrences".

	* test-suite/tests/getopt-long.test ("multiple occurrences"): Same
	  again.

2011-05-26  Andy Wingo  <wingo@pobox.com>

	remove gc pthread redirects entirely
	* libguile/pthread-threads.h: As an experiment, just define
	  scm_i_pthread_create et al to their pthread_* functions, instead of
	  the GC_ ones.  It seems sufficient, given that all uses of Guile have
	  to go through scm_with_guile anyway...  Passes tests on my machine.
	  Committing to give buildbots a go at it.

	Merge remote-tracking branch 'origin/stable-2.0'

	leave guile when reading signal pipe
	* libguile/scmsigs.c (read_signal_pipe_data, signal_delivery_thread):
	  Leave guile when reading from the signal pipe.  Hopefully that lets GC
	  know not to wake up this thread.

	lazily init futures worker pool
	* module/ice-9/futures.scm (%workers, %create-workers!)
	  (create-workers!): Define a mechanism to spawn off the future threads
	  only when the first future is created.
	  (make-future): Call create-workers! here.

2011-05-26  Andy Wingo  <wingo@pobox.com>

	scm_new_smob, scm_new_double_smob inline functions
	* libguile/smob.h (scm_new_smob, scm_new_double_smob): New constructors,
	  which do what SCM_NEWSMOB / SCM_NEWSMOB3 had done, but with inline
	  functions instead of macros.  They also bail to scm_i_new_smob /
	  scm_i_new_double_smob in either the mark or the free case, so that the
	  inline definition doesn't reference other internal details like libgc
	  stuff.
	  (SCM_SMOB_TYPE_MASK et al): Move definitions up so the new_smob see
	  them as already being declared.
	  (SCM_NEWSMOB, SCM_RETURN_NEWSMOB, SCM_NEWSMOB2, SCM_RETURN_NEWSMOB2):
	  (SCM_NEWSMOB3, SCM_RETURN_NEWSMOB3): Reimplement in terms of the new
	  inline functions.
	  (scm_i_finalize_smob): Remove declaration, as it's no longer needed or
	  used.
	  Remove now-unneeded bdw-gc include.

	* libguile/smob.c (finalize_smob): Rename from scm_i_finalize_smob, and
	  make static.
	  (scm_i_new_smob, scm_i_new_double_smob): Slow-path allocators.

	* libguile/inline.c: Include smob.h, so as to reify scm_new_smob and
	  scm_new_double_smob.

2011-05-26  Andy Wingo  <wingo@pobox.com>

	scm_cell, scm_double_cell, scm_words back to gc.h
	* libguile/inline.h:
	* libguile/gc.h (scm_cell, scm_double_cell, scm_words): Move
	  declarations and definitions back here, from inline.h.  It's more
	  natural.

	* libguile/inline.c: Include gc.h as well.

2011-05-26  Andy Wingo  <wingo@pobox.com>

	simplify inline function infrastructure
	* libguile/__scm.h (SCM_C_EXTERN_INLINE): Move this definition here,
	  from inline.h.  We'd like to support inline function definitions in
	  more header files: not just inline.h.
	  (SCM_CAN_INLINE, SCM_INLINE, SCM_INLINE_IMPLEMENTATION): New
	  definitions.

	* libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Define these
	  wrappers, which redirect to the GC_MALLOC macros when building Guile,
	  and the scm_gc_malloc functions otherwise.  A step towards getting
	  BDW-GC out of Guile's API.

	* libguile/inline.h: Simplify, using SCM_INLINE,
	  SCM_INLINE_IMPLEMENTATION, and SCM_IMPLEMENT_INLINES.  Also use the
	  new SCM_GC_MALLOC macros.

2011-05-26  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'local-2.0/stable-2.0'

	remove scm_newcell_count, scm_newcell2_count
	* libguile/inline.h:
	* libguile/gc.c: Remove declaration and definition of unused
	  "scm_newcell_count" and "scm_newcell2_count".  Since SCM_INTERNAL is
	  "extern", these symbols were not externally visible anyway, at least
	  under Linux or Windows.

2011-05-26  Andy Wingo  <wingo@pobox.com>

	deprecate scm_immutable_{double_,}cell
	* libguile/inline.h:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_immutable_cell, scm_immutable_double_cell):
	  Deprecate these, as the GC_STUBBORN API doesn't do anything any more.

	* libguile/strings.c (scm_i_c_make_symbol): Change the one use of
	  scm_immutable_double_cell to scm_double_cell.

2011-05-25  Mark H Weaver  <mhw@netris.org>

	Clarify docs for SCM_UNSPECIFIED: used sometimes but not always
	* doc/ref/data-rep.texi (Immediate objects): Clarify the description
	  of SCM_UNSPECIFIED.  It is returned by some (but not all) expressions
	  whose value is unspecified by the Scheme standard.

2011-05-25  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		libguile/procprop.c

	out-of-tree build fix
	* test-suite/standalone/Makefile.am (GUILE_AUTO_COMPILE): Add srcdir to
	  the environment.
	* test-suite/standalone/test-import-order: Look for the modules in the
	  srcdir.  Fixes out-of-tree builds.

2011-05-24  Andy Wingo  <wingo@pobox.com>

	threadsafe addition to the goops vtable_class_map
	* libguile/goops.c (scm_i_define_class_for_vtable): Lock around
	  additions to the vtable_class_map.  Use is unlocked though; solving
	  GOOPS parallel-initialization would be a good thing.

	threadsafe access to source properties weak hash table
	* libguile/srcprop.c: Add a lock around scm_source_whash, and use it.

2011-05-24  Andy Wingo  <wingo@pobox.com>

	read + source properties simplification
	* libguile/srcprop.h: Remove internal scm_source_whash declaration.
	* libguile/srcprop.c (scm_i_set_source_properties_x)
	  (scm_i_has_source_properties): New helpers.
	  (scm_source_whash): Make static.

	* libguile/read.c (scm_read_sexp): Remove register declarations here;
	  let's trust the compiler.  Remove code to incrementally build up a
	  copy; instead let's let scm_i_set_source_properties_x handle copying
	  the expression if needed.
	  (scm_read_quote, scm_read_syntax): Use scm_i_set_source_properties_x.
	  (recsexpr): Remove this helper from 1996.
	  (scm_read_sharp_extension): Instead of trying to recursively label
	  sharp-read subforms with source properties, just label the outside
	  form and rely on the macro-expander to propagate it down.

2011-05-24  Andy Wingo  <wingo@pobox.com>

	safely access the trampoline weak map
	* libguile/smob.c (scm_i_smob_apply_trampoline): Protect the trampoline
	  weak map with a mutex.

2011-05-23  Andy Wingo  <wingo@pobox.com>

	set-procedure-property! threadsafety issue
	* libguile/procprop.c (scm_set_procedure_property_x): Fix a threadsafety
	  bug pointed out by Ken Raeburn.

	really threadsafe access to symbol table
	* libguile/symbols.c (symbols_lock): Rename from intern_lock.
	  (lookup_interned_symbol, lookup_interned_latin1_symbol): Instead of
	  faith-based programming, just use the mutex.  Though I haven't seen
	  this break, Ken is right!

2011-05-22  Mark H Weaver  <mhw@netris.org>

	Don't call scm_lock_mutex and scm_unlock_mutex via pointer of wrong type
	* libguile/threads.c (lock_mutex_return_void, unlock_mutex_return_void):
	  New static functions that simply call scm_lock_mutex and
	  scm_unlock_mutex, respectively, but return void instead of SCM.

	  (scm_dynwind_lock_mutex): Pass unlock_mutex_return_void to
	  scm_dynwind_unwind_handler_with_scm, and lock_mutex_return_void to
	  scm_dynwind_rewind_handler_with_scm.  Previously, we passed
	  scm_unlock_mutex and scm_lock_mutex (which return SCM), but the
	  scm_dynwind_* functions expect pointers to functions which return
	  void.  When SCM is of type union, this changes the calling conventions
	  of the functions on some platforms (e.g. GCC 4.5.2 and 4.5.3 on x86).

2011-05-22  Mark H Weaver  <mhw@netris.org>

	Don't call scm_lock_mutex and scm_unlock_mutex via pointer of wrong type
	* libguile/threads.c (lock_mutex_return_void, unlock_mutex_return_void):
	  New static functions that simply call scm_lock_mutex and
	  scm_unlock_mutex, respectively, but return void instead of SCM.

	  (scm_dynwind_lock_mutex): Pass unlock_mutex_return_void to
	  scm_dynwind_unwind_handler_with_scm, and lock_mutex_return_void to
	  scm_dynwind_rewind_handler_with_scm.  Previously, we passed
	  scm_unlock_mutex and scm_lock_mutex (which return SCM), but the
	  scm_dynwind_* functions expect pointers to functions which return
	  void.  When SCM is of type union, this changes the calling conventions
	  of the functions on some platforms (e.g. GCC 4.5.2 and 4.5.3 on x86).

2011-05-21  Andy Wingo  <wingo@pobox.com>

	fix define-module ordering
	* module/ice-9/boot-9.scm (define-module): Fix to load the #:use-module
	  clauses in the order in which they appear in the define-module form.
	  Thanks to Jan Nieuwenhuizen for the report.

	* test-suite/standalone/test-import-order: Add new test that
	  define-module and use-modules resolve the interface in the right
	  order.

	* test-suite/standalone/Makefile.am:
	* test-suite/standalone/test-import-order-a.scm:
	* test-suite/standalone/test-import-order-b.scm:
	* test-suite/standalone/test-import-order-c.scm:
	* test-suite/standalone/test-import-order-d.scm: Aux files.

2011-05-21  Andy Wingo  <wingo@pobox.com>

	(syntax foo) -> #'foo in goops
	* module/oop/goops.scm: Change instances of (syntax foo) to #'foo.

2011-05-20  Andy Wingo  <wingo@pobox.com>

	clocktime freebsd portability
	* libguile/stime.c (HAVE_POSIX_CPUTIME): Hack around buggy FreeBSD
	  implementation of _POSIX_CPUTIME.

	fix compile error in mingw fstat socket detection
	* libguile/filesys.c (fstat_Win32) [__MINGW32__]: Apparently there is no
	  _S_IFSOCK on mingw32.  Thanks to Volker Grabsch for the report.

	gen-scmconfig cross-compilation fix
	* libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): Fix
	  cross-compilation.  Thanks to Volker Grabsch for the report!

2011-05-20  Andy Wingo  <wingo@pobox.com>

	fix documentation for option-set! syntaxen
	* doc/ref/api-evaluation.texi (Scheme Read): Note that read-set! is
	  syntax.
	  (Scheme Write): Likewise for print-set!.

	* doc/ref/api-io.texi (Writing): Remove reference to
	  print-options-interface.

	* doc/ref/repl-modules.texi (Readline Options): Update, and add entries
	  for readline-options, readline-set! et al.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	regexp.test needed char-code-limit
	* test-suite/tests/regexp.test (char-code-limit): Define a local version
	  of this recently removed definition.  Hopefully that's the only use
	  of it though!

	remove SCM_EXIT_SUCCESS and SCM_EXIT_FAILURE definitions
	* libguile/__scm.h: Remove unused SCM_EXIT_SUCCESS and SCM_EXIT_FAILURE
	  definitions.

	use of EXIT_SUCCESS and EXIT_FAILURE
	* libguile/threads.c (scm_init_guile):
	* libguile/throw.c (scm_exit_status): Use EXIT_SUCCESS and EXIT_FAILURE
	  instead of 0 and 1.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	scm_wta_* procedures replace SCM_WTA_* macros
	* libguile/__scm.h: Move all the SCM_WTA and SCM_GASSERT macros out of
	  here.  Also remove the scm_call_generic declarations.
	* libguile/deprecated.h (SCM_WTA_DISPATCH_0, SCM_WTA_DISPATCH_1):
	  (SCM_WTA_DISPATCH_2, SCM_WTA_DISPATCH_N): Deprecate.  See below for
	  their replacements.
	  (SCM_GASSERT0, SCM_GASSERT1, SCM_GASSERT2, SCM_GASSERTn): Deprecate
	  these too.
	  (SCM_WTA_DISPATCH_1_SUBR): Deprecate this strange thing.
	  (scm_call_generic_0, scm_call_generic_1, scm_call_generic_2):
	  (scm_call_generic_3, scm_apply_generic): Remove, indicating their
	  replacements.

	* libguile/print.c (iprin1):
	* libguile/eq.c (scm_equal_p): Use scm_call_2 instead of
	  scm_call_generic_2.

	* libguile/goops.h:
	* libguile/goops.c: Remove scm_{call,apply}_generic definitions.
	  (scm_wta_dispatch_0, scm_wta_dispatch_1, scm_wta_dispatch_2):
	  (scm_wta_dispatch_n): New procedures, replacing the SCM_WTA macros.

	* libguile/numbers.c (scm_lcm):
	* libguile/procs.c (scm_setter): Remove uses of SCM_GASSERT.

	* libguile/numbers.c (scm_lcm):
	* libguile/procs.c (scm_setter):
	* libguile/vectors.c: Use the procedural scm_wta routines instead of the
	  SCM_WTA macros.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	SCM_ASSERT to error.h
	* libguile/error.h (SCM_ASSERT, SCM_ASSERT_TYPE): Move definition here.
	  Remove SCM_RECKLESS case.
	* libguile/__scm.h: (From here.)

	remove SCM_ASRTGO
	* libguile/__scm.h (SCM_ASRTGO): Remove unused macro.

	remove unused SCM_FENCE definition
	* libguile/__scm.h (SCM_FENCE): Remove unused definition.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	rename scm_async_click() to scm_async_tick(); privatize SCM_ASYNC_TICK
	* libguile/_scm.h (SCM_ASYNC_TICK, SCM_ASYNC_TICK_WITH_CODE): Make these
	  definitions private.  Call the tick() function instead of click().

	* libguile/__scm.h:
	* libguile/async.h (scm_async_tick): Move declaration here.  Remove
	  scm_async_click declaration.  Tick is the new (and old!) click, you
	  see.
	  (SCM_CRITICAL_SECTION_END): Call tick() instead of click().

	* libguile/async.c (scm_async_tick): Remove old definition, and rename
	  scm_async_click to scm_async_tick.
	  (decrease_block): Adapt to click() -> tick() name change.

	* libguile/deprecated.h (scm_async_click, SCM_ASYNC_TICK): Define some
	  GONE macros.

	* libguile/threads.c (fat_mutex_unlock): Tick() instead of click().

2011-05-15  Andy Wingo  <wingo@pobox.com>

	simplify SCM_TICK
	* libguile/__scm.h (SCM_TICK): Define to simply scm_async_tick (or
	  SCM_ASYNC_TICK when building Guile).

2011-05-15  Andy Wingo  <wingo@pobox.com>

	remove SCM_THREAD_SWITCHING_CODE
	* libguile/deprecated.h (SCM_THREAD_SWITCHING_CODE):
	* libguile/threads.h: Remove SCM_THREAD_SWITCHING_CODE, adding in a
	  deprecation note.

	* libguile/__scm.h (SCM_TICK): Remove SCM_THREAD_SWITCHING_CODE.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	make SCM_I_SETJMP and SCM_I_LONGJMP private
	* libguile/_scm.h (SCM_I_SETJMP, SCM_I_LONGJMP): Move to this private
	  header.
	* libguile/__scm.h (scm_i_jmp_buf): Only define the scm_i_jmp_buf type
	  in this public header.

	move SCM_FLUSH_REGISTER_WINDOWS to continuations.c
	* libguile/continuations.c: Move SCM_FLUSH_REGISTER_WINDOWS define
	  here...
	* libguile/__scm.h: ...from here.

	minor __scm.h cleanup
	* libguile/__scm.h: Clean up setjmp/longjmp portability defines.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	remove mention of cheap continuations
	* libguile/__scm.h: Inline an #ifndef CHEAP_CONTINUATIONS block for
	  VMS, as we always have full continuations.

	* libguile/feature.c (scm_init_feature): Don't bother defining the
	  "full-continuation" feature.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	remove SCM_I_LLONG and SCM_I_ULLONG limit defines
	* test-suite/standalone/test-num2integral.c (test_long_long):
	  (test_ulong_long): Replace SCM_I_LLONG and SCM_I_ULLONG defines with
	  their counterparts from limits.h.

	* libguile/__scm.h: Remove SCM_I_LLONG and SCM_I_ULLONG limit defines.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	remove SCM_I_SIZE limits defines
	* libguile/__scm.h: Remove defines for SCM_I_SIZE_MAX, SCM_I_SSIZE_MIN,
	  and SCM_I_SSIZE_MAX, as there is no longer a scm_t_size / scm_size_t
	  type.
	* libguile/bytevectors.c (make_bytevector): Replace a use of
	  SCM_I_SIZE_MAX with ((size_t) -1).

	remove SCM_CHAR_CODE_LIMIT define
	* libguile/__scm.h: Remove SCM_CHAR_CODE_LIMIT define.
	* libguile/feature.c (scm_init_feature): Remove char-code-limit define,
	  which was sure to be 256: a bogus value.

	remove more unused __scm.h options
	* libguile/__scm.h: Remove unused SCM_DEBUG_MARKING_API,
	  SCM_DEBUG_INTERRUPTS, and SCM_DEBUG_DEBUGGING_SUPPORT defines.

	remove mention of GUILE_DEBUG_FREELIST
	* libguile/__scm.h: Remove commented-out GUILE_DEBUG_FREELIST define.
	* libguile/gen-scmconfig.c: Remove mention of GUILE_DEBUG_FREELIST.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	remove #define STACK_CHECKING from __scm.h.
	* libguile/__scm.h: Remove #define STACK_CHECKING and #undef
	  NO_CEVAL_STACK_CHECKING.

	* libguile/debug.c (scm_debug_options)
	* libguile/init.c (scm_i_init_guile):
	* libguile/stackchk.c (scm_report_stack_overflow):
	* libguile/stackchk.h: Always enable stack checking.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	remove SICP from __scm.h
	* libguile/__scm.h: Remove #undef SICP.
	* libguile/feature.c (scm_init_feature): Never add the sicp feature.

	remove ENGNOT from __scm.h
	* libguile/__scm.h: Remove #undef ENGNOT.
	* libguile/numbers.c (idbl2str): Remove #ifdef ENGNOT sections.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	SCM is either a union or scm_t_bits
	* libguile/tags.h: Elide the SCM_DEBUG_TYPING_STRICTNESS==1 case.
	  Instead just have a flag, SCM_USING_PREHISTORIC_COMPILER, which if set
	  uses what was SCM_DEBUG_TYPING_STRICTNESS==0.

	* libguile/__scm.h: Remove SCM_DEBUG_TYPING_STRICTNESS block.

2011-05-15  Andy Wingo  <wingo@pobox.com>

	SCM is a union
	* libguile/tags.h (SCM): Change to simply be a union containing
	  scm_t_bits.
	  (SCM_PACK, SCM_UNPACK): Adapt accordingly.

	fix type errors in test suite
	* test-suite/standalone/test-num2integral.c (out_of_range_handler): Fix
	  SCM used as a truth value.
	* test-suite/standalone/test-scm-spawn-thread.c (inner_main): Use
	  SCM2PTR here.

2011-05-14  Andreas Rottmann  <a.rottmann@gmx.at>

	Improve R6RS conformance wrt. conditions in the I/O libraries
	* module/rnrs/io/ports.scm (open-file-output-port): Handle `no-fail'
	  file option.
	  (with-i/o-filename-conditions): Use `with-throw-handler' instead of `catch'.
	  (with-i/o-port-error,
	  with-textual-output-conditions. with-textual-input-conditions): New
	  exception-conversion helpers.
	  (put-char, put-datum, put-string, display): Use
	  `with-textual-output-conditions' instead of `with-i/o-encoding-error'
	  to get proper conditions in case of write errors.
	  (get-char, get-datum, get-line, get-string-all, lookahead-char):
	  Likewise, for the input case.

	* test-suite/tests/r6rs-ports.test (pass-if-condition, test-file,
	  make-failing-port): New helpers.
	  ("8.2.10 Output ports"): Add some tests for `open-file-output-port'.
	  ("8.2.9 Textual Input"): Add tests read error conditions.
	  ("8.2.12 Textual Output"): Add tests for write error conditions.
	  ("8.3 Simple I/O"): Add tests for conditions, `call-with-input-file'
	  and `call-with-output-file'.

2011-05-13  Andy Wingo  <wingo@pobox.com>

	Bump default typing strictness to 2.
	* libguile/__scm.h (SCM_DEBUG_TYPING_STRICTNESS): Bump the default to
	  2.

	merge strictness branch from 2.0

	refactor do_thread_exit cleanup handler invocation
	* libguile/threads.c (do_thread_exit): Redo cleanup handler call so as
	  not to shove a SCM into a pointer.

	i18n error return type fix
	* libguile/i18n.c (chr_to_case, str_to_case): Return #f in error case
	  instead of 0.

	PTR2SCM and SCM2PTR in inline.h
	* libguile/inline.h (scm_cell, scm_immutable_cell):
	  (scm_double_cell, scm_immutable_double_cell):
	  (scm_words): Be more consistent in use of PTR2SCM and SCM2PTR.

	compile-time assertion in net_db uses constant expressions
	* libguile/net_db.c: Use constant expressions for EAI_BADFLAGS and
	  AI_ALL representations.

	ports.c uninitialized static SCM values are #f, not 0
	* libguile/ports.c: (scm_current_input_port, scm_current_output_port)
	  (scm_current_error_port): Use #f as the uninitialized value instead of
	  0.

	scm_port_for_each fix
	* libguile/ports.c (scm_port_for_each): Inline the call to
	  scm_c_port_for_each, to avoid type errors.

	weak_bucket_assoc tweak
	* libguile/hashtab.c (weak_bucket_assoc): Change assertion to be a check
	  and abort, and so that only calls GC_is_visible if the check fails.

	vm_make_boot_program initializer fix
	* libguile/vm.c (vm_make_boot_program): Use #f as the "I don't have a
	  program" value.

	correct use of SCM2PTR in SCM_I_REGISTER_DISAPPEARING_LINK forms
	* libguile/hashtab.c (set_weak_cdr):
	* libguile/vectors.c (scm_c_vector_set_x):
	* libguile/weaks.c (scm_weak_car_pair, scm_weak_cdr_pair):
	  (scm_doubly_weak_pair): Use SCM2PTR for the target of
	  SCM_I_REGISTER_DISAPPEARING_LINK calls.

	scm_is_false instead of == SCM_BOOL_F; also is_null, is_true, etc
	* libguile/deprecation.c (scm_issue_deprecation_warning)
	* libguile/eval.c (CAPTURE_ENV):
	* libguile/goops.c (make_dispatch_procedure, make_class_from_symbol):
	  (create_smob_classes):
	* libguile/guardians.c (finalize_guarded, scm_i_get_one_zombie):
	* libguile/hashtab.c (scm_fixup_weak_alist, scm_internal_hash_fold):
	* libguile/i18n.c (scm_nl_langinfo)
	* libguile/load.c (scm_primitive_load)
	* libguile/posix.c (scm_setrlimit)
	* libguile/socket.c (scm_to_sockaddr):
	* libguile/srcprop.c (scm_make_srcprops): Use scm_is_false / scm_is_true
	  / scm_is_null instead of comparing against SCM_BOOL_F et al.

	more care regarding SCM_PACK and SCM_UNPACK
	* libguile/control.c (reify_partial_continuation):
	* libguile/eval.c (RETURN_BOOT_CLOSURE):
	* libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref)
	  (scm_frame_local_set_x)
	* libguile/frames.h (SCM_FRAME_SET_RETURN_ADDRESS):
	  (SCM_FRAME_SET_MV_RETURN_ADDRESS, SCM_FRAME_SET_DYNAMIC_LINK):
	* libguile/goops.c (scm_class_of, scm_primitive_generic_generic)
	  (scm_c_extend_primitive_generic, compute_getters_n_setters)
	  (scm_sys_initialize_object):
	* libguile/guardians.c (finalize_guarded):
	* libguile/list.c (SCM_I_CONS):
	* libguile/macros.c (scm_i_make_primitive_macro)
	  (scm_make_syntax_transformer):
	* libguile/memoize.c (MAKMEMO, SCM_MAKE_MEMOIZER)
	  (SCM_MAKE_REST_MEMOIZER):
	* libguile/modules.c (scm_module_reverse_lookup)
	* libguile/print.c (iprin1):
	* libguile/promises.c (scm_make_promise)
	* libguile/srcprop.c (scm_make_srcprops):
	* libguile/vectors.c (scm_c_vector_ref):
	* libguile/vm-engine.c (vm_engine)
	* libguile/vm-i-scheme.c (REL, add1, sub1):
	* libguile/vm-i-system.c (new_frame, call_cc)
	* libguile/weaks.h (SCM_WEAK_PAIR_WORD_DELETED_P): Be more careful about
	  SCM_PACK / SCM_UNPACK.

	scm_is_eq for SCM vals, not == or !=
	* libguile/bytevectors.c (scm_make_bytevector, STRING_TO_UTF)
	  (UTF_TO_STRING):
	* libguile/continuations.c (scm_i_check_continuation):
	* libguile/expand.h (SCM_EXPANDED_P):
	* libguile/fluids.c (scm_i_make_with_fluids):
	* libguile/generalized-vectors.c (scm_make_generalized_vector):
	* libguile/goops.c (SCM_GOOPS_UNBOUNDP, slot_definition_using_name):
	  (scm_c_extend_primitive_generic, more_specificp, scm_make)
	* libguile/i18n.c (SCM_VALIDATE_OPTIONAL_LOCALE_COPY):
	  (scm_locale_string_to_integer)
	* libguile/modules.c (resolve_duplicate_binding):
	  (scm_module_reverse_lookup)
	* libguile/posix.c (scm_to_resource):
	* libguile/r6rs-ports.c (scm_put_bytevector):
	* libguile/socket.c (scm_connect, scm_bind, scm_sendto
	* libguile/stacks.c (find_prompt):
	* libguile/variable.c (scm_variable_ref, scm_variable_bound_p):
	* libguile/vm-engine.h (ASSERT_BOUND_VARIABLE, ASSERT_BOUND)
	* libguile/vm-i-system.c (VARIABLE_BOUNDP, local_bound)
	  (long_local_bound, fluid_ref): Use scm_is_eq to compare, not == / !=.

2011-05-13  Andy Wingo  <wingo@pobox.com>

	deprecate scm_internal_dynamic_wind
	* libguile/dynwind.c:
	* libguile/dynwind.h:

	* libguile/deprecated.h (scm_t_inner):
	* libguile/deprecated.c (scm_internal_dynamic_wind): Deprecate, as the
	  scm_dynwind API is better, and this API encourages users to stuff SCM
	  values into pointers.

2011-05-13  Andy Wingo  <wingo@pobox.com>

	excise scm_internal_dynamic_wind from goops.c
	* libguile/goops.c (go_to_hell, go_to_heaven, purgatory):
	  (scm_change_object_class): Rewrite to use scm_dynwind_begin instead of
	  scm_dynamic_wind.

	async.c refactor
	* libguile/async.c (increase_block, decrease_block): Write more
	  clearly.
	  (scm_dynwind_block_asyncs, scm_dynwind_unblock_asyncs): Move
	  definitions up.
	  (scm_call_with_blocked_asyncs, scm_c_call_with_blocked_asyncs)
	  (scm_call_with_unblocked_asyncs, scm_c_call_with_unblocked_asyncs):
	  Implement in terms of scm_dynwind_{un,}block_asyncs, so that we don't
	  stuff SCM values into pointers.

2011-05-13  Andy Wingo  <wingo@pobox.com>

	fix type errors
	* libguile/numbers.c (scm_logand): Fix a type error (comparing a SCM
	  against an int, when we really wanted to compare the unpacked
	  fixnum).

	* libguile/ports.c (scm_i_set_conversion_strategy_x): Check
	  scm_conversion_strategy_init, not scm_conversion_strategy.

	* libguile/read.c (recsexpr): Fix loops to avoid strange test of SCM
	  values.

2011-05-13  Andy Wingo  <wingo@pobox.com>

	allow iflags to be constant expressions with typing-strictness==2
	* libguile/tags.h (SCM_MAKE_ITAG8_BITS): New helper, produces a
	  scm_t_bits instead of a SCM, because SCM_UNPACK is not a constant
	  expression with SCM_DEBUG_TYPING_STRICTNESS==2.
	  (SCM_MAKIFLAG_BITS): Remove SCM_MAKIFLAG, and replace with this, which
	  returns bits.
	  (SCM_BOOL_F_BITS, SCM_ELISP_NIL_BITS, SCM_EOL_BITS, SCM_BOOL_T_BITS):
	  (SCM_UNSPECIFIED_BITS, SCM_UNDEFINED_BITS, SCM_EOF_VAL_BITS):
	  (SCM_UNBOUND_BITS): New definitions.  Defined SCM_BOOL_F, etc in terms
	  of them.
	  (SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0):
	  (SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_1):
	  (SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_2):
	  (SCM_XXX_ANOTHER_LISP_FALSE_DONT_USE): Be bits instead of SCM values.
	  (SCM_BITS_DIFFER_IN_EXACTLY_ONE_BIT_POSITION):
	  (SCM_BITS_DIFFER_IN_EXACTLY_TWO_BIT_POSITIONS): Rename from
	  SCM_VALUES_DIFFER_..., and take unpacked bits as the args.

	* libguile/boolean.c: Update verify block to use
	  SCM_BITS_DIFFER_IN_EXACTLY_TWO_BIT_POSITIONS et al.

	* libguile/debug.c (scm_debug_opts):
	* libguile/print.c (scm_print_opts):
	* libguile/read.c (scm_read_opts): Use iflags bits for initializers.

	* libguile/hash.c (scm_hasher): Use _BITS for iflags as case labels.

	* libguile/pairs.c: Nil/null compile-time check uses
	  SCM_ELISP_NIL_BITS.

2011-05-13  Andy Wingo  <wingo@pobox.com>

	fix static allocation with debug_typing_strictness==2
	* libguile/tags.h (SCM): For SCM_DEBUG_TYPING_STRICTNESS==2, give the
	  union a tag, and use C99 compound literals to construct the value.
	  This allows SCM_PACK to be a constant expression.

	* libguile/snarf.h: Allow SCM_SUPPORT_STATIC_ALLOCATION for
	  SCM_DEBUG_TYPING_STRICTNESS==2.
	  (SCM_IMMUTABLE_STRING): Properly parenthesize the string length.
	  (SCM_STATIC_PROGRAM): Fix for SCM_DEBUG_TYPING_STRICTNESS==2.

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

	remove all deprecated code
	* libguile/async.c:
	* libguile/async.h:
	* libguile/debug.h:
	* libguile/deprecated.c:
	* libguile/deprecated.h:
	* libguile/evalext.h:
	* libguile/gc-malloc.c:
	* libguile/gc.h:
	* libguile/gen-scmconfig.c:
	* libguile/numbers.c:
	* libguile/ports.c:
	* libguile/ports.h:
	* libguile/procprop.c:
	* libguile/procprop.h:
	* libguile/read.c:
	* libguile/socket.c:
	* libguile/srfi-4.h:
	* libguile/strings.c:
	* libguile/strings.h:
	* libguile/tags.h:
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm: Remove all deprecated code.  CPP defines
	  that were not previously issuing warnings were changed so that their
	  expansions would indicate the replacement forms to use,
	  e.g. scm_sizet__GONE__REPLACE_WITH__size_t.

	  The two exceptions were SCM_LISTN, which did not produce warnings
	  before, and the string-filter argument order stuff.

	  Drops the initial dirty memory usage of Guile down to 2.8 MB on my
	  machine, from 4.4 MB.

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

	add missing SCM_DEPRECATED annotation
	* libguile/deprecated.h: Use SCM_DEPRECATED instead of SCM_API for the
	  asinh, acosh, atanh, and atan2 wrappers.

	Merge remote-tracking branch 'origin/stable-2.0'

	all deprecated routines emit warnings
	* module/ice-9/deprecated.scm (substring-move-left!)
	  (substring-move-right!, dynamic-maybe-call, dynamic-maybe-link)
	  (try-module-linked, try-module-dynamic-link)
	  ($asinh, $acosh, $atanh, $sqrt, $abs, $exp, $log, $sin, $cos)
	  ($tan, $asin, $acos, $atan, $sinh, $cosh, $tanh)
	  (process-define-module): Add deprecation warnings.

2011-05-09  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

2011-05-08  Andy Wingo  <wingo@pobox.com>

	fix some duplication in object tables
	* module/language/glil/compile-assembly.scm (build-object-table): Don't
	  add the same value to an object table twice.

2011-05-08  Ludovic Courtès  <ludo@gnu.org>

	Add `vhash-fold-right'.
	* module/ice-9/vlist.scm (vhash-fold-right): New procedure.

	* test-suite/tests/vlist.test ("vhash")["vhash-fold-right"]: New test.

	* doc/ref/api-compound.texi (VHashes): Document `vhash-fold-right'.

2011-05-08  Ludovic Courtès  <ludo@gnu.org>

	Optimize `vlist-fold-right'.
	* module/ice-9/vlist.scm (vlist-fold-right): Avoid `vlist-reverse' and
	  instead `vlist-ref' individual elements.  The result is about twice
	  faster.  Thanks Andy for suggesting it indirectly.  :-)

2011-05-08  Andy Wingo  <wingo@pobox.com>

	add map and for-each benchmarks
	* benchmark-suite/benchmarks/srfi-1.bm ("map", "for-each"): Add
	  benchmarks.

2011-05-08  Ludovic Courtès  <ludo@gnu.org>

	Fix small integer return value packing on big endian machines.
	* libguile/foreign.c (pack): Add `return_value_p' parameter.  Update
	  callers.
	  When RETURN_VALUE_P is true, assume LOC points to an `ffi_arg', and
	  cast its results to the relevant type.  This fixes packing of integer
	  return values smaller than `int' on SPARC64 and PowerPC64.  Reported
	  by Nelson H. F. Beebe <beebe@math.utah.edu>.

	Make the definition of `scm_read_shebang' match its declaration.
	* libguile/read.c (scm_read_shebang): Remove the `inline' keyword.

2011-05-08  Andy Wingo  <wingo@pobox.com>

	compile-assembly: cleanup
	* module/language/glil/compile-assembly.scm: Clean up code for
	  subprograms (not needed, we just cache the glil) and object alists
	  (replaced by constants tables).

2011-05-08  Andy Wingo  <wingo@pobox.com>

	compile-assembly: use file-level constants table
	* module/language/glil/compile-assembly.scm (compile-assembly): Rework
	  to handle toplevel-specific code generation here, instead of in
	  glil->assembly.  Specifically, here we build a global constant table,
	  and arrange for it to be the objtable of the toplevel thunk.

	  (compile-program): New helper, compiles a <glil-program> and returns
	  just the (load-program ...) form.

	  (compile-objtable): New helper, generates assembly to build an object
	  table, using some other constants table, and possibly recursing to
	  `compile-program' for cached GLIL programs.

	  (glil->assembly): Simplify, removing the toplevel? argument, and
	  replacing the object alist with an objtable computed in a previous
	  pass.  Adapt to the new form of the objtable, and to use
	  compile-program and compile-objtable.

2011-05-08  Andy Wingo  <wingo@pobox.com>

	compile-assembly: add dump-constants, a new helper
	* module/language/glil/compile-assembly.scm (dump-constants): New
	  helper.  Generates bytecode that will result in a vector for the
	  global object table being pushed on the stack.  The items in the
	  global object table will share state as much as possible.

	compile-assembly: add build-constant-store, build-object-table
	* module/language/glil/compile-assembly.scm (immediate?): New helper.
	  (build-constant-store): New helper.  Walks the GLIL tree and builds up
	  a constant table, as a vhash.
	  (build-object-table): Another helper, builds a constant table for a
	  given GLIL program.

	compile-assembly: make-meta refactor
	* module/language/glil/compile-assembly.scm (make-meta): Avoid going
	  through the compiler.

	compile-assembly: add traversal helpers
	* module/language/glil/compile-assembly.scm (vhash-fold-right2):
	  (fold2, vector-fold2): Add some traversal helpers that we'll use in
	  the next commit.

	fix `hash' for inf and nan
	* libguile/hash.c (scm_hasher): Fix to work on inf and nan.
	* test-suite/tests/hash.test ("hash"): Add tests.

2011-05-07  Andreas Rottmann  <a.rottmann@gmx.at>

	Make the R6RS simple I/O library use conditions
	* module/rnrs/io/ports.scm (display): Implement as an
	  exception-converting wrapper around Guile's core display.
	* module/rnrs/io/simple.scm: Don't export Guile's corresponding core
	  procedures, but use `(rnrs io ports)' instead.  This way, we get the
	  conditions required by R6RS raised.

	* doc/ref/r6rs.texi (rnrs io simple): Mention that these procedures are
	  supposed to raise R6RS conditions.

2011-05-07  Ludovic Courtès  <ludo@gnu.org>

	Fix `get_utf8_codepoint' to not consume valid starting bytes.
	Thanks to Mark H. Weaver for pointing this out.

	* libguile/ports.c (CONSUME_PEEKED_BYTE): New macro.
	  (get_utf8_codepoint): New variable `pt'.  Use
	  `scm_peek_byte_or_eof'/`CONSUME_PEEKED_BYTE' pairs instead of
	  `scm_get_byte_or_eof'.

	* test-suite/tests/ports.test ("string ports")[#xc2 #x41 #x42, #xe0 #xa0
	  #x41 #x42, #xf0 #x88 #x88 #x88]: Fix to conform to Unicode 6.0.0.
	  [#xe0 #x88 #x88]: Remove test.
	  [#xf0 #x80 #x80 #x41]: New test.

2011-05-07  Ludovic Courtès  <ludo@gnu.org>

	Add `scm_peek_byte_or_eof'.
	* libguile/inline.h (scm_get_byte_or_eof): Add `SCM_UNLIKELY' for EOF.
	  (scm_peek_byte_or_eof): New function.

	* libguile/r6rs-ports.c (scm_lookahead_u8): Use `scm_peek_byte_or_eof'.

2011-05-07  Andreas Rottmann  <a.rottmann@gmx.at>

	More completely document the `(rnrs io ports)' library
	* doc/ref/api-io.texi (R6RS I/O Ports): Transcribe missing parts from
	  the R6RS document.

2011-05-07  Andy Wingo  <wingo@pobox.com>

	bytevectors have internal parent field
	* libguile/bytevectors.h (SCM_BYTEVECTOR_HEADER_SIZE): Bump, giving
	  bytevectors another word: a parent pointer.  Will allow for
	  sub-bytevectors and efficient mmap bindings.

	* libguile/bytevectors.c (make_bytevector):
	  (make_bytevector_from_buffer): Init parent to #f.
	  (scm_c_take_bytevector, scm_c_take_typed_bytevector): Another
	  argument, the parent, which gets set in the bytevector.

	* libguile/foreign.c (scm_pointer_to_bytevector): Use the parent field
	  instead of registering a weak reference from bytevector to foreign
	  pointer.

	* libguile/objcodes.c (scm_objcode_to_bytecode): Use the parent field to
	  avoid copying the objcode.

	* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS):
	* libguile/strings.c (scm_from_stringn):
	* libguile/vm.c (really_make_boot_program):
	* libguile/r6rs-ports.c (scm_get_bytevector_some)
	  (scm_get_bytevector_all, bytevector_output_port_procedure): Set the
	  parent to #f.

2011-05-07  Andy Wingo  <wingo@pobox.com>

	fix srfi-1 map-in-order definition
	* module/srfi/srfi-1.scm (map-in-order): As we are not extending the
	  core `map' binding, actually make a new `map-in-order' alias here.
	  Fixes fresh builds.

2011-05-06  Ludovic Courtès  <ludo@gnu.org>

	Special-case UTF-8 ports to bypass `iconv' entirely.
	* libguile/ports.c (update_port_lf): Handle EOF.
	  (get_utf8_codepoint, get_iconv_codepoint): New functions.
	  (get_codepoint): Use them.
	  (scm_i_set_port_encoding_x): Don't open conversion descriptors when
	  ENCODING is "UTF-8".

	* libguile/print.c (display_string_as_utf8, display_string_using_iconv):
	  New functions.
	  (display_string): Use them.

	* test-suite/tests/ports.test ("string ports")[#xc2 #x41 #x42]: Add a
	  note that this is not the wrong behavior per Unicode 6.0.0.

2011-05-06  Ludovic Courtès  <ludo@gnu.org>

	Fix `foreign.test' for big endian machines.
	* test-suite/tests/foreign.test ("pointer<->bytevector")["pointer from
	  bits", "dereference-pointer"]: Fix iteration order for big endian
	  machines.

2011-05-06  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

2011-05-06  Andy Wingo  <wingo@pobox.com>

	avoid tls gets when handling interrupts in the vm
	* libguile/__scm.h (SCM_ASYNC_TICK_WITH_CODE): Redefine to take a
	  scm_i_thread* as well.  OK to do because it's within a
	  BUILDING_LIBGUILE block.

	* libguile/vm-engine.c (vm_engine): Cache the scm_i_thread* instead of
	  the dynstate, so we can use the thread for ticks.

	* libguile/vm-engine.h (VM_HANDLE_INTERRUPTS): Tick with the
	  scm_i_thread* local var, to avoid excessive tls calls.

	* libguile/vm-i-system.c: Fix dynstate users to use
	  current_thread->dynamic_state.

2011-05-05  Andy Wingo  <wingo@pobox.com>

	map and for-each in scheme
	* module/ice-9/boot-9.scm (map, for-each): Implement in Scheme instead
	  of C.  There are boot versions before `cond' is defined.
	  (map-in-order): Define this alias here instead of in evalext.h.

	* libguile/eval.c: Stub out the map and for-each definitions to just
	  call into Scheme.

	* libguile/evalext.c: Remove map-in-order definition.

	* module/srfi/srfi-1.scm: Replace all calls to map1 with calls to map.
	  (map, for-each): Define implementations here, in Scheme, instead of in
	  C.

	* test-suite/tests/eval.test (exception:wrong-length, "map"): Update the
	  expected exception for mapping over lists of different lengths.

	* libguile/srfi-1.h:
	* libguile/srfi-1.c: Remove map and for-each definitions.  Remove the
	  bit that extended the core `map' primitive with another method: the
	  right way to do that is with modules.

2011-05-05  Andy Wingo  <wingo@pobox.com>

	psyntax simplification
	* module/ice-9/psyntax.scm (strip): Inline the and-map* definition to
	  its one call site.

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

2011-05-05  Andy Wingo  <wingo@pobox.com>

	scm_mem[qv] optimization
	* libguile/list.c (scm_memq, scm_memv): Inline the tortoise/hare check
	  that scm_ilength does, via SCM_VALIDATE_LIST, into the memq/memv
	  bodies.  Avoids traversing these lists twice.

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

	Generate `escape' and `substitute' port decoding tests.

2011-05-05  Andy Wingo  <wingo@pobox.com>

	Merge remote-tracking branch 'origin/stable-2.0'

2011-05-05  Andy Wingo  <wingo@pobox.com>

	VM tweaks
	* libguile/vm-engine.c (VM_CHECK_OBJECT, VM_CHECK_FREE_VARIABLES): Set
	  to 0 for both engines.  These are really internal debugging variables,
	  which don't affect user-visible features, provided that the compiler
	  is correct of course.
	  (VM_CHECK_UNDERFLOW): New var, also off by default: whether to check
	  for stack underflow when popping values.
	  (vm_engine): Don't declare object_count if we are not checking object
	  table accesses.

	* libguile/vm-engine.h (CACHE_PROGRAM): Don't muck with object_count
	  if we are not checking object table accesses.
	  (CHECK_UNDERFLOW, PRE_CHECK_UNDERFLOW): Nop out if we are not checking
	  underflow.
	  (POP2, POP3): New macros which check for underflow before popping more
	  than one value.

	* libguile/vm-i-loader.c (load_array):
	* libguile/vm-i-scheme.c (set_car, set_cdr, vector_set, slot_set)
	  (BV_SET_WITH_ENDIANNESS, BV_FIXABLE_INT_SET, BV_INT_SET)
	  (BV_FLOAT_SET):
	* libguile/vm-i-system.c (partial_cont_call, fix_closure, prompt)
	  (fluid_set): Use POP2 / POP3.
	  (local_set, long_local_set): Pop to locals instead of using values on
	  the stack then dropping; allows for underflow to be checked before the
	  value is accessed.
	  (BR): Don't NULLSTACK or DROP after the operation.
	  (br_if, br_if_not, br_if_eq, br_if_not_eq, br_if_null)
	  (br_if_not_null): Pop to locals before doing the compare and jump.

2011-05-05  Andy Wingo  <wingo@pobox.com>

	srfi-1 `member' in scheme, inlines to memq / memv in some cases
	* libguile/srfi-1.c:
	* libguile/srfi-1.h (scm_srfi1_member): Move implementation to Scheme.

	* module/srfi/srfi-1.scm (member): Implement here, with the inlining
	  cases for eq? and eqv?.  Speeds up a compiled bootstrap of
	  psyntax.scm, because lset-adjoin inlines to the memq case.
	  (lset<=): Reindent.

	  (lset-adjoin, lset-union): If the comparator is eq? or eqv?, just pass
	  it through to `member', so we inline to memq / memv.  Use something
	  closer to the reference implementations.

2011-05-05  Andy Wingo  <wingo@pobox.com>

	speed up compile-bytecode
	* module/language/assembly/compile-bytecode.scm (compile-bytecode):
	  Rewrite to fill a bytevector directly, instead of using bytevector
	  ports.  `write-bytecode' itself is still present and almost the same
	  as before; it's just that `write-byte' et al now inline the effect of
	  writing a byte to a binary port.

	* test-suite/tests/asm-to-bytecode.test (comp-test): Refactor to use
	  public interfaces.

2011-05-05  Andy Wingo  <wingo@pobox.com>

	silly "optimization" in (language assembly)
	* module/language/assembly.scm (byte-length): Silly, minor tweak: put
	  the fixed-length instruction case first.  Seems to shave some 10% off
	  the time compiling psyntax.scm (when the whole rest of the system is
	  compiled, of course).

	add gcprof
	* module/statprof.scm (gcprof): New variant of statprof; instead of
	  being driven by setitimer, this one is driven by the after-gc-hook.

	minor statprof tweaks
	* module/statprof.scm (statprof-reset): Make full-stacks? into an
	  optional arg instead of doing the rest arg dance.
	  (statprof-display): Format gc-time-taken appropriately.

2011-05-04  Ludovic Courtès  <ludo@gnu.org>

	Automatically generate `peek-char' decoding error tests.
	* test-suite/tests/ports.test ("string ports")[make-peek+read-checks]:
	  New macro.
	  [test-decoding-error]: Change to take a list of expected characters or
	  conditions.  Use `make-peek+read-checks' to generate a `peek-char'
	  test.
	  [(#xc2 #x41 #x42), (#xe0 #xa0 #x41 #x42)]: New tests.

2011-05-04  Andy Wingo  <wingo@pobox.com>

	measure time spent in gc
	* libguile/gc.c (scm_gc_stats): Set the gc-time-taken entry to our
	  recorded value.
	  (start_gc_timer, accumulate_gc_timer, scm_init_gc): Arrange to record
	  a conservative estimate of time spent in GC.

2011-05-04  Andy Wingo  <wingo@pobox.com>

	scm_c_get_internal_run_time is more precise
	* libguile/stime.h (SCM_TIME_UNITS_PER_SECOND): Redefine to point to a C
	  variable instead of being a pure preprocessor thing.  This has the
	  possibility to break existing compiled C extensions' interpretation of
	  the internal-time-units-per-second, but hopefully there's no too much
	  of that code out there, and in the worst case they can just
	  recompile.  Scheme code will get it right without the need to
	  recompile.

	* libguile/stime.c (TIME_UNITS_PER_SECOND): New local define, and
	  increase to nanosecond resolution if we are on a system in which this
	  is useful and practical.
	  (time_from_seconds_and_nanoseconds): New helper.
	  (get_internal_real_time, get_internal_run_time): New global vars:
	  function pointers.
	  (get_internal_real_time_posix_timer):
	  (get_internal_run_time_posix_timer):
	  (get_internal_real_time_gettimeofday):
	  (get_internal_run_time_times):
	  (get_internal_real_time_fallback): Various implementations.
	  (scm_get_internal_real_time): Return the get_internal_real_time()
	  result.
	  (scm_c_get_internal_run_time): Likewise.
	  (scm_gettimeofday): No need for a critical section, and remove
	  obsolete ftime block.
	  (scm_init_stime): Init all of the new time bases, and decide on
	  implementations of real time and run time accessors.

2011-05-04  Andy Wingo  <wingo@pobox.com>

	build support for detecting clock_gettime, with -lrt if needed
	* acinclude.m4 (gl_CLOCK_TIME):
	* configure.ac: Locally include gl_CLOCK_TIME.  To be fixed properly
	  when gnulib updates their license to reflect the actual BSD state of
	  things.
	* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS):
	  Add -lrt for clock_gettime, if needed.
	* meta/guile-2.0-uninstalled.pc.in:
	* meta/guile-2.0.pc.in: Likewise, in Libs.private.

2011-05-02  Daniel Llorens  <daniel.llorens@bluewin.ch>

	Fix call-with-input-file & relatives for multiple values
	* module/ice-9/r4rs.scm (call-with-input-file, call-with-output-file): Rewrite
	  with call-with-values.
	  (with-input-from-file): use call-with-input-file.
	  (with-output-to-file, with-error-to-file): use call-with-output-file.
	  Update docstrings to make clear that multiple values may be yielded.

2011-05-01  Andy Wingo  <wingo@pobox.com>

	deprecate scm_struct_table
	* libguile/goops.h:
	* libguile/goops.c (scm_i_define_class_for_vtable): New internal helper,
	  defines a class for a vtable, relying on the name slot being set
	  correctly.
	  (scm_class_of, create_struct_classes): Use the local vtable-to-class
	  map instead of scm_struct_table.

	* libguile/struct.h (SCM_STRUCT_TABLE_NAME, SCM_SET_STRUCT_TABLE_NAME)
	  (SCM_STRUCT_TABLE_CLASS, SCM_SET_STRUCT_TABLE_CLASS, scm_struct_table)
	  (scm_struct_create_handle): Deprecate these internals of the map
	  between structs and classes.

	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_struct_create_handle): Deprecated code over
	  here now.

2011-05-01  Andy Wingo  <wingo@pobox.com>

	disallow get-handle / create-handle! of weak hash tables
	* libguile/hashtab.c (scm_hashq_get_handle, scm_hashq_create_handle_x)
	  (scm_hashv_get_handle, scm_hashv_create_handle_x)
	  (scm_hash_get_handle, scm_hash_create_handle_x)
	  (scm_hashx_get_handle, scm_hashx_create_handle_x): Don't allow these
	  functions to be called on weak hash tables, as we have no idea when
	  the GC will null out fields of the handle, and set-cdr! won't register
	  disappearing links, and set-car! would never work of course.

	(ice-9 poe) does not get handles from weak hash tables
	* module/ice-9/poe.scm (pure-funcq, perfect-funcq): Reimplement to not
	  use get-handle.

	boot-9 fixme note
	* module/ice-9/boot-9.scm (module-replace!): Add a fixme about using
	  something other than object properties here.

	fix scm_object_property_set_x for handles and weak tables
	* libguile/objprop.c (scm_object_property_set_x): Use ref and set!
	  instead of create-handle and set-cdr!, as it is a weak hash table.
	  (scm_set_object_properties_x): Likewise.

	deprecated primitive-properties don't get handles from weak hash tables
	* libguile/deprecated.c (scm_primitive_property_ref)
	  (scm_primitive_property_set_x): Avoid getting handles to elements in a
	  weak hash table, as that's not going to work very well.

2011-05-01  Andy Wingo  <wingo@pobox.com>

	deprecate scm_whash API
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_whash_get_handle, SCM_WHASHFOUNDP)
	  (SCM_WHASHREF, SCM_WHASHSET, scm_whash_create_handle)
	  (scm_whash_lookup, scm_whash_insert): Deprecate this API.

	* libguile/srcprop.c:
	* libguile/srcprop.h:
	* libguile/read.c (scm_read_sexp): Use the hashq API instead of the
	  whash API.

2011-05-01  Andy Wingo  <wingo@pobox.com>

	fix hash-set! in weak-value table from non-immediate to immediate
	* libguile/hashtab.c (set_weak_cdr, scm_hash_fn_set_x): If we have a
	  weak-value hash table with a previous non-immediate value for a given
	  key, and we are setting an immediate as the new value, we were not
	  unregistering the disappearing link.  Fixed.

2011-04-29  Andy Wingo  <wingo@pobox.com>

	fix free-id=? for module-bound keywords
	* module/ice-9/psyntax.scm (free-id=?): For identifiers that are
	  resolved to the toplevel, check that the variables that they would
	  resolve to are equal, instead of simply checking that the symbolic
	  identifier names are equal.  Allows keywords to be bound, renamed,
	  exported, excluded, etc.

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

2011-04-29  Andy Wingo  <wingo@pobox.com>

	eval-when matches situations symbolically
	* module/ice-9/psyntax.scm (chi-when-list): Just match symbolically
	  instead of lexically, so as not to tie the meaning of eval-when to the
	  bindings of eval, load, compile, and expand.

	oop goops comment
	* module/oop/goops.scm: Add a note about the need to deprecate
	  min-fixnum and max-fixnum.

	psyntax simplification
	* module/ice-9/psyntax.scm (id-var-name): Just rely on multiple-values
	  truncation.

2011-04-29  Andy Wingo  <wingo@pobox.com>

	MV truncation in the boot evaluator
	* libguile/eval.c (truncate_values): New helper.
	  (EVAL1): New macro, does an eval then truncates the values.
	  (eval, prepare_boot_closure_env_for_apply)
	  (prepare_boot_closure_env_for_eval): Use EVAL1 in appropriate places
	  to get multiple-values truncation even here in the boot evaluator.

	eval.c fixen

2011-04-29  Andy Wingo  <wingo@pobox.com>

	latin1 strings in vm error messages
	* libguile/vm-engine.c: Use latin1 strings here for the string
	  literals.

2011-04-28  Andy Wingo  <wingo@pobox.com>

	check for iconveh values at configure-time
	* configure.ac: Check for the iconveh values here, instead of relying on
	  gen-scmconfig to know them.  That doesn't work in general because
	  gen-scmconfig runs on the build machine, not the target machine.

	* libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): Revert rule to the
	  revision before 533d8212.

	* libguile/gen-scmconfig.h.in (SCM_I_GSC_ICONVEH_ERROR):
	  (SCM_I_GSC_ICONVEH_QUESTION_MARK):
	  (SCM_I_GSC_ICONVEH_ESCAPE_SEQUENCE):
	* libguile/gen-scmconfig.c: Use configure-time substitutions to set
	  SCM_ICONVEH_ERROR_HANDLER et al.

2011-04-28  Andy Wingo  <wingo@pobox.com>

	-x error message fix
	* module/ice-9/command-line.scm (compile-shell-switches): Fix error
	  message for -x switch.

	fix double-loading of script in -ds case
	* module/ice-9/command-line.scm (compile-shell-switches): In the -ds
	  case, we were erroneously loading the script twice.  Fix that.

	fix break example
	* doc/ref/api-control.texi (while do): Fix a break example.

	Merge remote-tracking branch 'origin/stable-2.0'
	Conflicts:
		GUILE-VERSION

	allow while as an expression
	* module/ice-9/boot-9.scm (while): Specify the return value as #f under
	  normal conditions, #t under (break), and arg... under (break arg...).
	* test-suite/tests/syntax.test ("while"): Test.
	* doc/ref/api-control.texi (while do): Document.

2011-04-28  Andy Wingo  <wingo@pobox.com>

	add reset and shift
	* module/ice-9/control.scm (reset, shift): Add implementations of these
	  operators from Wolfgang J Moeller, derived from implementations by
	  Oleg Kiselyov.
	  (reset*, shift*): Procedural variants.

	* test-suite/tests/control.test ("shift and reset"): Add tests,
	  originally from Oleg Kiselyov.

2011-04-27  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in `NEWS'.

	Bump version number for 2.0.1.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
	  (LIBGUILE_INTERFACE_CURRENT): Increment to account for new C functions
	  such as `scm_c_public_ref' and `scm_from_latin1_keyword'.
	  (LIBGUILE_INTERFACE_AGE): Increment.

	Update `NEWS'.

2011-04-27  Ludovic Courtès  <ludo@gnu.org>

	Keep a 2.0.0-compatible `define-inlinable' macro in (srfi srfi-9).
	Partially reverts 165b10ddfaaa8ecc72d45a9be7d29e7537dc2379 and
	531c9f1dc51c4801c4d031ee80a31f15285a6b85.

	* module/srfi/srfi-9.scm (define-inlinable): New macro.

2011-04-27  Ludovic Courtès  <ludo@gnu.org>

	Document `(ice-9 binary-ports)'.
	* doc/ref/api-io.texi (R6RS I/O Ports): Mention `(ice-9 binary-ports)'.

	* NEWS: Update.

2011-04-27  Ludovic Courtès  <ludo@gnu.org>

	Add tests for UTF-8 ill-formed sequence handling.
	* test-suite/tests/ports.test ("string ports"): Add for
	  `test-decoding-error' tests for ill-formed UTF-8 sequences.  Thanks
	  to Mark H Weaver <mhw@netris.org> for pointing this out.

2011-04-27  Ludovic Courtès  <ludo@gnu.org>

	Gracefully handle unterminated UTF-8 sequences instead of hitting an `assert'.
	* libguile/ports.c (get_codepoint): Return EILSEQ when OUTPUT_SIZE == 0.

	* test-suite/tests/ports.test ("string ports"): Add 2 tests for
	  unterminated sequences.

2011-04-27  Ludovic Courtès  <ludo@gnu.org>

	Add a couple more Unicode I/O tests.
	* test-suite/tests/ports.test ("string ports")["%default-port-encoding
	  is honored"]: Make sure `(port-encoding p)' is as expected.
	  ["peek-char [utf-16]"]: New test.

	Rewrite port decoding error tests using a mini DSL.
	* test-suite/tests/ports.test ("string ports")[test-decoding-error]: New
	  macro.
	  ["read-char, wrong encoding, error", "read-char, wrong encoding,
	  escape", "read-char, wrong encoding, substitute", "peek-char, wrong
	  encoding, error"]: Rewrite using `test-decoding-error'.

	Gracefully handle `setlocale' errors at the REPL.
	* module/ice-9/top-repl.scm (top-repl): Catch exceptions from
	  `setlocale'.  Reported by CRLF0710 <crlf0710@gmail.com>.

2011-04-26  Ludovic Courtès  <ludo@gnu.org>

	Remove the `sizeof (mpz_t)' check.
	* libguile/numbers.c: Remove `sizeof (mpz_t)' check, which wasn't need
	  anymore since `make_bignum' doesn't make any such assumption.

2011-04-25  Ludovic Courtès  <ludo@gnu.org>

	Use `scm_with_guile' in `test-pthread-create'.
	* test-suite/standalone/test-pthread-create.c (inner_main): New
	  function.
	  (main): Call it within `scm_with_guile', instead of using
	  `scm_init_guile'.  This improves portability--e.g.,
	  `GC_get_stack_base', used by `scm_init_guile', failed on Darwin
	  up to BDW-GC 7.1alpha4 included (thanks, Mark, for the hint.)

2011-04-25  Ludovic Courtès  <ludo@gnu.org>

	Update Gnulib to v0.0-5158-g7d06b32; remove `strcase' and `version-etc-fsf'.
	* m4/gnulib-cache.m4: Remove `strcase' and `version-etc-fsf'.

	* configure.ac (POTENTIAL_GCC_CFLAGS): Remove `-Wundef'.

	* libguile/script.c: Don't include <version-etc.h>.

2011-04-25  Ludovic Courtès  <ludo@gnu.org>

	Fix `#ifdef HAVE_CONFIG_H' stanza in some stand-alone tests.
	* test-suite/standalone/test-asmobs-lib.c,
	  test-suite/standalone/test-extensions-lib.c,
	  test-suite/standalone/test-ffi-lib.c,
	  test-suite/standalone/test-list.c,
	  test-suite/standalone/test-num2integral.c,
	  test-suite/standalone/test-with-guile-module.c: Change `#ifndef
	  HAVE_CONFIG_H' to `#ifdef HAVE_CONFIG_H' (!).

	Compile more file system related procedures when `--disable-posix'.
	* libguile/filesys.c (scm_tc16_dir, scm_directory_stream_p, scm_opendir,
	  scm_readdir, scm_rewinddir, scm_closedir, scm_dir_print,
	  scm_dir_free, scm_lstat): Compile unconditionally.

2011-04-25  Ludovic Courtès  <ludo@gnu.org>

	Move `{total,current}-processor-count' outside of `posix.c'.
	* libguile/posix.c (scm_total_processor_count,
	  scm_current_processor_count): Move to...
	* libguile/threads.c: ... here.

	* libguile/posix.h (scm_total_processor_count,
	  scm_current_processor_count): Move declarations to...
	* libguile/threads.h: ... here.

	* test-suite/tests/posix.test ("nproc"): Move tests to...
	* test-suite/tests/threads.test: ... here.

2011-04-25  Ludovic Courtès  <ludo@gnu.org>

	Make the `sizeof (mpz_t)' check at compile-time.
	* libguile/init.c (scm_i_init_guile): Remove the `sizeof (mpz_t)'
	  run-time check.

	* libguile/numbers.c: Add a compile-time check for `sizeof (mpz_t)'.

2011-04-25  Ludovic Courtès  <ludo@gnu.org>

	Add pthread-related tests.
	* test-suite/standalone/Makefile.am (test_scm_spawn_thread_CFLAGS,
	  test_scm_spawn_thread_LDADD, test_pthread_create_CFLAGS,
	  test_pthread_create_LDADD, test_pthread_create_secondary_CFLAGS,
	  test_pthread_create_secondary_LDADD): New variables.
	  (check_PROGRAMS)[BUILD_PTHREAD_SUPPORT]: Add `test-scm-spawn-thread',
	  `test-pthread_create', `test-pthread_create-secondary'.
	  (TESTS)[BUILD_PTHREAD_SUPPORT]: Likewise.

	* test-suite/standalone/test-scm-spawn-thread.c,
	  test-suite/standalone/test-pthread-create.c,
	  test-suite/standalone/test-pthread-create-secondary.c: New files.

2011-04-25  Ludovic Courtès  <ludo@gnu.org>

	Make `scm_i_ensure_signal_delivery_thread' call in Guile mode.
	* libguile/threads.c (on_thread_exit): Move
	  `scm_i_ensure_signal_delivery_thread' call...
	  (do_thread_exit): ... here.

2011-04-22  Ludovic Courtès  <ludo@gnu.org>

	Make sure binary ports pass `binary-port?' regardless of the locale.
	* libguile/r6rs-ports.c (make_bip, make_cbip, make_bop, make_cbop):
	  Set `c_port->encoding' to NULL.

	* test-suite/tests/r6rs-ports.test ("7.2.7 Input
	  Ports")["bytevector-input-port is binary"]: New test.
	  ("7.2.7 Input Ports")["make-custom-binary-input-port"]: Make sure PORT
	  passes `binary-port?' and `input-port?'.
	  ("8.2.10 Output ports")["bytevector-output-port is binary"]: New test.
	  ["make-custom-binary-output"]: Rename to...
	  ["make-custom-binary-output-port"]: ... this.

	* test-suite/tests/ports.test ("string ports")["read-char, wrong
	  encoding, error", "read-char, wrong encoding, escape", "read-char,
	  wrong encoding, substitute", "peek-char, wrong encoding, error"]: Use
	  `set-port-encoding!' instead of `%default-port-encoding' to set the
	  encoding of bytevector input ports.

	* test-suite/tests/rdelim.test ("read-line")["decoding error", "decoding
	  error, substitute"]: Likewise.

	* doc/ref/api-io.texi (R6RS Port Manipulation): Document `binary-port?'
	  and `textual-port?'.

	* doc/ref/r6rs.texi (R6RS Incompatibilities): Mention the soft
	  distinction between textual and binary ports.

2011-04-22  Ludovic Courtès  <ludo@gnu.org>

	Turn the libunistring/iconv configure check into a macro.
	* acinclude.m4 (GUILE_LIBUNISTRING_WITH_ICONV_SUPPORT): New macro.

	* configure.ac: Use it.

2011-04-22  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in `configure.ac'.
	* configure.ac: Add missing comma in `AC_RUN_IFELSE' invocation.

	Increase the timeout of timing-sensitive thread tests.
	* test-suite/tests/threads.test ("timed locking succeeds if mutex
	  unlocked within timeout", "timed unlocking returns #t if condition
	  signaled", "timed joining succeeds if thread exits within timeout"):
	  Increase the timeout.  Reported by Dale P. Smith <dsmich@roadrunner.com>.

2011-04-21  Andy Wingo  <wingo@pobox.com>

	add test that libunistring was built with iconv support
	* configure.ac: Add check that libunistring was built with iconv
	  support.  Thanks to Mark Weaver for the debugging and test program.

2011-04-21  Mark H Weaver  <mhw@netris.org>

	Clarify units of string length in decription of scm_from_stringn
	* doc/ref/api-data.texi (Conversion to/from C): In description of
	  scm_from_stringn, clarify that the length is specified in bytes.

2011-04-20  Mark H Weaver  <mhw@netris.org>

	Clarify the units of returned lengths in string conversion functions
	* doc/ref/api-data.texi (Conversion to/from C): In descriptions of
	  scm_to_stringn and scm_to_{latin1,utf8,utf32}, clarify that the
	  returned length is in units of bytes or code points, not characters.
	  Also change NULL to @code{NULL} in a few places.

2011-04-15  Andy Wingo  <wingo@pobox.com>

	fix pre-GC_set_start_callback compilation
	* libguile/gc.c: Move declaration of run_before_gc_hook up.

2011-04-15  Andy Wingo  <wingo@pobox.com>

	pre-GC_set_start_callback compatibility
	* configure.ac: Add a check for GC_set_start_callback.

	* libguile/gc.c (scm_i_gc): If we don't have GC_set_start_callback, run
	  the before-gc hook manually here.
	  (scm_init_gc): Otherwise set it as a start callback.

	* libguile/hashtab.c (weak_gc_callback, weak_gc_hook)
	  (weak_gc_finalizer, scm_c_register_weak_gc_callback): Fix to work
	  either way, with or without GC_set_start_callback.

2011-04-15  Andy Wingo  <wingo@pobox.com>

	weak hash table vacuum on before-gc C hook
	* libguile/hashtab.c (weak_gc_callback)
	  (scm_c_register_weak_gc_callback): Change implementation to use the
	  before-gc C hook instead of the after-gc finalizers.

	use gc_start_callback + asyncs for after-gc-hook, instead of finalizers
	* libguile/gc.c (run_before_gc_c_hook, scm_storage_prehistory)
	  (after_gc_async_thunk, queue_after_gc_hook, scm_init_gc): Instead of
	  playing our finalizer trick, connect to the GC start callback, and use
	  it to queue an async after-gc-hook.  Seems to fix the after-gc-hook on
	  non-threaded builds.  Though this does re-enable the before-gc C hook,
	  we don't wire up the Scheme hook because we're in the alloc lock; and
	  indeed, a before-GC scheme hook isn't a great idea...

2011-04-15  Andy Wingo  <wingo@pobox.com>

	add --fresh-auto-compile
	* doc/ref/api-evaluation.texi (Compilation): Add discussion of
	  --fresh-auto-compile.
	* doc/ref/scheme-scripts.texi (Invoking Guile): Add --fresh-auto-compile
	  option.

	* NEWS: Add entry.

	* libguile/load.c: Define %fresh-auto-compile.
	  (scm_primitive_load_path): Use it here.
	  (scm_init_load_should_auto_compile): Init from GUILE_AUTO_COMPILE env
	  var, with a value of "fresh".

	* module/ice-9/boot-9.scm (load-in-vicinity): Auto-compilation cache is
	  stale if %fresh-auto-compile is true.

	* module/ice-9/command-line.scm (compile-shell-switches): Parse out
	  --fresh-auto-compile.

2011-04-15  Ludovic Courtès  <ludo@gnu.org>

	Build `filesys.x'.
	* libguile/Makefile.am (DOT_X_FILES): Add `filesys.x'.

2011-04-15  Ludovic Courtès  <ludo@gnu.org>

	Allow compilation with `--disable-posix'.
	Reported by Dmitry Dzhus <dima@dzhus.org>.

	* configure.ac: Remove `AC_LIBOBJ([filesys])'.  Document
	  `--disable-posix' as omitting non-essential POSIX interfaces.

	* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  Add `filesys.c'.
	  (DOT_DOC_FILES): Add `filesys.doc'.
	  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): Remove
	  `filesys.c'.

	* libguile/posix.c (scm_mkstemp, scm_access): Move to `filesys.c'.
	  (scm_init_posix): Move `R_OK' etc. to `filesys.c'.

	* libguile/filesys.c (scm_chown, scm_chmod, scm_umask, scm_open_fdes,
	  scm_open, scm_close, scm_close_fdes, scm_link, scm_tc16_dir,
	  scm_directory_stream_p, scm_opendir, scm_readdir, scm_rewinddir,
	  scm_closedir, scm_dir_print, scm_dir_free, scm_chdir, scm_getcwd,
	  set_element, fill_select_type, get_element, retrieve_select_type,
	  scm_select, scm_fcntl, scm_fsync, scm_symlink, scm_readlink,
	  scm_lstat, scm_copy_file): Conditionalize on HAVE_POSIX.
	  (scm_mkstemp, scm_access): New functions.
	  (scm_init_filesys): Conditionalize `scm_tc16_dir', `O_RDONLY', etc. on
	  HAVE_POSIX.  Define `R_OK', `W_OK', etc.

	* libguile/fports.c (fport_print): Use `scm_ttyname' only when
	  HAVE_POSIX.

	* libguile/i18n.c (lock_locale_mutex, unlock_locale_mutex): New
	  functions.  Update users of `scm_i_locale_mutex' to use them.

	* libguile/init.c (scm_i_init_guile): Always call `scm_init_filesys'.

	* meta/guile-tools.in (main): Use `setlocale' only when it is defined.

	* module/ice-9/boot-9.scm: Always load `ice-9/posix'.

2011-04-14  Ludovic Courtès  <ludo@gnu.org>

	Include <sched.h> in `posix.c'.
	* configure.ac: Check for <sched.h>.

	* libguile/posix.c [HAVE_SCHED_H]: Include <sched.h>, for
	  `sched_setaffinity' & co.
	  Reported by Marco Maggi <marco.maggi-ipsu@poste.it>.

2011-04-14  Ludovic Courtès  <ludo@gnu.org>

	Add tests for `-Wformat' and gettext.
	* test-suite/tests/tree-il.test ("warnings")["non-literal format string
	  using gettext", "one missing argument, gettext"]: New tests.

2011-04-14  Andy Wingo  <wingo@pobox.com>

	fix analyze.scm literal string warnings
	* module/language/tree-il/analyze.scm (const-fmt): Return any literal
	  value, not just strings.  The string case is checked later.

	fix embarrassing bugs in (ice-9 command-line)
	* module/ice-9/command-line.scm (compile-shell-switches): Whoops, fix a
	  few cases that forgot to loop back to the beginning.

	guile -v prints LGPLv3+.
	* module/ice-9/command-line.scm (compile-shell-switches): Though Guile
	  may be distributed under the GPLv3, Guile is actually LGPLv3+.

	script.c calls out to (ice-9 command-line)
	* libguile/script.c (scm_shell_usage): Call (ice-9 command-line)'s
	  shell-usage.
	  (scm_compile_shell_switches): Likewise, call (ice-9 command-line)'s
	  compile-shell-switches.

	add packager info to %build-info
	* libguile/load.c (init_build_info): Add packager, packager-version, and
	  packager-bug-reports to %build-info, if they are available.

	add (ice-9 command-line)
	* module/ice-9/command-line.scm: New module for parsing Guile's command
	  line, ported from script.c.  Includes local eval-string implementation
	  to make `guile -c 1' faster, by not having to load the compiler.
	* module/Makefile.am: Add to build.

	don't warn about non-literal fmt strings for e.g. (_ "foo")
	* module/language/tree-il/analyze.scm (const-fmt, format-analysis):
	  Allow format strings to be gettexted, using the conventional _ name.

2011-04-13  Andy Wingo  <wingo@pobox.com>

	update NEWS
	* NEWS: Update for 2.0.1.

	(rnrs arithmetic fixnums) fixnum? export a procedure again
	* module/rnrs/arithmetic/fixnums.scm (fixnum?): Restore this export to
	  be a procedure, not syntax.
	  (inline-fixnum?): This is what fixnum? was.  Use it internally.

	revert 4a2ac0623c3dabb2c8b9d38c27b837dcb2c7fe4e
	* module/ice-9/popen.scm (open-pipe*): No need to pump the pipes
	  guardian here, now that hooks are working again.

	--disable-threads fix
	* libguile/threads.c (do_thread_exit_trampoline, on_thread_exit):
	  (scm_i_init_thread_for_guile): Only register and unregister threads
	  with bdw-gc when we are building with threads support.  Thanks to
	  Marijn for the report.

2011-04-11  Andy Wingo  <wingo@pobox.com>

	bump effective version to 2.2
	* .gitignore:
	* GUILE-VERSION (GUILE_EFFECTIVE_VERSION):
	* configure.ac:
	* doc/example-smob/Makefile (CFLAGS, LIBS):
	* doc/guile.1:
	* doc/ref/libguile-concepts.texi:
	* doc/ref/srfi-modules.texi:
	* doc/ref/vm.texi:
	* meta/Makefile.am (EXTRA_DIST, pkgconfig_DATA):
	* meta/guile-config.in (guile-module):
	* meta/guile-2.2-uninstalled.pc.in:
	* meta/guile-2.2.pc.in: Bump effective version to 2.2.

	Merge remote branch 'origin/stable-2.0'
	Conflicts:
		GUILE-VERSION
		test-suite/tests/srfi-4.test

2011-04-11  Ian Price  <ianprice90@googlemail.com>

	Fix fencepost error in bip_seek
	* libguile/r6rs-ports.c (bip_seek): Fix to allow seeking to end of port.

	* test-suite/tests/r6rs-ports.test ("bytevector input port can seek to
	  very end"): Add tests.

2011-04-11  Ian Price  <ianprice90@googlemail.com>

	fix assert to return true value.
	* module/rnrs/base.scm (assert): returns value instead of void.

	* test-suite/tests/r6rs-base.test ("assert"): add test cases.

2011-04-11  Ian Price  <ianprice90@googlemail.com>

	Added optional second arg to R6RS log function
	* module/rnrs/base.scm (log): now takes a base argument, using the
	  change of base formula for logs.
	* test-suite/tests/r6rs-base.test ("log (2nd arg)"): Add test cases.

2011-04-11  Andy Wingo  <wingo@pobox.com>

	fix reader.test for --disable-deprecated
	* test-suite/tests/reader.test: Fix deprecated tests; begin-deprecated
	  was splicing in expression context before, which is a no-no.

	regen psyntax-pp.scm
	* module/ice-9/psyntax-pp.scm: Regenerate, to take advantage of better
	  #{}# serialization.

2011-04-11  Andy Wingo  <wingo@pobox.com>

	symbols with odd characters print better in #{}#
	* libguile/print.c (symbol_has_extended_read_syntax): Use a more
	  general, unicode-appropriate algorithm.  Hopefully doesn't cause
	  any current #{}# cases to be unescaped.
	  (print_extended_symbol): Use more appropriate unicode algorithm, and
	  emit unicode hex escapes instead of our own lame escapes.

	* test-suite/tests/symbols.test: Add tests.

2011-04-11  Andy Wingo  <wingo@pobox.com>

	read-extended-symbol handles backslash better, including r6rs hex escapes
	* libguile/read.c (scm_read_extended_symbol): Interpret '\' as an escape
	  character.  Due to some historical oddities we have to support '\'
	  before any character, but since we never emitted '\' in front of
	  "normal" characters like 'x' we can interpret "\x..;" to be an R6RS
	  hex escape.

	* test-suite/tests/reader.test ("#{}#"): Add tests.

2011-04-11  Andy Wingo  <wingo@pobox.com>

	refactor scm_i_print_symbol_name
	* libguile/print.c (symbol_has_extended_read_syntax)
	  (print_normal_symbol, print_extended_symbol, scm_i_print_symbol_name):
	  Factor scm_i_print_symbol_name into separate routines.  Add comments.
	  There are a number of bugs here.

	ignore SIGPIPE in (system repl server)
	* module/system/repl/server.scm (run-server): Ignore SIGPIPE when we run
	  a server, as otherwise a rudely disconnected client could cause the
	  server to quit.  Thanks to John Proctor for the report, and Detlev
	  Zundel for the debugging.

2011-04-09  Mark H Weaver  <mhw@netris.org>

	Fix the R6RS exact-integer-sqrt and import into core guile
	* libguile/numbers.c (scm_exact_integer_sqrt): New C procedure to
	  compute exact integer square root and remainder.
	  (scm_i_exact_integer_sqrt): New Scheme procedure `exact-integer-sqrt'
	  from the R6RS, imported into core guile.

	* libguile/numbers.h: Add prototypes.

	* module/rnrs/base.scm: Remove broken stub implementation, which would
	  fail badly when applied to large integers.

	* doc/ref/api-data.texi: Add documentation.

	* doc/ref/r6rs.texi: Change documentation for `exact-integer-sqrt' to a
	  stub that xrefs the core docs, as is done for other operations
	  available in core.

	* test-suite/tests/numbers.test: Add tests.

	* NEWS: Add news entries.

2011-04-08  Andreas Rottmann  <a.rottmann@gmx.at>

	Implement R6RS' `fixnum?' in a smarter way
	* module/rnrs/arithmetic/fixnums.scm (fixnum?): Implemented using
	  bit-twiddling, and using `define-inlinable'.

2011-04-07  Mark H Weaver  <mhw@netris.org>

	Fix typo in arithmetic benchmark
	* benchmark-suite/benchmarks/arithmetic.bm (fixnum): Fix `-' benchmark
	  to actually use `-' operator instead of `+' operator.

2011-04-07  Andreas Rottmann  <a.rottmann@gmx.at>

	Move `define-inlinable' into the default namespace
	* module/ice-9/boot-9.scm (define-inlineable): Moved here from SRFI-9.
	* module/srfi/srfi-9 (define-inlinable): Removed here.

	* doc/ref/api-procedures.texi (Inlinable Procedures): Add subsection
	  about `define-inlinable'.

2011-04-07  Mark H Weaver  <mhw@netris.org>

	Fix parsing of exact numbers with negative exponents
	* libguile/numbers.c (mem2decimal_from_point): Use scm_divide instead of
	  scm_divide2real when applying a negative exponent, to preserve
	  exactness in case the "#e" forced exactness specifier is present.
	  This fixes a bug where numeric literals such as "#e1e-5" yielded
	  incorrect fractions.

2011-04-06  Mark H Weaver  <mhw@netris.org>

	Doc fix: quotient/remainder/modulo do not require exact arguments
	* doc/ref/api-data.texi (Arithmetic): `floor-remainder' is equivalent to
	  the R5RS `modulo' when the arguments are integers.  Previously,
	  equivalence was claimed only for exact integers.  Similarly for
	  `truncate-quotient' and `truncate-remainder' compared with the R5RS
	  `quotient' and `remainder'.

	Undeprecate read syntax for uniform complex vectors
	* libguile/read.c (scm_read_sharp): Move the "#c..." case outside of
	  #if SCM_ENABLE_DEPRECATED, and to the same section which handles
	  "#s...", "#u..." and "#f...".
	  Thanks to Andreas Rottmann <a.rottmann@gmx.at> for the bug report.

2011-04-04  Andreas Rottmann  <a.rottmann@gmx.at>

	Several optimizations for R6RS fixnum arithmetic
	* module/rnrs/arithmetic/fixnums.scm (assert-fixnum): Is now a
	  macro.
	  (assert-fixnums): New procedure checking a the elements of a list
	  for fixnum-ness.  All callers applying `assert-fixnum' to a list
	  now changed to use this procedure.

	* module/rnrs/arithmetic/fixnums.scm (define-fxop*): New for defining
	  n-ary inlinable special-casing the binary case using `case-lambda'.
	  All applicable procedures redefined using this macro.

	* module/rnrs/arithmetic/fixnums.scm: Alias all predicates to
	  their non-fixnum counterparts.

2011-04-04  Andreas Rottmann  <a.rottmann@gmx.at>

	Add a few benchmarks for R6RS fixnum arithmetic
	* benchmark-suite/benchmarks/r6rs-arithmetic.bm: New file containing
	  some benchmarks for R6RS fixnum operations.
	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
	  benchmarks/r6rs-arithmetic.

2011-04-03  Andy Wingo  <wingo@pobox.com>

	pthread-threads.h: only redirect to GC_pthread_sigmask if it is present
	* configure.ac: Check for pthread_sigmask.
	* libguile/gen-scmconfig.c: Create SCM_HAVE_GC_PTHREAD_SIGMASK.
	* libguile/pthread-threads.h (scm_i_pthread_sigmask): Only redirect to
	  GC_pthread_sigmask if GC_pthread_sigmask is present.

2011-04-01  Andy Wingo  <wingo@pobox.com>

	fix c32vector-set!, c64vector-set!
	* module/srfi/srfi-4/gnu.scm (bytevector-c32-native-set!):
	  (bytevector-c64-native-set!): Fix to actually allow complex numbers.

	* test-suite/tests/srfi-4.test: Add tests.

2011-04-01  Andy Wingo  <wingo@pobox.com>

	string->pointer and pointer->string have optional encoding arg
	* test-suite/tests/foreign.test ("pointer<->string"): Add test cases.

	* libguile/foreign.c (scm_string_to_pointer, scm_pointer_to_string): Add
	  optional encoding, and in the pointer->string case, length arguments.

	* libguile/foreign.h: Update prototypes of internal functions.
	  Shouldn't affect ABI as they are internal.

	* doc/ref/api-foreign.texi (Void Pointers and Byte Access): Update
	  docs.

2011-04-01  Andy Wingo  <wingo@pobox.com>

	support loading objcode even if mmap(2) is unavailable
	* configure.ac: Check for sys/mman.h.

	* libguile/objcodes.c (verify_cookie): Factor cookie verification out to
	  a helper function.
	  (make_objcode_from_file): Rename from make_objcode_by_mmap.  If mmap
	  is unavailable, just read(2) to a bytevector.

2011-04-01  Andy Wingo  <wingo@pobox.com>

	make_objcode_by_mmap uses MAP_PRIVATE, not MAP_SHARED
	* libguile/objcodes.c (make_objcode_by_mmap): MAP_PRIVATE, not
	  MAP_SHARED -- we don't need to update the underlying file, nor do we
	  need to see updates.

	latin1 subr and message in internal scm_{encoding,decoding}_error
	* libguile/strings.c (scm_encoding_error, scm_decoding_error): Use
	  scm_from_latin1_string for the subr and message args, as these are
	  internal functions, and we know their callers.

2011-03-31  Andy Wingo  <wingo@pobox.com>

	fix duplicate path in uninstalled-env
	* meta/uninstalled-env.in: Our code that checked for paths already being
	  in the load path was not working for the last entry in the load path.
	  This caused the last entry to be re-added to the beginning, which also
	  caused relative filename canonicalization to prepend "module/" to
	  everything.

	  Terrible.

2011-03-31  Kevin Fletcher  <kevinjohn.fletcher@gmail.com>

	fix gc_register_my_thread et al fallback impls
	* libguile/threads.c (GC_register_my_thread, GC_get_stack_base): Fix
	  fallback impls.

2011-03-31  Andy Wingo  <wingo@pobox.com>

	web.texi: handler return types documentation
	* doc/ref/web.texi (Web Server): More docs on handler return types.

	web.texi: fix uri->string invocation
	* doc/ref/web.texi (Web Examples): Fix uri->string invocation.  Thanks
	  to Romel Sandoval for the report.

2011-03-31  Andy Wingo  <wingo@pobox.com>

	fix problems detecting coding: in block comments
	* libguile/read.c (scm_i_scan_for_encoding): Fix for coding on first
	  line #! and for !# immediately following the coding.

	* test-suite/Makefile.am:
	* test-suite/tests/coding.test: Add tests.

2011-03-31  Andy Wingo  <wingo@pobox.com>

	inline fxops in psyntax
	* module/ice-9/psyntax.scm (fx+, fx-, fx=, fx<): Given our lame lack of
	  an inliner, inline these manually with identifier syntax.

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

2011-03-31  Andy Wingo  <wingo@pobox.com>

	allow definitions in with-syntax body
	* module/ice-9/psyntax.scm (with-syntax): Allow definitions in the body,
	  as seems to be suggested by the R6RS.

	* test-suite/tests/syncase.test ("with-syntax"): Add test.

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

2011-03-31  Michael Gran  <spk121@yahoo.com>

	More descriptive error for dynamic-pointer
	* libguile/dynl.c (sysdep_dynl_value): Failure to find a symbol is not
	  an error, so raise our own, more appropriate error.

	* test-suite/tests/foreign.test ("dynamic-pointer"): Add a test.

2011-03-30  Andy Wingo  <wingo@pobox.com>

	with-continuation-barrier calls exit(3) _after_ unwinding
	* libguile/continuations.c (scm_handler, c_handler)
	  (scm_c_with_continuation_barrier, scm_with_continuation_barrier):
	  Instead of calling scm_handle_by_message_noexit in the pre-unwind
	  handler, roll our own exception printing in the pre-unwind, and do to
	  exit()-on-quit in the post-unwind handler.  This lets the stack unwind
	  at exit-time so that pending dynwinds run.

	* test-suite/tests/continuations.test ("continuations"): Add a test.

2011-03-30  Michael Gran  <spk121@yahoo.com>

	don't GC unregister null thread
	GC_unregister_my_thread is only supposed to be called from
	a thread other than the main thread, so, it should never be
	called when the system is compiled with null threads.

	* libguile/threads.c (on_thread_exit)[SCM_USE_NULL_THREADS]: don't
	    call GC_unregister_my_thread

2011-03-30  Michael Gran  <spk121@yahoo.com>

	check for GC_allow_register_threads
	This is not present in earlier versions of BDW-GC

	* configure.ac: check for GC_allow_register_threads
	* libguile/threads.c (scm_i_init_thread_for_guile): Only call
	  GC_allow_register_threads if it is present.

2011-03-29  Ludovic Courtès  <ludo@gnu.org>

	Fix `procedure->pointer' for functions returning `void'.
	* libguile/foreign.c (unpack): Handle `FFI_TYPE_VOID'.

	* test-suite/tests/foreign.test ("procedure->pointer")["procedures
	  returning void"]: New test.  Reported by
	  Tristan Colgate <tcolgate@gmail.com>.

2011-03-29  Andy Wingo  <wingo@pobox.com>

	fix prompt and abort with the boot evaluator
	* libguile/control.h:
	* libguile/control.c (scm_i_prompt_pop_abort_args_x): Take a VM instead
	  of a prompt, given that it's the VM's registers that record the abort
	  arguments, not the prompt registers (which actually point right below
	  the abort values).

	* libguile/eval.c (eval):
	* libguile/throw.c (pre_init_catch): Pass the vm instead of a prompt.

2011-03-29  Andy Wingo  <wingo@pobox.com>

	fix compilation with libgc 7.0, 7.1
	* configure.ac: Check for GC_pthread_exit and GC_pthread_cancel.

	* libguile/gen-scmconfig.c: Write HAVE_GC_PTHREAD_CANCEL and
	  HAVE_GC_PTHREAD_EXIT into scmconfig.h.

	* libguile/pthread-threads.h (scm_i_pthread_exit, scm_i_pthread_cancel):
	  Only redefine to their GC_pthread_* variants if we have those
	  functions, which is not the case in libgc < 7.2.

2011-03-29  Andy Wingo  <wingo@pobox.com>

	fix error message on ,disassemble "non-procedure"
	* module/language/objcode/spec.scm (decompile-value): Don't assume that
	  `error' will handle format strings appropriately.
	* module/system/repl/command.scm (disassemble): A more human error when
	  you disassemble a non-procedure.

	Bug reported by Andrew Horton.

2011-03-29  Andy Wingo  <wingo@pobox.com>

	document -q, repl options
	* doc/ref/scheme-scripts.texi (Invoking Guile): Document -q.
	* doc/ref/scheme-using.texi (Init File): New section, on .guile.
	  (Readline): Link to Init File.
	  (System Commands): Document the various REPL options, and
	  repl-default-option-set!.

	rewrite ensure-writable-dir to not be racy
	* module/system/base/compile.scm (ensure-writable-dir): Rewrite to not
	  be racy.

2011-03-27  Andy Wingo  <wingo@pobox.com>

	fix prompt in fix in single-value context compilation
	* module/language/tree-il/compile-glil.scm (flatten): When compiling a
	  <prompt> in push context with an RA, after the body returns normally,
	  jump to that RA instead of to our POST label (which in that case does
	  not need to be emitted).  Fixes a tail <prompt> in a push <fix>.

	* test-suite/tests/control.test ("prompt in different contexts"): Add
	  more test cases.

2011-03-27  Andy Wingo  <wingo@pobox.com>

	tree-il->scheme fix
	* module/language/tree-il.scm (tree-il->scheme): Fix <prompt> to Scheme
	  serialization.

2011-03-27  Noah Lavine  <nlavine@haverford.edu>

	Document SRFI-23
	 * doc/ref/srfi-modules.texi: mention that we support SRFI 23
	 * module/ice-9/boot-9.scm (%cond-expand-features): add srfi-23

2011-03-26  Bruno Haible  <bruno@clisp.org>

	Update comment about uc_locale_language.
	* libguile/i18n.c (locale_language): Update comment.

2011-03-26  Andy Wingo  <wingo@pobox.com>

	fix stexi->html double translation
	* module/texinfo/html.scm (entry): Fix to avoid double translation:
	  arg-req already pulls an stexi->shtml on its arg.

	fix (texinfo reflection) to handle nested structures like syntax patterns
	* module/texinfo/reflection.scm (process-args): Convert any arg to a
	  string.  "Fixes" documentation of syntax-rules patterns.

2011-03-25  Neil Jerram  <neil@ossau.uklinux.net>

	Remove statements about scripts/* that are no longer true
	* doc/ref/tools.texi (Executable Modules): Say "guile-tools modules"
	  instead of "executable modules".  Remove obsolete statements about
	  not ending in .scm, being executable, and beginning with shell
	  script invocation sequence.

	* module/scripts/README: Ditto.

2011-03-25  Neil Jerram  <neil@ossau.uklinux.net>

	Inline the effect of am/pre-inst-guile
	It's just one variable definition, and in my opinion it confuses,
	rather than helps, the overall build picture to have two names
	(preinstguile and meta/guile) for the same thing.

	* am/Makefile.am (am_frags): Remove pre-inst-guile.

	* am/pre-inst-guile: Deleted.

	* doc/ref/Makefile.am: Don't include am/pre-inst-guile.
	  ($(snarf_doc).am, $(snarf_doc).texi): Expand $(preinstguile).

	* module/Makefile.am (ice-9/psyntax-pp.scm.gen): Don't include
	  am/pre-inst-guile.
	  (ice-9/psyntax-pp.scm.gen): Expand $(preinstguile).

2011-03-25  Neil Jerram  <neil@ossau.uklinux.net>

	Make explicit that GUILE_FOR_BUILD is only used when cross-compiling
	* configure.ac (GUILE_FOR_BUILD): Change normal build value to
	  'this-value-will-never-be-used'.

	GUILE_FOR_BUILD is only needed by meta/guile.in, not by Makefiles
	* configure.ac: Use AM_SUBST_NOTMAKE for GUILE_FOR_BUILD instead of
	  AC_SUBST.

	Remove unused definition of preinstguiletool
	* am/pre-inst-guile (preinstguiletool): Removed.

2011-03-25  Andy Wingo  <wingo@pobox.com>

	avoid running GC when SCM_I_CURRENT_THREAD is unset
	* libguile/threads.c (guilify_self_1): Prevent finalizers from running
	  before SCM_I_CURRENT_THREAD is set.
	  (do_thread_exit_trampoline): Leave the thread in the registered state.
	  (on_thread_exit): Always unregister the thread here.

2011-03-25  Andy Wingo  <wingo@pobox.com>

	threading / with_guile refactor to use more GC_stack_base
	* libguile/init.h:
	* libguile/init.c (scm_i_init_guile): Change arg to this internal
	  function from SCM_STACKITEM* to void*.  Actually it's a
	  struct GC_stack_base*.

	* libguile/bdw-gc.h: Don't do pthread redirects, because we don't want
	  to affect applications' pthread_* bindings.

	* libguile/pthread-threads.h (scm_i_pthread_create)
	  (scm_i_pthread_detach, scm_i_pthread_exit, scm_i_pthread_cancel)
	  (scm_i_pthread_sigmask): Do pthread redirects here, in this internal
	  header.

	* libguile/threads.h: Remove declaration of internal
	  scm_i_with_guile_and_parent.  Remove declaration of undefined
	  scm_threads_init_first_thread.  Make declaration of internal
	  scm_threads_prehistory actually internal, and take a void* (actually a
	  struct GC_stack_base*).

	* libguile/threads.c (GC_get_stack_base): Implement a shim if this
	  function is unavailable, and fold in the implementations of
	  get_thread_stack_base.
	  (GC_call_with_stack_base): Actually implement.
	  (guilify_self_1): Take a GC_stack_base* as an arg.
	  (scm_i_init_thread_for_guile): Likewise, and set up libgc for
	  registration of other threads.
	  (scm_init_guile): Use GC_get_stack_base instead of our own guesswork.
	  (with_guile_and_parent, scm_i_with_guile_and_parent): Rework to
	  trampoline through a GC_call_with_stack_base.
	  (scm_threads_prehistory): Pass the "base" arg on to guilify_self_1.

2011-03-25  Andy Wingo  <wingo@pobox.com>

	Revert "with-continuation-barrier carps, calls exit(3) _after_ unwinding"
	This reverts commit ecba00af6501e082b86c8f2f7730081c733509d7.

2011-03-24  Andy Wingo  <wingo@pobox.com>

	bdw-gc 6.8 compatibility (hopefully)
	* configure.ac (HAVE_GC_STACK_BASE): New check.

	* libguile/threads.c (GC_UNIMPLEMENTED, GC_SUCCESS): Define if needed.
	  (GC_register_my_thread, GC_unregister_my_thread)
	  (GC_call_with_stack_base): Define shims if needed.

2011-03-24  Andy Wingo  <wingo@pobox.com>

	with-continuation-barrier carps, calls exit(3) _after_ unwinding
	* libguile/continuations.c (scm_handler, c_handler)
	  (scm_c_with_continuation_barrier, scm_with_continuation_barrier): Call
	  scm_handle_by_message_noexit in the post-unwind handler, so that
	  dynwinds

	* test-suite/tests/continuations.test ("continuations"): Add a test.

2011-03-23  Andy Wingo  <wingo@pobox.com>

	fix a failure to sync regs in vm bytevector ops
	* libguile/vm-i-scheme.c (BV_SET_WITH_ENDIANNESS, BV_FIXABLE_INT_SET)
	  (BV_INT_SET, BV_FLOAT_SET): Sync registers before dispatching to the C
	  function.

2011-03-22  Mark H Weaver  <mhw@netris.org>

	Do not enter the debugger if the thrown key is in `pass-keys'
	* module/system/repl/error-handling.scm (call-with-error-handling):
	  Do _not_ enter the debugger if the thrown key is in `pass-keys'.
	  Previously, for example, (throw 'quit) entered the debugger when run
	  from the REPL, despite the fact that 'quit is in `pass-keys'.

2011-03-20  Ludovic Courtès  <ludo@gnu.org>

	Make VM string literals immutable.
	* libguile/strings.c (scm_i_make_string, scm_i_make_wide_string): Add
	  `read_only_p' parameter.  All callers updated.

	* libguile/vm-i-loader.c (load_string, load_wide_string): Push read-only
	  strings.

	* test-suite/tests/strings.test ("literals"): New test prefix.

2011-03-20  BT Templeton  <bpt@hcoop.net>

	fix guile-snarf
	* libguile/snarf.h: New macro `SCM_SNARF_INIT_PREFIX'. (SCM_SNARF_INIT)
	  Use `SCM_SNARF_INIT_PREFIX' instead of including a literal marker. If
	  the preprocessor echoes #define directives to its output, this will
	  prevent `guile-snarf' from snarfing the `SCM_SNARF_INIT' definition
	  itself. Reported by Mike Gran <spk121@yahoo.com>.
	* libguile/guile-snarf.in (modern_snarf): Don't output anything for
	  lines in which only one of the magic snarfing markers is present.
	  Modify the `sed' program for compatibility with POSIX `sed'. The new
	  `sed' program is based on a version by Wolfgang Jenkner
	  <wjenkner@inode.at>.
	* test-suite/standalone/test-guile-snarf: New tests.

2011-03-20  Andreas Rottmann  <a.rottmann@gmx.at>

	Add VM test for call/cc in non-tail position
	* test-suite/vm/t-call-cc.scm: Add test case using call/cc in a non-tail
	  position.

	Fix syntax error in benchmark-suite/Makefile.am
	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Correct position of
	  a trailing backslash.

2011-03-19  Michael Gran  <spk121@yahoo.com>

	Benchmarks for string comparisons
	* benchmark-suite/benchmarks/strings.bm: new file
	* benchmark-suite/Makefile.am: add strings.bm

2011-03-19  Andy Wingo  <wingo@pobox.com>

	fix new-frame push in call/cc
	* libguile/vm-i-system.c (call/cc): Whoops, fix the new-frame push
	  here.  A little birdie tells me a test case is coming soon.

2011-03-18  Andy Wingo  <wingo@pobox.com>

	fix thread cleanup
	* libguile/threads.h: Always declare a scm_i_thread_key, for cleanup
	  purposes, in the BUILDING_LIBGUILE case.

	* libguile/threads.c (scm_i_thread_key): Init with a cleanup handler, so
	  any guile-specific info for a thread can be cleaned up reliably.
	  (guilify_self_1): Always set the thread key.
	  (do_thread_exit_trampoline, on_thread_exit): Enter guile-mode for the
	  guile-mode cleanup handler, and trampoline through a
	  gc_call_with_stack_base for reasons explained in the code.
	  (init_thread_key, scm_i_init_thread_for_guile): Always init the key.
	  (scm_i_with_guile_and_parent): No need for pthread_cancel cleanup
	  handlers, as the pthread key destructor will take care of that for
	  us.
	  (really_launch): Remove needless pthread_exit call with incorrect
	  comment.

2011-03-18  Ludovic Courtès  <ludo@gnu.org>

	Fix `i18n.test' when the German or Greek locales aren't available.
	* test-suite/tests/i18n.test (%german-utf8-locale, %greek-utf8-locale):
	  New variables.
	  (under-german-utf8-locale-or-unresolved,
	  under-greek-utf8-locale-or-unresolved): Use them.

2011-03-17  Ludovic Courtès  <ludo@gnu.org>

	i18n: Add case mapping and case-insensitive string comparison tests.
	Thanks to Mark H Weaver <mhw@netris.org> for coming up with most of the
	examples.

	* test-suite/tests/i18n.test (%german-utf8-locale-name,
	  %greek-utf8-locale-name): New variables.
	  (under-german-utf8-locale-or-unresolved,
	  under-greek-utf8-locale-or-unresolved): New procedures.
	  ("text collation (German)", "text collation (Greek)"): New tests
	  prefixes.
	  ("string mapping")["string-locale-upcase German",
	  "string-locale-upcase Greek", "string-locale-upcase Greek (two
	  sigmas)", "string-locale-downcase Greek", "string-locale-downcase
	  Greek (two sigmas)"]: New tests.

2011-03-17  Ludovic Courtès  <ludo@gnu.org>

	i18n: Re-enable tests with the Turkish locale.
	* test-suite/tests/i18n.test ("character mapping")["char-locale-upcase
	  Turkish", "char-locale-downcase Turkish"]: Re-enable.  Passes with
	  GNU libc 2.12.1.
	  ("string mapping")["string-locale-upcase Turkish",
	  "string-locale-downcase Turkish"]: Likewise.

2011-03-17  Andy Wingo  <wingo@pobox.com>

	add multibyte regexp test
	* test-suite/standalone/Makefile.am:
	* test-suite/standalone/test-mb-regexp: New test, that the previous
	  patch fixed the abort() on fixup_multibyte_match.

2011-03-17  Andy Wingo  <wingo@pobox.com>

	scm_{to,from}_locale_string use current locale, not current ports
	* libguile/strings.c (scm_to_locale_stringn, scm_from_locale_stringn):
	  Use the encoding of the current locale, not of the current i/o ports.
	  Also use the current conversion strategy.

	* doc/ref/api-data.texi (Conversion to/from C): Update docs.

2011-03-17  Andy Wingo  <wingo@pobox.com>

	allow ,option on-error report instead of debug
	* module/system/repl/command.scm:
	* module/system/repl/debug.scm (terminal-width): Move terminal-width
	  here, make it thread-local, and export it.
	  (print-locals, print-frame, print-frames): Default width to
	  terminal-width.

	* module/system/repl/error-handling.scm (call-with-error-handling): Add
	  `report' and `backtrace' on-error handlers.

	* module/system/repl/common.scm (repl-default-options): Add on-error
	  REPL option, defaulting to `debug', but which may be changed.

	* module/system/repl/repl.scm (run-repl): Pass the #:on-error REPL
	  option to call-with-error-handling.

2011-03-17  Andy Wingo  <wingo@pobox.com>

	add heap-allocated-since-gc to gc-stats
	* libguile/gc.c (scm_gc_stats): Use add bytes_since_gc to the alist,
	  under "heap-allocated-since-gc", and remove dead code.

2011-03-17  Andy Wingo  <wingo@pobox.com>

	fix code that causes warnings on gcc 4.6
	* libguile/arrays.c (scm_i_read_array):
	* libguile/backtrace.c (display_backtrace_body):
	* libguile/filesys.c (scm_readdir)
	* libguile/i18n.c (chr_to_case):
	* libguile/ports.c (register_finalizer_for_port):
	* libguile/posix.c (scm_nice):
	* libguile/stacks.c (scm_make_stack): Clean up a number of
	  set-but-unused vars.  Thanks to Douglas Mencken for the report.

	* libguile/numbers.c (scm_log, scm_exp): Fix a few #if cases that should
	  be #ifdef.

2011-03-17  Andy Wingo  <wingo@pobox.com>

	add pointer->scm, scm->pointer
	* libguile/foreign.c (scm_pointer_to_scm, scm_scm_to_pointer): New
	  functions, useful to pass and receive SCM values to and from foreign
	  functions.

	* module/system/foreign.scm: Export the new functions.

	* doc/ref/api-foreign.texi (Foreign Variables): Add docs.

	* test-suite/tests/foreign.test ("pointer<->scm"): Tests.

2011-03-15  Andy Wingo  <wingo@pobox.com>

	add more prompt/abort tests
	* test-suite/tests/control.test: Use c&e tests for most test blocks.
	  Note that this did not catch the recent bug.
	  ("reified continuations"): Add a new test for capturing partial
	  continuations containing pending call frames.  Before these would
	  contain dynamic links pointing out of the continuation segment, which
	  would not be relocated; now, the dynamic links are only made when the
	  frames are activated.

	  Thanks to Wolfgang J Moeller for the bug report and test case.

2011-03-15  Andy Wingo  <wingo@pobox.com>

	fix frame dynamic linkage in the face of partial continuation application
	* libguile/vm-i-system.c (new-frame): Though it was appealing to set the
	  dynamic link here on the incomplete frame, we no longer do that, for
	  the reasons mentioned in the code.
	  (call, mv-call): Adapt to set the frame's dynamic link.

	* libguile/vm-engine.c (vm_engine): Don't set dynamic link here, even
	  for boot program.

	* libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref)
	  (scm_frame_local_set_x): Fix up not-yet-active frame detection.

2011-03-13  Ludovic Courtès  <ludo@gnu.org>

	doc: Remove "lack of support for Unicode I/O and strings".
	* doc/ref/api-io.texi (R6RS I/O Ports): Remove 1.8ish comment.

2011-03-13  Andreas Rottmann  <a.rottmann@gmx.at>

	Enhance transcoder-related functionality of `(rnrs io ports)'
	* module/rnrs/io/ports.scm (transcoder-eol-style)
	  (transcoder-error-handling-mode): Export these.
	  (textual-port?): Implement this procedure and export it.
	* module/rnrs.scm: Export these here as well.

	* module/rnrs/io/ports.scm (port-transcoder): Implement this procedure.
	  (binary-port?): Treat only ports without an encoding as binary ports,
	  add docstring.
	  (standard-input-port, standard-output-port, standard-error-port):
	  Ensure these are created without an encoding.
	  (eol-style): Add `none' as enumeration member.
	  (native-eol-style): Switch to `none' from `lf'.

	* test-suite/tests/r6rs-ports.test (7.2.7 Input ports)
	  (8.2.10 Output ports): Test binary-ness of `standard-input-port',
	  `standard-output-port' and `standard-error-port'.
	  (8.2.6 Input and output ports): Add test for `port-transcoder'.

2011-03-13  Andreas Rottmann  <a.rottmann@gmx.at>

	Export `current-*-port' from `(rnrs io ports)'
	* module/rnrs/io/ports.scm: Export `current-input-port',
	  `current-output-port' and `current-error-port' (see R6RS 8.2.7 "Input
	  ports" and 8.2.10 "Output ports").

2011-03-13  Andreas Rottmann  <a.rottmann@gmx.at>

	Add `get-string-n' and `get-string-n!' for R6RS ports
	* libguile/r6rs-ports.c (scm_get_string_n_x): Implement `get-string-n!'
	  in C for efficiency.
	* libguile/r6rs-ports.h: Add prototype for this function.
	* module/ice-9/binary-ports.scm: Export `get-string-n!'.

	* module/rnrs/io/ports.scm (get-string-n): Implement based on
	  `get-string-n!'.
	  Export both `get-string-n!' and `get-string-n'.
	* module/rnrs.scm: Also export these.

	* test-suite/tests/r6rs-ports.test (8.2.9 Textual input): Add a few
	  tests for `get-string-n' and `get-string-n!'.

2011-03-13  Ludovic Courtès  <ludo@gnu.org>

	Work around weak-value hash table bug in `define-wrapped-pointer-type'.
	* module/system/foreign.scm (define-wrapped-pointer-type)[wrap]: Use
	  `hash-ref' and `hash-set!' instead of `hash-create-handle!' and
	  `set-cdr!'.

2011-03-11  Ludovic Courtès  <ludo@gnu.org>

	Fix `define-inlinable' in SRFI-9 so that arguments are evaluated only once.
	* module/srfi/srfi-9.scm (define-inlinable): When inlining, evaluate the
	  arguments only once.  Reported by Andreas Rottmann; thanks to Andy
	  Wingo for the elegant solution.

	* test-suite/tests/srfi-9.test ("side-effecting arguments"): New test
	  prefix.

2011-03-11  Andy Wingo  <wingo@pobox.com>

	fix port-filename without readline to match the docs
	* libguile/init.c (stream_body, scm_standard_stream_to_port): Don't name
	  stdin, stdout, and stderr -- at least not as strings.  That confuses
	  any code which tries to treat port-filename as a real filename, like
	  the syntax expander, or the `load' procedure/macro.  Also this
	  behavior matches the docs now.

2011-03-10  Mark H Weaver  <mhw@netris.org>

	Fix bug to make `string=' much faster
	* libguile/srfi-13.c (scm_string_eq): Fix a bug which caused the slow
	  general string_compare function to be used for strings of unequal
	  lengths.

2011-03-10  Ludovic Courtès  <ludo@gnu.org>

	Thanks, Aidan.

2011-03-10  Ludovic Courtès  <ludo@gnu.org>

	FFI: Return the right alignment for structures.
	* libguile/foreign.c (scm_alignof): Fix handling of structure alignment.
	  Reported by Aidan Gauland <aidalgol@no8wireless.co.nz>.

	* test-suite/tests/foreign.test ("structs")["alignof { int8, double,
	  int8 }", "int8, { int8, double, int8 }, int16"]: New tests.

2011-03-09  Mark H Weaver  <mhw@netris.org>

	Update Gnulib; add new modules; remove `round' module.
	This updates Gnulib to v0.0-4951-g6ff7b70.

	* m4/gnulib-cache.m4: Add floor, ceil, frexp, and ldexp.  Add wchar as
	  an explicit dependency; it had been present as an indirect dependency
	  before, but no longer.  Remove round, which I had requested earlier,
	  but turned out to be unnecessary.

2011-03-09  Andy Wingo  <wingo@pobox.com>

	fix-letrec tweaks
	* module/language/tree-il/fix-letrec.scm (partition-vars): Previously,
	  for letrec* we treated all unreferenced vars as complex, because of
	  orderings of effects that could arise in their definitions.  But we
	  can actually keep simple and lambda vars as unreferenced, as their
	  initializers cannot cause side effects.
	  (fix-letrec!): Remove letrec* -> letrec code, as it's unneeded.

2011-03-09  Andreas Rottmann  <a.rottmann@gmx.at>

	Don't mix definitions and expressions in SRFI-9
	The expansion of `define-inlinable' contained an expression, which made
	SRFI-9's `define-record-type' fail in non-toplevel contexts ("definition
	used in expression context").

	* module/srfi/srfi-9.scm (define-inlinable): Get rid of apparently
	  useless expression in the expansion, so the expansion yields only
	  definitions.  At the same time, use a space in the generated names to
	  lessen the chances of name conflicts, also avoiding -Wunused-toplevel
	  warnings.
	* test-suite/tests/srfi-9.test (non-toplevel): New test verifying that
	  `define-record-type' works in non-toplevel context as well.
	* doc/ref/srfi-modules.texi (SRFI-9 - define-record-type): Add
	  subsubsection noting that Guile does not enforce top-levelness.

2011-03-09  Mark H Weaver  <mhw@netris.org>

	Add scm_from_latin1_keyword and scm_from_utf8_keyword
	* libguile/keywords.c (scm_from_latin1_keyword, scm_from_utf8_keyword):
	  New functions appropriate for use when keyword name is a constant.

	  (scm_from_locale_keyword, scm_from_locale_keywordn): Change formal
	  parameter from `str' to `name'.

	* libguile/keywords.h: Add prototypes for new functions.  Change formal
	  parameter of scm_from_locale_keyword* from `str' to `name'.

	* doc/ref/api-data.texi: Document new functions.  Remind users that
	  scm_from_locale_keyword should not be used when the name is a C string
	  constant.  Change formal parameter from `str' to `name'.

2011-03-09  Mark H Weaver  <mhw@netris.org>

	Add scm_from_latin1_keyword and scm_from_utf8_keyword
	* libguile/keywords.c (scm_from_latin1_keyword, scm_from_utf8_keyword):
	  New functions appropriate for use when keyword name is a constant.

	  (scm_from_locale_keyword, scm_from_locale_keywordn): Change formal
	  parameter from `str' to `name'.

	* libguile/keywords.h: Add prototypes for new functions.  Change formal
	  parameter of scm_from_locale_keyword* from `str' to `name'.

	* doc/ref/api-data.texi: Document new functions.  Remind users that
	  scm_from_locale_keyword should not be used when the name is a C string
	  constant.  Change formal parameter from `str' to `name'.

2011-03-09  Mark H Weaver  <mhw@netris.org>

	Improve docs of string and symbol conversions from C strings
	* doc/ref/api-data.texi (Conversion to/from C): Document
	  scm_from_latin1_string, scm_from_utf8_string, and
	  scm_from_utf32_string.  Remind readers that these functions should be
	  used to convert C string constants, and that scm_from_locale_string is
	  _not_ appropriate for that purpose.

	  (Symbol Primitives): Document scm_from_latin1_symbol and
	  scm_from_utf8_symbol.  Remind readers that these functions should be
	  used when the specified names are C string constants, and that
	  scm_from_locale_symbol is _not_ appropriate for that purpose.

2011-03-09  Mark H Weaver  <mhw@netris.org>

	Improve docs of string and symbol conversions from C strings
	* doc/ref/api-data.texi (Conversion to/from C): Document
	  scm_from_latin1_string, scm_from_utf8_string, and
	  scm_from_utf32_string.  Remind readers that these functions should be
	  used to convert C string constants, and that scm_from_locale_string is
	  _not_ appropriate for that purpose.

	  (Symbol Primitives): Document scm_from_latin1_symbol and
	  scm_from_utf8_symbol.  Remind readers that these functions should be
	  used when the specified names are C string constants, and that
	  scm_from_locale_symbol is _not_ appropriate for that purpose.

2011-03-09  Mark H Weaver  <mhw@netris.org>

	Within `while', `continue' takes zero arguments
	* module/ice-9/boot-9.scm (while): Report an error if `continue' is
	  passed one or more arguments.  Previously, it would report an error if
	  `(continue arg rest ...)' was found within the `while', but not if
	  `continue' was found bare and later applied to one or more arguments,
	  e.g. `(apply continue (list arg rest ...))'.

2011-03-09  Mark H Weaver  <mhw@netris.org>

	Quotient, remainder and modulo accept inexact integers
	* libguile/numbers.c (scm_quotient, scm_remainder, scm_modulo): Accept
	  inexact integers as well as exact ones, as required by the R5RS.

	* test-suite/tests/numbers.test (quotient, remainder, modulo): Add tests.

2011-03-09  Mark H Weaver  <mhw@netris.org>

	Within `while', `continue' takes zero arguments
	* module/ice-9/boot-9.scm (while): Report an error if `continue' is
	  passed one or more arguments.  Previously, it would report an error if
	  `(continue arg rest ...)' was found within the `while', but not if
	  `continue' was found bare and later applied to one or more arguments,
	  e.g. `(apply continue (list arg rest ...))'.

2011-03-09  Mark H Weaver  <mhw@netris.org>

	Quotient, remainder and modulo accept inexact integers
	* libguile/numbers.c (scm_quotient, scm_remainder, scm_modulo): Accept
	  inexact integers as well as exact ones, as required by the R5RS.

	* test-suite/tests/numbers.test (quotient, remainder, modulo): Add tests.

2011-03-08  Mark H Weaver  <mhw@netris.org>

	Remove incorrect footnote from GOOPS manual
	* doc/ref/goops.texi (Inheritance): Remove footnote which incorrectly
	  stated that <complex> was not shown in the class hierarchy figure.

	Update comments regarding GMP earlier than 4.2.
	* libguile/numbers.c: Update comments regarding GMP earlier than 4.2.
	  Remove speculations about versions of GMP that had not yet been
	  released when the comments were written.  Replace them with facts that
	  are now known about the changes made in GMP 4.2.

	Fix description of the R6RS `finite?' in manual
	* doc/ref/r6rs.texi (rnrs base): `(finite? x)' returns true iff x is
	  neither infinite nor a NaN.  Previously, it stated that `finite?' was
	  the negation of `infinite?', which was incorrect because NaNs are
	  neither finite nor infinite.  Combine description of 'nan?' with those
	  of `finite?' and `infinite?'.

2011-03-08  Mark H Weaver  <mhw@netris.org>

	Fix bytevectors VALIDATE_REAL to test for reals, not rationals
	Reported and fixed by Daniel Llorens <dll@bluewin.ch>.

	* libguile/bytevectors.c (VALIDATE_REAL): Test for reals, not rationals.

	* test-suite/tests/srfi-4.test (f32 vectors, f64 vectors): Add tests.

2011-03-08  Mark H Weaver  <mhw@netris.org>

	Remove incorrect footnote from GOOPS manual
	* doc/ref/goops.texi (Inheritance): Remove footnote which incorrectly
	  stated that <complex> was not shown in the class hierarchy figure.

	Update comments regarding GMP earlier than 4.2.
	* libguile/numbers.c: Update comments regarding GMP earlier than 4.2.
	  Remove speculations about versions of GMP that had not yet been
	  released when the comments were written.  Replace them with facts that
	  are now known about the changes made in GMP 4.2.

	Fix description of the R6RS `finite?' in manual
	* doc/ref/r6rs.texi (rnrs base): `(finite? x)' returns true iff x is
	  neither infinite nor a NaN.  Previously, it stated that `finite?' was
	  the negation of `infinite?', which was incorrect because NaNs are
	  neither finite nor infinite.  Combine description of 'nan?' with those
	  of `finite?' and `infinite?'.

2011-03-08  Mark H Weaver  <mhw@netris.org>

	Fix bytevectors VALIDATE_REAL to test for reals, not rationals
	Reported and fixed by Daniel Llorens <dll@bluewin.ch>.

	* libguile/bytevectors.c (VALIDATE_REAL): Test for reals, not rationals.

	* test-suite/tests/srfi-4.test (f32 vectors, f64 vectors): Add tests.

2011-03-08  Andy Wingo  <wingo@pobox.com>

	scm_public_ref et al docs
	* doc/ref/api-modules.texi (Accessing Modules from C): Add docs for the
	  new C procedures.

	eval-string docs
	* doc/ref/api-evaluation.texi (Fly Evaluation): Update eval-string
	  documentation.

	document scm_call_{5,6,n}
	* doc/ref/api-evaluation.texi (Fly Evaluation): Document
	  scm_call_{5,6,n}.

	add scm_call_{5,6}
	* libguile/eval.h:
	* libguile/eval.c (scm_call_5, scm_call_6): New scm_call functions; why
	  not.

2011-03-08  Andy Wingo  <wingo@pobox.com>

	fix scm_setter
	* libguile/procs.c (scm_setter): Only get at the setter slot if the pure
	  generic actually has a setter.  Needs test.

	* test-suite/tests/goops.test ("defining generics"):
	  ("defining accessors"): Add `setter' tests.

2011-03-08  Andy Wingo  <wingo@pobox.com>

	core eval-string uses (ice-9 eval-string)
	* libguile/strports.c (scm_eval_string_in_module): Use eval-string from
	  (ice-9 eval-string).

	add scm_c_public_ref et al
	* libguile/modules.h:
	* libguile/modules.c (scm_public_lookup, scm_private_lookup)
	  (scm_c_public_lookup, scm_c_private_lookup, scm_public_ref)
	  (scm_private_ref, scm_c_public_ref, scm_c_private_ref)
	  (scm_public_variable, scm_private_variable, scm_c_public_variable)
	  (scm_c_private_variable): New helpers to get at variables and values
	  in modules.

2011-03-06  Ludovic Courtès  <ludo@gnu.org>

	Handle `letrec*' like `letrec' in simple cases.
	* module/language/tree-il/fix-letrec.scm (fix-letrec!): When X is a
	  `letrec*' with only lambdas and simple expressions, analyze it as if
	  it were a `letrec'.
	* test-suite/tests/tree-il.test ("letrec"): Add test for
	  `(letrec* (x y) (xx yy) ((const 1) (const 2)) (lexical y yy))'.

	Have `gc-profile.scm' make sure it's on a Linux-based system.
	* gc-benchmarks/gc-profile.scm (memory-mappings): Check %HOST-TYPE for
	  "-linux-".

2011-03-06  Ludovic Courtès  <ludo@gnu.org>

	Add `gc-benchmarks/' to the distribution.
	* gc-benchmarks/Makefile.am: New file.

	* configure.ac: Produce it.

	* Makefile.am (SUBDIRS): Add `gc-benchmarks'.

2011-03-06  Ludovic Courtès  <ludo@gnu.org>

	Make `object->string' explicitly close its string output port.
	* libguile/strports.c (scm_object_to_string): Close PORT before
	  returning the resulting string.

	Slightly optimize `gensym'.
	* libguile/symbols.c (default_gensym_prefix): New variable.
	  (scm_gensym): Use it.  Use `scm_from_latin1_stringn' instead of
	  `scm_from_locale_stringn'.
	  (scm_init_symbols): Initialize DEFAULT_GENSYM_PREFIX.

	Simply grow string port buffers geometrically.
	* libguile/strports.c (SCM_WRITE_BLOCK): Remove.
	  (st_flush): Multiply `pt->write_buf_size' by 2.
	  (st_seek): Likewise when TARGET == PT->write_buf_size.

2011-03-06  Ludovic Courtès  <ludo@gnu.org>

	Let `scm_mkstrport' allocate buffers on the caller's behalf.
	* libguile/strports.c (INITIAL_BUFFER_SIZE): New macro.
	  (scm_mkstrport): If STR is false, allocate a bytevector on the
	  caller's behalf.
	  (scm_object_to_string, scm_call_with_output_string,
	  scm_open_output_string): Pass SCM_BOOL_F as the STR argument of
	  `scm_mkstrport'.

	* libguile/backtrace.c (scm_display_application,
	  display_backtrace_body): Likewise.

	* libguile/gdbint.c (scm_init_gdbint): Likewise.

	* libguile/print.c (scm_simple_format): Likewise.

2011-03-06  Ludovic Courtès  <ludo@gnu.org>

	Use a bytevector as the backing buffer of string ports.
	* libguile/strports.c (st_resize_port): Adjust to deal with OLD_STREAM
	  and NEW_STREAM as bytevectors.
	  (scm_mkstrport): Store a bytevector in the port's stream rather than a
	  string.

2011-03-05  Andy Wingo  <wingo@pobox.com>

	add ice-9 eval-string
	* module/Makefile.am:
	* module/ice-9/eval-string.scm: New module, for use in implementing the
	  scm_c_eval_string_from_file_line suggestion.

	* test-suite/Makefile.am:
	* test-suite/tests/eval-string.test: New tests.

2011-03-05  Andy Wingo  <wingo@pobox.com>

	remove obsolete comments
	* libguile/eval.c (scm_nconc2last):
	* libguile/strports.c (scm_c_read_string): Remove some obsolete
	  comments.

2011-03-05  Mark Harig  <idirectscm@aim.com>

	Updated Guile manual page.
	* doc/guile.1: Added the current month and year, Guile version
	  descriptive text, and the text GNU to the title.

	  Updated the nroff formatting commands for the SYNOPSIS and OPTIONS
	  sections to what 'man' prescribes.  See 'man(1)', 'man(7)', and
	  'man-pages(7)'.

	  Corrected grammar, spelling, and capitalization (for example,
	  'scheme' to 'Scheme').

	  Vertical white-space was non-standard (two lines between some
	  sections, one space between others).  Changed this to the standard
	  one empty line before each section heading, and added dots (a single
	  period on a line) before every section heading (.SH) so that
	  maintainers will find the readability unchanged.

	  Added white space to follow the 'groff' recommendation of starting
	  every sentence on its own line, and breaking sentences at
	  punctuation.

	  Corrected an error in description of the info command.

	  Added the missing option '--no-debug', and the short switches '-h'
	  and '-v'.

	  Changed the description of the environment variable
	  GUILE_LOAD_COMPILED_PATH so that it references the Guile variable
	  `%load-compiled-path' instead of the variable `%load-path'.

	  Updated the copyright to include 2011.

2011-03-04  BT Templeton  <bpt@hcoop.net>

	guile-snarf: allow multiple init actions on one line
	* libguile/guile-snarf.in (modern_snarf): Allow programs to specify
	  multiple initialization actions on a single line. This makes it
	  possible for C programs to define multiple subrs with a single macro
	  invocation.

	* test-suite/standalone/test-guile-snarf: Enable more tests.

2011-03-04  BT Templeton  <bpt@hcoop.net>

	add guile-snarf tests
	* test-suite/standalone/test-guile-snarf: New file.
	* test-suite/standalone/Makefile.am: Add `test-guile-snarf'.

2011-03-04  Andy Wingo  <wingo@pobox.com>

	repl: terminal-width by default
	* module/system/repl/command.scm (terminal-width): New parameter that
	  will use the true terminal width if unset.
	  (backtrace, locals): Default to (terminal-width).
	  (width): Simplify.

2011-03-04  Michael Gran  <spk121@yahoo.com>

	Add ,width meta-command to set screen width in debug output
	This meta-command allows one to set the default number of columns
	that output from ,backtrace and ,locals shall occupy.

	* doc/ref/scheme-using.texi (Debug Commands): document ,width
	* module/system/repl/command.scm (*width*): new var
	  (backtrace, locals): use *width* in optarg
	  (width): new meta-command

2011-03-04  Andy Wingo  <wingo@pobox.com>

	fix ,stat
	* module/system/repl/command.scm (statistics): Fix for BDW-GC.
	  Unfortunately we still don't have mallocation or time taken.

2011-03-03  Andy Wingo  <wingo@pobox.com>

	repl.scm understands comments
	* module/system/repl/repl.scm (read-comment, read-scheme-line-comment)
	  (read-scheme-datum-comment): New helpers.
	  (meta-reader): Take a language instead of a reader.  If we have a
	  nonwhitespace char, first check to see that it's a comment, and if so,
	  read it off and loop.
	  (prompting-meta-read): Call meta-reader with the lang.

	repl.scm refactor
	* module/system/repl/repl.scm (flush-leading-whitespace): Rename from
	  next-char.
	  (meta-reader): Use flush-leading-whitespace.
	  (run-repl): Use flush-to-newline after the evaluation, which seems to
	  be the same as what we did before.

	fix encoding scanning for non-seekable ports
	* libguile/read.c (scm_i_scan_for_encoding): If possible, just use the
	  read buffer for the encoding scan, and avoid seeking.  Fixes
	  `(open-input-file "/dev/urandom")', because /dev/urandom can't be
	  seeked backwards.

2011-03-03  Andy Wingo  <wingo@pobox.com>

	more module-use-interfaces! tweaks
	* module/ice-9/boot-9.scm (module-use-interfaces!): Fix up to prevent
	  duplication in the use list of multiple incoming interfaces.

	* test-suite/tests/modules.test ("module-use"): Add tests.

2011-03-03  Andreas Rottmann  <a.rottmann@gmx.at>

	Use module identity to filter for existing modules
	This fixes a problem with R6RS's `import' in particuliar: when importing
	a subset of a library/module, the interface created for that purpose
	inherits the name of the module it is derived from.  The low-level
	primitives that are used for importing would then disregard earlier
	imports from the same module.

	An example for this bug can be seen with the following library
	definition:

	(library (test-guile2)
	  (export foo)
	  (import (only (rnrs base) define)
	          (only (rnrs base) error))

	  (define (foo . args)
	    #t))

	In the above, the import of `define' would be disregarded when `error'
	is imported, thus leading to a syntax error, since `(foo . args)' is
	treated as an application, since the binding of `define' would be not
	present.

	* module/ice-9/boot-9.scm (module-use!): Remove the filtering of the
	  existing imports of the module by name; a check for identity is
	  already done beforehand.
	  (module-use-interfaces!): Filter the existing imports by identity
	  instead of filtering them by their names.

2011-03-03  Ludovic Courtès  <ludo@gnu.org>

	Remove extra comma after `SCM_ARRAY_ELEMENT_TYPE_LAST'.
	* libguile/array-handle.h (scm_t_array_element_type): Remove extra comma
	  after last element.  Reported by David Fang <fang@csl.cornell.edu>.
	  Indent.

2011-03-02  Ludovic Courtès  <ludo@gnu.org>

	Improve the documentation for `dynamic-link'.
	* doc/ref/api-foreign.texi (Foreign Libraries): Make it clear that the
	  LIBRARY argument of `dynamic-link' should not contain an extension.
	  (Foreign Functions): Add cross-reference from `load-extension' to
	  `dynamic-link'.  Typeset file names and module names correctly.

2011-03-02  Mark H Weaver  <mhw@netris.org>

	Portability fixes for popen.test (for when /bin/sh is not bash)
	* test-suite/tests/popen.test (open-input-pipe no-duplicate): Pass
	  "read REPLY" command instead of "read" to the subshell, for improved
	  portability.  In particular, it is needed when /bin/sh is dash.

	  (open-output-pipe no-duplicate): Pass "exec guile [...]" instead of
	  "guile [...]" to the subshell, to ensure that the subshell will not
	  run guile as a subprocess while holding a duplicate of STDIN, which
	  would cause this test to fail.  This is needed when /bin/sh is dash.

2011-03-02  Mark H Weaver  <mhw@netris.org>

	Portability fixes for popen.test (for when /bin/sh is not bash)
	* test-suite/tests/popen.test (open-input-pipe no-duplicate): Pass
	  "read REPLY" command instead of "read" to the subshell, for improved
	  portability.  In particular, it is needed when /bin/sh is dash.

	  (open-output-pipe no-duplicate): Pass "exec guile [...]" instead of
	  "guile [...]" to the subshell, to ensure that the subshell will not
	  run guile as a subprocess while holding a duplicate of STDIN, which
	  would cause this test to fail.  This is needed when /bin/sh is dash.

2011-02-28  Ludovic Courtès  <ludo@gnu.org>

	Have `read' update line/column numbers when reading SCSH block comments.
	* libguile/read.c (scm_read_scsh_block_comment): Use `scm_getc' instead
	  of `scm_get_byte_or_eof'.

	* test-suite/tests/reader.test ("read-options")["position of SCSH block
	  comment"]: New test.

2011-02-28  Andy Wingo  <wingo@pobox.com>

	update port-filename docs
	* doc/ref/api-io.texi (File Ports):
	* libguile/ports.c (scm_port_filename): Fix docs to match
	  implementation.

2011-02-28  Paolo Bonzini  <bonzini@gnu.org>

	fix multiplication on x86_64
	2011-02-28  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-64.h: Add jit_add{c,x}{i,r}_l, jit_mulr_{l,ul}_,
		fix jit_mul{i,r}_{l,ul}.

2011-02-28  Ludovic Courtès  <ludo@gnu.org>

	Link stand-alone tests against libgc.
	Reported by Andreas Rottmann <a.rottmann@gmx.at>.

	* test-suite/standalone/Makefile.am (LIBGUILE_LDADD): New variable.
	  (test_num2integral_LDADD, test_round_LDADD, libtest_asmobs_la_LIBADD,
	  libtest_ffi_la_LIBADD, test_list_LDADD, test_unwind_LDADD,
	  test_conversion_LDADD, test_loose_ends_LDADD, test_scm_c_read_LDADD,
	  test_scm_take_locale_symbol_LDADD, test_scm_take_u8vector_LDADD,
	  libtest_extensions_la_LIBADD, test_with_guile_module_LDADD,
	  test_scm_with_guile_LDADD): Use it.

2011-02-28  Ludovic Courtès  <ludo@gnu.org>

	Strip any CPPFLAGS other than `-I' from `guile-2.0.pc'.
	* configure.ac: Strip anything beyond `-I' from $GUILE_CFLAGS so that
	  `guile-2.0.pc' does not export them to the user.  Reported and fixed
	  by Bruno Haible <bruno@clisp.org>.

2011-02-27  Andy Wingo  <wingo@pobox.com>

	flush all input on a read error
	* module/system/repl/repl.scm (flush-all-input): New helper.
	  (prompting-meta-read): Flush all input on a read error, as we could be
	  within some expression or a string or something.

2011-02-27  Andy Wingo  <wingo@pobox.com>

	scm-error-printer resilience
	* module/ice-9/boot-9.scm (scm-error-printer): Allow #f for rest args,
	  interpreting it as '().  Fixes regexp throws, which are of the form:

	    (regular-expression-syntax "make-regexp" "Invalid preceding regular expression" #f ("?.*"))

2011-02-27  Andy Wingo  <wingo@pobox.com>

	update R6RS incompatibilities
	* doc/ref/r6rs.texi (R6RS Incompatibilities): Update.

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

	add syncase test
	* test-suite/tests/syncase.test ("top-level expansions"): New test.

	chi-top-sequence defines macros before expanding other exps
	* module/ice-9/psyntax.scm (chi-top-sequence): Manually inline
	  eval-if-c&e into its two call sites; I found it hard to understand
	  otherwise.  If the mode is just 'e, defer expansion of definitions and
	  expressions until the end, so that they can be expanded in a context
	  of all syntax expanders defined in the sequence.

	psyntax: fold chi-top-sequence into chi-top
	* module/ice-9/psyntax.scm (chi-top-sequence): Pull chi-top into the
	  body of this toplevel begin expander.  This will let us do r6rs
	  toplevel expansion correctly.
	  (chi-top): Remove.
	  (macroexpand): Dispatch to chi-top-sequence directly.

2011-02-25  Ludovic Courtès  <ludo@gnu.org>

	Fix `gc-profile.scm'.
	* gc-benchmarks/gc-profile.scm (memory-mappings)[mapping-line-rx]: Fix
	  and give an example.
	  (total-heap-size): Fix docstring.

2011-02-25  Andy Wingo  <wingo@pobox.com>

	make-weak-key-hash-table vacuuming
	* libguile/hashtab.c (scm_make_weak_key_hash_table): Whoops, fix the
	  case I actually cared about.

2011-02-24  Ludovic Courtès  <ludo@gnu.org>

	Revert ""latin1" -> "Latin-1"."
	This reverts commit c2c550ca9d2442d070f79ed8bacb8db173c72df3.

	The name "latin1" is standardized by IANA, unlike the other one.
	Reported by Bruno Haible.

2011-02-24  Ludovic Courtès  <ludo@gnu.org>

	Make `locale-digit-grouping' more robust.
	* libguile/i18n.c (scm_nl_langinfo)[GROUPING]: Consider negative numbers
	  like `CHAR_MAX'.  Reported by David Fang <fang@csl.cornell.edu>.
	  Fix suggested by Bruno Haible <bruno@clisp.org>.

	Fix README.
	* README: Remove mention of an alpha release.  Reported by
	  Mark H. Weaver.

2011-02-24  Andy Wingo  <wingo@pobox.com>

	weak hash tables vacuum stale entries after a gc
	* libguile/hashtab.c (scm_c_register_weak_gc_callback): New private
	  helper, arranges for a C function to be called with a SCM as an
	  argument, as long as the argument is reachable by GC.
	  (scm_make_weak_key_hash_table)
	  (scm_make_weak_value_hash_table)
	  (scm_make_doubly_weak_hash_table): Register a weak GC callback to
	  vacuum_weak_hash_table.

	re-enable the after-gc-hook
	* libguile/gc.c (scm_gc): No need to take a mutex here.  Don't run the
	  hook, the hook will run itself.
	  (scm_c_register_gc_callback): New private helper, registers a callback
	  the next time GC happens.
	  (system_gc_callback): Guile's internal callback that runs
	  scm_after_gc_c_hook, which itself queues a call to the after-gc-hook.
	  (scm_storage_prehistory): Queue up a call to system_gc_callback.

	pointerless backing buffers for string ports
	* libguile/strports.c (scm_mkstrport): String port string buffer
	  allocated atomically.

	errno saving in display_string
	* libguile/print.c (display_string): Fix a case in which perhaps `errno'
	  could have been stompled.

2011-02-24  Andy Wingo  <wingo@pobox.com>

	web server more assiduous about closing ports
	* module/web/uri.scm:
	* module/web/server.scm (call-with-output-string*):
	  (call-with-output-bytevector*): Local procs to output to strings or
	  bytevectors, *and then close the port*.  We can't make this change in
	  call-with-output-string because it would be incompatible.

	* module/web/uri.scm (call-with-encoded-output-string, decode-string)
	  (uri-decode)
	* module/web/server.scm (call-with-encoded-output-string): Use the new
	  helpers.

2011-02-23  Andy Wingo  <wingo@pobox.com>

	open-pipe* pumps pipes guardian
	* module/ice-9/popen.scm (open-pipe*): Hack around the lack of an
	  after-gc hook, and pump the pipes guardian here in the procedure that
	  adds to the guardian.

2011-02-23  Andy Wingo  <wingo@pobox.com>

	GC dead links in weak hash tables before a possible rehash
	* libguile/hashtab.c (vacuum_weak_hash_table): New helper, goes through
	  the entirety of a weak hash table, vacuuming dead entries.
	  (scm_hash_fn_create_handle_x): If when adding to a weak hash table, we
	  would trigger a rehash, vacuum the table first.  The weak_bucket_assoc
	  would have only caught dead entries within one bucket.

	  Without this patch, the following code leaks:

	  (let lp ()
	    (call-with-output-string
	      (lambda (port)
	        (display "foo" port)))
	    (lp))

2011-02-23  Ludovic Courtès  <ludo@gnu.org>

	Switch to 2.1.0.
	* GUILE-VERSION (GUILE_MAJOR_VERSION, GUILE_MINOR_VERSION,
	  GUILE_MINOR_VERSION): Switch to 2.1.0.

2011-02-23  Mark H Weaver  <mhw@netris.org>

	Portability fix for new log and log10
	* libguile/numbers.c: Define M_LN2 if it's not already defined.
	  Fix error in comment.

	Portability fix for new log and log10
	* libguile/numbers.c: Define M_LN2 if it's not already defined.
	  Fix error in comment.

2011-02-22  Ludovic Courtès  <ludo@gnu.org>

	Fix a bug in `vhash-delete'.
	* module/ice-9/vlist.scm (vhash-delete): Honor HASH.
	* test-suite/tests/vlist.test ("vhash")["vhash-delete honors HASH"]: New test.

	Use `vhash-delq' in `(language tree-il analyze)'.
	* module/language/tree-il/analyze.scm (unbound-variable-analysis): Use
	  `vhash-delq' instead of `vhash-delete'.

	Optimize `vhash-delete'.
	* module/ice-9/vlist.scm (vhash-delete): Check whether KEY is in VHASH
	  and return VHASH if it's not.

	Add omitted exports from `(ice-9 vlist)'.
	* module/ice-9/vlist.scm: Export `vhash-delq' and `vhash-delv'.

	Compile `(rnrs)' after all other RNRS modules, potentially.
	* module/Makefile.am (RNRS_SOURCES): Move `rnrs.scm' last.

	Make `(rnrs base)' independent of other rnrs modules.
	* module/rnrs/base.scm (define-proxy): New macro.
	  (raise, condition, make-error, make-assertion-violation,
	  make-who-condition, make-message-condition, make-irritants-condition):
	  Use it.

2011-02-20  Andy Wingo  <wingo@pobox.com>

	update examples in manual to use PKG_CHECK_MODULES
	* doc/ref/autoconf.texi (Using Autoconf Macros): Switch example to use
	  PKG_CHECK_MODULES.
	* doc/ref/libguile-linking.texi (A Sample Guile Main Program): Likewise,
	  and change from configure.in to configure.ac, and recommend
	  autoreconf.

	pkg-config instead of guile-config in manuals
	* doc/ref/api-options.texi (Build Config):
	* doc/ref/libguile-linking.texi (Linking Programs With Guile):
	  (A Sample Guile Main Program):
	* doc/ref/libguile-smobs.texi (The Complete Example): Use pkg-config in
	  the examples instead of guile-config.

	tour.texi compilation fix
	* doc/ref/tour.texi (Writing Guile Extensions): Fix compilation
	  example.

2011-02-20  Andy Wingo  <wingo@pobox.com>

	@value{EFFECTIVE-VERSION} instead of 2.0 in some places in the manual
	* doc/ref/history.texi (A Timeline of Selected Guile Releases): Update
	  the 2.0 release blurb.

	* doc/ref/api-foreign.texi (Modules and Extensions):
	* doc/ref/libguile-extensions.texi (A Sample Guile Extension):
	* doc/ref/tour.texi (Linking Guile into Programs): Use
	  @value{EFFECTIVE-VERSION} instead of 2.0.  Also fix sample extension
	  compilation line to include the Guile CFLAGS.

2011-02-20  Bruno Haible  <bruno@clisp.org>

	guile.m4: Add support for linking against guile with rpath.
	* guile.m4 (GUILE_FLAGS): Also set GUILE_LIBS and GUILE_LTLIBS. Fix
	  documentation.

2011-02-19  Neil Jerram  <neil@ossau.uklinux.net>

	Fix typos in (web ...) doc
	* doc/ref/web.texi (Types and the Web): "help" -> "helpful".
	  (HTTP): Add closing paren.  Remove code that looks like a leftover.

	Last (for a little while) GOOPs doc fix
	* doc/ref/goops.texi (GOOPS Object Miscellany): Clarify that it would
	  be instances being printed, not classes.

2011-02-18  Neil Jerram  <neil@ossau.uklinux.net>

	Remove unneeded fixme
	* doc/ref/goops.texi (Class Definition Protocol): Removed `*fixme
	  Need to insert something here about checking that the value is not
	  unbound'.  It's a fine detail, and also I imagine there could be a
	  valid application that would choose to allow SCM_GOOPS_UNBOUND
	  values to escape through here.

	Tidy up remaining bits of the MOP section
	* doc/ref/goops.texi (Method Definition): Unindent text about
	  define-method invoking add-method!.
	  (Method Definition Internals): Add @noindent's.
	  (Generic Function Invocation): Add intro text, and tidy up the tree.

	Clean up doc on class redefinition and instance class changing
	* doc/ref/goops.texi (Class Redefinition): Deleted, with its material
	  all merged into later `Redefining a Class' and `Changing the Class of
	  an Instance' sections.

	Merge orphan Class Options section into Class Definition
	* doc/ref/goops.texi (Class Definition): Move material from later
	  `Class Options' section to here.

2011-02-18  Neil Jerram  <neil@ossau.uklinux.net>

	Doc of MOP for instance and class creation
	* doc/ref/goops.texi (Instance Creation Protocol): Rename from
	  `Customizing Instance Creation', and move before the more
	  complicated class definition stuff.  Couple of very minor edits.

	  (Class Definition Protocol): Remove ensure-metaclass-with-supers
	  (too internal) and repeated material.  Move class-redefinition
	  stuff to (existing) later section on that.  Merge reference-like
	  material from `Customizing Class Definition' to here.

2011-02-18  Neil Jerram  <neil@ossau.uklinux.net>

	Summarize class definition protocol
	* doc/ref/goops.texi (Class Definition Protocol): Add tree summary
	  diagram.

	Work on GOOPS MOP documentation
	* doc/ref/goops.texi (The Metaobject Protocol): Simplify intro text.
	  Minor edits and simplifications throughout this section.
	  (Metaobjects and the Metaobject Protocol): Insert "default".
	  (Metaclasses): Renamed from `Terminology', and deleted the material
	  on CPL and accessors, which just duplicated what has already been
	  covered earlier in the chapter.  Remove statements that confuse
	  whether "metaclass of" means "class of class of" or "class of
	  (something that is itself a class)".  (I think it's actually the
	  latter.)
	  (Class Definition Protocol): Renamed from `Class Definition
	  Internals'.

	Rewording for "make an intervention".
	* doc/ref/compiler.texi (Extending the Compiler): Rephrase first sentence.

	No sublimated desires
	* doc/ref/compiler.texi: Delete "subliminated".

2011-02-18  Andy Wingo  <wingo@pobox.com>

	fix a couple leaks in ports.c.  thanks valgrind!
	* libguile/ports.c (scm_i_remove_port): Fix a case in which ports
	  explictly closed via close-port would leak their iconv_t data.
	  (scm_set_port_encoding_x): scm_i_set_port_encoding_x strdups its
	  argument, so we need to free the locale encoding of the incoming str.

	core modules use (ice-9 binary-ports) instead of (rnrs io ports)
	* module/language/assembly/compile-bytecode.scm:
	* module/language/elisp/lexer.scm:
	* module/web/request.scm:
	* module/web/response.scm:
	* module/web/server.scm:
	* module/web/uri.scm: Use ice-9 binary-ports.

2011-02-18  Andy Wingo  <wingo@pobox.com>

	add (ice-9 binary-ports)
	* module/ice-9/binary-ports.scm: New module.
	* module/Makefile.am: Add to makefile.

	* module/rnrs/io/ports.scm: Re-export bindings from (ice-9 binary
	  ports).  This will allow the compiler to not pull (rnrs) into its
	  included module set.

2011-02-18  Andy Wingo  <wingo@pobox.com>

	update extension example in manual
	* doc/ref/libguile-extensions.texi (A Sample Guile Extension): Fix use
	  of deprecated functions.

2011-02-16  Ludovic Courtès  <ludo@gnu.org>

	Change tag naming convention to `vX.Y.Z'.
	* configure.ac: Tell `git-version-gen' that we're switching to a
	  `vX.Y.Z' scheme for release tags.

2011-02-16  Neil Jerram  <neil@ossau.uklinux.net>

	Rewording for "make an intervention".
	* doc/ref/compiler.texi (Extending the Compiler): Rephrase first sentence.

	No sublimated desires
	* doc/ref/compiler.texi: Delete "subliminated".

2011-02-16  Mark H Weaver  <mhw@netris.org>

	Improvements to `log' and `log10'
	* libguile/numbers.c (log_of_shifted_double, log_of_exact_integer,
	  log_of_exact_integer_with_size, log_of_fraction): New internal static
	  functions used by scm_log and scm_log10.

	  (scm_log, scm_log10): Robustly handle large integers, large and small
	  fractions, and fractions close to 1.  Previously, computing logarithms
	  of fractions close to 1 yielded grossly inaccurate results, and the
	  other cases yielded infinities even though the answer could easily fit
	  in a double.  (log -0.0) now returns -inf.0+<PI>i, where previously it
	  returned -inf.0.  (log 0) now throws a numerical overflow exception,
	  where previously it returned -inf.0.  (log 0.0) still returns -inf.0.
	  Analogous changes made to `log10'.

	* test-suite/tests/numbers.test (log, log10): Add tests.

2011-02-16  Mark H Weaver  <mhw@netris.org>

	Fix comment above number-theoretic division tests
	* test-suite/tests/numbers.test: Fix comment.

2011-02-16  Mark H Weaver  <mhw@netris.org>

	Improvements to `log' and `log10'
	* libguile/numbers.c (log_of_shifted_double, log_of_exact_integer,
	  log_of_exact_integer_with_size, log_of_fraction): New internal static
	  functions used by scm_log and scm_log10.

	  (scm_log, scm_log10): Robustly handle large integers, large and small
	  fractions, and fractions close to 1.  Previously, computing logarithms
	  of fractions close to 1 yielded grossly inaccurate results, and the
	  other cases yielded infinities even though the answer could easily fit
	  in a double.  (log -0.0) now returns -inf.0+<PI>i, where previously it
	  returned -inf.0.  (log 0) now throws a numerical overflow exception,
	  where previously it returned -inf.0.  (log 0.0) still returns -inf.0.
	  Analogous changes made to `log10'.

	* test-suite/tests/numbers.test (log, log10): Add tests.

2011-02-16  Mark H Weaver  <mhw@netris.org>

	Fix comment above number-theoretic division tests
	* test-suite/tests/numbers.test: Fix comment.

2011-02-15  Ludovic Courtès  <ludo@gnu.org>

	Switch to 2.0.0.
	* GUILE-VERSION (GUILE_MAJOR_VERSION, GUILE_MINOR_VERSION,
	  GUILE_MINOR_VERSION): 2.0.0!

	Increment `LIBGUILE_INTERFACE_CURRENT'.
	* GUILE-VERSION (LIBGUILE_INTERFACE_CURRENT): Set to 22, i.e.,
	  Guile 1.8.8 + 1.

2011-02-15  Ludovic Courtès  <ludo@gnu.org>

	Update `doc/example-smob'.
	* doc/example-smob/Makefile (CFLAGS, LIBS): Use `pkg-config' instead of
	  `guile-config'.

	* doc/example-smob/image-type.c (mark_image, free_image): Remove.
	  (init_image_type): Don't call `scm_set_smob_mark' and
	  `scm_set_smob_free'.

2011-02-15  Mark H Weaver  <mhw@netris.org>

	Use trunc in scm_i_inexact_truncate_divide
	* libguile/numbers.c (scm_i_inexact_truncate_divide): Use trunc instead
	  of floor and ceil.  Important for consistency with
	  scm_truncate_quotient and scm_truncate_remainder.

2011-02-15  Ludovic Courtès  <ludo@gnu.org>

	Document `%auto-compilation-options'.
	* doc/ref/api-evaluation.texi (Compilation): Emphasize
	  auto-compilation.  Document `%auto-compilation-options'.

	Fix compilation of `c-tokenize.c' in a cross-compile setup.
	* libguile/Makefile.am (c-tokenize.$(OBJEXT)): When cross-compiling,
	  don't include any CPPFLAGS since we could end up seeing Gnulib's
	  replacements, e.g., `rpl_malloc', which we can't use.

	Use all the LDFLAGS from Gnulib.
	* libguile/Makefile.am (version_info): New variable.
	  (libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD): Remove
	  `$(LTLIBUNISTRING) $(LTLIBICONV) $(LTLIBINTL)'.
	  (libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS): Add all the flags
	  from Gnulib, one per line as in the `gnulib-tool' output, including
	  those above.

	Remove Gnulib's `sockets' module from the import list.
	* m4/gnulib-cache.m4: Remove `sockets', which we don't directly depend
	  on.

2011-02-15  Ludovic Courtès  <ludo@gnu.org>

	Import Gnulib's `log1p' and `round' modules.
	From Gnulib v0.0-4889-ge375fe3.

	* m4/gnulib-cache.m4: Add `log1p' and `round', requested by
	  Mark H Weaver <mhw@netris.org>.
	  Use `malloc-gnu' instead of `malloc', the latter being obsolete.

2011-02-15  Andy Wingo  <wingo@pobox.com>

	remove 1.9 changes from NEWS (leaving only 2.0)
	* NEWS: Compress year range (as allowed by standards and note in
	  README).  Remove 1.9.15->2.0 changes, leaving only 2.0 changes.

2011-02-15  Mark H Weaver  <mhw@netris.org>

	Use trunc instead of scm_c_truncate
	* libguile/numbers.c (scm_c_truncate, scm_truncate_number,
	  scm_i_inexact_truncate_quotient, scm_i_inexact_truncate_remainder):
	  Use trunc directly, now that we have its gnulib module.

	Fix minor errors in docs of division operators
	* doc/ref/api-data.texi (Arithmetic): The R5RS `quotient', `remainder',
	  and `modulo' operators are exact-integer-only operators.  `modulo' is
	  equivalent to `floor-remainder', not `floor-quotient'.

2011-02-14  Andy Wingo  <wingo@pobox.com>

	news tweak
	* NEWS: Tweak

	add more NEWS
	* NEWS: Add new NEWS and fold into main text.

	fold new NEWS items into main text
	* NEWS: Fold all items into main text, while keeping a list of things
	  that are new in 1.9.15.

	update THANKS
	* THANKS: Update, adding all people who have their name on a patch in
	  Git.  Add a section on authors of other free software libraries.

	tweak to internal scm_i_extract_values_2
	* libguile/values.c (scm_i_extract_values_2): Make nvalues check more
	  robust.

2011-02-14  Mark H Weaver  <mhw@netris.org>

	Allow GOOPS getters to add methods to primitive generics
	* module/oop/goops.scm (ensure-generic): If the old definition of a
	  desired getter is a primitive generic, let the new method be added to
	  it instead of creating a fresh new generic.

	  (ensure-accessor): Modify as necessary to keep the old behavior.
	  Maybe something more optimal can be done here, but it's not yet
	  obvious to me how to do it.

2011-02-14  Mark H Weaver  <mhw@netris.org>

	Make SCM_NUMP and SCM_NUMBERP more extensible
	* libguile/numbers.h (SCM_NUMP, SCM_NUMBERP): Mask out more bits in the
	  cell type field when doing the comparison, in order to accept future
	  numeric types that have not yet been implemented.  This should allow
	  us to add more core numeric types without breaking ABI compatibility.
	  As a bonus, these macros are now more efficient.

	Slight optimization for scm_equal_p
	* libguile/eq.c (scm_equal_p): Move SCM_STRUCTP check within the default
	  case of the SCM_TYP7 switch statement, for optimization.

2011-02-14  Mark H Weaver  <mhw@netris.org>

	Reduce code size of division operators
	* libguile/numbers.c (scm_quotient): Reimplement in terms of
	  scm_truncate_quotient.

	  (scm_remainder): Reimplement in terms of scm_truncate_remainder.

	  (scm_modulo): Reimplement in terms of scm_floor_remainder.

	  (scm_euclidean_quotient, scm_euclidean_remainder,
	  scm_euclidean_divide): Reimplement in terms of floor and ceiling.
	  Make them non-extensible, because there is no need; they will work
	  with any objects that implement the floor and ceiling division
	  operators, and that can be tested using `negative?'.

2011-02-14  Mark H Weaver  <mhw@netris.org>

	Optimize truncate, round, floor, and ceiling
	* libguile/numbers.c (scm_c_truncate): Use ceil (x) instead of
	  -floor (-x).

	  (scm_truncate_number): Implement directly instead of by checking the
	  sign and using scm_floor or scm_ceiling.  Use scm_truncate_quotient
	  for fractions.  Make extensible, so that new number types implemented
	  in GOOPS will be able to do the job more efficiently, since it is
	  often easier to implement truncate than floor or ceiling.

	  (scm_round_number): Optimize fractions case by using
	  scm_round_quotient.  Make extensible, so that new number types
	  implemented in GOOPS will be able to do the job efficiently.

	  (scm_floor, scm_ceiling): Optimize fractions case by using
	  scm_floor_quotient and scm_ceiling_quotient, respectively.

	* test-suite/tests/numbers.test: Add test cases.

2011-02-14  Mark H Weaver  <mhw@netris.org>

	Add four new sets of fast quotient and remainder operators
	* libguile/numbers.c (scm_floor_divide, scm_floor_quotient,
	  scm_floor_remainder, scm_ceiling_divide, scm_ceiling_quotient,
	  scm_ceiling_remainder, scm_truncate_divide, scm_truncate_quotient,
	  scm_truncate_remainder, scm_round_divide, scm_round_quotient,
	  scm_round_remainder): New extensible procedures `floor/',
	  `floor-quotient', `floor-remainder', `ceiling/', `ceiling-quotient',
	  `ceiling-remainder', `truncate/', `truncate-quotient',
	  `truncate-remainder', `round/', `round-quotient', and
	  `round-remainder'.

	* libguile/numbers.h: Add function prototypes.

	* test-suite/tests/numbers.test: Add tests.

	* doc/ref/api-data.texi (Arithmetic): Add documentation.

	* NEWS: Add NEWS entry.

2011-02-14  Mark H Weaver  <mhw@netris.org>

	Optimize division operators handling of fractions
	* libguile/numbers.c: (scm_euclidean_quotient, scm_euclidean_remainder,
	  scm_euclidean_divide, scm_centered_quotient, scm_centered_remainder,
	  scm_centered_divide): Optimize case where both arguments are exact and
	  at least one is a fraction, by reducing to a subproblem involving only
	  integers, and then adjusting the resulting remainder as needed.

2011-02-14  Mark H Weaver  <mhw@netris.org>

	Make divide functions return values via (SCM *) output arguments
	* libguile/numbers.c (scm_euclidean_divide, scm_centered_divide): Change
	  API to return two values via output arguments of type (SCM *), instead
	  of packing into a values object.

	  (scm_i_euclidean_divide, scm_i_centered_divide): New internal wrappers
	  that call the above functions and pack the result into a values
	  object.

	* libguile/numbers.h: Change prototypes to reflect new API.

	* doc/ref/api-data.h (Arithmetic): Update manual.

2011-02-14  Mark H Weaver  <mhw@netris.org>

	Added internal C function to extract from values object
	* libguile/values.c (scm_i_extract_values_2): New internal function
	  that extracts two values from a values object.

	* libguile/values.h: Added prototype.

2011-02-14  Andy Wingo  <wingo@pobox.com>

	update thanks
	* THANKS: Add Ian Price

	add vector-move test cases
	* test-suite/tests/vectors.test ("vector-move-left!")
	  ("vector-move-right!"): Add test cases for recent bug.

2011-02-14  Ian Price  <ianprice90@googlemail.com>

	fix fencepost error in vector-move-left! and -right!
	* libguile/vectors.c (scm_vector_move_right_x, scm_vector_move_left_x):
	  Fix edge case.

2011-02-14  Ludovic Courtès  <ludo@gnu.org>

	Pass all the flags when building `gen-scmconfig' in a cross-compile setup.
	* libguile/Makefile.am (gen-scmconfig.$(OBJEXT)): When cross-compiling,
	  pass all the CPPFLAGS and CFLAGS.

	Leave the default `*current-warning-prefix*' at the REPL.
	* module/system/repl/common.scm (repl-compile): Leave the default
	  `*current-warning-prefix*'.

2011-02-14  Ludovic Courtès  <ludo@gnu.org>

	Temporarily fix `unistr.in.h' to allow compilation with `-Wundef'.
	See <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/24225> for details.

	* lib/unistr.in.h: Change #if's into #ifdef's.

2011-02-14  Ludovic Courtès  <ludo@gnu.org>

	Update Gnulib; add new modules.
	This updates Gnulib to v0.0-4889-ge375fe3.

	* m4/gnulib-cache.m4: Add `accept', `bind', `close', `connect',
	  `getpeername', `getsockname', `getsockopt', `listen', `malloc',
	  `malloca', `recv', `recvfrom', `send', `sendto', `setsockopt',
	  `shutdown', `socket', and `sockets', requested by
	  Jan Nieuwenhuizen <janneke-list@xs4all.nl> for cross-MinGW32 builds.
	  Add `trunc', requested by Mark H Weaver <mhw@netris.org>.

2011-02-14  Neil Jerram  <neil@ossau.uklinux.net>

	Thank Ralf
	* THANKS: Thank Ralf.

2011-02-13  Neil Jerram  <neil@ossau.uklinux.net>

	Typo fix
	* doc/ref/api-modules.texi (R6RS Libraries): "libraries
	  implementation" -> "library implementation".

	Procedure/macro index includes Autoconf macros
	* doc/ref/indices.texi (Procedure Index): Make explicit that the
	  procedure/macro index includes Autoconf macros.

2011-02-13  Neil Jerram  <neil@ossau.uklinux.net>

	Misc textual editing
	* doc/ref/api-scheduling.texi (Asyncs): "queueing" -> "queuing".

	* benchmark-suite/lib.scm, doc/sources/unix.texi (Unix conventions),
	  test-suite/lib.scm: "postpend" -> "append".

	* doc/ref/api-compound.texi (Array Syntax, Dictionary Types),
	  doc/ref/api-control.texi (Catch), doc/ref/api-data.texi (Complex
	  Numbers, Conversion, Random, Symbol Props, Symbol Uninterned),
	  doc/ref/api-options.texi (Build Config, Common Feature Symbols),
	  doc/ref/api-regex.texi (Match Structures),
	  doc/ref/api-undocumented.texi, doc/ref/compiler.texi (Tree-IL,
	  GLIL), doc/ref/data-rep.texi (Immediate objects), doc/ref/goops.texi
	  (Slot Description Example), doc/ref/history.texi (A Scheme of Many
	  Maintainers, Status), doc/ref/libguile-program.texi (Available
	  Functionality), doc/ref/misc-modules.texi (Formatted Output),
	  doc/ref/mod-getopt-long.texi (getopt-long Reference),
	  doc/ref/posix.texi (Network Socket Address, Network Sockets and
	  Communication), doc/ref/srfi-modules.texi (SRFI-1 Association Lists,
	  SRFI-10, SRFI-19 String to date, SRFI-27 Random Sources),
	  doc/ref/vm.texi (Instruction Set, Top-Level Environment
	  Instructions, Procedure Call and Return Instructions),
	  doc/sources/unix.texi (Unix conventions): Correct spacing after
	  "i.e." and "e.g.".

2011-02-13  Neil Jerram  <neil@ossau.uklinux.net>

	Avoid uses of "resp. signed"
	* doc/ref/api-data.texi (Bytevectors as Integers, Bytevectors and
	  Integer Lists): Split signed and unsigned deffns.

	Reword intro of `Accessing Arrays from C'
	* doc/ref/api-compound.texi (Accessing Arrays from C): Reword to avoid
	  awkward "rectangularily organized".

2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	docs: fix typos in manual, and a couple in code comments.
	* doc/ref/api-data.texi: Use \sqrt{2} consistently rather than \sqrt2.
	  Add @: for correct spacing after "i.e.".

	docs: fix markup in api-options.texi.
	* doc/ref/api-options.texi (Build Config): Use @var for
	metasyntactic variable.  Add newline after @noindent.
	Use @env for GUILE_LOAD_PATH.

2011-02-13  Noah Lavine  <nlavine@haverford.edu>

	Set sockaddr_in.sin_len field when it exists.
	* configure.ac: Detect when struct sockaddr_in has a sin_len field.
	  Remove obsolete comment.
	* libguile/socket.c (scm_to_sockaddr, scm_fill_sockaddr): Set the
	  sin_len field in our struct sockaddr_in when it exists.

2011-02-13  Andy Wingo  <wingo@pobox.com>

	bump objcode version to 2.0; introduce minor-version compatibility
	* libguile/_scm.h (SCM_OBJCODE_MAJOR_VERSION): Bump to 2.
	  (SCM_OBJCODE_MINOR_VERSION): Reset to 0.
	  (SCM_OBJCODE_MACHINE_VERSION_STRING, SCM_OBJCODE_COOKIE): Reorder so
	  the minor version is the last byte.

	* libguile/objcodes.c (make_objcode_by_mmap): Accept objcodes whose
	  minor version is less than SCM_OBJCODE_MINOR_VERSION, not just equal
	  to.

2011-02-13  Noah Lavine  <nlavine@haverford.edu>

	zero newly allocated sockaddrs
	* libguile/socket.c (scm_to_sockaddr, scm_fill_sockaddr): Zero the
	  sockaddrs, so we do not pass uninitialized memory to the kernel.

2011-02-13  Ludovic Courtès  <ludo@gnu.org>

	Add `%auto-compilation-options', used by `compile-file' when auto-compiling.
	* module/ice-9/boot-9.scm (%auto-compilation-options): New variable.
	  (load-in-vicinity): Honor it.

	* libguile/load.c (kw_opts, sym_compile_file,
	  sym_auto_compilation_options): New variables.
	  (do_try_auto_compile): Honor %AUTO-COMPILATION-OPTIONS.

	* module/system/repl/common.scm (repl-default-options): Have
	  `compile-options' default to %AUTO-COMPILATION-OPTIONS.

2011-02-13  Ludovic Courtès  <ludo@gnu.org>

	Add `*current-warning-prefix*'.
	* module/system/base/message.scm (*current-warning-prefix*): New
	  variable.
	  (%warning-types): Honor `*current-warning-prefix*'.

	* module/scripts/compile.scm (compile): Use an empty
	  `*current-warning-prefix*'.

	* module/system/repl/common.scm (repl-compile): Likewise.

	* test-suite/tests/tree-il.test (call-with-warnings): Likewise.

2011-02-13  Andy Wingo  <wingo@pobox.com>

	primitive-load defaults to utf-8, not latin-1
	* libguile/load.c (scm_primitive_load): Default to utf-8.

2011-02-13  Ludovic Courtès  <ludo@gnu.org>

	Have `the-scm-module' be its own public interface (bug #30623).
	* module/ice-9/boot-9.scm (the-scm-module): Make it its own public
	  interface.

	* test-suite/tests/modules.test ("foundations")["the-root-module",
	  "the-scm-module"]: New tests.

2011-02-13  Andy Wingo  <wingo@pobox.com>

	autocompile -> auto-compile
	* NEWS:
	* check-guile.in:
	* doc/guile.1:
	* doc/ref/scheme-scripts.texi:
	* libguile/init.c:
	* libguile/load.c:
	* libguile/load.h:
	* libguile/script.c:
	* module/Makefile.am:
	* module/ice-9/boot-9.scm:
	* module/scripts/compile.scm:
	* module/system/base/compile.scm:
	* test-suite/Makefile.am:
	* test-suite/tests/popen.test: Change "autocompile" to "auto-compile" or
	  "auto_compile", as appropriate, in variable names, function names,
	  command line arguments, and the documentation.

	`load' is a macro (!) that resolves paths relative to source file dir
	* module/ice-9/boot-9.scm (load-in-vicinity): New helper, loads a file
	  relative to a path.
	  (load): Turn into a macro that captures the name of the source file
	  being expanded, and dispatches to load-in-vicinity.  Referencing
	  `load' by bare name returns a closure that embeds the current source
	  file name.

2011-02-13  Andy Wingo  <wingo@pobox.com>

	read-enable 'positions by default
	* libguile/read.c (scm_read_opts): Default "positions" to #t.  The
	  compiler was already turning it on anyway, and this allows
	  primitive-load without --auto-compile to also propagate source
	  information through the expander, for better errors and to let macros
	  know their source.

	* module/language/scheme/spec.scm: No need to enable positions here
	  now.

2011-02-13  Andy Wingo  <wingo@pobox.com>

	use scm_c_make_struct in scm_values
	* libguile/values.c (scm_values): Micro-optimization.

2011-02-13  Ludovic Courtès  <ludo@gnu.org>

	Add `scm_t_subr' typedef (fix bug #23681).
	* libguile/__scm.h (scm_t_subr): New typedef.

	* libguile/deprecated.h (scm_make_gsubr, scm_make_gsubr_with_generic,
	  scm_call_catching_errors): Use it.

	* libguile/gsubr.h (scm_c_make_gsubr, scm_c_define_gsubr,
	  scm_c_define_gsubr_with_generic): Likewise.

	* libguile/smob.h (scm_smob_descriptor)[apply]: Likewise.
	  (scm_set_smob_apply): Likewise.

	* libguile/snarf.h (SCM_FUNC_CAST_ARBITRARY_ARGS): Likewise.

2011-02-13  Ludovic Courtès  <ludo@gnu.org>

	Change `scm_ramapc' prototype to avoid empty declarators (bug #23681).
	* libguile/array-map.h (scm_ramapc): Change `cproc' to `void *' instead
	  of using empty declarators.

	* libguile/array-map.c (scm_ramapc): Adjust accordingly.

2011-02-13  Ludovic Courtès  <ludo@gnu.org>

	Fix prototype of `scm_the_vm'.
	* libguile/vm.h (scm_the_vm): Use `(void)' instead of `()'.

2011-02-12  Andy Wingo  <wingo@pobox.com>

	fix syntax-error printing
	* module/ice-9/boot-9.scm: Fix to make "extra" a rest arg.

	fix scm-error invocation on SIGINT in top-repl.scm
	* module/ice-9/top-repl.scm (call-with-sigint): Pass '() as the format
	  args when invoking scm-error, to ensure that the error is printable.

2011-02-12  Mark H Weaver  <mhw@netris.org>

	Fixes and improvements to number-theoretic division operators
	* libguile/numbers.c (scm_euclidean_quotient, scm_euclidean_divide,
	  scm_centered_quotient, scm_centered_divide): Fix bug in inum/inum
	  case, where (quotient most-negative-fixnum -1) would not be converted
	  to a bignum.

	  (scm_euclidean_quotient): Be more anal-retentive about calling
	  scm_remember_upto_here_1 after mpz_sgn, (even though mpz_sgn is
	  documented as being implemented as a macro and certainly won't
	  do any allocation).  It's better to be safe than sorry here.

	  (scm_euclidean_quotient, scm_centered_quotient): In the bignum/inum
	  case, check if the divisor is 1, since this will allow us to avoid
	  allocating a new bignum.

	  (scm_euclidean_divide, scm_centered_quotient, scm_centered_divide):
	  When computing the intermediate truncated quotient (xx / yy) and
	  remainder, use (xx % yy) instead of (xx - qq * yy), on the theory that
	  the compiler is more likely to handle this case intelligently and
	  maybe combine the operations.

	  (scm_euclidean_divide): In the bignum/inum case, we know that the
	  remainder will fit in an fixnum, so don't bother allocating a bignum
	  for it.

	  (scm_euclidean_quotient, scm_euclidean_remainder,
	  scm_euclidean_divide, scm_centered_quotient, scm_centered_remainder,
	  scm_centered_divide): Minor stylistic changes.

	* test-suite/tests/numbers.test: Rework testing framework for
	  number-theoretic division operators to be more efficient and
	  comprehensive in its testing of code paths and problem cases.

2011-02-12  Mark H Weaver  <mhw@netris.org>

	Add comment about handling of exactness specifiers
	* libguile/numbers.c: Add discussion on the handling of exactness
	  specifiers to the comment above the string-to-number conversion
	  functions.

	Fix extensibility of 1-argument atan
	* libguile/numbers.c (scm_atan): Call SCM_WTA_DISPATCH_1 instead of
	  SCM_WTA_DISPATCH_2 if the second argument is unbound.  Arguably,
	  SCM_WTA_DISPATCH_* should handle that case gracefully, but currently
	  it doesn't.

	Fix mistake in comment in tags.h
	* libguile/tags.h: Fix comment in discussion of data representation.
	  tc3-code #0b110 indicates a small integer and #0b100 indicates a
	  non-integer immediate.  Previously, these were reversed.

	Bump copyright date in REPL version string
	* module/system/repl/common.scm (*version*): Add 2011 to copyright
	  date range.

2011-02-12  Ludovic Courtès  <ludo@gnu.org>

	Make sure we don't override the user's extension search path.
	* libguile/dynl.c (augment_env): New function.
	  (sysdep_dynl_init): Use it instead of `lt_dladdsearchdir'.

	* configure.ac: Define `SHARED_LIBRARY_PATH_VARIABLE'.

2011-02-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	Save config.cache before tests which are likely to fail.
	Guile's configure script takes fairly long.  On a system without
	automatic build dependency installation, it is amplified by the fact
	that your user might be both impatient and not read the build
	instructions, thus needs to rerun configure several times only to find
	out there is another dependency to install.  Still, there is help even
	for such kinds of misguided figures such as me: save the temporary
	config.cache file (if one is used anyway) before embarking upon the set
	of tests that are likely to error out.  That way, the second and further
	reruns are much faster.

	The downside of this patch is that, when fixing the errors requires
	changing to precious variables (such as CPPFLAGS or so), the user will
	need to 'rm -f config.cache' to keep configure happy.

	* configure.ac: Call AC_CACHE_SAVE before the gmp tests.

2011-02-11  Andreas Rottmann  <a.rottmann@gmx.at>

	install r6rs exception printer
	* module/rnrs/exceptions.scm: Install an exception printer for R6RS
	  exceptions.

2011-02-11  Andy Wingo  <wingo@pobox.com>

	better narrowing in catch-all handlers in throw.c
	* libguile/throw.c (handler_message): Narrow away the catch-closure and
	  throw frames.

2011-02-11  Andy Wingo  <wingo@pobox.com>

	pre-boot lookup of print-exception works
	* libguile/backtrace.c (scm_print_exception): Use scm_module_variable to
	  look up print-exception so that it works before boot-9 is loaded.

	* libguile/throw.c (CACHE_VAR): Tweak to use scm_from_latin1_symbol.

2011-02-11  Andy Wingo  <wingo@pobox.com>

	scm_handle_by_message uses scm_print_exception
	* libguile/throw.c (handler_message, should_print_backtrace): Use
	  scm_print_exception.  Add a helper function to determine when to print
	  a backtrace; don't do so on read or syntax errors.

	scm_display_error_message, display-error use print-exception
	* libguile/backtrace.c (scm_display_error_message)
	  (scm_i_display_error): Use scm_print_exception.

2011-02-11  Andy Wingo  <wingo@pobox.com>

	print-exception gets a c binding
	* libguile/backtrace.c (scm_print_exception): Add C binding for
	  print-exception, which dispatches to whatever is defined in Scheme.
	  (boot_print_exception): Add initial binding, replaced later in
	  Scheme.

	* module/ice-9/boot-9.scm: Expect there to already be a print-exception
	  binding.

2011-02-11  Andy Wingo  <wingo@pobox.com>

	repl.scm: use print-exception
	* module/system/repl/repl.scm: Remove custom exception printers in favor
	  of print-exception.

	(system repl error-handling) uses print-exception
	* module/system/repl/error-handling.scm (error-string): Just use
	  print-exception instead of rolling our own printer.
	  (call-with-error-handling): Simplify.

	add set-exception-printer!, print-exception to boot-9
	* module/ice-9/boot-9.scm (set-exception-printer!, print-exception):
	  Define an extensible exception-printing mechanism.
	  Also register printers for all keys thrown by Guile.
	  Inspired by a patch by Andreas Rottmann.

2011-02-11  Andy Wingo  <wingo@pobox.com>

	frame-source available in default environment
	* libguile/frames.c (scm_frame_source): Don't call out to (system vm
	  frames), as this routine is used when printing exceptions.  Make
	  available in the default environment (ugh).

	* module/system/vm/frame.scm: Remove frame-source definition and
	  export.

2011-02-10  Andy Wingo  <wingo@pobox.com>

	deprecate primitive properties
	* libguile.h:
	* libguile/Makefile.am:
	* libguile/deprecated.h:
	* libguile/deprecated.c:
	* libguile/init.c:
	* libguile/properties.c:
	* libguile/properties.h: Deprecate the "primitive properties"
	  interface.  It was only used to implement object properties, and that
	  is no longer the case.

	* module/ice-9/boot-9.scm (make-object-property): Reimplement just in
	  terms of weak hash tables, and make threadsafe.

	* NEWS:
	* doc/ref/api-utility.texi: Update.

2011-02-10  Andy Wingo  <wingo@pobox.com>

	ports.c safely accesses the port weak hash table
	* libguile/ports.h (scm_i_remove_port): Remove declaration, as it was
	  SCM_INTERNAL.
	* libguile/ports.c (scm_add_to_port_table): Issue a deprecation
	  warning if this function is called.  Remove needless SCM_API
	  declaration, it was already declared as such in ports.h.  Safely
	  access the port table.
	  (scm_i_remove_port): Remove bogus comment about lack of need for
	  threadsafety.  Take the port table mutex.
	  (scm_close_port): No need to take port table mutex around calling
	  scm_i_remove_port.

	pre-deprecate scm_ptobs
	* libguile/ports.h (scm_t_ptob_descriptor): Add comment about impending
	  ptob deprecation.

	fix potential concurrency bugs in port-for-each
	* libguile/ports.c (scm_c_port_for_each): Simplify to avoid concurrency-
	  and gc-related bugs.

	comment on scm_pre_modules_obarray re threadsafety
	* libguile/modules.c (scm_pre_modules_obarray): Add comment to the
	  effect that this global variable does not need a lock around it.

	instructions.c: threadsafe static var
	* libguile/instructions.c (fetch_instruction_table): Lock access to the
	  static, lazily-generated table.

	make static hash table access thread-safe in foreign.c
	* libguile/foreign.c (register_weak_reference): Wrap static hash table
	  access in a mutex.

	fix potential deadlock in issue-deprecation-warning
	* libguile/deprecation.c (scm_c_issue_deprecation_warning): Avoid
	  printing to a Scheme port while in a mutex.

2011-02-10  Ludovic Courtès  <ludo@gnu.org>

	"latin1" -> "Latin-1".
	Reported by Ralf Wildenhues.

	* doc/ref/vm.texi (Loading Instructions): Use "Latin-1", not "latin1".

2011-02-10  Ludovic Courtès  <ludo@gnu.org>

	Add `scm_i_set_default_port_encoding' and `scm_i_default_port_encoding'.
	* libguile/ports.c (scm_i_set_default_port_encoding,
	  scm_i_default_port_encoding): New function.  Replace
	  `scm_i_set_port_encoding_x' and `scm_i_get_port_encoding' with
	  PORT == SCM_BOOL_F.
	  (scm_i_set_port_encoding_x): Assume PORT is a port.
	  (scm_i_get_port_encoding): Remove.
	  (scm_port_encoding): Adjust accordingly.
	  (scm_new_port_table_entry): Use `scm_i_default_port_encoding'.

	* libguile/ports.h (scm_i_get_port_encoding): Remove declarations.
	  (scm_i_default_port_encoding, scm_i_set_default_port_encoding): New
	  declarations.

	* libguile/posix.c (setlocale): Use `scm_i_set_default_port_encoding'.

2011-02-10  Ludovic Courtès  <ludo@gnu.org>

	Simplify `scm_i_set_port_encoding_x'.
	* libguile/ports.c (find_valid_encoding): Remove.
	  (scm_i_set_port_encoding_x): Remove call to `find_valid_encoding'.
	  Remove `valid_enc'.  Rename `enc' to `encoding'.

	* test-suite/tests/ports.test ("port-encoding"): New test prefix.

2011-02-10  Ludovic Courtès  <ludo@gnu.org>

	Add `read-delimited' tests.
	* test-suite/tests/rdelim.test ("read-delimited", "read-delimited!"):
	  New test prefixes.

2011-02-10  Andy Wingo  <wingo@pobox.com>

	getopt-long: arg parsing errors cause print and exit, not backtrace
	* module/ice-9/getopt-long.scm (fatal-error): New helper.  For errors
	  that come from the user -- i.e., not the grammar -- we will handle our
	  own error printing and call `exit' rather than relying on the root
	  catch handler.  This is more friendly to the user than a Scheme
	  backtrace.
	  (parse-option-spec, process-options, getopt-long): Call `fatal-error'
	  as appropriate.

	* test-suite/tests/getopt-long.test (pass-if-fatal-exception): New
	  helper, checks that a certain key was thrown to, and that suitable
	  output has been printed on an error port.
	  (deferr): Change to expect a 'quit key instead of 'misc-error.  Update
	  exceptions to not match the beginning of the string, as that will be
	  the program name.  Update tests to use pass-if-fatal-exception.

2011-02-10  Andy Wingo  <wingo@pobox.com>

	getopt-long cleanups
	* module/ice-9/getopt-long.scm (process-options): Use `match' in the
	  loop.  Clean up `eat' to not take the option being processed.

	getopt-long cleanup
	* module/ice-9/getopt-long.scm (process-options): Use more internal
	  definitions instead of let-bound functions to decrease the nesting
	  depth.

	getopt-long cleanup
	* module/ice-9/getopt-long.scm (looks-like-an-option): Remove obtuse use
	  of "some".

	getopt-long uses match:substring from (ice-9 regex)
	* module/ice-9/getopt-long.scm: Import (ice-9 regex), and use its
	  match:substring instead of our own.

	match-lambda in getopt-long
	* module/ice-9/getopt-long.scm (parse-option-spec): Use match-lambda to
	  parse the grammar.

	getopt-long uses srfi-9 records internally
	* module/ice-9/getopt-long.scm: #:keywords in the define-module block.
	  (option-spec): Define as a srfi-9 record instead of playing macro
	  games with boot-9 records.

	volatile locals in bootstrap evaluator
	* libguile/eval.c (eval): For SCM_M_PROMPT, mark the locals needed after
	  a longjmp as volatile.  Perhaps related to bug 32340.

2011-02-09  Andy Wingo  <wingo@pobox.com>

	more robust fallback error printer
	* libguile/throw.c (pre_init_throw): Deal with errors printing the
	  exception.

2011-02-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	docs: add missing parentheses in asin formula.
	* doc/r5rs/r5rs.texi (Numerical operations): Add parentheses
	around argument to sqrt.

	docs: fix markup in api-options.texi.
	* doc/ref/api-options.texi (Build Config): Use @env for GUILE_LOAD_PATH.

	fix typos in the manual bits generated from source comments.
	* libguile/bitvectors.c, libguile/chars.c,
	libguile/deprecated.c, libguile/numbers.c, libguile/random.c,
	libguile/read.c, libguile/root.c, libguile/srfi-1.c,
	libguile/srfi-13.c, libguile/srfi-14.c, libguile/uniform.c:
	Fix typos, add missing newlines.

	docs: fix typos in manual, and a couple in code comments.
	* doc/ref/api-binding.texi, doc/ref/api-compound.texi,
	doc/ref/api-control.texi, doc/ref/api-debug.texi,
	doc/ref/api-io.texi, doc/ref/api-macros.texi,
	doc/ref/api-procedures.texi, doc/ref/api-scheduling.texi,
	doc/ref/api-undocumented.texi, doc/ref/api-utility.texi,
	doc/ref/compiler.texi, doc/ref/goops.texi,
	doc/ref/libguile-concepts.texi, doc/ref/misc-modules.texi,
	doc/ref/posix.texi, doc/ref/r6rs.texi, doc/ref/slib.texi,
	doc/ref/srfi-modules.texi, doc/ref/sxml-match.texi,
	doc/ref/tools.texi, doc/ref/vm.texi, doc/ref/web.texi,
	doc/sources/env.texi, doc/sources/jimb-org.texi,
	doc/sources/scheme-concepts.texi, doc/sources/unix.texi,
	module/ice-9/optargs.scm: Fix typos.
	* doc/r4rs/r5rs.texi: Likewise.  Do not capitalize code symbols
	even at the start of a sentence.
	* doc/ref/api-data.texi: Likewise.  Also, remove executable bit.

2011-02-09  Andy Wingo  <wingo@pobox.com>

	abort on pre-boot throw without catch
	* libguile/throw.c (pre_init_throw): Abort instead of exit in the error
	  case.  Print out a message.

2011-02-09  Andy Wingo  <wingo@pobox.com>

	fix a couple of (system vm frame) accesses on boot errors
	* libguile/backtrace.c (display_error_body): Don't look up the
	  frame-source if Guile isn't initialized yet.  Fixes display-error
	  before boot has finished.

	* libguile/throw.c (handler_message): Likewise, don't backtrace before
	  boot has finished, because we can't load (system vm frame).

2011-02-09  Andy Wingo  <wingo@pobox.com>

	fix recursive throws if an error occurs at boot-time
	* libguile/throw.c (find_pre_init_catch): New internal helper.
	  (pre_init_throw): If we don't find a catch, print out a message and
	  abort.
	  (scm_init_throw): Declare pre-init-throw as taking at least one arg.

	remove dead code in init.c
	* libguile/init.c: Remove some dead code.

2011-02-09  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	docs: remove non-ASCII space from docs.
	* doc/ref/api-compound.texi (Vector Accessing from C): Replace
	0xa0 character with space.

2011-02-09  Andy Wingo  <wingo@pobox.com>

	readline uses define-once
	* guile-readline/ice-9/readline.scm: Use define-once.

2011-02-09  Andy Wingo  <wingo@pobox.com>

	add define-once
	* module/ice-9/boot-9.scm (define-once): New syntax.

	* doc/ref/api-binding.texi (Top Level):
	* NEWS: Add notes about define-once.

2011-02-09  Ludovic Courtès  <ludo@gnu.org>

	Improve type checking when invoking foreign functions.
	* libguile/foreign.c (unpack): Make sure X is a pointer before using
	  `SCM_POINTER_VALUE'.

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

2011-02-08  Andy Wingo  <wingo@pobox.com>

	uninstalled-env ordering tweaks to fix readline's file name
	* meta/uninstalled-env.in (subdirs_with_ltlibs): Remove "srfi".
	  Reorder the load-path and load-compiled-path to put the root dir after
	  guile-readline, so that relative canonicalization computes the correct
	  path for ice-9/readline.scm.

	module-use-interfaces! handles duplicate interfaces
	* module/ice-9/boot-9.scm (module-use-interfaces!): Fix to have the same
	  interface de-duplication characteristics as module-use!.

	remove readline-activator.scm
	* guile-readline/readline-activator.scm: Remove this file that was
	  deprecated in Guile 1.4.

2011-02-08  Ludovic Courtès  <ludo@gnu.org>

	Make `(format #f ...)' always Unicode-capable.
	* module/ice-9/format.scm (format): When DESTINATION is #f, use a
	  Unicode-capable output string port.

	* test-suite/tests/format.test ("format basic output")["default to
	  Unicode-capable port"]: New test.

2011-02-08  Andy Wingo  <wingo@pobox.com>

	fix scm_procedure on non-structs
	* libguile/procs.c (scm_procedure): Fix argument type check.

2011-02-08  Ludovic Courtès  <ludo@gnu.org>

	Have `define-wrapped-pointer-type' take a type name.
	* module/system/foreign.scm (define-wrapped-pointer-type): Add a
	  `type-name' argument instead of non-hygienically generating one.

	* test-suite/tests/foreign.test (foo): Update.

	* doc/ref/api-foreign.texi (Void Pointers and Byte Access): Update
	  accordingly.

2011-02-08  Andy Wingo  <wingo@pobox.com>

	fix quasiquote test
	* test-suite/tests/syntax.test ("quasiquote"): Fix unquote-splicing
	  extra args test to update for current behavior.

	hackily fix another case where display-exception would be apropos
	* module/system/repl/error-handling.scm (display-syntax-error)
	  (error-string): Until we get the exception-printing patch merged in,
	  copy display-syntax-error into error-handling so that we avoid
	  display-error.  Fixes bug 32365.

2011-02-08  Andy Wingo  <wingo@pobox.com>

	unquote and unquote-splicing can split multiple expressions
	* module/ice-9/psyntax.scm (quasiquote): Import new definition from
	  upstream psyntax, to allow unquote and unquote-splicing to take
	  multiple arguments.
	  (unquote, unquote-splicing): Adapt to not require a particular syntax
	  form.

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

2011-02-07  Ludovic Courtès  <ludo@gnu.org>

	Hack around a defect in `define-wrapped-pointer-type'.
	* module/system/foreign.scm (define-wrapped-pointer-type): Choose
	  TYPE-NAME deterministically.

2011-02-07  Ludovic Courtès  <ludo@gnu.org>

	Add tests for `memq' and `memv'.
	This is a follow-up to a75ea6589642270adf933b85a15d96a74ff59225 ("fix
	memq/memv inlining").

	* test-suite/tests/list.test ("memq", "memv"): New test prefixes.

2011-02-07  Andy Wingo  <wingo@pobox.com>

	fix memq/memv inlining
	* module/language/tree-il/inline.scm (boolean-value): Add a case for
	  applications of primitives, and move the memq/memv->bool code here.
	  (inline!): We were inlining (memq 'a '(a b c)) => #t, and not the list
	  tail, which was an embarrassing bug.  Fixed by moving this code to the
	  boolean-value function.  Thanks to Mark Harig for the report.

	hack around bug in port-filename
	* module/ice-9/boot-9.scm (define-module): Until the port-filename bug
	  is fixed, hack around it.

2011-02-03  Mark H Weaver  <mhw@netris.org>

	Improved exactness handling for complex number parsing
	When parsing non-real complex numbers, apply exactness specifiers on
	per-component basis, as is done in PLT Scheme.  For complex numbers
	written in rectangular form, exactness specifiers are applied to the
	real and imaginary parts before calling scm_make_rectangular.  For
	complex numbers written in polar form, exactness specifiers are applied
	to the magnitude and angle before calling scm_make_polar.

	There are two kinds of exactness specifiers: forced and implicit.  A
	forced exactness specifier is a "#e" or "#i" prefix at the beginning of
	the entire number, and applies to both components of a complex number.
	"#e" causes each component to be made exact, and "#i" causes each
	component to be made inexact.  If no forced exactness specifier is
	present, then the exactness of each component is determined
	independently by the presence or absence of a decimal point or hash mark
	within that component.  If a decimal point or hash mark is present, the
	component is made inexact, otherwise it is made exact.

	After the exactness specifiers have been applied to each component, they
	are passed to either scm_make_rectangular or scm_make_polar to produce
	the final result.  Note that this will result in a real number if the
	imaginary part, magnitude, or angle is an exact 0.

	Previously, both forced and implicit exactness specifiers applied to
	the number as a whole _after_ calling scm_make_rectangular or
	scm_make_polar.

	For example, (string->number "#i5.0+0i") now does the equivalent of:

	  (make-rectangular (exact->inexact 5.0) (exact->inexact 0))

	which yields 5.0+0.0i.  Previously it did the equivalent of:

	  (exact->inexact (make-rectangular 5.0 0))

	which yielded 5.0.

	* libguile/numbers.c (mem2ureal): Receive a forced exactness specifier
	  (forced_x), create and maintain our own implicit exactness specifier
	  flag local to this component (implicit_x), and apply these exactness
	  specifiers within this function.  Previously, we received a pointer to
	  an implicit exactness specifier flag from above, and the exactness
	  specifiers were applied from within scm_i_string_length.

	  (mem2complex): Receive a forced exactness specifier parameter and pass
	  it down to mem2ureal.  Previously, we passed down a pointer to an
	  implicit exactness specifier flag instead.

	  (scm_i_string_to_number): No longer create an implicit exactness
	  specifier flag here, and do not apply exactness specifiers here.  All
	  we do here now regarding exactness is to parse the "#e" or "#i" prefix
	  (if any) and pass this information down to mem2ureal via mem2complex
	  in the form of an explicit exactness specifier (forced_x).

	  (scm_c_make_polar): If the cosine and sine of the angle are both NaNs
	  and the magnitude is zero, return 0.0+0.0i instead of +nan.0+nan.0i.
	  This case happens when the angle is not finite.

	* test-suite/tests/numbers.test (string->number): Move the test cases
	  for non-real complex numbers into a separate table in which the
	  expected real and imaginary parts are separate entries.  Add several
	  new test cases.

2011-02-03  Mark H Weaver  <mhw@netris.org>

	Fix non-portable usage of `isinf' in `max' and `min'
	* numbers.c: Add new macros DOUBLE_IS_POSITIVE_INFINITY and
	  DOUBLE_IS_NEGATIVE_INFINITY.
	  (scm_max, scm_min): Use the new macros to detect particular
	  infinities.  Previously we checked the return value of `isinf'
	  to determine the sign of the infinity, but that is not portable.

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

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

	Fix `GUILE_THREAD_LOCAL_STORAGE'.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Fix M4 quotation.

	Enclose SRFI-13 deprecation handling in `#if SCM_ENABLE_DEPRECATED == 1'.
	* libguile/srfi-13.c (scm_string_filter, scm_string_delete): Enclose
	  deprecated call convention handling in `#if SCM_ENABLE_DEPRECATED == 1'.

2011-02-02  Andy Wingo  <wingo@pobox.com>

	fix srfi-13 test argument orders
	* test-suite/tests/srfi-13.test ("string-filter", "string-delete"): Fix
	  argument order in tests.

2011-02-02  Mark H Weaver  <mhw@netris.org>

	Support non-real complex numbers with inexact zero imaginary part
	Add the ability to represent non-real complex numbers whose imaginary
	part is an _inexact_ zero (0.0 or -0.0), per R6RS.  Previously, such
	numbers were immediately changed into inexact reals.

	* libguile/numbers.c: Remove from the list of `General assumptions' in
	  numbers.c that objects satisfying SCM_COMPLEXP() have a non-zero
	  complex component.  This is no longer true.  Also add a warning
	  about another unrelated assumption that is not entirely correct
	  (that floor(r) == r implies that mpz_set_d will DTRT; it won't
	  if r is infinite).

	  (icmplx2str): Always print the imaginary part, even if it is zero.
	  Also handle a negative zero imaginary part more gracefully.  It
	  now prints 0.0-0.0i, where previously it would print 0.0+-0.0i.

	  (mem2ureal): Replace scm_from_double (0.0) with flo0.

	  (scm_c_make_rectangular): Always create non-real complex numbers.
	  Previously it would create inexact reals if the specified imaginary
	  part was zero.

	  (scm_make_rectangular): If the imaginary part is an _exact_ 0, return
	  the real part unchanged (possibly exact), otherwise return a non-real
	  complex number (possibly with an inexact zero imaginary part).
	  Previously, it would return an inexact real number whenever the
	  imaginary part was any kind of zero.

	  (scm_make_polar): If the magnitude is an exact 0, return an exact 0.
	  If the angle is an exact 0, return the magnitude unchanged (possibly
	  exact).  Otherwise return a non-real complex number (possibly with an
	  inexact zero imaginary part).  Previously, it would return a real
	  number whenever the imaginary part was any kind of zero.

	  (scm_imag_part): Return an exact 0 if applied to a real number.
	  Previously it would return an inexact zero if applied to an inexact
	  real number.

	  (scm_inexact_to_exact): Accept complex numbers with inexact zero
	  imaginary part.  In that case, simply use the real part and ignore the
	  imaginary part.  Essentially we coerce the inexact zero imaginary part
	  to an exact 0.

	* test-suite/tests/numbers.test: Add many test cases, and modify
	  existing tests as needed to reflect these changes.  Also add a new
	  internal predicate: `almost-real-nan?' which tests for a non-real
	  complex number with zero imaginary part whose real part is a NaN.

	* doc/ref/api-data.texi (Complex Numbers): Update description of complex
	  numbers to reflect these changes: non-real complex numbers in Guile
	  need not have non-zero imaginary part.  Also, each part of a complex
	  number may be any inexact real, not just rationals as was previously
	  stated.  Explicitly mention that each part may be an infinity, a NaN,
	  or a signed zero.

	  (Complex Number Operations): Change the formal parameter names of
	  `make-polar' from `x' and `y' to `mag' and `ang'.

	* NEWS: Add news entries.

2011-02-02  Mark H Weaver  <mhw@netris.org>

	Improve handling of signed zeroes
	* libguile/numbers.c (scm_abs): (abs -0.0) now returns 0.0.  Previously
	  it returned -0.0.  Also move the REALP case above the BIGP case,
	  and consider it SCM_LIKELY to be REALP if not INUMP.
	  (scm_difference): (- 0 0.0) now returns -0.0.  Previously it returned
	  0.0.  Also make sure that (- 0 0.0+0.0i) will return -0.0-0.0i.

	* test-suite/tests/numbers.test (abs, -): Add test cases, and change
	  some tests to use `eqv?' instead of `=', in order to test exactness
	  and distinguish signed zeroes.

2011-02-02  Mark H Weaver  <mhw@netris.org>

	Trigonometric functions return exact numbers in some cases
	* libguile/numbers.c (scm_sin, scm_cos, scm_tan, scm_asin, scm_acos,
	  scm_atan, scm_sinh, scm_cosh, scm_tanh, scm_sys_asinh, scm_sys_acosh,
	  scm_sys_atanh): Return an exact result in some cases.

	* test-suite/tests/numbers.test: Add test cases.

	* NEWS: Add NEWS entry

2011-02-02  Mark H Weaver  <mhw@netris.org>

	Fix `min' and `max' handling of NaNs, infinities, and signed zeroes
	* libguile/numbers.c (scm_min, scm_max): Properly order the real
	  infinities and NaNs, per R6RS, and also take care to handle signed
	  zeroes properly.  Note that this ordering is different than that of
	  `<', `>', `<=', and `>=', which return #f if any argument is a real
	  NaN, and consider the real zeroes to be equal.  The relevant real
	  infinity (-inf.0 for min, +inf.0 for max) beats everything, including
	  NaNs, and NaNs beat everything else.  Previously these were handled
	  improperly in some cases, e.g.:
	  (min 1/2 +nan.0) now returns +nan.0 (previously returned 0.5),
	  (max 1/2 +nan.0) now returns +nan.0 (previously returned 0.5),
	  (min -inf.0 +nan.0) now returns -inf.0 (previously returned +nan.0),
	  (max +inf.0 +nan.0) now returns +inf.0 (previously returned +nan.0),
	  (min -0.0  0.0) now returns -0.0 (previously returned  0.0),
	  (max  0.0 -0.0) now returns  0.0 (previously returned -0.0),
	  (max  0   -0.0) now returns  0.0 (previously returned -0.0),
	  (max -0.0  0  ) now returns  0.0 (previously returned -0.0).

	* test-suite/tests/numbers.test (min, max): Add many more test cases
	  relating to NaNs, infinities, and signed zeroes.  Change most existing
	  test cases to use `eqv?' instead of `=', in order to check exactness.

2011-02-02  Noah Lavine  <nlavine@haverford.edu>

	macro documentation fixup
	* doc/ref/api-macros.texi: make the difference between pattern variables
	  and lexical variables a bit clearer.

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

	Disable use of thread-local storage on FreeBSD.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Explicitly require
	  `AC_CANONICAL_HOST'.  Disable on FreeBSD.

	Update `NEWS'.
	* NEWS: Update.

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

	R6RS: Have `put-char', `put-string', etc. raise an `&i/o-encoding-error'.
	* module/rnrs/io/ports.scm (&i/o-encoding): New error condition type.
	  (with-i/o-encoding-error): New macro.
	  (put-char, put-datum, put-string): Use it.

	* test-suite/tests/r6rs-ports.test ("8.2.6  Input and output
	  ports")["transcoded-port, output [error handling mode = raise]"]: New
	  test.

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

	Change `scm_encoding_error' to pass the port and faulty character.
	* libguile/strings.c (scm_encoding_error): Remove the `from', `to', and
	  `string_or_bv' parameters; add `port' and `chr'.
	  (scm_to_stringn): Update accordingly.

	* libguile/strings.h (scm_encoding_error): Update accordingly.

	* libguile/ports.c (scm_ungetc): Update accordingly.

	* libguile/print.c (iprin1, scm_write_char): Update accordingly.

	* test-suite/tests/encoding-escapes.test ("display output
	  errors")["ultima", "Rashomon"]: Check the arguments of
	  `encoding-error'.
	  ["tekniko"]: New test.

	* test-suite/tests/ports.test ("string ports")["wrong encoding"]: Adjust
	  to new `encoding-error' arguments.

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

	Upon port encoding error, always write as much as possible.
	* libguile/print.c (display_string): Upon error, always write the
	  OUTPUT_LEN bytes of output, regardless of the conversion strategy.

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

	R6RS: Have `get-char', `get-line', etc. raise an `&i/o-decoding-error'.
	* module/rnrs/io/ports.scm (&i/o-decoding): New error condition type.
	  (with-i/o-decoding-error): New macro.
	  (get-char, get-datum, get-line, get-string-all, lookahead-char): Use
	  it.

	* test-suite/tests/r6rs-ports.test ("8.2.6  Input and output
	  ports")["transcoded-port [error handling mode = raise]"]: Use `guard'
	  and `i/o-decoding-error?'.

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

	Avoid circular dependency between (rnrs base) and (rnrs exceptions).
	* module/rnrs/base.scm (raise): Define as a macro instead of a
	  procedure.

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

	Have `read-char' & co. throw to `decoding-error'.
	* libguile/ports.c (scm_read_char): Mention `decoding-error' in the
	  docstring.
	  (get_codepoint): Change to return an error code; add `codepoint'
	  output parameter.  Don't raise an error from here.
	  (scm_getc): Raise an error with `scm_decoding_error' if
	  `get_codepoint' returns an error.
	  (scm_peek_char): Likewise.  Update docstring.

	* libguile/strings.c (scm_decoding_error_key): New variable.
	  (scm_decoding_error): New function.
	  (scm_from_stringn): Use `scm_decoding_error' instead of
	  `scm_encoding_error'.

	* libguile/strings.h (scm_decoding_error): New declaration.

	* test-suite/tests/ports.test ("string ports")["read-char, wrong
	  encoding, error"]: Change to expect `decoding-error'.  Make sure PORT
	  points past the error.
	  ["read-char, wrong encoding, escape"]: Likewise.
	  ["peek-char, wrong encoding, error"]: New test.

	* test-suite/tests/r6rs-ports.test ("7.2.11 Binary
	  Output")["put-bytevector with wrong-encoding string port"]: Change to
	  expect `decoding-error'.
	  ("8.2.6  Input and output ports")["transcoded-port [error handling
	  mode = raise]"]: Likewise.

	* test-suite/tests/rdelim.test ("read-line")["decoding error", "decoding
	  error, substitute"]: New tests.

	* doc/ref/api-io.texi (Reading): Update documentation of `read-char' and
	  `peek-char'.
	  (Line/Delimited): Update documentation of `read-line'.

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

	Use `#ifdef HAVE_...', not `#if'.
	* test-suite/standalone/test-round.c (test_scm_c_round): Use `#ifdef
	  HAVE_FESETROUND', not `#if'.

	Fix typo.
	* libguile/srfi-1.c (scm_srfi1_concatenate_x): Fix `FUNC_NAME'.

2011-02-02  Michael Gran  <spk121@yahoo.com>

	Use 'substring' instead of obsoleted 'make-shared-substring'
	* module/system/repl/describe.scm (display-description): replace
	  make-shared-substring with substring

2011-02-01  Andreas Rottmann  <a.rottmann@gmx.at>

	Fix `show' REPL meta-command
	* module/system/repl/command.scm (warranty, copying, version): Use
	  `define-meta-command' to define these procedures, so they are entered
	  into the *command-infos* table.

2011-02-01  Mark H Weaver  <mhw@netris.org>

	Improve discussion of exactness propagation in manual
	* doc/ref/api-data.texi (Exact and Inexact Numbers): Improve the
	  discussion of exactness propagation.  Mention that there are
	  exceptions to the rule that calculations involving inexact numbers
	  must product an inexact result.

	Move comment about trig functions back where it belongs
	* libguile/numbers.c: Move a comment about the trigonometric functions
	  next to those functions.  At some point they became separated, when
	  scm_expt was placed between them.

2011-02-01  Mark H Weaver  <mhw@netris.org>

	Handle products with exact 0 differently
	* libguile/numbers.c (scm_product): Handle exact 0 differently.  A
	  product containing an exact 0 now returns an exact 0 if and only if
	  the other arguments are all exact.  An inexact zero is returned if and
	  only if the other arguments are all finite but not all exact.  If an
	  infinite or NaN value is present, a NaN value is returned.
	  Previously, any product containing an exact 0 yielded an exact 0,
	  regardless of the other arguments.

	  A note on the rationale for (* 0 0.0) returning 0.0 and not exact 0:
	  The exactness propagation rules allow us to return an exact result in
	  the presence of inexact arguments only if the values of the inexact
	  arguments do not affect the result.  In this case, the value of the
	  inexact argument _does_ affect the result, because an infinite or NaN
	  value causes the result to be a NaN.

	  A note on the rationale for (* 0 +inf.0) being a NaN and not exact 0:
	  The R6RS requires that (/ 0 0.0) return a NaN value, and that (/ 0.0)
	  return +inf.0.  We would like (/ x y) to be the same as (* x (/ y)),
	  and in particular, for (/ 0 0.0) to be the same as (* 0 (/ 0.0)),
	  which reduces to (* 0 +inf.0).  Therefore (* 0 +inf.0) should return
	  a NaN.

	* test-suite/tests/numbers.test: Add many multiplication tests.

	* NEWS: Add NEWS entry.

2011-02-01  Mark H Weaver  <mhw@netris.org>

	More discriminating NaN predicates for numbers.test
	* test-suite/tests/numbers.test: (real-nan?, complex-nan?,
	  imaginary-nan?): Add more discriminating NaN testing predicates
	  internal to numbers.test, and convert several uses of `nan?'
	  to use these instead:
	   * `real-nan?' checks that its argument is real and a NaN.
	   * `complex-nan?' checks that both the real and imaginary
	                    parts of its argument are NaNs.
	   * `imaginary-nan?' checks that its argument's real part
	                      is zero and the imaginary part is a NaN.

2011-02-01  Mark H Weaver  <mhw@netris.org>

	Fix bugs in `rationalize'
	* libguile/numbers.c (scm_rationalize): Fix bugs.  Previously, it
	  returned exact integers unmodified, although that was incorrect if
	  the epsilon was at least 1 or inexact, e.g. (rationalize 4 1) should
	  return 3 per R5RS and R6RS, but previously it returned 4.  Also
	  handle cases involving infinities and NaNs properly, per R6RS.

	* test-suite/tests/numbers.test: Add test cases for `rationalize'.

	* NEWS: Add NEWS entry

2011-02-01  Mark H Weaver  <mhw@netris.org>

	Fix and combine NEWS entries on `infinite?' and `finite?'
	* NEWS: Fix and combine NEWS entries on `infinite?' and `finite?'.
	  Previous, they stated that these predicates now work on non-real
	  complex numbers, but that is not the case.

2011-02-01  Mark H Weaver  <mhw@netris.org>

	Update copyright date of manual, and a small fix
	* doc/ref/guile.texi: Update copyright date to 2011.

	* doc/ref/r6rs.texi (rnrs base): Fix typo: `rem0' -> `div0'.

2011-01-31  Andy Wingo  <wingo@pobox.com>

	update NEWS
	* NEWS: Update.

2011-01-31  Mark H Weaver  <mhw@netris.org>

	Improve extensibility of `expt' and `integer-expt'
	* libguile/numbers.c (scm_integer_expt): No longer require that the
	  first argument be a number, in order to improve extensibility.  This
	  allows us to efficiently raise arbitrary objects to an integer power
	  as long as we can multiply those objects.  For example, this allows us
	  to efficiently exponentiate matrices if we define only multiplication
	  methods for matrices.  Note also that scm_expt calls this procedure
	  whenever the exponent is an integer, regardless of the type of the
	  first argument.  Also rearrange the order in which we test special
	  cases.

	* test-suite/tests/numbers.test (expt, integer-expt): Comment out tests
	  that required `(expt #t 0)' and `(integer-expt #t 0)' to throw
	  exceptions.  Add tests for (expt #t 2) and `(integer-expt #t 2)
	  instead.

	* NEWS: Add NEWS entry

2011-01-31  Andy Wingo  <wingo@pobox.com>

	toplevel vars added by syntax expansion are unbound
	* module/ice-9/psyntax.scm (chi-top): When adding to the toplevel
	  environment at compile-time, default to undefined variables, not
	  variables defined to #f.

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

	* module/ice-9/boot-9.scm (module-add!): Add a new pre-modules version
	  of this function, so we can add variables the environment, not just
	  values.
	  (module-define!): Use module-add!.

2011-01-31  Mark H Weaver  <mhw@netris.org>

	Rename {euclidean,centered}_quo_rem to {euclidean,centered}_divide
	* libguile/numbers.c (euclidean_quo_rem): Rename to euclidean_divide.
	  (centered_quo_rem): Rename to {euclidean,centered}_divide.

	* libguile/numbers.h: Rename euclidean_quo_rem to euclidean_divide and
	  centered_quo_rem to centered_divide.

	* doc/ref/api-data.texi: Rename euclidean_quo_rem to euclidean_divide and
	  centered_quo_rem to centered_divide.

2011-01-31  Ludovic Courtès  <ludo@gnu.org>

	Disable stand-alone tests that require `dlopen' when `--disable-shared'.
	* configure.ac (HAVE_SHARED_LIBRARIES): New Automake conditional.

	* test-suite/standalone/Makefile.am (check_SCRIPTS): Add `test-asmobs',
	  `test-ffi', and `test-extensions' only when `HAVE_SHARED_LIBRARIES'.

2011-01-31  Mark H Weaver  <mhw@netris.org>

	Rework the testing framework for number-theoretic division operators
	* test-suite/tests/numbers.test (test-eqv?): Remove special handling of
	  zeroes.  Zeroes are now compared like all other numbers.  Exact
	  numbers are compared with `eqv?' and inexact numbers are compared to
	  within test-epsilon.

	  Rework the testing framework for number-theoretic division operators:
	  `euclidean/', `euclidean-quotient', `euclidean-remainder',
	  `centered/', `centered-quotient', and `centered-remainder'.
	  Previously we compared all test results against a simple scheme
	  implementation of the same operations.  However, these operations have
	  discontinuous jumps where a tiny change in the inputs can lead to a
	  large change in the outputs, e.g.:

	    (euclidean/ 130.00000000000 10/7) ==> 91.0 and 0.0
	    (euclidean/ 129.99999999999 10/7) ==> 90.0 and 1.42857142856141

	  In the new testing scheme, we compare values against the simple
	  implementations only if the input arguments contain an infinity or a
	  NaN.  In the common case of two finite arguments, we simply make sure
	  that the outputs of all three operators (e.g. `euclidean/',
	  `euclidean-quotient', `euclidean-remainder') equal each other, that
	  outputs are exact iff both inputs are exact, and that the required
	  properties of the operator are met: that Q is an integer, that R is
	  within the specified range, and that N = Q*D + R.

2011-01-30  Ludovic Courtès  <ludo@gnu.org>

	Add `pointer?'.
	* libguile/foreign.c (scm_pointer_p): New function.
	* libguile/foreign.h (scm_pointer_p): New declaration.
	* module/system/foreign.scm: Export `pointer?'.

	* test-suite/tests/foreign.test ("null pointer")["pointer?"]: New
	  test.
	  ("make-pointer")["pointer?"]: New test.

	* doc/ref/api-foreign.texi (Foreign Variables): Document `pointer?'.

2011-01-30  Ludovic Courtès  <ludo@gnu.org>

	Remove the "has finalizer?" bit from pointer objects.
	* libguile/foreign.h (SCM_POINTER_HAS_FINALIZER): Remove.

	* libguile/foreign.c (scm_from_pointer): Store nothing more than
	  `scm_tc7_pointer' in the type slot.

2011-01-30  Ludovic Courtès  <ludo@gnu.org>

	Add `define-wrapped-pointer-type'.
	* module/system/foreign.scm (define-wrapped-pointer-type): New macro.

	* doc/ref/api-foreign.texi (Foreign Types): Mention the `*' symbol.
	  (Void Pointers and Byte Access): Document `define-wrapped-pointer-type'.

	* test-suite/tests/foreign.test ("define-wrapped-pointer-type"): New
	  test prefix.

2011-01-30  Mark H Weaver  <mhw@netris.org>

	Improve extensibility of core numeric procedures
	* libguile/numbers.c (scm_quotient, scm_remainder, scm_modulo,
	  scm_zero_p, scm_positive_p, scm_negative_p, scm_real_part,
	  scm_imag_part, scm_numerator, scm_denominator, scm_magnitude,
	  scm_angle, scm_exact_to_inexact): Change from SCM_GPROC to
	  SCM_PRIMITIVE_GENERIC.  As a side effect, all of these procedures now
	  have documentation strings.

	  (scm_exact_p, scm_inexact_p, scm_odd_p, scm_even_p, scm_finite_p,
	  scm_inf_p, scm_nan_p, scm_expt, scm_inexact_to_exact, scm_log,
	  scm_log10, scm_exp, scm_sqrt): Change from SCM_DEFINE to
	  SCM_PRIMITIVE_GENERIC, and make sure the code allows these functions
	  to be extended in practice.

	  (scm_real_part, scm_imag_part, scm_numerator, scm_denominator,
	  scm_inexact_to_exact): Simplify type dispatch code.

	  (scm_sqrt): Rename formal argument from x to z, since complex numbers
	  are supported.

	  (scm_abs): Fix empty FUNC_NAME.

	* libguile/numbers.h (scm_finite_p): Add missing prototype.

	  (scm_inf_p, scm_nan_p): Rename formal parameter from n to x, since
	  the domain is the real numbers.

	* test-suite/tests/numbers.test: Test for documentation strings.  Change
	  from `expect-fail' to `pass-if' for several of these, and add tests
	  for others.  Also add other tests for `real-part' and `imag-part',
	  which previously had none.

2011-01-30  Mark H Weaver  <mhw@netris.org>

	Add two new sets of fast quotient and remainder operators
	* libguile/numbers.c (scm_euclidean_quo_and_rem, scm_euclidean_quotient,
	  scm_euclidean_remainder, scm_centered_quo_and_rem,
	  scm_centered_quotient, scm_centered_remainder): New extensible
	  procedures `euclidean/', `euclidean-quotient', `euclidean-remainder',
	  `centered/', `centered-quotient', `centered-remainder'.

	* libguile/numbers.h: Add function prototypes.

	* module/rnrs/base.scm: Remove incorrect stub implementations of `div',
	  `mod', `div-and-mod', `div0', `mod0', and `div0-and-mod0'.  Instead do
	  renaming imports of `euclidean-quotient', `euclidean-remainder',
	  `euclidean/', `centered-quotient', `centered-remainder', and
	  `centered/', which are equivalent to the R6RS operators.

	* module/rnrs/arithmetic/fixnums.scm (fxdiv, fxmod, fxdiv-and-mod,
	  fxdiv0, fxmod0, fxdiv0-and-mod0): Remove redundant checks for division
	  by zero and unnecessary complexity.
	  (fx+/carry): Remove unneeded calls to `inexact->exact'.

	* module/rnrs/arithmetic/flonums.scm (fldiv, flmod, fldiv-and-mod,
	  fldiv0, flmod0, fldiv0-and-mod0): Remove redundant checks for division
	  by zero and unnecessary complexity.  Remove unneeded calls to
	  `inexact->exact' and `exact->inexact'

	* test-suite/tests/numbers.test: (test-eqv?): New internal predicate for
	  comparing numerical outputs with expected values.

	  Add extensive test code for `euclidean/', `euclidean-quotient',
	  `euclidean-remainder', `centered/', `centered-quotient',
	  `centered-remainder'.

	* test-suite/tests/r6rs-arithmetic-fixnums.test: Fix some broken test
	  cases, and remove `unresolved' test markers for `fxdiv', `fxmod',
	  `fxdiv-and-mod', `fxdiv0', `fxmod0', and `fxdiv0-and-mod0'.

	* test-suite/tests/r6rs-arithmetic-flonums.test: Remove `unresolved'
	  test markers for `fldiv', `flmod', `fldiv-and-mod', `fldiv0',
	  `flmod0', and `fldiv0-and-mod0'.

	* doc/ref/api-data.texi (Arithmetic): Document `euclidean/',
	  `euclidean-quotient', `euclidean-remainder', `centered/',
	  `centered-quotient', and `centered-remainder'.

	  (Operations on Integer Values): Add cross-references to `euclidean/'
	  et al, from `quotient', `remainder', and `modulo'.

	* doc/ref/r6rs.texi (rnrs base): Improve documentation for `div', `mod',
	  `div-and-mod', `div0', `mod0', and `div0-and-mod0'.  Add
	  cross-references to `euclidean/' et al.

	* NEWS: Add NEWS entry.

2011-01-30  Mark H Weaver  <mhw@netris.org>

	Add SCM_LIKELY and SCM_UNLIKELY for optimization
	* libguile/numbers.c (scm_abs, scm_quotient, scm_remainder, scm_modulo):
	  Add SCM_LIKELY and SCM_UNLIKELY in several places for optimization.

	  (scm_remainder): Add comment about C99 "%" semantics.
	  Strip away a redundant set of braces.

2011-01-30  Mark H Weaver  <mhw@netris.org>

	Fix GOOPS method compilation bug when no next-method exists
	* module/oop/goops/compile.scm (compute-cmethod): Fix a bug
	  that caused the method compiler to barf while compiling a
	  method that calls (next-method), if there is no applicable
	  next method.

2011-01-30  Mark H Weaver  <mhw@netris.org>

	Implement R6RS `real-valued?', `rational-valued?', `integer-valued?'
	* module/rnrs/base.scm (real-valued?, rational-valued?,
	  integer-valued?): Implement in compliance with R6RS.

	* test-suite/tests/r6rs-base.test: Add test cases for
	  `real-valued?', `rational-valued?', and `integer-valued?'.

	* NEWS: Add NEWS entries.

2011-01-30  Mark H Weaver  <mhw@netris.org>

	Infinities and NaNs are no longer rational
	* libguile/numbers.c (scm_rational_p): Return #f for infinities and
	  NaNs, per R6RS.  Previously it returned #t for real infinities
	  and NaNs.  They are still considered real by scm_real `real?'
	  however, per R6RS.  Also simplify the code.

	  (scm_real_p): New implementation to reflect the fact that the
	  rationals and reals are no longer the same set.  Previously it just
	  called scm_rational_p.

	  (scm_integer_p): Simplify the code.

	* test-suite/tests/numbers.test: Add test cases for `rational?'
	  and `real?' applied to infinities and NaNs.

	* doc/ref/api-data.texi (Real and Rational Numbers): Update docs to
	  reflect the fact that infinities and NaNs are no longer rational, and
	  that `real?'  no longer implies `rational?'.  Improve discussion of
	  infinities and NaNs.

	* NEWS: Add NEWS entries, and combine with an earlier entry about
	  infinities no longer being integers.

2011-01-30  Mark H Weaver  <mhw@netris.org>

	`equal?' and `eqv?' are now equivalent for numbers
	Change `equal?' to work like `eqv?' for numbers.
	Previously they worked differently in some cases, e.g.
	when comparing signed zeroes or NaNs.  For example,
	(equal? 0.0 -0.0) returned #t but (eqv? 0.0 -0.0)
	returned #f, and (equal? +nan.0 +nan.0) returned #f
	but (eqv? +nan.0 +nan.0) returned #t.

	* libguile/numbers.c (scm_real_equalp, scm_bigequal,
	  scm_complex_equalp, scm_i_fraction_equalp): Move to eq.c.

	* libguile/eq.c (scm_real_equalp): Compare flonums using
	  real_eqv instead of ==, so that NaNs are now considered
	  equal, and to distinguish signed zeroes.

	  (scm_complex_equalp): Compare real and imaginary
	  components using real_eqv instead of ==, so that NaNs are
	  now considered equal, and to distinguish signed zeroes.

	  (scm_bigequal): Use scm_i_bigcmp instead of duplicating it.

	  (real_eqv): Test for NaNs using isnan(x) instead of
	  (x != x), and use SCM_UNLIKELY for optimization.

	  (scm_eqv_p): Use scm_bigequal, scm_real_equalp,
	  scm_complex_equalp, and scm_i_fraction_equalp to compare
	  numbers, instead of inline code.  Those predicates now do
	  what scm_eqv_p formerly did internally.  Replace if
	  statements with switch statements, as is done in
	  scm_equal_p.  Remove useless code to check equality of
	  fractions with different SCM_CELL_TYPEs; this was for a
	  tentative "lazy reduction bit" which was never developed.

	  (scm_eqv_p, scm_equal_p): Remove useless code to check
	  equality between inexact reals and non-real complex numbers
	  with zero imaginary part.  Such numbers do not exist,
	  because the current code is careful to never create them.

	* test-suite/tests/numbers.test: Add test cases for
	  `eqv?' and `equal?'.  Change existing test case for
	  `(equal? +nan.0 +nan.0)' to expect #t instead of #f.

	* NEWS: Add NEWS entries.

2011-01-30  Mark H Weaver  <mhw@netris.org>

	Remove useless test and fix spelling errors
	* test-suite/tests/numbers.test: Remove test for lazy reduction bit of
	  fractions, which was never implemented.  Fix some spelling errors.

2011-01-29  Ludovic Courtès  <ludo@gnu.org>

	Don't remove `standard-library.texi' upon "make clean".
	* doc/ref/Makefile.am (CLEANFILES): Rename to...
	  (DISTCLEANFILES): ... this.  So that "make clean" doesn't remove
	  `standard-library.texi'.  Reported by Hans Åberg <haberg-1@telia.com>.

	Add missing include for MinGW.
	* libguile/ports.h: Include <unistd.h>.

	Make `inet-ntop' and `inet-pton' available even when !HAVE_IPV6.
	* libguile/socket.c (scm_inet_pton, scm_inet_ntop): Move out of `#ifdef
	  HAVE_IPV6' and conditionalize the IPv6-specific bits.  Reported by
	  Jan Nieuwenhuizen <janneke@gnu.org>.

2011-01-29  Jan Nieuwenhuizen  <janneke@gnu.org>

	When cross building, run GUILE_FOR_BUILD instead of just-built guile.
	* meta/guile.in: Run @GUILE_FOR_BUILD@ when cross-compiling.

2011-01-29  Ludovic Courtès  <ludo@gnu.org>

	Have `srfi-19.test' use the non-deprecated `format' style.
	* test-suite/tests/srfi-19.test: Fix all uses of `format' to pass a port
	  or Boolean as the first argument.

	Add a test for `send' and `recv!'.
	* test-suite/tests/socket.test ("AF_UNIX/SOCK_STREAM")["bind (bis)",
	  "listen (bis)", "recv!", "accept (bis)"]: New tests.

2011-01-29  Ludovic Courtès  <ludo@gnu.org>

	Have `recv!', `send', etc. accept a bytevector.
	* libguile/socket.c (scm_recv, scm_send, scm_recvfrom, scm_sendto):
	  Expect the buffer to be a bytevector.  Move the string-handling
	  code under `#if SCM_ENABLE_DEPRECATED == 1' and issue a deprecation
	  warning.

	* test-suite/tests/socket.test ("AF_UNIX/SOCK_DGRAM")["sendto",
	  "sendto/sockaddr"]: Adjust accordingly.

	* doc/ref/posix.texi (Network Sockets and Communication): Update
	  documentation of `recv!', `send', `recvfrom!', and `sendto'.

2011-01-29  Ludovic Courtès  <ludo@gnu.org>

	Add `-lgc' to `Libs' in `guile-2.0.pc'.
	This accounts for the fact that some public Guile macros and inline
	functions use libgc functions.

	* meta/guile-2.0.pc.in (Libs.private): Move @BDW_GC_LIBS@ to...
	  (Libs): ... here.  Reported by Hans Aberg <haberg-1@telia.com>.

	* meta/guile-2.0-uninstalled.pc.in: Likewise.

2011-01-28  Andy Wingo  <wingo@pobox.com>

	update api-evaluation.texi
	* doc/ref/api-evaluation.texi (Compilation): Update compile-file and
	  compiled-file-name docs.

2011-01-28  Mark H Weaver  <mhw@netris.org>

	Fix bugs when negating SCM_MOST_POSITIVE_FIXNUM+1
	* libguile/numbers.c (scm_difference, scm_product):
	  Fix bugs when negating SCM_MOST_POSITIVE_FIXNUM+1,
	  aka -SCM_MOST_NEGATIVE_FIXNUM.  Previously, these cases
	  failed to normalize the result to a fixnum, causing
	  `=', `eqv?' and `equal?' to fail, e.g.:
	  (= most-negative-fixnum (- 0 (- most-negative-fixnum)))
	  (= most-negative-fixnum (* -1 (- most-negative-fixnum)))
	  (= most-negative-fixnum (* (- most-negative-fixnum) -1))

	* test-suite/test/numbers.test: Add test cases to detect
	  bugs when negating SCM_MOST_POSITIVE_FIXNUM+1 and
	  SCM_MOST_NEGATIVE_FIXNUM by various methods.

2011-01-28  Mark H Weaver  <mhw@netris.org>

	note inf? / nan? domain in NEWS
	* NEWS: Add NEWS entry.

2011-01-28  Andy Wingo  <wingo@pobox.com>

	domain of inf?, finite?, nan? is the real numbers
	* libguile/numbers.c (scm_inf_p, scm_finite_p, scm_nan_p): The domain of
	  these functions is the real numbers.  Error on other input.

	* doc/ref/api-data.texi (Reals and Rationals): Update the documentation
	  accordingly.

	* test-suite/tests/numbers.test ("finite?", "inf?"): Update tests.

2011-01-28  Mark H Weaver  <mhw@netris.org>

	Remove useless code from do_divide
	* libguile/numbers.c (do_divide): Remove code which handled a case
	  that never occurs: a zero bignum.

2011-01-28  Mark H Weaver  <mhw@netris.org>

	Optimize scm_exact_p by making use of SCM_INEXACTP
	* libguile/numbers.c (scm_exact_p): Optimize by making use of the
	  SCM_INEXACTP macro.
	  (scm_inexact_p): Move it next to scm_exact_p, and add else's.

	* test-suite/tests/numbers.test: Add test cases for `exact?'
	  and `inexact?' applied to infinities and NaNs.

2011-01-28  Mark H Weaver  <mhw@netris.org>

	Implement `finite?' in core and fix R6RS `finite?' and `infinite?'
	* libguile/numbers.c (scm_finite_p): Add new predicate `finite?' from
	  R6RS to guile core, which returns #t if and only if its argument is
	  neither infinite nor a NaN.  Note that this is not the same as (not
	  (inf? x)) or (not (infinite? x)), since NaNs are neither finite nor
	  infinite.

	* test-suite/tests/numbers.test: Add test cases for `finite?'.

	* module/rnrs/base.scm: Import `inf?' as `infinite?' instead of
	  reimplementing it.  Previously, the R6RS implementation of
	  `infinite?' did not detect non-real complex infinities, nor did it
	  throw exceptions for non-numbers.  (Note that NaNs _are_ considered
	  numbers by scheme, despite their name).

	  Import `finite?' instead of reimplementing it.  Previously, the R6RS
	  implementation of `finite?' returned #t for both NaNs and non-real
	  complex infinities, in violation of R6RS.

	* NEWS: Add NEWS entries, and reorganize existing numerics-related
	  entries together under one subheading.

	* doc/ref/api-data.texi (Real and Rational Numbers): Add docs for
	  `finite?' and scm_finite_p.

2011-01-28  Mark H Weaver  <mhw@netris.org>

	Add SCM_INUM1 to numbers.h, and make use of it and SCM_INUM0 in numbers.c
	* libguile/numbers.h: Add SCM_INUM1, a name for the fixnum 1.  This is
	  analogous to SCM_INUM0, a name for 0, which already existed.

	* libguile/numbers.c: Change occurrences of SCM_I_MAKINUM (0) and
	  SCM_I_MAKINUM (1) to SCM_INUM0 and SCM_INUM1, respectively.

2011-01-28  Mark H Weaver  <mhw@netris.org>

	Fix NEWS entry regarding changes to `expt' for zero base
	NEWS: Fix NEWS entry regarding changes to `expt' when base is zero

	Do not apply `inf?' or `nan?' to strings
	* module/ice-9/format.scm (format): Test to make sure an argument is a
	  number before applying `inf?' and `nan?' to it.  Formerly, format
	  would call `inf?' and `nan?' on arguments that might be either a
	  number or a string, although those predicates should ideally throw an
	  exception when applied to non-number objects.

	Fix incorrect FUNC_NAME for scm_current_processor_count
	* libguile/posix.c (scm_current_processor_count):
	  Fix incorrect FUNC_NAME (was s_scm_total_processor_count)

2011-01-27  Andy Wingo  <wingo@pobox.com>

	fix guile-tools getopt
	* meta/guile-tools.in (getopt): Define a local version of getopt that
	  stops parsing options when it sees a non-option.

	fix THANKS
	* THANKS: Fix.

2011-01-27  Andy Wingo  <wingo@pobox.com>

	for mmap objcodes, store the fd in the third word, as a scheme int
	This leaves space for native code.

	* libguile/objcodes.h (SCM_OBJCODE_NATIVE_CODE)
	  (SCM_SET_OBJCODE_NATIVE_CODE): Reserve the fourth word of objcode for
	  "native code", whatever that means.

	* libguile/objcodes.c: Update a comment.
	  (make_objcode_by_mmap): Put the fd in the third word.

2011-01-27  Andy Wingo  <wingo@pobox.com>

	objcode type is an enumeration, not flags
	* libguile/objcodes.h (SCM_OBJCODE_TYPE_MMAP)
	  (SCM_OBJCODE_TYPE_BYTEVECTOR, SCM_OBJCODE_TYPE_SLICE)
	  (SCM_OBJCODE_TYPE_STATIC): Enumerate objcode types instead of
	  expressing them as flags.
	  (SCM_OBJCODE_TYPE): Type is held in bits 8-15.
	  (SCM_OBJCODE_FLAGS): Flags are now shifted by 16 bits, not 8.
	  (SCM_MAKE_OBJCODE_TAG): New helper.

	* libguile/continuations.c (STATIC_OBJCODE_TAG):
	* libguile/control.c (STATIC_OBJCODE_TAG):
	* libguile/foreign.c (STATIC_OBJCODE_TAG):
	* libguile/gsubr.c (STATIC_OBJCODE_TAG):
	* libguile/smob.c (STATIC_OBJCODE_TAG):
	* libguile/objcodes.c (make_objcode_by_mmap, scm_c_make_objcode_slice)
	  (scm_bytecode_to_objcode): : Use SCM_MAKE_OBJCODE_TAG.

2011-01-27  Andy Wingo  <wingo@pobox.com>

	guile-tools gracefully errors for missing scripts
	* meta/guile-tools.in (find-script): Use the #:ensure arg of
	  resolve-module.
	  (main): Display a comprehensible error message if we don't find a
	  script.

	guile-tools uses getopt-long
	* meta/guile-tools.in: Use getopt-long.

	guile-tools uses srfi-1
	* meta/guile-tools.in (guile-tools): Use srfi-1 here, now that we can.

2011-01-27  Andy Wingo  <wingo@pobox.com>

	fix error handling in variable-ref family of instructions
	* libguile/vm-i-system.c (variable-ref, variable-set, variable-bound?):
	  Check that the argument is actually a variable.  Thanks to Kevin
	  Holmes for the report.

	* libguile/vm-engine.c (vm_engine): Error handling down here.

	* THANKS: Update.

2011-01-27  Ludovic Courtès  <ludo@gnu.org>

	Use `scm_from_latin1_stringn' in `objcodes.c'.
	* libguile/objcodes.c (make_objcode_by_mmap): Use
	  `scm_from_latin1_stringn', not `scm_from_locale_stringn', to display
	  the invalid cookie in the error case.

	Fix buffer overflow in `read-line'.
	* libguile/rdelim.c (SCM_DEFINE): Compare INDEX to LINE_BUFFER_SIZE, not
	  `sizeof (buf)'.

2011-01-26  Ludovic Courtès  <ludo@gnu.org>

	Add ECMAScript parser tests.
	* test-suite/tests/ecmascript.test ("parser"): Add parser tests for the
	  previous fixes.

2011-01-26  Noah Lavine  <nlavine@haverford.edu>

	Parse Decimal Numbers
	 * module/language/ecmascript/parse.scm: handle numbers with leading
	    decimals correctly.

	Fix Hex Constants
	 * module/language/ecmascript/tokenize.scm: hexadecimal constants can
	    now use 'X' in addition to 'x'.

	Ecmascript Syntax
	  * module/language/ecmascript/tokenize.scm: an unbreakable space
	      counts as whitespace.

	Ecmascript Syntax Fix
	  * module/language/ecmascript/parse.scm: allow empty function bodies.

2011-01-26  Ludovic Courtès  <ludo@gnu.org>

	Add a `read-line' benchmark.
	* benchmark-suite/benchmarks/ports.bm ("rdelim"): New benchmark prefix.

	Tweak `read-line'.
	* libguile/rdelim.c (LINE_BUFFER_SIZE): Set to 1 KiB instead of 4 KiB.
	  (scm_read_line): Initialize STRING to #f so we actually use the fast
	  path.

2011-01-26  Andy Wingo  <wingo@pobox.com>

	more sensible error if compiled-file-name returns false in compile-file
	* module/system/base/compile.scm (compile-file): Error if no output-file
	  is given and compiled-file-name returns false.

	fix THANKS
	* THANKS: Fix Hans' surname.

	fix error-handling of apply to non-list
	* libguile/vm-engine.c (vm_error_apply_to_non_list): Sync registers
	  before erroring. Fix type of finish_args.  Thanks to Hans Aberg for
	  the report.

	update README for copyright year ranges
	* README: Add note about copyright year ranges.  Remove reference to
	  guile-tut.info.

2011-01-26  Andy Wingo  <wingo@pobox.com>

	fix format ~f documentation for width combined with overflowchar
	* doc/ref/misc-modules.texi (Formatted Output): Adapt ~f documentation
	  to indicate that the output will always have a decimal point.  Thanks
	  to Fu-gangqiang for the report.

	* THANKS: Update.

2011-01-26  Julian Graham  <julian.graham@aya.yale.edu>

	Additional documentation for symbol manipulation functions.
	* doc/ref/api-data.texi (Symbol Primitives): Document `symbol',
	  `list->symbol', and `symbol-append'.

2011-01-26  Ludovic Courtès  <ludo@gnu.org>

	Rewrite `read-line' in terms of `scm_getc'.
	As a result `read-line' handles decoding and decoding errors the same
	way as `scm_getc'.  It's also simpler and free of `malloc' calls.

	* libguile/rdelim.c (scm_do_read_line): Remove.
	  (scm_read_line): Rewrite as a loop that calls `scm_getc'.

	* test-suite/tests/rdelim.test: New file.
	* test-suite/Makefile.am (SCM_TESTS): Add `tests/rdelim.test'.

2011-01-26  Ludovic Courtès  <ludo@gnu.org>

	Have `scm_getc' honor the port's conversion strategy.
	* libguile/ports.c (get_codepoint): Reset `pt->input_cd' upon failure.
	  If `pt->ilseq_handler' is `SCM_ICONVEH_QUESTION_MARK', then return a
	  question mark.
	  [failure]: Use `scm_encoding_error' when raising an error.

	* test-suite/lib.scm (exception:encoding-error): Adjust regexp.

	* test-suite/tests/ports.test ("string ports")["read-char, wrong
	  encoding, error", "read-char, wrong encoding, escape", "read-char,
	  wrong encoding, substitute"]: New tests.

2011-01-26  Ludovic Courtès  <ludo@gnu.org>

	Test substitution and escaping on port output.
	* test-suite/tests/ports.test ("string ports")["wrong encoding,
	  substitute", "wrong encoding, escape"]: New tests.

2011-01-26  Ludovic Courtès  <ludo@gnu.org>

	Add `scm_{to,from}_utf32_string'.
	* libguile/strings.c (scm_from_utf32_string, scm_from_utf32_stringn,
	  scm_to_utf32_string, scm_to_utf32_stringn): New functions.

	* libguile/strings.h (scm_from_utf32_string, scm_from_utf32_stringn,
	  scm_to_utf32_string, scm_to_utf32_stringn): New declarations.

	* doc/ref/api-data.texi (Conversion to/from C): Document
	  `scm_{to,from}_{utf8,utf32}_stringn'.

2011-01-26  Ludovic Courtès  <ludo@gnu.org>

	Optimize `scm_{to,from}_latin1_string'.
	* libguile/strings.c (scm_from_latin1_stringn): Directly return a narrow
	  string instead of going through `scm_from_stringn'.
	  (scm_to_latin1_stringn): Directly return a copy of STR's raw bytes when
	  it's narrow.

2011-01-25  Andy Wingo  <wingo@pobox.com>

	stexi->shtml supports itemx
	* module/texinfo/html.scm (entry, rules): Allow @itemx,

2011-01-24  Ludovic Courtès  <ludo@gnu.org>

	Install the current locale when starting the REPL.
	* module/ice-9/top-repl.scm (top-repl): Install the current locale.

	Remove useless branches in the port code.
	* libguile/ports.c (scm_i_get_port_encoding): Remove useless `if'.
	  (scm_set_port_encoding_x): Remove redundant `find_valid_encoding'
	  call.

	Always initialize a port's encoding name.
	* libguile/ports.c (scm_i_set_port_encoding_x): Always initialize
	  PT->encoding to something non-NULL.  This fixes callers of
	  `scm_encoding_error' such that they always pass a non-NULL encoding
	  name.  Reported by Matei Conovici.

2011-01-24  Andy Wingo  <wingo@pobox.com>

	update the man page
	* doc/guile.1: Update a bit.

2011-01-24  Ludovic Courtès  <ludo@gnu.org>

	Choose the input source file encoding in a locale-independent way.
	This is so that compiling the same code on environments with different
	locale settings yields the same result.

	* module/system/base/compile.scm (compile-file): When ENC if #f, default
	  to "UTF-8" instead of `(fluid-ref %default-port-encoding)'.

	* doc/ref/api-evaluation.texi (Compilation): Document the default output
	  file name and default source file encoding for `compile-file' and
	  `guile-tools compile'.

2011-01-23  Ludovic Courtès  <ludo@gnu.org>

	Remove unexpected non-ASCII character.
	* module/language/tree-il/fix-letrec.scm: Replace U+2019 with an ASCII
	  quote.  The iconv implementation on FreeBSD would immediately notice
	  and bail out when reading it under a US-ASCII locale.

	Rewrite `scm_lfwrite_substr' in terms of `scm_display'.
	* libguile/ports.c (scm_lfwrite_substr): Rewrite in terms of
	  `scm_display'.

2011-01-23  Ludovic Courtès  <ludo@gnu.org>

	Remove `scm_lfwrite_str'.
	* libguile/ports.c (scm_lfwrite_str): Remove.

	* libguile/ports.h (scm_lfwrite_str): Remove declaration.

	* libguile/numbers.c (scm_i_print_fraction): Use `scm_display' instead
	  of `scm_lfwrite_str'.

2011-01-23  Ludovic Courtès  <ludo@gnu.org>

	Augment `THANKS'.

2011-01-23  Ludovic Courtès  <ludo@gnu.org>

	Hide the string escaping hacks.
	* libguile/strings.c (scm_i_unistring_escapes_to_guile_escapes): Rename
	  to...
	  (unistring_escapes_to_guile_escapes): ... this.  Make `static'.
	  (scm_i_unistring_escapes_to_r6rs_escapes): Rename to...
	  (unistring_escapes_to_r6rs_escapes): ... this.  Make `static'.

	* libguile/strings.h (scm_i_unistring_escapes_to_guile_escapes,
	  scm_i_unistring_escapes_to_r6rs_escapes): Remove declarations.

2011-01-23  Ludovic Courtès  <ludo@gnu.org>

	Rewrite `read-char', `display', etc. using iconv calls instead of libunistring.
	Thanks to Bruno Haible for his suggestions.  See
	<http://lists.gnu.org/archive/html/bug-libunistring/2010-09/msg00007.html>,
	for details.

	* libguile/ports.c (register_finalizer_for_port): Always register a
	  finalizer for PORT.
	  (finalize_port): Close ENTRY->input_cd and ENTRY->output_cd.
	  (scm_new_port_table_entry): Initialize the `input_cd' and `output_cd'
	  fields.
	  (utf8_to_codepoint): New function.
	  (get_codepoint): Rewrite to use `iconv' instead of libunistring.
	  (scm_i_set_port_encoding_x): Initialize the `input_cd' and `output_cd'
	  fields.
	  (update_port_lf): Move upward.  Use `switch' instead of `if's.

	* libguile/ports.h (scm_t_port)[input_cd, output_cd]: New fields.

	* libguile/print.c (codepoint_to_utf8, display_string): New functions.
	  (display_character): Use `display_string'.
	  (write_combining_character): Likewise.
	  (iprin1): Use `display_string' instead of `scm_lfwrite_str', and
	  `display_character' instead of `scm_putc'.
	  (write_character): Likewise.
	  (write_character_escaped): New function.

	* test-suite/tests/encoding-escapes.test ("display output
	  escapes")["Rashomon"]: Use lower-case escapes.
	  ["fake escape"]: New test.

2011-01-23  Andy Wingo  <wingo@pobox.com>

	infinities are no longer integers
	* libguile/numbers.c (scm_is_integer): Infinities are not integers, per
	  the R6RS.
	  (scm_even_p, scm_odd_p): Passing an infinity to even? or odd? is an
	  error.

	* test-suite/tests/numbers.test ("integer?"): Adapt test.
	  ("expt"): Add tests for +inf.0 and -inf.0 exponents.

	* NEWS: Add NEWS entries.

2011-01-22  Andy Wingo  <wingo@pobox.com>

	web.texi fix
	* doc/ref/web.texi (HTTP Headers): Fix transfer-encoding example.

2011-01-22  Andy Wingo  <wingo@pobox.com>

	scm_with_guile calls GC_call_with_gc_active
	* configure.ac: Check for GC_call_with_gc_active.

	* libguile/threads.h (scm_i_thread): Remove "top", as it's not used.

	* libguile/threads.c (with_gc_inactive, with_gc_active): Define shims to
	  GC_do_blocking and GC_call_with_gc_active.
	  (scm_i_init_thread_for_guile): Don't do thread base adjustment here,
	  do it in scm_i_with_guile_and_parent.  The previous logic would never
	  be run.
	  (scm_i_with_guile_and_parent): If we enter Guile mode, leave it too.
	  Take care of adjusting the thread stack base here too.  Also, call
	  with_gc_active.
	  (scm_without_guile): Refactor.

2011-01-21  Andy Wingo  <wingo@pobox.com>

	update NEWS for hungry-eol-escapes
	* NEWS: Update for hungry-eol-escapes.

	document hungry-eol-escapes
	* doc/ref/api-data.texi (String Syntax): Document hungry-eol-escapes.
	* doc/ref/api-evaluation.texi (Scheme Read):
	* doc/ref/api-options.texi (Runtime Options): Update read-options 'help
	  output.

2011-01-21  Andy Wingo  <wingo@pobox.com>

	implement r6rs hungry escaped EOL
	* libguile/private-options.h (SCM_HUNGRY_EOL_ESCAPES_P): New private
	  option.
	* libguile/read.c: Define SCM_HUNGRY_EOL_ESCAPES_P, defaulting to #f.
	  (skip_intraline_whitespace): New helper.
	  (scm_read_string): If SCM_HUNGRY_EOL_ESCAPES_P,
	  skip_intraline_whitespace after an escaped EOL.

	* test-suite/tests/reader.test ("read-options"): Add test.

2011-01-21  Andy Wingo  <wingo@pobox.com>

	implement port-eof?
	* module/rnrs/io/ports.scm (port-eof?): Implement.
	* module/rnrs.scm: Re-export port-eof?.

	* test-suite/tests/r6rs-ports.test ("7.2.5 End-of-File Object"): Add
	  test.

	Thanks to Göran Weinholt for the report.

2011-01-20  Andy Wingo  <wingo@pobox.com>

	add NEWS for expt change
	* NEWS: Update for Mark's expt patch.

	update NEWS for 1.9.14
	* NEWS: Fold 1.9.14 entries into main text.

2011-01-20  Mark H Weaver  <mhw@netris.org>

	Fix bugs in expt and integer-expt
	* libguile/numbers.c (scm_expt): Fix bug that caused expt to throw an
	  exception whenever the base was exact and the exponent was an
	  inexact integer, e.g. (expt 5 6.0).

	  (scm_expt): Fix bug that caused expt to introduce spurious imaginary
	  parts in the result when the base was an inexact negative real and
	  the exponent was an integer, e.g. (expt -1.0 2)

	  (scm_integer_expt, scm_expt): Change behavior of (integer-expt 0 -1),
	  and therefore also (expt 0 -1), to return NaN, per R6RS (actually,
	  R6RS says we should throw an exception or return an "unspecified
	  number object", but for now we use NaN).  Formerly we returned 0, per
	  R5RS. R5RS claims that 0^x=0 for all non-zero x, but that's
	  mathematically incorrect, and probably an oversight.

	  (scm_integer_expt): Consistently throw a wrong-argument-type exception
	  when the exponent is inexact.  Formerly, it didn't always check this
	  if the base was 0, 1, or -1.

	* test-suite/tests/numbers.test ("integer-expt", "expt"): Add tests.

2011-01-17  Noah Lavine  <nlavine@haverford.edu>

	Add ECMAScript Unicode literal support
	* module/language/ecmascript/tokenize.scm: add unicode literals

	* test-suite/tests/ecmascript.test ("parser"): Add new tests for Latin-1
	  and Unicode escapes in string literals.

2011-01-15  Neil Jerram  <neil@ossau.uklinux.net>

	Add "REPORTING BUGS" and "COPYING" sections to Guile man page
	Thanks to Mark Harig for the suggestion.

	* doc/guile.1: Added "REPORTING BUGS" and "COPYING" sections, modelled
	  on those in the Emacs man page.

2011-01-15  Neil Jerram  <neil@ossau.uklinux.net>

	Document missing Guile command line options
	Thanks to Mark Harig for pointing this out and suggesting the text.

	* doc/ref/scheme-scripts.texi (Invoking Guile): Mention --autocompile
	  and --no-autocompile.

2011-01-15  Neil Jerram  <neil@ossau.uklinux.net>

	Manual page fixes
	Thanks to Mark Harig for pointing these out.

	* doc/guile.1: Remove mention of the tutorial, since it no longer
	  exists (as a separate document).  Document the -q option.

	* THANKS: Add Mark Harig.

2011-01-14  Neil Jerram  <neil@ossau.uklinux.net>

	Confront the MOP
	* doc/ref/goops.texi (The Metaobject Protocol): Bring forward to
	  before `Class Options', and add intro text to explain why.  All of
	  the sections now remaining are ones where the MOP is more likely to
	  be relevant than not.

	Move `GOOPS Error Handling' to after `Introspection'
	* doc/ref/goops.texi (GOOPS Error Handling): Move to just after
	  `Introspection'.

	Move `Handling Slot Access Errors' inside `Accessing Slots'
	* doc/ref/goops.texi (Accessing Slots): Move `Handling Slot Access
	  Errors' here; update relevant references.

	Merge small sections into `GOOPS Object Miscellany'
	* doc/ref/goops.texi (GOOPS Object Miscellany): New section, combining
	  previous `Object Comparison', `Cloning Objects' and `Write and
	  Display'.  Replace `Object Comparison' text with something that
	  makes sense.  Add a snippet to the end of the write/display section.

	Remove content-free `Generic Functions and Accessors'
	* doc/ref/goops.texi (GOOPS): Remove `Generic Functions and
	  Accessors'.  There was nothing here that wasn't better covered
	  elsewhere.

	Move `Accessing Slots' inside `Introspection'.
	* doc/ref/goops.texi (Introspection): Move `Accessing Slots' into
	  here, and flatten it, except for `Handling Slot Access Errors'.
	  (GOOPS Error Handling): Move `Handling Slot Access Errors' here.

	Reorder `Introspection'
	* doc/ref/goops.texi (Instances): Move `Instances' before `Slots', as
	  it feels more important.

	Edit `Introspection'
	* doc/ref/goops.texi (Introspection): Make a bit snappier.
	  (Classes): Add intro.  Remove "the" and "metaobject" everywhere.
	  Remove `class-environment', since I don't know what it's useful for.
	  (Instances): Remove implementation notes.
	  (Built-in classes): Merge with `Instances'.  Reorder text points.
	  (Generic Functions): Add intro.  Remove "the" and "metaobject"
	  everywhere.
	  (Generic Function Methods): Merge with `Generic Functions'.

	Move `Introspection' earlier
	* doc/ref/goops.texi (Introspection): Move to after `Generic Functions
	  and Methods'.  The idea is to have all of that sections that make
	  sense without needing to understand the MOP, before sections that
	  really depend on the MOP.

2011-01-13  Neil Jerram  <neil@ossau.uklinux.net>

	Improve doc on generic functions and inheritance
	* doc/ref/goops.texi (Methods and Generic Functions): More explanation
	  of generic function invocation.  Created (or moved) subsections here
	  to cover material on the following that was previously spread elsewhere:
	  accessors; extending primitives; merging generics; generic function
	  examples; handling invocation errors.  Edited for clarity throughout.
	  (Generic functions and methods, Example): Nodes deleted, with their
	  material incorporated above.
	  (Class Precedence List): Edited to improve clarity.
	  (Sorting Methods): New subsection.

2011-01-11  Andy Wingo  <wingo@pobox.com>

	web.texi defun -> deffn
	* doc/ref/web.texi (URIs): Change instances of @defun to @deffn with
	  {Scheme Procedure}.

	more web.texi foo
	* doc/ref/web.texi (Web Server, Web Examples): Update.

	update web.text documentation for requests and responses
	* doc/ref/web.texi (Requests, Responses): Update, and add a note on
	  character encodings.

2011-01-11  Andy Wingo  <wingo@pobox.com>

	request and response cleanups
	* module/web/request.scm (build-request): Make URI a positional
	  argument.

	* module/web/response.scm: Remove extend-response.
	  (read-response): Fix a docstring.
	* module/web/server.scm (extend-response): Include extend-response here,
	  but not exported.

2011-01-11  Andy Wingo  <wingo@pobox.com>

	(web response) and (web request): bodies are bytevectors
	* module/web/request.scm (read-request-body, write-request-body): Rename
	  from read-request-body/bytevector and
	  write-request-body/bytevector.  Remove the /latin-1 variants, as they
	  were unused and a bad idea.
	* module/web/response.scm (read-response-body, write-response-body):
	  Likewise.

	* module/web/server/http.scm (http-read, http-write): Adapt to
	  request/response change.

	* test-suite/tests/web-request.test:
	* test-suite/tests/web-response.test: Update tests.

2011-01-10  Andy Wingo  <wingo@pobox.com>

	update web.texi for (web http) changes
	* doc/ref/web.texi (HTTP Headers): Update to reflect current code, and
	  to reformat. Not sure if it's an improvement...

	parse credentials and challenges
	* module/web/http.scm (parse-credentials, validate-credentials)
	  (write-credentials, parse-challenge, parse-challenges)
	  (validate-challenges, write-challenge, write-challenges)
	  (declare-credentials-header!, declare-challenge-list-header!): New
	  helpers.
	  ("Authorization", "Proxy-Authorization"): Parse out credentials.
	  ("Proxy-Authenticate", "WWW-Authenticate"): Parse out challenges.

2011-01-09  Andy Wingo  <wingo@pobox.com>

	more symbols in (web http)
	* module/web/http.scm (declare-symbol-list-header!): New helper.
	  ("Connection"): Redefine as a header list.
	  ("Allow", "Content-Encoding", "Accept-Ranges"): Redefine as symbol
	  lists.

	* test-suite/tests/web-http.test:
	* test-suite/tests/web-response.test: Adapt tests.

2011-01-09  Andy Wingo  <wingo@pobox.com>

	(web http): keys are always symbols
	* module/web/http.scm (parse-media-type): Parse media types as symbols.
	  (parse-key-value-list, parse-param-component, parse-param-list):
	  Change kons to val-parser. Always parse keys as symbols, and always
	  either cons, if there is a val, or just have the key, if there is no
	  val.  Easier to explain and just as correct.
	  (declare-param-list-header!, declare-key-value-list-header!): Adapt to
	  key-list and param-list kons change.
	  ("Cache-Control", "Pragma", "Transfer-Encoding", "Accept", "Expect")
	  ("TE"): Likewise, adapt.
	  ("Content-Type"): Param keys are symbols.

	update (web http) docs
	* doc/ref/web.texi (HTTP): Update docs to correspond with current code.

2011-01-08  Andy Wingo  <wingo@pobox.com>

	(web http): don't expose header-decl objects
	* module/web/http.scm: Change to not expose the header-decl objects,
	  instead exposing header-parse, header-validator, header-writer et al.
	  Explaining header decls in the manual was too complicated.
	  (string->header, header->string): New helpers.
	  (<header-decl>): Remove the `sym' field.
	  (declare-header!): Adapt to header-decl change, and use
	  string->header.
	  (known-header?, header-parser, header-validator, header-writer): New
	  procedures.

	  Adapt to use the new procedures internally.

2011-01-08  Andy Wingo  <wingo@pobox.com>

	(web http): header names always represented as symbols
	* module/web/http.scm (declare-header!): No need to specify `sym', as it
	  can be derived from `name'. Change to take parser, validator, and
	  writer as positional arguments, and multiple? as a keyword.
	  (parse-header): Change to take the header as a symbol already, and
	  just return the parsed value.  All headers are symbols now, including
	  unknown headers.  I feel OK doing this given that the symbol GC works
	  now.
	  (lookup-header-decl): Only look up headers by symbol.
	  (read-header): Adapt to parse-header change.

	  (valid-header?, write-header): Adapt to all headers being symbols.
	  (split-header-names, list-of-header-names?, write-header-list):
	  Represent all header names as symbols.

	  (declare-opaque-header!, declare-date-header!)
	  (declare-string-list-header!, declare-header-list-header!)
	  (declare-integer-header!, declare-uri-header!)
	  (declare-quality-list-header!, declare-param-list-header!)
	  (declare-key-value-list-header!, declare-entity-tag-list-header!):
	  Change to be functions instead of syntax, and no need to specify the
	  symbolic name. Update all header declarations accordingly.

	* module/web/request.scm (validate-headers):
	* module/web/response.scm (validate-headers): Adapt to all headers being
	  symbols.

	* test-suite/tests/web-http.test (pass-if-parse, pass-if-any-error)
	  (pass-if-parse-error): Update for parse-header change.
	  ("general headers"): Update header list examples to be all symbols.

2011-01-08  Andy Wingo  <wingo@pobox.com>

	fix scm_from_stringn empty string case
	* libguile/strings.c (scm_from_stringn): Fix empty string case
	  (oops...).

	fix tab completion in repl (doh)
	* libguile/hashtab.c: Fix remaining vector hash table support.
	* module/ice-9/session.scm (apropos-fold): Use a hash table instead of a
	  vector for the completions.

2011-01-07  Andy Wingo  <wingo@pobox.com>

	revert unfinished web.texi changes
	These were prematurely committed in
	17072fd2c6acad1d4f2b5c98eb0d62911ea07406.

2011-01-07  Andy Wingo  <wingo@pobox.com>

	use scm_from_latin1_symboln for string literals and load-symbol
	* libguile/bytevectors.c:
	* libguile/eval.c:
	* libguile/goops.c:
	* libguile/i18n.c:
	* libguile/load.c:
	* libguile/memoize.c:
	* libguile/modules.c:
	* libguile/ports.c:
	* libguile/print.c:
	* libguile/procs.c:
	* libguile/programs.c:
	* libguile/read.c:
	* libguile/script.c:
	* libguile/srfi-14.c:
	* libguile/stacks.c:
	* libguile/strings.c:
	* libguile/throw.c:
	* libguile/vm.c: Use scm_from_latin1_symboln to make symbols from string
	  literals, because they aren't in the user's locale -- they are in
	  ASCII, and we can optimize this case.

	* libguile/vm-i-loader.c: Also use scm_from_latin1_symboln when loading
	  narrow symbols.

2011-01-07  Andy Wingo  <wingo@pobox.com>

	optimize scm_from_latin1_symboln
	* libguile/symbols.c (lookup_interned_latin1_symbol): New helper.
	  (scm_from_latin1_symboln): Use lookup_interned_latin1_symbol, so we
	  avoid allocating a string in that case.

	lookup_interned_symbol uses get_handle_by_hash
	* libguile/symbols.c (lookup_interned_symbol): Change to use
	  scm_hash_fn_get_handle_by_hash.

	add scm_hash_fn_get_handle_by_hash
	* libguile/hashtab.h:
	* libguile/hashtab.c (scm_hash_fn_get_handle_by_hash): New internal
	  procedure, which should make symbol table lookup faster.

	remove vector hash table code
	* libguile/hashtab.c: Remove deprecated hash-tables-as-vectors support
	  code.

	hashtab cleanups
	* libguile/hashtab.c: Update comments.
	  (hashtable_size): Allow bigger vectors on 64-bit machines.

	fix symbol garbage collection
	* libguile/symbols.c (lookup_interned_symbol, intern_symbol): Refactor
	  to use hashtab.[ch] interfaces.

	add hash functions for locale, latin1, and utf8 strings
	* libguile/hash.c (scm_i_locale_string_hash)
	  (scm_i_latin1_string_hash, scm_i_utf8_string_hash): New functions.

	multibyte regex error handling fix
	* libguile/regex-posix.c (fixup_multibyte_match): Fix mbrlen error
	  handling.

	hash.c cleanup
	* libguile/hash.c (scm_hasher): Remove needless remember_upto_here.

	add scm_from_{latin1,utf8}_symbol{n,}
	* libguile/symbols.c (scm_from_latin1_symbol, scm_from_latin1_symboln)
	  (scm_from_utf8_symbol, scm_from_utf8_symboln): New functions.

2011-01-07  Andy Wingo  <wingo@pobox.com>

	add scm_{to,from}_{utf8,latin1}_string{n,}
	* libguile/strings.h:
	* libguile/strings.c (scm_from_latin1_string, scm_to_latin1_string): New
	  functions, in terms of the latin1_stringn variants.
	  (scm_from_utf8_string, scm_from_utf8_stringn)
	  (scm_to_utf8_string, scm_to_utf8_stringn): New functions.
	  (scm_i_from_utf8_string, scm_i_to_utf8_string): Removed these internal
	  functions.
	  (scm_from_stringn): Handle -1 as a length. Unlike the previous
	  behavior of scm_from_locale_string (NULL), which returned the empty
	  string, we now raise an error.  The null pointer is not the same as
	  the empty string.

	* libguile/stime.c (scm_strftime, scm_strptime): Adapt to publishing of
	  utf8 functions.

2011-01-07  Andy Wingo  <wingo@pobox.com>

	read-header returns EOF at end, update (web http) docs
	* doc/ref/web.texi (HTTP): Add an example for declaring a header, and
	  adapt to read-header change.

	* module/web/http.scm (read-header): Return EOF for both values if there
	  are no more headers, instead of #f.
	  (read-headers): Adapt.

2011-01-07  Andy Wingo  <wingo@pobox.com>

	update URI documentation
	* doc/ref/web.texi (Types and the Web): Fix spacing.
	  (URIs): Give default values, and clarify a number of procedure docs.
	  Update "encoding" name, and string->uri name.

	uri-encode fast path
	* module/web/uri.scm (uri-encode): Add a fast-path for the common case
	  in which the string does not contain any reserved characters.

	uri-decode #:encoding, not #:charset
	* module/web/uri.scm (call-with-encoded-output-string, encode-string)
	  (decode-string, uri-decode, uri-encode): Change all instances of
	  "charset" to "encoding", as variables and arguments.

2011-01-07  Andy Wingo  <wingo@pobox.com>

	rename string->uri and uri->string.
	* module/web/uri.scm (string->uri, uri->string): Rename from parse-uri
	  and unparse-uri.

	* test-suite/tests/web-uri.test:
	* module/web/http.scm: All callers changed.

2011-01-07  Andy Wingo  <wingo@pobox.com>

	clarify uri fragment discussion
	* doc/ref/web.texi (URIs): Clarify the discussion of URI fragments.

	rewrite web.texi intro
	* doc/ref/web.texi (Web): Rewrite the intro.
	  (Types and the Web): New subsection, a mini-rant.

2011-01-05  Ludovic Courtès  <ludo@gnu.org>

	Tiny style improvement in the ECMAScript compiler.
	Followup to 8891bd1b166b7210c241a0c1a730fc3af7f45b8a ("Fix ECMAScript
	object creation.").

	* module/language/ecmascript/compile-tree-il.scm (comp): Use `@implv'
	  for `new-object'.  Suggested by Kan-Ru Chen <kanru@kanru.info>.

2011-01-05  Ludovic Courtès  <ludo@gnu.org>

	Change `getaddrinfo' test to handle the GNU-specific `EAI_NODATA'.
	* doc/ref/posix.texi (Network Databases): Mention `EAI_NODATA'.

	* libguile/net_db.c (scm_getaddrinfo): Likewise for the docstring.

	* test-suite/tests/net-db.test ("getaddrinfo")["no name"]: Handle
	  `EAI_NODATA'.

2011-01-04  Noah Lavine  <nlavine@haverford.edu>

	Fix ECMAScript object creation.
	* module/language/ecmascript/compile-tree-il.scm (compile-tree-il):
	  generate correct tree-il for construction of new objects.
	* test-suite/tests/ecmascript.test (ecompile): Add pattern with EXPECTED
	  omitted.
	  ("compiler"): test whether we generate new objects correctly.

2011-01-04  Ludovic Courtès  <ludo@gnu.org>

	Document `scm_misc_error' (bug #31969).
	* doc/ref/api-control.texi (Handling Errors): Add `scm_misc_error'.
	  Suggested by Bake Timmons <b3timmons@speedymail.org> (bug #31969).

2011-01-04  Ludovic Courtès  <ludo@gnu.org>

	Improve doc of `string-index', `string-index-right', and `string-rindex'.
	Suggested by Noah Lavine <noah.b.lavine@gmail.com>.

	* doc/ref/api-data.texi (String Searching): Mention the return value of
	  `string-index', `string-index-right', and `string-rindex' when no
	  match is found.

	* libguile/srfi-13.c (scm_string_index, scm_string_index_right,
	  scm_string_rindex): Adjust docstring accordingly.

2010-12-23  Neil Jerram  <neil@ossau.uklinux.net>

	Manual typo fix
	* doc/ref/api-overview.texi (API Overview): bot -> but

2010-12-21  Ludovic Courtès  <ludo@gnu.org>

	Have `lookahead-u8' and `get-u8' actually do binary input.
	* libguile/r6rs-ports.c (scm_lookahead_u8): Use `scm_get_byte_or_eof'
	  instead of `scm_peek_char'.
	  (scm_get_u8): Likewise.

	* test-suite/tests/r6rs-ports.test ("7.2.8 Binary
	  Input")["lookahead-u8"]: Fix typo.
	  ["lookahead-u8 non-ASCII"]: New test.

2010-12-20  Ludovic Courtès  <ludo@gnu.org>

	Temporarily fix `unistr.in.h' to allow compilation with `-Wundef'.
	See <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/24225> for details.

	* lib/unistr.in.h: Change #if's into #ifdef's.

2010-12-20  Ludovic Courtès  <ludo@gnu.org>

	Update Gnulib to v0.0-4544-gce083ca.

2010-12-18  Andy Wingo  <wingo@pobox.com>

	format handles ~@c better
	* module/ice-9/format.scm (format): Fix ascii-ism in ~@c. Pull
	  flush-output? into the let*.

	more format tweaks
	* module/ice-9/format.scm (format): Strip format: prefix from port and
	  output-col.

	more format tweaks
	* module/ice-9/format.scm (format): Move the port and output-col to let*
	  vars, again removing a set!. We will probably move more state vars to
	  the let*, to let the procedures exist in a more fixed-point style.

	take advantage of letrec* in format
	* module/ice-9/format.scm (format): Take advantage of letrec* internal
	  expansion, and so have fewer set! invocations.

	inline format:out into format
	* module/ice-9/format.scm (format): Inline format:out into the body.

	more format cleanups
	* module/ice-9/format.scm (format): Remove the need to save a copy of
	  the incoming arguments, because they are available as local
	  variables.  Do the check early for the format-string actually being a
	  string.

	format's first arg is "destination"
	* module/ice-9/format.scm: The argument to format is "destination", not
	  "port". Fix this newly reintroduced buglet.

	inline format:format into format
	* module/ice-9/format.scm (format): Inline format:format body.

2010-12-18  Andy Wingo  <wingo@pobox.com>

	deprecate omission of port to ice-9 format
	* module/ice-9/format.scm (format): Add port and format-string as formal
	  arguments. Seems also to have triggered a reindent.  Formally
	  deprecate omitting the port, as it's usually an error.

	* test-suite/tests/format.test ("format basic output")
	  ("format basic output", "~{ iteration"): Fix up tests that omitted the
	  destination port.

2010-12-18  Andy Wingo  <wingo@pobox.com>

	letrec -> internal definitions in format.scm
	* module/ice-9/format.scm (format): Change from letrec to internal
	  definitions, and use the define (foo ...) .. shorthand. No semantic
	  change.

	format.scm cleanups
	* module/ice-9/format.scm (format:symbol-case-conv)
	  (format:iobj-case-conv): Remove these exports, they were not used.
	  (format:expch): Remove this one, though it was used.
	  (format:floats, format:complex-numbers, format:radix-pref): Inline
	  these "configuration variables" into the format body.

	ice-9 format license update
	* module/ice-9/format.scm: A more standard copyright header, with
	  LGPLv3+ instead of public domain. Update define-module block.

2010-12-17  Ludovic Courtès  <ludo@gnu.org>

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

	Tweak `NEWS'.
	* NEWS: Update.

	futures: Store pending futures in a queue.
	* module/ice-9/futures.scm (%futures): Change from a list to a queue.
	  (register-future!, process-futures, touch): Adjust accordingly.
	  (unregister-future!): Remove.

	Clarify doc regarding threading of `par-map' and `par-for-each'.
	* doc/ref/api-scheduling.texi (Parallel Forms): Refine wording for
	  `par-map' and `par-for-each'.

2010-12-17  Andy Wingo  <wingo@pobox.com>

	add www-commit rule in doc/ref
	* doc/ref/Makefile.am (www-commit): Add rule to update docs on web site.

2010-12-17  Ludovic Courtès  <ludo@gnu.org>

	Remove conflicting `scm_is_string' declaration.
	* libguile/strings.h: Move `scm_is_string' declaration...
	* libguile/inline.h: ... here.
	  Reported by Noah Lavine <noah.b.lavine@gmail.com>.

2010-12-17  Andy Wingo  <wingo@pobox.com>

	fix unbound fluid tests
	* test-suite/tests/fluids.test: Fix tests.

	update NEWS
	* NEWS: Update.

	guile-user has no filename
	* module/ice-9/boot-9.scm (guile-user): Set #:filename to #f for
	  guile-user module, as guile-user isn't really associated with any
	  file.

2010-12-17  Andy Wingo  <wingo@pobox.com>

	add ,reload meta-command and document it and reload-module
	* module/ice-9/boot-9.scm (reload-module): Add docstring.
	* module/system/repl/command.scm (reload): New meta-command.

	* doc/ref/scheme-using.texi (Module Commands): Document the ,reload
	  meta-command.
	* doc/ref/api-modules.texi (Module System Reflection): Document
	  reload-module.

2010-12-17  Andy Wingo  <wingo@pobox.com>

	document variable-unset!
	* doc/ref/api-modules.texi (Variables): Document variable-unset!.

	* NEWS: Update.

2010-12-17  Andy Wingo  <wingo@pobox.com>

	document make-unbound-fluid et al
	* doc/ref/api-scheduling.texi (Fluids and Dynamic States): Document the
	  new fluid routines.

	* NEWS: Update.

2010-12-17  Andy Wingo  <wingo@pobox.com>

	rename make-undefined-fluid to make-unbound-fluid
	* libguile/fluids.c (scm_make_unbound_fluid): Rename from
	  scm_make_undefined_fluid.

	* libguile/fluids.h:
	* module/language/elisp/runtime.scm: Update referrers.

2010-12-17  Andy Wingo  <wingo@pobox.com>

	multicast manual updates
	* doc/ref/posix.texi (Network Sockets and Communication): Add
	  IP_MULTICAST_TTL and IP_MULTICAST_IF docs, from the docstring.

	* NEWS: Update.

2010-12-17  Andy Wingo  <wingo@pobox.com>

	more web.texi "hacking"
	* doc/ref/web.texi (Web Server, Web Examples): Finish these sections.

	build-response validates headers
	* module/web/response.scm (build-response): Add some validation, like
	  for build-request.

2010-12-16  Ludovic Courtès  <ludo@gnu.org>

	Implement `(ice-9 threads)' high-level constructs in terms of futures.
	* module/ice-9/threads.scm (parallel, par-mapper): Rewrite in terms of
	  `future' and `touch'.

	* test-suite/tests/threads.test ("par-map", "par-for-each"): New test
	  prefixes.

	* doc/ref/api-scheduling.texi (Parallel Forms): Add cross-ref to
	  futures.  Recommend against the `n-' variants.

2010-12-16  Ludovic Courtès  <ludo@gnu.org>

	futures: Support multiple-value returns.
	* module/ice-9/futures.scm (process-future!): Use `call-with-values'
	  when invoking `(future-thunk future)'.

	* test-suite/tests/future.test ("futures")["multiple values"]: New test.

2010-12-16  Ludovic Courtès  <ludo@gnu.org>

	futures: Fix potential deadlock.
	* module/ice-9/futures.scm (process-futures): Fix potential deadlock,
	  whereby %FUTURES-MUTEX would be acquired *after* FUTURE's mutex.

	Rehash weak hash tables less frequently.
	* libguile/hashtab.c (weak_bucket_assoc): Call `scm_i_rehash' only when
	  REMAINING is below `SCM_HASHTABLE_LOWER (table)'.

2010-12-16  Ludovic Courtès  <ludo@gnu.org>

	Fix `hash' for pointer objects.
	Previously all pointer objects would hash to the same value.

	* libguile/hash.c (scm_hasher): Add case for `scm_tc7_pointer'.

2010-12-16  Ludovic Courtès  <ludo@gnu.org>

	Inline `scm_is_string'.
	* libguile/strings.c (scm_is_string): Move to...
	* libguile/inline.h (scm_is_string): ... here.  Inline.

2010-12-16  Ludovic Courtès  <ludo@gnu.org>

	Add `compose', `negate', and `const'.
	* module/ice-9/boot-9.scm (compose, negate, const): New procedures.

	* doc/ref/api-procedures.texi (Higher-Order Functions): New node.

	* test-suite/Makefile.am (SCM_TESTS): Add `tests/procs.test'.

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

2010-12-16  Andy Wingo  <wingo@pobox.com>

	update web-response tests for http header parsing change
	* test-suite/tests/web-response.test ("example-1"): Update for change in
	  parsing Vary header.

	update NEWS
	* NEWS: Update for Web documentation.

	more web.texi work
	* doc/ref/web.texi (Requests, Responses): Flesh out.
	  (Web Examples): New section, replacing "Web Handlers". The only one
	  that's not really written yet.

	add section on format of parsed http headers
	* doc/ref/web.texi (HTTP Headers): New section. Needs some examples,
	  though.

2010-12-16  Andy Wingo  <wingo@pobox.com>

	http: lists of header names parse better
	* module/web/http.scm (list-of-strings?, write-list-of-strings): Move
	  definitions up.
	  (split-header-names, list-of-header-names?, write-header-list): New
	  helpers.
	  (declare-header-list-header): New helper.
	  (cache-control): Use split-header-names for private and no-cache.
	  (trailer): Use declare-header-list-header to parse known headers to
	  symbols.
	  (vary): Likewise, use split-header-names et al.

	* test-suite/tests/web-http.test ("general headers"): Add a test.

2010-12-16  Andy Wingo  <wingo@pobox.com>

	better cache-control: private, no-cache parsing
	* module/web/http.scm (cache-control): Parse private and no-cache
	  better.
	* test-suite/tests/web-http.test ("general headers"): Update.

	fix web.texi
	* doc/ref/web.texi: Texinfo syntax fixen!

	update web.texi
	* doc/ref/web.texi (URIs, HTTP): Update these sections.

2010-12-16  Andy Wingo  <wingo@pobox.com>

	add web.texi to manual
	* doc/ref/web.texi: New file, here to document the various (web ...)
	  modules.  Quite a rough beginning, but it is a start...

	* doc/ref/guile.texi:
	* doc/ref/Makefile.am: Add to manual.

2010-12-16  Andy Wingo  <wingo@pobox.com>

	(web server) docstrings
	* module/web/server.scm: Docstrings in the house.

	docstrings in (web request) and (web response)
	* module/web/request.scm:
	* module/web/response.scm: Add docstrings.

	(web http) docstrings
	* module/web/http.scm: Add docstrings all around.

	document (web uri), and simplify uri-encode
	* module/web/uri.scm: Add docstrings.
	  (uri-encode): Simplify. Not sure what I was thinking before.

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

	update NEWS
	* NEWS: Update.

	fix bugs in primitive-poll
	* libguile/poll.c (scm_primitive_poll): Only mark POLLOUT for output
	  ports. Don't override results from the syscall, add to them.

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

	fix testing code in web/server
	* module/web/server.scm (call-with-encoded-output-string): Fix some code
	  I accidentally left in while testing. Re-tested the difference in
	  speed; pleasantly surprised.

	* module/web/uri.scm: Make the same change here.

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

	foreign: c-struct parsing simplification
	* module/system/foreign.scm: Revert much of fb636a1cce. Short et al are
	  not distinct types -- they are all aliases to e.g. int16. The only
	  case that was not covered before was the pointer case.
	  (bytevector-pointer-ref, bytevector-pointer-set!): Implement these,
	  and use them for pointers.

	1.9.13 news to main body
	* NEWS: Fold 1.9.13 text into the main text.

	http-read robustness
	* module/web/server/http.scm (http-read): Record the client index in
	  more cases in which code could throw an error.

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

	(web uri) can uri-decode non-utf-8 payloads
	* module/web/uri.scm (call-with-encoded-output-string, encode-string):
	  Copy from server.scm
	  (decode-string): Copy from tekuti.
	  (uri-decode): The #:charset arg is a string, like
	  port-encoding. Support other charsets.
	  (uri-encode): Charset is a string. Other encodings still not nicely
	  supported. Hmm.

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

	add return/values hack to compile-glil for lua
	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add a hack
	  like 'return but for multiple values, for lua.

	rnrs control only depends on (guile)
	* module/rnrs/control.scm: Depend only on (guile).

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

	fix self-tail-calls for lexical procs with optional, rest, or kwargs
	* module/language/tree-il/compile-glil.scm (flatten-lambda): Don't emit
	  a self-label, because when we can't match the args for a lexical call,
	  we have no space to shuffle args and jump.
	  (flatten): Apply the self-tail-call optimization to optional args
	  too, but only if the procedure is fix-allocated. If we can't apply the
	  optimization, use the normal tail-call sequence.

	* test-suite/tests/optargs.test ("lambda* inits"): Add tests.

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

	clarify compile-glil error messages
	* module/language/tree-il/compile-glil.scm (vars->bind-list, flatten):
	  Make internal self-checking error messages more clear, for
	  implementors of other languages.

2010-12-07  Andreas Rottmann  <a.rottmann@gmx.at>

	Get rid of `define-macro' in the SRFI 26 implementation
	* module/srfi/srfi-26.scm (cut, cute): Implement using `syntax-case'.
	  The new implementation is mostly just a transcription of the old code;
	  the reference implementation which relies only on `syntax-rules' may
	  (or may not) be considered more elegant :-).

2010-12-07  Ludovic Courtès  <ludo@gnu.org>

	Use `current-processor-count' to determine the number of future-workers.
	* module/ice-9/futures.scm (%worker-count): Use
	  `current-processor-count'.

	* doc/ref/api-scheduling.texi (Futures): Add note about side-effects and
	  I/O.  Mention `current-processor-count'.

2010-12-07  Ludovic Courtès  <ludo@gnu.org>

	Add `total-processor-count' and `current-processor-count'.
	* libguile/posix.c (scm_total_processor_count,
	  scm_current_processor_count): New functions.

	* libguile/posix.h (scm_total_processor_count,
	  scm_current_processor_count): New declarations.

	* test-suite/tests/posix.test ("nproc"): New test prefix.

	* doc/ref/posix.texi (Processes): Document `total-processor-count' and
	  `current-processor-count'.

2010-12-07  Ludovic Courtès  <ludo@gnu.org>

	Improve doc of `getaffinity' and `setaffinity'.
	* doc/ref/posix.texi (Processes): Add cross-reference from `setaffinity'
	  and `getaffinity' to the corresponding node in the glibc manual.

	* libguile/posix.c (scm_getaffinity, scm_setaffinity): Likewise.

2010-12-07  Ludovic Courtès  <ludo@gnu.org>

	Temporarily fix `unistr.in.h' to allow compilation with `-Wundef'.
	See <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/24225> for details.

	* lib/unistr.in.h: Change #if's into #ifdef's.

2010-12-07  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `nproc'.
	This updates Gnulib to v0.0-4496-g6491120.

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

2010-12-07  Ludovic Courtès  <ludo@gnu.org>

	Build dlopenable modules with `-module'.
	* test-suite/standalone/Makefile.am (libtest_asmobs_la_LDFLAGS,
	  libtest_ffi_la_LDFLAGS, libtest_extensions_la_LDFLAGS): Add `-module'.

	Add a record type printer for vlists/vhashes.
	* module/ice-9/vlist.scm (<vlist>): Add a record type printer.

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	lexical function binding for elisp
	* module/language/elisp/compile-tree-il.scm (access-variable)
	  (reference-variable, set-variable!): Handle globally-bound non-special
	  variables.

	  (bind-lexically?): Create lexical bindings for flet and flet*.

	* module/language/elisp/runtime.scm (reference-variable, set-variable!):
	  Handle globally-bound non-special variables.

	  (built-in-func): Set the variable directly instead of storing the
	  function in a fluid.

	* module/language/elisp/runtime/subrs.scm (funcall): Call apply
	  directly.

	* test-suite/tests/elisp-compiler.test ("Function Definitions")["flet
	  and flet*"]:

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	use unbound fluids instead of `void' sentinel value
	* module/language/elisp/compile-tree-il.scm (reference-with-check)
	  (compile-without-void-checks, want-void-check?): Remove.

	  (compile-function, compile-pair): Use `reference-variable' instead of
	  `reference-with-check'.

	  (compile-defvar): Only set `sym' if `sym' is not bound to a bound
	  fluid, rather than requiring that its value be `void'.

	  (process-options!): Remove `#:disable-void-check' option handling.

	* module/language/elisp/runtime.scm (void)
	  (reference-variable-with-check): Remove.

	  (ensure-fluid!): Use an undefined fluid as the initial value for
	  global variables.

	* module/language/elisp/runtime/function-slot.scm (without-void-checks):
	  Don't import or re-export.

	* module/language/elisp/runtime/macros.scm (prog1, cond, or, dolist):
	  Don't use `without-void-checks'.

	* module/language/elisp/runtime/subrs.scm (symbol-value)
	  (symbol-function, apply): Use `reference-variable' instead of
	  `reference-variable-with-check'.

	  (makunbound, fmakunbound, boundp, fboundp): Unset the variable's fluid
	  (or the variable itself, if it isn't bound to a fluid).

	* test-suite/tests/elisp-compiler.test ("Variable
	  Setting/Referencing")["disabled void check (all)", "disabled void
	  check (symbol list)", "without-void-checks"]: Remove.

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	function's argument can be a symbol
	* module/language/elisp/compile-tree-il.scm (compile-function): the form
	  `(function SYMBOL)' evaluates to the functional value of SYMBOL

	allow `(setcar nil nil)' and `(setcdr nil nil)'
	* module/language/elisp/runtime/subrs.scm (setcar, setcdr): Allow
	  setting the car or cdr of `nil' to `nil'.

	support "#'" syntax for function expressions
	* module/language/elisp/lexer.scm (lex):
	* module/language/elisp/parser.scm (get-expression): Support sharpsign
	  single-quote syntax as an abbreviation for `function' expressions.

	setq can take any number of arguments
	* module/language/elisp/compile-tree-il.scm (compile-setq): Return nil
	  if called with no arguments, and set the last variable to nil if its
	  value is omitted.

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	use correct names for quasiquotation operators
	Use #{`}#, #{,}# and #{,@}# as the quasiquote, unquote and
	unquote-splicing operators, respectively. Previously they were named
	escaping.

	* module/language/elisp/compile-tree-il.scm (unquote?): Change "\," to
	  "#{,}#".
	  (unquote-splicing): Change "\,@" to "#{,@}#".
	  (#{compile-`}#): Rename from #{compile-\`}#.
	* module/language/elisp/runtime/function-slot.scm: Import #{compile-`}#
	  instead of #{compile-\`}#, and re-export as #{`}# instead of as
	  #{\`}#.
	* module/language/elisp/parser.scm (quotation-symbols):
	* test-suite/tests/elisp-compiler.test ("Eval", "Quotation"):
	* test-suite/tests/elisp-reader.test ("Parser"): Change "\`", "\,", and
	  "\,@" to "#{`}#", "#{,}#" and "#{,@}#", respectively.

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	store special operators in the function slot
	If the function slot of a symbol contains a pair with `special-operator'
	in the car and a procedure in the cdr, the procedure is called to
	compile the form to Tree-IL. This is similar to other Emacs Lisp
	implementations, in which special operators are subrs.

	* module/language/elisp/compile-tree-il.scm: Restructured to store
	  special operator definitions in the function slot. Import `(language
	  elisp runtime)' for `defspecial'. Export special operators so that
	  `(language elisp runtime function-slot)' can re-export them.

	  (backquote?): Removed; the backquote symbol is defined as a special
	  operator, so it's no longer used in `compile-pair'.

	  (is-macro?, get-macro): Replaced by `find-operator'.
	  (find-operator): New procedure.

	  (compile-progn, compile-if, compile-defconst, compile-defvar,
	  compile-setq, compile-let, compile-lexical-let, compile-flet,
	  compile-let*, compile-lexical-let*, compile-flet*,
	  compile-without-void-checks, compile-with-always-lexical,
	  compile-guile-ref, compile-guile-primitive, compile-while,
	  compile-function, compile-defmacro, compile-defun, #{compile-`}#,
	  compile-quote): New special operators with definitions taken from the
	  pmatch form in `compile-pair'. There is no special operator `lambda';
	  it is now a macro, as in other Elisp implementations.

	  (compile-pair): Instead of directly compiling special forms, check for
	  a special operator object in the function slot.

	* module/language/elisp/runtime.scm: Export `defspecial'.
	  (make-id): New function.
	  (built-in-macro): Prefix macros with `macro-'.
	  (defspecial): New syntax.

	* module/language/elisp/runtime/function-slot.scm: Import and re-export
	  special operators. Rename imported special operators and macros to
	  remove prefixes. Re-export new macro `lambda'.

	* module/language/elisp/runtime/macros.scm (macro-lambda): New Elisp
	  macro.

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	update elisp reader tests to handle EOF tokens
	* test-suite/tests/elisp-reader.test (lex-all, "end-of-input",
	  "lexer/1"): Check for an EOF token instead of the symbol `*eoi*'.

	make user-defined macros available at runtime
	* module/language/elisp/compile-tree-il.scm (ensuring-globals): New
	  procedure.
	  (define-macro!): Remove.
	  (compile-pair) <defmacro>: Make macro available at runtime, not only
	  during compilation.
	  (compile-tree-il): Use `ensuring-globals'.

	allow fluid macro bindings
	* module/language/elisp/compile-tree-il.scm (define-macro!, get-macro):
	  Allow fluid macro bindings.

	new `load' subr
	* module/language/elisp/runtime/subrs.scm: Define new subr `load'.
	* module/language/elisp/runtime/function-slot.scm: Re-export `load'.

	Ignore #:warnings compiler option
	* module/language/elisp/compile-tree-il.scm (process-options!): Ignore
	  #:warnings compiler option.

	handle EOF correctly in parser and lexer
	* module/language/elisp/lexer.scm (lex, get-lexer/1): Return a valid
	  token at EOF.
	* module/language/elisp/parser.scm (get-expression): Raise an error if
	  EOF is reached.
	  (read-elisp): If at EOF, return the EOF object instead of attempting
	  to read an expression.

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	store macro definitions in the function slot
	Guile Emacs Lisp previously kept macros in a separate macro slot; now
	macros are stored as macro objects in the function slot for
	compatibility with other implementations.

	* module/language/elisp/compile-tree-il.scm (macro-slot): Remove.
	  (is-macro?): Check that the argument is a symbol. Now-unnecessary
	  check removed in `compile-tree-il'.
	  (macro?, define-macro!, get-macro): Store macro definitions in the
	  function slot, not in a separate macro slot.
	* module/language/elisp/runtime.scm (built-in-macro): Wrap the macro
	  function in a macro object (i.e., cons the symbol `macro' onto it).
	* module/language/elisp/runtime/function-slot.scm: Move contents to
	  "subrs.scm". Re-export function and macro definitions instead of
	  defining functions directly in this module.
	* module/language/elisp/runtime/macro-slot.scm: Move contents to
	  "macros.scm" and remove.
	* module/language/elisp/runtime/macros.scm: New file containing macro
	  definitions from "macro-slot.scm".
	* module/language/elisp/runtime/subrs.scm: New file containing function
	  definitions from "function-slot.scm".

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	use existing bindings record for defmacro
	* module/language/elisp/compile-tree-il.scm (compile-pair): Use existing
	  bindings record during macro definition.

	use tree-il's support for optional arguments
	* module/language/elisp/compile-tree-il.scm (compile-lambda): Use
	  Tree-IL's support for optional arguments.
	  (process-optionals, process-rest): Remove.

	make `pass-if-equal' literal in `compile-test'
	* test-suite/tests/elisp-compiler.test (compile-test): Add
	  `pass-if-equal' to the list of literal identifiers

	reindent
	* module/language/elisp/bindings.scm:
	* module/language/elisp/compile-tree-il.scm:
	* module/language/elisp/lexer.scm:
	* module/language/elisp/parser.scm:
	* module/language/elisp/runtime.scm:
	* module/language/elisp/runtime/function-slot.scm:
	* module/language/elisp/runtime/macro-slot.scm:
	* module/language/elisp/spec.scm: Reindent.

	reformat comments
	* module/language/elisp/bindings.scm:
	* module/language/elisp/compile-tree-il.scm:
	* module/language/elisp/lexer.scm:
	* module/language/elisp/parser.scm:
	* module/language/elisp/runtime.scm:
	* module/language/elisp/runtime/function-slot.scm:
	* module/language/elisp/runtime/macro-slot.scm:
	* module/language/elisp/runtime/value-slot.scm: Reformat comments.

	whitespace changes
	* module/language/elisp/bindings.scm:
	* module/language/elisp/compile-tree-il.scm:
	* module/language/elisp/lexer.scm:
	* module/language/elisp/parser.scm:
	* module/language/elisp/runtime.scm:
	* module/language/elisp/runtime/function-slot.scm:
	* module/language/elisp/runtime/macro-slot.scm: Ensure that all
	  top-level forms and comments are separated by exactly one newline.
	  Remove blank lines in most procedure bodies. Delete trailing
	  whitespace.

	autoload compile-file in (guile-user)
	* module/ice-9/boot-9.scm (guile-user): Autoload `compile-file'.

	variable-unset!
	* libguile/variable.c (scm_variable_unset_x): New function.
	* libguile/variable.h (scm_variable_unset_x): New prototype.

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	unbound fluids
	* libguile/fluids.c (scm_make_undefined_fluid, scm_fluid_unset_x)
	  (scm_fluid_bound_p): New functions.

	  (fluid_ref): New function; like scm_fluid_ref, but will not throw an
	  error for unbound fluids.
	  (scm_fluid_ref, swap_fluid): Use `fluid_ref'.

	* libguile/fluids.h (scm_make_undefined_fluid, scm_fluid_unset_x)
	  (scm_fluid_bound_p): New prototypes.

	* libguile/vm-i-system.c (fluid_ref): If fluid is unbound, jump to
	  `vm_error_unbound_fluid'.
	* libguile/vm-engine.c (VM_NAME)[vm_error_unbound_fluid]: New error
	  message.

	* test-suite/tests/fluids.test ("unbound fluids")["fluid-ref of unbound
	  fluid", "fluid-bound? of bound fluid", "fluid-bound? of unbound
	  fluid", "unbound fluids can be set", "bound fluids can be unset"]: New
	  tests.

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

	better unbound variable errors in the vm
	* libguile/vm-i-system.c (variable-ref, toplevel-ref)
	  (long-toplevel-ref): Fixup callers.

	* libguile/vm-engine.c (vm_error_unbound): Don't use vm-error for
	  unbound vars, use misc-error. Don't include VM: in the string. Take
	  the name directly in finish_args, not as a list.

2010-12-07  Brian Templeton  <bpt@hcoop.net>

	make guile-test work without configuration
	* test-suite/guile-test: Use "../meta/guile" as the interpreter instead
	  of "../libguile/guile".
	  (default-test-suite): New function, replacing the variable of the same
	  name. Look for tests in the same directory as the guile-test script.
	  Throw an error if not invoked as `guile-test'.
	  (test-suite): The old default value of `default-test-suite' could now
	  throw an error, and this already gets initialized in `main', so don't
	  provide an initial value.

2010-12-07  Neil Jerram  <neil@ossau.uklinux.net>

	Put `figures' into standard texinfo form
	* doc/ref/goops.texi (Example, Inheritance): Remove unnecessary figure
	  references.  Use @float and @ref.
	  (Class precedence list): Ditto.

2010-12-06  Neil Jerram  <neil@ossau.uklinux.net>

	Merge `tutorial' and `reference' treatments of the same basic GOOPS material
	* doc/ref/goops.texi (GOOPS): Move use of (oop goops) here.

	  (Class Definition): Merged with `Defining New Classes'

	  (Instance Creation): Insert before covering slot options.  Merge in
	  material from `Creating Instances'.

	  (Slot Options): Merged some better wording and index entries from
	  the tutorial version.

	  (Slot Description Example): New node, containing the <my-complex>
	  material from the tutorial.

	  (Methods and Generic Functions, Inheritance): Tutorial sections
	  moved into main line of the manual.

	* doc/ref/goops-tutorial.texi: Nothing left here now.

2010-12-06  Neil Jerram  <neil@ossau.uklinux.net>

	Minor textual markups
	* doc/ref/goops-tutorial.texi (Class definition): No reason to assume
	  particular familiarity with CLOS.
	  (Instance creation and slot access): Remove a couple of words.

2010-12-06  Andy Wingo  <wingo@pobox.com>

	scm_setvbuf doesn't throw away current buffers
	* libguile/ports.c (scm_drain_input): Slight optimization.

	* libguile/fports.c (scm_setvbuf): If there is buffered output, flush
	  it.  If there is input, drain it, and then unread it after updating
	  the buffers.  Much more sensible than dropping it silently...

2010-12-06  Andy Wingo  <wingo@pobox.com>

	http-read calls setvbuf only once
	* module/web/server/http.scm (http-read): Don't play the setvbuf dance,
	  it was throwing away buffered input. Instead just call setvbuf once
	  before doing any reads or writes.

2010-12-06  Andy Wingo  <wingo@pobox.com>

	ice-9 poll handles buffered io too
	* libguile/poll.c (scm_primitive_poll): Account for buffered I/O.

	* module/ice-9/poll.scm (poll): Adapt to call primitive-poll with the
	  port vector too.

2010-12-06  Andy Wingo  <wingo@pobox.com>

	fix name...
	* module/web/request.scm (read-request-body/latin-1): Fix name...

	fix read-{request,response}-body/latin-1
	* module/web/request.scm (read-response-body/latin-1):
	* module/web/response.scm (read-response-body/latin-1): Avoid the
	  craziness of the read-delimited! interface and hand-roll our
	  own. Fixes errors if read-delimited returns #f or EOF.

	update read-delimited! docs
	* doc/ref/api-io.texi (Line/Delimited): Update the read-delimited!
	  docs.

2010-12-06  Andy Wingo  <wingo@pobox.com>

	leniency regarding quality values in http.scm
	* module/web/http.scm: Add commentary.
	  (parse-quality): Allow .NNN to be interpreted as 0.NNN.

	* test-suite/tests/web-http.test ("request headers"): Add a test.

2010-12-06  Andy Wingo  <wingo@pobox.com>

	fix entity tag writing
	* module/web/http.scm (write-entity-tag): Fix writing of entity tags
	  (strong versus weak).

	more robustness in http-read
	* module/web/server/http.scm (http-read): If there was an error reading
	  the request, be sure to close the request port.

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

	http doesn't keep-alive requests for which there was an error
	* module/web/server/http.scm (keep-alive?): Don't keep the client around
	  if there is an error.

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

	(web server http) comment
	* module/web/server/http.scm: Add comment about charsets.

	fix error handling in read-{request,response}-body/latin-1
	* module/web/request.scm (read-request-body/latin-1):
	* module/web/response.scm (read-response-body/latin-1): Detect short
	  reads instead of returning a full buffer with the last bits zeroed
	  out. (Before the make-string commit, they contained uninitialized
	  memory, which was a fairly serious error.)

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

	make-string et al nulls memory if not given an initializer
	* libguile/gc-malloc.c: Add a note that the gc-malloc does not clear the
	  memory block, so users need to make sure it is initialized.

	* libguile/bitvectors.c (scm_c_make_bitvector):
	* libguile/bytevectors.c (scm_make_bytevector):
	* libguile/strings.c (scm_c_make_string): If no initializer is given,
	  initialize the bytes to 0. Prevents information leakage if an app uses
	  make-string et al without initializers.

	* libguile/foreign.c (make_cif): Initialize this too, to prevent leakage
	  in the struct holes. Paranoia...

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

	read-delimited is clearer and conses less
	* module/ice-9/rdelim.scm (read-delimited): Clarify and somewhat
	  optimize implementation.

	http server impl reads body as a bytevector by default
	* module/web/server/http.scm (http-read): Read body as a bytevector by
	  default. That way we punt encoding issues to the app.

	remove redundant error-handling block
	* module/web/server/http.scm (http-read): No need for a
	  call-with-error-handling block here, as the read impl is itself within
	  an error-handling block.

	web server micro-tuning
	* module/web/server/http.scm (http-open): Allow up to 128 pending
	  connections -- the default value for somaxconn on a number of
	  machines. This is from the HOP paper.
	  (http-read): Set the send buffer to 12 KB, also from the HOP paper.

	reverse order of poll-set traversal in http-read
	* module/web/server/http.scm (http-read): Rewrite to iterate down the
	  pollset, so the vector shuffles touch less memory and the end
	  condition of the loop is clearer.

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

	(web server) punts keep-alive to impls; http server uses (ice-9 poll)
	* module/web/server.scm: Rewrite to remove the extra "keep-alive"
	  parameter. Instead, since the server is an essentially stateful
	  object, have clients that want to do keep-alive manage that set as
	  part of the server state. Also avoids imposing a particular data
	  structure on the server implementation.

	* module/web/server/http.scm: Adapt to the new server interface. Also,
	  use a poll set instead of select and lists. Makes handling 1000
	  clients at a time much more possible.

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

	ASYNC_TICK after catching EINTR in SCM_SYSCALL
	* libguile/_scm.h (SCM_SYSCALL): As in scm_syserror, do a SCM_ASYNC_TICK
	  before resuming the syscall after an EINTR.

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

	add (ice-9 poll), a poll wrapper
	* libguile/poll.c:
	* libguile/poll.h:
	* module/ice-9/poll.scm: New module, (ice-9 poll).

	* module/Makefile.am:
	* libguile/init.c:
	* libguile/Makefile.am: Adapt.

	* configure.ac: Check for poll.h and poll.

2010-12-03  Ludovic Courtès  <ludo@gnu.org>

	Add `(ice-9 futures)'.
	* doc/ref/api-scheduling.texi (Threads): Add short introduction.
	  Mention the `threads' feature.  Add cross-reference to futures.
	  (Futures): New node.

	* module/Makefile.am (ICE_9_SOURCES): Add `ice-9/futures.scm'.

	* module/ice-9/futures.scm: New file.

	* test-suite/Makefile.am (SCM_TESTS): Add `tests/future.test'.

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

2010-12-03  Ludovic Courtès  <ludo@gnu.org>

	Add bindings to GNU `sched_setaffinity' and `sched_getaffinity'.
	* configure.ac: Add checks for `sched_setaffinity' and
	  `sched_getaffinity'.

	* doc/ref/posix.texi (Processes): Document `getaffinity' and
	  `setaffinity'.

	* libguile/posix.c (cpu_set_to_bitvector,
	  scm_getaffinity)[HAVE_SCHED_GETAFFINITY]: New functions.
	  (scm_setaffinity)[HAVE_SCHED_SETAFFINITY]: New function.

	* libguile/posix.h (scm_getaffinity, scm_setaffinity): New declarations.

	* test-suite/tests/posix.test ("affinity"): New test prefix.

2010-12-02  Andy Wingo  <wingo@pobox.com>

	no need for fport_fill_input to select() before read()
	* libguile/fports.c (fport_fill_input): Likewise to the previous commit,
	  no need to select() before read().

	scm_accept no longer leaves guile mode
	* libguile/socket.c (scm_accept): Revert
	  7d1fc8721724ab64ccdc44d6f4f84abad43751b4. Now that we don't need to
	  leave guile mode in order for GC to happen, don't do so, as we assume
	  that anyone who cares has already done a select() beforehand.

	sxml->xml fix
	* module/sxml/simple.scm (attribute-value->xml): Whoops, fix null case.

	sxml->xml writes directly to a port
	* module/sxml/simple.scm: Remove "universal-sxslt-rules" -- it was a bad
	  interface, and I couldn't find any users of it.
	  (sxml->xml): Rewrite so that instead of generating another tree of
	  data, we write the data directly to a port.

	add some debugging to (web server)
	* module/web/server.scm: Add some basic elapsed-time debugging, but only
	  if you flip a switch to turn it on at expand-time.

	better socket buffering on http web server backend
	* module/web/server/http.scm (http-read, http-write): Line-buffer the
	  port while we're reading the request, and block-buffer it otherwise
	  Use the default block size.

	indentation fix in ports.c
	* libguile/ports.c (scm_i_get_conversion_strategy): Indentation fix.

	(web server) supports non-utf-8 charsets
	* module/web/server.scm (sanitize-response): Support charsets other than
	  utf-8. Oddly collecting a string and converting it to utf-8 appears to
	  be faster than collecting a utf-8 bytevector directly.

2010-12-02  Andy Wingo  <wingo@pobox.com>

	add simple web app examples
	* examples/web/hello.scm:
	* examples/web/debug-sxml.scm: New examples, for simple web
	  applications.

	* examples/README:
	* examples/Makefile.am: Add new files.

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

	http web server impl ignores SIGPIPE
	* module/web/server/http.scm (http-open): Ignore SIGPIPE. Keeps the
	  server from dying in some circumstances.

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

	stub fixes to http 1.0 support in the web server
	* module/web/server.scm (read-client): Fix number of returned values in
	  the case in which there is an error reading the client.
	  (sanitize-response): Add a case to adapt the reponse to the request
	  version.
	  (handle-request): Sanitize the response within an error-handling
	  block.
	  (serve-one-client): Move sanitation out of here.

	* module/web/server/http.scm (keep-alive?): A more proper detection on
	  whether we should support persistent connections.

	* module/web/response.scm (adapt-response-version): New routine, to
	  adapt a response to a given version. Currently a stub.

2010-11-25  Andreas Rottmann  <a.rottmann@gmx.at>

	Some tweaks to the R6RS support
	* module/rnrs/base.scm (error, assert): Define -- they were missing.
	  (assertion-violation): Properly treat a #f `who' argument.

	* module/rnrs/conditions.scm (condition): Use `assertion-violation'
	  instead of the undefined `raise'.
	  (define-condition-type): Fix for multiple fields.
	* test-suite/tests/r6rs-conditions.test: Test accessors of a
	  multiple-field condition.  Also import `(rnrs base)' to allow
	  stand-alone running of the tests; apparently the `@' references
	  scattered throughout the R6RS modules make the libraries sensitive to
	  their load order -- for instance, trying to load `(rnrs conditions)'
	  before `(rnrs base)' is loaded fails.

	* module/rnrs/records/inspection.scm: Use `assertion-violation' instead
	  of an explicit `raise'.
	* module/rnrs/records/syntactic.scm (process-fields): Use
	  `syntax-violation' instead of bogus invocations of `error'.

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

	Fix `regexp.test' when the "en_US.utf8" locale isn't available.
	* test-suite/tests/regexp.test ("nonascii locales"): Move `with-locale'
	  within the body of `pass-if' so that `unresolved' is caught.

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

	Honor R6RS transcoder error handling modes, when possible.
	* module/rnrs/io/ports.scm (transcoded-port): Change RESULT's conversion
	  strategy based on TRANSCODER's error-handling mode.

	* test-suite/tests/r6rs-ports.test ("8.2.6  Input and output
	  ports")["transcoded-port [error handling mode = raise]",
	  "transcoded-port [error handling mode = replace]"]: New tests.

2010-11-24  Andreas Rottmann  <a.rottmann@gmx.at>

	Add implementation of "transcoded ports"
	* libguile/r6rs-ports.c (make_tp, tp_write, tp_fill_input, tp_flush)
	  (tp_close, initialize_transcoded_ports, scm_i_make_transcoded_port): New
	  functions.
	  (scm_init_r6rs_ports): Call `initialize_transcoded_ports'.
	* module/rnrs/ports.scm (transcoded-port): Actually implement,
	  using `%make-transcoded-port'.
	* test-suite/tests/r6rs-ports.test ("8.2.6 Input and output ports"): Added a
	  few tests for `transcoded-port'.

2010-11-24  Andreas Rottmann  <a.rottmann@gmx.at>

	Work towards a more complete implementation of `(rnrs io ports)'
	* module/rnrs/io/ports.scm: (file-options, buffer-mode, eol-style)
	  (error-handling-mode, make-transcoder, native-transcoder)
	  (latin-1-codec, utf-8-codec, utf-16-codec)
	  (call-with-bytevector-output-port, open-file-input-port)
	  (open-file-output-port, make-custom-textual-output-port)
	  (flush-output-port, put-char, put-datum, put-string, get-char)
	  (get-datum, get-line, get-string-all, lookahead-char)
	  (standard-input-port, standard-output-port, standard-error-port):
	  Define all of these.

	  (call-with-port): Don't use `dynamic-wind', as it is against its
	  specification in R6RS 8.2.6.

	* module/rnrs.scm: Export procedures added.

	* module/rnrs/io/simple.scm (call-with-input-file)
	  (call-with-output-file): Define these in terms of R6RS procedures to
	  get correct exception behavior.

2010-11-24  Andreas Rottmann  <a.rottmann@gmx.at>

	Reorganize the R6RS I/O condition types
	Move the I/O condition types from `(rnrs conditions)', where they were
	not exported, to `(rnrs files)', where they are.

	* module/rnrs/conditions.scm: Remove definition of I/O condition types.
	* module/rnrs/files.scm: Replace references to I/O condition types
	  inside `(rnrs conditions)' with the actual definitions.
	* module/rnrs/io/simple.scm: Don't `@@'-reference the I/O condition types, just
	  imported them from `(rnrs files)'.

2010-11-24  Andreas Rottmann  <a.rottmann@gmx.at>

	Turn `(rnrs io ports)' into an R6RS library
	* module/rnrs/io/ports.scm: Change into an R6RS library from a "regular"
	  Guile module, so the bookkeeping for #:re-export and #:replace is done
	  automatically and we gain control over the imports from `(guile)'.

2010-11-23  Andy Wingo  <wingo@pobox.com>

	fix regexp matches to refer to chars, not bytes
	* libguile/regex-posix.c (fixup_multibyte_match): Fixup the match
	  structure to refer to character offsets, not byte offsets. Fixes bug
	  31650.

	* test-suite/tests/regexp.test: Add a test.

2010-11-23  Andy Wingo  <wingo@pobox.com>

	fix web server bugs
	* module/web/http.scm (valid-quality?):
	* module/web/server.scm (sanitize-response): Fix a couple bugs.

2010-11-22  Andy Wingo  <wingo@pobox.com>

	fix up a couple content-length issues in web/server.scm:sanitize-response
	* module/web/server.scm (sanitize-response): Allow body to be #f. Don't
	  require or insert a content-length if there is no body.

2010-11-21  Julian Graham  <julian.graham@aya.yale.edu>

	Enumeration set universe comparisons should be done with `equal?'
	* module/rnrs/enums.scm (enum-set-union, enum-set-intersection,
	  enum-set-difference): Compare enum-set universes with `equal?' to support
	  sets generated using constructor syntax bound by `define-enumeration'.
	* test-suite/tests/r6rs-enums.test (enum-set-union, enum-set-intersection,
	  enum-set-difference): New test cases for syntactically-generated sets.

2010-11-20  Andreas Rottmann  <a.rottmann@gmx.at>

	Fix missing port-table locking and bytevector output port segfault
	* libguile/r6rs-ports.c (make_bip, make_cbip, make_bop, make_cbop): Lock
	  the port table.

	* libguile/r6rs-ports.c (make_bop): Let the returned extraction
	  procedure refer to the port's buffer instead of the port itself.  This
	  fixes a segfault if the port is closed before the extraction procedure
	  is called.
	  (bop_proc_apply): Adapt accordingly.
	* test-suite/tests/r6rs-ports.test (8.2.10 Output ports): Add testcase
	  for extraction after close.

2010-11-20  Andreas Rottmann  <a.rottmann@gmx.at>

	Allow user-defined meta-commands
	Besides allowing user-defined meta-commands, this change also refactors
	the meta-command machinery to split reading a command's arguments from
	the procedure actually implementing it, and hence allows nesting
	meta-commands.  As an example of such a command, ",in" is added as a new
	meta-command.

	* module/system/repl/command.scm: Export `define-meta-command'.
	  (*command-module*): Replaced by the hash table `*command-infos*'.
	  (command-info, make-command-info, command-info-procedure)
	  (command-info-arguments-reader): New procedures, encapsulating the
	  information about a meta-command.
	  (command-procedure): Adapted to use the `command-info' lookup
	  procedure.
	  (read-command-arguments): New auxiliary procedure invoking a command's
	  argument reader procedure.
	  (meta-command): Adapted to the split of reading arguments and
	  executing a command.
	  (add-meta-command!): New auxiliary procedure, registers a meta
	  command's procedure and argument reader into `*command-infos* and
	  `*command-table*.
	  (define-meta-command): Extended to allow specification of the command's
	  category; split the argument reader and actual command procedure.
	  (guile:apropos, guile:load, guile:compile-file, guile:gc): Remove these
	  aliases, they are unnecessary as we now use a hash table instead of the
	  module to store the commands.
	  (in): New meta-command, which evaluates an expression, or alternatively
	  executes another meta-command, in the context of a specific module.
	* doc/ref/scheme-using.texi (Module Commands): Document the `in'
	  meta-command.

2010-11-20  Andy Wingo  <wingo@pobox.com>

	announce flex version in autogen.sh
	* autogen.sh: Announce flex version. Has the side-effect of checking for
	  flex when building from git.

2010-11-20  Andreas Rottmann  <a.rottmann@gmx.at>

	Allow specifying load extensions on the command line
	Add a new command-line switch `-x', which manipulates the
	%load-extensions list.

	* libguile/script.c (scm_compile_shell_switches): Process the new "-x"
	  switch.
	  (scm_shell_usage): Mention the "-x" switch.
	* doc/ref/scheme-scripts.texi (Invoking Guile): Add "-x" switch to the
	  list of command-line switches.

2010-11-20  Ludovic Courtès  <ludo@gnu.org>

	Use `define-module*' in (ice-9 history).
	* module/ice-9/history.scm: Use `define-module*' instead of
	  `process-define-module'.

2010-11-19  Andy Wingo  <wingo@pobox.com>

	bump objcode version
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump, as the
	  process-define-module deprecation means that outside compiled code
	  won't find process-define-module in the (guile) module, as they would
	  before.

2010-11-19  Andy Wingo  <wingo@pobox.com>

	fix string-filter and string-delete argument order
	* libguile/srfi-13.h:
	* libguile/srfi-13.c (scm_string_filter, scm_string_delete): Swap
	  char_pred and s argument order, to comply with SRFI-13. There is a
	  back-compat shim that will detect programs that used the old,
	  erroneous interface, while giving a warning.

	* doc/ref/api-data.texi: Update docs.

2010-11-19  Andy Wingo  <wingo@pobox.com>

	deprecate process-define-module
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (process-define-module): Deprecate.

	define-module compiles to define-module*
	* module/ice-9/boot-9.scm (define-module): Compile down to a call to
	  define-module*, not process-define-module.

	scm_c_define_module uses define-module*
	* libguile/modules.c (scm_c_define_module):
	* module/ice-9/boot-9.scm: Update to have the C function call
	  define-module*.

	make module definition procedure more structured
	* module/ice-9/boot-9.scm (define-module*): New procedure, like
	  process-define-modules but more structured.
	  (process-define-module): Reimplement in terms of define-module*.

	relax sizeof(long) restriction in configure.ac
	* configure.ac: Relax the sizeof(long)==sizeof(void*) restriction,
	  instead asserting that the sizeof(long)<=sizeof(void*). There will
	  still be problems on nonstandard platforms related to the interface
	  with gmp, but those are confined to numbers.c.

2010-11-19  Andy Wingo  <wingo@pobox.com>

	fix a number of assuptions that a long could hold an inum
	* libguile/bytevectors.c:
	* libguile/goops.c:
	* libguile/instructions.c:
	* libguile/numbers.c:
	* libguile/random.c:
	* libguile/read.c:
	* libguile/vm-i-scheme.c: Fix a number of assumptions that a long could
	  hold an inum. This is not the case on platforms whose void* is larger
	  than their long.

	* libguile/numbers.c (scm_i_inum2big): New helper, only implemented for
	  sizeof(void*) == sizeof(long); produces a compile error on other
	  platforms. Basically gmp doesn't have a nice interface for converting
	  between mpz values and intmax_t.

2010-11-19  Andy Wingo  <wingo@pobox.com>

	simpos tweak
	* libguile/simpos.c (scm_system_star): Use scm_from_ulong, as we do cast
	  to ulong.

	fix a number of assumptions that a pointer could fit into a long
	* libguile/debug.c:
	* libguile/eval.c:
	* libguile/frames.c:
	* libguile/objcodes.c:
	* libguile/print.c:
	* libguile/programs.c:
	* libguile/read.c:
	* libguile/struct.c:
	* libguile/vm.c: Fix a number of instances in which we assumed we could
	  fit a pointer into a long.

2010-11-19  Ludovic Courtès  <ludo@gnu.org>

	Fix incorrect uses of en-dashes and em-dashes in the intro.
	* doc/ref/intro.texi (Introduction): Use commas instead of en-dashes
	  around "for example".  Use em-dashes instead of en-dashes around
	  parenthetical phrases.  Remove spaces around em-dashes.

2010-11-19  Ludovic Courtès  <ludo@gnu.org>

	Include <alloca.h> wherever `alloca' is used.
	Patch provided by <carlo.bramix@libero.it> (tiny change).

	* libguile/control.c, libguile/fluids.c, libguile/foreign.c,
	  libguile/hashtab.c, libguile/strings.c: Include <alloca.h>.

2010-11-19  Ludovic Courtès  <ludo@gnu.org>

	Optimize fixnum comparison.
	* libguile/vm-i-scheme.c (REL): Don't untag X and Y since tagging
	  preserves ordering.

	Add fixnum arithmetic benchmarks.
	* benchmark-suite/benchmarks/arithmetic.bm ("fixnum")["*", "/"]: New
	  benchmarks.

2010-11-19  Ludovic Courtès  <ludo@gnu.org>

	Add optimized tagged integer addition/subtractions for x86_64.
	This results in a 17% improvement in the execution time of the "+" and
	"-" benchmarks for fixnums.

	* libguile/vm-i-scheme.c (ASM_ADD, ASM_SUB)[defined __x86_64__ &&
	  SCM_GNUC_PREREQ (4, 5)]: New macros.
	  (add)[defined ASM_ADD]: Use `ASM_ADD' for the fast path.
	  (sub)[defined ASM_SUB]: Use `ASM_SUB' for the fast path.

	* test-suite/tests/numbers.test ("+")["fixnum + fixnum = bignum
	  (32-bit)", "fixnum + fixnum = bignum (64-bit)", "bignum + fixnum =
	  fixnum", "wrong type"]: New tests.
	  ("-")["fixnum - fixnum = bignum (32-bit)", "fixnum - fixnum = bignum
	  (64-bit)", "bignum - fixnum = fixnum", "wrong type"]: New tests.

	* test-suite/tests/00-initial-env.test ("goopsless")["+ wrong type
	  argument"]: Use `with-test-prefix/c&e' instead of `with-test-prefix'.
	  ["- wrong type argument"]: New test prefix.

2010-11-19  Ludovic Courtès  <ludo@gnu.org>

	Use the `with-test-prefix/c&e' for the `1+' and `1-' tests.
	* test-suite/tests/numbers.test ("1+"): Use `with-test-prefix/c&e'
	  instead of `with-test-prefix'.  Provide a name to each `pass-if'
	  invocation.
	  ("1-"): Likewise.

	Move `with-test-prefix/c&e' to `(test-suite lib)'.
	* test-suite/tests/bytevectors.test (c&e, with-test-prefix/c&e): Move...
	* test-suite/lib.scm: ... here.
	  (with-test-prefix): Rewrite using `syntax-rules'.

	Add `SCM_GNUC_PREREQ'.
	* libguile/__scm.h (SCM_GNUC_PREREQ): New macro.
	  Use it in this file in lieu of hand-written GCC version tests.

2010-11-18  Andy Wingo  <wingo@pobox.com>

	add `reload-module' to boot-9
	* module/ice-9/boot-9.scm (reload-module): New procedure,
	  programmatically reloads the source file corresponding to the given
	  module.

	numbers.test expects lower-case hexadecimals
	* test-suite/tests/numbers.test ("number->string"): Expect lower-case
	  hexidecimals.

	read-set! takes effect at expand time
	* module/ice-9/boot-9.scm (define-option-interface): The set! command
	  goes in an eval-when to be run at expand-time, so that (read-set!
	  keywords 'prefix) does what it used to in 1.8 (mostly).

2010-11-18  Andy Wingo  <wingo@pobox.com>

	repl read/write using current ports, not captured ports
	Fixes bug in repl meta-commands after activating readline, which changes
	the current input port.

	* module/system/repl/common.scm (<repl>): Remove inport and outport
	  fields.
	  (make-repl): Adapt.
	  (repl-read, repl-print): Just read and write to the current ports.

	* module/system/repl/repl.scm (meta-reader): Meta-read from the current
	  input port.

	* module/system/repl/command.scm (read-command, define-meta-command):
	  Read from the current input port.

2010-11-18  Andy Wingo  <wingo@pobox.com>

	lower-case hexadecimal digits again
	* libguile/numbers.c: Default to lower-case hexadecimal digits again.

	better errors for ecmascript parser too
	* module/language/ecmascript/parse.scm (syntax-error): Better errors
	  here too.

	ecmascript tokenization errors report source location
	* module/language/ecmascript/tokenize.scm (syntax-error): Report source
	  locations. Adapt all callers to pass source locations.

	add source-location->source-properties to lalr
	* module/system/base/lalr.scm (source-location->source-properties): New
	  public function, to produce source properties that can be given to the
	  compiler.

	more ecmascript testing
	* test-suite/tests/ecmascript.test (eread/1, parse): Also check
	  read-ecmascript/1, which uses tokenize/1.

	fix ecmascript at the repl
	* module/language/ecmascript/tokenize.scm (syntax-error): Reorder args
	  to throw vals in the right order.
	  (make-tokenizer/1): Fix. Broken since the lalr refactor...

	repl.scm displays syntax errors on read as well
	* module/system/repl/repl.scm (prompting-meta-read): Use
	  display-syntax-error as appropriate.

2010-11-18  Andy Wingo  <wingo@pobox.com>

	deprecate cuserid
	* libguile/posix.c:
	* libguile/posix.h:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_cuserid): Deprecate cuserid, as it only
	  returns 8 bytes of a user's login.

	* doc/ref/posix.texi: Remove cuserid from docs.

2010-11-18  Andy Wingo  <wingo@pobox.com>

	adapt tests to new syntax-error form
	* test-suite/tests/syntax.test (pass-if-syntax-error): Fix up for new
	  form of syntax errors. Adapt all tests.

	* test-suite/tests/srfi-17.test: Likewise.

2010-11-17  Julian Graham  <julian.graham@aya.yale.edu>

	Add exports for missing functions from `(rnrs base)'.
	* module/rnrs.scm (boolean=?): New export.
	  Fix typo in export of`integer-valued?'.
	* module/rnrs/base.scm: Add exports for `exact' and `inexact'.
	  (boolean=?, symbol=?, infinite?, finite?, exact-integer-sqrt,
	  integer-valued?, rational-valued?, real-valued?): New functions.
	* test-suite/tests/r6rs-base.test (boolean=?, symbol=?, infinite?,
	  finite?, exact-integer-sqrt, integer-valued?, rational-valued?,
	  real-valued?): New test prefixes and tests.

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

	fix the C syntax-error pretty-printer
	* libguile/throw.c (handler_message): Fix up a bit.

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

	add proper pretty-printing for syntax errors
	* module/system/repl/repl.scm (display-syntax-error): New helper,
	  displays a syntax error.
	  (abort-on-error, run-repl): Use it.

	* libguile/throw.c (handler_message): Re-code the same thing in C.

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

	remove syntax-error and call-with-compile-error-catch from compile.scm
	* module/system/base/compile.scm: Remove unused syntax-error and
	  call-with-compile-error-catch exports.

	ecmascript syntax errors throw to 'syntax-error
	* module/language/ecmascript/parse.scm (syntax-error):
	* module/language/ecmascript/tokenize.scm (syntax-error): Throw to
	  'syntax-error as psyntax does.

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

	syntax-violation uses lambda*, throws a structured message
	* module/ice-9/psyntax.scm (syntax-violation): Use lambda* for subform
	  arg. Instead of using scm-error, just throw to 'syntax-error with all
	  we got.

	* module/ice-9/psyntax-pp.scm (#{and-map*\ 37}): Regenerated.

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

	fix string->number for bases > 16
	* libguile/numbers.c (scm_iuint2str): Add an assertion on the domain of
	  the radix. Use the number_chars table to write the string, instead of
	  doing strange math. Same effect, though.
	  (mem2uinteger, char_decimal_value): Change logic to allow all ascii
	  alphabetic chars as decimals, not just a-f. Thanks to Nils Gey for the
	  report.

	* test-suite/tests/numbers.test ("number->string"): Add some tests.

2010-11-14  Neil Jerram  <neil@ossau.uklinux.net>

	Expression-oriented readline history
	* guile-readline/ice-9/readline.scm (make-readline-port): Instead of
	  calling add-history after every %readline call, do it only when
	  starting a new read.  Other times, append the line just read to an
	  internal buffer.

2010-11-13  Andy Wingo  <wingo@pobox.com>

	flesh out (web server)'s sanitize-response
	* module/web/server.scm (sanitize-response): Flesh out. If we get a
	  string, we encode it to a bytevector using the encoding snarfed from
	  the response. We should check the request, though...

	add extend-response.
	* module/web/response.scm (extend-response): New utility.

2010-11-13  Andy Wingo  <wingo@pobox.com>

	(web http) parses content-type as "foo/bar", not "foo" "bar"
	* module/web/http.scm (parse-media-type, validate-media-type,
	  (content-type): Change to represent media types as ("foo/bar" ("param"
	  . "val") ...) instead of ("foo" "bar" ("param" . "val") ...). Seems to
	  be more in line with what people expect.

	* test-suite/tests/web-http.test ("entity headers"): Add content-type
	  test.

	* test-suite/tests/web-response.test ("example-1"): Adapt expected
	  parse.

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

	NUL vs NULL fix
	* libguile/read.c (scm_i_scan_for_encoding): Fix NUL rather than NULL.

	remove (web toy-server)
	* module/Makefile.am
	* module/web/toy-server.scm: Remove. It's not so much that the new (web
	  server) stuff is not a toy, it's that users are expected to use the
	  new backends (mod-lisp, etc) in "production".

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

	add generic web server with http-over-tcp backend
	* module/web/server.scm: New generic web server module, with support for
	  different backends. An HTTP-over-TCP backend is the only one included
	  with Guile, though one can imagine FastCGI, mod-lisp, mongrel2/0mq etc
	  backends as well.

	* module/web/server/http.scm: The aforementioned HTTP backend.

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

	add request-meta
	* module/web/request.scm (<request>): Add `meta' field and accessor, for
	  metadata like the server IP, the client IP, CGI environment variables,
	  etc.
	  (build-request): Add meta kwarg.
	  (read-request): Add meta optional arg.
	  (write-request): Adapt.

	more (web http) exports for parsing request components
	* module/web/http.scm (lookup-header-decl): New exported function.
	  (parse-http-version, parse-http-method, parse-request-uri): Export
	  these functions.

	call-with-error-handling pass-keys w/ procedural handlers fix
	* module/system/repl/error-handling.scm (call-with-error-handling):
	  Respect the pass-keys set for procedural on-error and post-error
	  handlers.

	unparse-uri avoids serializing e.g. :80 in http:// uris
	* module/web/uri.scm (declare-default-port!): New function, declares a
	  default port for a scheme. Predeclare default ports for http and
	  https.
	  (unparse-uri): If the port is the default port for the given scheme,
	  don't serialize the port part of the URI.

2010-11-12  Julian Graham  <julian.graham@aya.yale.edu>

	Fix buffer over-read in port encoding scan.
	* libguile/read.c (scm_i_scan_for_encoding): Add a NULL terminator to the
	  end of header to prevent over-read by subsequent call to strstr.

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

	Add FFI tests for `sizeof' and structs.
	* test-suite/tests/foreign.test ("structs")["sizeof { int8, double }",
	  "sizeof { short, int, long, pointer }"]: New tests.

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

	Add FFI support for `short' and `unsigned short'.
	* libguile/foreign.c (sym_short, sym_unsigned_short): New variables.
	  (scm_init_foreign): Define Scheme variables SYM_SHORT and
	  SYM_UNSIGNED_SHORT.

	* module/system/foreign.scm (short, unsigned-short): New exports.
	  (integer-ref, integer-set): Support (= (sizeof TYPE) 2).
	  (%read-short, %write-short!, %read-unsigned-short,
	  %write-unsigned-short!): New variables.
	  (*writers*): Add support for `short' and `unsigned-short'.
	  (*readers*): Likewise.

	* test-suite/tests/foreign.test ("structs")["int8, pointer, short,
	  double"]: New test.

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

	Have `parse-c-struct' and `make-c-struct' support `int', pointers, etc.
	Reported by Tristan Colgate <tcolgate@gmail.com>.

	* module/system/foreign.scm: Call `load-extension' at compile-time too.
	  (compile-time-value): New macro.
	  (integer-ref, integer-set): New procedures.
	  (define-integer-reader, define-integer-writer): New macros.
	  (%read-int, %read-long, %write-int!, %write-long!, %read-unsigned-int,
	  %read-unsigned-long, %write-unsigned-int!, %write-unsigned-long!,
	  %read-size_t, %write-size_t!, %read-pointer, %write-pointer!): New
	  procedures.
	  (*writers*): Add writers for `int', `unsigned-int', `long',
	  `unsigned-long', `size_t', and `*'.
	  (*readers*): Likewise.

	* test-suite/tests/foreign.test ("structs")["int8, pointer",
	  "unsigned-long, int8, size_t", "long, int, pointer"]: New tests.

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

	FFI: Honor alignment constraints in `parse-c-struct'.
	* module/system/foreign.scm (parse-c-struct): Honor alignment
	  constraints for TYPE.

	* test-suite/tests/foreign.test ("structs")["alignment constraints
	  honored"]: New test.

2010-11-09  Michael Gran  <spk121@yahoo.com>

	Use ellipsis character in truncated pretty-print of sequences
	* module/ice-9/pretty-print.scm (print-sequence): use ellipsis when available

2010-11-08  Mike  <mike@joseph.localhost>

	pretty-print print-sequence width error
	Avoid the "expected a positive width" display error when printing
	sequences with no width remaining.

	* module/ice-9/pretty-print (print-sequence): test for zero width when
	  printing sequences

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

	Fix `reader.test'.
	This is a followup to a4e472294423bb796db3132c73027384fdfff820 ("need
	read error for extra closing square brackets".)

	* test-suite/tests/reader.test (exception:unexpected-rsqbracket): New
	  variable.
	  ("reading")["paren mismatch (2)"]: Change exception type to
	  EXCEPTION:UNEXPECTED-RSQBRACKET.
	  ["paren mismatch (3)", "paren mismatch (4)"]: New tests.
	  ("mismatching parentheses")["closing square bracket following
	  mismatched opening"]: New test.

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

	pretty-print: Suitably indent macro-related constructs.
	* module/ice-9/pretty-print.scm (generic-write)[pp-SYNTAX-CASE]: New
	  procedure.
	  [style]: Add support for `define-public', `define-syntax',
	  `let-syntax', `letrec-syntax', `syntax-rules', and `syntax-case'.

2010-11-06  Andy Wingo  <wingo@pobox.com>

	fix up toy-server error handling
	* module/web/toy-server.scm (serve-client): Fix up error handling, so we
	  catch errors when reading, handling, and writing. If we run
	  interactively, an error will enter the debugger.

2010-11-05  Michael Gran  <spk121@yahoo.com>

	need read error for extra closing square brackets
	* libguile/read.c (scm_read_expression): add test

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

	Improve handling of read macros in `pretty-print'.
	* module/ice-9/pretty-print.scm (generic-write)[wr]: Handle read macros
	  that appear in the middle of a list.

	* test-suite/tests/print.test (prints?): New macro.
	  ("pretty-print"): New test prefix.

2010-11-05  Andy Wingo  <wingo@pobox.com>

	add toy web server
	* module/web/toy-server.scm: New module, a toy web server.

	* module/Makefile.am: Adapt.

2010-11-05  Andy Wingo  <wingo@pobox.com>

	add HTTP response module
	* module/web/response.scm: New module, for HTTP responses.
	* test-suite/tests/web-response.test: Test suite.

	* module/Makefile.am:
	* test-suite/Makefile.am: Adapt.

2010-11-05  Andy Wingo  <wingo@pobox.com>

	add HTTP request module
	* module/web/request.scm: Add HTTP request module.
	* test-suite/tests/web-request.test: Test cases.

	* module/Makefile.am:
	* test-suite/Makefile.am: Adapt.

2010-11-04  Andy Wingo  <wingo@pobox.com>

	add HTTP module
	* module/web/http.scm: New module, declares known HTTP headers, and
	  their parsers and unparsers.

	* test-suite/tests/web-http.test: Add test suite.

	* module/Makefile.am:
	* test-suite/Makefile.am: Adapt.

2010-11-04  Andy Wingo  <wingo@pobox.com>

	URI parsing errors throw to `uri-error'
	* module/web/uri.scm (uri-error): New proc, throws to 'uri-error.
	  (validate-uri, uri-decode, uri-encode): Use uri-error.

	* test-suite/tests/web-uri.test: Update for uri-error.

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

	Finish adding api-regex.texi
	* doc/ref/Makefile.am (guile_TEXINFOS): Add api-regex.texi, so that it
	  gets into distributions.

2010-11-03  Andreas Rottmann  <a.rottmann@gmx.at>

	Add implementation of SRFI 38
	* module/srfi/srfi-38.scm: New file, partly based on the reference
	  implementation and on Alex Shinn's public-domain implementation for
	  Chicken.
	* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-38.scm.

	* test-suite/tests/srfi-38.test: New file, minimal test suite for SRFI
	  38.
	* test-suite/Makefile.am (SCM_TESTS): Added tests/srfi-38.test.

	* doc/ref/srfi-modules.texi: Add a node for SRFI 38.

2010-11-03  Andreas Rottmann  <a.rottmann@gmx.at>

	Use a fluid for the list of the reader's "hash procedures"
	This allows customizing the reader behavior for a dynamic extent more easily.

	* libguile/read.c (scm_read_hash_procedures): Renamed to
	  `scm_i_read_hash_procedures'.
	  (scm_i_read_hash_procedures_ref, scm_i_read_hash_procedures_set_x):
	  New (internal) accessor functions for the fluid.
	  (scm_read_hash_extend, scm_get_hash_procedure): Use these accessor
	  functions.
	  (scm_init_read): Create the fluid, named `%read-hash-procedures' instead of
	  the previous plain list `read-hash-procedures'.

	* test-suite/tests/reader.test: Adapt the "R6RS/SRFI-30 block comment
	  syntax overridden" test to make use of the fluid.

	* module/ice-9/deprecated.scm (read-hash-procedures):
	  New identifier macro -- backward-compatibility shim.

2010-10-31  Neil Jerram  <neil@ossau.uklinux.net>

	Manual sections don't need a page break before
	* doc/ref/api-coverage.texi (Code Coverage): Remove @page.

	* doc/ref/api-foreign.texi (Foreign Function Interface): Ditto.

	* doc/ref/api-lalr.texi: (LALR(1) Parsing): Ditto.

	* doc/ref/api-macros.texi (Macros): Ditto.

2010-10-31  Neil Jerram  <neil@ossau.uklinux.net>

	Add ref to new location for regex doc
	* doc/ref/api-data.texi: Add ref to new location for regex doc.  Also
	  correct other refs to say section rather than chapter.

2010-10-31  Neil Jerram  <neil@ossau.uklinux.net>

	Promote regex doc out of the `Simple Data Types' section
	Because that probably isn't where people will look for it.
	Thanks to Noah Lavine for the idea.

	* doc/ref/api-regex.texi (Regular Expressions): New file, containing
	  the regex doc (promoted one level) that used to be in api-data.texi.

	* doc/ref/guile.texi (API Reference): Include new file, and add menu
	  entry for the new section.

	* THANKS: Add Noah.

2010-10-28  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in the (system base lalr) documentation.
	* doc/ref/api-lalr.texi (LALR(1) Parsing): "The tokenizer should be a
	  unary procedure" -> "thunk".  Patch by Noah Lavine
	  <noah.b.lavine@gmail.com>.

2010-10-27  Andreas Rottmann  <a.rottmann@gmx.at>

	Extend the #:replace list of the SRFI 69 module
	* module/srfi/srfi-69.scm: Add `make-hash-table' and `hash-table?' to
	  the #:replace list of the module definition.

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

	Have "frisk" recognize `#:use-module' and `#:autoload'.
	* module/scripts/frisk.scm (grok-proc): Support keywords `#:use-module'
	  and `#:autoload'.

	Augment `arithmetic.bm'.
	* benchmark-suite/benchmarks/arithmetic.bm (repeat): Change the syntax.
	  Add support for binary OP.
	  ("fixnum")["1+", "1-"]: Adjust accordingly.
	  ["+", "-"]: New benchmarks.

2010-10-26  Neil Jerram  <neil@ossau.uklinux.net>

	Fix manual typo
	* doc/ref/api-foreign.texi: "prodedures" -> "procedures".

2010-10-22  Julian Graham  <julian.graham@aya.yale.edu>

	Improve performance of R6RS records implementation
	Reimplement record-type descriptors as vtables for record structs, saving
	us what was an expensive inspection of a record's vtable layout string to
	determine its type.

	* module/rnrs/records/inspection.scm (record-field-mutable?): Check
	  mutability using the bit field stored in the record-type descriptor
	  instead of the record struct's vtable.
	* module/rnrs/records/procedural.scm (record-internal?): Reimplement as a
	  delegation to a check of the passed struct's vtable against
	  `record-type-descriptor?'.
	  (record-type-vtable): Modify to include base vtable layout as a prefix
	  of the record-type-descriptor layout so that all record-type instances
	  are now also vtables.
	  (make-record-type-descriptor): Remove field vtable; build up a mutability
	  bit field to use for fast mutability checks.
	  (record-accessor, record-mutator): Use field struct and mutability bit
	  field.

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

	Tweak `-Wunused-variable' and `-Wunused-toplevel' for special names.
	* module/language/tree-il/analyze.scm (gensym?): New procedure.
	  (unused-variable-analysis): Ignore variables whose name passes
	  `gensym?' or is `_'.
	  (unused-toplevel-analysis): Ignore variables whose name passes
	  `gensym?'.

	* test-suite/tests/tree-il.test ("warnings")["unused-variable"]("special
	  variable names"): New test.
	  ["unused-toplevel"]("special variable names"): New test.

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

	Add `Libs.private' to the `.pc' files.
	* meta/guile-2.0-uninstalled.pc.in (Libs): Remove @GUILE_LIBS@.
	  (Libs.private): New field.
	* meta/guile-2.0.pc.in (Libs): Remove @GUILE_LIBS@.
	  (Libs.private): New field.

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

	configure: Don't needlessly augment $LIBS (and $GUILE_LIBS.)
	* configure.ac: Don't augment $LIBS with $LTLIBUNISTRING and
	  $BDW_GC_LIBS.

	* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS):
	  Remove @LTLIBINTL@.  Add $(BDW_GC_LIBS).

2010-10-20  Tristan Colgate-McFarlane  <tcolgate@gmail.com>

	Add support for more multicast sockopts.
	* libguile/socket.c: Add support for IP_MULTICAST_TTL and IP_MILTICAST_IF sockopts.

	Fix detection of struct ip_mreq
	* configura.ac: netinet/in.h is required to complete definition of
	  struct ip_mreq.

2010-10-19  Andy Wingo  <wingo@pobox.com>

	rdelim cleanups
	* module/ice-9/rdelim.scm: Clean up export list.
	  (read-line!, read-delimited!, read-delimited, read-line): Use
	  define*.

2010-10-18  Andy Wingo  <wingo@wingomac.bcn.oblong.net>

	more -Wundef on darwin fixes
	* libguile/threads.c:
	* libguile/posix.c: Change a couple #if HAVE_FOO to #ifdef HAVE_FOO to
	  pacify -Wundef. Some vars are defined or not, whereas some are always
	  defined to 0 or 1. The inconsistency is unfortunate.

	uninitialized var in scm_read_character
	* libguile/read.c (scm_read_character): Fix error condition where
	  charname could be uninitialized.

	_scm GUILE_USE_64_CALLS compilation warning fix
	* libguile/_scm.h: Check that GUILE_USE_64_CALLS is defined. Fixes an
	  error on i386-apple-darwin9.8.0.

2010-10-17  Andy Wingo  <wingo@pobox.com>

	web/uri: reimplement for rfc 3986, add tests
	* module/web/uri.scm: Reimplement for RFC 3986.

	* module/Makefile.am: Add to build.

	* test-suite/Makefile.am:
	* test-suite/tests/web-uri.test: Add tests.

2010-10-17  Andy Wingo  <wingo@pobox.com>

	import uri.scm from tekuti, from guile-www

2010-10-15  Ludovic Courtès  <ludo@gnu.org>

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

	Update `cpp-E.syms' and `cpp-SIG.syms'.
	* libguile/cpp-E.syms, libguile/cpp-SIG.syms: Update on a Glibc 2.11.1
	  system.

	Fix the `chknew-E' and `chknew-SIG' rules.
	* libguile/Makefile.am (chknew-E chknew-SIG): Run gcc without `-undef'
	  since otherwise it ends up trying to include headers that are not
	  available (e.g., <gnu/stubs-32.h> on an x86_64-linux-gnu system.)

2010-10-15  Michael Gran  <spk121@yahoo.com>

	Unresolved var errors don't work for top-level vars
	* libguile/vm-i-system.c (toplevel_ref, long_toplevel_ref): modified

	Update charsets to Unicode 6.0.0
	* libguile/srfi-14.i.c: regenerated

2010-10-14  Andy Wingo  <wingo@pobox.com>

	re-implement srfi-34's guard with syntax-case
	* module/srfi/srfi-34.scm (guard): Re-implement using syntax-case.

	ssax: add procs to define parsed entities
	* module/sxml/ssax.scm (reset-parsed-entity-definitions!)
	  (define-parsed-entity!): New heavy-handed knobs for adding to the set
	  of parsed entity definitions.

2010-10-14  Neil Jerram  <neil@ossau.uklinux.net>

	Nuke GOOPS `Quick Start' section, in favour of the `Tutorial'
	These sections are pretty similar in aim, but `Tutorial' is mostly
	better material.

	* doc/ref/goops-tutorial.texi (Class definition): Add a sentence about
	  what slots are.

	* doc/ref/goops-tutorial.texi (Tutorial): Remove repetition of the Stk
	  origin, and index entries that are overly general in the context of
	  the whole Guile manual.

	  (Generic functions): Add text here about the nature of methods,
	  previously in Quick Start.

	* doc/ref/goops.texi (Quick Start): Move `Built-in classes' subsection
	  to be part of `Introspection'.  Delete the rest, apart from snippets
	  moved into Tutorial.

2010-10-13  Andy Wingo  <wingo@pobox.com>

	fix bug in with-fluids in a non-tail position
	* libguile/vm-i-system.c (VM_DEFINE_INSTRUCTION): Drop the stack items
	  corresponding the the with-fluids object. Thanks very much to Stefan
	  Israelsson Tampe for the fix.

2010-10-13  Ludovic Courtès  <ludo@gnu.org>

	Optimize `1+' and `1-' on fixnums.
	* libguile/vm-i-scheme.c (INUM_MAX, INUM_MIN): New macros.
	  (add1, sub1): Add/subtract without untagging the operand.  This leads
	  to a 44% run time improvement compared to the previous
	  implementation.

	* libguile/vm.c: Include <stdint.h>.

	* test-suite/tests/numbers.test ("1+", "1-"): Add tests for
	  MOST-POSITIVE-FIXNUM, resp. MOST-NEGATIVE-FIXNUM, for 32-bit and
	  34-bit values thereof.

	* benchmark-suite/benchmarks/arithmetic.bm: New file.

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

2010-10-13  Neil Jerram  <neil@ossau.uklinux.net>

	Edit `Adding Methods to Generic Functions'
	* doc/ref/goops.texi (Adding Methods to Generic Functions): Move the
	  bit about no applicable methods to `Invoking Generic Functions'.
	  Other minor edits.
	  (Basic Method Definition): Flattened into parent.
	  (Method Definition Internals): Moved to MOP section at end of
	  chapter.

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

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

2010-10-13  Ludovic Courtès  <ludo@gnu.org>

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

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

2010-10-13  Ludovic Courtès  <ludo@gnu.org>

	Allocate inexact numbers in pointer-less memory.
	* libguile/numbers.c (scm_from_double): Use `scm_gc_malloc_pointerless'
	  instead of `scm_double_cell'.

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

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

	update NEWS for 1.9.13
	* NEWS: Update for 1.9.13.

2010-10-12  Neil Jerram  <neil@ossau.uklinux.net>

	Add TeX form of jao's name
	* doc/ref/scheme-using.texi: Add TeX equivalent for José.

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

	fold old news items into main news body
	* NEWS: Fold 1.9.12 items into the main body.

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

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

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

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

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

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

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

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

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

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

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

2010-10-11  Andy Wingo  <wingo@pobox.com>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2010-10-10  Andy Wingo  <wingo@pobox.com>

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

2010-10-10  Andy Wingo  <wingo@pobox.com>

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

	* module/Makefile.am: Add repl server.

2010-10-10  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-10  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-08  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-08  Ludovic Courtès  <ludo@gnu.org>

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

2010-10-08  Ludovic Courtès  <ludo@gnu.org>

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

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

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

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

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

2010-10-08  Ludovic Courtès  <ludo@gnu.org>

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

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

2010-10-08  Ludovic Courtès  <ludo@gnu.org>

	SRFI-1: Rewrite `split-at' and `split-at!' in Scheme.
	This partially reverts commit bb560b9c16893f762699ba5a3109c8367fff8dfc
	(Tue Mar 15 2005).

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

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

2010-10-08  Ludovic Courtès  <ludo@gnu.org>

	SRFI-1: Rewrite `filter-map' in Scheme.
	This partially reverts commit c16359466bcc3f2ebf6d750c069f787f629fc625
	(Thu Mar 17 2005).

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

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

2010-10-08  Ludovic Courtès  <ludo@gnu.org>

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

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

2010-10-08  Ludovic Courtès  <ludo@gnu.org>

	SRFI-1: Make `unfold' tail-recursive (fix bug #30071).
	* module/srfi/srfi-1.scm (unfold): Make tail-recursive, following a
	  suggestion by Szavai Gyula.

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

2010-10-08  Ludovic Courtès  <ludo@gnu.org>

	Register `scm_init_r6rs_ports' as an extension.
	* libguile/r6rs-ports.c (scm_register_r6rs_ports): New function.
	* libguile/r6rs-ports.h (scm_register_r6rs_ports): New declaration.

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

2010-10-08  Ludovic Courtès  <ludo@gnu.org>

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

2010-10-08  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-08  Andy Wingo  <wingo@pobox.com>

	add program-sources-pre-retire to core and define frame-next-source
	* libguile/programs.h:
	* libguile/programs.c (scm_program_source): Add an optional arg, the
	  sources table to traverse. Defaults to the result of
	  scm_program_sources.

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

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

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

2010-10-08  Andy Wingo  <wingo@pobox.com>

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

	fix tracing of mv returns
	* module/system/vm/trace.scm (print-return): Fix multiple-value-return
	  printing.

2010-10-08  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-08  Andy Wingo  <wingo@pobox.com>

	inline symbol? and vector? to opcodes, and a psyntax inlining tweak
	* libguile/vm-i-scheme.c (symbol?, vector?): New
	  instructions. Renumbered the rest.
	* libguile/vm-i-system.c: Renumber instructions.
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

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

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

2010-10-08  Andy Wingo  <wingo@pobox.com>

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

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

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

2010-10-07  Andy Wingo  <wingo@pobox.com>

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

2010-10-07  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-07  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-07  Andy Wingo  <wingo@pobox.com>

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

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

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

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

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

2010-10-07  Andy Wingo  <wingo@pobox.com>

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

2010-10-07  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-06  Andy Wingo  <wingo@pobox.com>

	update (system repl debug) todo
	* module/system/repl/debug.scm: Update todo.

2010-10-06  Andy Wingo  <wingo@pobox.com>

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

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

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

2010-10-06  Andy Wingo  <wingo@pobox.com>

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

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

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

2010-10-06  Andy Wingo  <wingo@pobox.com>

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

2010-10-05  Andy Wingo  <wingo@pobox.com>

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

2010-10-05  Andy Wingo  <wingo@pobox.com>

	(system vm trap-state): add-trap-at-frame-finish!
	* module/system/vm/traps.scm: Fix a comment.

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

2010-10-05  Andy Wingo  <wingo@pobox.com>

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

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

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

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

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

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

2010-10-05  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-04  Andy Wingo  <wingo@pobox.com>

	Revert "repl.scm next-char needed to read EOF from port"
	Actually peek-char => EOF does not guarantee that read-char => EOF. I
	don't know what to do about this.

	This reverts commit 6e1dccc42f9ec81e04524ccc0956c692ee423576.

2010-10-04  Neil Jerram  <neil@ossau.uklinux.net>

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

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

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

2010-10-03  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-03  Andreas Rottmann  <a.rottmann@gmx.at>

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

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

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

2010-10-03  Michael Gran  <spk121@yahoo.com>

	Add v1.8.x backward compatiblity to GUILE_SITE_DIR
	* meta/guile.m4 (GUILE_SITE_DIR): use pkgdatadir if no sitedir

2010-10-03  Andy Wingo  <wingo@pobox.com>

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

2010-10-03  Andreas Rottmann  <a.rottmann@gmx.at>

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

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

2010-10-03  Andreas Rottmann  <a.rottmann@gmx.at>

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

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

2010-10-03  Andreas Rottmann  <a.rottmann@gmx.at>

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

2010-10-03  Andy Wingo  <wingo@pobox.com>

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

2010-10-02  Neil Jerram  <neil@ossau.uklinux.net>

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

2010-10-02  Neil Jerram  <neil@ossau.uklinux.net>

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

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

2010-10-02  Neil Jerram  <neil@ossau.uklinux.net>

	Remove goops-version, which is no longer defined
	* doc/ref/goops.texi (Administrative Functions): Removed.

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

2010-10-02  Neil Jerram  <neil@ossau.uklinux.net>

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

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

2010-10-02  Neil Jerram  <neil@ossau.uklinux.net>

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

2010-10-01  Andy Wingo  <wingo@pobox.com>

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

2010-10-01  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-01  Andy Wingo  <wingo@pobox.com>

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

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

2010-10-01  Andy Wingo  <wingo@pobox.com>

	c stack overflow checked for, once more
	* libguile/stackchk.h: Include private-options.h if we are building
	  guile.

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

2010-10-01  Andy Wingo  <wingo@pobox.com>

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

2010-10-01  Neil Jerram  <neil@ossau.uklinux.net>

	Fix typo in configure.ac
	Fixes an error when running ./configure:
	./configure: line 31873: text: command not found

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

2010-10-01  Andy Wingo  <wingo@pobox.com>

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

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

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

2010-10-01  Andy Wingo  <wingo@pobox.com>

	scm_debug_opts to debug.c, backtrace on by default, scm_*_opts internal linkage
	* libguile/eval.c:
	* libguile/debug.c (scm_debug_opts): Move here, from eval.c. Change
	  SCM_BACKTRACE_P to 1, initially.

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

2010-10-01  Andy Wingo  <wingo@pobox.com>

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

	api-debug.texi refactors
	* doc/ref/api-debug.texi (Programmatic Error Handling): Rename from
	  "Debug on Error". Reorganize subsections according to when the error
	  is handled.
	* doc/ref/api-options.texi: Adapt xref.

	update tour.texi
	* doc/ref/tour.texi (Using the Guile Module System): Remove "in flux"
	  language. Update examples to use #:export instead of (export ...).

2010-10-01  Andy Wingo  <wingo@pobox.com>

	finish cleaning out api-options.texi
	* doc/ref/api-debug.texi (Debug on Error): Move debug options here (for
	  now). Leave debug-options-interface undocumented.

	* doc/ref/api-options.texi (Runtime Options): Remove debug options. Link
	  to the sections where the options documentation is now. Update the
	  options example transcript.

2010-10-01  Andy Wingo  <wingo@pobox.com>

	debug and readline options doc tweak
	* doc/ref/api-options.texi (Debugger options):
	* doc/ref/repl-modules.texi (Readline Options): Use 'help instead of
	  'full (they are entirely equivalent right now). Update output to show
	  options in the right order.

2010-10-01  Andy Wingo  <wingo@pobox.com>

	move read and print options docs to the procedures they parameterize
	* doc/ref/api-evaluation.texi (Scheme Read): Fold all reader options
	  docs into this section. Undocument read-options-interface.
	  (Scheme Write): New section for `write' and `display', and the print
	  options. print-enable/print-disable are not documented, as there are
	  no boolean print options. print-options-interface is likewise
	  undocumented.

	* doc/ref/api-options.texi: Remove discussion of options in
	  general. Move read options to Scheme Read, and print options to Scheme
	  Write.

	* doc/ref/api-io.texi (Reading): Link to Scheme Read.
	  (Writing): Move write and display to Scheme Write, and link there.

	* doc/ref/srfi-modules.texi:
	* doc/ref/api-debug.texi:
	* doc/ref/api-data.texi: Update xrefs.

2010-10-01  Andy Wingo  <wingo@pobox.com>

	remove elisp-strings and elisp-vectors read options
	* libguile/private-options.h (SCM_ELISP_VECTORS_P, SCM_ESCAPED_PARENS_P):
	* libguile/read.c (scm_read_opts): Remove unused elisp-vectors option,
	  and the elisp-strings option (which allowed \( and \) escapes in
	  strings).
	  (scm_read_string): Remove the elisp-strings case.

	* doc/ref/api-options.texi (Reader options): Update, and update wording
	  of the case-insensitive bit.

2010-10-01  Andy Wingo  <wingo@pobox.com>

	(foo-options 'full) displays options doc in correct order
	* libguile/options.c (get_documented_option_setting): Reverse options
	  interface list before returning, so that they are in the original
	  order.

	remove unused print-options
	* libguile/private-options.h (SCM_PRINT_CLOSURE, SCM_PRINT_SOURCE_P):
	* libguile/print.c (scm_print_opts):
	* doc/ref/api-options.texi (Printing options): Remove source and
	  closure-hook print options.

2010-09-30  Andy Wingo  <wingo@pobox.com>

	add ,registers
	* libguile/frames.h:
	* libguile/frames.c (scm_frame_stack_pointer): New function.

	* module/system/repl/debug.scm (print-registers): New function, prints
	  out registers.

	* module/system/repl/command.scm (registers): New debugging
	  meta-command.
	  (inspect): Not a stack-command, a normal meta-command.

2010-09-28  Andy Wingo  <wingo@pobox.com>

	fix check-guile.in for default vm change
	* check-guile.in: Make the --debug fix in the source file, not the
	  generated file. Grr.

2010-09-28  Andy Wingo  <wingo@pobox.com>

	default to regular vm for noninteractive use
	* libguile/script.c (scm_compile_shell_switches): Select the debugging
	  VM in the cases that we previously would select deval -- when running
	  interactively without --no-debug, or otherwise with --debug.

	* libguile/vm.c: Default to the regular engine.
	  (scm_c_set_vm_engine_x): Remove requirement for the VM to have no
	  pending computations.

2010-09-27  Ludovic Courtès  <ludo@gnu.org>

	Fix pattern variable extraction in `match' with `..1'.
	* module/ice-9/match.upstream.scm (match-extract-vars): Support `..1'.

2010-09-27  Ludovic Courtès  <ludo@gnu.org>

	Add support for `..1' to `match'.
	Patch accepted upstream:
	<http://lists.gnu.org/archive/html/guile-devel/2010-09/threads.html#00114>.

	* module/ice-9/match.upstream.scm (match-two): Add support for `..1'.

	* test-suite/tests/match.test ("matches")["list ..1", "list ..1, with
	  predicate"]: New tests.
	  ("doesn't match")["list ..1", "list ..1, with predicate"]: New tests.

2010-09-27  Andreas Rottmann  <a.rottmann@gmx.at>

	Add implementation of SRFI 27
	* module/srfi/srfi-27.scm: New file; implementation of SRFI 27 in terms
	  of the existing random number generator.
	* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-27.scm.

	* test-suite/tests/srfi-27.test: New file; minimal test suite for SRFI 27.
	* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-27.test.

	* doc/ref/srfi-modules.texi: Add subsection on SRFI-27 based
	  on the specification.

2010-09-27  Andy Wingo  <wingo@pobox.com>

	add call-with-vm; remove thread-vm bits; remove vm-apply; engines settable.
	* libguile/vm.h (scm_c_vm_run): Make internal.
	* libguile/vm.c (vm_default_engine): New static global variable.
	  (make_vm): Set vp->engine based on
	  (scm_vm_apply): Remove in favor of call-with-vm.
	  (scm_thread_vm, scm_set_thread_vm_x): Remove these, as they did not
	  have a well-defined meaning, and were dangerous to call on other
	  threads.
	  (scm_the_vm): Reinstate previous definition.
	  (symbol_to_vm_engine, vm_engine_to_symbol)
	  (vm_has_pending_computation): New helpers.
	  (scm_vm_engine, scm_set_vm_engine_x, scm_c_set_vm_engine_x): New
	  accessors for VM engines.
	  (scm_c_set_default_vm_engine_x, scm_set_default_vm_engine_x): New
	  setters for the default VM engine.
	  (scm_call_with_vm): New function, applies a procedure to arguments in
	  a context in which a given VM is current.

	* libguile/eval.c (eval, scm_apply): VM dispatch goes through
	  scm_call_with_vm.

	* test-suite/tests/control.test ("the-vm"):
	* module/system/vm/coverage.scm (with-code-coverage): Use call-with-vm.

	* module/system/vm/vm.scm: Update exports.

	* test-suite/vm/run-vm-tests.scm (run-vm-program):
	* test-suite/tests/compiler.test ("current-reader"): Just rely on the
	  result of make-program being an applicable.

	* test-suite/tests/eval.test ("stack overflow"): Add a note that this
	  test does not test what it should.

2010-09-27  Ludovic Courtès  <ludo@gnu.org>

	Fix bignum memory leak.
	The `mpz_t' associated with a bignum would never be freed, so an
	expression like `(while #t (expt 2 5000))' would quickly lead to memory
	exhaustion.

	* libguile/numbers.c (finalize_bignum): New function.
	  (make_bignum): Register it as a finalizer for P.

2010-09-27  Ludovic Courtès  <ludo@gnu.org>

	Allocate bignums in pointer-less memory.
	* libguile/numbers.c (make_bignum): New function.
	  (scm_i_mkbig, scm_i_long2big, scm_i_ulong2big, scm_i_clonebig,
	  scm_i_dbl2big, scm_i_mpz2num): Use it.

	Remove `scm_t_aligned_cell'.
	* libguile/_scm.h (scm_aligned_cell, scm_t_aligned_cell): Remove.  The
	  whole approach was misguided as the compiler can't guarantee absolute
	  alignment on the stack.

	Fix argument passing in VM hooks.
	* libguile/vm.c (vm_dispatch_hook): Take care of FRAME's alignment
	  explicitly so that it's correct even if the current stack frame isn't
	  8-byte aligned (as can be the case on i686--the SysV i386 ABI just
	  says that the stack is word-aligned.)

2010-09-27  Ludovic Courtès  <ludo@gnu.org>

	Have `@abort' honor VM changes by winds.
	* libguile/control.c (scm_c_abort): Update VM after the `scm_dowinds'
	  call.

	* test-suite/tests/control.test ("the-vm"): New test prefix.

2010-09-26  Michael Gran  <spk121@yahoo.com>

	Favor non-hex string escapes over hex escapes when writing strings
	The characters U+0007 to U+000D have non-hex forms for their
	escapes when in written strings.

	* libguile/print.c (write_character): use non-hex escapes
	* test-suite/tests/reader.test (write R6RS string escapes): adjust test

2010-09-26  Neil Jerram  <neil@ossau.uklinux.net>

	Edit define-class doc
	* doc/ref/goops.texi (Defining New Classes): Remove "fixme" text
	  (saying we should have something that we in fact already have).  A
	  few minor edits throughout.

	  (Basic Class Definition): Move content up into `Defining New
	  Classes'.

	  (Class Options): Move after `Slot Options' (because slot options are
	  more important).  Remove doc of the #:environment option, since I
	  believe it's now fictitious.

	  (Slot Options): Reorder the options so that the most commonly used
	  ones come first.

2010-09-26  Neil Jerram  <neil@ossau.uklinux.net>

	Remove unwarranted para
	* doc/ref/goops.texi (Metaobjects and the Metaobject Protocol): Remove
	  para about GOOPS classes belonging to the usual Scheme namespace.
	  Interest doesn't justify the space that it takes.

	Edit text about the MOP
	* doc/ref/goops.texi (The Metaobject Protocol, Metaobjects and the
	  Metaobject Protocol): Minor edits.

	Start separating doc of the metaobject protocol from that of basic GOOPS usage
	* doc/ref/goops.texi (Introductory Remarks): Node deleted, with
	  material moved to...
	  (The Metaobject Protocol): ...here.
	  (MOP Specification): Moved to become a subnode of `The Metaobject
	  Protocol'.

2010-09-26  Neil Jerram  <neil@ossau.uklinux.net>

	Promote subsections inside the GOOPS "Reference Manual" section
	* doc/ref/goops.texi (Reference Manual): Node deleted, with content
	  promoted up to...

	* doc/ref/goops.texi (GOOPS): ...here.

2010-09-25  Michael Gran  <spk121@yahoo.com>

	Incorrect parsing of NaN complex numbers
	* libguile/numbers.c (mem2complex): modified
	* test-suite/tests/reader.test: new complex NaN reader test

2010-09-25  Andy Wingo  <wingo@pobox.com>

	remove vm-version, vm options
	* libguile/vm.h (struct scm_vm): Remove "options" member.
	* libguile/vm.c (scm_vm_version, scm_vm_option, scm_set_vm_option_x):
	  Remove.

	* module/system/vm/vm.scm (vm-version, vm-option, set-vm-option!):
	  Remove.
	  (vms:time, vms:clock): Remove these unused definitions.
	  (vm-load): Remove. "Load" should be reserved for things that exist on
	  disk, methinks.

2010-09-25  Andy Wingo  <wingo@pobox.com>

	fix up options.test
	* test-suite/tests/options.test (test-suite): Fix up for removal of
	  maxdepth debug option.

	statprof test traps fix; re-enable accurate call counting test
	* test-suite/tests/statprof.test: Remove needless debug-enable /
	  trap-enable calls.
	  ("accurate call counting"): Fix this test. Whee :)

	fix eval.test for procnames eval option
	* test-suite/tests/eval.test ("define set procedure-name"): Fix needless
	  use of removed 'procnames eval option.

2010-09-24  Andy Wingo  <wingo@pobox.com>

	remove a number of debug options
	* libguile/private-options.h (SCM_BREAKPOINTS_P, SCM_TRACE_P)
	  (SCM_REC_PROCNAMES_P, SCM_BACKTRACE_INDENT, SCM_N_FRAMES)
	  (SCM_BACKTRACE_MAXDEPTH, SCM_DEVAL_P): Remove these internal names.

	* libguile/eval.c (scm_debug_opts): Remove the corresponding debug
	  options -- breakpoints, trace, procnames, indent, frames, maxdepth,
	  and debug.

	* libguile/debug.c (scm_debug_options): Remove SCM_N_FRAMES check.

	* test-suite/lib.scm (with-debugging-evaluator*):
	* module/scripts/summarize-guile-TODO.scm:
	* module/statprof.scm (statprof-reset):
	* module/ice-9/boot-9.scm (turn-on-debugging): Remove useless
	  debug-enable 'debug calls.

	* module/ice-9/deprecated.scm (debug-enable): As it seems that 'debug is
	  a particulatly common option that we just removed, add a deprecation
	  shim.

	* doc/ref/api-options.texi (Debugger options): Update the set of debug
	  options.

2010-09-24  Andy Wingo  <wingo@pobox.com>

	remove evaluator-traps-interface
	* libguile/debug.h:
	* libguile/debug.c (scm_with_traps):
	* libguile/eval.c (scm_evaluator_traps, scm_evaluator_trap_table):
	  Remove these procedures. Note that scm_evaluator_traps was known in
	  Scheme as `evaluator-traps-interface'.

	* libguile/private-options.h (SCM_TRAPS_P, SCM_ENTER_FRAME_P)
	  (SCM_APPLY_FRAME_P, SCM_EXIT_FRAME_P, SCM_ENTER_FRAME_HDLR)
	  (SCM_APPLY_FRAME_HDLR, SCM_EXIT_FRAME_HDLR, SCM_MEMOIZE_P)
	  (SCM_MEMOIZE_HDLR): Remove these private interfaces.

	* module/ice-9/boot-9.scm (traps, trap-enable, trap-disable, trap-set!):
	  Remove.

	* module/ice-9/scm-style-repl.scm (error-catching-loop): Remove
	  with-traps wrap.

	* doc/ref/api-options.texi (Low level options interfaces):
	  (User level options interfaces, Evaluator trap options)
	* doc/ref/api-evaluation.texi (Evaluator Behavior): Remove references to
	  the evaluator traps interface.

2010-09-24  Andy Wingo  <wingo@pobox.com>

	remove GDS
	It is with a sigh that I do this. Farewell, old friend GDS; your bits
	will live on, reclaimed and reused in the new debugger.

	* module/Makefile.am:
	* module/ice-9/gds-client.scm:
	* module/ice-9/gds-server.scm: Remove these; we favor Geiser now.

	* emacs/Makefile.am:
	* emacs/gds-faq.txt:
	* emacs/gds-scheme.el:
	* emacs/gds-server.el:
	* emacs/gds-test.el:
	* emacs/gds-test.sh:
	* emacs/gds-test.stdin:
	* emacs/gds-tutorial.txt:
	* emacs/gds.el: Remove GDS files. The docs are still around, as they
	  need to be folded into the docmentation of the new debugger.

2010-09-24  Andy Wingo  <wingo@pobox.com>

	remove (ice-9 debugger) and (ice-9 debugging)
	* module/ice-9/debugger.scm:
	* module/ice-9/debugger/command-loop.scm:
	* module/ice-9/debugger/commands.scm:
	* module/ice-9/debugger/state.scm:
	* module/ice-9/debugger/trc.scm:
	* module/ice-9/debugger/utils.scm:
	* module/ice-9/debugging/breakpoints.scm:
	* module/ice-9/debugging/example-fns.scm:
	* module/ice-9/debugging/ice-9-debugger-extensions.scm:
	* module/ice-9/debugging/load-hooks.scm:
	* module/ice-9/debugging/steps.scm:
	* module/ice-9/debugging/trace.scm:
	* module/ice-9/debugging/traps.scm:
	* module/ice-9/debugging/trc.scm: Remove these files, as we will favor
	  the REPL's implementation of a debugger, and (system vm traps) and
	  (system vm trap-state). But these old files will continue to inspire
	  the rest of the new debugger interface.

2010-09-24  Andy Wingo  <wingo@pobox.com>

	remove eval-options
	* libguile/eval.c:
	* libguile/private-options.h (scm_eval_opts, scm_eval_options_interface)
	  (SCM_EVAL_STACK): Remove these private interfaces.

	* module/ice-9/boot-9.scm (eval-options, eval-enable, eval-disable)
	  (eval-set!): Remove these procedures.

	* doc/ref/api-evaluation.texi:
	* doc/ref/api-options.texi: Remove references to eval options.

2010-09-24  Andy Wingo  <wingo@pobox.com>

	api-debug.texi updates
	* doc/ref/api-debug.texi (Debugging, Evaluation Model)
	  (Source Properties): Fixes.

	fix ,traps REPL command
	* module/system/repl/command.scm (traps): Fix this REPL meta-command.

2010-09-24  Andy Wingo  <wingo@pobox.com>

	remove srcprop.[ch] things that have to do with breakpoints
	* libguile/eval.c: Mark "breakpoints", "trace", and "procnames" debug
	  options as obsolete. There is lots of work left to do here, though.

	* libguile/srcprop.h (scm_sym_breakpoint)
	  (scm_c_source_property_breakpoint_p, SRCBRKP): Remove these
	  definitions, without replacements.

	* libguile/srcprop.c: Remove all code that has to do with breakpoints.

2010-09-24  Ludovic Courtès  <ludo@gnu.org>

	Make `procedure-execution-count' fail gracefully when no source info is available.
	* module/system/vm/coverage.scm (procedure-execution-count): Handle the
	  case where (null? (program-sources PROC)).

2010-09-24  Ludovic Courtès  <ludo@gnu.org>

	Fix coverage analysis of procedures called from C.
	* module/system/vm/coverage.scm (with-code-coverage): Switch current
	  thread to VM, using `set-thread-vm!'.

	* test-suite/tests/coverage.test ("procedure-execution-count")["called
	  from C"]: New test.

2010-09-24  Ludovic Courtès  <ludo@gnu.org>

	Remove unused declarations.
	* libguile/vm.h (scm_vm_option_ref, scm_vm_option_set_x): Remove.

2010-09-24  Ludovic Courtès  <ludo@gnu.org>

	Add `thread-vm' and `set-thread-vm!'.
	* libguile/vm.c (thread_vm, scm_thread_vm, scm_set_thread_vm_x): New
	  functions.
	  (scm_the_vm): Add docstring.  Use `thread_vm'.

	* libguile/vm.h (scm_thread_vm, scm_set_thread_vm_x): New declarations.

	* module/system/vm/vm.scm: Export `thread-vm' and `set-thread-vm!'.

2010-09-24  Andy Wingo  <wingo@pobox.com>

	procedure traps can fire on nested procedures
	* module/system/vm/traps.scm (frame-matcher): New helper.
	  (trap-at-procedure-call, trap-in-procedure, trap-in-dynamic-extent)
	  (trap-calls-in-dynamic-extent, trap-instructions-in-dynamic-extent)
	  (trap-instructions-in-procedure, trap-at-procedure-ip-in-range): Add
	  ability to trap on procedures that are closures.

	  (trap-at-source-location): Check source-closures first, to catch
	  source locations that are in nested procedures.

2010-09-24  Andy Wingo  <wingo@pobox.com>

	system xref maintains source mapping for nested procedures too
	* module/system/xref.scm (*closure-sources-db*): New global, like
	  *sources-db* but for nested procedures. It's a separate map because
	  these procs need to be treated differently in trap handlers -- you
	  match on the bytecode, not on the program object.
	  (add-source, forget-source): Take the db as an argument (the normal db
	  or the closures db).
	  (add-sources, forget-sources): Record sources for nested procedures to
	  in *closures-db*.
	  (untaint-sources, ensure-sources-db): Adapt for new closures db.
	  (lookup-source-procedures): Factored out.
	  (source-closures): New exported procedure, returns closures at the
	  given source location.

2010-09-24  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in `weaks.test'.
	* test-suite/tests/weaks.test (valid?): Check for `value', not `val'.

2010-09-23  Ludovic Courtès  <ludo@gnu.org>

	Fix bug #31081 (`lookahead-u8' returns an s8.)
	Reported by Göran Weinholt <goran@weinholt.se>.

	* libguile/r6rs-ports.c (scm_lookahead_u8): Return an unsigned byte.

	* test-suite/tests/r6rs-ports.test ("7.2.8 Binary Input")["lookahead-u8:
	  result is unsigned"]: New test.

2010-09-23  Ludovic Courtès  <ludo@gnu.org>

	Fixlet in `coverage.test'.
	* test-suite/tests/coverage.test ("line-execution-counts")["several
	  times"]: Add missing `else' clause.

	Strengthen the weak hash table tests.
	* test-suite/tests/weaks.test: Enclose in a module.
	  (valid?): New procedure.
	  ("weak-hash")["weak-key dies, "weak-value dies", "double-weak dies"]:
	  Check that all the values are `valid?', in addition to checking that
	  at least one of them is #f.

2010-09-23  Ludovic Courtès  <ludo@gnu.org>

	Fix weak-value hash tables.
	* libguile/hashtab.c (scm_hash_fn_set_x): Register a disappearing link
	  to VAL when TABLE is weak-value.

	* test-suite/tests/weaks.test ("weak-hash")["weak-key dies", "weak-value
	  dies", "doubly-weak dies"]: Use `hash-set!' and `hash-ref', not
	  `hashq-set!' and `hashq-ref', otherwise these tests would always
	  succeed because (eq? "this" "this") => #f.
	  ["lives"]: Use `hash-ref' and `hash-set!' too for consistency.

2010-09-23  Ludovic Courtès  <ludo@gnu.org>

	Define `equal?' for pointer objects.
	* libguile/eq.c (scm_equal_p): Handle pointer objects.

	* test-suite/tests/foreign.test ("make-pointer")["equal?", "equal?
	  modulo finalizer", "not equal?"]: New tests.

2010-09-23  Andy Wingo  <wingo@pobox.com>

	add ,break-at-source
	* module/system/vm/trap-state.scm (add-trap-at-source-location!): New
	  proc.
	* module/system/repl/command.scm (break-at-source): New repl
	  meta-command. Doesn't work as well as it could now because it doesn't
	  know about nested functions, but that's coming.

	another trap printing tweak
	* module/system/vm/trap-state.scm (add-trap-at-procedure-call!):
	  (add-trace-at-procedure-call!): Breakpoint / tracepoint name tweaks.

2010-09-23  Andy Wingo  <wingo@pobox.com>

	list-traps just returns trap identifiers, not names
	* module/system/vm/trap-state.scm (list-traps): Just return the integers
	  identifying the traps; people can use trap-name to get the names.

	* module/system/repl/command.scm (traps): Adapt.

2010-09-23  Andy Wingo  <wingo@pobox.com>

	trace printing tweak
	* module/system/vm/trap-state.scm (add-trace-at-procedure-call!): Tweak
	  to the #:prefix string.

	more uniform break / tracepoint printing in repl
	* module/system/repl/command.scm (break, tracepoint): In the message,
	  use the trap-name.

	add trap-name procedure
	* module/system/vm/trap-state.scm (trap-name): New proc.

2010-09-23  Andy Wingo  <wingo@pobox.com>

	tracepoints print their trap number
	* module/system/vm/trace.scm (print-application, print-return): Add a
	  prefix before the printout.
	  (trace-calls-to-procedure, trace-calls-in-procedure): Add prefix
	  keyword args.

	* module/system/vm/trap-state.scm (add-trace-at-procedure-call!): Give a
	  useful prefix for tracepoint printouts.

2010-09-23  Andy Wingo  <wingo@pobox.com>

	add repl ,tracepoint command
	* module/system/vm/trace.scm (print-return, print-application)
	  (frame-return-values): Factored out of other things.
	  (trace-calls-to-procedure): New proc, installs a trap tracing only
	  calls to the given proc.
	  (trace-calls-in-procedure): Refactor a bit.

	* module/system/vm/trap-state.scm (add-trace-at-procedure-call!): New
	  proc.

	* module/system/repl/command.scm (tracepoint): New command, installs a
	  tracepoint on a procedure.

2010-09-23  Andy Wingo  <wingo@pobox.com>

	avoid traps in repl except when evaluating the expression
	* module/system/vm/trap-state.scm (with-default-trap-handler): Don't
	  enable traps if we are setting a handler of #f.

	* module/system/repl/error-handling.scm (call-with-error-handling): Add
	  #:trap-handler arg.

	* module/system/repl/repl.scm (run-repl): Only have traps enabled while
	  running the thunk. Otherwise we trace on procedures called as part of
	  the repl.

2010-09-23  Andy Wingo  <wingo@pobox.com>

	add trap-calls-to-procedure
	* module/system/vm/traps.scm (trap-frame-finish): Use frame-address
	  instead of frame-dynamic-link.
	  (trap-calls-to-procedure): New proc, traps on procedure calls and
	  their corresponding returns.

	add scm_frame_address / frame-address
	* libguile/frames.h:
	* libguile/frames.c (scm_frame_address): New accessor, returns a frame's
	  fp.

2010-09-23  Andy Wingo  <wingo@pobox.com>

	tracing in terms of traps
	* module/system/vm/traps.scm (trap-frame-finish)
	  (trap-in-dynamic-extent, trap-calls-in-dynamic-extent)
	  (trap-instructions-in-dynamic-extent): New traps, for implementing
	  tracing, and the `finish' command.

	* module/system/vm/trace.scm (trace-calls-in-procedure)
	  (trace-instructions-in-procedure): New tracing traps.
	  (vm-trace): Reimplement in terms of the new traps.

	* module/system/vm/trap-state.scm (add-trap!): New helper; not used in
	  this commit, though.

2010-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	Explain examples of user-defined classes
	* doc/ref/goops.texi (User-defined classes): New text added to explain
	  the example code.

	Explain built-in classes like <string>
	* doc/ref/goops.texi (Built-in classes): New node.
	  (User-defined classes): Show is-a? v and class-of v here, instead of
	  in next node.
	  (Asking for the class of an object): Deleted, no longer needed.

2010-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	Improve GOOPS `Quick Start' doc
	* doc/ref/goops.texi (Quick Start): Remove words that only reiterate
	  "quick start".

	* doc/ref/goops.texi (Methods, User-defined classes, Asking for the
	  class of an object): Say "class" instead of "type".  They
	  are called classes elsewhere, and in an object-oriented system, people
	  expect classes!

2010-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	Move GOOPS chapter's Stk copyright notice upfront
	So as to enable more free refactoring of the rest of the chapter

	* doc/ref/goops.texi (Copyright Notice): New section containing the
	  Stk copyright.

	* doc/ref/goops-tutorial.texi (Copyright): Equivalent section here
	  deleted.

2010-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	GOOPS doc simplification
	* doc/ref/goops.texi (GOOPS): Simplify the introductory blurb.

2010-09-21  Andy Wingo  <wingo@pobox.com>

	(system repl command) cleanups
	* module/system/repl/command.scm (profile, trace, inspect)
	  (pretty-print): Use repl-prepare-eval-thunk instead of the lower-level
	  compile and make-program.

2010-09-21  Andy Wingo  <wingo@pobox.com>

	breakpoints from recursive prompts work
	* module/system/vm/traps.scm (new-disabled-trap): Don't manipulate the
	  VM trace level in the enable and disable handlers. Unfortunately, this
	  makes traps not work unless you enable hooks, but given that
	  vm_dispatch_hook has to set trace-level to 0, there needs to be an
	  object with a broader view of what traps are enabled. That object is
	  the hook state.

	* module/system/vm/trap-state.scm (trap-state->trace-level): New
	  procedure.
	  (with-default-trap-handler): Add an optional trap-state argument. Now
	  makes sure that the vm-trace-level is set appropriately during the
	  execution of the thunk, allowing for breakpoints from recursive
	  prompts.

2010-09-20  Ludovic Courtès  <ludo@gnu.org>

	SRFI-1: Rewrite `alist-copy' in Scheme.
	This partially reverts commit b1fff4e793619b20342cba0015b9367680d3a0bd
	(Sat Apr 2 2005).

	* libguile/srfi-1.c (scm_srfi1_alist_copy): Remove.
	* libguile/srfi-1.h (scm_srfi1_alist_copy): Remove declaration.

	* module/srfi/srfi-1.scm (alist-copy): New procedure.

2010-09-20  Ludovic Courtès  <ludo@gnu.org>

	Remove the SRFI-1 C proxies.
	* libguile/srfi-1.c (srfi1_module, CACHE_VAR): Remove.
	  (scm_srfi1_break, scm_srfi1_break_x, scm_srfi1_car_plus_cdr,
	  scm_srfi1_drop_right_x, scm_srfi1_drop_while, scm_srfi1_eighth,
	  scm_srfi1_fifth, scm_srfi1_fold, scm_srfi1_last, scm_srfi1_list_index,
	  scm_srfi1_list_tabulate, scm_srfi1_lset_adjoin, scm_srfi1_ninth,
	  scm_srfi1_not_pair_p, scm_srfi1_reduce, scm_srfi1_reduce_right,
	  scm_srfi1_seventh, scm_srfi1_sixth, scm_srfi1_span, scm_srfi1_span_x,
	  scm_srfi1_take_x, scm_srfi1_take_while, scm_srfi1_take_while_x,
	  scm_srfi1_tenth, scm_srfi1_xcons): Remove.

	* libguile/srfi-1.h: Remove the corresponding declarations.

2010-09-19  Andy Wingo  <wingo@pobox.com>

	default-trap-handler bugfix
	* module/system/vm/trap-state.scm (default-trap-handler): Fix thinko.

2010-09-19  Göran Weinholt  <goran@weinholt.se>

	Fix make-variable-transformer export
	* module/rnrs/syntax-case.scm: Add make-variable-transformer to the
	  imports. This was causing an unbound variable error even though
	  (rnrs) had been imported.

2010-09-19  Andy Wingo  <wingo@pobox.com>

	add ,traps ,delete ,disable ,enable
	* module/system/repl/command.scm (traps, delete, disable, enable): New
	  meta-commands.

2010-09-19  Andy Wingo  <wingo@pobox.com>

	implement breakpoints in the repl
	* module/system/vm/trap-state.scm: New file, tracks a VM-specific set of
	  traps.
	* module/Makefile.am: Add trap-state.scm.

	* module/system/repl/error-handling.scm: While in a with-error-handling
	  block, bind a default trap handler that invokes a recursive prompt.

	* module/system/repl/command.scm: Add a `break' repl meta-command.

2010-09-17  Andy Wingo  <wingo@pobox.com>

	add (system vm traps)
	* module/system/vm/traps.scm: New module, implements higher-level traps
	  based on the VM hooks. Inspired by (ice-9 debugging traps). Instead of
	  the ice-9's variety, these traps have a procedural interface instead
	  of a GOOPS interface.

	* module/Makefile.am: Add the new module.

2010-09-17  Andy Wingo  <wingo@pobox.com>

	vm hooks run without hooks
	* libguile/vm.c (vm_dispatch_hook): Run hooks with the trace-level set
	  to 0. We really don't want hooks running while hooks are running.

2010-09-16  Andy Wingo  <wingo@pobox.com>

	fix bad Makefile.am addition

	instruction tracing tweak
	* module/system/vm/trace.scm (vm-trace): No need to output the opcode
	  number, and display the ip as a decimal, not a hexidecimal.

	only trace instructions inside the thunk
	* module/system/vm/trace.scm (vm-trace): Only trace instructions when
	  we're in the dynamic extent of the thunk.

	update vm hooks doc
	* doc/ref/api-evaluation.texi (VM Behaviour): Half-hearted doc update.

2010-09-16  Andy Wingo  <wingo@pobox.com>

	add vm-abort-continuation-hook, vm-restore-continuation-hook
	* libguile/vm-i-system.c (call_cc, tail_call_cc): Call the new
	  RESTORE_CONTINUATION_HOOK when a continuation is restored.
	  (prompt): Call the new ABORT_CONTINUATION_HOOK when entering the abort
	  handler's continuation.

	* libguile/vm-engine.h (ABORT_CONTINUATION_HOOK)
	  (RESTORE_CONTINUATION_HOOK):
	* libguile/vm.h (SCM_VM_ABORT_CONTINUATION_HOOK)
	  (SCM_VM_RESTORE_CONTINUATION_HOOK):
	* libguile/vm.c: (scm_vm_abort_continuation_hook): New hook, called when
	  entering an abort handler.
	  (scm_vm_restore_continuation_hook): New hook, called after returning
	  to a continuation.

	* module/system/vm/vm.scm: Add hooks to export list.

2010-09-16  Andy Wingo  <wingo@pobox.com>

	trim our set of vm hooks
	* libguile/vm.h (SCM_VM_PUSH_CONTINUATION_HOOK)
	  (SCM_VM_POP_CONTINUATION_HOOK): New hooks, to replace
	  enter/exit/return.
	  (SCM_VM_BOOT_HOOK, SCM_VM_HALT_HOOK, SCM_VM_BREAK_HOOK): Remove these
	  useless hooks.

	* libguile/vm.c (scm_vm_push_continuation_hook)
	  (scm_vm_pop_continuation_hook): New accessors.

	* libguile/vm-i-system.c: Remove boot, halt, break, enter, exit, and
	  return hooks. Also remove the break instruction. Instead now when we
	  push a new continuation onto the stack we call PUSH_CONTINUATION_HOOK,
	  and when we pop via a return we call POP_CONTINUATION_HOOK. APPLY_HOOK
	  is now decoupled from continuation pushes and pops.

	* libguile/vm-engine.h:
	* libguile/vm-engine.c: Adapt for hooks.

	* module/system/vm/trace.scm (vm-trace): Adapt for hooks. Also revive
	  the #:instructions? #t mode.

	* module/system/vm/vm.scm: Adapt exports for new set of hooks.

2010-09-16  Andy Wingo  <wingo@pobox.com>

	remove unused (system vm profile)
	* module/Makefile.am:
	* module/system/vm/profile.scm: Remove (system vm profile). We use
	  statprof.

2010-09-15  Ludovic Courtès  <ludo@gnu.org>

	Fix write-beyond-end-of-string error in the conversion to R6RS string escapes.
	Reported by Mike Gran <spk121@yahoo.com>.

	* libguile/strings.c (scm_i_unistring_escapes_to_guile_escapes,
	  scm_i_unistring_escapes_to_r6rs_escapes): Augment comments.
	  (scm_to_stringn): When `handler ==
	  SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE && SCM_R6RS_ESCAPES_P', realloc
	  BUF so that it's large enough for the worst case.

	* libguile/print.c (display_character): When `result != NULL && strategy
	  == SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE && SCM_R6RS_ESCAPES_P', make
	  LOCALE_ENCODED large enough to hold an R6RS escape.

2010-09-15  Ludovic Courtès  <ludo@gnu.org>

	Optimize `peek-char'.
	This makes `peek-char' 40x faster on a port whose encoding is
	faster on a UTF-8 port containing multi-byte codepoints.

	The `xml->sxml' procedure is 4x faster on a 2.7 MiB XML file.

	* libguile/ports.c (get_codepoint): New procedure, moved here from
	  `scm_getc', with the additional BUF and LEN parameters.
	  (scm_getc): Use it.
	  (scm_peek_char): Use it instead of the `scm_getc'/`scm_ungetc'
	  sequence.

	* test-suite/tests/ports.test ("string ports")["peek-char [latin-1]",
	  "peek-char [utf-8]"]: New tests.

	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
	  `benchmarks/ports.bm'.

	* benchmark-suite/benchmarks/ports.bm: New file.

2010-09-15  Ludovic Courtès  <ludo@gnu.org>

	Fix copyright year and module name of `write.bm'.
	* benchmark-suite/benchmarks/write.bm: Fix copyright year and module
	  name.

2010-09-15  Ludovic Courtès  <ludo@gnu.org>

	Re-introduce pretty-printing of combining characters.
	This had been removed by commit 07f49ac786e0f1c007eb336e2fb7a572e8405316
	("Factorize and optimize `write' for strings and characters.").
	Thanks Mike!

	* libguile/print.c (write_combining_character): New procedure.
	  (write_character): Use it.

	* test-suite/tests/chars.test ("basic char handling")["combining accent
	  is pretty-printed", "combining X is pretty-printed"]: New tests.

	* test-suite/tests/encoding-iso88591.test ("characters")["write A
	  followed by combining accent"]: New test.

	* test-suite/tests/encoding-utf8.test ("characters")["write A followed
	  by combining accent"]: New test.

2010-09-14  Ludovic Courtès  <ludo@gnu.org>

	Remove commented out code from `print.c'.
	* libguile/print.c (scm_write, scm_display, scm_write_char): Remove
	  `#if 0'-d code.

2010-09-14  Ludovic Courtès  <ludo@gnu.org>

	Factorize and optimize `write' for strings and characters.
	According to `write.bm', this makes `write' 2.6 times faster for strings.

	* libguile/print.c (iprin1): Use `write_character' when
	  `SCM_WRITINGP (pstate)' and `SCM_CHARP (exp)' or `scm_is_string (exp)'.
	  (scm_i_charprint): Remove.
	  (display_character, write_character): New functions.
	  (scm_write_char): Use `display_character' instead of
	  `scm_i_charprint'.

	* libguile/print.h (scm_i_charprint): Remove declaration.

	* benchmark-suite/benchmarks/write.bm: New file.

	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
	  `benchmarks/write.bm'.

2010-09-14  Ludovic Courtès  <ludo@gnu.org>

	Internally expose `scm_i_unistring_escapes_to_{guile,r6rs}_escapes'.
	* libguile/strings.c (unistring_escapes_to_guile_escapes): Rename to...
	  (scm_i_unistring_escapes_to_guile_escapes): ... this.  Change `char **bufp'
	  to `char *buf'; leave realloc responsibility to the caller.  Update caller.
	  (unistring_escapes_to_r6rs_escapes): Rename to...
	  (scm_i_unistring_escapes_to_r6rs_escapes): ... this.  Likewise.

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

	doc/ref lib-version.texi removal
	* doc/ref/.gitignore:
	* doc/ref/Makefile.am:
	* doc/ref/guile.texi: Remove rules for generating an unused
	  lib-version.texi.

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

	build tweak to remove SRFI version definitions
	* GUILE-VERSION: Remove SRFI version definitions, as they are no longer
	  needed.

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

	move srfi-1 and srfi-60 C impl to libguile, without public C api
	* libguile/srfi-1.c:
	* libguile/srfi-1.h:
	* libguile/srfi-60.c:
	* libguile/srfi-60.h:
	* libguile/ChangeLog-srfi: Move here, from the srfi/ dir. The C API is
	  internal. Add API to register the extensions, called by init.c.

	* libguile/init.c: Verily, register srfi extensions.

	* libguile/Makefile.am: Add srfi files.

	* module/srfi/srfi-1.scm:
	* module/srfi/srfi-60.scm: Update load-extension invocation.

	* Makefile.am:
	* configure.ac: Remove srfi/ dir.

	* test-suite/standalone/Makefile.am:
	* test-suite/standalone/test-srfi-1.c: Remove srfi-1 C test, we don't
	  support this API any more.

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

	remove empty srfi-4, srfi-13, and srfi-14 shlibs
	* srfi/srfi-13.c:
	* srfi/srfi-13.h:
	* srfi/srfi-14.c:
	* srfi/srfi-14.h:
	* srfi/srfi-4.c:
	* srfi/srfi-4.h:
	* srfi/Makefile.am:
	* configure.ac: Remove empty shlibs and headers for srfis 4, 13, and
	  14. The "version" was never programmatically exported, so there's no
	  possible way people could have used these.

2010-09-12  Neil Jerram  <neil@ossau.uklinux.net>

	Create tags for Scheme source
	* am/guilec: Set ETAGS_ARGS.

	* module/Makefile.am: When adding sources to EXTRA_DIST, add them to
	  ETAGS_ARGS too.

2010-09-12  Michael Gran  <spk121@yahoo.com>

	Provide non-locale C/Scheme string conversion functions
	* doc/ref/api-data.texi: document scm_to_stringn, scm_from_stringn,
	  scm_to_latin1_stringn, and scm_from_latin1_stringn
	* libguile/strings.h (scm_to_stringn): make public
	  (scm_to_latin1_stringn): new declaration
	  (scm_from_latin1_stringn): new declaration
	* libguile/strings.c (scm_to_latin1_stringn): new function
	  (scm_from_latin1_stringn): new function

2010-09-11  Neil Jerram  <neil@ossau.uklinux.net>

	Document scm_wrong_type_arg_msg
	* doc/ref/api-control.texi: New def for scm_wrong_type_arg_msg.

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

	Remove unnecessary blank "Indices" page.
	* doc/ref/guile.texi: Remove `Indices' heading.

2010-09-10  Andy Wingo  <wingo@pobox.com>

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

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

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

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

2010-09-08  Ludovic Courtès  <ludo@gnu.org>

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

2010-09-08  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `isnan' and `isinf' modules.
	This updates Gnulib to v0.0-4219-g84cdd8b.

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

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

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

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

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

2010-09-06  Ludovic Courtès  <ludo@gnu.org>

	Use `have-lib' when checking for libltdl.
	Suggested by primus <rprimus@gmail.com>.

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

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

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

2010-09-06  Ludovic Courtès  <ludo@gnu.org>

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

2010-09-06  Andy Wingo  <wingo@pobox.com>

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

2010-09-04  Ludovic Courtès  <ludo@gnu.org>

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

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

2010-09-04  Andy Wingo  <wingo@pobox.com>

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

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

2010-09-04  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS' for 1.9.12.
	* NEWS: Update.

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

2010-09-04  Ludovic Courtès  <ludo@gnu.org>

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

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

2010-09-04  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `stat-time' module; update Gnulib.
	This updates Gnulib files to v0.0-4207-gc82b481.

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

2010-09-04  Ludovic Courtès  <ludo@gnu.org>

	Add an entertaining `procedure->pointer' test.
	* test-suite/tests/foreign.test ("procedure->pointer")["bijection"]: New
	  test.

2010-09-03  Ludovic Courtès  <ludo@gnu.org>

	Fix the `put-bytevector' tests.
	* libguile/vports.c (sf_write): Add comment about what happens when DATA
	  contains binary data.

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

2010-09-03  Ludovic Courtès  <ludo@gnu.org>

	Add license header to `test-ffi'.
	* test-suite/standalone/test-ffi: Add license header.

2010-09-03  Ludovic Courtès  <ludo@gnu.org>

	Add `procedure->pointer' to the FFI.
	* libguile/foreign.c (make_cif): New procedure, with code formerly in
	  `scm_make_foreign_function'.
	  (scm_make_foreign_function): Use it.
	  (invoke_closure, scm_procedure_to_pointer)[FFI_CLOSURES]: New
	  functions.

	* libguile/foreign.h (scm_procedure_to_pointer): New declaration.

	* module/system/foreign.scm: Export `procedure->pointer' when available.

	* test-suite/standalone/test-ffi (f-callback-1, f-callback-2): New
	  procedures and related tests.

	* test-suite/standalone/test-ffi-lib.c (test_ffi_callback_1,
	  test_ffi_callback_2): New functions.

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

	* doc/ref/api-foreign.texi (Dynamic FFI): Document `procedure->pointer'.

2010-09-03  Jose A. Ortega Ruiz  <jao@gnu.org>

	Fix for `submodules' in (ice-9 session) (closes #30062)
	* module/ice-9/session.scm (submodules): replace implementation to
	  use `module-submodules' instead of `module-obarray' (the latter
	  doesn't include submodules anymore).

	* test-suite/tests/session.test: new test suite for session, checking
	  the exported procedures that use `submodules'.

2010-09-03  Andy Wingo  <wingo@pobox.com>

	module-ref-submodule deprecation fixes
	* module/ice-9/boot-9.scm (module-ref-submodule)
	  (module-define-submodule!): Pull deprecated shims here, as we need
	  them before loading (ice-9 deprecated). Also bugfix to only define the
	  module if there is no local variable, even if it is unbound.

	* module/ice-9/deprecated.scm: Remove from here.

2010-09-03  Andy Wingo  <wingo@pobox.com>

	back-compat in (rnrs) for deprecated modules-in-value-namespace
	* module/rnrs.scm (rnrs): Work around some unavoidable (I think)
	  behavior when back-compatible unified namespaces are enabled; see
	  comments in source.

	module-local-variable optimization
	* libguile/modules.c (scm_module_local_variable): An optimization in the
	  common no-module-binder case.

2010-09-02  Ludovic Courtès  <ludo@gnu.org>

	Fix memory leak in `lock-mutex' (aka. `scm_lock_mutex'.)
	The memory leak is trivially reproducible with:

	  (define m (make-mutex))
	  (let loop () (lock-mutex m) (unlock-mutex m) (loop))

	or similarly with:

	  (define p (delay (+ 1 2)))
	  (let loop () (force p) (loop))

	since `force' acquires P's mutex.

	It could also lead to premature release of a thread waiting in
	`fat_mutex_lock' when a former owner's `do_thread_exit' is run.

	* libguile/threads.c (fat_mutex_unlock): When `m->level' becomes 0,
	  remove MUTEX from `t->mutexes'.
	  (fat_mutex_lock): Update comment above the `t->mutexes' assignment.
	  (do_thread_exit): Add an assertion making sure that each mutex in
	  `t->mutexes' is owned by T.

2010-09-02  Ludovic Courtès  <ludo@gnu.org>

	Avoid calls to `scm_current_thread' in `fat_mutex_unlock'.
	* libguile/threads.c (fat_mutex_unlock): Use `t->handle' instead of
	  calling `scm_current_thread'.

2010-09-02  Ludovic Courtès  <ludo@gnu.org>

	Fix typos.
	* module/system/repl/repl.scm (run-repl): Fix variable name: `k', not
	  `key'.

	* module/texinfo/docbook.scm: Use `(srfi srfi-1)' for `fold'.

2010-09-02  Ludovic Courtès  <ludo@gnu.org>

	SRFI-1: Rewrite `drop-right!', `drop-while', `reduce', etc. in Scheme.
	This partially reverts commit e9508fbb7df0b1ead007637f16d80cf831776307
	(May 3 2005).

	* module/srfi/srfi-1.scm (take!, drop-right!, reduce, reduce-right,
	  take-while, take-while!, drop-while, span, span!, lset-adjoin): New
	  procedures.

	* srfi/srfi-1.c (scm_srfi1_drop_right_x, scm_srfi1_drop_while,
	  scm_srfi1_lset_adjoin, scm_srfi1_reduce, scm_srfi1_reduce_right,
	  scm_srfi1_span, scm_srfi1_span_x, scm_srfi1_take_x,
	  scm_srfi1_take_while, scm_srfi1_take_while_x): Rewrite as
	  proxies to the corresponding Scheme procedures.

	* benchmark-suite/benchmarks/srfi-1.bm ("drop-while"): New benchmark
	  prefix.

2010-09-01  Ludovic Courtès  <ludo@gnu.org>

	Rewrite `fport_flush' using Gnulib's `full_write'.
	* libguile/fports.c (fport_flush): Rewrite using `full_write'.

	popen.test: Don't auto-compile `popen-child.scm'.
	* test-suite/tests/popen.test ("open-output-pipe")["no duplicate"]:
	  Disable auto-compilation of `popen-child.scm'.

	Add `test-suite/tests/popen-child.scm' to the distribution.
	* test-suite/Makefile.am (SCM_TESTS): Add `tests/popen-child.scm'.

2010-08-31  Jose A. Ortega Ruiz  <jao@gnu.org>

	Add new debug meta-command ,error-message
	* module/system/repl/error-handling.scm: use the error string to
	  construct the <debug> instance.

	* module/system/repl/command.scm: new debug command `error-message'
	  that extracts the new <debug> field, available to stack commands as
	  `message'.

	* doc/ref/scheme-using.texi: documentation for new command.

	* module/system/repl/debug.scm: <debug> stores the error string in a
	  new field.

2010-08-30  Andy Wingo  <wingo@pobox.com>

	fix #y back-compat shim
	* module/ice-9/deprecated.scm (#\y): #y was in fact a syntax for
	  s8vectors, not bitvectors. Fix.

2010-08-30  Andy Wingo  <wingo@pobox.com>

	bitvector work
	* test-suite/Makefile.am:
	* test-suite/tests/bitvectors.test: Add a new file to test bitvectors.

	* libguile/uniform.c (scm_c_uniform_vector_length): Don't call
	  scm_uniform_vector_elements, as we don't need to be able to access the
	  elements with pointers to bytes. Fixes uniform-vector-length on
	  bitvectors.

2010-08-30  Andy Wingo  <wingo@pobox.com>

	docstrings in syntax-rules
	* module/ice-9/psyntax.scm (syntax-rules): Allow a docstring between the
	  literals and the first clause.

2010-08-29  Andy Wingo  <wingo@pobox.com>

	define* usage in boot-9
	* module/ice-9/boot-9.scm (make-module, make-mutable-parameter): Use
	  define*.

2010-08-29  Andy Wingo  <wingo@pobox.com>

	add flag to vtables to indicate that their layout is valid
	* libguile/struct.h (SCM_VTABLE_FLAG_VALIDATED): New flag, indicates
	  that the layout of a vtable has been validated. The other flags have
	  been renumbered.

	* libguile/struct.c (scm_i_struct_inherit_vtable_magic): Set the
	  VALIDATED flag if everything goes through.
	  (scm_struct_vtable_p): If the struct should be a vtable but isn't
	  validated, throw an error.
	  (scm_make_vtable_vtable): Validate the incoming user_fields layout
	  bit. Set the VALIDATED flag.
	  (scm_c_make_structv): Add a comment about the case in which we delay
	  scm_i_struct_inherit_vtable_magic.

2010-08-29  PCPA  <paulo.cesar.pereira.de.andrade@gmail.com>

	Also reset alloca_slack after jit_prolog in i386.
	  There is no guarantee of order of jit_function calls, so, it must
	reset it for every function. This should correct possible issues in
	OS/X, and will be required when i386 code is updated to use MMX/SSE*
	registers, possibly as some kind of extended interface, and then,
	would require 16 bytes aligned stack. This is already an issue if
	calling C code that uses SSE, and currently requires "manually"
	padding the stack by using jit_allocai.

	Revert change aliasing jit_movi_p to jit_movi_ul.
	  It cannot "optimize" to use 32 bits opcode or zero the register
	because that would break jit_patch_movi.

	Correct ALU add and sub operations with 64 bit immediate operands.
	  The problems would also happen with 32 bit unsigned operands that would
	happen to have the topmost bit set, so, now it only uses 32 bit immediates
	when bit 31 is not set.
	  This patch correct all the issues found by the test cases alu_add.tst and
	alu_sub.tst in http://code.google.com/p/exl/source/browse/trunk/check/lightning

	Define some extra fp-common macros when sizeof(long) == sizeof(int).

	Change _ASM_SAFETY register width check to accept valid alternate values.
	  The checks were moved from i386/asm.h to i386/asm-{32,64}.h, as well
	as some macros from core-{32,64}.h. Now it checks if the value is in the
	range of a valid register, and in the proper register class, what should
	prevent the common mistake of calling a jit*r_x macro passing an immediate
	as argument.
	  Now it pass lightning's make check in i386/x86_64, as well as all test
	cases in http://code.google.com/p/exl/source/browse/trunk/check/lightning
	when compiled with -D_ASM_SAFETY.

2010-08-29  Paulo Cesar Pereira de Andrade  <pcpa@mandriva.com.br>

	Correct branches and several ALU operations with 64 immediates
	  jit_bra_l had the logic reversed, and correcting that also corrected
	jit_b{lt,le,eq,ge,gt,ne}i_l.
	  TESTQir and _ALUQir were not properly working with 64 bit immediates,
	that require using a temporary register (JIT_REXTMP) as there are no
	related opcodes for 64 bit immediates. This corrected jit_bm{s,c}i_l and
	jit_bo{add,sub}i_l.
	  Now, the tests in
	http://code.google.com/p/exl/source/browse/trunk/check/lightning/branch.tst
	pass.

2010-08-28  Andy Wingo  <wingo@pobox.com>

	deprecate passing a number as the destination to `format'
	* module/ice-9/format.scm (format): Deprecate having a number as the
	  destination.
	* doc/ref/misc-modules.texi (Formatted Output): Update docs.

	threadsafety in deprecation, extensions
	* libguile/deprecation.c (scm_c_issue_deprecation_warning):
	* libguile/extensions.c (scm_c_register_extension, load_extension): Add
	  locks around global data structures.

	net-db.test tweak
	* test-suite/tests/net-db.test: Throw 'unresolved if we have a crap DNS
	  that is returning results for all addresses.

	threadsafe object properties
	* libguile/objprop.c: Add locking around the properties weak hash, to
	  avoid corrupting the whash.

	README fix for PKG_CONFIG=true
	* README: Add note that if you override pkg-config, you need to set
	  libffi flags as well. Thanks to Mark Weaver.

2010-08-28  Andreas Rottmann  <a.rottmann@gmx.at>

	Several fixes to R6RS libraries
	* module/rnrs/arithmetic/fixnums.scm (fixnum-width): Make this return an
	  an exact integer instead of an inexact number.

	* module/rnrs/base.scm (assertion-violation): Implement.

	* module/rnrs/conditions.scm (simple-conditions): Allow also simple
	  conditions as argument.

	* module/rnrs/enums.scm (define-enumeration): Properly construct empty
	  enumeration sets.

	* module/rnrs/exceptions.scm (guard): Don't restrict the body to a
	  single expression.

	* module/rnrs/records/syntactic.scm (define-record-type0): Expand into a
	  series of definitions only.

2010-08-27  Andy Wingo  <wingo@pobox.com>

	Revert "don't autocompile while snarfing"
	This reverts commit 176ee5c82a9e6c775722cfe96711f2a02cdb7672, which
	added autocomp inhibitions in the wrong place.

2010-08-27  Andy Wingo  <wingo@pobox.com>

	Revert "[build] Rewrite guile-func-name-check in Scheme, adding features."
	This reverts commit 6832604efa0f175a70be700624c365547fb27878. Not only
	does this fail on a fresh build due to a lack of "guile", but even if it
	did have its Makefile fixed, it would take too long to run, because the
	rest of Guile isn't compiled.

	The right thing is to avoid invoking Guile until after at least psyntax
	and boot-9 have been compiled.

	This commit can be reinstated if we move doc snarfing to a phase that
	happens after module/ is compiled.

2010-08-27  Andy Wingo  <wingo@pobox.com>

	don't autocompile while snarfing
	* am/snarf (GUILE_SNARF): Don't autocompile while snarfing, as we
	  probably don't have a compiled Guile at this point.

2010-08-27  Ludovic Courtès  <ludo@gnu.org>

	Document (ice-9 match).
	* doc/ref/Makefile.am (guile_TEXINFOS): Add `match.texi'.

	* doc/ref/guile.texi (Guile Modules): Include `match.texi'.

	* doc/ref/match.texi: New file.

	* doc/ref/sxml-match.texi (sxml-match): Add xref to `match.texi'.

	* module/ice-9/match.scm: Note lack of support for `(pat => exp)'.

2010-08-27  Ludovic Courtès  <ludo@gnu.org>

	SRFI-1: Choose better benchmark names.
	* benchmark-suite/benchmarks/srfi-1.bm ("fold"): Rename sub-tests to
	  "big" and "small".

2010-08-27  Ludovic Courtès  <ludo@gnu.org>

	SRFI-1: Rewrite `break' and `break!' in Scheme.
	This partially reverts commit 6e9f3c2676c0101590d4229653e9c628cb293064
	(Tue May 3 2005).

	* module/srfi/srfi-1.scm (break, break!): New procedures.

	* srfi/srfi-1.c (scm_srfi1_break, scm_srfi1_break_x): Rewrite as
	  proxies to the corresponding Scheme procedures.

	* test-suite/standalone/test-srfi-1.c (failure): New function.
	  (tests): Add `scm_srfi1_break' test.  Use `failure'.

2010-08-27  Ludovic Courtès  <ludo@gnu.org>

	SRFI-1: Rewrite `fifth', `sixth', etc. in Scheme.
	This partially reverts commit 03731332d5dc8d650b947f5126427402c2b1d8bb
	(Tue May 3 2005).

	* module/srfi/srfi-1.scm (fifth, sixth, seventh, eighth, ninth, tenth):
	  New procedures.

	* srfi/srfi-1.c (scm_srfi1_fifth, scm_srfi1_sixth, scm_srfi1_seventh,
	  scm_srfi1_eighth, scm_srfi1_ninth, scm_srfi1_tenth): Rewrite as
	  proxies to the corresponding Scheme procedure.

	* test-suite/tests/srfi-1.test ("eighth")["() -1"]: Change exception
	  type to `exception:wrong-type-arg'.
	  ("fifth")["() -1"]: Likewise.
	  ("ninth")["() -1"]: Likewise.
	  ("seventh")["() -1"]: Likewise.
	  ("sixth")["() -1"]: Likewise.
	  ("tenth")["() -1"]: Likewise.

2010-08-27  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded #:use-module.
	* module/system/vm/frame.scm: Remove use of (srfi srfi-1).

2010-08-27  Ludovic Courtès  <ludo@gnu.org>

	Assorted `syntax-check' fixes.
	* doc/ref/Makefile.am ($(snarf_doc).am): Untabify.

	* libguile/eval.c: Remove unnecessary <assert.h> inclusion.

	* .x-sc_m4_quote_check: Update.

	* libguile/error.c (scm_error_scm): Use `EXIT_FAILURE' instead of 1.
	* libguile/init.c (fixconfig, scm_boot_guile): Likewise.
	* libguile/null-threads.h (scm_i_pthread_exit): Likewise.
	* libguile/script.c (scm_compile_shell_switches): Likewise.
	* test-suite/standalone/test-conversion.c: Likewise.
	* test-suite/standalone/test-list.c: Likewise.
	* test-suite/standalone/test-unwind.c: Likewise.

	* libguile/async.c: Remove unnecessary inclusion of <signal.h>.

	* NEWS: "filesystem" -> "file system".
	* doc/ref/r6rs.texi: Ditto.

	* cfg.mk (local-checks-to-skip): New variable.

	* .x-sc_m4_quote_check, .x-sc_obsolete_symbols, .x-sc_program_name,
	  .x-sc_prohibit_atoi_atof, .x-sc_prohibit_magic_number_exit: New
	  files.

	* .gitignore: Update.

2010-08-27  Andy Wingo  <wingo@pobox.com>

	fix <letrec> docs
	* doc/ref/compiler.texi (Tree-IL): Fix docs for external representation
	  of letrec. Thanks to No Itisnt.

2010-08-26  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Rewrite guile-func-name-check in Scheme, adding features.
	* libguile/guile-func-name-check: Rewrite in Scheme; add inhibition
	  directives, string-literal handling, failureful exit on error.
	* libguile/guile-snarf-docs.in: Use ‘@top_builddir@/meta/guile’.
	* libguile/pairs.c: Add guile-func-name-check inhibition directive.

	[build] Refine libguile/*.doc snarfing.
	* libguile/guile-snarf-docs.in: Rewrite to incorporate all
	  three phases of snarfing: func-name check, cpp, tokenization.
	  Also, require/check new command-line syntax.
	* libguile/Makefile.am (AM_V_FILTER): Delete var.
	  (AM_V_FILTER_, AM_V_FILTER_0): Likewise.
	  (.c.doc): Run ./guile-snarf-docs; use new command-line syntax.

2010-08-26  Paulo Cesar Pereira de Andrade  <pcpa@mandriva.com.br>

	Account stack alignment on jit functions with odd number of arguments.
	  The x86_64 correction to keep stack aligned in jit_finish* was only
	correct for functions being called, but did not correctly handle alignment
	of stack arguments.

2010-08-25  Andy Wingo  <wingo@pobox.com>

	consolidate sitedir definition
	* configure.ac (sitedir): Fix definition to point to the
	  version-specific sitedir.

	* libguile/Makefile.am (libpath.h): Take sitedir definition from
	  configure.ac.

2010-08-25  Andy Wingo  <wingo@pobox.com>

	update download location in manual
	* doc/ref/intro.texi (Obtaining and Installing Guile): Update download
	  location.

2010-08-25  PCPA  <paulo.cesar.pereira.de.andrade@gmail.com>

	Implement x86_64 support for multiple integer and float arguments.
	  This changes the usage of some of the jit_local_state fields, and add
	two extra ones. Since jit_arg_x now returns either a register offset or
	an stack offset, it does not add _XMM0 to nextarg_putfp to distinguish
	from stack offsets.
	  The nextarg_puti field is used to known when run out of integer register
	arguments, and should push arguments on the stack.
	  The new framesize field is used to keep track of jit_arg_x offset on
	the stack, when jit_arg_x runs out of registers.
	  The argssize field is used in a slightly different way now, and is
	used to keep track of number of stack slots used to pass arguments, and
	nextarg_puti is used in its previous semantics, to also match nextarg_putfp
	logic.

	Change jit_finish to work with varargs functions in x86_64.
	  It is required to set %al to 0-8 inclusive, telling the number of
	xmm registers used to pass arguments.
	  This also corrects the calculation of _jitl.nextarg_putfp, that
	would be incorrect if calling a function with both, float and double
	arguments.

	Change JIT_FPR_NUM to 7 to prevent clobber of JIT_FPR(7)
	  Lightning provides at least 6 float registers, so, in this commit,
	reduce from 8 to 7 so that code respecting JIT_FPR_NUM should be
	safe again't use of JIT_FPTMP.

	Change JIT_REXTMP to not clobber 6th argument.
	  To not clobber JIT_R2, JIT_REXTMP is defined to the callee save register
	%r12, instead of the expected, scratch register %r11.
	  To have JIT_V_NUM at least at 3, it now also uses %r14, but does not add
	%r15, that could be JIT_V(4) to simplify logic of keeping stack 16 bytes
	aligned.

2010-08-24  Paulo Cesar Pereira de Andrade  <pcpa@mandriva.com.br>

	Change JIT_REXTMP, JIT_R, JIT_V to use 64-bit registers

	Add safety check on number of integer and float arguments on x86_64.

	Define extra SSE2 xmmN registers and set JIT_FPTMP to the topmost one.

	Change jit_getarg_{c,uc,s,us,i,ui} to extr_l to sign extend on 64 bits.

2010-08-20  Paolo Bonzini  <bonzini@gnu.org>

	more fixes to fp branches
	2010-08-20  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/fp-64.h: Return patch address from jit_bXYr_{f,d}.
		Reported by Paulo César Pereira de Andrade.
		* lightning/ppc/fp.h: Likewise.
		* lightning/sparc/fp.h: Implement FP branches.

2010-08-19  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Use AM_SILENT_RULES for generating cpp-E.c, cpp-SIG.c.
	* libguile/Makefile.am (.syms.c): Prefix first command
	  with $(AM_V_GEN); unconditionally silence second command.

2010-08-19  Paolo Bonzini  <bonzini@gnu.org>

	fix x86_64 jit_bner_{f,d}
	2010-08-18  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/fp-64.h: Fix jp in jit_bner_{f,d}.

2010-08-19  Andy Wingo  <wingo@pobox.com>

	objcodes.c comments
	* libguile/objcodes.c: Comments from Noah Lavine

2010-08-19  Noah Lavine  <nlavine@haverford.edu>

	Whitespace fix
	Add a space in libguile/objcodes.c to comply with the GNU Coding Standards.

2010-08-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Fix sed portability bug: Don't use '\n' in sed script.
	Regression introduced 2010-07-22, "[build] Overhaul
	<errno.h>, <signal.h> cpp symbol extraction/checking".
	See: <http://autobuild.josefsson.org/guile/log-201008181002653292000.txt>

	* libguile/Makefile.am (.syms.c): Convert
	  one-liner sed script to while-read-echo loop.

2010-08-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Create libguile/version.h using the configure script.
	* configure.ac (AC_CONFIG_FILES): Add libguile/version.h.

	* libguile/Makefile.am (version.h): Delete target.
	  (EXTRA_DIST): Remove version.h.in.
	  (BUILT_SOURCES): Remove version.h.
	  (MOSTLYCLEANFILES): Remove version.h, version.h.tmp.
	* libguile/version.h.in (SCM_MAJOR_VERSION): Use conventional
	  @VAR@ instead of @-VAR-@ for ‘GUILE_MAJOR_VERSION’.
	  (SCM_MINOR_VERSION, SCM_MICRO_VERSION, SCM_EFFECTIVE_VERSION): Likewise
	  for ‘GUILE_MINOR_VERSION’, ‘GUILE_MICRO_VERSION’, ‘GUILE_EFFECTIVE_VERSION’.

2010-08-18  Paolo Bonzini  <bonzini@gnu.org>

	fix -D_ASM_SAFETY compilation of beqr_d and bne_d
	2010-08-18  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/fp-32.h: Fix -D_ASM_SAFETY compilation.
		Reported by Paulo César Pereira de Andrade.

2010-08-17  Andy Wingo  <wingo@pobox.com>

	update scsh doc
	* doc/ref/scsh.texi (The Scheme shell (scsh)): Remove broken link to
	  arglist.com/guile/, and add note about bitrotting.

	further discouraged excision
	* libguile/gen-scmconfig.h.in: Remove a DISCOURAGED define.

2010-08-17  Andy Wingo  <wingo@pobox.com>

	a number of doc fixes
	* doc/ref/api-control.texi (Handling Errors): Update docs for
	  display-error.

	* libguile/backtrace.h (scm_i_display_error): Change prototype to
	  s/stack/frame/.
	* libguile/throw.c (handler_message): Change invocation of
	  scm_i_display_error to pass a frame.

	* doc/ref/api-deprecated.texi (Deprecation): Update wording.

	* doc/ref/api-evaluation.texi (Local Evaluation): Remove section on
	  local-eval.

	* doc/ref/api-macros.texi: Fix a couple typos.

	* doc/ref/api-memory.texi (Objects): Remove terrible section.
	* doc/ref/api-procedures.texi (Procedure Properties): Remove docs for
	  closure?.
	  (Compiled Procedures): Update wording.

	* doc/ref/guile.texi (API Reference): Remove reference to "Objects".

2010-08-17  Andy Wingo  <wingo@pobox.com>

	minor NEWS tweaks
	* NEWS: Minor tweaks.

	reindent psyntax.scm
	* module/ice-9/psyntax.scm: Reindent.

2010-08-17  Andy Wingo  <wingo@pobox.com>

	update comments in psyntax.scm
	* module/ice-9/psyntax.scm: Update comments. Fix a couple of needless
	  conses in and-map.

	* module/ice-9/psyntax-pp.scm (#{and-map*\ 35}): Regen.

2010-08-17  Andy Wingo  <wingo@pobox.com>

	@apply for multiple args in the boot memoizer
	* libguile/memoize.c (m_apply): Fix for multiple arguments, as in
	  (@apply proc foo bar baz).

2010-08-16  Ludovic Courtès  <ludo@gnu.org>

	Fix i18n tests when no French locale is available.
	* test-suite/tests/i18n.test ("number->locale-string")["French"]: Move
	  `under-french-locale-or-unresolved' within each `pass-if'.

2010-08-15  Andreas Rottmann  <a.rottmann@gmx.at>

	Link test-srfi-1 to libguile as well
	With an installed copy of libguile in place, test-srfi-1 would be run
	using that instead of the in-tree libguile.

	* test-suite/standalone/Makefile.am (test_srfi_1_LDADD): Add libguile.

2010-08-15  Ludovic Courtès  <ludo@gnu.org>

	Add `string->pointer' and `pointer->string' to the FFI.
	* libguile/foreign.c (scm_string_to_pointer, scm_pointer_to_string): New
	  functions.

	* libguile/foreign.h (scm_string_to_pointer, scm_pointer_to_string): New
	  declarations.

	* module/system/foreign.scm: Export `string->pointer' and
	  `pointer->string'.

	* test-suite/tests/foreign.test ("pointer<->string"): New test prefix.

	* doc/ref/api-foreign.texi (Void Pointers and Byte Access): Add
	  `string->pointer' and `pointer->string'.

2010-08-15  Ludovic Courtès  <ludo@gnu.org>

	Add `number->locale-string' tests.
	* test-suite/tests/i18n.test ("number->locale-string"): New test prefix.

2010-08-15  Paolo Bonzini  <bonzini@gnu.org>

	ldst test update
	2010-08-15  Paolo Bonzini  <bonzini@gnu.org>

		* tests/ldst.c: Update.
		* tests/Makefile.am: Use -ffloat-store to compile it.

2010-08-15  Paolo Bonzini  <bonzini@gnu.org>

	fix 64-bit load with sign extension
	2010-08-15  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s,
		jit_ldxr_s): Move...
		* lightning/i386/core-32.h: ... here.
		* lightning/i386/core-64.h (jit_ldr_c, jit_ldxr_c, jit_ldr_s,
		Use movsbq and movswq.

2010-08-15  Paolo Bonzini  <bonzini@gnu.org>

	fix jit_extr_f_d and jit_extr_d_f for x86-64
	2010-08-10  Paulo César Pereira de Andrade <pcpa@mandriva.com.br>
		    Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-32.h (jit_replace): Use MOVLrr, not MOVLir.
		(jit_movbrm): Check index register as well.
		* lightning/i386/fp-64.h: Add jit_extr_f_d and jit_extr_d_f.
		* lightning/fp-common.h: Add jit_extr_f_d and jit_extr_d_f.

2010-08-10  Paulo César Pereira de Andrade  <pcpa@mandriva.com.br>

	fix two bugs in load/store for i386
	* lightning/i386/core-32.h (jit_replace): Use MOVLrr, not MOVLir.
	(jit_movbrm): Check index register as well.

2010-08-09  Julian Graham  <julian.graham@aya.yale.edu>

	Explicit definitions for `memp' and `assp' in `(rnrs list)'; the predicate argument to Guile's `member' and `assoc' functions has a different expected arity.
	* module/rnrs/lists.scm (memp, assp): Wrap the predicate function with a
	  two-argument wrapper before calling Guile's underlying implemenation.
	* test-suite/Makefile.am: Add test-suite/tests/r6rs-lists.test to
	  SCM_TESTS.
	* test-suite/tests/r6rs-lists.test: New file.

	Explicit definitions for `vector-for-each' and `vector-map'; Guile's SRFI-1 `for-each' and `map' implementations do not operate on lists and vectors interchangeably.
	* module/rnrs/base.scm (vector-for-each, vector-map): New functions.
	* test-suite/Makefile.am: Add test-suite/tests/r6rs-base.test to SCM_TESTS.
	* test-suite/tests/r6rs-base.test: New file.

2010-08-08  Andy Wingo  <wingo@pobox.com>

	further rnrs incompat note
	* doc/ref/r6rs.texi: Note about rnrs io ports.

2010-08-08  Andy Wingo  <wingo@pobox.com>

	loose ends from "discouraged" removal
	* README: Remove docs on "discouraged".

	* configure.ac: Remove one more "discouraged" thing.

	* doc/ref/api-deprecated.texi: Rename from api-discdepr.texi, and remove
	  sections on "discouraged".

	* doc/ref/Makefile.am:
	* doc/ref/guile.texi: Update referrers.

2010-08-08  Andy Wingo  <wingo@pobox.com>

	remove "discouraged" infrastructure
	* libguile/discouraged.h: Remove.

	* libguile/deprecated.c (scm_internal_select, scm_thread_sleep)
	  (scm_thread_usleep): Deprecate formerly discouraged names.

	* libguile/eq.h (SCM_EQ_P):
	* libguile/pairs.h (SCM_NULLP, SCM_NNULLP, SCM_CONSP, SCM_NCONSP):
	* libguile/boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL):
	  (SCM_NEGATE_BOOL, SCM_BOOL_NOT): Undiscourage these names, because I'm
	  not sure deprecating them will do any good.

	* libguile.h:
	* libguile/gen-scmconfig.c:
	* libguile/numbers.c:
	* libguile/init.c:
	* libguile/Makefile.am:
	* configure.ac: Remove bits that referenced discouraged.h, and dealt
	  with the "discouraging" system.

2010-08-08  Andy Wingo  <wingo@pobox.com>

	deprecated all discouraged functions
	* libguile/Makefile.am:
	* libguile/discouraged.c: Remove discouraged.c.

	* libguile/deprecated.c:
	* libguile/deprecated.h:
	* libguile/discouraged.h: All functions and declarations moved from
	  discouraged.[ch] to deprecated.[ch], adding deprecation warnings.

	* libguile/init.c: Remove discouraged init.

	* libguile/numbers.c (scm_num2float, scm_num2double): Deprecate.

	* test-suite/standalone/test-num2integral.c: Port to modern API.

2010-08-08  Andy Wingo  <wingo@pobox.com>

	more r6rs incompat
	* doc/ref/r6rs.texi (R6RS Incompatibilities): Add section on string
	  syntax.

	add section on toplevel expansion to r6rs incompatibilities
	* doc/ref/r6rs.texi (R6RS Incompatibilities): Add a section about
	  toplevel expansion, before taking a look at fixing it...

2010-08-06  Andy Wingo  <wingo@pobox.com>

	more NEWS updates
	* NEWS: Update some more.

	fix stack narrowing for tail-call to throw
	* module/system/repl/debug.scm (narrow-stack->vector): Fix for the
	  tail-call to `throw' case, as in `(quit)'.

	,x unbound does not quit repl
	* module/system/repl/repl.scm (run-repl): Catch errors executing
	  metacommands. Feature on top of feature...

	update NEWS for 1.9.12 (mostly)
	* NEWS: Update for 1.9.12.

2010-08-06  Andy Wingo  <wingo@pobox.com>

	add docs for extensiondir; misc other fixes
	* libguile/foreign.c (scm_i_pointer_print): Print in hexadecimal.

	* doc/ref/api-foreign.texi (Modules and Extensions): Update for
	  "extensiondir", and a discussion of Guile versions.
	  (Foreign Variables): Fix discussion of types.
	  (Void Pointers and Byte Access): Fix typo.

2010-08-06  Andy Wingo  <wingo@pobox.com>

	remove type discusison from dynamic-pointer docstring
	* doc/ref/api-foreign.texi:
	* libguile/dynl.c (scm_dynamic_pointer): Remove discussion of types from
	  the docstring.

	s/extensionsdir/extensiondir/
	* libguile/Makefile.am (libpath.h): Change "extensionsdir" to
	  "extensiondir".
	* meta/guile-2.0.pc.in (extensiondir): Likewise.

2010-08-06  Andy Wingo  <wingo@pobox.com>

	%site-dir is specific to the effective version
	* libguile/load.h:
	* libguile/load.c (scm_sys_global_site_dir): New API, is what %site-dir
	  used to be.
	  (scm_sys_site_dir): Changed to be a version-specific dir.
	  (scm_init_load_path): Search the version-specific sitedir before the
	  global one.

	* libguile/Makefile.am (libpath.h): Update SCM_SITE_DIR and
	  SCM_GLOBAL_SITE_DIR, as appropriate.

2010-08-06  Andy Wingo  <wingo@pobox.com>

	only one Value History section
	* doc/ref/repl-modules.texi: Remove section on Value History, it's
	  covered in scheme-using.
	* doc/ref/scheme-using.texi: Rename "Value Historyx" section to "Value
	  History".
	* doc/ref/guile.texi: Update xref.

	add settable identifier syntax docs
	* doc/ref/api-macros.texi (Identifier Macros): Add documentation for
	  settable identifier syntax.

2010-08-06  Andy Wingo  <wingo@pobox.com>

	letrec* in docs, and some r6rs fixes
	* doc/ref/api-binding.texi: Add docs for letrec*, and revise some other
	  text.
	* doc/ref/compiler.texi: Update <letrec> for in-order?.
	* doc/ref/r6rs.texi: Add letrec* entry.

	* module/rnrs.scm:
	* module/rnrs/base.scm: Export letrec*.

2010-08-05  Andy Wingo  <wingo@pobox.com>

	fold 1.9.11 news into main body
	* NEWS: Update.

2010-08-04  Andy Wingo  <wingo@pobox.com>

	fix vector-move-right! and vector-move-left!
	* libguile/vectors.c (scm_vector_move_left_x, scm_vector_move_right_x):
	  Fix some bugs reported by Michael Lucy -- both variants would happily
	  write beyond the end, and vector-move-right! didn't increment the
	  counter before copying in the reverse direction.

	* test-suite/tests/vectors.test ("vector-move-left!"):
	  ("vector-move-right!"): Add tests.

2010-08-04  Yan Li  <yan.i.li@intel.com>

	Compiling DOT_X_FILES requires version.h
	There was a race condition when building Guile since DOT_X_FILES didn't
	depend on version.h, which is dynamically generated. Sometimes the
	DOT_X_FILES are compiled before the version.h is generated and leads to
	build failure. This patch fixed this problem.

2010-08-01  Andreas Rottmann  <a.rottmann@gmx.at>

	Fix the range of `random' on 64-bit platforms
	For > 32 bit integers still in the fixnum range, scm_random() would
	return random numbers with a lower range than specified.

	* libguile/random.c (scm_i_mask32): New static inline function.
	  (scm_c_random): Use `scm_i_mask32'.
	  (scm_c_random64): New function, 64-bit variant of scm_c_random.
	  (scm_random): Use `scm_c_random64' instead of forming the 64-bit random
	  number in a bogus way.
	* libguile/random.h: Added `scm_c_random64'.

2010-07-28  Paolo Bonzini  <bonzini@gnu.org>

	add ldst test
	2010-07-28  Paolo Bonzini  <bonzini@gnu.org>

		* tests/Makefile.am: Add ldst test.
		* tests/Makefile.in: Regenerate.
		* tests/ldst.c: New.
		* tests/ldst.ok: New.

2010-07-28  Paolo Bonzini  <bonzini@gnu.org>

	fix i386 jit_replace and x86_64 jit_movi_f
	2010-07-28  Paolo Bonzini  <bonzini@gnu.org>

		* THANKS: Add Paulo Cesar Pereira de Andrade.
		* doc/porting.texi: Fix ordering of arguments in jit_stxi.
		* lightning/i386/core-32.h (jit_replace): Remove cmp argument.
		* lightning/i386/fp-64.h (jit_movi_f): Fix.

2010-07-28  Ludovic Courtès  <ludo@gnu.org>

	Fix `parse-c-struct'.
	* module/system/foreign.scm (parse-c-struct): Update use of
	  `pointer->bytevector' to the new API.

	* test-suite/tests/foreign.test ("structs"): New test prefix.

2010-07-28  Ludovic Courtès  <ludo@gnu.org>

	Update the FFI doc.
	* doc/ref/api-foreign.texi (Foreign Types): Remove bits about typed
	  foreign pointers.  Add `void'.
	  (Foreign Variables): Update the doc of `dynamic-pointer' and the
	  `numptob' example.  Remove `foreign-set!' and `foreign-ref'.  Add
	  `pointer-address', `make-pointer', `%null-pointer', and
	  `null-pointer?'
	  (Void Pointers and Byte Access): Make it clear that wrapped pointers
	  are untyped.  Remove `void' from here.  Replace `foreign->bytevector'
	  and `bytevector->foreign' by `pointer->bytevector' and
	  `bytevector->pointer'.  Add `dereference-pointer' and the rest of the
	  `numptob' example.
	  (Dynamic FFI): Update examples.  Remove `%null-pointer' from here.

	* libguile/dynl.c (scm_dynamic_pointer): Update docstring.

	* libguile/foreign.c (scm_dereference_pointer,
	  scm_pointer_to_bytevector): Likewise.

	* module/system/foreign.scm (null-pointer?): Add docstring.

2010-07-28  Ludovic Courtès  <ludo@gnu.org>

	Remove unused parameter from `bytevector->pointer'.
	* libguile/foreign.c (scm_bytevector_to_pointer): Remove unused LEN
	  parameter.  Update docstring.

	Always return `%null-pointer' when creating a NULL pointer with no finalizer.
	* libguile/foreign.c (scm_make_pointer): Always call out to
	  `scm_from_pointer'.
	  (scm_from_pointer): Return NULL_POINTER when PTR and FINALIZER are
	  NULL.

2010-07-28  Ludovic Courtès  <ludo@gnu.org>

	Use "pointer" instead of "foreign" when dealing with wrapped pointers.
	* libguile/foreign.h (scm_t_foreign_finalizer): Rename to...
	  (scm_t_pointer_finalizer): ... this.
	  (SCM_FOREIGN_P): Rename to...
	  (SCM_POINTER_P): this.
	  (SCM_VALIDATE_FOREIGN): Rename to...
	  (SCM_VALIDATE_POINTER): ... this.
	  (SCM_FOREIGN_HAS_FINALIZER): Rename to...
	  (SCM_POINTER_HAS_FINALIZER): ... this.
	  (scm_take_foreign_pointer): Rename to...
	  (scm_from_pointer): ... this.
	  (scm_foreign_address): Rename to...
	  (scm_pointer_address): ... this.
	  (scm_foreign_to_bytevector): Rename to...
	  (scm_pointer_to_bytevector): ... this.
	  (scm_foreign_set_finalizer_x): Rename to...
	  (scm_set_pointer_finalizer_x): ... this.
	  (scm_bytevector_to_foreign): Rename to...
	  (scm_bytevector_to_pointer): ... this.
	  (scm_i_foreign_print): Rename to...
	  (scm_i_pointer_print): ... this.

	* libguile/foreign.c: Update accordingly.

	* libguile/tags.h (scm_tc7_foreign): Rename to...
	  (scm_tc7_pointer): ... this.

	* libguile/foreign.c, libguile/deprecated.c, libguile/dynl.c,
	  libguile/evalext.c, libguile/gc.c, libguile/goops.c, libguile/gsubr.c,
	  libguile/gsubr.h, libguile/print.c, libguile/snarf.h,
	  libguile/vm-i-system.c, module/system/foreign.scm,
	  test-suite/standalone/test-ffi, test-suite/tests/foreign.test: Update
	  accordingly.

2010-07-27  Andy Wingo  <wingo@pobox.com>

	64-bit random fixes
	* libguile/random.c (scm_random): Fix generation of inum randoms with
	  more than 32 bits.

	* libguile/random.h (scm_t_rstate): Fix a comment.

2010-07-26  Ludovic Courtès  <ludo@gnu.org>

	Add `dereference-pointer' to `(system foreign)'.
	* libguile/foreign.c (scm_dereference_pointer): New function.

	* libguile/foreign.h (scm_dereference_pointer): New declaration.

	* module/system/foreign.scm (dereference-pointer): Likewise.

	* test-suite/tests/foreign.test
	  ("foreign<->bytevector")["dereference-pointer"]: New test.

2010-07-26  Ludovic Courtès  <ludo@gnu.org>

	Simplify the (system foreign) API.
	Suggested by Neil Jerram.

	* libguile/foreign.h (SCM_FOREIGN_TYPE, SCM_FOREIGN_VALUE_REF,
	  SCM_FOREIGN_VALUE_SET, SCM_FOREIGN_LEN, SCM_FOREIGN_TYPED_P,
	  SCM_FOREIGN_VALUE_P, SCM_VALIDATE_FOREIGN_VALUE, scm_foreign_set_x,
	  scm_foreign_type): Remove.
	  (scm_foreign_ref): Rename to...
	  (scm_foreign_address): ... this.
	  (scm_take_foreign_pointer): Update.
	  (SCM_FOREIGN_POINTER): Remove CTYPE argument.  Update callers.
	  (scm_make_pointer): New declaration.

	* libguile/foreign.c (scm_to_uintptr, scm_from_uintptr): New macros.
	  (scm_make_pointer): New function.
	  (scm_take_foreign_pointer): Remove TYPE and LEN arguments.  Update
	  callers.
	  (scm_foreign_ref): Remove to...
	  (scm_foreign_address): ... this.  Remove type-related code.
	  (scm_foreign_set_x): Remove.
	  (scm_foreign_to_bytevector): Change argument order; make LEN argument
	  compulsory.
	  (scm_i_foreign_print): Remove type printing.
	  (unpack): Remove foreign-type checking.

	* libguile/deprecated.c (scm_dynamic_args_call): Update accordingly.

	* libguile/dynl.c (scm_dynamic_pointer): Remove the TYPE and LEN
	  arguments; update callers.  Update to the new foreign API.

	* libguile/dynl.h (scm_dynamic_pointer): Update.

	* libguile/gsubr.c (create_gsubr): Update to the new foreign API.

	* libguile/gsubr.h (SCM_SUBRF, SCM_SUBR_GENERIC): Ditto.

	* libguile/snarf.h (SCM_IMMUTABLE_FOREIGN): Ditto.

	* libguile/vm-i-system.c (subr_call): Ditto.

	* module/system/foreign.scm (null-pointer?): New procedure.

	* test-suite/standalone/test-ffi: Update to the new
	  `bytevector->foreign' signature.

	* test-suite/tests/foreign.test ("null pointer")["null pointer
	  identity", "null-pointer? %null-pointer"]: New tests.
	  ["foreign-set! other-null-pointer", "foreign->bytevector
	  other-null-pointer"]: Remove.
	  ("make-pointer", "foreign<->bytevector"): New test prefixes.

2010-07-26  Ludovic Courtès  <ludo@gnu.org>

	Import unbound variable reports in the VM.
	* libguile/vm-engine.c (VM_NAME)[vm_error_unbound]: Add comment.

	* libguile/vm-i-system.c (variable_ref): Attempt provide the name of X
	  in FINISH_ARGS.

2010-07-26  Ludovic Courtès  <ludo@gnu.org>

	Check for go/scm mtime ordering rather than equality.
	* am/guilec (install-data-hook): Remove.
	  (guile_install_go_files): New variable.
	  ($(guile_install_go_files)): New dependency.

	* libguile/load.c (compiled_is_fresh): Check for ordering of STAT_SOURCE
	  and STAT_COMPILED, not equality.

	* module/ice-9/boot-9.scm (load): Ditto.

	* module/system/base/compile.scm (call-with-output-file/atomic): Don't
	  set the timestamp of TEMPLATE.

2010-07-26  Andy Wingo  <wingo@pobox.com>

	rstates point to rngs
	* libguile/random.h (scm_t_rstate): Include the rng in the rstate, so we
	  can actually have multiple rngs. Instead of reserved0 / reserved1,
	  reserve a double explicitly for scm_c_normal01.
	  (scm_c_uniform32): Change to call the rstate's rng.

	* libguile/random.c: Change to access an rstate's rng through its rng
	  pointer.
	  (scm_c_normal01): Instead of a flag and a next double, just check that
	  the double is equal to 0.0. Excluding one value shouldn't affect the
	  distribution, right?

2010-07-26  Andy Wingo  <wingo@pobox.com>

	update docs
	* doc/ref/api-data.texi:
	* libguile/random.c: Update datum->random-state and random-state->datum
	  docs.

2010-07-26  Andy Wingo  <wingo@pobox.com>

	refactor datum->random-state / random-state->datum
	* libguile/random.c (scm_t_i_rstate): Move here from random.h, along
	  with prototypes for functions
	  (scm_i_uniform32, scm_i_init_rstate, scm_i_copy_rstate): Change to
	  take a stock scm_t_rstate as an arg, and cast it. This way we don't
	  cast the pointers below.
	  (scm_i_rstate_from_datum, scm_i_rstate_from_datum): Same and rename
	  from scm_i_init_rstate_scm / scm_i_expose_rstate.
	  (scm_c_rstate_from_datum): Rename from scm_c_make_rstate_scm.
	  (scm_datum_to_random_state, scm_random_state_to_datum): Rename from
	  scm_external_to_random_state and scm_random_state_to_external.
	  (scm_init_random): Remove casts.

	* libguile/random.h (scm_t_rng): Rename init_rstate_scm, expose_rstate
	  vmethods to from_datum, to_datum. Remove internal definitions. Rename
	  to scm_c_rstate_from_datum, and provide scm_random_state_to_datum and
	  scm_datum_to_random_state.

2010-07-26  Andy Wingo  <wingo@pobox.com>

	low-level RNG interfaces deal in scm_t_uint32, not unsigned long
	* libguile/random.h (scm_t_rng): random_bits returns a scm_t_uint32.
	  (scm_i_uniform32, scm_t_i_rstate): Internal RNG returns a
	  scm_t_uint32, as advertised, instead of unsigned long.
	  (scm_c_random): Return a scm_t_uint32 instead of an unsigned long.

	* libguile/random.c (scm_i_uniform32, scm_i_init_rstate_scm):
	  (scm_i_expose_rstate, scm_c_random, scm_c_random_bignum, scm_random)
	  (scm_init_random): Adapt types to match implementation.

2010-07-26  Andy Wingo  <wingo@pobox.com>

	remove SCM_HAVE_T_INT64, SCM_HAVE_T_UINT64
	* libguile/__scm.h:
	* libguile/numbers.h:
	* libguile/random.c:
	* libguile/srfi-4.c:
	* libguile/srfi-4.h:
	* libguile/numbers.c:
	* test-suite/standalone/test-conversion.c:
	* libguile/gen-scmconfig.c: As we require 64-bit integers in
	  configure.ac, remove conditional definition of 64-bit types.

2010-07-26  Andreas Rottmann  <a.rottmann@gmx.at>

	Allow exposing of random number generator state
	Now the random number generator state can be obtained in external
	(i.e. `read'/`write'-able) form via the new procedure
	`random-state->external'.  An externalized state can be reinstantiated by
	calling `external->random-state'.

	* libguile/random.c (scm_i_init_rstate_scm, scm_i_expose_rstate): New
	  internal functions.
	* libguile/random.c (scm_c_make_rstate_scm, scm_external_to_random_state,
	  scm_random_state_to_external): New public functions.
	* libguile/random.h: Add prototypes for the above functions.

	* libguile/random.h (scm_t_rng): Add new fields `init_rstate_scm' and
	  `expose_rstate'.
	* libguile/random.c (scm_init_random): Initialize the new fields in
	  `scm_the_rng'.

2010-07-26  Paolo Bonzini  <bonzini@gnu.org>

	fix jit_movbrm in the i386 backend
	2010-07-26  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-32.h (jit_replace): Move here (removed
		2009-03-01).

2010-07-24  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Fix "make dist" regression: Distribute guile-func-name-check.
	Regression introduced 2010-07-22,
	"Avoid no-op config-subst for libguile/guile-func-name-check".
	* libguile/Makefile.am (noinst_SCRIPTS):
	Move guile-func-name-check from here...
	(EXTRA_DIST): ...to here.

2010-07-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Update AUTHORS to reflect now-removed guile-snarf-docs-texi; nfc.

2010-07-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[maint] Remove unused script guile-doc-snarf.
	* doc/ref/tools.texi (Doc Snarfing): Don't mention guile-doc-snarf.

	* configure.ac (libguile/guile-doc-snarf): Delete ‘GUILE_CONFIG_SCRIPT’.

	* libguile/Makefile.am (noinst_SCRIPTS): Remove guile-doc-snarf.
	* libguile/.gitignore: Remove guile-doc-snarf.
	* libguile/guile-doc-snarf.in: Delete file.

	* module/scripts/doc-snarf.scm: Comment munging; nfc.

	* AUTHORS: Update.

2010-07-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Add copyright notice to acinclude.m4.
	* acinclude.m4: Add copyright notice, with years derived from "git log" output.

	[build] Move GUILE_CONFIG_SCRIPT to acinclude.m4.
	* configure.ac (GUILE_CONFIG_SCRIPT): Move from here...
	* acinclude.m4 (GUILE_CONFIG_SCRIPT): ...to here.

	[maint] Avoid no-op config-subst for libguile/guile-func-name-check.
	* configure.ac (libguile/guile-func-name-check): Remove ‘GUILE_CONFIG_SCRIPT’.
	* libguile/Makefile.am (.c.doc): Look in $(srcdir) for awk script.
	* libguile/guile-func-name-check: Rename from guile-func-name-check.in.

	[build] Overhaul <errno.h>, <signal.h> cpp symbol extraction/checking.
	* libguile/Makefile.am (BUILT_SOURCES): Delete cpp_err_symbols.c,
	  cpp_sig_symbols.c; add cpp-E.c, cpp-SIG.c.
	  (EXTRA_DIST): Delete cpp_signal.c, cpp_errno.c, cpp_err_symbols.in,
	  cpp_err_symbols.c, cpp_sig_symbols.c, cpp_sig_symbols.in, cpp_cnvt.awk;
	  add cpp-E.syms, cpp-E.c, cpp-SIG.syms, cpp-SIG.c.
	  (error.x, posix.x): Update prereq list.
	  (cpp_err_symbols.c, cpp_sig_symbols.c): Delete targets.
	  (check_signals, check_errnos): Likewise.
	  (.syms.c): New pattern rule.
	  (chknew-E, chknew-SIG): New targets.
	  (MOSTLYCLEANFILES): Delete cpp_err_symbols_here, cpp_err_symbols_diff,
	  cpp_err_symbols_new, cpp_sig_symbols_here, cpp_sig_symbols_diff,
	  cpp_sig_symbols_new.
	* libguile/cpp-E.syms: Rename from libguile/cpp_err_symbols.in.
	* libguile/cpp-SIG.syms: Rename from libguile/cpp_sig_symbols.in.
	* libguile/error.c (scm_init_error): #include "libguile/cpp-E.c".
	* libguile/posix.c (scm_init_posix): #include "libguile/cpp-SIG.c".
	* libguile/cpp_cnvt.awk: Delete file.
	* libguile/cpp_errno.c: Delete file.
	* libguile/cpp_signal.c: Delete file.

2010-07-21  Andy Wingo  <wingo@pobox.com>

	fix git-version-gen to work with bsd sed and obsolete regexps
	* configure.ac: Avoid + in git-version-gen sed script, as it doesn't
	  work on BSD sed with obsolete regexps.

2010-07-21  Ludovic Courtès  <ludo@gnu.org>

	Start rewriting SRFI-1 in Scheme.
	This partially reverts commit e556f8c3c6b74ee6596e8dcbe829109d7745da2c
	(Fri May 6 2005).

	* module/srfi/srfi-1.scm (xcons, list-tabulate, not-pair?, car+cdr,
	  last, fold, list-index): New procedures.

	* srfi/srfi-1.c (srfi1_module): New variable.
	  (CACHE_VAR): New macro.
	  (scm_srfi1_car_plus_cdr, scm_srfi1_fold, scm_srfi1_last,
	  scm_srfi1_list_index, scm_srfi1_list_tabulate, scm_srfi1_not_pair_p,
	  scm_srfi1_xcons): Rewrite as proxies of the corresponding Scheme
	  procedure.

	* test-suite/tests/srfi-1.test ("list-tabulate")["-1"]: Change exception
	  type to `exception:wrong-type-arg'.

	* benchmark-suite/benchmarks/srfi-1.bm: New file.

	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
	  `benchmarks/srfi-1.bm'.

	* test-suite/standalone/Makefile.am (test_srfi_1_SOURCES,
	  test_srfi_1_CFLAGS, test_srfi_1_LDADD): New variables.
	  (check_PROGRAMS): Add `test-srfi-1'.
	  (TESTS): Ditto.

	* test-suite/standalone/test-srfi-1.c: New file.

2010-07-21  Ludovic Courtès  <ludo@gnu.org>

	Add `vhash-fold*' in `(ice-9 vlist)'.
	* module/ice-9/vlist.scm (%vhash-fold*): New inline procedure.
	  (vhash-fold*, vhash-foldq*, vhash-foldv*): New procedures.

	* test-suite/tests/vlist.test ("vhash")["vhash-fold*", "vhash-fold*
	  tail", "vhash-fold* interleaved", "vhash-foldq* degenerate"]: New
	  tests.

	* doc/ref/api-compound.texi (VHashes): Add `vhash-fold*' & co.

2010-07-19  Andreas Rottmann  <a.rottmann@gmx.at>

	Fix random number generator on 64-bit platforms
	* libguile/random.c (scm_c_random): On platforms where `unsigned long' has 64
	  bit, generate up to 64 bit of randomness. This is expected by
	  scm_c_random_bignum(), and hence was a serious distortion of the random value
	  distribution for values exceeding 2^32. This change also fixes a crash when
	  the `m' argument is a value above 2^32.

2010-07-19  Paolo Bonzini  <bonzini@gnu.org>

	always set and replace lightning_frag
	2010-07-19  Paolo Bonzini  <bonzini@gnu.org>

		* build-aux/lightning.m4: Always set and replace lightning_frag.
		* Makefile.in: Regenerate.
		* aclocal.m4: Regenerate.
		* config.h.in: Regenerate.
		* configure: Regenerate.
		* doc/Makefile.in: Regenerate.
		* doc/lightningize.1: Regenerate.
		* doc/version.texi: Regenerate.
		* lightning/Makefile.in: Regenerate.
		* opcode/Makefile.in: Regenerate.
		* tests/Makefile.in: Regenerate.

2010-07-19  Paolo Bonzini  <bonzini@gnu.org>

	always set and replace lightning_frag
	2010-07-19  Paolo Bonzini  <bonzini@gnu.org>

		* build-aux/lightning.m4: Always set and replace lightning_frag.

2010-07-17  Andy Wingo  <wingo@pobox.com>

	recommend #:replace
	* doc/ref/api-modules.texi (Creating Guile Modules): Update text to
	  recommend #:replace.
	* module/srfi/srfi-19.scm (current-time): #:replace.

	use scm_malloc_pointerless to alloc aligned blocks in fallback
	* libguile/continuations.c (SCM_DECLARE_STATIC_ALIGNED_ARRAY)
	  (SCM_STATIC_ALIGNED_ARRAY)
	* libguile/control.c (SCM_DECLARE_STATIC_ALIGNED_ARRAY)
	  (SCM_STATIC_ALIGNED_ARRAY): Tweak backslashes. Use
	  scm_malloc_pointerless to ensure alignment.

	SCM_I_FLUID_P -> SCM_FLUID_P
	* libguile/fluids.h (SCM_FLUID_P): Change from SCM_I_FLUID_P.
	  (SCM_I_FLUID_NUM, SCM_I_DYNAMIC_STATE_P, SCM_I_DYNAMIC_STATE_FLUIDS):
	  Wrap in BUILDING_LIBGUILE ifdef.

2010-07-17  Michael Gran  <spk121@yahoo.com>

	Enable character hex escapes by default
	R6RS character hex escapes do not conflict with legacy Guile octal
	character escapes, so they can be enabled by default.

	* libguile/read.c (scm_read_character): modified
	* test-suite/tests/reader.test: modify character escape tests
	* doc/ref/api-data.texi: modified
	* doc/ref/api-options.texi: modified

2010-07-17  Michael Gran  <spk121@yahoo.com>

	open-file should handle binary mode and coding declarations
	The open-file port should use the 8-bit ISO-8859-1 encoding when
	a file is opened using mode "b".  Also, it should honor a "coding:"
	declaration at the top of a file when reading files where it is present.

	* libguile/fports.c (scm_open_file): modified
	* test-suite/tests/ports.test: more tests for open-file
	* doc/ref/api-io.texi (File Ports): more documentation for open-file

2010-07-16  Andy Wingo  <wingo@pobox.com>

	remove (system vm debug)
	* module/system/vm/debug.scm: Remove.
	* module/Makefile.am: Update.

	* module/system/repl/debug.scm: Add some TODOs and a commented-out
	  function here.

2010-07-16  Andy Wingo  <wingo@pobox.com>

	remove (ice-9 emacs)
	* module/ice-9/emacs.scm: Remove.
	* module/ice-9/deprecated.scm (load-emacs-interface): Remove wrapper
	  with no callers.
	* module/Makefile.am: update.

2010-07-16  Andy Wingo  <wingo@pobox.com>

	gut ice-9 debug
	* module/ice-9/debug.scm: Gut, though we keep the module around for code
	  Out There that uses it.

	* module/ice-9/top-repl.scm (top-repl): Don't import (ice-9 debug)

	* module/ice-9/debugger/commands.scm:
	* module/ice-9/debugging/trace.scm:
	* module/ice-9/emacs.scm: Remove ice-9 debug includes.

2010-07-16  Andy Wingo  <wingo@pobox.com>

	update tour.texi examples
	* doc/ref/tour.texi (Running Guile Interactively): Update examples for
	  formatting.

	tour.texi updates
	* doc/ref/tour.texi: Update Guile prompts for
	  scheme@(guile-user)>. Update output to assume value-history is on. Lop
	  and crop the bug reporting section -- it was too long.

	update debugger docs
	* doc/ref/api-debug.texi (Debug on Error): Update xref.
	* doc/ref/scheme-using.texi (REPL Commands): New subsection.
	  (Interactive Debugging): Rename from Interactive Debugger, to indicate
	  that debugging is just part of the REPL. Update docs.

	updates to system repl command
	* module/system/repl/command.scm (help): Update docs on how to get help
	  on a particular command.
	  (load): Remove #:f flag.

	lower fill-column in .dir-locals.el
	* .dir-locals.el: Fill-columns back down to 72.

2010-07-16  Michael Gran  <spk121@yahoo.com>

	read-line should use port's encoding, not locale's encoding
	* libguile/rdelim.c (scm_read_line): modified, use port's encoding
	* test-suite/test/ports.test: new test

2010-07-16  Michael Gran  <spk121@yahoo.com>

	More explicit variable names in scm_i_scan_for_encoding
	Note especially that the variable 'i' has two different uses in this
	function, and they get confused.

	* libguile/read.c (scm_i_scan_for_encoding): cleanup

2010-07-15  Ludovic Courtès  <ludo@gnu.org>

	Remove heap allocations in `scm_getc', `scm_ungetc', and `find_valid_encoding'.
	* libguile/ports.c (scm_getc): Provide `u32_conv_from_encoding' with the
	  RESULT_BUF stack-allocated buffer to avoid heap allocation.
	  (find_valid_encoding): Likewise.
	  (scm_ungetc): Ditto with `u32_conv_to_encoding'.

2010-07-15  Ludovic Courtès  <ludo@gnu.org>

	Expose `scm_encoding_error'.
	* libguile/strings.c (scm_encoding_error): Make public.

	* libguile/strings.h (scm_encoding_error): New internal declaration.

2010-07-15  Ludovic Courtès  <ludo@gnu.org>

	sxml-match: Always use the same prompt tag.
	* module/sxml/match.scm (%call/ec-prompt): New variable.
	  (call/ec): Use it instead of creating a new prompt tag.

	Declare `ice-9/psyntax-pp.scm.gen' as a phony target.
	* module/Makefile.am (.PHONY): Add `ice-9/psyntax-pp.scm.gen'.

2010-07-15  Andy Wingo  <wingo@pobox.com>

	don't re-print the error by default in call-with-error-handling
	* module/system/repl/error-handling.scm (call-with-error-handling):
	  Previous post-error changed to "report"; now "catch", the default,
	  doesn't re-print the error.

	error-handling tweak
	* module/system/repl/error-handling.scm (call-with-error-handling):
	  Remove extra newline.

2010-07-15  Andy Wingo  <wingo@pobox.com>

	better error reporting from the vm
	* libguile/vm-engine.c: Add func_name local, for error reporting.
	  (vm_error_apply_to_non_list): New error case.
	  (vm_error_wrong_type_arg): Remove this generic error case.
	  (vm_error_wrong_type_apply): Remove FUNC_NAME -- no sense in seeing
	  "vm-debug-engine" in the error report.
	  (vm_error_not_a_pair, vm_error_not_a_bytevector)
	  (vm_error_not_a_struct, vm_error_not_a_thunk): Use func_name instead
	  of FUNC_NAME, so we can indicate what caused the error.

	* libguile/vm-i-scheme.c (VM_VALIDATE_CONS, car, cdr, set-car!)
	  (set-cdr!): Indicate provenance of errors.
	  (VM_VALIDATE_STRUCT, struct-vtable):
	  (VM_VALIDATE_BYTEVECTOR, BV_FIXABLE_INT_REF, BV_INT_REF)
	  (BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET): Same.

	* libguile/vm-i-system.c (apply, tail-apply): Use
	  vm_error_apply_to_non_list.

2010-07-15  Andy Wingo  <wingo@pobox.com>

	pass a frame to display-error in system repl error-handling
	* module/system/repl/error-handling.scm (call-with-error-handling): Pass
	  a frame to display-error.

	display-error takes a frame, shows source if possible
	* libguile/backtrace.h:
	* libguile/backtrace.c (scm_display_error): Change "stack" arg to
	  "frame". Still accept stacks for backward compatibility.
	  (display_header, display_error_body): Show the source of the error, if
	  possible.

2010-07-14  Andy Wingo  <wingo@pobox.com>

	fix boostrapping error with srfi-1 (for the third time!)
	* module/ice-9/deprecated.scm (set-repl-prompt!): Avoid @, so as to
	  avoid a bootstrapping error. Horrible.

2010-07-14  Julian Graham  <julian.graham@aya.yale.edu>

	Fix argument passing for external hash functions in `(rnrs hashtables)'. Guile implements this library in terms of SRFI-69, which is a bit vague on the arity of hash functions, whereas `(rnrs hashtables)' explicitly specifies unary ones.
	* module/rnrs/hashtables.scm (wrap-hash-function): Assume SRFI-69 will pass
	  the table capacity as the second argument; return the result of proc
	  modulo the capacity.

	* test-suite/tests/r6rs-hashtables.test (make-hashtable): New test case for
	  hash functions that return large values.

2010-07-13  Andy Wingo  <wingo@pobox.com>

	fix '(] infinite loop
	* libguile/read.c (scm_read_sexp): Fix reader infinite loop. Thanks to
	  Bill Schottstaedt for the report.
	* test-suite/tests/reader.test: Add test.

	fix psyntax-pp.go dependency
	* module/Makefile.am (ice-9/psyntax-pp.go): Fix dep.

	ctrl-d with readline exits one recursive repl instance
	* module/ice-9/buffered-input.scm (make-buffered-input-port): Instead of
	  always returning EOF once EOF is seen once, call the producer again.
	  Allows Ctrl-D to cause one EOF at the REPL, returning once from a
	  recursive edit, but input continues normally. Thanks to Andrew
	  Bagdanov for a clue that led to the fix.

	don't automatically generate psyntax-pp.scm any more
	* module/Makefile.am (ice-9/psyntax-pp.scm.gen): No longer automatically
	  regenerate psyntax-pp.scm, as the gensym dance is getting too
	  complicated. Instead when you change psyntax.scm now you should make
	  ice-9/psyntax-pp.scm.gen.

2010-07-13  Ludovic Courtès  <ludo@gnu.org>

	Have `benchmark-guile' honor the current $GUILE_LOAD_PATH.
	* benchmark-guile.in (GUILE_LOAD_PATH): Extend the current value instead
	  of overwriting it completely.

	Add missing benchmark files to the distribution.
	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
	  `benchmarks/chars.bm' and `benchmarks/srfi-13.bm'.

2010-07-13  Ludovic Courtès  <ludo@gnu.org>

	Fix type-checking in the optimized path of `string=?'.
	* libguile/srfi-13.c (scm_string_eq): Properly type-check S1 and S2.

	* test-suite/tests/strings.test ("string=?")["1st argument EOF", "2nd
	  argument EOF"]: New tests exposing the problem.

2010-07-10  Andy Wingo  <wingo@pobox.com>

	print column numbers in backtraces
	* module/system/repl/debug.scm (print-frame): Print column numbers too.

2010-07-10  Andy Wingo  <wingo@pobox.com>

	finally, backtraces only showing frames for the computation
	* module/system/repl/repl.scm (run-repl): Run the thunk in a stack in a
	  prompt, similar to the default prompt. Gives proper backtraces.

	* module/system/repl/error-handling.scm (call-with-error-handling):
	  Narrow one more outer frame, for the %start-stack thunk invocation.

	* module/ice-9/boot-9.scm (%start-stack): Reindent.

2010-07-10  Andy Wingo  <wingo@pobox.com>

	update manual for value history on by default
	* doc/ref/compiler.texi: Update for new ,pp meta-command.
	* doc/ref/scheme-using.texi (Using Guile Interactively): Show value
	  history in examples.
	  (Value Historyx): Update docs to mention the repl option and the
	  programmatic interface.

2010-07-10  Andy Wingo  <wingo@pobox.com>

	validating repl options; value-history on by default
	* module/system/repl/common.scm: Use (ice-9 history). Turns on value
	  history by default.
	  (repl-default-options): Expand the format of options to include an
	  optional value transformer, run when setting a value. Add prompt and
	  value-history options.
	  (repl-prepare-eval-thunk): Use repl-option-ref.
	  (repl-option-ref): Error if the option is unknown.
	  (repl-option-set!, repl-default-option-set!): Error if the option is
	  unknown. Pass the val through the transformer procedure.
	  (repl-default-prompt-set!): Just use repl-default-option-set!.

	* module/system/repl/command.scm (option): Update for the new options
	  format.

2010-07-10  Andy Wingo  <wingo@pobox.com>

	value-history-enabled? accessor
	* module/ice-9/history.scm (value-history-enabled?): Add accessor.
	  (enable-value-history!, disable-value-history!): Adapt.

	heap/literal fixes for repl-default-options
	* module/system/repl/common.scm (repl-default-options): Heap-allocate
	  the repl-default-options, to avoid mutating a literal.
	  (make-repl): Copy repl-default-options.

	add utils to turn value history on and off, and to clear it
	* module/ice-9/history.scm (enable-value-history!)
	  (disable-value-history!, clear-value-history!): New exports.

	capture default dynamic state in (guile-user)
	* libguile/init.c (scm_i_init_guile): Move the call to
	  scm_init_threads_default_dynamic_state after the call to
	  scm_load_startup_files, so that the default dynamic state is in the
	  (guile-user) module, not (guile).

2010-07-10  No Itisnt  <theseaisinhere+git@gmail.com>

	Remove trailing whitespace
	* module/language/tree-il.scm: Remove trailing whitespace

2010-07-09  Andy Wingo  <wingo@pobox.com>

	avoid running the debugger during parsing or compilation at the repl
	* module/system/repl/repl.scm (abort-on-error): New helper.
	  (run-repl): Don't enter the debugger during parsing or compilation of
	  a repl expression. If you want to debug compilation, run compilation
	  from the repl, not as part of the repl.

	fix up a repl command docstring
	* module/system/repl/command.scm (procedure): Fix up docstring.

	tweaks to print-locals
	* module/system/repl/debug.scm (print-locals): Run the before-print-hook
	  on the values, so we can hook into (ice-9 history) if available. Don't
	  bother printing binding indices. Give a little per-line-prefix.

	tweaks to new repl
	* module/system/repl/command.scm (read-command): Remove a pk.
	* module/system/repl/repl.scm (run-repl): Export. Use % and abort to
	  implement the prompt.

2010-07-09  Andy Wingo  <wingo@pobox.com>

	integrate the debugger into the repl
	* module/system/repl/debug.scm: New file, defines a data type to hold
	  state for a debugger stack, and some helper procedures to print the
	  stack or print a frame. Most pieces are from (system vm debug).

	* module/system/repl/error-handling.scm: New file, implements
	  call-with-error-handling and with-error-handling, and instead of going
	  into a debugger, we go into a recursive repl that happens to have
	  debugging information. Will be removing the old debugger from (system
	  vm debug) shortly.

	* module/Makefile.am (SYSTEM_SOURCES): Add error-handling and debug scm
	  files.

	* module/system/repl/repl.scm (prompting-meta-read): Better error
	  handling -- we don't want to go into a debugger when reading a
	  command.
	  (start-repl): Add #:debug keyword argument, and just dispatch to
	  run-repl.
	  (run-repl): New function, with the guts of the old start-repl. Added a
	  prompt, to which a throw to 'quit will abort.

	* module/system/repl/common.scm (repl-prepare-eval-thunk): New
	  helper. In the future we will use this to not enter the debugger on
	  errors that happen at compile time.
	  (repl-eval): Use repl-prepare-eval-thunk.
	  (repl-print): Run the before-print-hook when printing a value.

	* module/system/repl/command.scm (*command-table*): Move `option' to the
	  `system' group. Move `trace' to the `profile' group. Add `debug' and
	  `inspect' groups.
	  (command-abbrevs): Rename from command-abbrev, and allow multiple
	  abbreviations.
	  (display-group): Fix the case where abbrev? was #f.
	  (display-summary): Fix alignment of the command and
	  abbreviations. Allow multiple abbreviations.
	  (read-command): Rename from read-datum, and have better error
	  handling.
	  (meta-command): Better error handling.
	  (define-meta-command): Better error handling.
	  (help, show, import, compile, disassemble, time, profile, trace): Fix
	  docstrings and error messages.
	  (define-stack-command): New helper, for commands that operate on a
	  saved stack.
	  (backtrace, up, down, frame, procedure, locals): New debugger
	  commands, in the REPL now.
	  (inspect, pretty-print): New "inspect" commands.

2010-07-09  Andy Wingo  <wingo@pobox.com>

	readline only handles SIGWINCH
	* acinclude.m4 (GUILE_READLINE): Check for rl_catch_signals and
	  rl_catch_sigwinch.

	* guile-readline/readline.c (scm_init_readline): If we can, turn off
	  readline's signal handling, because we can do our own.
	  (scm_readline): Use dynwinds to handle resetting readline's state on
	  nonlocal exit, not catches.
	  (unwind_readline): Rename from handle_error.

2010-07-09  Andy Wingo  <wingo@pobox.com>

	remove use-emacs-interface check from ice-9 readline
	* guile-readline/ice-9/readline.scm (activate-readline): Remove check
	  for use-emacs-interface in guile-user, an interface that was removed.

	define* in ice-9 regex
	* module/ice-9/regex.scm (match:start, match:end, match:substring)
	  (fold-matches, list-matches): Reimplement using define*.

	untabify (ice-9 regex)
	* module/ice-9/regex.scm: Untabify.

2010-07-09  Andy Wingo  <wingo@pobox.com>

	fix (set! MACRO exp) hygiene
	* module/ice-9/psyntax.scm (lookup): Reflow comment.
	  (chi-top, syntax): Add comments about mod for lookup.
	  (set!): Lookup the identifier in the module attached to its syntax
	  object. In the (set! MACRO foo) case, after expanding the macro, chi
	  the resulting expression with the empty wrap, as syntax-type
	  does. Seems to fix the case where the expansion references
	  lexically-bound variables.

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

	* test-suite/tests/syncase.test: Add a bunch of tests.

2010-07-04  Neil Jerram  <neil@ossau.uklinux.net>

	Fix TeXing of doc/ref/r6rs.texi
	* doc/ref/r6rs.texi (rnrs conditions): Add "{Condition Type}" to
	  @deffn line for each condition type.  Add one missing "{Scheme
	  Procedure}".

2010-07-04  Ludovic Courtès  <ludo@gnu.org>

	Optimize `string=' for the common case.
	* libguile/srfi-13.c (scm_string_eq): Add a fast path for the common
	  case.

2010-07-04  Ludovic Courtès  <ludo@gnu.org>

	Add `scm_i_string_data'.
	* libguile/strings.c (STRINGBUF_CONTENTS): New macro.
	  (STRINGBUF_CHARS, STRINGBUF_WIDE_CHARS): Use it.
	  (scm_i_string_data): New function.

	* libguile/strings.h (scm_i_string_data): New declaration.

2010-07-01  Neil Jerram  <neil@ossau.uklinux.net>

	Fix hanging of popen.test
	The "open-output-pipe":"no duplicate" test has been hanging, on and
	off, and not completely reliably, for a few years.  It's now doing so
	fairly reliably for me, and investigation shows that

	- the child shell process is in a tight loop (99% CPU)

	- the parent Guile process is stuck calling waitpid().

	The problem is that the child hasn't got the SIGPIPE that the test
	intends, and so is continuing to echo "closed" forever; and Guile is
	waiting for it to terminate, forever.

	I haven't fully debugged the SIGPIPE problem, but it sounds very like
	what Chet Ramey describes here:
	http://old.nabble.com/Re%3A-SIGPIPE-not-properly-reset-with-%27trap---PIPE%27-p20985595.html.

	(And my version of bash is 3.2.39.)

	So, a fix should be to use something other than shell to implement the
	child; and it appears that this works.

	* check-guile.in (TEST_SUITE_DIR): Export.

	* test-suite/tests/popen-child.scm: New script file.

	* test-suite/tests/popen.test ("open-output-pipe", "no duplicate"):
	  Use Guile for the child process, instead of shell.

2010-06-29  Andy Wingo  <wingo@pobox.com>

	fix repl level printing
	* module/system/repl/common.scm (repl-prompt): Fix repl level printing.

2010-06-29  Tristan Colgate  <tcolgate@gmail.com>

	Update #:procedure method for <applicable-struct>
	* modules/oop/goop.scm (initialize-object-procedure): Use slot-set!
	  instead of set-object-procedure!.

2010-06-28  Andy Wingo  <wingo@pobox.com>

	* module/srfi/srfi-60.scm (bit-count): #:replace core definition.

2010-06-26  Andy Wingo  <wingo@pobox.com>

	use *repl-stack* instead of *repl-level*
	* module/ice-9/boot-9.scm (*repl-stack*): Instead of repl-level, have a
	  stack.
	  (batch-mode?): Change to poke the stack.

	* module/ice-9/deprecated.scm (set-batch-mode?!): Update deprecation
	  method.

	* module/system/repl/common.scm (repl-prompt): Update to poke
	  *repl-stack* to get the level.

	* module/system/repl/repl.scm (start-repl): Bind *repl-stack*
	  appropriately.

2010-06-26  Andy Wingo  <wingo@pobox.com>

	tweak to ensure-batch-mode!
	* module/ice-9/boot-9.scm (ensure-batch-mode!): Fix to be correct
	  regarding dynamic extent (so far as this hack goes).

2010-06-26  Andy Wingo  <wingo@pobox.com>

	add repl inport and outport fields and accessors
	* module/system/repl/common.scm (<repl>): Add inport and outport fields
	  and accessors.
	  (make-repl): Add optional "debug" argument. Bind inport and outport to
	  the current inport and output ports at the time of repl creation.
	  (repl-read): Read from the repl inport.
	  (repl-print): Write to the repl outport.

	* module/system/repl/command.scm (read-datum, read-line, meta-command):
	  Respect repl-inport, and bind the outport of meta-commands to the repl
	  outport.

2010-06-26  Andy Wingo  <wingo@pobox.com>

	allow kwargs to repl metacommands
	* module/system/repl/command.scm (define-meta-command): Allow repl
	  meta-commands to have optional or keyword arguments.

2010-06-25  Thien-Thi Nguyen  <ttn@gnuvola.org>

	HACKING: Mention (add-hook 'before-save-hook 'delete-trailing-whitespace)
	* HACKING (Coding standards):
	Mention ‘(add-hook 'before-save-hook 'delete-trailing-whitespace)’.

2010-06-24  Julian Graham  <julian.graham@aya.yale.edu>

	Edits to R6RS standard libraries documentation proposed by Ludovic Courtès.
	* doc/ref/r6rs.texi: Fix erroneous usage of @pxref; add pointers from
	  `(rnrs conditions)' and `(rnrs arithmetic bitwise)' to SRFI-35 and
	  SRFI-60 sections; remove reference to `fold'.

2010-06-22  Andy Wingo  <wingo@pobox.com>

	top-repl out to its own module
	* module/ice-9/boot-9.scm:
	* module/ice-9/top-repl.scm: Move top-repl out here.

	* module/Makefile.am: Add new file.

	* module/ice-9/deprecated.scm (top-repl): Deprecated shim.

	* libguile/script.c (scm_compile_shell_switches): Invoke top-repl from
	  its new location.

2010-06-22  Andy Wingo  <wingo@pobox.com>

	simplify top-repl
	* module/ice-9/boot-9.scm (top-repl): Simplify.

	don't bother catching SIGSEGV et al in top-repl
	* module/ice-9/boot-9.scm (exit-hook): Move up with the other hooks.
	  (top-repl): Don't install handlers for SIGFPE, SIGILL, SIGSEGV, or
	  SIGBUS, as they will have no effect.

2010-06-22  Andy Wingo  <wingo@pobox.com>

	deprecate named-module-use!, load-emacs-interface, and remove --emacs
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (named-module-use!)
	  (load-emacs-interface): Deprecate these.

	* module/ice-9/gds-client.scm (run-utility): Redefine to not use
	  named-module-use!.

	* libguile/script.c (scm_shell_usage): Remove --emacs option.
	  (scm_compile_shell_switches): Remove support for --emacs.

	* module/ice-9/boot-9.scm (top-repl): Don't muck with --emacs.

	* doc/ref/scheme-scripts.texi (Invoking Guile): Remove note about
	  --emacs.

2010-06-22  Andy Wingo  <wingo@pobox.com>

	require-extension using syntax-case
	* module/ice-9/boot-9.scm (require-extension): Implement using
	  syntax-case.

	cond-expand in syntax-case
	* module/ice-9/boot-9.scm: Some spacing improvements.
	  (cond-expand): Reimplement in syntax-case.

	more aspiration in boot-9
	* module/ice-9/boot-9.scm: Spacing fixes for local-ref et al.

	begin-deprecated using syntax-case
	* module/ice-9/boot-9.scm (begin-deprecated): In terms of syntax-case.

2010-06-22  Julian Graham  <julian.graham@aya.yale.edu>

	Integrate complete R6RS standard libraries documentation.
	* doc/ref/r6rs.texi: Reshuffle Andy Wingo's introductory notes; add more
	  detailed @subsubsections for each library.

2010-06-21  Andy Wingo  <wingo@pobox.com>

	relax restriction on _ in literals
	* module/ice-9/psyntax.scm: Relax restriction on _ in literals.

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

2010-06-21  Andy Wingo  <wingo@pobox.com>

	fix matches? test
	* test-suite/tests/syntax.test (matches?): Unfortunately this relatively
	  recent macro fails due to the underscore-in-literals-list prohibition.
	  But, it seems I was in the minority wanting _ for a literal.

2010-06-21  Andy Wingo  <wingo@pobox.com>

	syntax-case treats _ as placeholder
	* module/ice-9/psyntax.scm (underscore?): New helper, like ellipsis?.
	  (syntax-case): Treat the _ pattern as a matches-all pattern,
	  disallowing it from the keyword list. Another well-thought part of the
	  R6RS.
	  ($sc-dispatch): Dispatch _ patterns.

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

	* test-suite/tests/syncase.test ("_ is a placeholder"): Add a test.

2010-06-21  Andy Wingo  <wingo@pobox.com>

	fix compilation with automake < 1.11
	* configure.ac: On automake < 1.11, define AM_DEFAULT_VERBOSITY so that
	  our custom silent rules work.

	freshly regenerate psyntax-pp
	* module/ice-9/psyntax-pp.scm: A fresh regen to get the lowest gensyms
	  we can. Needs a better solution in the end.

	fix rnrs duplicate bindings warnings
	* module/rnrs.scm: Fix i/o duplicate bindings warnings by excluding some
	  bindings.

2010-06-20  Andy Wingo  <wingo@pobox.com>

	rnrs modules #:replace as appropriate
	* module/ice-9/boot-9.scm (export!): New syntax, as export is to
	  module-export!, export! is to module-replace!. I thought that taking
	  up the name `replace' would be presumptuous, hence the name mismatch.

	* module/ice-9/r6rs-libraries.scm (library): Calculate not only
	  re-exports, but replacements as well.

2010-06-20  Andy Wingo  <wingo@pobox.com>

	ensure unicode-capable rnrs string ports
	* module/rnrs/io/ports.scm (open-string-input-port):
	  (open-string-output-port): Ensure that the ports are unicode-capable
	  by binding %default-port-encoding to "UTF-8".

2010-06-20  Ludovic Courtès  <ludo@gnu.org>

	Canonicalize source file names in `primitive-load-path' (fix bug #30170).
	* libguile/load.c (scm_primitive_load_path): Canonicalize
	  FULL_FILENAME.  Fixes bug #30170 ("Auto-compilation erroneously
	  recompiles dependencies").

2010-06-19  Andy Wingo  <wingo@pobox.com>

	repl compiles with warnings by default
	* module/system/repl/command.scm (compile): Remove the bitrotten
	  options.

	* module/system/repl/common.scm (repl-default-options): Add
	  'compile-options option.
	  (repl-compile-options): Accessor for compile-options.
	  (repl-compile): Use repl-compile-options.
	  (repl-eval): Adapt to repl-compile interface change.

2010-06-19  Andy Wingo  <wingo@pobox.com>

	scheme-mode in syntactic records test
	* test-suite/tests/r6rs-records-syntactic.test: Add -*- scheme -*-.

	typo in mutable-strings
	* module/rnrs/mutable-strings.scm: Fix typo.

	*unspecified* in rnrs exceptions
	* module/rnrs/exceptions.scm (rnrs): Import *unspecified*.

	don't unconditionally restore signals in ensure-batch-mode!
	* module/ice-9/boot-9.scm (ensure-batch-mode!): Remove comment about
	  restoring signals, and that behavior, as it was making popen.test
	  hang. I should investigate further, but instead I'm just going to hope
	  that this fixes it.

2010-06-19  Andreas Rottmann  <a.rottmann@gmx.at>

	Fix SRFI-9 for records without fields
	* module/srfi/srfi-9.scm (define-record-type): Deal with fieldless records.
	* test-suite/tests/srfi-9.test: Add a fieldless record definition.

	Ignore the SRFI name component(s) in R6RS imports
	* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface): To avoid having to
	  create alias libraries for all the SRFIs, we simply ignore the name
	  components, so (srfi :n foo bar) will resolve to (srfi :n).

	ice-9 receive without define-macro
	* module/ice-9/receive.scm: Replace define-macro usage with syntax-rules.

	add rnrs unicode to the compound rnrs module
	* module/rnrs.scm: import rnrs unicode and export all of its procedures.

2010-06-19  Andy Wingo  <wingo@pobox.com>

	fix ^L typo
	* module/rnrs/mutable-pairs.scm: Fix ^L typo.

2010-06-19  Andy Wingo  <wingo@pobox.com>

	set! name (lambda ...) names the lambda
	* module/ice-9/psyntax.scm (build-lexical-assignment)
	  (build-global-assignment): Maybe name the RHS.

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

	* module/ice-9/boot-9.scm (catch, with-throw-handler, throw): Rework to
	  use set! instead of define! so that we get names.

2010-06-19  Andy Wingo  <wingo@pobox.com>

	deprecate the-last-stack
	* libguile/backtrace.h (scm_the_last_stack_fluid_var)
	* libguile/backtrace.c (scm_init_backtrace): No more
	  scm_the_last_stack_fluid_var. The replacement is to resolve
	  `the-last-stack' in (ice-9 stack-catch).
	  (scm_backtrace_with_highlights): Accordingly, instead of backtracing
	  the last stack, backtrace the current stack.

	* libguile/throw.h:
	* libguile/throw.c:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_internal_stack_catch): Deprecate this
	  function.

	* module/ice-9/save-stack.scm (the-last-stack): Move here from boot-9.

	* module/ice-9/debug.scm:
	* module/ice-9/debugger.scm: Use (ice-9 save-stack) for the-last-stack.

	* module/ice-9/deprecated.scm (the-last-stack): Add deprecated shim.

2010-06-19  Andy Wingo  <wingo@pobox.com>

	don't bind the-last-stack in repl.scm
	* module/system/repl/repl.scm (start-repl): Don't bind the-last-stack.

	no the-last-stack in ice-9 threads
	* module/ice-9/threads.scm (thread-handler): Don't muck with
	  the-last-stack.

	remove the-last-stack from boot-9
	* module/ice-9/boot-9.scm (false-if-exception): Use syntax-rules. Don't
	  muck with the-last-stack, it is going away. Remove a later comment
	  about the-last-stack.

2010-06-19  Andy Wingo  <wingo@pobox.com>

	deprecate save-stack, stack-saved?
	* module/Makefile.am:
	* module/ice-9/boot-9.scm:
	* module/ice-9/save-stack.scm (stack-saved?, save-stack): Move these
	  bindings to their own module.

	* module/oop/goops.scm (goops-error):
	* module/ice-9/boot-9.scm (error, top-repl): Remove calls to save-stack.

	* module/ice-9/deprecated.scm (stack-saved?, save-stack): Add deprecated
	  shims.

	* module/ice-9/emacs.scm:
	* module/ice-9/stack-catch.scm:
	* module/ice-9/debugger/command-loop.scm:
	* module/ice-9/scm-style-repl.scm: Import (ice-9 save-stack).

2010-06-19  Andy Wingo  <wingo@pobox.com>

	add support for variable transformers: settable identifier syntax
	* module/ice-9/psyntax.scm (set!): Handle variable transformers; though,
	  they cannot produce definitions.
	  (make-variable-transformer): New procedure.
	  (identifier-syntax): Allow the R6RS form that makes variable
	  transformers.

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

	* doc/ref/r6rs.texi (R6RS Incompatibilities): Remove letrec* item, and
	  add set! restriction.

2010-06-19  Andy Wingo  <wingo@pobox.com>

	handle-system-error to scm-style-repl
	* module/ice-9/boot-9.scm:
	* module/ice-9/scm-style-repl.scm (handle-system-error): Move here from
	  boot-9.

	* module/ice-9/deprecated.scm (handle-system-error): Keep a deprecated
	  wrapper in the root environment.

2010-06-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Use UTC, precise format for ‘buildstamp’ value.
	* libguile/Makefile.am (libpath.h): For ‘buildstamp’,
	  specify date(1) output format precisely, and in UTC.
	* doc/ref/api-options.texi (Build Config): Update ‘buildstamp’ doc.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	add open-string-{input,output}-port to rnrs io ports
	* module/rnrs/io/ports.scm (open-string-input-port)
	  (open-string-output-port): New procedures.

	* module/rnrs.scm (rnrs): Export the new (rnrs io ports) procedures.

2010-06-18  Julian Graham  <julian.graham@aya.yale.edu>

	Fix `define-condition-type' to use condition-accessors, not record accessors.
	* module/rnrs/conditions.scm (define-condition-type): The generated
	  accessors should be condition accessors, which know how to unpack a
	  compound condition; these can then delegate to the appropriate record
	  accessors.
	* test-suite/tests/r6rs-conditions.test: New test case to verify above.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	`(debug)' debugs the current stack.
	* module/system/vm/debug.scm (debug): Change to debug the current stack
	  instead of the last stack.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	remove before-signal-stack
	* module/ice-9/boot-9.scm (before-signal-stack): Remove. We're moving
	  away from using the-last-stack, so this backup copy is not much use.
	  (top-repl): Don't bother saving a before-signal-stack.

	* module/ice-9/debugger/command-loop.scm (debugger-handler): No need to
	  restore here either.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	has-shown-debugger-hint? to scm-style-repl
	* module/ice-9/boot-9.scm:
	* module/ice-9/scm-style-repl.scm (has-shown-debugger-hint?): Move to
	  scm-style-repl.

	reorder hooks in boot-9
	* module/ice-9/boot-9.scm: Reorder hooks.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	default-pre-unwind-handler to scm-style-repl
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (default-pre-unwind-handler): Deprecate
	  root-module definition.

	* module/ice-9/scm-style-repl.scm (default-pre-unwind-handler): Move
	  here.

	* module/ice-9/debugging/traps.scm:
	* module/ice-9/debugger.scm:
	* module/ice-9/stack-catch.scm: Use default-pre-unwind-handler from
	  scm-style-repl.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	finish deprecating pre-unwind-handler-dispatch
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (pre-unwind-handler-dispatch): Properly
	  deprecate.

	* module/ice-9/debugger.scm (debug-on-error):
	* module/ice-9/debugging/traps.scm (on-pre-unwind-handler-dispatch):
	  Update remaining pre-unwind-handler-dispatch uses.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	deprecate `repl'
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (repl): Deprecate.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	batch-mode? in terms of *repl-level*
	* module/ice-9/boot-9.scm (*repl-level*): New global fluid, moved here
	  from (system repl common).
	  (batch-mode?): Reimplement in terms of *repl-level*.
	  (ensure-batch-mode!): A replacement for set-batch-mode?!.

	* module/ice-9/deprecated.scm (set-batch-mode?!): Deprecate.

	* module/ice-9/popen.scm (open-process): Use ensure-batch-mode!.

	* module/ice-9/scm-style-repl.scm (error-catching-loop): Override
	  ensure-batch-mode!.

	* module/system/repl/common.scm: Remove *repl-level*.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	*unspecified* is identifier syntax
	* module/ice-9/boot-9.scm (*unspecified*): Define using
	  identifier-syntax. Should also prevent it from being set!.
	  (unspecified?): Move up.

	repl whitespace fix
	* module/system/repl/repl.scm: Fix whitespace.

	deprecate set-repl-prompt!
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (set-repl-prompt!): Deprecate, but wrap
	  the (system repl common) implementation instead of the scm-style-repl.

	add repl-default-option-set! in (system repl common)
	* module/system/repl/common.scm (repl-default-option-set!): New
	  interface.
	  (repl-default-prompt-set!): New procedure, sets the 'prompt property
	  in the default env.
	  (repl-prompt): Use the 'prompt repl option if available.

2010-06-18  Andy Wingo  <wingo@pobox.com>

	assert-repl-* and associated state variables to scm-style-repl
	* module/ice-9/boot-9.scm:
	* module/ice-9/scm-style-repl.scm (scm-repl-silent, assert-repl-silence)
	  (scm-repl-print-unspecified, assert-repl-print-unspecified)
	  (scm-repl-verbose, assert-repl-verbosity)
	  (scm-repl-prompt): Move these definitions here from boot-9.scm.

	* module/ice-9/deprecated.scm (assert-repl-silence):
	  (assert-repl-print-unspecified, assert-repl-verbosity): Deprecated
	  wrappers for the functions. I'm not sure if the variables can be
	  helped though.

2010-06-18  No Itisnt  <theseaisinhere+git@gmail.com>

	Use AM_SILENT_RULES to pare down build output, ignore auto-generated files
	* .gitignore: Ignore extra gnulib headers.
	* am/snarf: Silent SNARF command
	* am/guilec: Silent GUILEC command
	* configure.ac: Use AM_SILENT_RULES when available
	* guile-readline/Makefile.am:
	* libguile/Makefile.am:
	* srfi/Makefile.am:
	* test-suite/standalone/Makefile.am: Silence snarf output

2010-06-17  U-Cain\Mike  <Mike@Cain.(none)>

	DAY_1 nl_langinfo constants don't require <nl_types.h>
	There is an incorrect conditional compilation requirement that
	<nl_types.h> be present for DAY_1 to be defined.  This doesn't
	agree with the LSB and causes make check to fail on Cygwin.

	* libguile/i18n.c [HAVE_NL_TYPES_H]: modify conditional compilatiion

2010-06-17  Andy Wingo  <wingo@pobox.com>

	build psyntax-pp.go from psyntax.scm
	* module/Makefile.am (ice-9/psyntax-pp.go): Build from psyntax.scm, so
	  we get proper debugging information and variable names.

2010-06-17  Andy Wingo  <wingo@pobox.com>

	fix order of internal definitions
	* module/ice-9/psyntax.scm (chi-body): Whoops, actually render internal
	  definitions into a letrec* in the right order.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	* test-suite/tests/syntax.test: Add some letrec* tests.

2010-06-17  Andy Wingo  <wingo@pobox.com>

	compile-psyntax "optimizes" psyntax-pp
	* module/ice-9/compile-psyntax.scm (source): "Optimize" psyntax-pp
	  before writing it out.

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

2010-06-17  Andy Wingo  <wingo@pobox.com>

	tree-il->scheme renders fix as letrec*
	* module/language/tree-il.scm (tree-il->scheme): Expand out to letrec*,
	  as it doesn't matter, and this avoids a let when running through the
	  evaluator.

2010-06-17  Andy Wingo  <wingo@pobox.com>

	resolve-primitives tweaks
	* module/ice-9/boot-9.scm (make-struct/no-tail): Define a version of
	  this function. Because during optimization we resolve make-struct to
	  make-struct/no-tail, we need an implemented make-struct/no-tail if we
	  are to be able to run scheme made from tree-il->scheme.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Remove
	  variable-set case, as there is no "variable-set!" primitive.
	  (flatten): Add a special hack for variable-set!. Ugly, I know.

	* module/language/tree-il/primitives.scm (*effect-free-primitives*): Add
	  make-struct/no-tail.
	  (*effect+exception-free-primitives*): Remove make-struct, as it could
	  raise an exception.
	  (variable-set!): Remove expansion to variable-set.

2010-06-17  Andy Wingo  <wingo@pobox.com>

	internal definitions expand out to letrec* instead of letrec
	* module/ice-9/psyntax.scm (chi-body): Internal definitions are now
	  letrec* instead of letrec, following the R6RS.

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

2010-06-17  Andy Wingo  <wingo@pobox.com>

	compiler support for letrec*
	* test-suite/tests/tree-il.test ("letrec"): Add some tests.
	* module/language/tree-il/compile-glil.scm (flatten): Add support for
	  compiling letrec* in its unoptimized form.

	* module/language/tree-il/fix-letrec.scm (simple-expression?):
	  Parameterize, so that letrec* will not treat `(car x)' as primitive
	  (because it could raise an exception).
	  (partition-vars): Lump unreferenced vars in with complex vars, when
	  compiling letrec*.
	  (fix-letrec!): No need to evaluate inits within a let for letrec*.

2010-06-17  Andy Wingo  <wingo@pobox.com>

	add effect+exception-free-primitive? predicate
	* module/language/tree-il/primitives.scm
	  (effect+exception-free-primitive?): New predicate, like
	  effect-free-primitive?, but excludes accessors that could raise
	  exceptions.

2010-06-17  Andy Wingo  <wingo@pobox.com>

	psyntax, primitive expander, and memoizer support for letrec*
	* libguile/expand.c (expand_letrec_helper): Factor out common code.
	  (expand_letrec): Use expand_letrec_helper.
	  (expand_letrec_star): New primitive syntax: letrec*.

	* libguile/memoize.c (memoize): Add memoizer support for in-order letrec
	  (letrec*).

	* module/ice-9/psyntax.scm (build-letrec): Another arg, `in-order?'.
	  (chi-body): Adapt to build-letrec change. We don't yet use letrec* for
	  internal definitions.
	  (letrec): Adapt to build-letrec change.
	  (letrec*): New expander.

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

2010-06-17  Andy Wingo  <wingo@pobox.com>

	beginnings of letrec* support in the expander
	* libguile/expand.h (SCM_EXPANDED_LETREC_IN_ORDER_P)
	  (SCM_MAKE_EXPANDED_LETREC): Add a new field to letrec, in-order?. Will
	  be used to support letrec*.

	* libguile/expand.c (LETREC, expand_named_let, expand_letrec): Adapt
	  code.

	* module/language/elisp/compile-tree-il.scm (compile-pair):
	* module/ice-9/psyntax.scm (build-named-let, build-letrec): Pass #f for
	  in-order? to `make-letrec'.

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

	* module/language/tree-il.scm: Add letrec-in-order? accessor.
	  (parse-tree-il, unparse-tree-il): Parse and unparse an in-order?
	  letrec as `letrec*'.
	  (tree-il->scheme): Serialize letrec*.

2010-06-17  Andy Wingo  <wingo@pobox.com>

	fix bug in memoize
	* libguile/memoize.c (memoize): Fix a bug where LETREC was being
	  accessed as LET, and it just happened to coincide.

2010-06-17  Ludovic Courtès  <ludo@gnu.org>

	Remove outdated sponsorship info from `THANKS'.

	Update `THANKS'.

2010-06-17  Ludovic Courtès  <ludo@gnu.org>

	Use Alex Shinn's pattern matcher for (ice-9 match).
	* module/ice-9/match.scm: Rewrite to simply load `match.upstream.scm'.

	* module/ice-9/match.upstream.scm: New file.

	* module/Makefile.am (NOCOMP_SOURCES): Add `ice-9/match.upstream.scm'.

	* test-suite/Makefile.am (SCM_TESTS): Add `tests/match.test'.

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

2010-06-16  Andy Wingo  <wingo@pobox.com>

	remove encoding of versions into the file system (for now?)
	* module/ice-9/boot-9.scm (find-versioned-module): Remove. Still had
	  some bugs (e.g. for "." in the path and in finding compiled files),
	  did too much computation and statting, and we don't really want to
	  promote versioning. Nor do we want to hard-code a particular encoding
	  of versions in the file-system. Perhaps the real way to do this is to
	  be extensible somehow.
	  (try-module-autoload): Just dispatch to primitive-load-path in all cases.

	* module/rnrs
	* module/rnrs.scm:
	* module/rnrs/arithmetic/bitwise.scm:
	* module/rnrs/arithmetic/fixnums.scm:
	* module/rnrs/arithmetic/flonums.scm:
	* module/rnrs/base.scm:
	* module/rnrs/conditions.scm:
	* module/rnrs/control.scm:
	* module/rnrs/enums.scm:
	* module/rnrs/eval.scm:
	* module/rnrs/exceptions.scm:
	* module/rnrs/files.scm:
	* module/rnrs/hashtables.scm:
	* module/rnrs/io/simple.scm:
	* module/rnrs/lists.scm:
	* module/rnrs/mutable-pairs.scm:
	* module/rnrs/mutable-strings.scm:
	* module/rnrs/programs.scm:
	* module/rnrs/r5rs.scm:
	* module/rnrs/records/inspection.scm:
	* module/rnrs/records/procedural.scm:
	* module/rnrs/records/syntactic.scm:
	* module/rnrs/sorting.scm:
	* module/rnrs/syntax-case.scm:
	* module/rnrs/unicode.scm: Move these files, eliding the "6/" infix, so
	  that they are in the normal (unversioned) module path.

2010-06-16  Andy Wingo  <wingo@pobox.com>

	set module version in module-export-all!
	* module/ice-9/boot-9.scm (module-export-all!): Set the interface
	  version as well.

	load modules from within a known environment
	* module/ice-9/boot-9.scm (try-module-autoload): Init the module
	  excursion with a fresh user module.

2010-06-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[maint] Add configure.ac abstraction: GUILE_CONFIG_SCRIPT
	* configure.ac (GUILE_CONFIG_SCRIPT): New ‘AC_DEFUN’; use it for:
	check-guile, benchmark-guile, meta/guile, meta/uninstalled-env,
	meta/gdb-uninstalled-guile, meta/guile-tools, libguile/guile-snarf,
	libguile/guile-doc-snarf, libguile/guile-func-name-check,
	libguile/guile-snarf-docs test-suite/standalone/test-use-srfi,
	test-suite/standalone/test-fast-slot-ref.

	Init shell var properly in git-version-gen.
	* build-aux/git-version-gen: Ensure shell var
	is not influenced by an env var of the same name.

2010-06-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Add tmpfile(3) to libguile.
	* libguile/posix.c (scm_tmpfile): New primitive.
	* libguile/posix.h (scm_tmpfile): New func decl.

	* doc/ref/posix.texi (File System): Document `tmpfile'.

2010-06-14  Andy Wingo  <wingo@pobox.com>

	fix bug in collect
	* module/ice-9/deprecated.scm (collect): Fix bug.

2010-06-13  Andy Wingo  <wingo@pobox.com>

	attempted microoptimization in eval.scm.
	* module/ice-9/eval.scm (primitive-eval): Try using list-ref instead of
	  cdring in the vm. We'll check the hydra build times to see if this has
	  any actual merit. Surely the best solution is another representation
	  of environments, though.

2010-06-11  Andy Wingo  <wingo@pobox.com>

	compile (ice-9 deprecated) earlier
	* module/Makefile.am (ICE_9_SOURCES): Reorder placement of (ice-9
	  deprecated), as it's getting bigger, so we should compile it earlier.

	handler of a prompt is in tail context
	* module/language/tree-il/analyze.scm (analyze-lexicals): The handler of
	  a prompt is in tail context.

2010-06-11  Andy Wingo  <wingo@pobox.com>

	while in terms of syntax-case
	* module/ice-9/boot-9.scm (while): Reimplement in terms of syntax-case.
	  Prompt inlining is coming later.

	* test-suite/tests/syntax.test ("while"): Update the expected syntax
	  errors.

2010-06-11  Andy Wingo  <wingo@pobox.com>

	comment in fix-letrec
	* module/language/tree-il/fix-letrec.scm (simple-expression?): Add a
	  small FIXME.

	fix lexical call naming bug
	* module/ice-9/psyntax.scm: Fix bug in which the whole syntax object was
	  being recorded as the name of the operator in a lexical call, instead
	  of just the symbolic name.
	* module/ice-9/psyntax-pp.scm: Regenerated.

	unparse the tag of a prompt
	* module/language/tree-il.scm (unparse-tree-il): Properly unparse the
	  tag of a prompt.

	make-prompt-tag is an effect-free primitive
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*, *effect-free-primitives*): Recognize
	  make-prompt-tag as interesting and effect-free.

2010-06-11  Andy Wingo  <wingo@pobox.com>

	add inliner cases for conditionals
	* module/language/tree-il/inline.scm (boolean-value, inline!): Add a
	  case for inlining conditional expressions.

	* test-suite/tests/tree-il.test: Fix conditional tests to have a
	  non-inlinable condition.

2010-06-11  Andy Wingo  <wingo@pobox.com>

	deprecate `collect'
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (collect): Deprecate, and fix to ensure
	  sequential collection.

	define-option-interface in terms of syntax-rules
	* module/ice-9/boot-9.scm (define-option-interface): Rewrite using
	  syntax-rules.

	a failed resolve-interface does not leave behind an empty module
	* module/ice-9/boot-9.scm (resolve-interface): Pass #:ensure #f to
	  resolve-module, so that in the case of module-not-found we don't leave
	  behind an empty module without an interface.

	cleanups to version-matches?
	* module/ice-9/boot-9.scm (version-matches?): Some cleanups: use
	  and-map, or-map; prefer case to cond; abbreviate and scope helper
	  functions.

	deprecate get-option, for-next-option, display-usage-report, transform-usage-lambda
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (get-option, for-next-option)
	  (display-usage-report, transform-usage-lambda): Deprecate these
	  option-parsing utils. We can revive them in a non-deprecated module if
	  there is interest, but I suspect there will be no interest.

	deprecate `scheme-file-suffix'
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (scheme-file-suffix): Deprecate.

	comments in boot-9
	* module/ice-9/boot-9.scm: Add comments.

2010-06-11  Andy Wingo  <wingo@pobox.com>

	deprecate `bad-throw'
	* module/ice-9/boot-9.scm:
	* module/ice-9/scm-style-repl.scm (bad-throw): Move here. This function
	  was never documented, but has been around since guile-ii. It's not
	  used with current code though.

	* module/ice-9/deprecated.scm: Provide bad-throw in default env.

	* module/ice-9/debugger/commands.scm: Import bad-throw from
	  scm-style-repl.

2010-06-11  Andy Wingo  <wingo@pobox.com>

	error in terms of case-lambda
	* module/ice-9/boot-9.scm (error): Redefine using case-lambda.

2010-06-11  Andy Wingo  <wingo@pobox.com>

	deprecate has-suffix?
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (has-suffix?): Deprecate.

	* test-suite/guile-test:
	* benchmark-suite/guile-benchmark: Fix uses of deprecated has-suffix?.

2010-06-11  Andy Wingo  <wingo@pobox.com>

	comments in boot-9
	* module/ice-9/boot-9.scm: Add some comments about the nature of
	  properties.

2010-06-10  Andy Wingo  <wingo@pobox.com>

	deprecate apply-to-args
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (apply-to-args): Deprecate.

	remove annotation?
	* module/ice-9/boot-9.scm (annotation?): Remove unused new definition.

2010-06-10  Andy Wingo  <wingo@pobox.com>

	scm-style-repl -> (ice-9 scm-style-repl)
	* module/Makefile.am:
	* module/ice-9/scm-style-repl.scm: New file, to hold the old
	  scm-style-repl.

	* module/ice-9/deprecated.scm: Provide scm-style-repl and
	  error-catching-loop and error-catching-repl in the default env, but
	  with deprecation warnings.

2010-06-10  Andy Wingo  <wingo@pobox.com>

	resolve-module #:ensure argument
	* module/ice-9/boot-9.scm (resolve-module): Add #:ensure kwarg,
	  defaulting to true. If true we make an empty module if none was found
	  (the old behavior). Otherwise we return false.

	* test-suite/tests/modules.test ("resolve-module"): Add tests for old
	  and new behavior.

2010-06-10  Andy Wingo  <wingo@pobox.com>

	expt / integer-expt fixes
	* libguile/numbers.c (scm_integer_expt): Validate the first arg as a
	  number.
	  (scm_expt): Delegate to scm_integer_expt iff x is exact. Fixes
	  fractions.test, which I broke recently

	* test-suite/tests/numbers.test ("integer-expt"): Add test for
	  (integer-expt #t 0).

2010-06-10  Andy Wingo  <wingo@pobox.com>

	Fix build bug, manifested as failure to find libguile-srfi-srfi-1-v-4
	* module/ice-9/boot-9.scm (top-repl): This use of @ is not safe, because
	  it will cause (system repl repl) to be loaded at expand time, which
	  will eventually cause (srfi srfi-1) to be loaded, which won't work
	  with a fresh build tree because the helper lib isn't compiled. Gross.
	  (load): Add a note about why this use of @ is safe.

	brown-paper-bag to uninstalled-env
	* meta/uninstalled-env.in: Fix lack of test.

	more uninstalled-env fixen
	* meta/uninstalled-env.in: Don't implicitly add . to LTDL
	  search paths if no LTDL_LIBRARY_PATH was set. Avoid a duplicate to
	  PATH.

	uninstalled-env cleanups
	* meta/uninstalled-env.in: Clean up setting of GUILE_LOAD_PATH and
	  GUILE_LOAD_COMPILED_PATH.

	don't forget to set GUILE_SYSTEM_PATH in uninstalled mode
	* meta/uninstalled-env.in (GUILE_SYSTEM_PATH): Set this var too in
	  uninstalled mode.

	deprecate error-catching-loop, error-catching-repl
	* module/ice-9/deprecated.scm (error-catching-loop)
	  (error-catching-repl): Deprecate.

	remove commented-out code from boot-9
	* module/ice-9/boot-9.scm: Remove commented-out code.

	deprecate scm-style-repl
	* module/ice-9/deprecated.scm (scm-style-repl): Deprecate.

	fix error handling when reading debugger args
	* module/system/vm/debug.scm (debugger-repl): Errors reading debugger
	  args no longer drop us out of the debugger.

	bind debugging i/o ports in start-repl
	* module/system/repl/repl.scm (start-repl): If the debugging ports are
	  unbound, bind them to the current i/o ports. Allows errors within
	  with-output-to-foo / with-input-from-foo to be sensibly debugged.

2010-06-10  Andy Wingo  <wingo@pobox.com>

	repl.scm simplifications
	* module/system/repl/repl.scm (prompting-meta-read): Use
	  call-with-error-handling.

	* module/system/vm/debug.scm (call-with-error-handling): Add case for
	  #:on-error 'pass. Have the catch handler return the unspecified value.

2010-06-10  Andy Wingo  <wingo@pobox.com>

	start cleaning up repl/debugger error handling
	* module/system/repl/repl.scm (prompting-meta-read): Catch and print
	  read errors here, returning unspecified in that case.
	  (start-repl): Don't enable the debugger while reading expressions.
	  Adapt with-backtrace to with-error-handling.

	* module/system/vm/debug.scm (run-debugger, debugger-repl): No need to
	  take a stack, the frames vector is sufficient.
	  (call-with-error-handling, with-error-handling): New public utilities.
	  Notably they do not poke the-last-stack.

2010-06-10  Andy Wingo  <wingo@pobox.com>

	hygienic with-backtrace
	* module/system/repl/repl.scm (with-backtrace): Make a syntax-rules
	  macro.

2010-06-10  Julian Graham  <julian.graham@aya.yale.edu>

	Resolve issues in `find-versioned-module'.
	* module/ice-9/boot-9.scm (find-versioned-module): Perform a stable sort on
	  version numbers of matched libraries; eliminate extra path separator in
	  library file path.

2010-06-09  Andy Wingo  <wingo@pobox.com>

	fix build error with Compaq C V6.3-025
	* libguile/hashtab.c: Re-arrange functions to avoid the need for
	  pre-declaring character arrays with no length. Fixes compilation on
	  Compaq C V6.3-025. Thanks to Jay Krell for the report.

2010-06-09  Andy Wingo  <wingo@pobox.com>

	r6rs `import' accepts multiple clauses
	* module/ice-9/r6rs-libraries.scm (import): Accept multiple clauses.

	* test-suite/tests/rnrs-libraries.test: Add test.

2010-06-07  Andy Wingo  <wingo@pobox.com>

	fix (expt #t 0)
	* libguile/numbers.c (scm_expt): Fix check regarding when to dispatch to
	  integer-expt.

	* test-suite/tests/numbers.test ("expt"): Add test.

2010-06-07  Andy Wingo  <wingo@pobox.com>

	modules have field for their filenames, for debugging
	* module/ice-9/boot-9.scm (module-filename, set-module-filename!): Add a
	  new field to modules, the filename that is associated with the module.
	  For debugging purposes.
	  (process-define-module): Parse out a #:filename argument.
	  (make-module, make-autoload-interface): Adapt to module-constructor
	  change.
	  (define-module): Init module-filename from (current-source-location).

2010-06-06  Andy Wingo  <wingo@pobox.com>

	add current-source-location
	* module/ice-9/boot-9.scm (current-source-location): New macro, returns
	  the, um, current source location.

	add syntax-source accessor
	* module/ice-9/psyntax.scm: Add syntax-source accessor.
	* module/ice-9/psyntax-pp.scm: Regenerated.
	* module/ice-9/boot-9.scm: Declare syntax-source.

	srfi-34 #:replace raise fix
	* module/srfi/srfi-34.scm: #:replace the binding for `raise'

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

	Add tests for `program-sources' (bug #29817).
	* test-suite/tests/compiler.test ("program-sources"): New test prefix.

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

	Don't build any generated source file at "make dist" time.
	* srfi/Makefile.am
	  (libguile_srfi_srfi_1_v_@LIBGUILE_SRFI_SRFI_1_MAJOR@_la_SOURCES,
	  libguile_srfi_srfi_4_v_@LIBGUILE_SRFI_SRFI_4_MAJOR@_la_SOURCES,
	  libguile_srfi_srfi_13_14_v_@LIBGUILE_SRFI_SRFI_13_14_MAJOR@_la_SOURCES,
	  libguile_srfi_srfi_60_v_@LIBGUILE_SRFI_SRFI_60_MAJOR@_la_SOURCES):
	  Remove `.x' files so that they're not built by "make dist".

	* test-suite/standalone/Makefile.am (libtest_asmobs_la_SOURCES): Remove
	  `test-asmobs-lib.x'.
	  (libtest_ffi_la_SOURCES): Remove `test-ffi-lib.x'.
	  (BUILT_SOURCES): Likewise.

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

	Add tests for `procedure-name'.
	This is a followup to 22cf27c815b756cac6893b5b239898767e6cb498 ("fix
	procedure naming").

	* test-suite/tests/compiler.test ("procedure-name"): New test prefix.

2010-06-06  Andy Wingo  <wingo@pobox.com>

	fix `format' with %f and exact rationals
	* module/ice-9/format.scm (format:parse-float): Accept a number, and
	  when stringifying the number, first convert to inexact.

	* test-suite/tests/format.test ("~f fixed-point"): Add exact rational
	  test.

2010-06-06  Andy Wingo  <wingo@pobox.com>

	simplify macro representation in the wake of module hygiene changes
	* module/ice-9/psyntax.scm (chi-install-global, chi-macro)
	  (eval-local-transformer): Now that we handle module hygiene through
	  syntax objects, there is no more need to record the current module
	  when installing syntax transformers.

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

	* libguile/_scm.h: Bump objcode version for macro representation change.

	* libguile/macros.c (scm_macro_transformer): Adapt to change in macro
	  representation.

2010-06-06  Andy Wingo  <wingo@pobox.com>

	fix module-hygiene corner case by relying more on syntax objects
	* module/ice-9/psyntax.scm (chi-macro): Instead of assuming that output
	  of a macro should be scoped relative to the module that was current
	  when the macro was defined, allow the module information associated
	  with the syntax object itself to pass through unmolested. Fixes bug
	  29860.
	  (datum->syntax): Propagate the module of the identifier through to the
	  new syntax object, so that datum->syntax preserves module hygiene in
	  addition to lexical hygiene.
	  (include, include-from-path): Refactor to plumb though the hygiene
	  information from the filename instead of the `include', allowing
	  hygiene from the original caller of include-from-path to propagate
	  through.

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

	* test-suite/tests/syncase.test ("macro-generating macro"): Add test for
	  bug 29860.

2010-06-05  Andy Wingo  <wingo@pobox.com>

	source location propagation fixes in psyntax
	* module/ice-9/psyntax.scm (syntax-type): Add some comments about source
	  locations. In calls to chi-macro, pass the source location
	  information. Propagate source location information when unpacking
	  syntax objects.
	  (chi-macro): Add a comment about source locations. Decorate output
	  introduced by the macro with the source location of macro use.

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

	Fixes bug #29817.

2010-06-05  Ludovic Courtès  <ludo@gnu.org>

	Update `.gitignore' for new Gnulib-generated files.

	Update Gnulib to v0.0-3966-g9f737c8 for `libunistring' m4 fixes.

2010-06-02  Andy Wingo  <wingo@pobox.com>

	brown-paper-bag commit
	* module/system/vm/debug.scm (frame->module): In which our author
	  misunderstands git's index.

	flesh out recursive repl module with local vars
	* module/system/vm/debug.scm (frame->module): Actually bind frame-local
	  variables to values in the new anonymous module. Setting settable vars
	  should work too :)

2010-06-02  Andy Wingo  <wingo@pobox.com>

	recursive repl support
	* module/system/repl/common.scm (*repl-level*): New public fluid.
	  (repl-prompt): If *repl-level* is a positive integer, add it to the
	  prompt.

	* module/system/repl/repl.scm (start-repl): The `lang' argument is now
	  optional, and defaults to (current-language). New kwargs level and
	  welcome; level defaults to 0, or 1+ the existing level, and the
	  welcome is a boolean, true if level is 0. Parameterize *repl-level*
	  during the dynamic extent of this repl. Also, parameterize
	  the-last-stack to #f for the duration of this repl.

	* module/system/vm/debug.scm (frame->module, debugger-repl): Stubs of a
	  recursive repl implementation. The idea is to be a repl in the lexical
	  context of the error; but it would be nice to be able to operate in
	  the module of the proc too, for example to export bindings. Hmm.

2010-06-02  Andy Wingo  <wingo@pobox.com>

	current-language fluid refactoring
	* module/system/base/compile.scm:
	* module/system/base/language.scm (*current-language*, current-language):
	  Move this fluid and thunk down to (system base language).

	boot-9 top-repl tweak
	* module/ice-9/boot-9.scm (top-repl): More concisely drill down to
	  start-repl.

2010-06-02  Andy Wingo  <wingo@pobox.com>

	some repl doc updates
	* doc/ref/tour.texi (Reporting Bugs): Update instructions for generating
	  a backtrace.

	* doc/ref/scheme-using.texi: Update examples of Guile prompts, and add
	  an explanation of the prompt format.

2010-06-02  Andy Wingo  <wingo@pobox.com>

	minor NEWS tweaks
	* NEWS: Fix wordings.

2010-06-02  Andy Wingo  <wingo@pobox.com>

	add #:version (6) to rnrs bytevectors and ports
	* module/rnrs/bytevectors.scm:
	* module/rnrs/io/ports.scm: Add #:version (6) to these modules.

	* module/6/rnrs.scm: Add versions to the import specs for bytevectors
	  and ports.

2010-06-02  Andy Wingo  <wingo@pobox.com>

	fix argument tab-completion
	* guile-readline/readline.c (scm_init_readline): Space is a
	  word-breaking char too. Fixes tab-completion for args; thanks to Jao
	  for the patch!

2010-06-02  Andy Wingo  <wingo@pobox.com>

	fix procedure naming
	* module/ice-9/psyntax.scm (define-expansion-accessors): New helper, to
	  define accesors for a particular expansion data structure. Use it
	  later to define lambda?, lambda-meta, and set-lambda-meta!.
	  (maybe-name-value): Update to work with the newly defined accessors.
	  (build-global-reference, build-let, build-named-let, build-letrec):
	  Re-enable naming of procedures.

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

2010-06-01  Ludovic Courtès  <ludo@gnu.org>

	Fix `git-version-gen' sed script.
	* cfg.mk (git-version-gen-tag-sed-script): Remove trailing dash in
	  regexp.

	* configure.ac: Likewise in the second argument to `AC_INIT'.

2010-06-01  Ludovic Courtès  <ludo@gnu.org>

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

	Make `@' visible in the sxml-match documentation.
	* doc/ref/sxml-match.texi (sxml-match): Quote `@' in the examples.

	Remove unused symbols.
	* libguile/debug.c (scm_sym_procname, scm_sym_dots): Remove.

2010-06-01  Andy Wingo  <wingo@pobox.com>

	NEWS is ready
	* NEWS: Finalize.

	remove docs for removed procedures
	* doc/ref/api-procedures.texi (Compiled Procedures): Remove docs for
	  removed procedures.

	more NEWS
	* NEWS: More updates.

	small NEWS updates
	* NEWS: Some updates.

2010-06-01  Andy Wingo  <wingo@pobox.com>

	r6rs docs in the manual
	* doc/ref/r6rs.texi (R6RS Support): Skeleton of docs on our R6RS
	  support.

	* doc/ref/guile.texi:
	* doc/ref/Makefile.am: Add r6rs.texi.

	* doc/ref/intro.texi: Add a link to r6rs.texi.

2010-06-01  Andy Wingo  <wingo@pobox.com>

	(rnrs bytevectors) fallout
	* module/Makefile.am (RNRS_SOURCES): Fix for (rnrs bytevectors) rename.

2010-06-01  Andy Wingo  <wingo@pobox.com>

	rename (rnrs bytevector) to (rnrs bytevectors)
	* module/rnrs/bytevectors.scm: Rename to (rnrs bytevectors), from (rnrs
	  bytevector), to match the name from the R6RS.

	* benchmark-suite/benchmarks/bytevectors.bm:
	* doc/ref/api-data.texi:
	* doc/ref/api-foreign.texi:
	* libguile/bytevectors.c:
	* module/6/rnrs.scm:
	* module/language/assembly.scm:
	* module/language/assembly/compile-bytecode.scm:
	* module/language/assembly/decompile-bytecode.scm:
	* module/language/glil/compile-assembly.scm:
	* module/language/tree-il/primitives.scm:
	* module/srfi/srfi-4.scm:
	* module/srfi/srfi-4/gnu.scm:
	* module/system/foreign.scm:
	* test-suite/standalone/test-ffi:
	* test-suite/tests/asm-to-bytecode.test:
	* test-suite/tests/bytevectors.test:
	* test-suite/tests/foreign.test:
	* test-suite/tests/r6rs-ports.test: Update all referrers.

2010-06-01  Andy Wingo  <wingo@pobox.com>

	more 1.9.11 NEWS updates
	* NEWS: More updates.

2010-06-01  Ludovic Courtès  <ludo@gnu.org>

	Fix `VM_VALIDATE_BYTEVECTOR' macro wrt. trailing semicolons.
	* libguile/vm-i-scheme.c (VM_VALIDATE_BYTEVECTOR): Enclose in "do { }
	  while (0)".

2010-06-01  Ludovic Courtès  <ludo@gnu.org>

	Fix unaligned accesses by the bytevector instructions.
	* libguile/vm-i-scheme.c (ALIGNED_P): New macro.
	  (BV_FIXABLE_INT_REF, BV_INT_REF, BV_FLOAT_REF, BV_FIXABLE_INT_SET,
	  BV_INT_SET, BV_FLOAT_SET): Check the alignment of the pointer instead
	  of checking "i % size == 0".  This fixes bus errors on
	  `sparc64-linux-gnu'.

	* libguile/vm.c: Include <alignof.h>.

2010-06-01  Ludovic Courtès  <ludo@gnu.org>

	Upgrade manual to GFDLv1.3+.
	* doc/ref/fdl.texi: Upgrade to GFDLv1.3.

	* doc/ref/guile.texi: Change copying notice to "Version 1.3 or any later
	  version".
	  (GNU Free Documentation License): New node, formerly in `fdl.texi'.

2010-05-30  Ludovic Courtès  <ludo@gnu.org>

	Ignore `.version'.

	Have `test-ffi' run all the tests even after a failure.
	* test-suite/standalone/test-ffi (failed?): New variable.
	  (test): Set `failed?' to #t upon error and display an error message.
	  Have the exit code depend on FAILED?.

	Fix argument and return value alignment in `scm_i_foreign_call'.
	* libguile/foreign.c (scm_i_foreign_call): Fix the computation of
	  ARG_SIZE wrt. alignment.  Arrange so that the address ARGS[i] is
	  aligned, rather than checking whether OFF is aligned.  Have the RVALUE
	  be at least word-aligned, which fixes calls to `char'-returning
	  functions on `armv5tel-*-linux-gnueabi'.

2010-05-30  Ludovic Courtès  <ludo@gnu.org>

	Fix parenthesizing of the `ROUND_UP' macro; factorize.
	* libguile/_scm.h (ROUND_UP): New macro.

	* libguile/continuations.c (ROUND_UP): Remove.

	* libguile/control.c (ROUND_UP): Remove.

	* libguile/foreign.c (ROUND_UP): Remove.

2010-05-30  Ludovic Courtès  <ludo@gnu.org>

	Relax the `(version)' test.
	* test-suite/tests/version.test ("version reporting works"): Test
	  whether `(version)' contains MAJOR.MINOR.MICRO, rather than being
	  equal to it.

2010-05-30  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `git-version-gen'.
	* GUILE-VERSION (GUILE_VERSION): Remove.

	* Makefile.am (dist-hook): Depend on `gen-tarball-version'.
	  (BUILT_SOURCES): New variable.
	  ($(top_srcdir)/.version, gen-tarball-version): New targets.

	* cfg.mk (git-version-gen-tag-sed-script): New variable.

	* configure.ac: Use `build-aux/git-version-gen' to generate the VERSION
	  argument of `AC_INIT'.  Initialize Automake without `check-news'.
	  Define $GUILE_VERSION as an alias for $PACKAGE_VERSION.

2010-05-30  Ludovic Courtès  <ludo@gnu.org>

	Import Gnulib's `git-version-gen' module.
	* m4/gnulib-cache.m4: Add `git-version-gen'.

2010-05-29  Ludovic Courtès  <ludo@gnu.org>

	Update Gnulib to v0.0-3955-g8ab5996.

2010-05-28  Ludovic Courtès  <ludo@gnu.org>

	Update `THANKS'.

2010-05-28  Ludovic Courtès  <ludo@gnu.org>

	Remove dead code related to `scm_i_terminating'.
	* libguile/fports.c (scm_i_terminating): Remove declaration.
	  (fport_flush): Remove code conditional of `scm_i_terminating'.

	* libguile/gc.c (scm_i_terminating): Remove.

2010-05-28  Ludovic Courtès  <ludo@gnu.org>

	Fix the visibility of a few of internal symbols.
	* libguile/gc.h (scm_i_gc): Make internal.
	* libguile/posix.h (scm_i_locale_mutex): Likewise.
	* libguile/arrays.h (scm_i_tc16_array): Likewise.
	* libguile/numbers.c (scm_i_num_less_p): Likewise.
	* libguile/discouraged.h (scm_i_init_discouraged): Likewise.
	* libguile/continuations.c (scm_i_dummy): Made static.
	* libguile/gc.c (scm_i_cell_validation_already_running): Likewise.
	* libguile/discouraged.h (scm_i_init_discouraged): Likewise.

	Quote the first argument to `AC_DEFINE_UNQUOTED'.
	* configure.ac: Quote the first argument to `AC_DEFINE_UNQUOTED'.

2010-05-28  Ludovic Courtès  <ludo@gnu.org>

	Change occurrences of "filesystem" to "file system".
	* doc/ref/posix.texi (File System): Change "filesystem" to "file
	  system".

	* libguile/posix.c (scm_utime): Ditto.

2010-05-28  Ludovic Courtès  <ludo@gnu.org>

	Use GCC's `malloc' attribute for malloc-like routines.
	* libguile/__scm.h (SCM_MALLOC): New macro.

	* libguile/gc.h (scm_malloc, scm_calloc, scm_strdup, scm_strndup,
	  scm_gc_malloc_pointerless, scm_gc_calloc, scm_gc_malloc,
	  scm_gc_strdup, scm_gc_strndup): Mark as `SCM_MALLOC'.

2010-05-28  Volker Grabsch  <vog@notjusthosting.com>

	don't fail when HAVE_STAT64 is undefined
	* libguile/_scm.h: Check whether `HAVE_STAT64' is defined instead of
	  checking its value.

	don't run the `pthread_attr_getstack' check when cross compiling
	* configure.ac: Run the `pthread_attr_getstack' test only when building
	  natively.

	add pdcurses to the list of termlibs
	* acinclude.m4 (GUILE_READLINE): Look for pdcurses as found on MinGW.

2010-05-28  Ludovic Courtès  <ludo@gnu.org>

	Add `scm_t_aligned_cell' internal type.
	* libguile/_scm.h (struct scm_aligned_cell)[__GNUC__]: New type.
	  (union scm_aligned_cell)[!__GNUC__]: New type.
	  (scm_t_aligned_cell): New type.

	* libguile/vm.c (vm_dispatch_hook): Use it.

2010-05-28  Julian Graham  <julian.graham@aya.yale.edu>

	Ignore explicit phase specification for imports in `library' form.
	* module/ice-9/r6rs-libraries.scm (library): Unwrap the `for' sub-form
	  during export resolution the same way that `import' does.
	* test-suite/tests/rnrs-libraries.test ("implicit phasing"): New test
	  prefix and tests.

2010-05-27  No Itisnt  <theseaisinhere+git@gmail.com>

	Two spaces.

	Rename set-record-printer!
	* doc/ref/srfi-modules.texi: set-record-printer! -> set-record-type-printer!

	Add sources to module/Makefile.am
	* module/Makefile.am: add srfi/srfi-9/gnu.scm to SRFI_SOURCES

2010-05-27  No Itisnt  <theseaisinhere+git@gmail.com>

	Record printer fixes
	* doc/ref/srfi-modules.texi: Fix style

	* module/srfi/srfi-9/gnu.scm (set-record-type-printer!): renamed from set-record-printer!

2010-05-27  Julian Graham  <julian.graham@aya.yale.edu>

	Support for the #!r6rs lexeme.
	* libguile/read.c (scm_read_shebang): New function;
	  (scm_read_sharp): Call scm_read_shebang on '!', which delegates to
	  scm_read_scsh_block_comment as necessary.
	* test-suite/tests/reader.test ("R6RS lexeme comment", "partial R6RS
	  lexeme comment"): New tests.

2010-05-27  Andy Wingo  <wingo@pobox.com>

	partial 1.9.11 NEWS
	* NEWS: Add some 1.9.11 news -- unfinished, though.

	remove scm_memoizer_p and scm_memoizer declarations
	* libguile/memoize.h (scm_memoizer_p, scm_memoizer): Remove these
	  declarations.

2010-05-26  Ludovic Courtès  <ludo@gnu.org>

	Clean up `test-suite/vm'.
	* test-suite/vm/Makefile.am: Add copyright/license header.

	* test-suite/vm/the-bug.txt: Remove.

2010-05-26  Ludovic Courtès  <ludo@gnu.org>

	Rename the `testsuite' directory to `test-suite/vm'.
	* testsuite: Move to...
	* test-suite/vm: ... here.

	* Makefile.am (SUBDIRS): Remove `testsuite'.

	* configure.ac: Output `test-suite/vm/Makefile' instead of
	  `testsuite/Makefile'.

	* test-suite/Makefile.am (SUBDIRS): Add `vm'.

2010-05-26  Ludovic Courtès  <ludo@gnu.org>

	Raise an exception upon VM stack overflows (fixes bug #29574).
	* libguile/vm-engine.c (VM_NAME)[vm_error_stack_overflow]: Increase
	  `vp->stack_limit' when possible.

	* libguile/vm.c (VM_STACK_RESERVE_SIZE): New macro.

	* test-suite/lib.scm (exception:vm-error): New variable.

	* test-suite/tests/eval.test ("stack overflow"): New test prefix.

2010-05-26  Ludovic Courtès  <ludo@gnu.org>

	sxml-match: Handle multiple-value returns.
	* module/sxml/sxml-match.ss (sxml-match1): Invoke ESCAPE via
	  `call-with-values'.

	* test-suite/tests/sxml-match-tests.ss ("test multiple value returns"):
	  New test.

	* module/sxml/match.scm: Mention the modification.

2010-05-26  No Itisnt  <theseaisinhere+git@gmail.com>

	Merge branch 'master' of git.sv.gnu.org:/srv/git/guile

2010-05-25  Ludovic Courtès  <ludo@gnu.org>

	Add (sxml match).
	* module/Makefile.am (LIB_SOURCES): Add `sxml/match.scm'.
	  (NOCOMP_SOURCES): Add `sxml/sxml-match.ss'.

	* module/sxml/match.scm, module/sxml/sxml-match.ss: New files.

	* test-suite/Makefile.am (SCM_TESTS): Add `tests/sxml.match.test'.
	  (EXTRA_DIST): Add `tests/sxml-match-tests.ss'.

	* test-suite/tests/sxml-match-tests.ss,
	  test-suite/tests/sxml.match.test: New files.

	* doc/ref/guile.texi (Guile Modules): Include `sxml-match.texi'.

	* doc/ref/sxml-match.texi: New file.

	* doc/ref/Makefile.am (guile_TEXINFOS): Add `sxml-match.texi'.

2010-05-25  Ludovic Courtès  <ludo@gnu.org>

	Add copyight/license header in `compile-psyntax.scm'.

2010-05-25  No Itisnt  <theseaisinhere+git@gmail.com>

	* doc/ref/srfi-modules.texi: * module/srfi/srfi-9/gnu.scm: rename `define-record-printer' to   `set-record-printer!' to reflect the fact that the printer is set at runtime

	add custom record printers
	* doc/ref/srfi-modules.texi: update documentation
	* module/srfi/srfi-9/gnu.scm: add `define-record-printer'

2010-05-24  Andy Wingo  <wingo@pobox.com>

	update NEWS for things that were true and aren't, or vice versa
	* NEWS: Misc updates.

	pre-prepare NEWS
	* NEWS: Integrate 1.9.10 entries into the main text.

2010-05-23  Julian Graham  <julian.graham@aya.yale.edu>

	Edits for R6RS library implementation documentation, as suggested by Ludovic Courtès.
	* doc/ref/api-module.texi (R6RS Libraries): Wrap keywords variously in
	  @code and @dfn forms; rewrite pointer to implicit phasing paper; add
	  "Scheme Syntax" specification to @deffns.

2010-05-22  Ludovic Courtès  <ludo@gnu.org>

	Fix disassembly of free variable lists.
	* module/language/assembly/disassemble.scm (disassemble-free-vars):
	  Handle FREE-VARS as a list, not a vector.

2010-05-21  Andy Wingo  <wingo@pobox.com>

	boot-9 comment cleanup
	* module/ice-9/boot-9.scm: Remove needless comment.

	lambda* in make-mutable-parameter
	* module/ice-9/boot-9.scm (make-mutable-parameter): Use lambda*.

	define* in repl-reader
	* module/ice-9/boot-9.scm (repl-reader): Use define*.

	define* in try-module-autoload
	* module/ice-9/boot-9.scm (try-module-autoload): Use define*.

	define* in resolve-interface
	* module/ice-9/boot-9.scm (resolve-interface): Use define* with proper
	  keyword arguments, for great justice.

	lambda* in resolve-module
	* module/ice-9/boot-9.scm (resolve-module): Use lambda*.

	define* in load-module
	* module/ice-9/boot-9.scm (load-module): Use define*.

	define* in module-observe-weak
	* module/ice-9/boot-9.scm (module-observe-weak): Use define*.

	define* in load
	* module/ice-9/boot-9.scm (load): Use define*.

	case-lambda in dup->{in,out,}port, dup
	* module/ice-9/boot-9.scm (dup->port, dup->inport, dup->outport, dup):
	  Use case-lambda. Not particularly elegant.

	define* in file-set-position
	* module/ice-9/boot-9.scm (file-set-position): Use define*.

	define* in record-constructor
	* module/ice-9/boot-9.scm (record-constructor): Use define*.

	define* in make-record-type
	* module/ice-9/boot-9.scm (make-record-type): Use define*.

	lambda* in string-any, string-every
	* module/ice-9/boot-9.scm (string-any, string-every): Use lambda*.

	lambda* in catch
	* module/ice-9/boot-9.scm (catch): Use lambda*.

	lambda* in make-prompt-tag
	* module/ice-9/boot-9.scm (make-prompt-tag): Use lambda*.

2010-05-21  Julian Graham  <julian.graham@aya.yale.edu>

	Explicitly import `*unspecified*' to support R6RS library purification enhancements.
	* module/rnrs/6/hashtables.scm: Add explicit import for `*unspecified*'.

	Explicitly import `@@' to support R6RS library purification enhancements on `master'.
	* module/rnrs/6/conditions.scm:
	* module/rnrs/6/exceptions.scm:
	* module/rnrs/6/files.scm:
	* module/rnrs/6/hashtables.scm:
	* module/rnrs/io/6/simple.scm:
	* module/rnrs/records/6/inspection.scm: Add explicit import for `@@'.

	Fix broken imports in `(rnrs r5rs)'.
	* module/rnrs/6/r5rs.scm (imports): Import `null-environment' from
	  `(ice-9 safe-r5rs)'; import `scheme-report-environment' from
	  `(ice-9 r5rs)'.

	Fix incorrect export names in `(rnrs io simple)'.
	* module/rnrs/io/6/simple.scm: with-input-file => with-input-from-file,
	  with-output-file => with-output-to-file.

	Implementation for R6RS (rnrs) composite library.  (Can't be loaded yet because of conflict between `syntax-case' transformer binding and `(rnrs syntax-case)' hierarchical namespace module binding.)
	* module/6/rnrs.scm: New file.
	* module/Makefile.am: Add 6/rnrs.scm to RNRS_SOURCES.

	Test suite and fixes for R6RS (rnrs arithmetic fixnums).
	* module/rnrs/arithmetic/6/fixnums.scm: Fix missing imports;
	  (fixnum-width, greatest-fixnum, least-fixnum): Redefine these as
	  zero-argument procedures; Fix argument mismatches in several functions.
	* test-suite/Makefile.am: Add tests/r6rs-arithmetic-fixnums.test to
	  SCM_TESTS.
	* test-suite/tests/r6rs-arithmetic-fixnums.test: New file.

	Fix typo in license comment.
	* test-suite/tests/r6rs-eval.test: Lice6nse => License.

	Implementation and test cases for the R6RS (rnrs arithmetic flonums) library.
	* module/Makefile.am: Add rnrs/arithmetic/6/fixnums.scm and
	  rnrs/arithmetic/6/flonums.scm to RNRS_SOURCES.
	* module/rnrs/6/base.scm: (div-and-mod, div0, mod0, div0-and-mod0): New
	  functions; this `div' implementation is not quite right, but we'll come
	  back to it later.
	* module/rnrs/arithmetic/6/fixnums.scm: New file.
	* module/rnrs/arithmetic/6/flonums.scm: New file.
	* test-suite/Makefile.am: Add tests/r6rs-arithmetic-flonums.test to
	  SCM_TESTS.
	* test-suite/tests/r6rs-arithmetic-flonums.test: New file.

	Implementation and test case for R6RS (rnrs eval) library.
	* module/Makefile.am: Add rnrs/6/eval.scm to RNRS_SOURCES.
	* module/rnrs/6/eval.scm: New file
	* test-suite/Makefile.am: Add tests/r6rs-eval.test to SCM_TESTS.
	* test-suite/tests/r6rs-eval.test: New file.

	Fix syntax and consolidate imports for (rnrs lists).
	* module/rnrs/6/lists.scm: Import syntax is
	  `(only (import-set) id-1 ...)', not `(only (import-set) (id-1 ...))';
	  use `rename' form as wrapper instead of creating separate custom
	  interface on SRFI-1.

	Implementation and test cases for the R6RS (rnrs enums) library.
	* module/Makefile.am: Add rnrs/6/enums.scm to RNRS_SOURCES.
	* module/rnrs/6/conditions.scm: Fix define-condition-type binding for
	  syntax-violation? predicate.
	* module/rnrs/6/enums.scm: New file.
	* test-suite/Makefile.am: Add tests/r6rs-enums.test to SCM_TESTS.
	* test-suite/tests/r6rs-enums.test: New file.

	Add R6RS `syntax-violation' to (rnrs syntax-case).
	* module/rnrs/6/exceptions.scm: Remove dependency on (rnrs syntax-case);
	  rewrite guard and guard0 in using syntax-rules in terms of syntax-case.
	* module/rnrs/6/syntax-case.scm: Add syntax-violation implementation.

	Test suite and fixes for R6RS (rnrs conditions) and (rnrs records procedural).
	* module/rnrs/6/conditions.scm: Fix export of
	  make-implementation-restriction-violation; remove dependency on
	  (rnrs syntax-case); remove redundant function
	  compound-condition-components; rewrite define-condition-type using
	  syntax-rules instead of syntax-case.
	* module/rnrs/records/6/procedural.scm: Remove serious-condition?,
	  violation? and assertion-violation? predicates, since they're not true
	  condition predicates.
	* test-suite/Makefile.am: Add tests/r6rs-conditions.test to SCM_TESTS.
	* test-suite/tests/r6rs-conditions.test: New file.

	Implementation for the (rnrs mutable-pairs) and (rnrs mutable-strings) libraries.
	* module/Makefile.am: Add rnrs/6/mutable-pairs.scm and
	  rnrs/6/mutable-strings.scm to RNRS_SOURCES.
	* module/rnrs/6/mutable-pairs.scm: New file.
	* module/rnrs/6/mutable-strings.scm: New file.

	Implementation for the R6RS (rnrs r5rs) library.
	* module/Makefile.am: Add rnrs/6/r5rs.scm to RNRS_SOURCES.
	* module/rnrs/6/r5rs.scm: New file.

	Add `guard' form and test cases to R6RS (rnrs exceptions) library.
	* module/rnrs/6/exceptions.scm: (guard0, guard): New syntax.
	* module/rnrs/records/6/procedural.scm: (r6rs-raise-continuable): Can't
	  use `raise' here because it's exported by (rnrs exceptions); use plain
	  old `throw' instead.
	* test-suite/Makefile.am: Add tests/r6rs-exceptions.test to SCM_TESTS.
	* test-suite/tests/r6rs-exceptions.test: New file.

	Fix test suite title in comment
	* test-suite/tests/r6rs-records-procedural.test: `(rnrs control)' =>
	  `(rnrs records procedural)'

	Implementation and test cases for R6RS (rnrs files) library.
	* module/Makefile.am: Add rnrs/6/files.scm to RNRS_SOURCES.
	* module/rnrs/6/conditions.scm (define-condition-type): Use specified
	  accessor name to create accessor binding.  Add internally-visible
	  &i/o-* condition types.
	* module/rnrs/6/files.scm: New file.
	* module/rnrs/io/6/simple.scm: Export &i/o-* condition types clandestinely
	  imported from (rnrs conditions).
	* test-suite/Makefile.am: Add tests/r6rs-files.test to SCM_TESTS.
	* test-suite/test/r6rs-files.test: New file.

	Implementation for the R6RS (rnrs sorting) library.
	* module/Makefile.am: Add rnrs/6/sorting.scm to RNRS_SOURCES.
	* module/rnrs/6/sorting.scm: New file.

	Implementation for the R6RS (rnrs programs) library.
	* module/Makefile.am: Add rnrs/6/programs.scm to RNRS_SOURCES.
	* module/rnrs/6/programs.scm: New file.

	Implementation and test cases for the R6RS (rnrs unicode) library.
	* module/Makefile.am: Add rnrs/6/unicode.scm to RNRS_SOURCES.
	* module/rnrs/6/unicode.scm: New file.
	* test-suite/Makefile.am: Add tests/r6rs-unicode.test to SCM_TESTS.
	* test-suite/tests/r6rs-unicode.test

	Fixes and test cases for R6RS (rnrs hashtables) library.
	* module/rnrs/6/hashtables.scm: Assorted bugfixes, esp. for wrapping
	  single-argument hash functions.
	* test-suite/Makefile.am: Add tests/r6rs-hashtables.test to SCM_TESTS.
	* test-suite/tests/r6rs-hashtables.test: New file.

	Add test cases for record constructor protocols and parent protocol delegation.
	* test-suite/tests/r6rs-records-procedural.test ("simple protocol",
	  "protocol delegates to parent with protocol"): New tests.

	Implementation for the R6RS (rnrs hashtables) library; Implementation and test cases for the R6RS (rnrs record syntactic) library.
	* module/Makefile.am: Add rnrs/6/hashtables.scm to RNRS_SOURCES.
	* module/rnrs/6/hashtables.scm: New file.
	* module/rnrs/records/6/inspection.scm: (record-type-generative?) Record
	  types are generative iff they have no uid, not vice-versa.
	* module/rnrs/records/6/syntactic.scm: Finish `define-record-type'
	  implementation; add `record-type-descriptor' and
	  `record-constructor-descriptor' forms.
	* test-suite/Makefile.am: Add tests/r6rs-records-syntactic.test to
	  SCM_TESTS.
	* test-suite/tests/r6rs-records-inspection.test: Update tests for
	  `record-type-generative?' to reflect corrected behavior.
	* test-suite/tests/r6rs-records-syntactic.test: New file.

	(rnrs conditions) should not depend on (rnrs records syntactic).
	* module/rnrs/6/conditions.scm: (define-condition-type) Re-implement
	  `define-condition-type' in terms of (rnrs records procedural).

	Fix missing export of string->symbol in (rnrs base).
	* module/rnrs/6/base.scm: Add string->symbol to library exports.

	Implementation for the R6RS (rnrs lists) library.
	* module/Makefile.am: Add module/rnrs/6/lists.scm to RNRS_SOURCES.
	* module/rnrs/6/lists.scm: New file.

	Implementation and test cases for the R6RS (rnrs records inspection) library.
	* module/Makefile.am: Add module/rnrs/records/6/inspection.scm to RNRS_SOURCES.
	* module/rnrs/records/6/inspection.scm: New file.
	* module/rnrs/records/6/procedural.scm: Assorted refactoring:
	    Create index constants for record, rtd, and rcd field indexes;
	    record-type-vtable, record-constructor-vtable: More informative display
	    names;
	    (make-record-type-descriptor): fold left, not right when creating vtable;
	      store field names as vector, not list;
	      detect opaque parents
	* test-suite/Makefile.am: Add test-suite/tests/r6rs-records-inspection.test to
	  SCM_TESTS.
	* test-suite/tests/r6rs-records-inspection.test: New file.

	Remove needless import of (rnrs io simple).
	* module/rnrs/6/conditions.scm: Remove (rnrs io simple (6)) from imports.

	Implementation and test cases for the R6RS (rnrs records procedural) library, along with its dependencies.
	* module/Makefile.am: Add new R6RS libraries below to RNRS_SOURCES.
	* module/rnrs/6/conditions.scm, exceptions.scm, syntax-case.scm: New files.
	* module/rnrs/io/6/simple.scm: New file.
	* module/rnrs/records/6/procedural.scm, syntactic.scm: New files.
	* test-suite/Makefile.am: Add tests/r6rs-records-procedural.test to SCM_TESTS.
	* test-suite/tests/r6rs-records-procedural.test: New file.

	Fix missing imports for `(rnrs arithmetic bitwise)'.
	* module/Makefile.am: Add module/rnrs/arithmetic/6/bitwise.scm to
	  RNRS_SOURCES.
	* module/rnrs/arithmetic/6/bitwise.scm: Import `(rnrs control)' and `modulo'
	  from `(guile)'.
	* test-suite/Makefile.am: Add r6rs-arithmetic-bitwise.test to SCM_TESTS.

	Implementation and test cases for the R6RS (rnrs control) library.
	* module/Makefile.am: Add rnrs/6/base.scm and rnrs/6/control.scm to
	  RNRS_SOURCES.
	* module/rnrs/6/base.scm, control.scm: New files.
	* test-suite/Makefile.am: Add tests/r6rs-control.test to SCM_TESTS.
	* test-suite/tests/r6rs-control.test: New file.

	Implementation and test cases for the R6RS (rnrs arithmetic bitwise) library.
	* module/rnrs/arithmetic/6/bitwise.scm: New file.
	* test-suite/tests/r6rs-arithmetic-bitwise.test: New file.

2010-05-21  Julian Graham  <julian@spiderstacy.(none)>

	Documentation for the R6RS `library' and `import' forms.
	* doc/ref/api-modules.texi (R6RS Libraries): New section, documents
	  `library' and `import'.

2010-05-20  Andy Wingo  <wingo@pobox.com>

	eval-when expand for use-modules and export
	* module/ice-9/boot-9.scm (use-modules, use-syntax)
	  (export, re-export): Add `expand' to the eval-when list, as we did for
	  R6RS.

	pure r6rs modules
	* module/ice-9/r6rs-libraries.scm (library): Make pure modules.
	  (import): Also process imports at expand time, for the `eval' case.

	macroexpanded pretty-printer
	* module/language/tree-il.scm (print-tree-il):
	  (borrow-core-vtables, <tree-il>): When tree-il loads, override the
	  printers for macroexpanded structures.

	lambda* usage in psyntax.scm
	* module/ice-9/psyntax.scm (macroexpand): Use lambda*.
	* module/ice-9/psyntax-pp.scm: Regenerated.

	tree-il->scheme for lambda* et al
	* module/language/tree-il.scm (tree-il->scheme): Fix lambda* /
	  case-lambda / case-lambda* transformation.

2010-05-20  Andy Wingo  <wingo@pobox.com>

	remove *mode* fluid from psyntax
	* module/ice-9/psyntax.scm: Remove the *mode* fluid. Whee :)
	  (macroexpand): No need to bind aa *mode* fluid.

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

2010-05-20  Andy Wingo  <wingo@pobox.com>

	iron out inconsistency between eval and compile expansion
	* libguile/expand.c (expand_lambda_star_case): Harmonize with tree-il,
	  expanding keywords to (aok? (kw name gensym) ...), not
	  (aok? (kw . index) ...).

	* libguile/memoize.c (memoize): Process the (kw name gensym) format into
	  (kw . index).

	* module/ice-9/psyntax.scm (build-lambda-case): Remove a
	  compile-versus-eval special case.

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

2010-05-20  Andy Wingo  <wingo@pobox.com>

	primitive-eval takes expanded, not memoized, source
	* module/ice-9/eval.scm (primitive-eval):
	* libguile/eval.c (scm_c_primitive_eval): Don't expect a memoized
	  expression -- expect either raw source or an *expanded* expression. We
	  handle memoization ourselves.

	* libguile/expand.c (scm_macroexpand): Settle down into its proper name,
	  "macroexpand", even as we comment that it is but a fleeting boot
	  expander.
	  (scm_macroexpanded_p): New predicate for expanded code.

	* libguile/expand.h: Add scm_macroexpanded_p.

	* libguile/memoize.c (scm_memoize_expression): Require that the
	  expression be expanded.
	  (scm_init_memoize): Don't alias memoize-expression to macroexpand.

	* module/ice-9/psyntax-pp.scm:
	* module/ice-9/psyntax.scm: Always produce macroexpanded expressions,
	  and hand them to primitive-eval. No more calls to memoize-expression
	  here.

	* test-suite/tests/optargs.test: Remove some tests, as unfortunately we
	  have no way to invoke the boot expander after boot.

2010-05-20  Andy Wingo  <wingo@pobox.com>

	%null-pointer properly aligned
	* libguile/foreign.c: Allocate %null-pointer on the heap, to assure
	  proper alignment.

2010-05-20  Andy Wingo  <wingo@pobox.com>

	psyntax produces "expanded" structures directly
	* module/ice-9/psyntax.scm: Remove a number of eval-versus-compile
	  cases, instead producing "expanded" structures directly, which happen
	  to coincide with tree-il.

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

2010-05-19  Andy Wingo  <wingo@pobox.com>

	expanded type constructors in psyntax
	* module/ice-9/psyntax.scm (define-expansion-constructors): Define
	  constructors for expanded types.

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

2010-05-19  Andy Wingo  <wingo@pobox.com>

	tree-il on expanded-vtables
	* module/language/tree-il.scm: In a somewhat daring move, inherit
	  the "core" tree-il constructs from %expanded-vtables.

	fix a couple expander naming bugs
	* libguile/expand.h:
	* libguile/memoize.c: Fix a couple bugs: it's application-args, not
	  application-exps, and public?, not public.

	%expanded-vtables is a vector
	* libguile/expand.c (scm_init_expand): %expanded-vtables is a vector.

2010-05-19  Andy Wingo  <wingo@pobox.com>

	separate boot expansion from memoization
	* libguile/Makefile.am:
	* libguile/init.c:
	* libguile/expand.c:
	* libguile/expand.h: Add new expander. The idea is that macroexpansion
	  is one thing, and whether to compile or interpret the result of that
	  is another thing.

	* libguile/memoize.c: Adapt to expand as necessary, and then memoize
	  expanded source without worrying about syntax errors.

	* module/ice-9/eval.scm (make-general-closure): Allow alt clauses to not
	  possess the full make-general-closure arity.

2010-05-18  Andy Wingo  <wingo@pobox.com>

	remove the new scm_memoize_begin, etc
	* libguile/memoize.h:
	* libguile/memoize.c: Remove the recently-added scm_memoize_begin,
	  scm_memoize_lambda, et al. We'll take a different tack.

2010-05-16  Andy Wingo  <wingo@pobox.com>

	scm_memoize_lambda update
	* libguile/memoize.h:
	* libguile/memoize.c (scm_memoize_lambda): Update to memoize
	  "full-arity" lambdas.

2010-05-14  Andy Wingo  <wingo@pobox.com>

	psyntax builds case-lambda expressions
	* module/ice-9/psyntax.scm (build-case-lambda, build-lambda-case):
	  Actually build case-lambda expressions, knowing that the memoizer will
	  do the right thing.

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

2010-05-14  Andy Wingo  <wingo@pobox.com>

	evaluator support for case-lambda
	* libguile/memoize.c (patch_case_lambda, scm_m_case_lambda)
	  (scm_m_case_lambda_star): Add memoizers for case-lambda and
	  case-lambda*.
	  (unmemoize): Unmemoize lambdas with multiple arities.

	* libguile/eval.c (prepare_boot_closure_env_for_apply):
	  (prepare_boot_closure_env_for_eval): Adapt to return both body and
	  env, so that case-lambda clauses can be selected appropriately.
	  (eval, boot_closure_apply): Adapt callers.

	* module/ice-9/eval.scm (make-general-closure): Support multiple
	  arities.

2010-05-14  Andy Wingo  <wingo@pobox.com>

	primitive support for lambda*
	* libguile/memoize.c (scm_m_lambda_star): Define lambda* in the
	  pre-psyntax env, and make it memoize lambda* expressions.

	* libguile/eval.c (BOOT_CLOSURE_PARSE_FULL): New helper.
	  (error_invalid_keyword, error_unrecognized_keyword): New helpers.
	  (prepare_boot_closure_env_for_apply): Flesh out application of boot
	  closures with "full" arity.
	  (prepare_boot_closure_env_for_eval): Punt to
	  prepare_boot_closure_env_for_eval for the full-arity case.

	* module/ice-9/eval.scm (make-fixed-closure): Rename from `closure', and
	  just handle fixed arities, where there is no rest argument..
	  (make-general-closure): New helper, a procedure, that returns a
	  closure that can take rest, optional, and keyword arguments.
	  (eval): Adapt to call make-fixed-closure or make-general-closure as
	  appropriate.

	* test-suite/tests/optargs.test ("lambda* inits"): Test the memoizer as
	  well.

2010-05-13  Andy Wingo  <wingo@pobox.com>

	tweak to lambda* memoization format
	* libguile/memoize.c (FULL_ARITY): Change the form to more closely
	  approximate <lambda-case>.
	  (unmemoize): Unmemoize lambda* expressions.

	change to format of memoization lambda expressions
	* libguile/memoize.c (scm_m_lambda, memoize_named_let)
	  (scm_memoize_lambda, unmemoize)
	* libguile/eval.c (eval, prepare_boot_closure_env_for_apply)
	  (prepare_boot_closure_env_for_eval, boot_closure_apply):
	* module/ice-9/eval.scm (primitive-eval): Change the format for memoized
	  lambda expressions, so as to allow, in the future, case-lambda* to be
	  supported by the evaluator.

	scm_badargsp is deprecated
	* libguile/eval.h:
	* libguile/eval.c:
	* libguile/deprecated.h
	* libguile/deprecated.c (scm_badargsp): Deprecate scm_badargsp.

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

	Have `sxml->xml' handle `*TOP*' nodes (bug #29260).
	* module/sxml/simple.scm (universal-sxslt-rules): Add handler for
	  `*TOP*'.  Suggested by Stefan Israelsson Tampe at
	  <https://savannah.gnu.org/bugs/index.php?29260>.

	* test-suite/Makefile.am (SCM_TESTS): Add `sxml.simple.test'.

	* test-suite/tests/sxml.simple.test: New file.

	* THANKS: Add Stefan.

2010-05-07  Andy Wingo  <wingo@pobox.com>

	add memoize-begin, memoize-let, etc functions
	* libguile/memoize.h:
	* libguile/memoize.c (scm_memoize_begin, scm_memoize_if,
	  scm_memoize_lambda, scm_memoize_let, scm_memoize_quote,
	  scm_memoize_define, scm_memoize_with_fluids, scm_memoize_call,
	  scm_memoize_lexical_ref, scm_memoize_lexical_set,
	  scm_memoize_toplevel_ref, scm_memoize_toplevel_set,
	  scm_memoize_module_ref, scm_memoize_module_set): New functions, public
	  to Scheme but private to C. For use by psyntax, in the future.

2010-05-07  Andy Wingo  <wingo@pobox.com>

	add "memoizer" data type
	* libguile/memoize.h:
	* libguile/memoize.c (MAKMEMO_APPLY): Take the proc and args separately.
	  (scm_tc16_memoizer, SCM_MEMOIZER_P, SCM_MEMOIZER): New smob type, for
	  "syntax" like @apply that have normal evaluation order.
	  (memoize_env_ref_macro, memoize): Refactor to handle "memoizers"
	  generically.

	  Reorganize the list of SCM_SYNTAX forms.

	  Move @apply, @dynamic-wind, @call-with-current-continuation,
	  @call-with-values, @prompt handling down to be generic "memoizer" data
	  types.

	  (scm_memoizer_p, scm_memoizer): New functions, exposed to Scheme. Will
	  be used by psyntax.

2010-05-07  Andy Wingo  <wingo@pobox.com>

	macro expanders return memoized expressions
	* libguile/eval.c (scm_c_primitive_eval):
	* module/ice-9/eval.scm (primitive-eval): Rely on the expander to
	  produce a memoized expression. If the expression is already memoized,
	  just pass it through (the equivalent of the old "noexpand" hack).

	* libguile/memoize.c (scm_init_memoize): Initialize `memoize-expression'
	  as the initial binding of `macroexpand'.

	* libguile/modules.c (scm_module_transformer): Before modules are
	  booted, look for `macroexpand', not `%pre-modules-transformer'.

	* module/ice-9/boot-9.scm: No more %pre-modules-transformer. Loading
	  psyntax extends `macroexpand'.
	  (make-module): `macroexpand' is the default transformer.

	* module/ice-9/psyntax.scm: No more `noexpand'.
	  (top-level-eval-hook, local-eval-hook): Instead of annotating with
	  noexpand, memoize the expression before handing it to primitive-eval.
	  (macroexpand): No more noexpand hack -- in its place we have another
	  hack, to memoize the result when running in eval mode.
	* module/ice-9/psyntax-pp.scm: Regenerated.

2010-05-07  Ludovic Courtès  <ludo@gnu.org>

	Attempt to guarantee 8-byte alignment of on-stack frame objects.
	* libguile/vm.c (vm_dispatch_hook): Make FRAME a union with a `double'
	  member.

2010-05-07  Ludovic Courtès  <ludo@gnu.org>

	Add (system vm coverage).
	* module/system/vm/coverage.scm: New file.

	* module/Makefile.am (SYSTEM_SOURCES): Add `system/vm/coverage.scm'.

	* test-suite/guile-test (main): Use (system vm coverage).  Handle
	  `--coverage' and `-c'.

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

	* test-suite/Makefile.am (SCM_TESTS): Add `tests/coverage.test'.

	* doc/ref/Makefile.am (guile_TEXINFOS): Add `api-coverage.texi'.

	* doc/ref/api-coverage.texi: New file.

	* doc/ref/guile.texi (API Reference): Include it.

2010-05-07  Ludovic Courtès  <ludo@gnu.org>

	Allocate frame objects on the stack when invoking VM hooks.
	* libguile/vm.c (vm_dispatch_hook): Don't call `scm_c_make_frame ()'.
	  Instead, allocate FRAME on the stack.

2010-05-07  Ludovic Courtès  <ludo@gnu.org>

	Add `program-free-variables' to `(system vm program)'.
	* module/system/vm/program.scm (program-free-variables): New procedure.

	* module/language/objcode/spec.scm (program-free-variables): Remove.

2010-05-07  Ludovic Courtès  <ludo@gnu.org>

	Fix the type tag produced by `SCM_STATIC_PROGRAM'.
	* libguile/snarf.h (SCM_STATIC_PROGRAM): Fix typo.

	When printing a VM, show the type of engine being used.
	* libguile/vm.c (scm_i_vm_print): Print the engine type.

2010-05-06  Andy Wingo  <wingo@pobox.com>

	fix macros that expand into (begin (define-module ...) ...)
	* module/ice-9/boot-9.scm (define-module): Add `expand' to the
	  situations, so that we ensure the current module changes at expand
	  time.

	* module/ice-9/r6rs-libraries.scm (library): Expand the body within @@
	  expressions.

2010-05-06  Andy Wingo  <wingo@pobox.com>

	psyntax no longer attempts to track (current-module)
	* module/ice-9/psyntax.scm: Revert tracking of the current module while
	  expanding toplevel sequences. Better to preserve lexical scoping
	  (relative to the module of the original expression) and allow for @@
	  to override it.

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

	* test-suite/tests/syncase.test: Test module-changing with @@.

2010-05-06  Andy Wingo  <wingo@pobox.com>

	@@ generalized to arbitrary expressions.
	* module/ice-9/psyntax.scm (@@): The RHS of an @@ is no longer
	  restricted to be an identifier, it can be an arbitrary expression.

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

2010-05-06  Andy Wingo  <wingo@pobox.com>

	change form of @ and @@ psyntax handlers
	* module/ice-9/psyntax.scm (@, @@): Take r and w args, and also return
	  r, w, and s. Adapt callers.

2010-05-06  Andy Wingo  <wingo@pobox.com>

	add `expand' eval-when situation
	* module/ice-9/psyntax.scm (chi-when-list, chi-top): Add an undocumented
	  `expand' situation to eval-when, which will trigger at expand-time for
	  toplevel expressions. Useful when you are expanding for eval, but need
	  to do some side effect to affect the expander -- like defining a
	  module.

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

2010-05-04  Andy Wingo  <wingo@pobox.com>

	add explanatory comment to chi-macro
	* module/ice-9/psyntax.scm (chi-macro): Add comment.

	check layout when making vtables
	* libguile/struct.c (scm_is_valid_vtable_layout): New private layout
	  validating function.
	  (scm_i_struct_inherit_vtable_magic): Do a more proper layout
	  validation, and don't abort.

2010-05-03  Andy Wingo  <wingo@pobox.com>

	add rnrs libraries test suite
	* test-suite/Makefile.am:
	* test-suite/tests/rnrs-libraries.test:
	* test-suite/tests/rnrs-test-a.scm: Add rnrs libraries test suite.

2010-05-03  Julian Graham  <julian.graham@aya.yale.edu>

	add support for r6rs libraries
	* module/ice-9/boot-9.scm: Include ice-9/r6rs-libraries.scm.
	* module/ice-9/r6rs-libraries.scm: New file.
	* module/Makefile.am (NOCOMP_SOURCES): Add r6rs-libraries.scm.

2010-05-03  Andy Wingo  <wingo@pobox.com>

	only ensure local vars for definitions during expansion when compiling
	* module/ice-9/psyntax.scm (chi-top): Only modify the compile-time
	  environment to indicate that there is a local binding if we are
	  running in compile mode. Otherwise some eval-when things might not
	  have gotten executed, and our current-module could be wrong.

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

2010-05-03  Andy Wingo  <wingo@pobox.com>

	export, re-export etc as syntax-rules macros
	* module/ice-9/boot-9.scm (export, re-export, export-syntax)
	  (re-export-syntax): Rewrite as syntax-rules macros.

	rewrite use-modules and use-syntax using syntax-case
	* module/ice-9/boot-9.scm (use-modules): Rewrite as a syntax-case macro.
	  (use-syntax): Likewise.
	  (compile-interface-spec): Remove unused function

	rewrite define-module as a syntax-case macro
	* module/ice-9/boot-9.scm (define-module): Rewrite as a syntax-case
	  macro, so that the expansion has proper module hygiene. Otherwise
	  process-define-module isn't properly resolved against the root module
	  -- a bytecode file that starts with a define-module would just try to
	  look up process-define-module from the current module.
	  (compile-define-module-args): Remove. Internal, and no one else used
	  it.

	remove duplicate quasisyntax.scm EXTRA_DIST
	* module/Makefile.am (EXTRA_DIST): Remove quasisyntax.scm, as the
	  NOCOMP_SOURCES handles that case.

2010-05-02  Julian Graham  <julian.graham@aya.yale.edu>

	Test cases for `version-matches?'.
	* test-suite/tests/modules.test ("module versions"): New tests for
	  `version-matches?'.

2010-05-02  Andy Wingo  <wingo@pobox.com>

	add tour.texi to guile_TEXINFOS
	* doc/ref/Makefile.am (guile_TEXINFOS): Add tour.texi.

	Update example disassemblies
	* doc/ref/compiler.texi:
	* doc/ref/vm.texi: Update example disassemblies for current compiler,
	  which uses assert-nargs-ee/locals.

2010-05-02  Andy Wingo  <wingo@pobox.com>

	add assert-nargs-ee/locals instruction
	* libguile/vm-i-system.c (assert-nargs-ee/locals): New instruction, a
	  combination of assert-nargs-ee and reserve-locals in the case in which
	  nreq and nlocs can both be represented in 8 bits.

	* module/language/glil/compile-assembly.scm (glil->assembly): Add
	  compiler case.

	* doc/ref/vm.texi (Function Prologue Instructions): Update docs.

2010-05-02  Andy Wingo  <wingo@pobox.com>

	add underflow check in make-array
	* libguile/vm-i-scheme.c (make-array): Check for underflow before making
	  the array.

	add SCM_UNLIKELY to CHECK_UNDERFLOW
	* libguile/vm-engine.h (CHECK_OVERFLOW, CHECK_UNDERFLOW): Add
	  SCM_UNLIKELY blocks. Fix off-by-one error in CHECK_UNDERFLOW.
	  (PRE_CHECK_UNDERFLOW): New macro, for checking underflow before
	  accessing the current sp.
	  (POP): Use PRE_CHECK_UNDERFLOW.

	update compiler.texi
	* doc/ref/compiler.texi (Compiler Tower): Update for removal of version
	  from <language>, and add joiner and make-default-environment fields.
	  Update examples.
	  (The Scheme Compiler): Update for `macroexpand' instead of
	  `sc-expand', and that the environment must be a module.
	  (Tree-IL): Update for new Tree-IL, and change from "vars" to
	  "gensyms".
	  (GLIL): Update for new GLIL, including preludes and prompts.
	  (Assembly): Update for current output (which seems quite verbose).
	  (Bytecode and Objcode): Update for current output, and some procedure
	  name changes.

2010-05-02  Andy Wingo  <wingo@pobox.com>

	rename `vars' field in tree-il binding constructs to `gensyms'
	* module/language/tree-il.scm (<tree-il>): Rename `vars' fields of
	  <let>, <letrec>, <fix>, and <lambda-case> to `gensyms'. For clarity,
	  and to match <lexical-ref>.

	* module/language/tree-il.scm:
	* module/language/tree-il/analyze.scm:
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/fix-letrec.scm:
	* module/language/tree-il/inline.scm: Update all callers.

2010-05-02  Andy Wingo  <wingo@pobox.com>

	fix a comment about environments and the scheme compiler
	* module/language/scheme/compile-tree-il.scm: Fix a comment about the
	  format of environments.

2010-05-02  Andy Wingo  <wingo@pobox.com>

	remove `version' field from <language>
	* module/system/base/language.scm (<language>): Remove the `version'
	  field from languages. It just wasn't useful.

	* module/language/assembly/spec.scm:
	* module/language/brainfuck/spec.scm:
	* module/language/bytecode/spec.scm:
	* module/language/ecmascript/spec.scm:
	* module/language/elisp/spec.scm:
	* module/language/glil/spec.scm:
	* module/language/objcode/spec.scm:
	* module/language/scheme/spec.scm:
	* module/language/tree-il/spec.scm:
	* module/language/value/spec.scm: Remove #:version from all language
	  definitions. Shorten some language names (e.g. "Guile Scheme" ->
	  "Scheme").

2010-05-01  Andy Wingo  <wingo@pobox.com>

	update documentation for vm instructions
	* doc/ref/vm.texi: Update with documentation for new-ish instructions,
	  and reorganize the sections a bit.

	* doc/ref/compiler.texi (GLIL): Fix up a couple xrefs.

2010-05-01  Andy Wingo  <wingo@pobox.com>

	simplify make-struct
	* libguile/vm-i-scheme.c: Use DROPN idiom.

2010-05-01  Andy Wingo  <wingo@pobox.com>

	optimize and bugfix make-struct VM opcode
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump for make-struct
	  change.

	* libguile/struct.c (scm_i_alloc_struct): Use scm_words instead of
	  scm_gc_malloc to simplify the code and inline the call to GC_MALLOC.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile
	  make-struct/no-tail to make-struct.

	* module/language/tree-il/primitives.scm (define-primitive-expander):
	  Allow a conditional branch of #f to aboirt inlining.
	  (make-struct): Expand into make-struct/no-tail in the case that
	  tail-size is 0.

	* libguile/vm-i-scheme.c (make-struct): Adapt to always assume tail-size
	  is 0. Inline allocation if possible. Don't decrement the SP past live
	  objects on the stack, which could cause GC to miss references. Use the
	  NULLSTACK macro.

2010-04-27  Andy Wingo  <wingo@pobox.com>

	fix bug in compile-glil.scm for return opcode-hack
	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Fix entry
	  for `return'. Thanks to Jon Herron for the report.

	add module-export-all!
	* module/ice-9/boot-9.scm (module-export-all!): New function, exports
	  all current and future local variables from a module.

	Merge branch 'wip-module-namespaces'

	comment some global variables in modules.c
	* libguile/modules.c: Comment some global variables.

2010-04-26  Neil Jerram  <neil@ossau.uklinux.net>

	Fix inconsistent sectioning, causing make to fail
	* doc/ref/guile.texi (Top): Remove @raisesections and @lowersections
	  around scheme-ideas.texi.

	* doc/ref/scheme-ideas.texi (About Data, ...): Instead remove one
	  "sub" from every node here apart from the chapter node.

	* doc/ref/scheme-ideas.texi (Evaluating, Eval Variable, Eval
	  Procedure, Eval Special, Lexical Scope, Scoping Example): Turn
	  subheadings back into subsubsections, and reinstate corresponding
	  menus.  (These had to become headings, rather than (sub)*sections, when
	  the top level item in scheme-ideas.texi was a section.  Now it's a
	  chapter again, they can go back to being (sub)*sections.)

2010-04-26  Neil Jerram  <neiljerram@googlemail.com>

	Bring the manual organisation section a little closer to reality
	FWIW I'm not sure I like this bullety presentation - but for now this
	just aligns the descriptions a bit closer to the actual chapters and
	chapter contents.

	* doc/ref/intro.texi (Organisation of this Manual): Cover `Hello
	  Guile!' and `Hello Scheme!' chapters.  Thin out text for
	  `Programming in Scheme'.  Renumber other chapters.

2010-04-26  Neil Jerram  <neiljerram@googlemail.com>

	Assorted minor manual changes
	* doc/ref/guile.texi (Programming in Scheme): Remove "awful" and add
	  "as opposed to having to dive into C code", to explain what we
	  really mean here.  Remove incorrect para about the `Hello Scheme!'
	  material.

	* doc/ref/intro.texi (Interactive Programming): Change "allows" to "is
	  designed for" - sounds less accidental!

	* doc/ref/scheme-ideas.texi (Hello Scheme!): Remove unnecessary
	  "reference", and inappropriate "randomness".

2010-04-26  Neil Jerram  <neiljerram@googlemail.com>

	More `Guile and the GNU Project' text
	* doc/ref/intro.texi (Guile and the GNU Project): More text about
	  extensibility and software freedom.

2010-04-25  Neil Jerram  <neiljerram@googlemail.com>

	Move description of manual organisation from Preface to Introduction
	This material isn't "meta-" enough to be in the Preface, and it
	supports (by its structure) some of the points that the Introduction
	makes about Guile, so I think it belongs here.

	* doc/ref/intro.texi (Introduction): Add `Organisation of this Manual'
	  menu item and material to here...

	* doc/ref/preface.texi (Preface): ...from here.

2010-04-25  Neil Jerram  <neiljerram@googlemail.com>

	Remove weird instruction
	* doc/ref/intro.texi: Remove `Do not confuse the two.'  (Or else
	  what?)

	Fix typo
	* doc/ref/compiler.texi (Bytecode and Objcode): Remove extraneous
	  comma.

2010-04-25  Neil Jerram  <neiljerram@googlemail.com>

	Move `Reporting Bugs' section out of Introduction
	I think it's too detailed, when compared with the other Introduction
	sections.  It probably also refers to concepts that haven't been
	mentioned yet, but are mentioned in the following quick tour chapter;
	so let's move it there.

	* doc/ref/guile.texi: Move @raisesections and @lowersections for
	  tour.texi material from here to inside tour.texi.

	* doc/ref/intro.texi (Introduction): Don't mention reporting problems
	  in first para.  Move menu item and material for `Reporting Bugs'
	  from here...

	* doc/ref/tour.texi (Hello Guile!): ...to here.  Also mention
	  reporting problems in the introductory para.

2010-04-25  Neil Jerram  <neiljerram@googlemail.com>

	Move whirlwind tour material to its own chapter
	* doc/ref/guile.texi (Top): New top level `Hello Guile!' menu item;
	  include new file tour.texi.

	* doc/ref/intro.texi (Introduction): Remove whirlwind tour menu item
	  and material from here...

	* doc/ref/tour.texi: ...to new file here.

2010-04-25  Neil Jerram  <neiljerram@googlemail.com>

	Move Scheme introduction (Guile-independent) to its own chapter
	This magically fixes all the internal wordings that say "chapter"
	rather than "section", and separates Guile-independent and skippable
	material from material that is Guile-specific and
	probably-not-skippable - which I think is helpful.

	* doc/ref/guile.texi (Top): New `Hello Scheme!' menu item, and removed
	  `Basic Ideas' item.  Move include of scheme-ideas.texi before
	  `Programming in Scheme' chapter, using @raisesections and
	  @lowersections.  Also move scheme-reading.texi to same place.

	* doc/ref/scheme-ideas.texi: Change name from `Basic Ideas' (which is
	  a bit boring) to `Hello Scheme!'.  Move `Further Reading' menu item
	  here.

2010-04-24  Andy Wingo  <wingo@pobox.com>

	module-public-interface is a field in the module record
	* module/ice-9/boot-9.scm (module-public-interface)
	  (set-module-public-interface!): Instead of using
	  '%module-public-interface, use a field in the module instead.
	  (make-module, make-autoload-interface): Adapt.

	* module/ice-9/deprecated.scm (module-public-interface):
	  (set-module-public-interface!): Add shims so that manually munging
	  %module-public-interface should continue to work.

2010-04-24  Andy Wingo  <wingo@pobox.com>

	fix some uses of %module-public-interface
	* module/ice-9/r5rs.scm:
	* module/ice-9/safe-r5rs.scm:
	* module/oop/goops/save.scm:
	* module/oop/goops/simple.scm:
	* module/oop/goops/stklos.scm: Fix some uses of
	  %module-public-interface.

2010-04-24  Andy Wingo  <wingo@pobox.com>

	module-public-interface in Scheme
	* libguile/modules.c: Consolidate all variables to the top of the file.
	  (scm_module_public_interface): Dispatch to Scheme.
	  (scm_post_boot_init_modules): Resolve module-public-interface.

	* module/ice-9/boot-9.scm (module-public-interface): Implement in
	  Scheme.

2010-04-24  Andy Wingo  <wingo@pobox.com>

	add submodule binders
	* module/ice-9/boot-9.scm (module-submodule-binder)
	  (set-module-submodule-binder!): New field on modules.
	  (make-module, make-autoload-interface): Adapt.
	  (module-ref-submodule): If we miss the submodules table, call the
	  submodules binder, if any.

	* module/ice-9/deprecated.scm (module-ref-submodule): Check the
	  submodule binder before the deprecated look into the obarray.

2010-04-24  Andy Wingo  <wingo@pobox.com>

	module-{ref,define}-submodule use the submodules table
	* module/ice-9/boot-9.scm (module-ref-submodule)
	  (module-define-submodule!): Implement in terms of the
	  module-submodules table, instead of looking for bindings in the value
	  namespace.

	* module/ice-9/deprecated.scm (module-ref-submodule):
	  (module-define-submodule!): Define deprecated versions of these that
	  duplicate the submodules table in the normal values namespace, for
	  back compatibility.

2010-04-24  Andy Wingo  <wingo@pobox.com>

	add submodules field to modules
	* module/ice-9/boot-9.scm (module-type, module-constructor): Add a field
	  to modules, a table that will hold submodules.
	  (make-module, make-autoload-interface): Adapt.

	use nested-ref-module in (system xref)
	* module/system/xref.scm (program-callee-rev-vars): Use
	  nested-ref-module instead of nested-ref.

	nested module fixen to (ice-9 ls)
	* module/ice-9/ls.scm (local-definitions-in, definitions-in): Use nested
	  module procedures, as appropriate.
	  (recursive-local-define): Fix attempt to treat null as false. Whoops..

	deprecated %app shims use module-define-submodule!
	* module/ice-9/deprecated.scm (%app, app, modules): Don't use the module
	  interface to provide %app shims, use module-define-submodule! directly
	  to side-effect the root module.

	resolve-module uses -module variants
	* module/ice-9/boot-9.scm (resolve-module): Use module-define-submodule!
	  when binding the root, and nested-ref-module for the hot lookup, which
	  is guaranteed to return a module or #f.

	use the define-module variants in module-name and make-modules-in
	* module/ice-9/boot-9.scm (module-name): Use module-define-submodule!
	  instead of nested-define!.
	  (make-modules-in): Rewrite in terms of nested-define-module!.

	nested-ref et al use module-ref-submodule; add -module nested variants
	* module/ice-9/boot-9.scm: Update comments above nested-ref to include
	  ref-module and define-module!.
	  (nested-ref, nested-set!, nested-define!, nested-remove!): Use
	  module-ref-submodule to traverse the module hierarchy.
	  (nested-ref-module, nested-define-module!): New functions, like
	  nested-ref and nested-define!, but operate on namespaces instead of
	  values.
	  (local-ref-module, local-define-module): New analogs of local-ref and
	  local-define, but for namespaces.

2010-04-23  Andy Wingo  <wingo@pobox.com>

	add module-ref-submodule, module-define-submodule!
	* module/ice-9/boot-9.scm (module-ref-submodule):
	  (module-define-submodule!): New stubs, will be used to separate
	  traversing the module tree from accessing values.

	tweak to resolve-module
	* module/ice-9/boot-9.scm (resolve-module): If we found a module but it
	  didn't have a public interface and we're not autoloading, just return
	  the module directly instead of dispatching to make-modules-in.

	fix (app modules) usage in (ice-9 session)
	* module/ice-9/session.scm (root-modules): Fix '(app modules) usage.

2010-04-22  Andy Wingo  <wingo@pobox.com>

	deprecate %app
	* module/ice-9/boot-9.scm (module-name): Don't rely on (%app modules),
	  use other tricks to name anonymous modules.
	  (resolve-module): Instead of relying on %app, close over the root of
	  the module hierarchy -- the module that was '(%app modules).

	* module/ice-9/deprecated.scm (%app): Provide a compatible %app shim.

2010-04-22  Andy Wingo  <wingo@pobox.com>

	refactorings for the module boot process
	* module/ice-9/boot-9.scm (%app): Bind %app and (%app modules) within
	  the nested hierarchy before making (guile).
	  (the-root-module): Define to '(%app modules guile) together with
	  the-root-module's definition.
	  (resolve-module): Define a "phase 2" resolve-module that only works on the
	  root module.
	  (try-module-autoload): No need for stub definition, as modules.c does
	  not reference this binding.
	  (resolve-module): Redefine, after modules have been loaded, to
	  actually do its job, without any hacks for the pre-boot phase.

	  Move up the boot code before the definition of resolve-module's
	  helpers.

2010-04-22  Andy Wingo  <wingo@pobox.com>

	add comments to resolve-module
	* module/ice-9/boot-9.scm (resolve-module): Add comments.

	formally deprecate `app'
	* module/ice-9/deprecated.scm (app): Deprecate.
	* module/ice-9/boot-9.scm: Remove app definition.

	(app modules) -> (%app modules)
	* module/ice-9/debugging/breakpoints.scm (module-if-already-loaded):
	  (all-loaded-modules):
	* module/oop/goops/stklos.scm: Fix instances of (app modules) to be
	  (%app modules).

2010-04-20  Andy Wingo  <wingo@pobox.com>

	fix comment about "local-define" and "local-remove".
	* module/ice-9/boot-9.scm: Fix comment about "local-define!", whereas
	  it's "local-define". Same for "local-remove".

2010-04-20  Andy Wingo  <wingo@pobox.com>

	module-type defined programmatically
	* module/ice-9/boot-9.scm (make-record-type): Add an explanatory
	  comment.
	  (%print-module): Remove a hacky comment about redefinitions being
	  difficult, because now the module-printer is called by name from
	  module-type's printer.
	  (module-type): Define the module type, its constructor, predicate, and
	  accessors programmatically, at expansion time. Should reduce any
	  errors in transcription, between adding fields and adding accessors.

	* libguile/modules.c (scm_lookup_closure_module): Move an explanatory
	  comment here from boot-9.scm.

2010-04-19  Andy Wingo  <wingo@pobox.com>

	avoid primitive-eval in record-constructor
	* module/ice-9/boot-9.scm (record-type-vtable): Add a third field, a
	  precomputed constructor. There is an unfortunate circularity here,
	  though.
	  (make-record-type): If the record has fewer than 20 fields,
	  return a constructor pre-generated to suit. Otherwise just check the
	  length, and dispatch to `apply' and not `primitive-eval'. FWIW the
	  current module record has something like 12 fields.
	  (record-constructor): If we're asking for the standard constructor,
	  return the precomputed constructor.

2010-04-19  Andy Wingo  <wingo@pobox.com>

	make-record-type slight refactor
	* test-suite/tests/records.test ("records"): Add tests for printers.

	* module/ice-9/boot-9.scm (make-record-type): Refactor the code that
	  makes the default printer.

2010-04-19  Andy Wingo  <wingo@pobox.com>

	filesystem trickery to scm_i_relativize_path in filesys.c; bugfix.
	* libguile/filesys.h:
	* libguile/filesys.c (scm_i_relativize_path): New function, moved here
	  from fports.c. Internal for now; we can make it external though if
	  people like its interface.

	* libguile/fports.c (fport_canonicalize_filename): Move all of the
	  tricky bits to filesys.c. Also fixes a bug in which a delimiter wasn't
	  stripped.

2010-04-19  Andy Wingo  <wingo@pobox.com>

	deprecate @bind
	* module/ice-9/boot-9.scm:
	* module/ice-9/deprecated.scm (@bind): Deprecate @bind, which was a
	  thread-unsafe dynamic scoping mechanism, used in the old elisp
	  support. Fluids are more correct, and are probably faster, given the
	  VM support for with-fluids.

	* test-suite/tests/dynamic-scope.test: Remove.
	* test-suite/tests/fluids.test: Move relevant tests from
	  dynamic-scope.test here, recast in terms of with-fluids.

2010-04-19  Andy Wingo  <wingo@pobox.com>

	compile-file gets #:canonicalization arg, defaults to 'relative
	* module/system/base/compile.scm (compile-file, compile-and-load): Add a
	  keyword arg #:canonicalization, which defaults to 'relative. In this
	  way, one might compile "../module/ice-9/boot-9.scm", but the path that
	  gets residualized into the .go is "ice-9/boot-9.scm".

	%file-port-name-canonicalization is a fluid
	* libguile/fports.c (fport_canonicalize_filename):
	  (scm_init_fports): Change %file-port-name-canonicalization to be a
	  fluid.

	add %file-port-name-canonicalization option
	* libguile/fports.c (%file-port-name-canonicalization): New global var.
	  (fport_canonicalize_filename): New helper. If
	  %file-port-name-canonicalization is 'absolute, then run file port
	  names through canonicalize_path; if it's 'relative, then canonicalize
	  the name, but strip off load paths; otherwise leave the port name
	  alone.
	  (scm_open_file): Use fport_canonicalize_filename.
	  (scm_init_fports): Define %file-port-name-canonicalization.

	formatting fix
	* libguile/filesys.c (scm_canonicalize_path): Format fix.

	use procedure-minimum-arity in tests
	* test-suite/tests/procprop.test ("procedure-arity"): Fix tests to use
	  procedure-minimum-arity.

2010-04-17  Andy Wingo  <wingo@pobox.com>

	deprecate arity access via (procedure-properties proc 'arity)
	* libguile/procprop.h (scm_sym_arity): Deprecate. I didn't move it to
	  deprecated.h though, because that might have some boot implications --
	  though I didn't check.

	* libguile/procprop.c (scm_procedure_properties)
	  (scm_set_procedure_properties_x, scm_procedure_property)
	  (scm_set_procedure_property_x): Deprecate access to a procedure's
	  arity via procedure-properties. Users should use
	  procedure-minimum-arity.

	* module/ice-9/channel.scm (eval):
	* module/ice-9/session.scm (arity):
	* module/language/tree-il/analyze.scm (validate-arity): Fix up instances
	  of (procedure-property x 'arity) to use procedure-minimum-arity.

2010-04-17  Andy Wingo  <wingo@pobox.com>

	add procedure_minimum_arity
	* libguile/procprop.h:
	* libguile/procprop.c (scm_procedure_minimum_arity): New public
	  function, will replace (procedure-property foo 'arity).

	* libguile/programs.c (scm_i_program_arity): Rework to always provide
	  the most permissive arity.

2010-04-17  Andy Wingo  <wingo@pobox.com>

	remove program-name, program-documentation
	* libguile/programs.h:
	* libguile/programs.c (scm_program_name): Remove. procedure-name is
	  sufficient.

	* module/system/vm/program.scm (program-name): Remove from exports list.
	  (program-documentation): Remove; procedure-documentation is
	  sufficient.

	* libguile/debug.c (scm_procedure_name): Remove special case for
	  programs.

	* module/language/tree-il/analyze.scm (validate-arity): Use
	  procedure-name.

	* module/ice-9/documentation.scm (object-documentation): Just use
	  procedure-documentation, without special cases for programs.

2010-04-17  Andy Wingo  <wingo@pobox.com>

	scm_i_program_properties is internal; just use procedure-properties
	* libguile/programs.h:
	* libguile/programs.c (scm_i_program_properties): Make internal.
	  (scm_program_name): Use scm_i_program_properties.

	* libguile/procprop.c (scm_procedure_properties): Use
	  scm_i_program_properties, for programs.

	* libguile/procs.c (scm_procedure_documentation): Use procedure-property
	  to get to 'documentation, not program-property.

	* module/system/vm/program.scm (program-properties, program-property):
	  Remove from the exports list.
	  (program-documentation): Use procedure-property.

	* module/texinfo/reflection.scm (macro-arguments)
	  (macro-additional-stexi)
	  (object-stexi-documentation): Use procedure-property, not
	  program-property.

2010-04-17  Andy Wingo  <wingo@pobox.com>

	tweaks to procprop.c
	* libguile/procprop.c (scm_procedure_property)
	  (scm_set_procedure_property_x): Fix up some variable naming.

	procedure-properties incorporates program-properties
	* libguile/procprop.c (overrides, overrides_lock): Rename from props and
	  props_lock.
	  (scm_procedure_properties): If no overrides have been set, default to
	  scm_program_properties (if it's a program).
	  (scm_set_procedure_properties_x): Error if 'arity is in the alist.
	  (scm_procedure_property): Just do a lookup in the
	  scm_procedure_properties.
	  (scm_set_procedure_properties_x): Init the overrides to
	  scm_procedure_properties.

	fix read.bm
	* benchmark-suite/benchmarks/read.bm (%files-to-load): psyntax-pp.scm,
	  not psyntax.scm.

2010-04-16  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'wip-manual-2'
	Conflicts:

		doc/ref/api-translation.texi

2010-04-16  Andy Wingo  <wingo@pobox.com>

	fold in feedback to api-languages
	* doc/ref/api-languages.texi: Fold in feedback.

	NEWS tweaks for nil
	* NEWS: Some nil-related news fixes; after 1.9.10, I know, but hey ;-)

	more nil docs
	* doc/ref/api-languages.texi (Nil): Be a bit more thorough, and
	  positive.

	add docs on `nil'
	* doc/ref/api-languages.texi (Nil): Write about `nil'.

	fix bugs in ice-9 i18n demo (invalid input)
	* doc/ref/api-i18n.texi (Accessing Locale Information): Crucial
	  bugfixes.

	fixes to api-i18n.texi
	* doc/ref/api-i18n.texi (Character Case Mapping): Remove note about lack
	  of support for multibute characters.

	flesh out docs on multiple languages a bit more
	* doc/ref/api-languages.texi: Move here from api-translation. Still
	  stubbed in parts, but it's getting better.
	* doc/ref/Makefile.am: Adapt to api-languages.texi name change.
	* doc/ref/guile.texi: Likewise.

2010-04-15  Ludovic Courtès  <ludo@gnu.org>

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

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

	Improvements to Introduction chapter
	* doc/ref/intro.texi (Introduction): Change "some" to "the".
	  (Guile and Scheme): "multithreading" -> "multithreaded".
	  (Combining with C): Mention "libguile" as library name.
	  (Guile and the GNU Project): New text.
	  (Interactive Programming): New text.
	  (Supporting Multiple Languages): New text, reflecting currently
	  supported languages.
	  (Obtaining and Installing Guile): Use @var for version placeholder.
	  Remove mention of separate tutorial.

2010-04-10  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'master' into wip-manual-2
	Conflicts:

		doc/ref/api-procedures.texi
		doc/ref/misc-modules.texi

	(Caused by me removing `@page' from a couple of sections that have been modified
	by others.)

2010-04-09  Andy Wingo  <wingo@pobox.com>

	elisp.test cleanups
	* test-suite/tests/elisp.test: Use quote and #nil instead of quasiquote
	  and ,#nil.

	re-enable elisp test
	* test-suite/tests/elisp.test: Rework for #nil, to actually be enabled,
	  to always run, and to use the new compiler. Comment out some failing tests, to
	  be dealt with in the future.

	change remaining %nil -> #nil
	* doc/ref/vm.texi:
	* libguile/boolean.h:
	* libguile/pairs.h:
	* module/language/elisp/README:
	* test-suite/tests/elisp-compiler.test:
	* test-suite/tests/load.test: Change remaining mentions of %nil to #nil.

2010-04-09  Andy Wingo  <wingo@pobox.com>

	elisp fixes for nil, and, or
	* module/language/elisp/runtime/macro-slot.scm (or, and): Fix one-arg
	  case to return the arg as-is.

	* module/language/elisp/runtime.scm (nil-value): Fix to be #nil.

2010-04-09  Andy Wingo  <wingo@pobox.com>

	remove libguile/lang.h, deprecate %nil (in favor of #nil)
	* libguile/Makefile.am:
	* libguile/init.c:
	* libguile/lang.c:
	* libguile/lang.h: Remove lang.c and lang.h.

	* libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here.

	* module/ice-9/deprecated.scm (%nil): %nil definition moved here.

	* libguile/alist.c:
	* libguile/async.c:
	* libguile/backtrace.c:
	* libguile/boolean.c:
	* libguile/dynl.c:
	* libguile/eval.c:
	* libguile/filesys.c:
	* libguile/fluids.c:
	* libguile/list.c:
	* libguile/load.c:
	* libguile/options.c:
	* libguile/posix.c:
	* libguile/print.c:
	* libguile/promises.c:
	* libguile/sort.c:
	* libguile/throw.c:
	* libguile/trees.c:
	* libguile/vectors.c:
	* libguile/vm.c:
	* libguile/weaks.c:
	* srfi/srfi-1.c: <libguile/lang.h> references removed.

2010-04-09  Andy Wingo  <wingo@pobox.com>

	%nil -> #nil
	* module/language/assembly.scm (object->assembly, assembly->object):
	* module/language/elisp/compile-tree-il.scm (compile-pair):
	* module/language/glil/decompile-assembly.scm (decompile-load-program):
	  Change instances of %nil to #nil.

2010-04-09  Andy Wingo  <wingo@pobox.com>

	add read syntax for #nil
	* libguile/evalext.c (scm_self_evaluating_p): #nil is self-evaluating.

	* libguile/read.c (scm_read_nil, scm_read_sharp): Add read syntax for
	  #nil.

2010-04-09  Andy Wingo  <wingo@pobox.com>

	lisp nil always enabled
	* configure.ac: Remove --disable-elisp option. Lisp nil is always
	  enabled.

	* libguile/boolean.h:
	* libguile/gen-scmconfig.c:
	* libguile/gen-scmconfig.h.in:
	* libguile/init.c:
	* libguile/lang.c:
	* libguile/lang.h:
	* libguile/pairs.h:
	* libguile/private-options.h:
	* libguile/read.c: Remove conditionals for disabling elisp.

2010-04-09  Andy Wingo  <wingo@pobox.com>

	add debugging input and output ports
	* module/system/vm/debug.scm (*debug-input-port*):
	  (*debug-output-port*): New public fluids.
	  (run-debugger): Add some kwargs for input and output ports, defaulting
	  to the debug input and output ports.
	  (debug-pre-unwind-handler): Print to debug output port.
	  (debug): Untabify.

	repl-reader only prompts if no input is available
	* module/ice-9/boot-9.scm (repl-reader): For the default (non-readline)
	  repl reader, only display the prompt if input isn't already available.
	  Fixes spurious prompts in the debugger.

2010-04-09  Ludovic Courtès  <ludo@gnu.org>

	Raise an error when attempting to modify the value of `%null-pointer'.
	* libguile/foreign.c (sym_null_pointer_error): New variable.
	  (null_pointer_error): New function.
	  (scm_foreign_set_x): Raise an error if attempting to modify
	  NULL_POINTER.
	  (scm_foreign_to_bytevector): Use `null_pointer_error ()' instead of
	  `scm_misc_error ()'.

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

	* test-suite/Makefile.am (SCM_TESTS): Add tests/foreign.test.

	* test-suite/lib.scm (exception:null-pointer-error): New variable.

2010-04-09  Ludovic Courtès  <ludo@gnu.org>

	Allocate foreign pointer objects in GC-scanned memory.
	* libguile/foreign.c (scm_take_foreign_pointer): Allocate RET in
	  GC-scanned memory.  This fixes a bug where the object pointed to by
	  SCM_CIF in the pair returned by `cif_to_procedure ()' would be
	  reclaimed (as a consequence of commit
	  087aa6aa312a8d0af51fa9b2f7bfc1332ad97338).

	Avoid obsolescent C declarator with empty parentheses.
	* libguile/foreign.c (scm_i_foreign_call): Don't declare FUNC with a
	  declarator with empty parentheses (bug #23681).

2010-04-09  Ludovic Courtès  <ludo@gnu.org>

	Fix `module-reverse-lookup'.
	* libguile/modules.c (scm_module_reverse_lookup): Type-check VARIABLE.
	  Don't traverse the `uses' list when MODULE is #f.

	* test-suite/tests/modules.test ("foundations")["module-reverse-lookup
	  [pre-module-obarray]", "module-reverse-lookup [wrong-type-arg]"]: New
	  tests.

2010-04-09  Ludovic Courtès  <ludo@gnu.org>

	Remove `fold' from (sxml fold).
	* module/sxml/fold.scm: Use (srfi srfi-1).
	  (fold): Remove.
	  (fold-values): Update docstring accordingly.

	* test-suite/tests/sxml.fold.test: Use (srfi srfi-1).

2010-04-08  Andy Wingo  <wingo@pobox.com>

	fix curried definitions for value defines
	* module/ice-9/curried-definitions.scm: Allow definitions of values with
	  define and define*.
	* test-suite/tests/curried-definitions.test: Add tests.

	sync regs before calling scm_class_of
	* libguile/vm-i-scheme.c (class-of): Sync registers before calling
	  scm_class_of.

2010-04-08  Andy Wingo  <wingo@pobox.com>

	add (ice-9 curried definitions)
	* module/Makefile.am:
	* module/ice-9/curried-definitions.scm: New module, implementing
	  SICM-style currying.

	* test-suite/Makefile.am:
	* test-suite/tests/curried-definitions.test: A test.

2010-04-08  Andy Wingo  <wingo@pobox.com>

	fix bug when importing bindings that were already imported and used
	* module/ice-9/boot-9.scm (module-use!, module-use-interfaces!): When
	  adding the module or interface to the use list, clear the cached
	  imports obarray.

	  The test case is coming next.

2010-04-07  Andy Wingo  <wingo@pobox.com>

	update licenses on tests imported from guile-lib
	* test-suite/tests/sxml.fold.test:
	* test-suite/tests/sxml.ssax.test:
	* test-suite/tests/sxml.transform.test:
	* test-suite/tests/sxml.xpath.test:
	* test-suite/tests/texinfo.docbook.test:
	* test-suite/tests/texinfo.serialize.test:
	* test-suite/tests/texinfo.string-utils.test:
	* test-suite/tests/texinfo.test: Update licenses to GPL or LGPL 3+, and
	  update copyright holders to be FSF (where that is the case). Copyright
	  holders who are not FSF have their code in GPL/LGPL-compatible
	  licesnse.

	add docs and tests for array->list
	* libguile/generalized-arrays.c (scm_array_to_list): Add docs.
	* test-suite/tests/arrays.test ("array->list"): Add tests.

	update NEWS for 1.9.10
	* NEWS: Update for new 1.9.10 entries.

	very important fix to (system repl command)
	* module/system/repl/command.scm (language): s/Have fun/Happy hacking/.
	  Heh.

	deprecated sc-expand in deprecated (ice-9 syncase)
	* module/ice-9/syncase.scm: Export sc-expand as macroexpand.

	Update NEWS to reflect the current state
	* NEWS: Update a number of old entries.

2010-04-06  Andy Wingo  <wingo@pobox.com>

	remove transient 1.9.9 entries from the NEWS
	* NEWS: Cull 1.9.9 entries.

	finish ffi docs
	* libguile/foreign.c: Some doc tweaks.
	* doc/ref/api-foreign.texi: Finish FFI docs.

	more ffi docs
	* libguile/foreign.c (scm_make_foreign_function): Doc a little.
	* doc/ref/api-foreign.texi (Foreign Function Interface): Document some
	  more.

2010-04-03  Michael Gran  <spk121@yahoo.com>

	copyright dates
	* libguile/unidata_to_charset.pl: change copyright date
	* test-suite/tests/srfi-14.test: change copyright date

2010-04-03  Michael Gran  <spk121@yahoo.com>

	Remove obsolete docs for multi-byte text
	These describe the initial, unimplemented plan for Unicode
	support.  These have been overcome by events.

	* doc/mbapi.texi: removed
	* doc/mltext.texi: removed

2010-04-03  Michael Gran  <spk121@yahoo.com>

	Update standard character sets to Unicode 5.2
	* srfi-14.i.c: all character ranges updated to Unicode 5.2

2010-04-03  Michael Gran  <spk121@yahoo.com>

	Unicode data parsing script incorrect for char-set:ascii
	char-set:ascii is the only char-set consisting of a single contiguous
	range, and there was an off-by-one error for that case.

	* libguile/unidata_to_charset.pl (compute): fix off-by-one

2010-04-02  Andy Wingo  <wingo@pobox.com>

	deprecate dynamic-args-call, and update docs some more
	* libguile/deprecated.h (scm_dynamic_args_call): Deprecate.
	* libguile/deprecated.c:
	* libguile/dynl.h:
	* libguile/dynl.c:

	* doc/ref/api-foreign.texi: More doc updates.

2010-04-02  Andy Wingo  <wingo@pobox.com>

	add api-foreign.texi
	* doc/ref/api-foreign.texi: New file.
	* doc/ref/api-modules.texi: Reorganize bits about dynamic linking into
	  api-foreign.

	* doc/ref/guile.texi:
	* doc/ref/Makefile.am: Adapt to api-foreign.texi.

2010-04-01  Andy Wingo  <wingo@pobox.com>

	fix vector-ref and vector-set opcodes for weak vectors
	* libguile/vectors.h (SCM_I_IS_NONWEAK_VECTOR): New internal predicate.
	* libguile/vm-i-scheme.c (vector-ref, vector-set): Only inline access to
	  nonweak vectors.

2010-04-01  Andy Wingo  <wingo@pobox.com>

	more fixes to equal? for arrays
	* libguile/array-map.c (array_compare, scm_array_equal_p): Rewrite as
	  something that operates on the generic array handle infrastructure.
	  Based on array->list.
	  (scm_i_array_equal_p): Change the docs, as array-equal? is now the same
	  as equal?, except that it typechecks its args.

	* doc/ref/api-compound.texi (Array Procedures): Update array-equal?
	  docs.

	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_raequal): Deprecate.

	* libguile/bytevectors.c (scm_bytevector_eq_p): Bugfix: bytevectors are
	  bytevector=? only if their element type is the same.

	* libguile/eq.c (scm_equal_p): Only dispatch to scm_array_equal_p if
	  both args are arrays (generically).

	* test-suite/tests/arrays.test ("equal?"): Add some more tests.

2010-03-31  Andy Wingo  <wingo@pobox.com>

	fix array bugs in ecmascript
	* module/language/ecmascript/array.scm (pput, *array-prototype*): Fix
	  bugs in ecmascript array runtime.

	fix bug in ash opcode
	* libguile/vm-i-scheme.c (ash): Fix embarrassing bug in (ash 1 32).
	* test-suite/tests/bit-operations.test ("bitshifts on word boundaries"):
	  Add tests.

2010-03-31  Andy Wingo  <wingo@pobox.com>

	rename unif.test to arrays.test
	* test-suite/tests/arrays.test: Move all unif.test here. Unif.test was
	  mostly testing arrays anyway. Incorporate the existing arrays.test.

	* test-suite/tests/unif.test: Deleted.
	* test-suite/Makefile.am: Update.

2010-03-31  Ludovic Courtès  <ludo@gnu.org>

	Move another GOOPS-less test at the beginning.
	* test-suite/tests/eval.test ("promises")["extended promise
	  behaviour"]("implicit forcing is not supported"): Move...
	* test-suite/tests/00-initial-env.test ("goopsless"): ... here.

2010-03-31  Ludovic Courtès  <ludo@gnu.org>

	Add separate test file for GOOPS-less tests.
	* test-suite/tests/00-initial-env.test: New file.

	* test-suite/Makefile.am (SCM_TESTS): Add `tests/00-initial-env.test'.

	* test-suite/tests/numbers.test ("+")["wrong type argument"]: Move to
	  `00-initial-env.test'.

2010-03-31  Ludovic Courtès  <ludo@gnu.org>

	Adapt ECMAScript parser and lexer to `(system base lalr)'.
	* module/language/ecmascript/tokenize.scm: Use `make-lexical-token' and
	  related procedures instead of pairs as tokens passed to the parser.
	  Pass source location information in the form of `source-location'
	  objects.

	* module/language/ecmascript/parse.scm (read-ecmascript,
	  read-ecmascript/1): Instantiate a new parser at each call.
	  (parse-ecmascript): Rename to...
	  (make-parser): ... this.  Change `->' to `:' in the grammar syntax.

	* module/language/ecmascript/parse-lalr.scm: Remove.

	* module/Makefile.am (ECMASCRIPT_LANG_SOURCES): Remove
	  `language/ecmascript/parse-lalr.scm'.

2010-03-31  Ludovic Courtès  <ludo@gnu.org>

	Add rudimentary ECMAScript tests.
	* test-suite/Makefile.am (SCM_TESTS): Add `tests/ecmascript.test'.

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

2010-03-31  Ludovic Courtès  <ludo@gnu.org>

	Mention `(system base lalr)' in the manual.
	* doc/ref/Makefile.am (guile_TEXINFOS): Add `api-lalr.texi'.

	* doc/ref/api-lalr.texi: New file.

	* doc/ref/guile.texi (API Reference): Include it.

2010-03-31  Ludovic Courtès  <ludo@gnu.org>

	Add Boucher's `lalr-scm' as the `(system base lalr)' module.
	Taken from r51 of <http://lalr-scm.googlecode.com/svn/trunk>.

	* module/Makefile.am (SYSTEM_BASE_SOURCES): Add `system/base/lalr.scm'.
	  (NOCOMP_SOURCES): Add `system/base/lalr.upstream.scm'.

	* module/system/base/lalr.scm, module/system/base/lalr.upstream.scm: New
	  files.

	* test-suite/Makefile.am (LALR_TESTS, LALR_EXTRA, TESTS,
	  TESTS_ENVIRONMENT): New variables.
	  (EXTRA_DIST): Add $(LALR_EXTRA).

	* test-suite/lalr/common-test.scm,
	  test-suite/lalr/glr-test.scm,
	  test-suite/lalr/test-glr-associativity.scm,
	  test-suite/lalr/test-glr-basics-01.scm,
	  test-suite/lalr/test-glr-basics-02.scm,
	  test-suite/lalr/test-glr-basics-03.scm,
	  test-suite/lalr/test-glr-basics-04.scm,
	  test-suite/lalr/test-glr-basics-05.scm,
	  test-suite/lalr/test-glr-script-expression.scm,
	  test-suite/lalr/test-glr-single-expressions.scm,
	  test-suite/lalr/test-lr-associativity-01.scm,
	  test-suite/lalr/test-lr-associativity-02.scm,
	  test-suite/lalr/test-lr-associativity-03.scm,
	  test-suite/lalr/test-lr-associativity-04.scm,
	  test-suite/lalr/test-lr-basics-01.scm,
	  test-suite/lalr/test-lr-basics-02.scm,
	  test-suite/lalr/test-lr-basics-03.scm,
	  test-suite/lalr/test-lr-basics-04.scm,
	  test-suite/lalr/test-lr-basics-05.scm,
	  test-suite/lalr/test-lr-error-recovery-01.scm,
	  test-suite/lalr/test-lr-error-recovery-02.scm,
	  test-suite/lalr/test-lr-no-clause.scm,
	  test-suite/lalr/test-lr-script-expression.scm,
	  test-suite/lalr/test-lr-single-expressions.scm: New files.

2010-03-31  Andy Wingo  <wingo@pobox.com>

	fix equal? between an array and a non-array
	OK let's try again. While the thanks go to Daniel Llorens del Río for
	the tip, the blame continues going to me :)

	* test-suite/Makefile.am:
	* test-suite/tests/arrays.test: Add a test.

	* libguile/array-map.c (raeql): Handle a few 0-dimensional cases. If the
	  shapes of the arrays don't match, just return #f instead of raising
	  an error.

2010-03-30  Andy Wingo  <wingo@pobox.com>

	Revert "fix equal? between an array and a non-array"
	This reverts commit 9d031d4d575ac8f343a5d984cb02cd374577c5a9.

2010-03-30  Andy Wingo  <wingo@pobox.com>

	fix equal? between an array and a non-array
	* libguile/eq.c (scm_equal_p): Only call scm_array_equal_p if both
	  arguments are generalized arrays; otherwise they are not equal. Thanks
	  to Daniel Llorens del Río for the tip.

	* test-suite/Makefile.am:
	* test-suite/tests/arrays.test: Add a test.

2010-03-30  Andy Wingo  <wingo@pobox.com>

	correctly handle --no-autocompile (fixed broken previous patch)
	* libguile/load.c (scm_init_load): Initialize %load-should-autocompile
	  to false.

	* libguile/init.c (scm_i_init_guile):
	* libguile/load.h:
	* libguile/load.c (scm_init_load_should_autocompile): At the end of
	  init, check GUILE_AUTO_COMPILE.

	* libguile/script.c (scm_compile_shell_switches): Instead of making
	  --autocompile / --no-autocompile render into the s-expression, just
	  handle them immediately, so that --no-autocompile takes effect for the
	  expander.

2010-03-30  Andy Wingo  <wingo@pobox.com>

	nil is null, whee
	* libguile/pairs.h (scm_is_null): Nil is also null.

	* libguile/vm-i-scheme.c (not, not-not, null?, not-null?):
	* libguile/vm-i-system.c (br-if-null, br-if-not-null): Remove some more
	  nil special cases.

2010-03-30  Andy Wingo  <wingo@pobox.com>

	nil is false, whee
	* libguile/boolean.h (scm_is_false): Recognize nil as false, by default.
	  (scm_is_bool): Recognize nil as a boolean.

	* libguile/boolean.c (scm_not, scm_boolean, scm_to_bool, scm_is_bool):
	  Adapt to treat nil as false.

	* libguile/vm-i-system.c (br-if, br-if-not): Just use scm_is_false
	  instead of specifically mentioning nil.

2010-03-30  Andy Wingo  <wingo@pobox.com>

	going through scm_shell not necessary to get autocompilation
	* libguile/load.c (scm_init_load): Initialize %load-should-autocompile
	  from the environment variable here, so that apps that don't go through
	  scm_shell get autocompilation.

	* libguile/script.c (scm_compile_shell_switches): Explicitly enable or
	  disable autocompilation here, if told to do so.

2010-03-29  Andy Wingo  <wingo@pobox.com>

	fix bug in scm_must_free
	* libguile/gc-malloc.c: Update a comment.
	  (scm_must_free): Must be able to free memory allocated with
	  scm_must_malloc, and thus must be GC_FREE, not free.

	remove out-of-date comment in scm_gc_malloc
	* libguile/gc-malloc.c (scm_gc_malloc): Remove out-of-date comment.

	(texinfo reflection) parses out macro metadata
	* module/texinfo/reflection.scm (macro-arguments):
	  (macro-additional-stexi, object-stexi-documentation): Parse out the
	  metadata in macros, if it is available, so we can show defmacros'
	  arguments, syntax-rules' patterns, etc.

2010-03-29  Andy Wingo  <wingo@pobox.com>

	metadata for syntax-rules, identifier-syntax, and define-macro macros
	* module/ice-9/psyntax.scm (syntax-rules, identifier-syntax):
	* module/ice-9/boot-9.scm (define-macro): Embed metadata into the macro
	  transformer for use by documentation tools and the like.

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

2010-03-28  Mark H Weaver  <mhw@netris.org>

	Renumber IFLAGSs so the first 8 are reserved for lisp booleans.
	This enables more efficient implementations of several operations,
	e.g. scm_is_lisp_bool, canonicalize_boolean, fast_boolean_not,
	converting SCM booleans to C booleans, etc.

	* libguile/tags.h: Renumber IFLAGs.

	* libguile/print.c: Renumber iflagnames to match.

	* libguile/boolean.c:
	* libguile/boolean.h:
	  SCM_XXX_ANOTHER_BOOLEAN_DONT_USE --> SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0

2010-03-28  Andy Wingo  <wingo@pobox.com>

	Fix inlining of lambda-apply-lambda.
	* module/language/tree-il/inline.scm (inline!): Only inline (lambda args
	  (apply (lambda ...) args)) if the outer lambda has rest args. Thanks
	  to Mark Weaver for the note.

2010-03-26  Andy Wingo  <wingo@pobox.com>

	remove spurious declarations in c-tokenize.lex
	* libguile/c-tokenize.lex: Remove spurious declarations of flex-internal
	  functions, as their prototypes are changing in upstream flex.

2010-03-25  Andy Wingo  <wingo@pobox.com>

	vectors of pairs in docstring position are metadata
	* module/ice-9/psyntax.scm (chi-lambda-case, lambda): If we find a
	  vector of pairs in the docstring position, interpret those pairs as
	  additional metadata.

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

2010-03-25  Andy Wingo  <wingo@pobox.com>

	psyntax supports multiple docstrings, merging lambda-case metadata
	* module/ice-9/psyntax.scm (build-simple-lambda, build-case-lambda):
	  Don't take a docstring, take a metadata alist. Don't bother annotating
	  interpreted expressions with docstrings.
	  (chi-simple-lambda): Take already-parsed metadata.
	  (lambda): Parse out multiple docstrings as separate "documentation"
	  entries in the "meta".
	  (chi-lambda-case): Merge multiple "meta" entries among the various
	  cases.
	  (lambda*, case-lambda, case-lambda*): Receive "meta" clauses, not
	  docstrings.

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

2010-03-23  Andy Wingo  <wingo@pobox.com>

	make guile's welcome more gnu-conventional; also warranty and copying info
	* module/system/repl/command.scm: Add support for ,show with topics
	  "warranty", "copying", and "version".
	  (language): Don't re-print the welcome; print sometime more terse.
	* module/system/repl/common.scm (*version*, *warranty*, *copying*): New
	  public globals.
	  (repl-welcome): Display *version*.

2010-03-22  Andy Wingo  <wingo@pobox.com>

	Update manual examples of how to link with Guile
	* doc/ref/intro.texi (Linking Guile into Programs):
	* doc/ref/libguile-linking.texi (A Sample Guile Main Program): Update
	  examples of how to link with guile.

2010-03-20  Ludovic Courtès  <ludo@gnu.org>

	Make `include' tail-recursive.
	* module/ice-9/psyntax.scm (include)[read-file]: Make tail-recursive.

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

2010-03-20  Ludovic Courtès  <ludo@gnu.org>

	Cosmetic changes in `foreign.c'.
	* libguile/foreign.c (unpack, pack): Add `const' qualifier for `type'.
	  Comment.  Indent.
	  (scm_i_foreign_call): Add `const' qualifier for `argv'.  Punctuate
	  comments.  Clarify argument unpacking loop.

	Fix argument passing to foreign functions.
	* libguile/foreign.c (scm_i_foreign_call): When allocating room for
	  DATA, use the sum of all the argument sizes, not `cif->bytes'.

2010-03-19  Andy Wingo  <wingo@pobox.com>

	fix srfi-31 check after macroexpand rename
	* test-suite/tests/srfi-31.test: ("rec special form"): Fix check.

	rename sc-expand to macroexpand
	* module/ice-9/boot-9.scm (macroexpand): Rename from sc-expand.
	  (%pre-modules-transformer): Adapt to name change.
	* module/ice-9/compile-psyntax.scm: Adapt to name change.
	* module/ice-9/psyntax-pp.scm: Regenerated.
	* module/ice-9/psyntax.scm: Rename sc-expand to macroexpand.
	* module/language/scheme/compile-tree-il.scm (compile-tree-il): Adapt to
	  name change.

	finish macro docs
	* doc/ref/api-macros.texi: Finish macro docs.

2010-03-19  Andy Wingo  <wingo@pobox.com>

	document syntax-case
	* doc/ref/api-macros.texi: Document syntax-case, and tweak defmacro
	  docs.

	* doc/ref/api-debug.texi: Move cons-source here.

2010-03-19  Andy Wingo  <wingo@pobox.com>

	add GUILE-VERSION to CONFIG_STATUS_DEPENDENCIES
	* Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add GUILE-VERSION, so that a
	  change in GUILE-VERSION causes a reconfigure.

2010-03-18  Ludovic Courtès  <ludo@gnu.org>

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

	Update `NEWS'.

2010-03-18  Andy Wingo  <wingo@pobox.com>

	A start at syntax-rules docs
	* doc/ref/api-macros.texi: New file, documenting macros. Removed some
	  old cruft, and started documenting hygienic macros.

	* doc/ref/api-procedures.texi: Moved macro things out of here.

	* doc/ref/guile.texi: Separate macros from procedures.

	* doc/ref/api-data.texi: Update some xrefs.

	* doc/ref/Makefile.am: Add api-macros.texi.

2010-03-18  Ludovic Courtès  <ludo@gnu.org>

	Improve encoding error reporting.
	* libguile/strings.c (scm_encoding_error): Change arguments to convey
	  more information.  Raise the error with `scm_throw ()', passing all
	  the information to the handler.
	  (scm_from_stringn, scm_to_stringn): Update accordingly.

	* test-suite/tests/ports.test ("string ports")["wrong encoding"]: Check
	  the arguments passed to the `throw' handler.

	* test-suite/tests/r6rs-ports.test ("7.2.11 Binary
	  Output")["put-bytevector with wrong-encoding string port"]: Likewise.

2010-03-18  Ludovic Courtès  <ludo@gnu.org>

	Update Gnulib; use the `func' module.
	Update Gnulib to v0.0-3575-g128e4b8.

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

2010-03-18  Ludovic Courtès  <ludo@gnu.org>

	Add `%null-pointer' to `(system foreign)'.
	* libguile/foreign.c (sym_null, null_pointer): New variables.
	  (scm_foreign_to_bytevector): Raise an error when PTR is NULL.
	  (scm_init_foreign): Define SYM_NULL.

	* module/system/foreign.scm (%null-pointer): New exported binding.

2010-03-17  Ludovic Courtès  <ludo@gnu.org>

	Remove obsolete test directory.
	* test-suite/tests/c-api: Remove.

2010-03-17  Ludovic Courtès  <ludo@gnu.org>

	Change `dynamic-link' to return a global handle when the argument is omitted.
	* libguile/dynl.c (sysdep_dynl_link): Handle FNAME == NULL.
	  (scm_dynamic_link): Make argument optional.  Adjust body accordingly.

	* test-suite/standalone/test-ffi (global, strerror, strlen): New
	  bindings.
	  Add test for these bindings.

	* doc/ref/api-modules.texi (Low level dynamic linking): Update
	  description of `dynamic-link'.

2010-03-17  Ludovic Courtès  <ludo@gnu.org>

	Provide `int', `long', `size_t', etc. in `(system foreign)'.
	* libguile/foreign.c (sym_int, sym_long, sym_unsigned_int,
	  sym_unsigned_long, sym_size_t): New variables.
	  (scm_init_foreign): Define them at the Scheme level.

	* module/system/foreign.scm (int, unsigned-int, long,
	  unsigned-long, size_t): New exported bindings.

2010-03-17  Ludovic Courtès  <ludo@gnu.org>

	Fix doc string of `dynamic-pointer'.
	* libguile/dynl.c (scm_dynamic_pointer): Fix doc string.  Reformat body.

	Use GC-managed pointerless memory in the FFI.
	* libguile/foreign.c (scm_make_foreign_function): Use
	  `scm_gc_malloc_pointerless ()' when allocating memory for CIF.
	  (pack): Likewise for the `FFI_TYPE_STRUCT' case.

2010-03-16  Andy Wingo  <wingo@pobox.com>

	update NEWS for 1.9.9
	* NEWS: Update.

	cull 1.9.8 NEWS items
	* NEWS: Remove 1.9.8 items; they have been folded in already.

	add a section to the manual on prompts
	* doc/ref/api-control.texi (Prompts): Add a section on prompts.

2010-03-16  Andy Wingo  <wingo@pobox.com>

	parallel installability for libguile*.h
	* Makefile.am:
	* libguile/Makefile.am (modincludedir): Install into
	  $pkgincludedir/$GUILE_EFFECTIVE_VERSION. This allows multiple Guile
	  development packages to be installed at once.

	* guile-readline/Makefile.am (modincludedir):
	* srfi/Makefile.am (srfiincludedir): Likewise.

	* meta/guile-2.0.pc.in (Cflags): Add the appropriate -I line so that
	  user code picks up the new location transparently.

2010-03-16  Andy Wingo  <wingo@pobox.com>

	rename libguile to libguile-@EFFECTIVE_VERSION@, currently libguile-2.0
	* libguile/Makefile.am (lib_LTLIBRARIES): Instead of just "libguile.la",
	  make "libguile-@EFFECTIVE_VERSION@.la". This allows multiple versions
	  of Guile to be installed at once. See
	  http://www106.pair.com/rhp/parallel.html for a rationale.

	  (libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS):
	  (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
	  (libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES):
	  (libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD):
	  (libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS): Fixup automake vars
	  to include the effective version.
	  (guile_LDADD): Fix up the spelling of libguile.

	* libguile/bytevectors.c (scm_bootstrap_bytevectors):
	* libguile/foreign.c (scm_register_foreign):
	* libguile/i18n.c (scm_bootstrap_i18n):
	* libguile/instructions.c (scm_bootstrap_instructions):
	* libguile/objcodes.c (scm_bootstrap_objcodes):
	* libguile/programs.c (scm_bootstrap_programs):
	* libguile/vm.c (scm_bootstrap_vm): Register extensions using e.g.
	  "libguile-2.0" as the libname -- i.e., including the effective version
	  in the libname.

	* module/ice-9/i18n.scm:
	* module/rnrs/bytevector.scm:
	* module/rnrs/io/ports.scm:
	* module/system/foreign.scm:
	* module/system/vm/instruction.scm:
	* module/system/vm/objcode.scm:
	* module/system/vm/program.scm:
	* module/system/vm/vm.scm: When doing a load-extension for something in
	  Guile, use the effective version also.

	* meta/guile-2.0-uninstalled.pc.in (Libs):
	* meta/guile-2.0.pc.in (Libs): Use -lguile-@EFFECTIVE_VERSION@. This
	  change should mean that code built against Guile should not be
	  affected by the libguile rename.

	* guile-readline/Makefile.am (libguilereadline_v_@LIBGUILEREADLINE_MAJOR@_la_LIBADD):
	* srfi/Makefile.am
	  (libguile_srfi_srfi_1_v_@LIBGUILE_SRFI_SRFI_1_MAJOR@_la_LIBADD):
	  (libguile_srfi_srfi_4_v_@LIBGUILE_SRFI_SRFI_4_MAJOR@_la_LIBADD):
	  (libguile_srfi_srfi_13_14_v_@LIBGUILE_SRFI_SRFI_13_14_MAJOR@_la_LIBADD):
	  (libguile_srfi_srfi_60_v_@LIBGUILE_SRFI_SRFI_60_MAJOR@_la_LIBADD):
	* test-suite/standalone/Makefile.am (test_num2integral_LDADD):
	  (test_round_LDADD):
	  (libtest_asmobs_la_LIBADD):
	  (libtest_ffi_la_LIBADD):
	  (test_list_LDADD):
	  (test_unwind_LDADD):
	  (test_conversion_LDADD):
	  (test_loose_ends_LDADD):
	  (test_scm_c_read_LDADD):
	  (test_scm_take_locale_symbol_LDADD):
	  (test_scm_take_u8vector_LDADD):
	  (libtest_extensions_la_LIBADD):
	  (test_with_guile_module_LDADD):
	  (test_scm_with_guile_LDADD): Fix up the spelling of libguile.la.

2010-03-16  Andy Wingo  <wingo@pobox.com>

	version.h has SCM_EFFECTIVE_VERSION; effective-version uses that
	* libguile/version.c (scm_effective_version): Use SCM_EFFECTIVE_VERSION.
	* libguile/version.h.in (SCM_EFFECTIVE_VERSION): Define from
	  GUILE_EFFECTIVE_VERSION.

	* libguile/Makefile.am (version.h): Subst in GUILE_EFFECTIVE_VERSION.

	* test-suite/tests/version.test ("version reporting works"): The
	  effective version is not necessarily MAJOR.MINOR. Remove check.

2010-03-16  Andy Wingo  <wingo@pobox.com>

	Bump GUILE_EFFECTIVE_VERSION to 2.0
	* GUILE-VERSION (GUILE_EFFECTIVE_VERSION): Bump to 2.0.

	decouple GUILE_VERSION from GUILE_EFFECTIVE_VERSION.
	* GUILE-VERSION (GUILE_VERSION): Decouple from GUILE_EFFECTIVE_VERSION.
	  This allows us to bumpt the effective version to 2.0 before reaching 2.0.

2010-03-16  Andy Wingo  <wingo@oblong.net>

	more vm gc fixen
	* libguile/vm-i-system.c (continuation_call): Sync before calling a
	  continuation. Shouldn't much matter, but it seems like a good idea.
	  (wind-fluids): More importantly, sync before allocating a with-fluids
	  object.

2010-03-15  Ludovic Courtès  <ludo@gnu.org>

	configure: Abort when GMP is not found.
	* configure.ac: Fix erroneous `AC_LIB_HAVE_LINKFLAGS' invocation.  Above
	  when $HAVE_LIBGMP is not "yes".

2010-03-15  Ludovic Courtès  <ludo@gnu.org>

	Make sure the whole VM stack is always scanned by the GC.
	Thanks to Andy for noticing this.

	* libguile/vm-engine.h (SYNC_REGISTER, CACHE_REGISTER): Add comment.

	* libguile/vm-i-scheme.c (make_struct): Call `SYNC_REGISTER ()' in all
	  cases since the GC is going to run.
	  (struct_ref, struct_set): Call `SYNC_REGISTER ()' on the slow path.
	  (BV_REF_WITH_ENDIANNESS, BV_FIXABLE_INT_REF, BV_INT_REF): Likewise.
	  (BV_FLOAT_REF): Always `SYNC_REGISTER ()'.

2010-03-14  Ludovic Courtès  <ludo@gnu.org>

	doc: Update "Multi-Threading" node.
	* doc/ref/libguile-concepts.texi (Multi-Threading): Remove bits about
	  the requirement not to block in guile mode.

2010-03-14  Ludovic Courtès  <ludo@gnu.org>

	doc: Remove obsolete reference to the lack of Unicode support.
	* doc/ref/api-data.texi (Bytevectors as Strings): Remove obsolete
	  footnote on the lack of Unicode support.

	* test-suite/tests/bytevectors.test ("2.9 Operations on
	  Strings")["string->utf8 [latin-1]", "utf8->string [latin-1]"]: Remove
	  use of `with-latin1-locale'.
	  ["string->utf32 [Greek]"]: New tests.

2010-03-14  Andy Wingo  <wingo@pobox.com>

	small vm.texi updates
	* doc/ref/vm.texi (A Virtual Machine for Guile):
	  (VM Concepts, Variables and the VM, Branch Instructions): Small
	  updates.

	add some vm hook docs
	* doc/ref/api-evaluation.texi (VM Behaviour): Add docs for
	  vm-trace-level and set-vm-trace-level!.

2010-03-14  Andy Wingo  <wingo@pobox.com>

	(debug) at the repl invokes the vm debugger
	* module/ice-9/boot-9.scm (top-repl): Map (debug) at the repl to (system
	  vm debug).

	* module/system/vm/debug.scm (run-debugger, debugger-repl): Don't take
	  the index as an arg, for now anyway.
	  (debug): New wrapper.

2010-03-14  Andy Wingo  <wingo@pobox.com>

	Update api-debug.texi; there is a ways to go.
	* doc/ref/api-debug.texi: Update a bit.

	pmatch license clarification clarifications
	* module/system/base/pmatch.scm: Clarify the clarifications (somehow
	  didn't make it into my last commit).

	clarify pmatch licensing
	* module/system/base/pmatch.scm: Clarify licensing.

	fix critical bug in history.texi
	* doc/ref/history.texi (A Timeline of Selected Guile Releases): Ahem :)

2010-03-14  Andy Wingo  <wingo@pobox.com>

	update "data representation" part of guile internals doc
	* doc/ref/api-control.texi (Handling Errors): Move the "Signalling Type
	  Errors" section here.

	* doc/ref/data-rep.texi (Data Representation): Refactor, lopping and
	  cropping and stitching.

	* doc/ref/libguile-concepts.texi (Dynamic Types):
	* doc/ref/libguile-smobs.texi (Describing a New Type, Double Smobs):
	* doc/ref/guile.texi (Guile Implementation, Programming in C): Adapt to
	  refactorings.

	* doc/ref/history.texi (A Scheme of Many Maintainers):
	  (A Timeline of Selected Guile Releases, Status): Update.

2010-03-13  Andy Wingo  <wingo@pobox.com>

	narrowing stacks to prompts; backtrace shows frames from start-stack
	* libguile/stacks.c (scm_sys_stacks): New global variable, moved here
	  from boot-9.scm.
	  (scm_init_stacks): Define scm_sys_stacks to %stacks.
	  (stack_depth): Remove narrowing by frame pointer.
	  (find_prompt): New helper.
	  (narrow_stack): Clean up a bit, and allow narrowing by prompt tag.
	  (scm_make_stack): Update docs, and use scm_stack_id to get the stack
	  id.
	  (scm_stack_id): The current stack id may be fetched as the cdar of
	  %stacks.
	  (stack_id_with_fp): Remove helper.

	* module/ice-9/boot-9.scm (%start-stack): Fix indentation.
	  (%stacks): Remove definition, it's in stacks.c now.
	  (default-pre-unwind-handler): Narrow by another frame.
	  (save-stack): Remove special handling for certain stack ids, as it is
	  often possible that the function isn't on the stack -- in the
	  interpreter, or after a tail call. Better to narrow by prompt ids.

	* module/system/vm/debug.scm (print-frames): Change to operate on a
	  vector of frames.
	  (run-debugger): Change to receive a vector of frames. The debugger
	  also has the full stack, so it can re-narrow (or widen) to get the
	  whole stack, if the user wants.
	  (stack->vector): New helper.
	  (debug-pre-unwind-handler): Narrow by more frames, and to the most
	  recent start-stack invocation. Adapt to run-debugger change.

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

	remove repl-vm; repl evaluation does not cause recursive vm invocation
	* module/system/repl/common.scm (<repl>): Remove "vm" field and repl-vm
	  accessor. I think the correct model is to just use the-vm. This change
	  was prompted by the need to have the REPL itself not cause a recursive
	  VM invocation, so that captured prompts at the REPL are rewindable.
	  (make-repl): Remove treatment of #:vm.
	  (repl-eval): Load a compiled expression as a simple thunk, avoiding a
	  recursive VM call.

	* module/system/repl/command.scm (profile, trace): Remove repl-vm
	  treatment.
	  (backtrace, debugger, step): Remove, as they were not implemented.

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

	prompt around REPL evaluations, and around `guile' program invocation
	* module/ice-9/control.scm (%): Add a single-argument case, which
	  instates a default prompt with a default handler.

	* libguile/script.c (scm_compile_shell_switches): Wrap user programs in
	  a default prompt.

	* module/system/repl/common.scm (repl-eval): REPL expressions are user
	  programs too; wrap each one in a default prompt.

2010-03-11  Andy Wingo  <wingo@pobox.com>

	add abort to unknown prompt test
	* libguile/control.c (scm_c_abort): Change error string if a prompt
	  isn't found.

	* test-suite/tests/control.test ("abort to unknown prompt"): New test.

2010-03-11  Andy Wingo  <wingo@pobox.com>

	remove internal treatment of default prompt tag, it seems there was no need
	* libguile/control.h (scm_sys_default_prompt_tag):
	* libguile/control.c (scm_init_control): Remove the logic that defined
	  %default-prompt-tag.
	  (scm_c_abort): Remove check for default prompt tag, it wasn't useful.

	* libguile/throw.c (sym_pre_init_catch_tag): Define as the pre-init
	  prompt tag.
	  (pre_init_catch, pre_init_throw): Use sym_pre_init_catch_tag.

	* module/ice-9/boot-9.scm (default-prompt-tag): Define as a simple
	  value, not a fluid. Perhaps we can expose it as a fluid later.

2010-03-09  Andy Wingo  <wingo@pobox.com>

	prompt, abort -> call-with-prompt, abort-to-prompt
	* module/ice-9/boot-9.scm (default-prompt-tag, make-prompt-tag): New
	  functions.
	  (call-with-prompt, abort-to-prompt): Rename from `prompt' and `abort',
	  respectively. These names are more clear, and allow `prompt' and
	  `abort' to have more convenient, less general bindings.
	  (default-throw-handler, custom-throw-handler, catch, %start-stack):
	  Adapt callers.

	* module/ice-9/control.scm: Adapt re-export list.
	  (control): Remove binding, until we're sure that it is Sitaram's
	  control.
	  (abort): New binding, aborts to the nearest prompt with the default
	  tag.
	  (%): Use call-with-prompt.

	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  (*interesting-primitive-names*): Adapt for prompt/abort changes.

	* test-suite/tests/control.test: Take advantage of the defaults for %
	  and abort.

2010-03-09  Andy Wingo  <wingo@pobox.com>

	%start-stack in Scheme, in terms of prompts
	* libguile/debug.h:
	* libguile/debug.c (scm_sys_start_stack): Removed, we implement this in
	  Scheme now.

	* libguile/vm.h:
	* libguile/vm.c (scm_vm_call_with_new_stack): Likewise removed.

	* module/ice-9/boot-9.scm (%start-stack): Implement in terms of prompts.
	  (%stacks): New fluid, for tracking active stacks.
	  (start-stack): Implement using syntax-rules.

2010-03-09  Andy Wingo  <wingo@pobox.com>

	fix continuation printing bug
	* libguile/programs.c (scm_i_program_print): Fix bug printing
	  continuations.

2010-03-07  Ludovic Courtès  <ludo@gnu.org>

	Don't export `write-bytecode' from `(language assembly compile-bytecode)'.
	* module/language/assembly/compile-bytecode.scm: Don't export
	  `write-bytecode'.

	* test-suite/tests/asm-to-bytecode.test (write-bytecode): New global
	  variable.

2010-03-07  Ludovic Courtès  <ludo@gnu.org>

	Add wide-string compilation test.
	* test-suite/tests/asm-to-bytecode.test ("compiler")[load-wide-string
	  "λ"]: New test.

2010-03-07  Ludovic Courtès  <ludo@gnu.org>

	Fix miscompilation of non-ASCII Latin-1 strings.
	The bug was introduced dad6817f ("Use the R6RS I/O API in
	`write-bytecode'.").

	* module/language/assembly/compile-bytecode.scm
	  (write-bytecode)[write-string]: Rename to...
	  [write-latin1-string]: ... this.  Add the `write-loader-len' call.
	  Write each character individually instead of using `string->utf8'.
	  [write-loader]: Remove.

	* test-suite/tests/asm-to-bytecode.test ("compiler")[load-string "æ"]:
	  New test.

2010-03-05  Ludovic Courtès  <ludo@gnu.org>

	Recycle fluid numbers.
	* libguile/fluids.c: Remove outdated comment on the complexity of fluid GC.
	  (FLUID_GROW): Increase to 128.
	  (allocated_fluids): Change to `void **'.
	  (allocated_fluids_num): Remove.
	  (grow_dynamic_state): Remove race-condition checker.  Grow to
	  ALLOCATED_FLUIDS_LEN.
	  (next_fluid_num): Rename to...
	  (new_fluid): ... this.  Return a fluid instead of a fluid number.
	  Assume ALLOCATED_FLUIDS is sparse and search for a free number in it.
	  Make ALLOCATED_FLUIDS point to pointerless memory and initialize
	  individual elements with a pointer to the new fluid.  Register a
	  disappearing link from there to the fluid.
	  (scm_make_fluid): Use `new_fluid ()'.
	  (scm_fluid_ref, scm_fluid_set_x, scm_i_swap_with_fluids): Remove
	  assertion that wasn't checked in a thread-safe way.

	Add new fluid tests.
	* test-suite/tests/fluids.test ("initial fluid values")["initial value
	  is inherited from parent thread"]: New test.
	  ("fluid values are thread-local"): New test.

	Don't gratuitously over-engineer things...
	* libguile/eval.c (eval)[SCM_M_CALL]: Always use `alloca' for ARGV.

2010-03-05  Ludovic Courtès  <ludo@gnu.org>

	Slightly optimize the memoizer, bootstrap evaluator, and `(ice-9 eval)'.
	* libguile/eval.c (CAR, CDR, CAAR, CADR, CDAR, CDDR, CADDR, CDDDR): Use
	  the macro variants, not the functions.
	  (eval)[SCM_M_CALL]: When invoking a VM program, accumulate its
	  arguments on the stack rather than on the heap.

	* libguile/memoize.c (CAR, CDR, CAAR, CADR, CDAR, CDDR, CADDR, CDDDR,
	  CADDR): Use the macro variants, not the functions.
	  (scm_memoized_expression_typecode): Use `SCM_I_MAKINUM' instead of
	  `scm_from_uint16'.

2010-03-05  Ludovic Courtès  <ludo@gnu.org>

	Remove obsolete compile-time option for freelist debugging.
	* configure.ac: Remove `--enable-debug-freelist' option and
	  `SCM_I_GSC_GUILE_DEBUG_FREELIST' substitution variable.

	* libguile/gen-scmconfig.c (main): Remove references to
	  `SCM_I_GSC_GUILE_DEBUG_FREELIST' and `GUILE_DEBUG_FREELIST'.

	* libguile/gen-scmconfig.h.in (SCM_I_GSC_GUILE_DEBUG_FREELIST): Remove.

2010-03-04  Andy Wingo  <wingo@pobox.com>

	some with-fluid* -> with-fluids
	* module/ice-9/boot-9.scm (false-if-exception, load)
	  (try-module-autoload):
	* module/language/tree-il/compile-glil.scm (compile-glil): Turn some
	  with-fluid* invocations into with-fluids.

	partial continuations print as #<partial-continuation ...>
	* libguile/control.c (reify_partial_continuation):
	* libguile/programs.c (scm_i_program_print):
	* libguile/programs.h (SCM_F_PROGRAM_IS_PARTIAL_CONTINUATION)
	  (SCM_PROGRAM_IS_PARTIAL_CONTINUATION): Distinguish partial
	  continuations from full continuations.

	tighten up scm_i_dowinds, fixing invalid SCM_CAR (prompt)
	* libguile/dynwind.c: Update comment regarding what can be on the wind
	  stack.
	  (scm_i_dowinds): Clean up to remove @bind and catch/throw-handler
	  cases, to add a case for prompts, and to be more strict in general
	  regarding the set of things that can be on the wind stack. Fixes a bug
	  whereby prompts were accessed via SCM_CAR; thanks to Ken Raeburn for
	  the report.

	add printers for prompts and with-fluids objects
	* libguile/control.c:
	* libguile/control.h (scm_i_prompt_print):
	* libguile/fluids.c:
	* libguile/fluids.h (scm_i_with_fluids_print):
	* libguile/print.c (iprin1): Add printers for prompts and with-fluids
	  objects.

2010-03-04  Ludovic Courtès  <ludo@gnu.org>

	Try to avoid `guile-test' failures when it can't display the name of a test.
	This can happen, e.g., when printing "UNRESOLVED: regexp.test: TEST-NAME",
	where TEST-NAME contains characters that cannot be converted to the
	encoding of the current output or error port.

	* test-suite/guile-test (main): Set the conversion strategy for the
	  output and error ports to `escape'.

	* test-suite/tests/regexp.test (current-output-port): Likewise.

2010-03-04  Ken Raeburn  <raeburn@raeburn.org>

	The load-module routine tries to interpret relative paths relative to the module currently being loaded (i.e., make-texinfo.scm itself), resulting in confusing behavior for offset builds.  So, don't use them.
	* doc/ref/Makefile.am ($(snarf_doc).texi): Use an absolute path for
	  the input file.

2010-03-04  Ludovic Courtès  <ludo@gnu.org>

	Write the test suite log file in UTF-8.
	* test-suite/guile-test (main): Set LOG-PORT's encoding to UTF-8.

2010-03-04  Ludovic Courtès  <ludo@gnu.org>

	Use `with-latin1-locale' in `regexp.test'.
	As a side effect, it fixes tests on platforms with no 8-bit locale and
	where executing regexps on characters >= 128 can lead to errors such as
	`cannot convert to output locale "US-ASCII": ""\x80""'.

	This commit partially reverts 7583976b ("More setlocale robustness in
	regexp tests").

	* test-suite/tests/regexp.test (mysetlocale, set-latin-1): Remove.
	  ("regexp-quote"): Use `with-latin1-locale' instead of the above
	  procedures.

2010-03-04  Ludovic Courtès  <ludo@gnu.org>

	Move Latin-1 locale fiddling to `(test-suite lib)'.
	* test-suite/lib.scm (with-latin1-locale*): New procedure.
	  (with-latin1-locale): New macro.

	* test-suite/tests/bytevectors.test (with-locale, with-latin1-locale):
	  Remove.  Adjust users.

2010-03-03  Ludovic Courtès  <ludo@gnu.org>

	Fix `with-locale*' in `(test-suite lib)'.
	* test-suite/lib.scm (with-locale*): Set LOC to the previous locale
	  name, not to the new locale name.  Only restore LOC when it's not #f.
	  (with-locale): Use `syntax-rules'.

2010-03-03  Andy Wingo  <wingo@pobox.com>

	psyntax expander tracks changes to current module in top-level begin
	* module/ice-9/psyntax-pp.scm: Regenerated.
	* module/ice-9/psyntax.scm (chi-top-sequence): Track changes to the
	  current module. Allows e.g. top-level `define-module' within a begin
	  to work.

	* test-suite/tests/syncase.test ("changes to expansion environment"):
	  Enable test.

2010-03-03  Andy Wingo  <wingo@pobox.com>

	use anonymous mv-bind in compile-glil.scm; fix abort compilation bug
	* module/language/tree-il/compile-glil.scm (flatten): Change to use the
	  anonymous <glil-mv-bind> form when truncating to 0 or 1 values. In
	  those cases, remove the <glil-unbind> statements. As a side effect,
	  fixes compilation of abort in a "values" context.

	  Thanks to Tristan Colgate for the bug report.

	* test-suite/tests/tree-il.test: Update to expect anonymous mv-bind.

2010-03-03  Andy Wingo  <wingo@pobox.com>

	<glil-mv-bind> can truncate values anonymously
	* module/language/glil/compile-assembly.scm (glil->assembly): Allow an
	  integer for `vars', which means simply to truncate the values, and not
	  pass binding metadata to the compiler.

	add more tests to control.test
	* test-suite/tests/control.test ("restarting partial continuations"):
	  Add more tests, for `abort' in different positions. All succeed in the
	  evaluator but fail with the compiler.

2010-03-03  Ludovic Courtès  <ludo@gnu.org>

	Fix off-by-one error in the off-by-one fix of `make-srfi-4-vector'.
	This is a followup to d900a8557db21641413db8995a7cdc1453adbe1f ("Fix
	off-by-one error when initializing vectors in `make-srfi-4-vector'.").

	* libguile/srfi-4.c (scm_make_srfi_4_vector): Don't initialize RET when
	  LEN is zero.

2010-03-03  Ludovic Courtès  <ludo@gnu.org>

	Add test checking whether fluids are GC'd.
	* test-suite/tests/fluids.test ("fluids are GC'd"): New test.

2010-03-02  Ludovic Courtès  <ludo@gnu.org>

	Fix "coding:" cookies in the test suite.
	* test-suite/tests/bytevectors.test, test-suite/tests/keywords.test,
	  test-suite/tests/procprop.test, test-suite/tests/srfi-35.test,
	  test-suite/tests/srfi-88.test: Add "coding:" cookie on the first line.

2010-03-02  Ludovic Courtès  <ludo@gnu.org>

	Fix off-by-one error when initializing vectors in `make-srfi-4-vector'.
	* libguile/srfi-4.c (scm_make_srfi_4_vector): When FILL is bound and
	  non-zero, initialize the last element.

	* test-suite/tests/srfi-4.test ("TAG vectors")["make-TAGvector"]: New
	  tests.

2010-03-02  Ken Raeburn  <raeburn@raeburn.org>

	Use libguile/control.x explicitly.

2010-03-02  Julian Graham  <julian.graham@aya.yale.edu>

	Change failing syncase test case to UNRESOLVED.
	* test-suite/tests/syncase.test:
	  ("expander detects changes to current-module"): Throw 'unresolved instead of
	  returning #f.

2010-02-27  Julian Graham  <julian.graham@aya.yale.edu>

	add (currently failing) test case for changing the current module inside `begin' form
	* test-suite/tests/syncase.scm: ("expander detects changes to current-module"):
	  New test case.

2010-02-26  Andy Wingo  <wingo@pobox.com>

	rewinding prompts works
	* libguile/control.h (SCM_PROMPT_HANDLER): Remove, it was unused.
	  (SCM_PROMPT_DYNWINDS): Rename from SCM_PROMPT_DYNENV.

	* libguile/control.c: (scm_c_make_prompt): Take another arg, the winds
	  that are to be in place for the prompt. Fix allocation to be 4 words
	  instead of 5 (the handler was never used).

	* libguile/eval.c (eval):
	* libguile/throw.c (pre_init_catch): Adapt to scm_c_make_prompt change.

	* libguile/vm-i-system.c (partial-cont-call): Grovel the new elements of
	  the wind list in order to call setjmp() on the new prompts. Pass
	  cookie to vm_reinstate_partial_continuation.
	  (prompt): Adapt to scm_c_make_prompt change.

	* libguile/vm.c (vm_reinstate_partial_continuation): Take a cookie arg,
	  used when winding captured prompts onto the stack. Winding a prompt
	  implies making a new prompt, actually -- with new registers, a new
	  jump buffer, new winds, etc.

	* test-suite/tests/control.test ("rewinding prompts"): Add a test for
	  rewinding prompts.

2010-02-26  Andy Wingo  <wingo@pobox.com>

	catch, throw, with-throw-handler implemented in Scheme
	* libguile/throw.c (tc16_jmpbuffer, tc16_pre_unwind_data): Remove these
	  smob types, and associated constructors and accessors (all internal).
	  (scm_catch, scm_catch_with_pre_unwind_handler):
	  (scm_with_throw_handler, scm_throw): Simply dispatch to scheme.
	  Lovely.
	  (tc16_catch_closure): Introduce a new applicable smob type, for use by
	  the C catch interface. All constructors and accessors are internal.
	  (scm_c_catch, scm_internal_catch, scm_c_with_throw_handler): Build
	  applicable smobs out of the C procedure arguments, so we can then
	  dispatch through scm_catch et al.
	  (scm_ithrow): Dispatch to scm_throw.
	  (pre_init_catch, pre_init_throw): Restricted catch/throw
	  implementation for use before boot-9 runs.
	  (scm_init_throw): Bind the pre-init catch and throw definitions.

	* module/ice-9/boot-9.scm (prompt, abort): Move these definitions up in
	  the file.
	  (catch, throw, with-throw-handler): Implement in Scheme. Whee!

2010-02-26  Andy Wingo  <wingo@pobox.com>

	deprecate lazy-catch
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_internal_lazy_catch, scm_lazy_catch):
	  Deprecate, and print out a nasty warning that people should change to
	  with-throw-handler.

	* libguile/throw.h:
	* libguile/throw.c (scm_c_with_throw_handler): Deprecate the use of the
	  lazy_catch_p argument, printing out a nasty warning if someone
	  actually passes 1 as that argument. The combination of the pre-unwind
	  and post-unwind handlers should be sufficient.

	* test-suite/tests/exceptions.test: Remove lazy-catch tests, as they are
	  deprecated. Two of them fail:
	  * throw/catch: effect of lazy-catch unwinding on throw to another key
	  * throw/catch: repeat of previous test but with lazy-catch
	  Hopefully people are not depending on this behavior, and the warning is
	  sufficiently nasty for people to switch. We will see.

	* test-suite/tests/eval.test ("promises"): Use with-throw-handler
	  instead of lazy-catch.

	* doc/ref/api-debug.texi:
	* doc/ref/api-control.texi: Update to remove references to lazy-catch,
	  folding in the useful bits to with-throw-handler.

2010-02-26  Andy Wingo  <wingo@pobox.com>

	fix a prompt bug
	* libguile/control.h:
	* libguile/control.c (scm_c_make_prompt): Instead of taking a VM arg,
	  take the registers directly.
	  (scm_c_abort): Declare as returning void. In fact it will never
	  return.

	* libguile/eval.c (eval):
	* libguile/throw.c (pre_init_catch): Adapt to prompt API change.

	* libguile/vm-i-system.c (prompt): Pass the abort ip as the ip to
	  scm_c_make_prompt. This fixes a bug in which we used the "offset"
	  local var, but it wasn't guaranteed to be around after a longjmp.

2010-02-25  Andy Wingo  <wingo@pobox.com>

	simplify handling of nonlocal prompt returns from c
	* libguile/control.h:
	* libguile/control.c (scm_i_prompt_pop_abort_args_x): New helper.

	* libguile/eval.c (eval): Use the new helper.

2010-02-25  Andy Wingo  <wingo@pobox.com>

	more substance to control.test
	* test-suite/tests/control.test ("suspend/resume with fluids"):
	  ("restarting partial continuations"):
	  ("reified continuations", "escape-only continuations"): More tests.
	eval.scm's handling of with-fluids doesn't leave the VM

	* module/ice-9/eval.scm (primitive-eval): Implement with-fluids in terms
	  of with-fluids, to avoid recursively calling the VM via with-fluids*.

2010-02-25  Andy Wingo  <wingo@pobox.com>

	eval.scm's handling of with-fluids doesn't leave the VM
	* module/ice-9/eval.scm (primitive-eval): Implement with-fluids in terms
	  of with-fluids, to avoid recursively calling the VM via with-fluids*.

	error if given an unrewindable partial continuation
	* libguile/vm-engine.c (vm_error_continuation_not_rewindable):
	* libguile/vm-i-system.c (partial-cont-call):
	* libguile/vm.h (SCM_VM_CONT_PARTIAL_P):
	  (SCM_VM_CONT_REWINDABLE_P): Fix a bug in which we weren't checking if
	  a partial continuation was actually rewindable.

	fix embarrassing bug
	* libguile/vm.c: Fix embarrassing error regarding the symbolitude of
	  vm-error and friends.

2010-02-24  Andy Wingo  <wingo@pobox.com>

	start of tests for (ice-9 control)
	* test-suite/Makefile.am:
	* test-suite/tests/control.test: Add the beginnings of a delimited
	  continuations test suite.

	fix symbol initialization in vm.c
	* libguile/vm.c (scm_bootstrap_vm): Fix case in which some symbols
	  wouldn't be initialized by the time they were needed.

	(ice-9 control) fixes
	* module/ice-9/control.scm (%): Fix to allow tagged and default-tagged
	  prompts.
	  (abort): Re-export.

	fix escape-only prompts
	* libguile/control.c (scm_c_make_prompt): Whoops, set the escape-only
	  flag properly here.

	add %default-prompt-tag, and error (not abort()) on an abort to bad tag
	* libguile/init.c (scm_i_init_guile): Call scm_init_control after
	  initing fluids.
	* libguile/control.h (scm_sys_default_prompt_tag): New internal var.
	* libguile/control.c (scm_c_abort): If abort is called for an unknown
	  tag, raise an exception, except if the tag was the default prompt tag,
	  in which case really abort -- to prevent recursion when some other
	  patches land.
	  (scm_init_control): Define %default-prompt-tag in the default
	  environment.

	turn abort() calls in vm.c into exceptions
	* libguile/vm.c (vm_return_to_continuation, vm_abort):
	  (vm_reinstate_partial_continuation, really_make_boot_program): Turn
	  some abort()s into scm_misc_errors.

	rewind the dynamic state when entering a partial continuation
	* libguile/control.c (cont_objcode):
	* libguile/vm-i-system.c (partial-cont-call):
	* libguile/vm.c (vm_reinstate_partial_continuation): Don't keep the
	  "external winds" in a partial continuation, as they aren't logically
	  part of the continuation. Reinstate the "internal winds" when entering
	  a partial continuation. Things seem to work!

2010-02-24  Andy Wingo  <wingo@pobox.com>

	partial-cont-call works
	* libguile/vm-i-system.c (partial-cont-call): Sync registers before
	  splatting a partial continuation, and cache them back afterwards.

	* libguile/vm.c (vm_reinstate_partial_continuation): Actually implement,
	  except dynamic-wind.

2010-02-24  Andy Wingo  <wingo@pobox.com>

	record IP in partial continuations
	* libguile/control.c (reify_partial_continuation): Assert some
	  invariants, and record the IP as the MVRA of the continuation.

	ensure non-escape-only prompts have a thunk application as their body
	* module/language/tree-il/inline.scm (inline!): Fix indenting for
	  lambda-case. In an amusing turn of events, use the inliner to
	  de-inline prompt bodies, if the prompt is not escape-only.

2010-02-22  Andy Wingo  <wingo@pobox.com>

	actually capture partial continuations
	* libguile/control.c (cont_objcode): Along with a bunch of boilerplate
	  that certainly needs to go in some central place, define this
	  continuation-calling trampoline.
	  (reify_partial_continuation): New function, returns a procedure that
	  when called will reinstate a partial continuation.
	  (scm_c_abort): Take an extra arg, the cookie. Actually reify a
	  continuation.
	  (scm_at_abort): Adapt to scm_c_abort change.

	* libguile/control.h: Declare scm_c_abort change.

	* libguile/vm-i-system.c (partial_cont_call): New instruction.
	  (call/cc, tail-call/cc): Adapt to scm_i_vm_capture_stack change.
	  (abort): Pass vm_cookie to abort.

	* libguile/vm.h (SCM_F_VM_CONT_PARTIAL, SCM_F_VM_CONT_REWINDABLE): New
	  flags.
	  (struct scm_vm_cont): Add flags field.
	  (SCM_VM_CONT_PARTIAL_P, SCM_VM_CONT_REWINDABLE_P): New predicates.

	* libguile/vm.c (scm_i_vm_capture_stack): Rename from
	  vm_capture_continuation, and make internal instead of static. Take a
	  flags argument.
	  (scm_i_vm_capture_continuation): Adapt to scm_i_vm_capture_stack
	  change.
	  (vm_abort): Plumb cookie to scm_c_abort.
	  (vm_reinstate_partial_continuation): New stub.

2010-02-22  Andy Wingo  <wingo@pobox.com>

	tweaks to default program printer
	* libguile/programs.c (scm_i_program_print): Instead of printing the
	  address of the objcode, print the address of the program itself. Also
	  for continuations.

2010-02-22  Andy Wingo  <wingo@pobox.com>

	abort always dispatches to VM bytecode, to detect same-invocation aborts
	* libguile/control.h:
	* libguile/control.c (scm_c_make_prompt): Take an extra arg, a cookie.
	  Continuations will be rewindable only if the abort has the same cookie
	  as the prompt.
	  (scm_at_abort): Redefine from scm_abort, and instead of taking rest
	  args, take the abort values as a list directly. Also, don't allow
	  rewinding, because we won't support rewinding the C stack with
	  delimited continuations.

	* libguile/eval.c (eval): Adapt to scm_c_make_prompt change.

	* libguile/vm-engine.c (vm_engine): Use vp->cookie to get a unique value
	  corresponding to this VM invocation.
	* libguile/vm-i-system.c (prompt): Pass the cookie to scm_c_make_prompt.
	  (abort): Take an additional tail arg.
	* libguile/vm.c (vm_abort): Parse out the abort tail arg. This is for
	  the @abort case, or the (apply abort ...) case.
	  (make_vm): Initialize the cookie to 0.
	* libguile/vm.h (struct scm_vm): Add cookie.

	* module/ice-9/boot-9.scm (abort): Define here as a trampoline to
	  @abort. Needed to make sure that a call to abort dispatches to a VM
	  opcode, so the cookie will be the same.

	* module/language/tree-il.scm (<tree-il>): Add a "tail" field to
	  <abort>, for the (apply abort ...) case, or (@abort tag args). Should
	  be #<const ()> in the normal case. Add support throughout.
	* module/language/tree-il/analyze.scm (analyze-lexicals): Add abort-tail
	  support here too.

	* module/language/tree-il/compile-glil.scm (flatten): Compile the tail
	  argument appropriately.
	* module/language/tree-il/primitives.scm (*primitive-expand-table*): Fix
	  @abort and abort cases to pass the tail arg to make-abort.

2010-02-22  Andy Wingo  <wingo@pobox.com>

	prompt and abort inlining
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Add abort.
	  (*primitive-expand-table*): Fix so that we inline `prompt' and
	  `abort', and remove obsolete code dealing in `control'.

	fix <prompt> compilation bug
	* module/language/tree-il/analyze.scm (analyze-lexicals): Fix bug
	  analysing <prompt> expressions.

2010-02-19  Andy Wingo  <wingo@pobox.com>

	prompt as part of guile's primitive language
	* libguile/control.h:
	* libguile/control.c: Remove scm_atcontrol and scm_atprompt.
	  (scm_c_make_prompt): Remove handler arg, as the handler is inline.
	  (scm_abort): New primitive, exported to Scheme as `abort'. The
	  compiler will also recognize calls to `abort', but this is the base
	  case.
	  (scm_init_control): Remove scm_register_control, just have this
	  function, which adds `abort' to the `(guile)' module.

	* libguile/eval.c (eval): Add SCM_M_PROMPT case.

	* libguile/init.c (scm_i_init_guile): Change scm_register_control call
	  into a nice orderly scm_init_control call.

	* libguile/memoize.h: (scm_sym_at_prompt, SCM_M_PROMPT):
	* libguile/memoize.c (MAKMEMO_PROMPT, scm_m_at_prompt, unmemoize): Add
	  prompt support to the memoizer.

	* libguile/vm-i-system.c (prompt): Fix to not expect a handler on the
	  stack.

	* module/ice-9/boot-9.scm (prompt): Add definition in terms of @prompt.

	* module/ice-9/control.scm: Simplify, and don't play with the compiler
	  here, now that prompt and abort are primitive.

	* module/ice-9/eval.scm (primitive-eval): Add a prompt case.

	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Add @prompt and prompt.

2010-02-19  Andy Wingo  <wingo@pobox.com>

	fix prompt disassembly bug
	* module/language/assembly/disassemble.scm (code-annotation): Fix a bug
	  disassembling `prompt'.

2010-02-19  Andy Wingo  <wingo@pobox.com>

	add scm_c_abort, wire it up to the abort opcode
	* libguile/control.h:
	* libguile/control.c (scm_c_abort): Add an implementation of `abort',
	  but it doesn't reify the continuation yet.

	* libguile/vm-i-system.c (abort):
	* libguile/vm.c (vm_abort): Wire up the call to `abort', avoiding
	  consing the args into a list.

	* module/language/tree-il/compile-glil.scm (flatten): Add some compily
	  bits that can allow the abort to be resumed.

2010-02-19  Andy Wingo  <wingo@pobox.com>

	prompt handlers are always inline
	* libguile/control.h (SCM_F_PROMPT_INLINE, SCM_PROMPT_INLINE_P): Remove;
	  prompts always have "inline" handlers now.
	* libguile/control.c (scm_c_make_prompt): Remove inline_handler_p arg.

	* libguile/vm-i-system.c (prompt):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	 Adapt to prompt changes.

	* module/language/glil.scm (make-glil-prompt, glil-prompt-inline?):
	  Remove inline? flag.
	  (parse-glil, unparse-glil):
	* module/language/glil/compile-assembly.scm (glil->assembly): Adapt to
	  <glil-prompt> change.

	* module/language/tree-il/compile-glil.scm (flatten): Require the
	  handler of a <prompt> to be a lambda-case.

	* module/language/tree-il/primitives.scm (*primitive-expand-table*):
	  Ensure that the handler of a <prompt> is a lambda-case.

	* module/language/tree-il/inline.scm (inline!): Simplify a degenerate
	  case: (lambda args (apply (lambda ...) args)) => (lambda ...).

2010-02-19  Andy Wingo  <wingo@pobox.com>

	fluid-ref / fluid-set! compile to dynref/dynset
	* module/language/tree-il/primitives.scm: Resolve fluid-ref and
	  fluid-set! as primitives, and thence to dynref/dynset.

	add <dynref> and <dynset> to tree-il
	* module/language/tree-il.scm (<dynref>, <dynset>): New tree-il language
	  elements, corresponding to fluid-ref and fluid-set.
	* module/language/tree-il/analyze.scm:
	* module/language/tree-il/compile-glil.scm: Wire them up in the usual
	  manner.

	new VM operations: fluid-ref, fluid-set
	* libguile/vm-i-system.c (fluid-ref, fluid-set): New VM ops.

	fluids.h exposes more of its interface, internally at least
	* libguile/fluids.h (SCM_I_FLUID_P, SCM_I_FLUID_NUM)
	  (SCM_I_DYNAMIC_STATE_P, SCM_I_DYNAMIC_STATE_FLUIDS): Expose these
	  predicates and accessors, internally at least.
	* libguile/fluids.c (IS_FLUID, FLUID_NUM, IS_DYNAMIC_STATE)
	  (DYNAMIC_STATE_FLUIDS): Implement in terms of the exposed macros.

	vm caches the dynamic state in a local var
	* libguile/vm-engine.c (vm_engine): Cache the dynamic state in a local
	  var when we enter the VM.
	* libguile/vm-i-system.c (wind-fluids, unwind-fluids): Use the cached
	  dynamic state instead of going through SCM_I_CURRENT_THREAD.

2010-02-19  Andy Wingo  <wingo@pobox.com>

	rename <control> to <abort>
	* libguile/vm-i-system.c (abort): Rename instruction from `throw'.
	* libguile/vm.c (vm_abort): Rename from vm_throw.
	* module/language/tree-il.scm (<abort>, make-abort, abort-src,
	  abort-tag, abort-args: Rename from <control> & company.

	* module/language/tree-il/analyze.scm:
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/primitives.scm: Fix all callers.

2010-02-19  Andy Wingo  <wingo@pobox.com>

	<prompt> has no pre-unwind-handler, it's unnecessary
	* libguile/control.h:
	* libguile/control.c (scm_c_make_prompt, SCM_PROMPT_PRE_UNWIND_HANDLER):
	* libguile/vm-i-system.c (prompt)
	* module/language/tree-il.scm (<prompt> prompt-pre-unwind-handler):
	* module/language/tree-il/analyze.scm:
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/inline.scm:
	* module/language/tree-il/primitives.scm: Remove the "pre-unwind"
	  handler from prompt; it turns out not to be necessary. Adapt all
	  references.

	re-expand psyntax-pp
	* module/ice-9/psyntax-pp.scm: Expand again so we actually use
	  with-fluids.

	fix tree-il->scheme bug for <dynlet>
	* module/language/tree-il.scm (tree-il->scheme): Bugfix for dynlet.

2010-02-18  Andy Wingo  <wingo@pobox.com>

	psyntax support for with-fluids
	* module/ice-9/psyntax.scm (build-dynlet, with-fluids): Use psyntax to
	  recognize `with-fluids' as a core form, producing <dynlet> if we are
	  compiling.
	  (sc-expand): To spice up the mix, use with-fluids here in the
	  implementation.

	* module/ice-9/psyntax-pp.scm: Bootstrapped twice (!).

	* module/ice-9/boot-9.scm: Remove with-fluids definition, it's in the
	  core now.

2010-02-18  Andy Wingo  <wingo@pobox.com>

	add tree-il->glil compilation for dynlet
	* module/language/tree-il/compile-glil.scm (flatten): Compile <dynlet>.

	add wind-fluids, unwind-fluids VM ops
	* libguile/vm-i-system.c (wind-fluids, unwind-fluids): New instructions,
	  for dynamic binding.

	add dynlet to tree-il
	* module/language/tree-il.scm (<dynlet>, dynlet?, make-dynlet)
	  (dynlet-src, dynlet-fluids, dynlet-vals, dynlet-body): New tree-il
	  construct, mapping to `with-fluids'.
	  (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold):
	  (make-tree-il-folder, post-order!, pre-order!): Wire it up.
	* module/language/tree-il/analyze.scm (analyze-lexicals): Add dynlet
	  support.

2010-02-18  Andy Wingo  <wingo@pobox.com>

	add with-fluids objects and primitive syntax
	* libguile/tags.h (scm_tc7_with_fluids): Allocate a tc7 for
	  "with-fluids" objects, which will only live on the dynamic stack (wind
	  list), not in normal scheme-land.

	* libguile/fluids.h (SCM_WITH_FLUIDS_P, SCM_WITH_FLUIDS_LEN)
	  (SCM_WITH_FLUIDS_NTH_FLUID, SCM_WITH_FLUIDS_NTH_VAL)
	  (SCM_WITH_FLUIDS_SET_NTH_VAL): Add some accessors.
	* libguile/fluids.c (scm_i_make_with_fluids, scm_i_swap_with_fluids):
	  New internal functions.
	  (scm_c_with_fluids, scm_c_with_fluid): Push with-fluids objects on the
	  dynwind list, not winders.

	* libguile/dynwind.c (scm_i_dowinds): Add cases for winding and
	  unwinding with-fluids objects.

	* libguile/memoize.h (scm_sym_with_fluids, SCM_M_BEGIN): New public
	  data.
	* libguile/memoize.c (scm_m_with_fluids): Define with-fluids as a
	  primitive syntax.
	  (unmemoize): Add with-fluids case.

	* libguile/eval.c (eval):
	* module/ice-9/eval.scm (primitive-eval): Add with-fluids cases.

	* test-suite/tests/fluids.test
	  ("fluids not modified if nonfluid passed to with-fluids"): Enable a
	  now-passing test.

2010-02-18  Andy Wingo  <wingo@pobox.com>

	add fluid tests
	* test-suite/Makefile.am:
	* test-suite/tests/fluids.test: Add some fluid tests. One is an XFAIL
	  right now.

	rename <dynamic-wind> to <dynwind>
	* module/language/tree-il.scm (<dynwind>): Rename from <dynamic-wind>.
	* module/language/tree-il/analyze.scm:
	* module/language/tree-il/primitives.scm:
	* module/language/tree-il/compile-glil.scm: All accessors and callers
	  changed.

	fix unmemoization bug
	* libguile/memoize.c (unmemoize): Fix unmemoization of memoized
	  toplevel-ref and module-ref forms.

	eval.c tweaks
	* libguile/eval.c (eval): Fix a couple of uses of scm_cdr that should
	  use CDR.

	fix comment in continuations.c
	* libguile/continuations.c: Fix a comment.

	memoize (begin foo) to foo
	* libguile/memoize.c (memoize_sequence): Don't make a `begin' if there's
	  only one form.

	reorder eval clauses
	* module/ice-9/eval.scm: Add a comment explaining the frequencies of the
	  various memoized expression types.
	  (eval): Reorder the cases based the profile.

2010-02-18  Andy Wingo  <wingo@pobox.com>

	dynwind is now a part of guile's primitive language
	* libguile/memoize.h (scm_sym_at_dynamic_wind, SCM_M_DYNWIND)
	* libguile/memoize.c (memoized_tags, MAKMEMO_DYNWIND)
	  (scm_m_at_dynamic_wind, unmemoize): Add dynwind as a primitive
	  expression type.

	* libguile/dynwind.c (scm_dynamic_wind): Downgrade to a normal C
	  function.

	* libguile/eval.c (eval):
	* module/ice-9/eval.scm (primitive-eval): Add dynwind support.

	* module/ice-9/r4rs.scm: More relevant docs.
	  (apply): Define in a more regular way.
	  (dynamic-wind): Add to this file, with docs, dispatching to
	  @dynamic-wind.

	* module/language/tree-il/primitives.scm: Parse @dynamic-wind into a
	  tree-il dynamic-wind.

2010-02-17  Ludovic Courtès  <ludo@gnu.org>

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

2010-02-17  Ludovic Courtès  <ludo@gnu.org>

	Update to Gnulib v0.0-3448-g6078aa4 for its <netdb.h> fix.
	Reverts commit 691b9ec196203fa5d6da3530d5355b2f73e707d1 ("getaddrinfo:
	Define macros lacking in NetBSD 5.0.").

	* libguile/net_db.c (AI_ALL, AI_V4MAPPED, AI_ADDRCONFIG): Remove
	  placeholder definitions, how provided by Gnulib's <netdb.h>.

2010-02-17  Andy Wingo  <wingo@oblong.net>

	slight NEWS tweaks
	* NEWS: Slight tweaks.

2010-02-17  Ludovic Courtès  <ludo@gnu.org>

	getaddrinfo: Define macros lacking in NetBSD 5.0.
	* libguile/net_db.c (AI_ALL, AI_V4MAPPED, AI_ADDRCONFIG): New
	  macros, when not already defined.

	Update `NEWS'.

	Mention libffi dependency in `README'.

	Include <libguile/__scm.h> in "foreign.h".
	* libguile/foreign.h: Include <libguile/__scm.h>.

2010-02-17  Ludovic Courtès  <ludo@gnu.org>

	Remove misplaced tabs from the manual.
	* doc/ref/posix.texi (Network Databases): Remove tabs from `getaddrinfo'
	  example.

	* .dir-locals.el: Set `indent-tabs-mode' to `t' for `texinfo-mode'.

2010-02-16  Andy Wingo  <wingo@pobox.com>

	a start at NEWS
	* NEWS: A start at NEWS; now to sleep.

	delete the tutorial
	* configure.ac:
	* doc/Makefile.am:
	* doc/tutorial/ChangeLog-2008:
	* doc/tutorial/ChangeLog-guile-doc-tutorial:
	* doc/tutorial/Makefile.am:
	* doc/tutorial/guile-tut.texi: Remove the tutorial. The history was out
	  of date (whereas the manual is current), the C examples are no longer
	  valid (and the manual does provide C examples), it was incomplete, and
	  its first person no longer hacks on Guile. So tutorial, you had a good
	  run, but the manual does your job now!

	fix a bug in the tutorial
	* doc/tutorial/guile-tut.texi (c_builtins.c): Fix a typo with an
	  undeclared variable. Thanks to Raimon Grau for the pointer. This
	  tutorial is quite out of date, though...

2010-02-16  Andy Wingo  <wingo@pobox.com>

	`load' doesn't cause the compiler to be loaded in some cases
	* module/system/base/compile.scm (compiled-file-name): Add a comment.
	* module/ice-9/boot-9.scm (load): Avoid loading up (system base compile)
	  just to compute an autocompiled file name. Fixes the issue whereby
	  guile-tools snarf-check-and-output-texi was inadvertantly loading up
	  srfi-1, and thereby a stale library, just to see if guile-tools itself
	  had a compiled version.

	  Not sure what the right unit test is here, other than vigilance.

2010-02-16  Ludovic Courtès  <ludo@gnu.org>

	Add missing $(LTLIBINTL), suggested by Gnulib.
	* libguile/Makefile.am (libguile_la_LIBADD): Add $(LTLIBINTL).

2010-02-16  Ludovic Courtès  <ludo@gnu.org>

	i18n: Define `nl_item' when it's not available (needed for Cygwin).
	* configure.ac: Add check for `nl_item'.

	* libguile/i18n.c: Separate check for `HAVE_LANGINFO_H' and
	  `HAVE_NL_TYPES_H'.
	  [!HAVE_NL_ITEM]: Define `nl_item'.

2010-02-16  Ludovic Courtès  <ludo@gnu.org>

	Skip "wrong service name" `getaddrinfo' test on Darwin 9.2.
	* test-suite/tests/net-db.test ("getaddrinfo")["wrong service name"]:
	  Skip test on Darwin 9.2.

2010-02-16  Michael Gran  <spk121@yahoo.com>

	Faster read of semicolon comments
	There is no need to do character encoding processing within
	semicolon comments.

	* libguile/read.c (scm_read_semicolon_comment): changed

2010-02-15  Ludovic Courtès  <ludo@gnu.org>

	Fix builds of `i18n.c' on non-GNU systems.
	* libguile/i18n.c (chr_to_case, str_to_case): Add `func_name' argument
	  and `FUNC_NAME' macro.  Update callers.

	Add `getaddrinfo' test.
	* test-suite/tests/net-db.test ("getaddrinfo")["port 80 with family and
	  socket type"]: New test.

	Use `#f' for `addrinfo:canonname' when it wasn't supplied by getaddrinfo(3).
	* libguile/net_db.c (scm_from_addrinfo): Use `#f' when `ai_canonname'
	  isn't set.

2010-02-15  Ludovic Courtès  <ludo@gnu.org>

	Fix `getaddrinfo' tests.
	Thanks to Ken Raeburn.

	* test-suite/tests/net-db.test ("getaddrinfo")["port 80"]: Fix bogus
	  check of `addrinfo:flags' (POSIX says that the "contents of the
	  ai_flags field of the returned structures are undefined.").
	  ("wrong service name"): Accept `EAI_NONAME' as a valid error code.

2010-02-15  Ludovic Courtès  <ludo@gnu.org>

	Make the `getaddrinfo' "no name" test more robust.
	* test-suite/tests/net-db.test ("getaddrinfo")["no name"]: Check for
	  `EAI_EAGAIN' too.

2010-02-14  Ludovic Courtès  <ludo@gnu.org>

	Add missing Gnulib files; update `.gitignore'.
	This files were missing from commit
	61cd9dc907b8a09990b14e9aeac7e20fe77cecc6 ("Use Gnulib's `getaddrinfo'
	module.").

2010-02-14  Ludovic Courtès  <ludo@gnu.org>

	Add `getaddrinfo' and related procedures.
	* libguile/net_db.c (sym_getaddrinfo_error, sym_ai_passive,
	  sym_ai_canonname, sym_ai_numerichost, sym_ai_numericserv,
	  sym_ai_v4mapped, sym_ai_all, sym_ai_addrconfig, sym_eai_badflags,
	  sym_eai_noname, sym_eai_again, sym_eai_fail, sym_eai_family,
	  sym_eai_socktype, sym_eai_service, sym_eai_memory, sym_eai_system,
	  sym_eai_overflow, sym_eai_nodata, sym_eai_addrfamily,
	  sym_eai_inprogress, sym_eai_canceled, sym_eai_notcanceled,
	  sym_eai_alldone, sym_eai_intr, sym_eai_idn_encode): New variables.
	  (scm_from_addrinfo, scm_getaddrinfo, scm_gai_strerror): New functions.

	* libguile/net_db.h (scm_getaddrinfo, scm_gai_strerror): New functions.

	* module/ice-9/networking.scm (addrinfo:flags, addrinfo:fam,
	  addrinfo:socktype, addrinfo:protocol, addrinfo:addr,
	  addrinfo:canonname): New procedures.

	* test-suite/tests/net-db.test: New file.

	* test-suite/Makefile.am (SCM_TESTS): Add `tests/net-db.test'.

	* doc/ref/posix.texi (Network Databases)[getaddrinfo]: New subsection.
	  [The Host Database]: Suggest using `getaddrinfo'.

2010-02-14  Ludovic Courtès  <ludo@gnu.org>

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

	* libguile/Makefile.am (libguile_la_LDFLAGS): Add `$(GETADDRINFO_LIB)
	  $(HOSTENT_LIB) $(SERVENT_LIB)'.

2010-02-13  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Document trailing whitespace policy.
	* HACKING (Coding standards): Delete trailing whitespace.
	Add blurb documenting trailing whitespace policy.

2010-02-13  Ludovic Courtès  <ludo@gnu.org>

	Document the maximum number of arguments for a subr.
	* doc/ref/api-procedures.texi (Primitive Procedures): Specify the
	  maximum number of arguments.  Patch by guign@mails.selgrad.org.

2010-02-13  Ludovic Courtès  <ludo@gnu.org>

	Reinstate `scm_protects', for backward compatibility.
	Partly reverts e7efe8e793fa51ea898aea4477939c598b3e9fac ("decruftify
	scm_sys_protects").

	* libguile/gc.c (protects): Rename to...
	  (scm_protects): ... this.

	* libguile/gc.h (scm_protects): Add declaration.

2010-02-10  Ludovic Courtès  <ludo@gnu.org>

	Fix documentation of the `string->utf' and `utf->string' functions.
	* doc/ref/api-data.texi (Bytevectors as Strings): Describe optional
	  parameter of `string->utf{16,32}' and `utf{16,32}->string'.

	Use the R6RS I/O API in `write-bytecode'.
	* module/language/assembly/compile-bytecode.scm
	  (write-bytecode)[u32-bv]: New variable.
	  [write-char, write-uint16-be, write-uint16-le, write-uint32-le]:
	  Remove.
	  [write-string, write-uint32-be, write-uint32, write-wide-string,
	  write-bytevector]: Rewrite using the `(rnrs io ports)' API.
	  [write-uint24-be]: Rename to...
	  [write-int24-be]: ... this.  Use `(rnrs io ports)' API.  Callers
	  updated.
	  [write-uint16]: Remove.

2010-02-10  Ludovic Courtès  <ludo@gnu.org>

	Change `write-bytecode' to accept a bytevector.
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	  Replace the WRITE-BYTE and GET-ADDR parameters with PORT.  New ADDRESS
	  and EMIT-OPCODE? parameters.  Callers updated.
	  [write-byte, get-addr]: New procedures.
	  Adjust to write to PORT.
	  (compile-bytecode): Update accordingly.

	* test-suite/tests/asm-to-bytecode.test (munge-bytecode): Return a
	  bytevector instead of a u8vector.
	  (comp-test): Deal with bytevectors.

2010-02-10  Ludovic Courtès  <ludo@gnu.org>

	vlist: Slightly improve readability and consistency.
	* module/ice-9/vlist.scm (define-inline): Fix case with non-singleton
	  body.
	  (make-vhash-assoc): Remove.  Change to...
	  (%vhash-assoc): ... this, using `define-inline'.

2010-02-08  Andy Wingo  <wingo@pobox.com>

	continuations return multiple values on the stack
	* libguile/vm.h (struct scm_vm_cont): Instead of saving the "IP", save
	  "RA" and "MVRA". That is, save singly-valued and multiply-valued
	  return addresses, so that we can return multiple values on the stack.
	  (scm_i_vm_reinstate_continuation): Remove.
	* libguile/vm.c (vm_capture_continuation): Rename from capture_vm_cont,
	  and change the prototype so we can capture the RA and MVRA, and so
	  that tail calls to call/cc can capture a continuation without the
	  call/cc application frame.
	  (vm_return_to_continuation): Rename from reinstate_vm_cont, and take
	  arguments to return to the continuation. Handles returning to single
	  or multiple-value RA.
	  (scm_i_vm_capture_continuation): Change to invoke
	  vm_capture_continuation. Kept around for the benefit of make-stack.

	* libguile/vm-i-system.c (continuation-call): Handle reinstatement of
	  the VM stack, with arguments.
	  (call/cc, tail-call/cc): Adapt to new vm_capture_continuation
	  prototype. tail-call/cc captures tail continuations.

	* libguile/stacks.c (scm_make_stack): Update for scm_vm_cont structure
	  change.

	* libguile/continuations.h (struct scm_contregs): Remove throw_value
	  member, which was used to return a value to a continuation.
	  (scm_i_check_continuation): New internal function, checks that a
	  continuation may be reinstated.
	  (scm_i_reinstate_continuation): Replaces scm_i_continuation_call; just
	  reinstates the C stack.
	  (scm_i_contregs_vm, scm_i_contregs_vm_cont): New internal accessors.
	* libguile/continuations.c (scm_i_make_continuation): Return
	  SCM_UNDEFINED if we are returning again.
	  (grow_stack, copy_stack_and_call, scm_dynthrow): Remove extra arg, as
	  vm opcodes handle value returns.
	  (copy_stack): No need to instate VM continuation.
	  (scm_i_reinstate_continuation): Adapt.

2010-02-08  Andy Wingo  <wingo@pobox.com>

	scm_i_make_continuation takes vm and vm_cont args explicitly
	* libguile/continuations.h:
	* libguile/continuations.c (scm_i_make_continuation): Take VM and VM
	  continuation arguments as well; I'm not convinced that saving all VM
	  continuations was the right thing, and in any case we only ever saved
	  the latest. Running a new VM should create a continuation barrier.

	* libguile/stacks.c (scm_make_stack):
	* libguile/vm-i-system.c (call/cc, tail-call/cc): Adapt callers.

	* libguile/vm.h (scm_i_vm_capture_continuation)
	  (scm_i_vm_reinstate_continuation): Change to be internal, and to only
	  capture and reinstate continuations for a particular VM.

2010-02-08  Andy Wingo  <wingo@pobox.com>

	make scm_make_continuation internal
	* libguile/continuations.h:
	* libguile/continuations.c (scm_i_make_continuation): Change from
	  scm_make_continuation, and make internal.

	* libguile/vm-i-system.c (call/cc, tail-call/cc): Adapt callers.

	* test-suite/standalone/test-unwind.c (check_cont_body): Adapt a test.

	* doc/ref/api-control.texi (Continuations): Update docs.

2010-02-08  Andy Wingo  <wingo@pobox.com>

	eval.c uses scm_i_call_with_current_continuation
	* libguile/continuations.h
	* libguile/continuations.c (scm_i_call_with_current_continuation): New
	  internal function. Not exported because I'm not sure whether or not
	  this should have a continuation barrier in the future. Uses a
	  hand-coded VM procedure.

	* libguile/eval.c (eval): Use scm_i_call_with_current_continuation.

2010-02-08  Andy Wingo  <wingo@pobox.com>

	continuations are vm procedures
	* libguile/vm-i-system.c (continuation-call): New op, like subr-call or
	  foreign-call, but for continuations.

	* libguile/continuations.h: Add scm_i_continuation_call internal
	  declaration.
	  (SCM_CONTINUATIONP): Reimplement in terms of
	  SCM_PROGRAM_IS_CONTINUATION.
	  (scm_tc16_continuation, SCM_CONTREGS, SCM_CONTINUATION_LENGTH)
	  (SCM_SET_CONTINUATION_LENGTH, SCM_JMPBUF, SCM_DYNENV, SCM_THROW_VALUE)
	  (SCM_CONTINUATION_ROOT, SCM_DFRAME): Remove these from the exposed
	  API.
	  (scm_i_continuation_to_frame): New internal declaration.
	* libguile/continuations.c
	* libguile/continuations.c: Add trickery like in foreign.c, smob.c, and
	  gsubr.c, so that we can make procedural trampolines for continuations.
	  (scm_i_continuation_to_frame): New internal function, from stacks.c.

	* libguile/programs.h (SCM_F_PROGRAM_IS_CONTINUATION)
	  (SCM_PROGRAM_IS_CONTINUATION): Add a flag for programs that are
	  continuations. Probably should add flags for the other trampoline
	  types too.
	* libguile/programs.c (scm_i_program_print): Print continuations as
	  before.

	* libguile/stacks.c (scm_stack_id, scm_make_stack): Use
	  scm_i_continuation_to_frame in the continuation case.

2010-02-08  Andy Wingo  <wingo@pobox.com>

	push a prompt handler value even in the inline-handler case
	* module/language/tree-il/compile-glil.scm (flatten): Push a handler
	  value even in the inline-handler case, to make prompt's interface more
	  uniform, and also to correspond to the existing VM implementation.

2010-02-08  Andy Wingo  <wingo@pobox.com>

	connect a few more wires to promptenstein
	* libguile/tags.h (scm_tc7_prompt): Allocate a tc7 for prompt objects.

	* libguile/control.h (SCM_F_PROMPT_INLINE, SCM_F_PROMPT_ESCAPE)
	  (SCM_PROMPT_P, SCM_PROMPT_FLAGS, SCM_PROMPT_INLINE_P)
	  (SCM_PROMPT_ESCAPE_P, SCM_PROMPT_TAG, SCM_PROMPT_REGISTERS)
	  (SCM_PROMPT_DYNENV, SCM_PROMPT_HANDLER)
	  (SCM_PROMPT_PRE_UNWIND_HANDLER, SCM_PROMPT_SETJMP)
	  (struct scm_prompt_registers):
	* libguile/control.c (scm_c_make_prompt): Flesh out a simple prompts
	  implementation.

	* libguile/vm-i-system.c (prompt): Wire up the implementation.
	* libguile/vm.c: Add a needed #include.

2010-02-03  Michael Gran  <spk121@yahoo.com>

	Optimize reader by preferring stack-allocated buffers
	* libguile/read.c (read_token): now takes a C buffer instead of a SCM.
	  string.  All callers changed.
	  (read_complete_token): now takes C buffers, not SCM strings.  No longer
	  does port position updates or encoding processing.  All callers changed.
	  (scm_read_number, scm_read_mixed_case_symbol, scm_read_number_and_radix)
	  (scm_read_character): Do port updates and string processing no longer
	  done by read_complete_token. Some reordering for optimization.

2010-02-03  Ludovic Courtès  <ludo@gnu.org>

	Use vhashes in `unused-variable-analysis'.
	* module/language/tree-il/analyze.scm (unused-variable-analysis): Use
	  vhashes instead of alists/lists.

	Use vhashes in `arity-analysis'.
	* module/language/tree-il/analyze.scm (arity-analysis): Use vhashes
	  instead of alists.

	Use vhashes in `unbound-variable-analysis'.
	* module/language/tree-il/analyze.scm (unbound-variable-analysis): Use
	  vhashes instead of alists/lists.

	Use vhashes in `unused-toplevel-analysis'.
	* module/language/tree-il/analyze.scm (graph-reachable-nodes): Add
	  REACHABLE argument.  Update to use vhash instead of alists or lists.
	  (graph-reachable-nodes*): Adjust accordingly.
	  (partition*): New function.
	  (unused-toplevel-analysis): Adjust to use vhash instead of alists or
	  lists.

2010-02-03  Ludovic Courtès  <ludo@gnu.org>

	Add `(ice-9 vlist)'.
	* module/ice-9/vlist.scm, test-suite/tests/vlist.test,
	  benchmark-suite/benchmarks/vlists.bm: New files.

	* module/Makefile.am (ICE_9_SOURCES): Add `vlist.scm'.

	* test-suite/Makefile.am (SCM_TESTS): Add `tests/vlist.test'.

	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
	  `benchmarks/vlists.bm'.

	* doc/ref/api-compound.texi (VLists, VHashes): New nodes.

2010-02-01  Ludovic Courtès  <ludo@gnu.org>

	Inline SRFI-9 constructors too.
	* module/srfi/srfi-9.scm (define-record-type)[constructor]: Use
	  `define-inlinable' instead of `define'.

	* test-suite/lib.scm (exception:syntax-pattern-unmatched): New variable.

	* test-suite/tests/srfi-9.test ("constructor")["foo 0 args (inline)",
	  "foo 2 args (inline)"]: New tests.
	  ["foo 0 args", "foo 2 args"]: Adjust to constructor inlining.

	* testsuite/t-records.scm: Remove wrong-arg-count case.

2010-02-01  Ludovic Courtès  <ludo@gnu.org>

	SRFI-9: Fix `define-inlinable'.
	* module/srfi/srfi-9.scm (define-inlinable): Fix the catch-all case of
	  the generated macro.

2010-01-31  Andy Wingo  <wingo@pobox.com>

	add (ice-9 control)
	* module/language/tree-il/primitives.scm (define-primitive-expander):
	  Allow quoted datums. Allow all self-evaluating expressions to be
	  constants.
	  (prompt, control): Add primitive expanders to turn these into @prompt
	  and @control.

	* module/ice-9/control.scm: New module, for delimited continuation
	  operators.

	* module/Makefile.am: Add.

2010-01-31  Andy Wingo  <wingo@pobox.com>

	add @control and @prompt stub primitives
	* libguile/Makefile.am:
	* libguile/control.c:
	* libguile/control.h:
	* libguile/init.c: Add stub @control and @prompt primitives, for use
	  when bootstrapping (ice-9 control).

2010-01-31  Andy Wingo  <wingo@pobox.com>

	GLIL and assembly support for prompt compilation
	* module/language/glil/compile-assembly.scm (glil->assembly): Compile
	  <glil-prompt> appropriately.

	* module/language/assembly/disassemble.scm (code-annotation):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	  Assemble and disassemble `prompt' appropriately.

2010-01-31  Andy Wingo  <wingo@pobox.com>

	tree-il -> glil compilation of prompt, dynamic-wind, control
	* module/language/tree-il/compile-glil.scm (flatten): Compile <prompt>,
	  <dynamic-wind>, and <control>.

	add return/nvalues
	* libguile/vm-i-system.c (return/nvalues): New instruction, like
	  call/nargs.

	GLIL support for <prompt>
	* module/language/glil.scm (<glil>): Add <glil-prompt>, with
	  handler-label and escape-only? fields.

	tree-il analyzer and inliner handle <prompt>
	* module/language/tree-il/analyze.scm (analyze-lexicals): Add cases for
	  <prompt>, <dynamic-wind>, and <control>. If a continuation is not
	  referenced in the body of a prompt handler, mark the prompt as
	  escape-only.
	* module/language/tree-il/inline.scm (inline!): Inline the handler of a
	  prompt if it is a simple lambda.

	dynamic-wind compilation to VM ops
	* module/language/tree-il/primitives.scm: Resolve calls to dynamic-wind
	  to <dynamic-wind>, thereby inlining the dynwind to VM ops, and
	  allowing inline allocation of the body thunk.

	new tree-il for prompt, control, and dynamic-wind
	* module/language/tree-il.scm: Initial tree-il support for <prompt>,
	  <control>, and <dynamic-wind>.

	initial VM support for delimited continuations and dynamic-wind
	* libguile/vm-i-system.c (prompt, wind, throw, unwind):
	  New instructions, for implementing dynamic-wind and delimited
	  continuations.
	* libguile/vm.c: Add some stub support for the new instructions.
	* libguile/vm-engine.c: Some new error conditions.

2010-01-27  Andy Wingo  <wingo@pobox.com>

	add a test for ffi and pointers
	* test-suite/standalone/test-ffi:
	* test-suite/standalone/test-ffi-lib.c: Add a pointer test.

2010-01-27  Andy Wingo  <wingo@pobox.com>

	add simple foreign finalization, and pointer support
	* libguile/foreign.h:
	* libguile/foreign.c (scm_foreign_set_finalizer_x): New function, for a
	  limited form of finalization (like `free').
	  (scm_alignof, scm_sizeof, parse_ffi_type, fill_ffi_type): For the
	  purposes of make-foreign-function, treat '* (the asterisk symbol) as a
	  pointer.

	* module/system/foreign.scm: Export foreign-set-finalizer!.

2010-01-27  Andy Wingo  <wingo@pobox.com>

	statprof bugfixes
	* module/statprof.scm (get-call-data): For closures, get call data by
	  the program's objcode.
	  (statprof-start, statprof-stop): Fix bug in which all statprof runs
	  were enabling the apply hook regardless of the setting of
	  #:count-calls?. The result was distorted timings, where procedure
	  calls were unfairly penalized.
	  (procedure=?): Streamline.

	inline calls to variable-bound?
	* module/language/tree-il/compile-glil.scm (*primcall-ops*):
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Actually resolve calls to
	  `variable-bound?' to the opcode that we have for it.

	fix to variable-bound? instruction prototype
	* libguile/vm-i-system.c (variable-bound?): Correctly declare as popping
	  one item.

	remove incremental NEWS entries in preparation for 1.9.8
	* NEWS

2010-01-26  Andy Wingo  <wingo@pobox.com>

	add a test for foreign functions taking struct args
	* test-suite/standalone/test-ffi (f-sum-struct):
	* test-suite/standalone/test-ffi-lib.c (test_ffi_sum_struct): Add a
	  struct test. Wheee....

	turn asserts into exceptions in foreign.c
	* libguile/foreign.c (scm_foreign_ref, scm_foreign_set_x)
	  (scm_i_foreign_print, fill_ffi_type, cif_to_procedure, unpack): Turn a
	  number of asserts into proper errors.

	add make-c-struct, parse-c-struct
	* module/system/foreign.scm: Export alignof and sizeof.
	  (make-c-struct, parse-c-struct): New public functions.

	add `alignof' and `sizeof' Scheme functions
	* libguile/foreign.h:
	* libguile/foreign.c (scm_alignof, scm_sizeof): New functions.

	add ffi tests
	* test-suite/standalone/Makefile.am:
	* test-suite/standalone/test-ffi:
	* test-suite/standalone/test-ffi-lib.c: Add some tests for the ffi.

2010-01-26  Andy Wingo  <wingo@pobox.com>

	implement foreign-call
	* libguile/foreign.h:
	* libguile/foreign.c (scm_i_foreign_call): New internal function,
	  actually implementing foreign calls. Untested.

	* libguile/vm-i-system.c (foreign-call): Wire up the call to
	  scm_i_foreign_call.

2010-01-26  Andy Wingo  <wingo@pobox.com>

	first pass at implementing low-level foreign functions
	* libguile/Makefile.am (AM_CPPFLAGS): Move LIBFFI_CFLAGS here (from
	  AM_CFLAGS), allowing snarfing to work.

	* libguile/foreign.h (scm_make_foreign_function): New public function.

	* libguile/foreign.c: Flesh out an implementation of foreign functions.
	  (scm_take_foreign_pointer): Bugfix for the case in which we have a
	  finalizer.

	* module/system/foreign.scm: Export `make-foreign-function'.

2010-01-26  Andy Wingo  <wingo@pobox.com>

	renumber VM opcodes
	* libguile/vm-i-loader.c:
	* libguile/vm-i-scheme.c:
	* libguile/vm-i-system.c: Renumber ops. Add a foreign-call op stub.
	  Rearrange some ops.

	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump

2010-01-26  Andy Wingo  <wingo@pobox.com>

	byte access to foreigns via bytevectors
	* libguile/foreign.h:
	* libguile/foreign.c (scm_foreign_ref, scm_foreign_set_x): Remove all
	  bits about offsets and aliasing; bytevectors are much better at that.
	  (scm_foreign_to_bytevector, scm_bytevector_to_foreign): New functions
	  for getting at the bytes of a memory region.

	* module/system/foreign.scm (foreign->bytevector, bytevector->foreign):
	  Export these.

2010-01-26  Andy Wingo  <wingo@pobox.com>

	move foreign function interface to its own module
	* libguile/foreign.h:
	* libguile/init.c: Change so that init just registers an extension,
	  later called by foreign.scm.

	* libguile/foreign.c (scm_init_foreign): Define constants for the
	  various foreign types.

	* module/Makefile.am:
	* module/system/foreign.scm: New module, for the foreign function
	  interface.

2010-01-26  Andy Wingo  <wingo@pobox.com>

	foreign.h presents a more pointer-centric interface
	* libguile/foreign.c:
	* libguile/foreign.h: Rework interface to be more pointer-centric.
	  Details are:
	  (SCM_FOREIGN_TYPE_STRUCT, SCM_FOREIGN_TYPE_POINTER): Removed; now the
	  pointer in a foreign is first-class. If it points to a native type
	  like uint32, then it still has a tag; but if it points to something
	  else, like a struct or a pointer or something, then its type is VOID
	  (i.e., void*).
	  (SCM_FOREIGN_POINTER): Rename from SCM_FOREIGN_OBJECT.
	  (SCM_FOREIGN_VALUE_REF, SCM_FOREIGN_VALUE_SET): Rename from
	  SCM_FOREIGN_OBJECT_REF and SCM_FOREIGN_OBJECT_SET, to indicate that
	  they only work with value types.
	  (SCM_FOREIGN_HAS_FINALIZER): Reserve a bit to indicate if the foreign
	  pointer in question has a finalizer registered.
	  (SCM_FOREIGN_LEN): For void* pointers, optionally store the length in
	  bytes of the associated memory region.
	  (SCM_FOREIGN_VALUE_P): Rename from SCM_FOREIGN_SIMPLE_P.
	  (SCM_VALIDATE_FOREIGN_VALUE): Rename from SCM_VALIDATE_FOREIGN_SIMPLE.
	  (scm_take_foreign_pointer): Rename from scm_c_take_foreign. Remove
	  scm_c_from_foreign.
	  (scm_foreign_type): New accessor.
	  (scm_foreign_ref, scm_foreign_set_x): Take some optional args, used
	  when dereferencing void pointers.

	* libguile/dynl.h:
	* libguile/dynl.c (scm_dynamic_pointer): New function, used by
	  scm_dynamic_func. Adapt code to foreign.h changes.

	* libguile/goops.c (scm_enable_primitive_generic_x)
	  (scm_set_primitive_generic_x): Use the SCM_SET_SUBR_GENERIC macro.

	* libguile/gsubr.c (create_gsubr): Adapt to API change.
	* libguile/gsubr.h (SCM_SUBRF, SCM_SUBR_GENERIC): Store the pointer
	  directly, not indirected.

	* libguile/snarf.h (SCM_DEFINE, SCM_IMMUTABLE_FOREIGN): Store subr
	  pointers directly. Adapt to SCM_FOREIGN_TYPE_VOID change.

	* libguile/vm-i-system.c (subr-call): Access the void* directly.

2010-01-26  Andy Wingo  <wingo@pobox.com>

	add libffi dependency
	* configure.ac:
	* libguile/Makefile.am (AM_CFLAGS, libguile_la_LDFLAGS): Add a libffi
	  dependency, for making a dynamic FFI.

2010-01-26  Ludovic Courtès  <ludo@gnu.org>

	Recognize structs with both "pr" and "pw" flags as simple.
	* libguile/struct.c (set_vtable_layout_flags): Keep the
	  `SCM_VTABLE_FLAG_SIMPLE' flag when VTABLE has a mixture of `r' and `w'
	  fields.

	* libguile/struct.h (SCM_VTABLE_FLAG_SIMPLE): Adjust comment.

2010-01-25  Ludovic Courtès  <ludo@gnu.org>

	Add ASCII art representing the basic struct layout.
	* libguile/struct.h: Add ASCII art version of the basic struct layout as
	  shown in Andy's diagrams.

	Reinstate 2-word displacement for structs.
	* libguile/struct.c (scm_init_struct): Reinstate 2-word displacement
	  removed by 01e74380f6170b5cb1105e5df9a368ab257420ef.

2010-01-23  Michael Gran  <spk121@yahoo.com>

	R6RS string escapes broken on string output
	scm_to_stringn failed to do the necessary escape conversion for
	R6RS hex escapes

	* libguile/strings.c (unistring_escapes_to_r6rs_escapes): new function
	  (scm_to_stringn): use new function when r6rs hex escapes are enabled

	* test-suite/tests/reader.test: new test for string display

2010-01-23  Ludovic Courtès  <ludo@gnu.org>

	Revert "Install `standard-library.info'."
	This reverts commit 0e64cbea3d22411564af302a63b670fe0617ccf3.

2010-01-23  Ludovic Courtès  <ludo@gnu.org>

	Add `struct-ref' and `struct-set' VM opcodes.
	* libguile/vm-i-scheme.c (make_struct): Optimize the
	  `SCM_VTABLE_FLAG_SIMPLE' case.
	  (struct_ref, struct_set): New opcodes.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add
	  `struct-ref' and `struct-set!'.

	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Likewise.
	  (*effect-free-primitives*): Add `struct-ref'.

2010-01-23  Ludovic Courtès  <ludo@gnu.org>

	Slightly improve comments and style in `struct.c'.
	* libguile/struct.c (scm_i_struct_inherit_vtable_magic): Comment.
	  Punctuate comments within the body, have them follow GCS.
	  (scm_make_vtable_vtable): Clarify comments.

	Clarify GC-registered displacements for structs.
	* libguile/struct.c (scm_init_struct): Remove unneeded
	  `GC_REGISTER_DISPLACEMENT ()' call.  Comment the remaining one.

2010-01-23  Ludovic Courtès  <ludo@gnu.org>

	Optimize struct initialization and accessors for the common case.
	* libguile/struct.c (set_vtable_layout_flags): New function.
	  (scm_i_struct_inherit_vtable_magic): Use it.
	  (scm_struct_init): Optimize the case where HANDLE's vtable has the
	  `SCM_VTABLE_FLAG_SIMPLE' flag.
	  (scm_struct_ref): Likewise.
	  (scm_struct_ref): Likewise, when `SCM_VTABLE_FLAG_SIMPLE_RW' is also set.

	* libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Update comment for the
	  next-to-last hidden field.
	  (scm_vtable_index_reserved_6): Rename to...
	  (scm_vtable_index_size): ... this.
	  (SCM_VTABLE_FLAG_RESERVED_0): Rename to...
	  (SCM_VTABLE_FLAG_SIMPLE): ... this.
	  (SCM_VTABLE_FLAG_RESERVED_1): Rename to...
	  (SCM_VTABLE_FLAG_SIMPLE_RW): ... this.

	* test-suite/tests/structs.test ("low-level struct
	  procedures")["struct-ref", "struct-set!", "struct-ref out-of-range",
	  "struct-set! out-of-range"]: New tests.

2010-01-22  Ludovic Courtès  <ludo@gnu.org>

	Install `standard-library.info'.
	* doc/ref/Makefile.am (BUILT_SOURCES): Move `standard-library.texi'
	  to...
	  (nodist_info_TEXINFOS): ... here.  New variable.

2010-01-20  Ludovic Courtès  <ludo@gnu.org>

	Fix `uniform-vector-read!' and `uniform-vector-write'.
	* libguile/deprecated.c (scm_uniform_vector_read_x,
	  scm_uniform_vector-write): Account for optional arguments.  Make sure
	  the former always returns an integer.

	* libguile/deprecated.h (scm_uniform_vector_read_x,
	  scm_uniform_vector_write, scm_uniform_array_read_x,
	  scm_uniform_array_write): Mark as `SCM_DEPRECATED'.

2010-01-19  Ludovic Courtès  <ludo@gnu.org>

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

	Update `NEWS'.

	Document `guile-tools compile'.
	* doc/ref/api-evaluation.texi (Compilation): Document `guile-tools
	  compile'.

2010-01-19  Ludovic Courtès  <ludo@gnu.org>

	Reinstate `scm_is_bool ()' as a function.
	* libguile/boolean.c (scm_is_bool): New function.

	* libguile/boolean.h (scm_is_bool): New function declaration.

2010-01-19  Ludovic Courtès  <ludo@gnu.org>

	Make `sockets.test' more robust.
	* test-suite/tests/socket.test ("AF_INET6/SOCK_STREAM"): Gracefully
	  handle cases where this combination is not supported.

2010-01-19  Michael Gran  <spk121@yahoo.com>

	Document modal encodings problem in ref doc
	* doc/ref/api-io.texi (Ports): note that modal encodings are not
	  supported

2010-01-19  Ludovic Courtès  <ludo@gnu.org>

	Fix use of utimensat(2).
	* libguile/posix.c (scm_utime): Use "#ifdef HAVE_UTIMENSAT", not "#if
	  HAVE_UTIMENSAT".  Fix GCC warning around call to utimensat(2):
	  "passing argument 3 of 'utimensat' from incompatible pointer type".

	* test-suite/tests/posix.test ("utime"): New test prefix.

2010-01-18  Michael Gran  <spk121@yahoo.com>

	Move string internals description in ref doc
	* doc/ref/api-data.texi: move string internals section

	String ref doc updates for case and conversion
	* doc/ref/api-data.texi: clarifications on Alphabetic Case Mapping and
	  Conversion To/From C.

	Document string-bytes-per-char and %string-dump
	* doc/ref/api-data.texi (String Internals): new subsubsection.  Document
	  string-bytes-per-char and %string-dump.

2010-01-17  Michael Gran  <spk121@yahoo.com>

	object->assembly shouldn't presume existence of %nil
	The %nil constant only exists if SCM_ENABLE_ELISP is defined.

	* module/language/assembly (object->assembly): check for existence of %nil

2010-01-17  Michael Gran  <spk121@yahoo.com>

	reader options macros incorrect when SCM_ENABLE_ELISP undefined
	When compiled with SCM_ENABLE_ELISP undefined, the reader options
	macros SCM_R6RS_ESCAPES_P and SCM_SQUARE_BRACKETS_P point past
	the end of the scm_read_opts struct.

	*libguile/private-options.h (SCM_R6RS_ESCAPES_P) [!SCM_ENABLE_ELISP]: modified
	 (SCM_SQUARE_BRACKETS_P) [!SCM_ENABLE_ELISP]: modified
	 (SCM_N_READ_OPTIONS): modified

2010-01-17  Andy Wingo  <wingo@oblong.net>

	fix doc snarfing with fedora 12
	* module/scripts/snarf-check-and-output-texi.scm
	  (process-multiline-directive): Be more accepting of source location
	  markers in the preprocessed source, by adding a couple cases in which
	  they can appear. Not foolproof, but it does adapt to what new GCCs are
	  putting out (e.g. cpp (GCC) 4.4.2 20091222 (Red Hat 4.4.2-20)).

2010-01-17  Andy Wingo  <wingo@oblong.net>

	nanosecond timestamp support in stat and utime
	* libguile/posix.h:
	* libguile/posix.c (scm_utime): Add optional nanosecond arguments. This
	  is an incompatible change on the C level, but it's unlikely people are
	  using this POSIX wrapper function, because they would just use the
	  POSIX function directly. Hopefully, anyway.

	* module/system/base/compile.scm (call-with-output-file/atomic):
	  Propagate source timestamps to targets with nanosecond precision, if
	  available. Fixes build on systems with ext4 filesystems.

	* libguile/filesys.c (scm_stat2scm):
	* module/ice-9/posix.scm (stat:atimensec, stat:mtimensec)
	  (stat:ctimensec): Add three new elements to Scheme stat structures,
	  for nanosecond-level timestamps.

	* configure.ac: Add checks for utimensat, and for nanosecond fields in
	  struct stat. We should switch to using Gnulib things for these,
	  though.

	* doc/ref/posix.texi (File System): Add documentation for utime's
	  additional arguments, and nanosecond stat timestamp accessors.

2010-01-15  Andy Wingo  <wingo@pobox.com>

	fix (class-of #u32())
	* libguile/goops.c (scm_class_of, create_standard_classes): Return
	  <bytevector> or <uvec> for bytevectors, as appropriate.

	add reader option for parsing [] as ().
	* libguile/private-options.h:
	* libguile/read.c (scm_read_opts, SCM_SQUARE_BRACKETS_P): Add an option
	  for treating [ and ] as parentheses, on by default. Note that this
	  makes them delimiters also, so [ and ] cannot appear in a symbol name,
	  with this read option on.
	  (scm_read_sexp): If we start with [, we end with ].
	  (scm_read_expression): Add case for [.

2010-01-14  Andy Wingo  <wingo@pobox.com>

	fix call counting in statprof, enhance repl support
	* module/statprof.scm: Use VM modules, instead of using @ hacks.
	  (statprof): New public export, a functional interface to the profiler.
	  (profile-signal-handler, count-call, statprof-start, statprof-stop):
	  Fix call counting with the VM.
	  (statprof-call-data->stats): Hack around a case in which a call could
	  be sampled but not counted, if you get my drift.
	  (procedure=?): Update for current API.
	  (with-statprof): Use `statprof'.

	* module/system/repl/command.scm (profile): Use the `statprof'
	  procedural interface.

2010-01-14  Andy Wingo  <wingo@oblong.net>

	vm.c uses scm_c_take_bytevector instead of scm_take_u8vector
	* libguile/vm.c (really_make_boot_program): Use scm_c_take_bytevector to
	  avoid loading srfi-4 at boot time.

2010-01-14  Andy Wingo  <wingo@pobox.com>

	1.8 compat in ice-9 syncase
	* module/ice-9/syncase.scm: Export datum->syntax-object and
	  syntax-object->datum as aliases of datum->syntax and syntax->datum.
	  Thanks to Daniel Llorens del Río for the suggestion.

	vm-trace prints return values
	* module/system/vm/trace.scm (vm-trace): Add a #:width argument. Print
	  return values, as Chez Scheme does.

2010-01-13  Andy Wingo  <wingo@pobox.com>

	RETURN_HOOK communicates the number of returned values
	* libguile/vm-engine.h (RUN_HOOK1): Add some machinery whereby a hook
	  can push an arg on the stack, run the hook, then drop the value.
	  (RETURN_HOOK): Use it here, so we push the number of returned values.

	* libguile/vm-i-system.c (return, return-values): Adapt to RETURN_HOOK
	  changes.

2010-01-13  Andy Wingo  <wingo@pobox.com>

	vm-trace only traces execution of its thunk
	* module/system/vm/trace.scm (vm-trace): Change to just export the one
	  procedure, vm-trace. This way it's threadsafe and more robust. Also
	  refactor to not print any of Guile's internal bits. Hopefully Neil
	  will be happier :)

	* module/system/repl/command.scm (option): Adapt to removal of
	  vm-trace-on! and vm-trace-off!, as those are unlikely to DTRT.

2010-01-13  Andy Wingo  <wingo@pobox.com>

	remove unused var in read.c
	* libguile/read.c (scm_read_character): Remove unused var.

2010-01-13  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Use `mkstemp' instead of `mktemp'.
	* test-suite/standalone/test-unwind.c (check_ports):
	Use `mkstemp' instead of `mktemp'.

	Update configure script hints wrt precious env vars.
	* README: Don't suggest setting vars before running configure.
	Instead, suggest specifying them on the configure command-line.

2010-01-13  Michael Gran  <spk121@yahoo.com>

	Document R6RS hex escapes
	* doc/ref/api-data.texi (Characters, String Syntax): document r6rs hex
	  escapes

	* doc/ref/api-options.texi (Reader Options): document r6rs-hex-escapes
	  reader option

2010-01-13  Michael Gran  <spk121@yahoo.com>

	Disable \u and \U escapes when r6rs-hex-escapes enabled
	When the reader option 'r6rs-hex-escapes is enabled, the \uNNNN and
	\UNNNNNN string escape sequences should be disabled.

	* libguile/read.c (scm_read_string): added checks for SCM_R6RS_ESCAPES_P

2010-01-13  Michael Gran  <spk121@yahoo.com>

	Move r6rs-hex-escape tests into reader.test
	* test-suite/tests/reader.test (r6rs-hex-escapes): new tests

	* test-suite/tests/chars.test (R6RS Hex escapes): remove tests by reverting
	  to previous version

	* test-suite/tests/strings.test (R6RS Hex escapes): remove tests by
	  reverting to previous version

2010-01-13  Michael Gran  <spk121@yahoo.com>

	Reader option for R6RS hex escapes
	This adds a reader option 'r6rs-hex-escapes that modifies the
	behavior of numeric escapes in characters and strings.  When enabled,
	variable-length character hex escapes (#\xNNN) are allowed and become
	the default output format for numerically-escaped characters.  Also,
	string hex escapes switch to a semicolon terminated hex escape (\xNNNN;).

	* libguile/print.c (PRINT_CHAR_ESCAPE): new macro
	  (iprin1): use new macro PRINT_CHAR_ESCAPE

	* libguile/private-options.h (SCM_R6RS_ESCAPES_P): new #define

	* libguile/read.c (scm_read_opts): add new option r6rs-hex-escapes
	  (SCM_READ_HEX_ESCAPE): modify to take a terminator parameter
	  (scm_read_string): parse R6RS hex string escapes
	  (scm_read_character): parse R6RS hex character escapes

	* test-suite/tests/chars.test (with-read-options): new procedure
	  (R6RS hex escapes): new tests

	* test-suite/tests/strings.test (with-read-options): new procedure
	  (R6RS hex escapes): new tests

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

	fix texinfo reflection for procedures
	* module/system/vm/program.scm (program-arguments-alist): Rename from
	  program-arguments, a name shadowed by features.c
	  (arglist->arguments-alist, arity->arguments-alist)
	  (arguments-alist->lambda-list, program-lambda-list, write-program):
	  Adapt callers.

	* module/system/vm/frame.scm (frame-lookup-binding): Return #f if the
	  binding is not found, not an error.
	  (frame-binding-set!, frame-binding-ref): Adapt to error appropriately.
	  (frame-arguments): Dispatch to frame-call-representation.
	  (frame-call-representation): Refactor a bit.

	* module/ice-9/session.scm (procedure-arguments): Adapt to
	  program-arguments name change.

	* module/texinfo/reflection.scm (get-proc-args): Refactor to actually
	  work with VM procedures.

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

	allow simple value definitions with define*-public
	* module/ice-9/optargs.scm (define*-public): Allow (define*-public ID
	  VAL).

	hopefully fix shared c32 / c64 uniform arrays
	* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): Add a width parameter,
	  indicating the number of sizeof(ctype) entries comprised by one
	  element of the uniform; normally 1, but 2 for c32 and c64.

	make-array bugfix
	* libguile/vm-i-scheme.c (make-array): Fix terrible stack corruption
	  bug.

	inspector integration in debugger
	* module/system/vm/debug.scm: Integrate with the inspector. Add a
	  "procedure" command.

	fix srfi-4 shared vector access from c
	* libguile/srfi-4.c (DEFINE_SRFI_4_C_FUNCS): Fix
	  elements/writable_elements for shared vectors. Thanks to Daniel
	  Llorens del Río for the info.

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

	programs print as #<procedure ...>
	* module/system/vm/program.scm (write-program): Print as #<procedure
	  ...>. Fix stdin printing.

	* doc/ref/vm.texi: Update a little bit.

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

	add a silly inspector
	* module/Makefile.am:
	* module/system/vm/inspect.scm: Add a very simple and stupid inspector.

2010-01-11  Andy Wingo  <wingo@pobox.com>

	remove section on enclose-array
	* doc/ref/api-compound.texi (Array Procedures): Remove section on
	  `enclose-array', as it doesn't exist any more.

	fix compilation of #2((1 2 3) (4 5 6))
	* module/language/glil/compile-assembly.scm (dump-object): Whoops,
	  really fix for multidimensional arrays.

	allow (define* SYM VAL)
	* module/ice-9/psyntax.scm (define*): Allow (define* SYM VAL), as 1.8
	  did. Thanks to Patrick McCarty for the report.

2010-01-11  Andy Wingo  <wingo@pobox.com>

	allow compilation of #@2(1 2 3)
	* libguile/arrays.h:
	* libguile/arrays.c (scm_from_contiguous_array): New public function,
	  like scm_from_contiguous_typed_array but for arrays of generic Scheme
	  values.

	* libguile/vm-i-scheme.c (make-struct): Sync regs before making the
	  struct, so if we get a GC the regs are on the heap.
	  (make-array): New instruction, makes an generic (untyped) Scheme
	  array.

	* module/language/glil/compile-assembly.scm (dump-object): Correctly
	  compile arrays.

2010-01-11  Andy Wingo  <wingo@pobox.com>

	fix erroneous compilation of #@2(1 2 3) as #(1 2 3)
	* module/language/glil/compile-assembly.scm (dump-object): Fix the
	  vector case to only match 0-indexed, vectors, not arrays like #@2(1 2
	  3).

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

	Evaluate the `export' and `re-export' forms at compile-time.
	* module/ice-9/boot-9.scm (export, re-export): Evaluate at compile-time
	  in addition to load/eval.

	* test-suite/tests/tree-il.test ("warnings")["unused-toplevel"]("unused
	  but define-public"): Remove throw to `unresolved'.

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

	The reference graph in `-Wunused-toplevel' may contain cycles.
	* module/language/tree-il/analyze.scm (<reference-graph>,
	  dag-reachable-nodes, dag-reachable-nodes*, unused-toplevel-analysis):
	  Replace occurrences of "dag" by "graph".

2010-01-11  Michael Gran  <spk121@yahoo.com>

	Refactor repeated code in scm_read_string
	* libguile/read.c (SCM_READ_HEX_ESCAPE): new macro
	  (scm_read_string): use new macro SCM_READ_HEX_ESCAPE

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

	Move `feature?' to `deprecated.scm'.
	* module/ice-9/boot-9.scm (feature?): Move to...

	* module/ice-9/deprecated.scm (feature?): ... here.

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

	Make `(ice-9 deprecated)' a module of its own.
	* module/ice-9/boot-9.scm: Load `deprecated.scm' with
	  `resolve-interface' instead of `primitive-load-path'.

	* module/ice-9/deprecated.scm: Turned into a module, `(ice-9
	  deprecated)'.

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

	Make `boot-9.scm' more friendly with `-Wunused-toplevel'.
	* module/ice-9/boot-9.scm: Switch back to the `(guile)' modules at the
	  end when compiling.

	Fix SRFI-19 exports.
	* module/srfi/srfi-19.scm: Export `time-monotonic->julian-day' and
	  `time-monotonic->modified-julian-day'.  Remove obscure `current-time'
	  hack.  Use `(define-module :export ...)' instead of `(export ...)'.

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

	Remove unused top-level variables.
	* module/ice-9/runq.scm (fork-strips): Remove.

	* module/language/assembly.scm (*block-alignment*): Remove.

	* module/language/assembly/disassemble.scm (disassemble-objects,
	  simplify): Remove.

	* module/srfi/srfi-18.scm (mutex-owners): Remove.

	* module/srfi/srfi-19.scm (leap-year?): Remove.

	* module/system/base/compile.scm (dsu-sort): Remove.

	* module/texinfo.scm (ascii->char): Remove.

	* module/texinfo/html.scm (ignored?): Remove.

	* module/texinfo/indexing.scm (def-name): Remove.

	* module/texinfo/plain-text.scm (ignore): Remove.

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

	Have "guile-tools compile" use the current locale.
	* meta/guile-tools.in (main): Install the user's locale.

	Provide Guile-friendly `coding:' meta-data.
	* module/ice-9/i18n.scm, module/rnrs/bytevector.scm,
	  module/rnrs/io/ports.scm, module/scripts/compile.scm,
	  module/srfi/srfi-35.scm, module/srfi/srfi-88.scm: Write `coding:'
	  comment at the top.

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

	Add `-Wunused-toplevel' compiler warning.
	* module/language/tree-il/analyze.scm (<reference-dag>): New record
	  type.
	  (dag-reachable-nodes, dag-reachable-nodes*, unused-variable-analysis):
	  New variables.
	  (unbound-variable-analysis): Slightly simplify the `up' procedure.

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

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

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

2010-01-11  Michael Gran  <spk121@yahoo.com>

	Merge branch 'master' of git.sv.gnu.org:/srv/git/guile

2010-01-11  Michael Gran  <spk121@yahoo.com>

	Add R6RS backspace string escape
	R6RS suggests that '\b' should be a string escape for the backspace
	character.

	* libguile/read.c (scm_read_string): parse backspace escape

	* test-suite/tests/strings.test (R6RS backslash escapes): new test
	  (Guile extensions backslash escapes): remove R6RS escapes from test.

	* doc/ref/api-data.texi (Strings): document new string escape

2010-01-11  Michael Gran  <spk121@yahoo.com>

	Add R6RS backslash string escape
	R6RS suggests that '\b' should be a string escape for the backslash
	character.

	* libguile/read.c (scm_read_string): parse backspace escape

	* test-suite/tests/strings.test (R6RS backslash escapes): new test
	  (Guile extensions backslash escapes): remove R6RS escapes from test.

	* doc/ref/api-data.texi (Strings): document new string escape

2010-01-11  Michael Gran  <spk121@yahoo.com>

	Add R6RS character names
	R6RS adds new names for some of the control characters.

	* libguile/chars.c (scm_r6rs_charnames, scm_r6rs_charnums)
	  (SCM_N_R6RS_CHARNAMES): new character name constants
	  (scm_alt_charnames, scm_alt_charnums): modified to remove duplicates
	  (scm_i_charname, scm_i_charname_to_char): use new constants

	* test-suite/tests/chars.test (R5RS character names, R6RS character names):
	  new tests

	* doc/ref/api-data.texi (Characters): updated

2010-01-10  Andy Wingo  <wingo@pobox.com>

	fix properties disassembly
	* module/language/assembly/disassemble.scm (disassemble-meta):
	  Properties start with the fourth element, not the third. (The third is
	  the set of arities.)

	show args to subr calls in backtraces
	* module/system/vm/frame.scm (frame-arguments): For subrs, we don't get
	  names in the lambda-list, we get #f instead. But still, parse out the
	  args in that case, assuming they are on the stack in that order.

	update NEWS
	* NEWS: Update for 1.9.7, and fold new entries into the main text.

	fold 1.9.6 NEWS into the main text
	* NEWS: Incorporate 1.9.6 NEWS items into the main text.

2010-01-09  Thien-Thi Nguyen  <ttn@gnuvola.org>

	Fix bug: Use correct `FUNC_NAME' for `scm_macro_binding'.
	* libguile/macros.c (scm_macro_binding): Use correct FUNC_NAME.

	Add cast in `make_vm' to silence compiler warning.
	* libguile/vm.c (make_vm): Add cast for .stack_base assignment.

	Fix bug: Init auto var to unrandomize `stack_depth' rv.
	* libguile/stacks.c (stack_depth): Init `n'.

2010-01-09  Andy Wingo  <wingo@pobox.com>

	fix SCM_STACK_OVERFLOW_P bug
	* libguile/stackchk.h (SCM_STACK_OVERFLOW_P): Fix a potential overflow,
	  depending on the absolute values of the thread base and the stack
	  limit. Thanks to Ivan Shcherbakov for the report.

	slight tweak to stack narrowing in the debugger
	* module/system/vm/debug.scm: Really narrow two frames and not by
	  function, so it works in the evaluator.

	fix bug in subr-call and smob-call
	* libguile/vm-i-system.c (subr-call, smob-call): Unlike the previous
	  situation, in which a call to a subr or a smob didn't actually build a
	  frame, we no longer need to explicitly pop the procedure and its
	  arguments. Indeed the procedure and its arguments must remain on the
	  stack, for hooks and ticks and such always to see frames with valid
	  procedures. Two lines out, two bugs less, and faster to boot.

	Narrow one more frame in debug.scm:debug-pre-unwind-handler
	* module/system/vm/debug.scm (debug-pre-unwind-handler): Narrow two
	  frames instead of stack-reffing past one. The second frame is
	  necessary, now that make-stack itself is on the stack.

	print the error more nicely when we enter the debugger
	* module/system/vm/debug.scm (debug-pre-unwind-handler): Nicer printing
	  of the error.

2010-01-09  Andy Wingo  <wingo@pobox.com>

	make backtraces prettier
	* module/system/vm/debug.scm (print-frames): Clean up a bit, reverting
	  part of the previous change. (The problem was that in the else branch
	  of the conditional, it didn't consume an arg.)

	  In the future I would like to preserve the clean look of the
	  backtraces. It's easier to read that way.

2010-01-09  Andy Wingo  <wingo@pobox.com>

	port-encoding returns #f if port encoding not set
	* libguile/ports.c (scm_port_encoding): Instead of returning "NONE" if
	  we don't know the encoding, return #f. Allows truncated-print to work
	  if you don't have a locale set.

2010-01-09  Andy Wingo  <wingo@pobox.com>

	allocate free variables inline to closures
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

	* libguile/programs.h (SCM_PROGRAM_FREE_VARIABLES)
	  (SCM_PROGRAM_FREE_VARIABLE_REF, SCM_PROGRAM_FREE_VARIABLE_SET)
	  (SCM_PROGRAM_NUM_FREE_VARIABLES):
	* libguile/programs.c (scm_make_program, scm_program_num_free_variables)
	  (scm_program_free_variable_ref, scm_program_free_variable_set_x):
	  Allocate free variables inline with programs, instead of being in a
	  vect. Should improve locality, and require fewer local variables in
	  the VM.

	* libguile/vm-engine.c (vm_engine): Remove free_vars and free_vars_count
	  variables.

	* libguile/vm-engine.h (CACHE_PROGRAM): No need to muck with free_vars
	  and free_vars_count.
	  (CHECK_FREE_VARIABLE): Update for inline free vars.

	* libguile/vm-i-system.c (FREE_VARIABLE_REF): Update for inline free
	  vars.
	  (make-closure, fix-closure): Take the closure vals as separate stack
	  args, and copy or fix them inline into the appropriate closure.

	* module/language/objcode/spec.scm (program-free-variables): Define a
	  local version of this removed function.

	* module/language/tree-il/compile-glil.scm (flatten): Adjust to not make
	  a vector when making closures.

	* module/system/vm/program.scm: Export program-num-free-variables,
	  program-free-variable-ref, program-free-variable-set!, and remove
	  program-free-variables.

	* test-suite/tests/tree-il.test ("lambda"): Update to not make vectors
	  when making closures.

2010-01-09  Andy Wingo  <wingo@pobox.com>

	smobs are applied with vm trampoline procedures
	* libguile/smob.c: Instead of having special evaluator support for
	  applying smobs, we use the same strategy that gsubr uses, that smob
	  application should happen via a trampoline VM procedure, which uses a
	  special opcode (smob-apply). So statically allocate all of the desired
	  trampoline procedures here.
	  (scm_i_smob_apply_trampoline): Unfortunately there's no real place to
	  put the trampoline, so instead use a weak-key hash. It's nasty, but I
	  think the benefits of speeding up procedure calls in the general case
	  are worth it.

	* libguile/smob.h (scm_smob_descriptor): Remove fields apply_0, apply_1,
	  apply_2, and apply_3; these were never public. Also remove the
	  gsubr_type field. Instead cache the trampoline objcode here.
	  (SCM_SMOB_APPLY_0, SCM_SMOB_APPLY_1, SCM_SMOB_APPLY_2,
	  SCM_SMOB_APPLY_3): Just go through scm_call_0, etc here.

	* libguile/vm-i-system.c (call, tail-call, mv-call): Simplify. All
	  procedure calls are VM calls now.
	  (smob-call): New instruction, used in smob trampoline procedures.

	* libguile/vm.c (apply_foreign): Remove. Yay!

	* libguile/procprop.c (scm_i_procedure_arity): Refactor a bit for the
	  smob changes.

2010-01-09  Andy Wingo  <wingo@pobox.com>

	re-add SCM_GSUBR_MAX
	* libguile/gsubr.h (SCM_GSUBR_MAX): Restore this define, which specifies
	  the max number of args to a gsubr.

	* libguile/smob.c: Remove local SCM_GSUBR_MAX define.

2010-01-08  Ludovic Courtès  <ludo@gnu.org>

	Fix frame printing in the debugger.
	* module/system/vm/debug.scm (location-string): New procedure.
	  (print-frames): Use it.  This fixes cases where LINE is #f and makes a
	  distinction between FILE = stdin and FILE is unknown.

	Factorize the location stack handling in warning analyses.
	* module/language/tree-il/analyze.scm (analyze-tree)[traverse]: New
	  argument UPDATE-LOCS.  Update users.
	  [keep-locs, extend-locs, shrink-locs]: New procedures.
	  (<binding-info>, <toplevel-info>): Remove `locs' field.
	  (unused-variable-analysis, unbound-variable-analysis): Update
	  accordingly.

2010-01-08  Ludovic Courtès  <ludo@gnu.org>

	Use `HORIZONTAL ELLIPSIS' when available in `truncated-print'.
	* module/ice-9/pretty-print.scm (truncated-print): Set
	  `%default-port-encoding' to the encoding of PORT.  Choose either
	  U+2026 or "..." depending on PORT's encoding.

	* test-suite/tests/print.test ("truncated-print")[tprint]: New ENCODING
	  argument.  Update existing tests accordingly. Add UTF-8 tests.

	* doc/ref/misc-modules.texi (Pretty Printing): Mention the possible use
	  of U+2026.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	remove scm_tc7_gsubr
	* libguile/tags.h (scm_tc7_gsubr): Return to the pool of unused tc7s, as
	  there are no more gsubrs. Yay :)

	* libguile/programs.h (SCM_F_PROGRAM_IS_PRIMITIVE):
	  (SCM_PROGRAM_IS_PRIMITIVE): New flag and accessor.

	* libguile/gsubr.c (create_gsubr):
	* libguile/snarf.h (SCM_STATIC_PROGRAM): Give subrs a PRIMITIVE flag.

	* libguile/smob.h:
	* libguile/smob.c (scm_i_smob_arity): New internal procedure. Uses the
	  old GSUBR type macros, local to the file.

	* libguile/procprop.c (scm_i_procedure_arity): Call out to
	  scm_i_smob_arity, and remove a gsubr case.

	* libguile/gc.c (scm_i_tag_name):
	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/goops.c (scm_class_of):
	* libguile/vm.c (apply_foreign):
	* libguile/hash.c (scm_hasher):
	* libguile/debug.c (scm_procedure_name):
	* libguile/print.c (iprin1): Remove gsubr cases.

	* libguile/gsubr.h (SCM_PRIMITIVE_P): Fix to work with the new VM
	  program regimen.
	  (SCM_GSUBR_TYPE, SCM_GSUBR_MAKTYPE, SCM_GSUBR_MAX, SCM_GSUBR_REQ)
	  (SCM_GSUBR_OPT, SCM_GSUBR_REST): Remove these macros, that are no
	  longer useful.
	* libguile/gsubr.c (scm_i_gsubr_apply, scm_i_gsubr_apply_list)
	  (scm_i_gsubr_apply_array): Remove internal gsubr application
	  functions.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	fix procedure-name on applicable structs
	* libguile/debug.c (scm_procedure_name): Fix for applicable structs.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	subrs are now VM trampoline procedures
	* libguile/_scm.h: Add foreign.h and programs.h to the private include
	  list, as snarfing subrs with static allocation now needs access to
	  some of their enums and macros.

	* libguile/gsubr.c (create_gsubr): Instead of creating a tc7_gsubr
	  object, create a VM program with the call-subr opcode, so that the
	  representation of subrs is now gsubrs. CPP and elisp, together at
	  last.
	  (scm_subr_objcode_trampoline): New function, used by the SCM_DEFINE
	  snarf macro.

	* libguile/gsubr.h (SCM_SUBR_META_INFO, SCM_SUBR_PROPS)
	  (SCM_SET_SUBR_GENERIC_LOC, SCM_SUBR_ARITY_TO_TYPE): Remove these
	  macros. They were never deprecated, but hopefully people aren't using
	  them.
	  (SCM_SUBRF, SCM_SUBR_NAME, SCM_SUBR_GENERIC, SCM_SET_SUBR_GENERIC):
	  Update to work on the new subr representation.

	* libguile/objcodes.h (SCM_F_OBJCODE_IS_STATIC): New flag, indicates
	  that the "backing store" of the objcode is statically allocated.

	* libguile/procprop.c (scm_sym_name): Define here instead of in gsubr.c.

	* libguile/snarf.h (SCM_DEFINE): If we are doing static allocation,
	  statically allocate the foreign object, the object table, and the
	  program, and use some SCM_SNARF_INITtery to fix things up.
	  Unfortunately I have not been able to make this immutable. It might be
	  possible, though.
	  (SCM_IMMUTABLE_CELL, SCM_STATIC_DOUBLE_CELL, SCM_IMMUTABLE_FOREIGN):
	  (SCM_STATIC_SUBR_OBJVECT, SCM_STATIC_PROGRAM): New helper macros.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	better scm_subr_p deprecation
	* libguile/deprecated.h (scm_subr_p): Dispatch instead to scm_i_subr_p so we get
	  link-time and run-time warnings.
	* libguile/deprecated.c (scm_i_subr_p): Here we call SCM_PRIMITIVE_P.

	provide missing prototypes
	* libguile/array-map.c:
	* libguile/chars.c:
	* libguile/eq.c:
	* libguile/strorder.c: Provide declarations missing after the asubrs/rpsubrs ->
	  gsubr conversion.

	boot the VM very early in init.c
	* libguile/init.c (scm_i_init_guile): Now that the VM doesn't depend on
	  smobs, we can boot it before anything.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	tc7 tags for vm-related data
	* libguile/tags.h (scm_tc7_frame, scm_tc7_objcode, scm_tc7_vm)
	  (scm_tc7_vm_cont): Take more tc7s for VM-related data structures.

	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/gc.c (scm_i_tag_name):
	* libguile/goops.c (scm_class_of, create_standard_classes):
	* libguile/print.c (iprin1): Add cases for the new tc7s.

	* libguile/frames.c:
	* libguile/frames.h:
	* libguile/objcodes.c:
	* libguile/objcodes.h:
	* libguile/vm.c:
	* libguile/vm.h: Desmobify.

	* libguile/vm.c (scm_vm_apply): Export to Scheme, because VM objects are
	  no longer applicable.

	* module/system/repl/command.scm (profile):
	* module/system/vm/trace.scm (vm-trace):
	* module/system/vm/vm.scm (vm-load): Call vm-apply to run a program in a
	  VM instead of treating the VM as applicable.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	properly integrate vm bootstrapping into init.c
	* libguile/Makefile.am (modinclude_HEADERS):
	* libguile/vm-bootstrap.h: Remove vm-bootstrap.h.

	* libguile/frames.c: No more vm-bootstrap.h.

	* libguile/instructions.c (scm_init_instructions):
	* libguile/objcodes.c (scm_init_objcodes):
	* libguile/programs.c (scm_init_programs): No need to call
	  scm_bootstrap_vm, init.c does that for us.

	* libguile/vm.c (scm_bootstrap_vm): No need call e.g.
	  scm_bootstrap_frames, init.c does that. Remove a twice-calling guard,
	  should be unnecessary. Don't define the load-compiled subr here.

	* libguile/load.c (scm_init_load): Define the load-compiled subr here.

	* libguile/vm.h: Declare scm_bootstrap_vm here.

	* libguile/init.c (scm_i_init_guile): Properly integrate VM
	  bootstrapping into this file.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	boot bytevectors earlier
	* libguile/init.c (scm_i_init_guile): It turns out generalized-vectors
	  and generalized-arrays don't actually block anyone in the dependency
	  graph, so punt those back to the end. Bootstrap bytevectors earlier,
	  though, which don't actually depend on smobs.

	inline srfi-4 vector accessors
	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Inline srfi-4 vector accessors.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	update uniform vector docs
	* doc/ref/api-compound.texi (Uniform Numeric Vectors): Make a subsection
	  of "Vectors", and link out to SRFI-4, where the main text has been
	  moved.

	* doc/ref/api-data.texi (Bytevectors as Uniform Vectors): New section.

	* doc/ref/srfi-modules.texi (SRFI-4): Move body of uniform vector docs
	  here. Discuss new module separation. Discuss relation to bytevectors.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	reimplement srfi-4 vectors on top of bytevectors
	* libguile/srfi-4.h:
	* libguile/srfi-4.c (scm_make_srfi_4_vector): New function, exported by
	  (srfi srfi-4 gnu).
	* libguile/srfi-4.i.c: Removed.
	* module/srfi/srfi-4.scm:
	* module/srfi/srfi-4/gnu.scm: Reimplement srfi-4 vectors on top of
	  bytevectors. The implementation is mostly in Scheme now.

	* test-suite/tests/unif.test: Update to use (srfi srfi-4 gnu).

	* libguile/bytevectors.c (bytevector_ref_c32, bytevector_ref_c64)
	  (bytevector_set_c32, bytevector_set_c64): Fix some embarrassing bugs.
	  Still need to do an upper bounds check.

	* libguile/deprecated.h: Remove deprecated array functions:
	  scm_i_arrayp, scm_i_array_ndim, scm_i_array_mem, scm_i_array_v,
	  scm_i_array_base, scm_i_array_dims, and the deprecated macros:
	  SCM_ARRAYP, SCM_ARRAY_NDIM, SCM_ARRAY_CONTP, SCM_ARRAY_MEM,
	  SCM_ARRAY_V, SCM_ARRAY_BASE, SCM_ARRAY_DIMS.
	* libguile/deprecated.c (scm_uniform_vector_read_x)
	  (scm_uniform_vector_write, scm_uniform_array_read_x)
	  (scm_uniform_array_write): Newly deprecated functions.

	* libguile/generalized-arrays.c (scm_array_type): Remove the bytevector
	  hack.

	* libguile/objcodes.c (scm_bytecode_to_objcode, scm_objcode_to_bytecode):
	  Rework to operate on bytevectors, as scm_make_u8vector now causes a
	  module lookup, which can't be done e.g. when loading the VM boot
	  program for psyntax-pp.go on a fresh bootstrap.

	* libguile/objcodes.h (SCM_F_OBJCODE_IS_BYTEVECTOR):
	  (SCM_OBJCODE_IS_BYTEVECTOR): s/U8VECTOR/BYTEVECTOR/.

	* module/ice-9/boot-9.scm (the-scm-module): A terrible hack to pull in
	  (srfi srfi-4), as the bindings are primarily there now. We'll worry
	  about this later.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	Revert "Remove unused internal bytevector functions."
	This reverts commit c4daa519107798d06ae96d2f69dc211fc57cc8a3.

	clean up includes in vectors.[ch]
	* libguile/vectors.h:
	* libguile/vectors.c: Clean up the includes... mostly.

	fix array->list
	* libguile/generalized-arrays.c (array_to_list): Fix buggy
	  implementation. Thanks to Daniel Llorens del Río for the bug repor.

2010-01-07  Ludovic Courtès  <ludo@gnu.org>

	Enclose hooks tests in their own module.
	* test-suite/tests/hooks.test: Enclose in `(test-suite test-hooks)'
	  module.

	Fix 1.8-compatibility of `scm_search_path ()'.
	* libguile/load.c (scm_search_path): Handle the 1.8-compatibility case
	  where REST is `SCM_UNDEFINED'.  Reported by Dale P. Smith.

	Use Gnulib's `full-write' instead of custom code.
	* libguile/fports.c (write_all): Remove.
	  (fport_write): Use `full_write ()' instead of `write_all ()'.

2010-01-07  Ludovic Courtès  <ludo@gnu.org>

	Use `encoding-error' instead of `misc-error' for string encoding errors.
	* libguile/strings.c (scm_encoding_error): New function.
	  (scm_from_stringn, scm_to_stringn): Use it instead of `scm_misc_error ()'.

	* test-suite/lib.scm (exception:encoding-error): Adjust accordingly.

	* test-suite/tests/encoding-escapes.test (exception:conversion):
	  Remove.  Use `exception:encoding-error' instead.

	* test-suite/tests/encoding-iso88591.test: Likewise.

	* test-suite/tests/encoding-iso88597.test: Likewise.

	* test-suite/tests/encoding-utf8.test: Likewise.

2010-01-07  Ludovic Courtès  <ludo@gnu.org>

	Have string ports honor `%default-port-encoding'.
	* libguile/strports.c (scm_i_mkstrport): Remove.
	  (scm_mkstrport): Don't change the port's encoding to UTF-8; convert
	  STR to the default port encoding.
	  (scm_strport_to_string): Fix documentation & indentation.

	* libguile/strports.h (scm_i_mkstrport): Remove.

	* test-suite/lib.scm (exception:encoding-error): New variable.
	  (format-test-name): Set `%default-port-encoding' to "UTF-8".

	* test-suite/tests/ports.test ("string ports")["%default-port-encoding
	  is honored", "suitable encoding [latin-1]", "suitable encoding
	  [latin-3]", "wrong encoding"]: New tests.

	* test-suite/tests/r6rs-ports.test ("7.2.11 Binary
	  Output")["put-bytevector with UTF-16 string port", "put-bytevector
	  with wrong-encoding string port"]: New tests.

	* test-suite/tests/reader.test (read-string): Set
	  `%default-port-encoding' to `#f'.
	  ("reading")["unprintable symbol"]: Use a string that doesn't contain
	  zeros.

	* doc/ref/api-io.texi (String Ports): Document encoding issues with
	  `call-with-output-string' and `with-output-to-string'.

2010-01-07  Ludovic Courtès  <ludo@gnu.org>

	Add in-source documentation of `scm_to_stringn ()'.
	* libguile/strings.c (scm_to_stringn): Add documentation comment.

2010-01-07  Andy Wingo  <wingo@pobox.com>

	fix compiler warnings in foreign.c
	* libguile/foreign.c (scm_c_from_foreign, scm_c_take_foreign): Fix
	  compiler warnings on 64-bit machines.

	add subr-call VM op
	* libguile/vm-i-system.c (subr_call): Add subr-call VM op.

	add SCM_PROGRAM_IS_PRIMITIVE_GENERIC flag and checker
	* libguile/programs.h (SCM_F_PROGRAM_IS_PRIMITIVE_GENERIC)
	  (SCM_PROGRAM_IS_PRIMITIVE_GENERIC): Add a primitive-generic flag and
	  accessor, for when we switch primitives to be implemented using VM
	  trampolines.

	program-meta procedures get their program's objtable
	* libguile/programs.c (scm_program_meta): Give the program meta
	  procedure the same object table as the main procedure. Will allow for
	  easier hand-crafting of meta programs. Of course when compiling a
	  metadata procedure from Scheme, one still wants to avoid preallocating
	  the heap objects needed by the metadata...

2010-01-07  Julian Graham  <julian.graham@aya.yale.edu>

	Attempt to narrow normalized strings.
	* libguile/strings.c (normalize_str): Clean up indentation.  Add call to
	  scm_i_try_narrow_string.

2010-01-05  Andy Wingo  <wingo@pobox.com>

	remove unused snarf macros
	* libguile/snarf.h (SCM_DEFINE1, SCM_PRIMITIVE_GENERIC_1, SCM_PROC1)
	  (SCM_GPROC1): Remove, as these deal in the removed typed subr
	  constructors.

	* libguile/tags.h (scm_tcs_subrs): Remove this. Use scm_tc7_gsubr
	  instead, though hopefully that will go too, soon.

2010-01-05  Andy Wingo  <wingo@pobox.com>

	move subr implementation details to gsubr.[ch]
	* libguile/procs.h: Move subr macros to gsubr.h.
	* libguile/procs.c (scm_c_make_subr, scm_c_make_subr_with_generic)
	  (scm_c_define_subr, scm_c_define_subr_with_generic): Remove these,
	  because they deal in subr types, and now there is only one subr type.
	  The body of this code is now in gsubr.c.

	* libguile/deprecated.h (scm_subr_p): Remove from procs.[ch] and define
	  as a deprecated macro. Only used internally, but who knows who's out
	  there.

	* libguile/goops.c (scm_generic_capability_p)
	  (scm_enable_primitive_generic_x, scm_set_primitive_generic_x)
	  (scm_primitive_generic_generic): Use the new SCM_PRIMITIVE_GENERIC_P
	  macro instead of calling scm_subr_p.

	* libguile/gsubr.h (SCM_PRIMITIVE_P, SCM_PRIMITIVE_GENERIC_P): New
	  macros, to replace scm_subr_p and hacky checking for generic
	  capability.
	  (SCM_SUBR_META_INFO, SCM_SUBR_NAME, SCM_SUBRF, SCM_SUBR_PROPS)
	  (SCM_SUBR_GENERIC, SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC)
	  (SCM_SUBR_ARITY_TO_TYPE): Moved here from procs.h.

	* libguile/gsubr.c (create_gsubr): Inline the
	  scm_c_make_subr definition here, and work for generics too. Removed a
	  scm_remember_upto_here_1 that was added earlier in the year when
	  meta_info was not being traced by the GC. Adapt callers.

2010-01-05  Andy Wingo  <wingo@pobox.com>

	clean up macros.[ch]
	There are some incompatible changes here, but only to interfaces that
	were introduced earlier in 1.9, or interfaces which have been broken
	since early in 1.9.

	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump, as the macro
	  changes affect the interface that is called by psyntax-generated macro
	  definitions.

	* libguile/inline.h (scm_words): New function, allocates a variable
	  number of contiguous scm_t_bits locations, with a given value in the
	  0th word, and 0 in the rest of the words.

	* libguile/macros.h: Rework interface to correspond more closely, and
	  minimally, to the needs of memoize.c and psyntax.
	  (SCM_ASSYNT, SCM_MACRO_TYPE_BITS, SCM_MACRO_TYPE_MASK)
	  (SCM_F_MACRO_EXTENDED, SCM_MACROP, SCM_MACRO_TYPE)
	  (SCM_MACRO_IS_EXTENDED, SCM_BUILTIN_MACRO_P, SCM_SYNCASE_MACRO_P)
	  (SCM_MACRO_CODE, scm_tc16_macro): Remove CPP macros related to the
	  representation of Scheme macros.
	  (scm_i_make_primitive_macro): Renamed from scm_i_makbimacro.
	  (scm_i_macro_primitive): New accessor so that memoize.c can get to the
	  primitive syntax transformer.
	  (scm_make_syncase_macro, scm_make_extended_syncase_macro)
	  (scm_syncase_macro_type, scm_syncase_macro_binding): Removed these
	  functions, replaced by make-syntax-transformer and its accessors.
	  (scm_macro_binding): New accessor, the same as what
	  scm_syncase_macro_binding was.

	* libguile/macros.c: All representation details of syntax transformers
	  are private to this file now.
	  (macro_print): Print macros as #<syntax-transformer ...>, or
	  #<primitive-syntax-transformer ...> if psyntax has not attached a
	  transformer of its own.
	  (scm_i_make_primitive_macro): Represent macros as 5-word smobs.
	  (scm_make_syntax_transformer): New constructor for syntax transformers
	  (macros), exported to scheme. Takes a name, and looks it up in the
	  current module to determine the previous primitive transformer, if
	  any.
	  (scm_macro_type): Instead of returning 'builtin-macro!, etc, return
	  the type as set by psyntax, or #f if it's a primitive.
	  (scm_macro_name): Return the stored macro name.
	  (scm_macro_transformer): Return the psyntax-set syntax transformer.
	  Hacky, but should help introspection somewhat.

	* libguile/memoize.c (memoize_env_ref_transformer): Use the new
	  scm_i_macro_primitive, and adapt to other macro API changes.

	* module/ice-9/psyntax.scm (put-global-definition-hook)
	  (get-global-definition-hook, chi-install-global): Call (and generate
	  calls to) the new macro constructors and accessors.

	* module/ice-9/psyntax-pp.scm: Doubly regenerated.

	* module/ice-9/debugging/traps.scm (trap-here): Comment out this
	  definition and export, while it's not working.

2010-01-05  Andy Wingo  <wingo@pobox.com>

	remove mmacros, SCM_SYNTAX snarf macro
	* libguile/snarf.h (SCM_SYNTAX): Remove snarf macro, users can't define
	  primitive syntax any more.

	* libguile/memoize.c (SCM_SYNTAX): Define locally, and just call
	  scm_i_makbimacro as there's no difference between that and
	  scm_makmmacro. Alter invocations to suit.

	* libguile/macros.h:
	* libguile/macros.c (scm_i_makmmacro): Remove; users can't define
	  primitive syntax any more. Use define-syntax instead.
	  (scm_make_synt): Remove, this was only used by the SCM_SYNTAX snarf
	  macro.
	  (scm_i_makbimacro): Change prototype of this internal function to make
	  the gsubr on behalf of the caller.
	  (macro_print, scm_macro_type): Remove cases for mmacros.

2010-01-05  Andy Wingo  <wingo@pobox.com>

	remove scm_makacro and scm_makmacro
	* libguile/macros.h:
	* libguile/macros.c (scm_makacro): Remove this function for making
	  "acros", as it is unused and won't work with the compiler.
	  (scm_makmacro): Remove this deprecated function for making
	  non-memoizing macros, as they won't work with the compiler.
	  (macro_print, scm_macro_type): Remove a couple of cases for macros
	  that can't be created any more.

	fix include paths in foreign.c
	* libguile/foreign.c: Fix include paths.

	remove the deprecatd scm_make_subr_*
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_make_subr, scm_make_subr_with_generic)
	  (scm_make_subr_opt): Remove these functions that were deprecated in
	  2003, as they explicitly reference subr types.

2010-01-04  Andy Wingo  <wingo@pobox.com>

	dynamic-func returns foreign objects, not bignums
	* libguile/dynl.c (scm_dynamic_func, scm_dynamic_call)
	  (scm_dynamic_args_call): Change the representation of dynamic
	  functions to be foreign objects. Shouldn't affect any users, as people
	  should be treating the return value of dynamic-func as an opaque
	  object.

2010-01-04  Andy Wingo  <wingo@pobox.com>

	add foreign value wrapper
	* libguile/foreign.h:
	* libguile/foreign.c: New files, implementing simple wrappers around
	  foreign values, such as those that one might link in dynamically from
	  a library.

	* libguile/tags.h (scm_tc7_foreign): Take a tc7 for foreign values.

	* libguile.h:
	* libguile/init.c: Add foreign.h to headers and init.

	* libguile/print.c (iprin1): Add printer for foreign values.

	* libguile/gc.c (scm_i_tag_name): Case for foreign values.
	* libguile/goops.c (scm_class_of, create_standard_classes): Add a class
	  for foreign values.

	* libguile/evalext.c (scm_self_evaluating_p): Add case for foreign
	  values.

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

2010-01-03  Ludovic Courtès  <ludo@gnu.org>

	Update `.gitignore'.

	Add per-directory Emacs local variables.

2010-01-03  Ludovic Courtès  <ludo@gnu.org>

	Remove dependency on GNU Make and reliance on /usr/bin/env.
	Both were introduced in commit c55cb58a ("integrate guile-lib docs").

	* doc/ref/Makefile.am ($(snarf_doc)scmfiles): Rename target to...
	  ($(snarf_doc)-scmfiles): ... this.  Change to generate a makefile
	  snippet containing a variable definition.  Automake-include the
	  generated snippet, `standard-library.am'.
	  (EXTRA_DIST): Add `$(snarf_doc).am'.
	  (CLEANFILES): Remove `$(snarf_doc)scmfiles'.

	* doc/ref/make-texinfo.scm: Remove executable bit and "#!/usr/bin/env".

	* doc/ref/standard-library.am: New file.

2010-01-03  Andy Wingo  <wingo@pobox.com>

	rename goto/args and friends to tail-call, tail-apply, etc
	* libguile/vm-i-system.c (tail-call, tail-call/nargs, tail-apply)
	  (tail-call/cc): Rename these back to tail-* from goto/*. We should
	  reserve the rename-then-goto name for when you actually do a rename
	  and goto, not when you shuffle the stack.

	* doc/ref/vm.texi:
	* module/language/glil/decompile-assembly.scm:
	* module/language/tree-il/compile-glil.scm:
	* test-suite/tests/tree-il.test: Adapt all callers and documentation.

2010-01-03  Andy Wingo  <wingo@pobox.com>

	add truncated-print tests
	* doc/ref/misc-modules.texi (Pretty Printing): Fix an error in
	  truncated-print example.

	* test-suite/Makefile.am:
	 * test-suite/tests/print.test: Add truncated-print tests.

2010-01-03  Andy Wingo  <wingo@pobox.com>

	fix bug in generalized-vector->list
	* libguile/generalized-vectors.c (scm_generalized_vector_to_list): Fix
	  bug iterating over indices of array. Thanks to Tristan Colgate for the
	  report.

	* test-suite/tests/srfi-4.test: Add tests that uniform-vector->list
	  works for all kinds of uniform vectors.

2010-01-03  Julian Graham  <julian.graham@aya.yale.edu>

	Support for Unicode string normalization functions
	* libguile/strings.c, libguile/strings.h (normalize_str,
	  scm_string_normalize_nfc, scm_string_normalize_nfd, scm_normalize_nfkc,
	  scm_string_normalize_nfkd): New functions.
	* test-suite/tests/strings.test: Unit tests for `string-normalize-nfc',
	  `string-normalize-nfd', `string-normalize-nfkc', and
	  `string-normalize-nfkd'.
	* doc/ref/api-data.texi (String Comparison): Documentation for normalization
	  functions.

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

	cleanups to debugger
	* module/system/vm/debug.scm (debugger-repl): Remove the `bindings'
	  command, it is superseded by `locals'.
	  Update the TODO.
	  (debug-pre-unwind-handler): Remove scary "beta" warning. Already being
	  able to bt #:width 1000 #:full? #t is quite useful...

	debugger's backtrace implemented in scheme
	* module/system/vm/debug.scm (print-locals): Factor out to a function.
	  (collect-frames, print-frames): Implement the guts of `backtrace' in
	  Scheme.
	  (debugger-repl): Add #:width and #:full? options to `backtrace'.
	  Backtrace uses the backtrace code implemented in scheme.

	frames.c no longer exports frame-source -- frame.scm does so already
	* libguile/frames.c (scm_frame_source): No longer exported to Scheme
	  via init's call to scm_init_frames; in fact just calls the Scheme
	  version. Perhaps this function is on its way out, though :)

	~:@y allows for truncation to an absolute maximum width
	* module/ice-9/format.scm (format): Allow ~:@y to interpret the width as
	  the maximum width, inclusive of whatever else has already been output.
	* doc/ref/misc-modules.texi (Formatted Output): Document this.

	integers at debugger select frames
	* module/system/vm/debug.scm (debugger-repl): Fix implementation of
	  frame-at-index. Allow integers as commands, as a shorthand for "frame
	  N".

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

	clean up (system vm frames), add locals command to debugger
	* libguile/frames.c (scm_init_frames): No need to bootstrap the VM here,
	  it should be already bootstrapped by init.c.
	  (scm_bootstrap_frames): No need to register an extension, as
	  scm_init_frames is called by init.c.

	* module/system/vm/frame.scm: Don't load the scm_init_frames extension,
	  as the primitives from frames.c are loaded by Guile's init.
	  (frame-bindings): Change to return bindings, as can be accessed by the
	  binding: accessors from program.scm.
	  (frame-lookup-binding): Revive and make this one work with current
	  code.
	  (frame-binding-set!):
	  (frame-binding-ref): Use the new frame-lookup-binding. Perhaps these
	  should handle boxing and unboxing, though.
	  (frame-source): New accessor, returns a source object.
	  (frame-call-representation): Change to return a full list, as
	  truncated-print can truncate for us.
	  (frame-environment, frame-object-binding, frame-object-name): Update
	  not to take an address, as the address is part of the frame.
	  (frame-variable-exists?, frame-variable-ref, frame-variable-set!)
	  (frame-local-variables, frame-program-name, print-frame)
	  (print-frame-chain-as-backtrace, frame-file, frame-line-number)
	  (make-frame-chain, bootstrap-frame?, frame-number, frame-address):
	  Remove these outdated functions.

	* module/system/vm/debug.scm (debugger-repl): Use
	  frame-call-representation, and ~@y.
	  (locals): New command, prints local variables in a frame.

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

	add ~@y truncated printing directive to format
	* doc/ref/misc-modules.texi (Formatted Output): Add documentation for
	  the new ~@y format directive.
	  (Pretty Printing): Add documentation for truncated-write.

	* module/ice-9/format.scm (format): Add ~@y, for doing a truncated
	  print. Also, allow both ~y variants to take a width parameter.

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

	add truncated-print to (ice-9 pretty-print)
	* module/ice-9/pretty-print.scm (pretty-print): Rework so "port" is the
	  kwarg, and "port*" is the optional arg. #:port is still the keyword.

	  (truncated-print): Add a printer that will ensure that the output
	  stays within a certain width. It could use genwrite but it doesn't
	  because it seems nice to allow breadth-first allocation of screen
	  space, and it's also nice to balance some delimiters (e.g. #< and >).

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

	fix bug in string array implementation type mask
	* libguile/strings.c (SCM_ARRAY_IMPLEMENTATION): The mask for the string
	  array implementation should be 0x7f, without masking out 0x2.
	  Otherwise numbers were being thought to be vectors!

	* test-suite/tests/unif.test: Add test.

	* libguile/vectors.c (SCM_ARRAY_IMPLEMENTATION): Only register one
	  implementation, because weak vectors can be checked with the mask &
	  ~2, and the functions are the same.

2009-12-29  Michael Gran  <spk121@yahoo.com>

	Add documentation for scm_c_upcase et al
	* doc/ref/api-data.texi: document scm_c_upcase, scm_c_downcase,
	  scm_c_titlecase, and scm_t_wchar

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

	pretty-print is a lambda*
	* module/ice-9/pretty-print.scm (pretty-print): Fix to always be a
	  define*. Shouldn't change behavior, but it will be more
	  introspectible.

	fix bug bindings lexical vars within optargs initializers
	* module/language/tree-il/analyze.scm (analyze-lexicals): Fix bug in
	  which variables bound within inits were being improperly allocated.
	* module/language/tree-il/compile-glil.scm (vars->bind-list): More
	  detail in terrible debugging clause.
	* test-suite/tests/optargs.test ("lambda* inits"): Add tests for binding
	  vars within inits.

	Merge branch 'read-fix'

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

	Fix bugs reading long tokens
	The commit "don't take string-write mutex in read.c:read_token", from
	8b0d7b9d94b9f142dc4f08ce12b345321359b3cd, had a number of bugs. Not sure
	how I missed these before.

	* libguile/read.c (read_token): Remove a couple of bogus
	  scm_i_string_stop_writing () calls, now that we no longer take the
	  string-write mutex.
	  (read_complete_token): read_token really needs a fresh buffer, which
	  was not the case when we are reading long tokens and thus hit the
	  overflow case. Fixes fractions.test.

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

	fix defmacro*
	* module/ice-9/optargs.scm (defmacro*): Fix implementation -- defmacro*
	  takes Lisp-like arguments.
	  (defmacro*-public): Fix also, expanding into defmacro*.

	* THANKS: Thanks to Tristan Colgate for the report.

	* test-suite/tests/optargs.test: Add defmacro* tests.

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

	(syntax foo) -> #'foo in boot-9
	* module/ice-9/boot-9.scm: Change instances of (syntax foo) to use the
	  reader macro #'.

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

	Incorrect indexing into character name list
	When converting a character into a character name, an incorrect
	character name could theoretically have been returned.

	* libguile/chars.c (scm_i_charname): used wrong index into
	  scm_alt_charnames

2009-12-28  Neil Jerram  <neil@ossau.uklinux.net>

	Automatic manual updates following libguile docstring changes
	Affecting the following procedures:

	* doc/ref/api-compound.texi (Uniform Numeric Vectors):
	  uniform-array-read!

	* doc/ref/api-data.texi (Complex): make-rectangular, string=?,
	  string<?, string<=?, string>?, string>=?, string-ci=?, string-ci<?,
	  string-ci<=?, string-ci>?, string-ci>=?, string-append/shared

	* doc/ref/api-evaluation.texi (Reader Extensions): read-hash-extend

	* doc/ref/api-procedures.texi (Procedures with Setters): procedure,
	  macro?, macro-type

	* doc/ref/api-undocumented.texi: module-import-interface,
	  %method-more-specific?

	* doc/ref/new-docstrings.texi: uniform-array->bytevector,
	  %start-stack, guardian-destroyed?, guardian-greedy?,
	  destroy-guardian!, gc-dump, gc-disable, gc-enable,
	  make-generalized-vector, set-primitive-generic!, nl-langinfo,
	  %warn-autocompilation-enabled, make-syncase-macro,
	  make-extended-syncase-macro, syncase-macro-type,
	  syncase-macro-binding, memoize-expression, unmemoize-expression,
	  memoized-expression-typecode, memoized-expression-data,
	  memoized-typecode, memoize-variable-access!, module-local-variable,
	  module-variable, eval-closure-module, module-transformer,
	  module-public-interface, define!, module-reverse-lookup, cddr,
	  make-promise, %get-stack-size, %string-dump, %symbol-dump,
	  string-bytes-per-char, uniform-vector-element-type,
	  uniform-vector-element-size, canonicalize-path, getrlimit, setrlimit

	* doc/maint/guile.texi: Corresponding tracking updates.

2009-12-27  Neil Jerram  <neil@ossau.uklinux.net>

	Doc for getsid
	* NEWS: Note new getsid primitive.

	* doc/ref/posix.texi (Processes): Document getsid.

2009-12-27  Neil Jerram  <neil@ossau.uklinux.net>

	Add support for getsid
	* configure.ac: Check availability of getsid() C library call.

	* libguile/posix.c (scm_getsid): New primitive.

	* libguile/posix.h: Declaration for new primitive.

2009-12-24  Julian Graham  <julian.graham@aya.yale.edu>

	Support for Unicode general categories
	* libguile/chars.c, libguile/chars.h (scm_char_general_category): New function.
	* test-suite/tests/chars.test: Unit tests for `char-general-category'.
	* doc/ref/api-data.texi (Characters): Documentation for
	  `char-general-category'.

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

	implement up, down, frame, and bindings in the repl
	* module/system/vm/debug.scm (debugger-repl): Implement up, down, frame,
	  and bindings using the new command infrastructure.

	rewrite debugger command loop
	* module/system/vm/debug.scm: Rewrite the command loop to have better
	  introspection and argument handling.

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

	keyword arg errors throw to 'keyword-argument-error
	* libguile/vm-engine.c (VM_NAME): Keyword arg errors are now thrown to
	  'keyword-argument-error.

	* libguile/vm.c: Define sym_keyword_argument_error, and statically
	  allocate some other symbols.

	* module/ice-9/optargs.scm (parse-lambda-case): Throw to
	  'keyword-argument-error in kwarg error cases.

	* module/ice-9/psyntax.scm (build-lambda-case): Remove a couple
	  workarounds for the old memoizer. Throw to 'wrong-number-of-args if
	  the lambda-case fails to parse.

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

	* test-suite/tests/optargs.test: Update expected exceptions.

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

	implement a silly debugger
	* module/system/vm/debug.scm: Implement the skeleton of a debugger. Not
	  very useful yet.

	* module/system/repl/repl.scm (call-with-backtrace): Have the pre-unwind
	  hook drop the user into the debugger. Hopefully we can have something
	  better within a couple weeks.

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

	fix warning-caught bug in boot-9
	* module/ice-9/boot-9.scm: Fix bug caught by warnings.

2009-12-22  Julian Graham  <julian.graham@aya.yale.edu>

	Complete support for version information in Guile's `module' form.
	* module/ice-9/boot-9.scm (try-load-module, try-module-autoload): Check
	  for version argument and use `find-versioned-module' if present.
	* module/ice-9/boot-9.scm (find-versioned-module, version-matches?)
	  (module-version, set-module-version!, version-matches?): New
	  functions.
	* module/ice-9/boot-9.scm (module-type, make-module, resolve-module)
	  (try-load-module, process-define-module, make-autoload-interface)
	  (compile-interface-spec): Add awareness and checking of version
	  information.
	* doc/ref/api-modules.texi (R6RS Version References): New subsubsection.
	  (General Information about Modules): Explain differences in search
	  process when version references are used.
	  (Using Guile Modules) (Creating Guile Modules): Document `#:version'
	  keyword.

2009-12-22  Julian Graham  <julian.graham@aya.yale.edu>

	Support for renaming bindings on module export.
	* module/ice-9/boot-9.scm (module-export!, module-replace!)
	  (module-re-export!): Allow members of export list to be pairs, mapping
	  internal names to external ones.

	* doc/ref/api-modules.texi (Creating Guile Modules): Update
	  documentation for `#:export', `#:export-syntax', `#:replace',
	  `#:re-export', `#:re-export-syntax', `export', and `re-export' to
	  reflect new format for arguments.

2009-12-22  Julian Graham  <julian.graham@aya.yale.edu>

	Improved support for Unicode title case in Guile's string and character APIs.
	* doc/ref/api-data.texi (Characters): Documentation for `char-titlecase'.
	* doc/ref/api-i18n.texi (Character Case Mapping): Documentation for
	  `char-locale-titlecase' and `string-locale-titlecase'.

	* libguile/chars.c, libguile/chars.h (scm_char_titlecase, scm_c_titlecase): New
	  functions.

	* libguile/i18n.c, libguile/i18n.h (chr_to_case, scm_char_locale_titlecase,
	  str_to_case, scm_string_locale_titlecase): New functions.
	* libguile/i18n.c (scm_char_locale_downcase, scm_char_locale_upcase,
	  scm_string_locale_downcase, scm_string_locale_upcase): Refactor to share code
	  via chr_to_case and str_to_case, as appropriate.
	* module/ice-9/i18n.scm (char-locale-title-case, string-locale-titlecase): New
	  functions.

	* libguile/srfi-13.c (string_titlecase_x): Use uc_totitle instead of uc_toupper.

	* test-suite/tests/chars.test: Tests for `char-titlecase'.
	* test-suite/tests/i18n.test: Tests for `char-locale-titlecase' and
	  `string-locale-titlecase'.
	* test-suite/tests/srfi-13.test: Tests for `string-titlecase'.

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

	untabify boot-9.scm
	* module/ice-9/boot-9.scm: Untabify.

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

	tracing at repl
	* module/system/repl/command.scm (option, trace): Integrate tracing (via
	  ,trace or ,tr).

	(system vm trace) sorta working
	* module/system/vm/trace.scm: Update to work with the current VM and its
	  tracing infrastructure.

	don't take string-write mutex in read.c:read_token
	* libguile/read.c (read_token): Don't take the string-write mutex when
	  reading a token into a buffer, because it's assumed that the buffer is
	  fresh (not seen by other threads), and a soft port can call a
	  procedure that needs the string-write mutex.

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

	rework vm tracing
	* libguile/vm-engine.c (VM_NAME): Engines take the VM itself (not the
	  vp), so they can pass the VM to hooks. No more hook args, we dispatch
	  without them.

	* libguile/vm-engine.h (RUN_HOOK): Dispatch the hook if the trace level
	  is positive (instead of if the hook is there). Don't cache registers
	  on return from the dispatch.

	* libguile/vm.h:
	* libguile/vm.c (vm_dispatch_hook): Don't bother with a dynwind; instead
	  decrement the trace level when going into a hook, and if we have a
	  nonlocal exit, the trace level never gets incremented again. Worse is
	  better.
	  (make_vm, scm_vm_trace_level, scm_set_vm_trace_level_x): New concept,
	  trace level. If positive, we run the hooks, otherwise we don't. Should
	  work. Removed scm_vm_trace_frame, I don't think that was the right way
	  to do it.

	* module/system/vm/vm.scm: Replace vm-trace-frame with vm-trace-level
	  and set-vm-trace-level!; the hooks actually get the frame as an
	  argument now.

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

	add scm_call_n, scm_c_run_hookn
	* libguile/eval.h:
	* libguile/eval.c (scm_call_n): New function, applies a function to an
	  array of args.

	* libguile/hooks.h:
	* libguile/hooks.c (scm_c_run_hookn): New function, runs a hook with an
	  array of args.

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

	remove "module system quirks" from the manual
	* doc/ref/api-modules.texi (Module System Quirks): Remove this outdated
	  section.

2009-12-21  Neil Jerram  <neil@ossau.uklinux.net>

	Placeholders for expected remaining Intro sections
	* doc/ref/intro.texi (Introduction): Add menu entries and sections for
	  `Guile and the GNU Project', `Interactive Programming' and
	  `Supporting Multiple Languages'.

	More intro text on combining with C code
	* doc/ref/intro.texi (Combining with C): New paragraph.

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

	poor man's statprof integration with the repl: ,pr
	* module/system/repl/command.scm (profile): Add a very poor integration
	  of statprof with the repl.

	add test suites

	integrate guile-lib docs

	texinfo fixes
	* module/texinfo.scm (parser-error): Throw to 'parser-error, as ssax's
	  input-parse does.
	  (texi-command-depth): Fix docstring so as not to confuse emacs.
	  (parse-table-args): Fix parser-error call to include port.

	tweaks to statprof
	* module/statprof.scm (make-call-data): Change so that call-data holds
	  the proc, not its name. Remove set-call-data-name!.
	  (get-call-data): Adapt caller.
	  (sample-stack-procs): Always sample procedures on the stack, even
	  anonymous ones.
	  (profile-signal-handler): Fix stack cutting to work with compiled
	  statprof.scm.
	  (count-call): Always count calls, even to anonymous procedures.
	  (statprof-call-data->stats): Use call-data-printable for printing the
	  call data.
	  (statprof-display-anomolies): Fix a couple longstanding bugs caught by
	  compiler warnings.

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

	import statprof, sxml, and texinfo from guile-lib
	* module/Makefile.am (LIB_SOURCES): Add statprof, sxml, and texinfo to
	  the build.
	  (NOCOMP_SOURCES): Reindent, and add the upstream SSAX files.

	* module/statprof.scm:
	* module/sxml/apply-templates.scm:
	* module/sxml/fold.scm:
	* module/sxml/simple.scm:
	* module/sxml/ssax.scm:
	* module/sxml/ssax/input-parse.scm:
	* module/sxml/transform.scm:
	* module/sxml/upstream/COPYING.SSAX:
	* module/sxml/upstream/SSAX.scm:
	* module/sxml/upstream/SXML-tree-trans.scm:
	* module/sxml/upstream/SXPath-old.scm:
	* module/sxml/upstream/assert.scm:
	* module/sxml/upstream/input-parse.scm:
	* module/sxml/xpath.scm:
	* module/texinfo.scm:
	* module/texinfo/docbook.scm:
	* module/texinfo/html.scm:
	* module/texinfo/indexing.scm:
	* module/texinfo/plain-text.scm:
	* module/texinfo/reflection.scm:
	* module/texinfo/serialize.scm:
	* module/texinfo/string-utils.scm: Add files from guile-lib to Guile.
	  It's only Richard, Andreas, Rob, and myself that have copyright on
	  these, and we have all assigned to the FSF. SSAX itself is in the
	  public domain.

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

	version.h depends on config.status
	* libguile/Makefile.am (version.h): Depend on config.status, so if we
	  reconfigure we make sure to regenerate the version.

	handle interrupts in mv-call, return/values
	* libguile/vm-i-system.c (mv-call, return/values): Interrupt before
	  entering and leaving MV frames as well as normal frames.

	remove scm_add_method
	* libguile/goops.h:
	* libguile/goops.c (scm_add_method): Remove this function. It didn't
	  work, and even if we fixed it to work it wouldn't be as good as using
	  Scheme's `add-method!'.

	guile-config depends on config.status
	* meta/Makefile.am (guile-config): Depend on config.status, so that if
	  $prefix changes, guile-config gets rebuilt.

	in the load path, look in library-dir before site-dir
	* libguile/load.c (scm_init_load_path): Search first in Guile's
	  version-specific path (the library path), *then* in the site dir. This
	  should allow us to import some of Guile-lib's modules into Guile,
	  perhaps customizing them with Guile-version-specific foo, without
	  accidentally falling back to system-installed guile-lib in the
	  sitedir. Also should reduce the number of stats by half, in the common
	  case.

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

	psyntax's labels and marks now unique over a read/write boundary
	* module/ice-9/psyntax.scm (gen-label, new-mark): Labels and marks need
	  to be unique across read/write boundaries -- it's not sufficient for
	  them to simply be unique within a process by virtue of (string #\i)
	  constructing a new object. This used to mostly work before, because
	  the collapsing of duplicate constants didn't catch many syntax-object
	  cases -- but for some reason the attached test case brings out the
	  problem. So switch to use gensyms. Potentially more costly, but it's
	  what upstream psyntax does now.

	  This bug took me fully two days to figure out.

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

	* test-suite/tests/syncase.test ("serializable labels and marks"): Add
	  test case.

2009-12-20  Neil Jerram  <neil@ossau.uklinux.net>

	Typo and formatting
	* doc/ref/intro.texi (Introduction): "onScheme" -> "on Scheme".  Add
	  blank lines around @itemize block - looks better in Info.

2009-12-20  Neil Jerram  <neil@ossau.uklinux.net>

	Remove obsolete and empty Tcl/Tk file
	* doc/ref/Makefile.am (guile_TEXINFOS): Remove tcltk.texi.

	* doc/ref/tcltk.texi: Deleted.

2009-12-20  Neil Jerram  <neil@ossau.uklinux.net>

	More about Guile's relationship to Scheme standards
	Also continue adding a bit more structure to the introductory "what is
	Guile" material.

	* doc/ref/intro.texi (Introduction): Split `What is Guile?' (which is
	  a bad heading, since we've already answered that...) into `Guile and
	  Scheme' and `Combining with C'.  Further splits will follow, to
	  cover the other toplevel bullet points.

	  (Guile and Scheme): Remove `packaged for use in a wide variety of
	  environments', as I don't see what this can mean to the reader at
	  this point.  Add text about R6RS and SRFIs.

2009-12-20  Neil Jerram  <neil@ossau.uklinux.net>

	Format `Revised^n' more nicely in TeX
	* doc/ref/intro.texi (Introduction): Format Revised^n differently for
	  TeX.

2009-12-19  Neil Jerram  <neil@ossau.uklinux.net>

	Document need for pkg-config to build Guile
	* README: Say that ./configure needs pkg-config; why; and how to work
	  around it.

2009-12-19  Neil Jerram  <neil@ossau.uklinux.net>

	New introductory text about Guile
	* doc/ref/guile.texi (Top): Rename `Introduction to Guile' as just
	  `Introduction'.

	* doc/ref/intro.texi: Add new introductory text.  [Not yet complete]

	* doc/ref/preface.texi (Preface): Update for chapter renaming.

2009-12-19  Neil Jerram  <neil@ossau.uklinux.net>

	Move Conventions section to after `Reporting Bugs'
	(Reporting Bugs fits better immediately after the tour of how to use
	Guile)

	* doc/ref/intro.texi: Move `Manual Conventions' to after `Reporting
	  Bugs', and rename to `Typographical Conventions'.

2009-12-19  Neil Jerram  <neil@ossau.uklinux.net>

	Move "Discouraged and Deprecated" from Introduction to API chapter
	* doc/ref/intro.texi (Discouraged and Deprecated): Move from here...

	* doc/ref/api-discdepr.texi: ...to new file here.

	* doc/ref/guile.texi: Include api-discdepr.texi, and include
	 `Discouraged and Deprecated' in API chapter menu.

	* doc/ref/Makefile.am (guile_TEXINFOS): Add api-discdepr.texi.

2009-12-19  Neil Jerram  <neil@ossau.uklinux.net>

	Remove page breaks except before new chapters and indices
	* doc/ref/api-binding.texi, doc/ref/api-compound.texi,
	  doc/ref/api-control.texi, doc/ref/api-data.texi,
	  doc/ref/api-debug.texi, doc/ref/api-evaluation.texi,
	  doc/ref/api-i18n.texi, doc/ref/api-io.texi, doc/ref/api-memory.texi,
	  doc/ref/api-modules.texi, doc/ref/api-options.texi,
	  doc/ref/api-overview.texi, doc/ref/api-procedures.texi,
	  doc/ref/api-scheduling.texi, doc/ref/api-smobs.texi,
	  doc/ref/api-translation.texi, doc/ref/api-utility.texi,
	  doc/ref/expect.texi, doc/ref/libguile-concepts.texi,
	  doc/ref/libguile-program.texi, doc/ref/misc-modules.texi,
	  doc/ref/repl-modules.texi, doc/ref/scheme-debugging.texi,
	  doc/ref/scheme-reading.texi, doc/ref/scheme-scripts.texi,
	  doc/ref/script-getopt.texi, doc/ref/scsh.texi,
	  doc/ref/srfi-modules.texi: Remove @page before @section.

	Remove obsolete material about GH
	* doc/ref/extend.texi: Delete.

2009-12-19  Neil Jerram  <neil@ossau.uklinux.net>

	Streamline the manual's Preface material
	(The principle here is that Preface should only contain
	meta-information about the manual, such as how to use it and who wrote
	it; plus any political points that we want to draw attention to.)

	* doc/ref/preface.texi (Preface): Make unnumbered, for consistency
	  with other GNU manuals (e.g. Emacs, GSL).  Merge layout text into
	  top level.  Simplify first sentence.  Move section on conventions
	  away...

	* doc/ref/intro.texi (Introduction to Guile): ...to here.

2009-12-18  Neil Jerram  <neil@ossau.uklinux.net>

	Update and simplify statement about RnRS support
	* doc/ref/scheme-intro.texi (Guile Scheme): Mention R6RS as well as
	  R5RS.  Simplify text.

2009-12-18  Brian Gough  <bjg@network-theory.co.uk>

	make the use of the 5-argument @xref command consistent
	A few of the @xref references to external manuals in the documentation
	are using an old 4-argument form that produces an undefined reference
	in the printed manual.  The following patch makes them consistent with
	the 5-argument @xrefs used elsewhere in the manual.

	--
	Brian Gough

	Network Theory Ltd,
	Publishing Free Software Manuals --- http://www.network-theory.co.uk/

	>From 6ca0417830dc5a98699a15808591dc1f2a90dfac Mon Sep 17 00:00:00 2001
	From: Brian Gough <bjg@gnu.org>
	Date: Mon, 14 Dec 2009 21:34:59 +0000
	Subject: [PATCH] make the use of the 5-argument @xref command consistent
	 when referring to other manuals.

2009-12-18  Ken Raeburn  <raeburn@raeburn.org>

	Allow more characters in coding system names in Emacs-style declarations.
	* libguile/read.c (scm_i_scan_for_encoding): Allow more punctuation
	  symbols in coding system names.

2009-12-18  Brian Gough  <bjg@network-theory.co.uk>

	more typo fixes
	More spelling corrections and fixes for doubled words (e.g. "the the")

	--
	Brian Gough

	Network Theory Ltd,
	Publishing Free Software Manuals --- http://www.network-theory.co.uk/

	>From 7be02beedc739c32cce2c8ec8f4ac814c994a13f Mon Sep 17 00:00:00 2001
	From: Brian Gough <bjg@gnu.org>
	Date: Mon, 14 Dec 2009 22:06:22 +0000
	Subject: [PATCH] fix various documentation typos (spelling & doubled words)

2009-12-18  Brian Gough  <bjg@network-theory.co.uk>

	typo fix
	Correction for garbled sentence.

	--
	Brian Gough

	Network Theory Ltd,
	Publishing Free Software Manuals --- http://www.network-theory.co.uk/

	>From f819b597a46ad4ed23597e5a81d1acab46f15147 Mon Sep 17 00:00:00 2001
	From: Brian Gough <bjg@gnu.org>
	Date: Mon, 14 Dec 2009 20:04:34 +0000
	Subject: [PATCH] typo fix

2009-12-18  Brian Gough  <bjg@network-theory.co.uk>

	added brief introduction about SLIB
	This patch adds a short introduction to the SLIB section of the manual
	with a link to the SLIB homepage.

	--
	Brian Gough

	Network Theory Ltd,
	Publishing Free Software Manuals --- http://www.network-theory.co.uk/

	>From 60548b6e039bf57694b7841996cfda011cb8a4bf Mon Sep 17 00:00:00 2001
	From: Brian Gough <bjg@gnu.org>
	Date: Mon, 14 Dec 2009 20:49:27 +0000
	Subject: [PATCH] added brief introduction about SLIB

2009-12-18  Brian Gough  <bjg@network-theory.co.uk>

	Hash Table examples - hashq takes different number of arguments
	In the "Hash Tables Example" in the manual, hashq needs 2 arguments
	instead of 1 (patch below).  I've updated the hash table output as
	well to match the current version.

	--
	Brian Gough

	Network Theory Ltd,
	Publishing Free Software Manuals --- http://www.network-theory.co.uk/

	>From fdb6101d2e064620746ebfc9f9cd28bbdd2470e8 Mon Sep 17 00:00:00 2001
	From: Brian Gough <bjg@gnu.org>
	Date: Mon, 14 Dec 2009 19:59:32 +0000
	Subject: [PATCH] update docs for Hash Table Examples
	 hashq now takes two arguments
	 order of elements in hash table is different now

2009-12-18  Brian Gough  <bjg@gnu.org>

	replace ascii figures with scalable ps/pdf versions.
	use ascii figures in HTML output, to work around deficiency in makeinfo
	where images are not copied to target directory.

	use explicit ./scriptname to help novice users

	use correct url to ftp.gnu.org

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	more NEWS updates
	* NEWS: Update some more.

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

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

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

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

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

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

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

	commit draft of NEWS

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	* libguile/_scm.h: Bump objcode version.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	* libguile/struct.h: Update a comment.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	* libguile/fluids.h: Remove scm_fluids_prehistory, and add internal
	  scm_i_fluid_print. Update a comment.

	* libguile/fluids.c: Update for tc7 representation. Also remove the next
	  pointers while we're at it, as they aren't used in the new BDW GC.

	* libguile/eq.c (scm_equal_p): Remove the hashtable case. Hashtables
	  could never be equal? before, I don't see why to add stubs doing the
	  same thing now.

	* libguile/print.c (iprin1):
	* libguile/gc.c (scm_i_tag_name):
	* libguile/evalext.c (scm_self_evaluating_p): Add fluid and
	  dynamic_state cases.

	* libguile/goops.h: Remove scm_class_hashtable; it will be static.
	* libguile/goops.c: Make <hashtable> static, and add <fluid> and
	  <dynamic-state> classes.

	* libguile/hashtab.h:
	* libguile/hashtab.c: Remove scm_i_hashtable_equal_p.

	* libguile/init.c (scm_i_init_guile): Remove call to fluids_prehistory.

2009-12-05  Andy Wingo  <wingo@pobox.com>

	hash tables have a tc7
	* libguile/tags.h (scm_tc7_hashtable): Allocate a tc7 for hashtables.

	* libguile/hashtab.h: Adjust macros accordingly.
	  (scm_i_hashtable_print, scm_i_hashtable_equal_p): New internal
	  functions.
	  (scm_hashtab_prehistory): Remove, no more need for this.

	* libguile/hashtab.c (scm_hash_fn_remove_x): Fix a longstanding bug.
	  (make_hash_table): Adapt to the new hash table representation.

	* libguile/eq.c (scm_equal_p)
	* libguile/evalext.c (scm_self_evaluating_p)
	* libguile/print.c (iprin1)
	* libguile/gc.c (scm_i_tag_name): Add some tc7_hashtab cases.

	* libguile/init.c: Remove unused environments init functions. Remove
	  call to hashtab_prehistory.

	* libguile/goops.h (scm_class_hashtable)
	* libguile/goops.c (scm_class_of, create_standard_classes): Have to
	  make a class for hash tables manually, because they aren't smobs any
	  more.

2009-12-04  Andy Wingo  <wingo@pobox.com>

	eval.c closures are now applicable smobs, not tc3s
	* libguile/debug.c (scm_procedure_name): Remove a SCM_CLOSUREP case and
	  some dead code.
	  (scm_procedure_module): Remove. This was introduced a few months ago
	  for the hygienic expander, but now it is no longer needed, as the
	  expander keeps track of this information itself.

	* libguile/debug.h: Remove scm_procedure_module.

	* libguile/eval.c: Instead of using tc3 closures, define a "boot
	  closure" applicable smob type, and represent closures with that. The
	  advantage is that after eval.scm is compiled, boot closures take up no
	  address space (besides a smob number) in the runtime, and require no
	  special cases in procedure dispatch.

	* libguile/eval.h: Remove the internal functions scm_i_call_closure_0
	  and scm_closure_apply, and the public function scm_closure.

	* libguile/gc.c (scm_storage_prehistory): No tc3_closure displacement
	  registration.
	  (scm_i_tag_name): Remove closure case, and a dead cclo case.

	* libguile/vm.c (apply_foreign):
	* libguile/print.c (iprin1):
	* libguile/procs.c (scm_procedure_p, scm_procedure_documentation);
	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/goops.c (scm_class_of): Remove tc3_closure/tcs_closure cases.
	* libguile/hash.c (scm_hasher):

	* libguile/hooks.c (scm_add_hook_x): Use new scm_i_procedure_arity.

	* libguile/macros.c (macro_print): Print all macros using the same code.
	  (scm_macro_transformer): Return any procedure, not just programs.

	* libguile/procprop.h:
	* libguile/procprop.c (scm_i_procedure_arity): Instead of returning a
	  list that the caller has to parse, have the same prototype as
	  scm_i_program_arity. An incompatible change, but it's an internal
	  function anyway.
	  (scm_procedure_properties, scm_set_procedure_properties)
	  (scm_procedure_property, scm_set_procedure_property): Remove closure
	  cases, and use scm_i_program_arity for arity.

	* libguile/procs.h (SCM_CLOSUREP, SCM_CLOSCAR, SCM_CODE)
	  (SCM_CLOSURE_NUM_REQUIRED_ARGS, SCM_CLOSURE_HAS_REST_ARGS)
	  (SCM_CLOSURE_BODY, SCM_PROCPROPS, SCM_SETPROCPROPS, SCM_ENV)
	  (SCM_TOP_LEVEL): Remove these macros that pertain to boot closures
	  only. Only eval.c should know abut boot closures.
	* libguile/procs.c (scm_closure_p): Remove this function. There is a
	  simple stub in deprecated.scm now.
	  (scm_thunk_p): Use scm_i_program_arity.
	* libguile/tags.h (scm_tc3_closure): Remove. Yay, another tc3 to play
	  with!
	  (scm_tcs_closures): Remove.

	* libguile/validate.h (SCM_VALIDATE_CLOSURE): Remove.

	* module/ice-9/deprecated.scm (closure?): Add stub.

	* module/ice-9/documentation.scm (object-documentation)
	* module/ice-9/session.scm (help-doc, arity)
	* module/oop/goops.scm (compute-getters-n-setters)
	* module/oop/goops/describe.scm (describe)
	* module/system/repl/describe.scm (display-object, display-type):
	  Remove calls to closure?.

2009-12-04  Andy Wingo  <wingo@pobox.com>

	remove cxrs
	* libguile/pairs.h:
	* libguile/pairs.c: Previously scm_cdadr et al were implemented as
	  #defines that called scm_i_chase_pairs, and the Scheme-exposed
	  functions themselves were cxr subrs, which got special help in the
	  interpreter. Since now the special help is unnecessary (because the
	  compiler inlines and expands calls to car, cdadr, etc), the complexity
	  is a loss. So just implement cdadr etc using normal functions. There's
	  an advantage too, in that the compiler can unroll the cxring, reducing
	  branches.

	* libguile/tags.h (scm_tc7_cxr): Remove this tag.
	  (scm_tcs_subrs): Now there's only one kind of subr, yay!

	* libguile/debug.c (scm_procedure_name)
	* libguile/evalext.c (scm_self_evaluating_p)
	* libguile/gc.c (scm_i_tag_name)
	* libguile/goops.c (scm_class_of)
	* libguile/hash.c (scm_hasher)
	* libguile/print.c (iprin1)
	* libguile/procprop.c (scm_i_procedure_arity)
	* libguile/procs.c (scm_procedure_p, scm_subr_p)
	  (scm_make_procedure_with_setter)
	* libguile/vm.c (apply_foreign): Remove cxr cases. Replace uses of
	  scm_tcs_subrs with scm_tc7_gsubr.

2009-12-04  Andy Wingo  <wingo@pobox.com>

	remove rpsubrs
	* libguile/tags.h: Remove rpsubrs (I chose to interpret the terse name
	  as "recursive predicate subrs"). Just use gsubrs with rest arguments,
	  or do a fold yourself.

	* libguile/array-map.c (scm_i_array_equal_p): Do the comparison in
	  order, why not.

	* libguile/chars.c:
	* libguile/eq.c:
	* libguile/numbers.c:
	* libguile/strorder.c: Add 0,2,1 gsubr wrappers for rpsubrs like eq?, <,
	  etc.

	* libguile/goops.c (scm_class_of)
	* libguile/procprop.c (scm_i_procedure_arity)
	* libguile/procs.c (scm_thunk_p)
	* libguile/vm.c (apply_foreign): Remove rpsubr cases.

	* test-suite/tests/numbers.test ("=", "<"): Turn a couple xfails into
	  passes.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	remove asubrs
	* libguile/tags.h (scm_tcs_subrs, scm_tc7_asubr): Remove definitions.

	* libguile/goops.c (scm_class_of)
	* libguile/procprop.c (scm_i_procedure_arity)
	* libguile/procs.c (scm_thunk_p)
	* libguile/vm.c (apply_foreign): Remove cases for asubrs.

	* libguile/array-map.c: Gut all of the optimizations, because there are
	  no more asubrs, soon won't be rpsubrs, and all of this should happen
	  on the Scheme level, ideally.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	speed up scm_call_N for non-programs
	* libguile/eval.c (scm_call_0, scm_call_1, scm_call_2, scm_call_3): All
	  of these should dispatch through the VM, without consing.

	simplify apply_foreign
	* libguile/vm.c (apply_foreign): Simplify.

	+, -, min, lcm, gcd now documented
	* test-suite/tests/numbers.test: Change some xfail documented? tests to
	  passes.

	change asubrs to be gsubrs
	* libguile/numbers.h:
	* libguile/numbers.c (scm_i_gcd, scm_i_lcm, scm_i_logand, scm_i_logior)
	  (scm_i_logxor, scm_i_min, scm_i_max, scm_i_sum, scm_i_difference)
	  (scm_i_product, scm_i_divide): Change asubrs to be gsubrs.

	+ is not an asubr
	* libguile/numbers.h:
	* libguile/numbers.c (scm_i_sum): Rework so that scm_sum is just a
	  normal function. Its generic is actually provided by scm_i_sum, a
	  gsubr with rest args. In that way, + is no longer an asubr.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	remove scm_tc7_dsubr
	* libguile/tags.h: Remove scm_tc7_dsubr. There are no more users of
	  this.

	* libguile/array-map.c:
	* libguile/eval.c:
	* libguile/eval.i.c:
	* libguile/goops.c:
	* libguile/procprop.c:
	* libguile/procs.h: Remove all dsubr cases.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	remove "primitive numerics" from the docs
	* doc/ref/api-data.texi: Update for $sin deprecation.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	implement transcendental sin, cos etc in c; deprecate $sin, $cos, etc
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_asinh, scm_acosh, scm_atanh): Deprecate
	  these stand-ins for the C99 asinh, acosh, and atanh functions. Guile
	  is not gnulib.
	  (scm_sys_atan2): Deprecate as well, in favor of scm_atan.

	* libguile/numbers.h:
	* libguile/numbers.c (scm_sin, scm_cos, scm_tan)
	  (scm_sinh, scm_cosh, scm_tanh)
	  (scm_asin, scm_acos, scm_atan)
	  (scm_sys_asinh, scm_sys_acosh, scm_sys_atanh): New functions,
	  replacing the combination of dsubrs and boot-9 wrappers with C subrs
	  that handle complex values. The latter three have _sys_ in their names
	  due to the name conflict with the deprecated scm_asinh et al.

	  Remove the $abs, $sin etc "dsubrs".

	* module/ice-9/boot-9.scm: Remove transcendental functions, as this all
	  happens in C now.

	* module/ice-9/deprecated.scm: Add aliases for $sin et al.

	* test-suite/tests/ramap.test ("array-map!"): Adjust "dsubr" tests to
	  use sqrt, not $sqrt. They don't actually test dsubrs now. In the
	  two-source test, I'm pretty sure the dsubr array-map! should have been
	  failing, as indeed it does now; I've changed the test case to expect
	  the failure. I'd still like to know why it was succeeding before.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	expt implemented in C, handles complex numbers
	* libguile/numbers.h:
	* libguile/numbers.c (scm_expt): Rename from scm_sys_expt, and handle
	  the complex cases as well.

	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_sys_expt): Add a deprecated shim.

	* module/ice-9/boot-9.scm (expt): Remove definition, scm_expt does all
	  we need.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	remove tc7_subr_* and tc7_lsubr_*
	* libguile/tags.h: Remove tc7 #defines for subrs, replacing them with
	  placeholders. These were public, but hopfully unused. I don't see how
	  to usefully deprecate them.

	* libguile/array-map.c (scm_array_map_x): Remove special cases for
	  certain subr types. This might make things slower for the moment,
	  otoh, native compilation should moot that question.

	* libguile/eval.i.c:
	* libguile/eval.c: Remove subr-handling cases. To regain this speed and
	  more won't have to wait for native compilation, though -- this change
	  smooths the way for subr dispatch in the VM.

	* libguile/gsubr.c (scm_i_gsubr_apply): Fix a bug in which we didn't
	  detect too-many-arguments. This would only show up when using ceval,
	  as only ceval called this function.

	* test-suite/tests/ramap.test ("array-map!"): Change the expected
	  exception if passed a procedure of the wrong arity. It now gives
	  wrong-num-args.
	  more won't have to wait for native compilation, though -- this change
	  smooths the way for subr dispatch in the VM.

	* libguile/goops.c (scm_class_of): Remove subr cases. No speed
	  implication.

	* libguile/objects.c (scm_valid_object_procedure_p): Remove this public
	  but undocumented, and useless, function. I do not think this will
	  affect anyone at all.
	  (scm_set_object_procedure_x): Replace a call to
	  scm_valid_object_procedure_p with scm_procedure_p, and actually wrap
	  with a scm_is_true.

	* module/oop/goops.scm (initialize-object-procedure): Don't call
	  valid-object-procedure?.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	all subrs are gsubrs
	* libguile/gsubr.c (create_gsubr, create_gsubr_with_generic): Always
	  create gsubrs -- never the specialized tc7 types. Allow gsubrs to have
	  generics, there doesn't seem to be any reason not to.

	* libguile/macros.c (scm_make_synt):
	* libguile/values.c (scm_init_values):
	* libguile/eval.c (scm_init_eval):
	* libguile/gc.c (scm_init_gc): Use scm_c_define_gsubr instead of
	  scm_c_define_subr.

	* libguile/goops.c (scm_class_of): Allow gsubrs to be primitive
	  generics.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	replace frame implementation with VM frames
	* libguile/stacks.h: Rework so that a stack doesn't copy information out
	  of VM frames, it just holds onto a VM frame, along with the stack id
	  and length. VM frames are now the only representation of frames in
	  Guile.
	  (scm_t_info_frame, SCM_FRAME_N_SLOTS, SCM_FRAME_REF, SCM_FRAME_NUMBER)
	  (SCM_FRAME_FLAGS, SCM_FRAME_SOURCE, SCM_FRAME_PROC, SCM_FRAME_ARGS)
	  (SCM_FRAME_PREV, SCM_FRAME_NEXT)
	  (SCM_FRAMEF_VOID, SCM_FRAMEF_REAL, SCM_FRAMEF_PROC)
	  (SCM_FRAMEF_EVAL_ARGS, SCM_FRAMEF_OVERFLOW)
	  (SCM_FRAME_VOID_P, SCM_FRAME_REAL_P, SCM_FRAME_PROC_P)
	  (SCM_FRAME_EVAL_ARGS_P, SCM_FRAME_OVERFLOW_P): Remove these macros
	  corresponding to the old frame implementation.
	  (scm_frame_p scm_frame_source, scm_frame_procedure)
	  (scm_frame_arguments): These definitions are now in frames.h.
	  (scm_last_stack_frame): Remove declaration of previously-removed
	  constructor. Probably should re-instate it though.
	  (scm_frame_number, scm_frame_previous, scm_frame_next)
	  (scm_frame_real_p, scm_frame_procedure_p, scm_frame_evaluating_args_p)
	  (scm_frame_overflow_p) : Remove these procedures corresponding to the
	  old stack implementation.

	* libguile/stacks.c: Update for new frames implementation.

	* libguile/frames.h:
	* libguile/frames.c: Rename functions operating on VM frames to have a
	  scm_frame prefix, not scm_vm_frame -- because they really are the only
	  frames we have. Rename corresponding Scheme functions too, from
	  vm-frame-foo to frame-foo.

	* libguile/deprecated.h: Remove scm_stack and scm_info_frame data types.

	* libguile/vm.c (vm_dispatch_hook): Adapt to scm_c_make_frame name
	  change.

	* module/system/vm/frame.scm: No need to export functions provided
	  frames.c now, as we load those procedures into the default environment
	  now. Rename functions, and remove a couple of outdated, unused
	  functions. The bottom half of this file is still bitrotten, though.

	* libguile/backtrace.c: Rework to operate on the new frame
	  representation. Also fix a bug displaying file names for compiled
	  procedures.

	* libguile/init.c: Load the VM much earlier, just because we can. Also
	  it allows us to have frames.[ch] loaded in time for stacks to be
	  initialized, so that scm_frame_arguments can do the right thing.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	remove debug frames
	* libguile/debug.h (scm_t_debug_frame): Remove this type, as it was
	  internal to the old evaluator.
	  (SCM_EVALFRAME, SCM_APPLYFRAME, SCM_VOIDFRAME, SCM_MACROEXPF)
	  (SCM_TAILREC, SCM_TRACED_FRAME, SCM_ARGS_READY, SCM_DOVERFLOW)
	  (SCM_MAX_FRAME_SIZE, SCM_FRAMETYPE)
	  (SCM_EVALFRAMEP, SCM_APPLYFRAMEP, SCM_VOIDFRAMEP, SCM_MACROEXPFP)
	  (SCM_TAILRECP, SCM_TRACED_FRAME_P, SCM_ARGS_READY_P, SCM_OVERFLOWP)
	  (SCM_SET_MACROEXP, SCM_SET_TAILREC, SCM_SET_TRACED_FRAME)
	  (SCM_SET_ARGSREADY, SCM_SET_OVERFLOW)
	  (SCM_CLEAR_MACROEXP, SCM_CLEAR_TRACED_FRAME, SCM_CLEAR_ARGSREADY):
	  Remove macro accessors to scm_t_debug_frame.
	  (SCM_DEBUGOBJP, SCM_DEBUGOBJ_FRAME, SCM_SET_DEBUGOBJ_FRAME):
	  (scm_debug_object_p, scm_make_debugobj): Remove debugobj accessors.
	  (scm_i_unmemoize_expr): Remove unused declaration.

	* libguile/debug.c (scm_debug_options): No more max limit on frame
	  sizes.
	  (scm_start_stack): Just call out to scm_vm_call_with_new_stack.
	  (scm_debug_object_p, scm_make_debugobj, scm_init_debug): No more
	  debugobj smob type.

	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_i_deprecated_last_debug_frame)
	  (scm_last_debug_frame): Remove deprecated debug-frame bits.

	* libguile/stacks.c (scm_make_stack): Rework this function and its
	  dependents to only walk VM frames.
	  (scm_stack_id): Call out to the holder of the VM frame in question,
	  which should be a VM or a VM continuation, for the stack ID. Currently
	  this bit is stubbed out.
	  (scm_last_stack_frame): Removed. It seems this is mainly useful for a
	  debugger, and we need to rewrite the debugger to work on the Scheme
	  level.

	* test-suite/tests/continuations.test ("continuations"): Remove test for
	  last-stack-frame.

	* libguile/continuations.h (struct scm_t_contregs):
	* libguile/continuations.c (scm_make_continuation):
	  (copy_stack_and_call, scm_i_with_continuation_barrier): No need to
	  save and restore debug frames.

	* libguile/threads.h (scm_i_thread): Don't track debug frames.
	  (scm_i_last_debug_frame, scm_i_set_last_debug_frame): Remove macro
	  accessors.

	* libguile/threads.c (guilify_self_1): Don't track debug frames.

	* libguile/throw.c: No need to track debug frames in a jmpbuf.

	* libguile/vm-engine.c (vm_engine, VM_PUSH_DEBUG_FRAMES): Don't push
	  debug frames.

	* libguile/vm.h:
	* libguile/vm.c (scm_vm_call_with_new_stack): New function. Currently
	  stubbed out though.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	clarify comments in eval.scm
	* module/ice-9/eval.scm: Add some more comments.

2009-12-03  Andy Wingo  <wingo@pobox.com>

	really boot primitive-eval from scheme.
	* libguile/eval.c (scm_primitive_eval, scm_c_primitive_eval):
	  (scm_init_eval): Rework so that scm_primitive_eval always calls out to
	  the primitive-eval variable. The previous definition is the default
	  value, which is probably overridden by scm_init_eval_in_scheme.

	* libguile/init.c (scm_i_init_guile): Move ports and load-path up, so we
	  can debug when initing eval. Call scm_init_eval_in_scheme. Awesome.

	* libguile/load.h:
	* libguile/load.c (scm_init_eval_in_scheme): New procedure, loads up
	  ice-9/eval.scm to replace the primitive-eval definition, if everything
	  is there and up-to-date.

	* libguile/modules.c (scm_module_transformer): Export to Scheme, so it's
	  there for eval.go.

	* module/ice-9/boot-9.scm: No need to define module-transformer.

	* module/ice-9/eval.scm (capture-env): Only reference the-root-module if
	  modules are booted.
	  (primitive-eval): Inline a definition for identity. Throw a more
	  standard error for "wrong number of arguments".

	* module/ice-9/psyntax.scm (chi-install-global): The macro binding for a
	  syncase macro is now a pair: the transformer, and the module that was
	  current when the transformer was installed. The latter is used for
	  hygiene purposes, replacing the use of procedure-module, which didn't
	  work with the interpreter's shared-code closures.
	  (chi-macro): Adapt for the binding being a pair, and get the hygiene
	  from the cdr.
	  (eval-local-transformer): Adapt to new form of macro bindings.

	* module/ice-9/psyntax-pp.scm: Regenerated.

	* .gitignore: Ignore eval.go.stamp.

	* module/Makefile.am: Reorder for fastest serial compilation, now that
	  there are no ordering constraints. I did a number of experiments here
	  and this seems to be the best; but the bulk of the time is compiling
	  psyntax-pp.scm with eval.scm. Not so great.

	* libguile/vm-engine.c (vm-engine): Throw a more standard error for
	  "wrong type to apply".

	* test-suite/tests/gc.test ("gc"): Remove a hack that shouldn't affect
	  the new evaluator, and throw in another (gc) for good measure.

	* test-suite/tests/goops.test ("defining classes"):
	* test-suite/tests/hooks.test (proc1): We can't currently check what the
	  arity is of a closure made by eval.scm -- or more accurately all
	  closures have 0 required args and no rest args. So punt for now.

	* test-suite/tests/syntax.test ("letrec"): The scheme evaluator can't
	  check that a variable is unbound, currently; perhaps the full "fixing
	  letrec" expansion could fix this. But barring that, punt.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	apply goes to the vm, not the interpreter
	* libguile/eval.c (eval): Call scm_vm_apply instead of apply.
	  (apply): Deleted, no longer referenced. Heh.
	  (scm_apply): Call scm_vm_apply.

	* libguile/init.c (scm_i_init_guile): Bootstrap the VM before the
	  evaluator.

	* libguile/vm.c (scm_vm_apply): Actually it's not necessary that the
	  procedure is a program; so that's cool, relax the check.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	vm doesn't call the evaluator at all (at least not directly)
	* libguile/vm-i-system.c (goto/args, mv-call): Finish the port to use
	  apply_foreign instead of scm_apply.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	first step to make the vm stop calling the interpreter
	* libguile/eval.h:
	* libguile/eval.c (scm_closure_apply): New function, applies a closure.
	  Won't be necessary in the future, but for now here it is, with
	  internal linkage.

	* libguile/gsubr.h:
	* libguile/gsubr.c (scm_i_gsubr_apply_array): New function, applies a
	  gsubr to an array of values, potentially extending that array for
	  optional arguments and rest arguments and such.

	* libguile/vm.c (apply_foreign): New function, applies a foreign
	  function to arguments on the stack, in place.

	* libguile/vm-i-system.c (call): Add a case for procedures-with-setters
	  (will go away when they are applicable structs). Instead of calling
	  the evaluator for foreign functions, call apply_foreign.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	add new scheme evaluator
	* module/ice-9/eval.scm: New evaluator, written in Scheme. Whee!
	  Batteries included but not wired up.

	* module/Makefile.am: Abuse touch(1) to make sure eval.go gets built
	  before everything. Can't just depend on eval.go, because eval.go will
	  get the timestamp of eval.scm, which might be newer than foo.go (and
	  thus foo.scm). Something better is warranted.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	add memoized expression accessors to scheme
	* libguile/eval.c: Fix a comment.
	  (eval): Abstract out the variable memoization into a function,
	  scm_memoize_variable_access_x.

	* libguile/memoize.c (memoized_tags): Fix a couple names.
	  (scm_memoize_variable_access_x): New internal function. Actually it's
	  public to Scheme, but we can't do much about that, because the new
	  evaluator will need it.
	  (scm_memoized_expression_typecode, scm_memoized_expression_data): New
	  accessors for memoized code, for Scheme.
	  (scm_memoized_typecode): Looks up the typecode for a symbol.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	export scm_define to scheme as define!
	* libguile/modules.c (scm_define): Export to Scheme as `define!'. The
	  evaluator needs it, and actually it's an OK thing to have around.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	wire through the existing vm ops for variable-ref and variable-set!
	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile
	  variable-ref and variable-set instructions specially.

	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Add cases for variable-ref and
	  variable-set!. The latter is a little tricky, because the args are
	  switched for the VM op, and we can't really change that easily.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	fixes to variable-ref, variable-set vm ops
	* libguile/vm-i-system.c (variable-ref, variable-set): Fix declared
	  number of pops and pushes.

	promises are in their own file now
	* libguile.h:
	* libguile/Makefile.am:
	* libguile/eval.c:
	* libguile/eval.h:
	* libguile/init.c:
	* libguile/promises.c:
	* libguile/promises.h: Split promises out into their own file.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	new evaluator, y'all
	* libguile/eval.c: So, ladies & gents, a new evaluator. It's similar to
	  the old one, in that we memoize and then evaluate, but in this
	  incarnation, memoization of an expression happens before evaluation,
	  not lazily as the expression is evaluated. This makes the evaluation
	  itself much cleaner, in addition to being threadsafe. In addition,
	  since this C evaluator will in the future just serve to bootstrap the
	  Scheme evaluator, we don't have to pay much concern for debugging
	  conveniences. So the environment is just a list of values, and the
	  memoizer pre-computes where it's going to find each individual value
	  in the environment.

	  Interface changes are commented below, with eval.h.

	  (scm_evaluator_traps): No need to reset the debug mode after rnning te
	  traps thing. But really, the whole traps system needs some love.

	* libguile/memoize.h:
	* libguile/memoize.c: New memoizer, which runs before evaluation,
	  checking all syntax before evaluation begins. Significantly, no
	  debugging information is left for lexical variables, which is not so
	  great for interactive debugging; perhaps we should change this to have
	  a var list in the future as per the classic interpreters. But it's
	  quite fast, and the resulting code is quite good. Also note that it
	  doesn't produce ilocs, memoized code is a smob whose type is in the
	  first word of the smob itself.

	* libguile/eval.h (scm_sym_and, scm_sym_begin, scm_sym_case)
	  (scm_sym_cond, scm_sym_define, scm_sym_do, scm_sym_if, scm_sym_lambda)
	  (scm_sym_let, scm_sym_letstar, scm_sym_letrec, scm_sym_quote)
	  (scm_sym_quasiquote, scm_sym_unquote, scm_sym_uq_splicing, scm_sym_at)
	  (scm_sym_atat, scm_sym_atapply, scm_sym_atcall_cc)
	  (scm_sym_at_call_with_values, scm_sym_delay, scm_sym_eval_when)
	  (scm_sym_arrow, scm_sym_else, scm_sym_apply, scm_sym_set_x)
	  (scm_sym_args): Remove public declaration of these symbols.
	  (scm_ilookup, scm_lookupcar, scm_eval_car, scm_eval_body)
	  (scm_eval_args, scm_i_eval_x, scm_i_eval): Remove public declaration
	  of these functions.
	  (scm_ceval, scm_deval, scm_ceval_ptr): Remove declarations of these
	  deprecated functions.
	  (scm_i_print_iloc, scm_i_print_isym, scm_i_unmemocopy_expr)
	  (scm_i_unmemocopy_body): Remove declarations of these internal
	  functions.
	  (scm_primitive_eval_x, scm_eval_x): Redefine as macros for their less
	  destructive siblings.

	* libguile/Makefile.am: Add memoize.[ch] to the build.

	* libguile/debug.h (scm_debug_mode_p, scm_check_entry_p)
	  (scm_check_apply_p, scm_check_exit_p, scm_check_memoize_p)
	  (scm_debug_eframe_size): Remove these vars that were tied to the old
	  evaluator's execution model.
	  (SCM_RESET_DEBUG_MODE): Remove, no more need for this.
	  (SCM_MEMOIZEDP, SCM_MEMOIZED_EXP, SCM_MEMOIZED_ENV): Remove macros
	  referring to old memoized code representation.
	  (scm_local_eval, scm_procedure_environment, scm_memoized_environment)
	  (scm_make_memoized, scm_memoized_p): Remove functions operating on old
	  memoized code representation.
	  (scm_memcons, scm_mem_to_proc, scm_proc_to_mem): Remove debug-only
	  code for old evaluator.

	* libguile/debug.c: Remove code to correspond with debug.h removals.
	  (scm_debug_options): No need to set the debug mode or frame limit
	  here, as we don't have C stack limits any more. Perhaps this is a bug,
	  but as long as we can compile eval.scm, we should be fine.

	* libguile/init.c (scm_i_init_guile): Init memoize.c.

	* libguile/modules.c (scm_top_level_env, scm_env_top_level)
	  (scm_env_module, scm_system_module_env_p): Remove these functions.

	* libguile/print.c (iprin1): No more need to handle isyms. Adapt to new
	  form of interpreted procedures.

	* libguile/procprop.c (scm_i_procedure_arity): Adapt to new form of
	  interpreted procedures.

	* libguile/procs.c (scm_thunk_p): Adapt to new form of interpreted
	  procedures.
	* libguile/procs.h (SCM_CLOSURE_FORMALS): Removed, this exists no more.
	  (SCM_CLOSURE_NUM_REQUIRED_ARGS, SCM_CLOSURE_HAS_REST_ARGS): New
	  accessors.

	* libguile/srcprop.c (scm_source_properties, scm_source_property)
	  (scm_set_source_property_x): Remove special cases for memoized code.

	* libguile/stacks.c (read_frame): Remove a source-property case for
	  interpreted code.
	  (NEXT_FRAME): Remove a case that I don't fully understand, that seems
	  to be designed to skip over apply frames. Will be obsolete in the
	  futures.
	  (read_frames): Default source value for interpreted frames to #f.
	  (narrow_stack): Don't pay attention to the system_module thing.

	* libguile/tags.h: Remove isyms and ilocs. Whee!

	* libguile/validate.h (SCM_VALIDATE_MEMOIZED): Fix to use the new
	  MEMOIZED_P formulation.

	* module/ice-9/psyntax-pp.scm (do, quasiquote, case): Adapt for these no
	  longer being primitive macros.
	* module/ice-9/boot-9.scm: Whitespace change, but just a poke to force a
	  rebuild due to and/or/cond/... not being primitives any more.

	* module/ice-9/deprecated.scm (unmemoize-expr): Deprecate, it's
	  unmemoize-expression now.

	* test-suite/tests/eval.test ("define set procedure-name"): XFAIL a
	  couple of tests here; I don't know what to do about them. I reckon the
	  expander should ensure that defined values are named.

	* test-suite/tests/chars.test ("basic char handling"): Fix expected
	  exception when trying to apply a char.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	goops moving away from evaluator opcodes, and a primitive compilation fix
	* module/oop/goops.scm (@slot-ref, @slot-set!): Define "primitives" for
	  these. Probably should do something more general, though, allowing
	  @struct-ref.

	* module/language/tree-il/primitives.scm (add-interesting-primitive!):
	  Error if the primitive isn't bound.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	remove (lang elisp), as it won't work with the new evaluator
	* lang/: Delete. This causes me some pain, but the new elisp compiler is
	  coming soon, and the old one really won't work with the new evaluator.
	* Makefile.am:
	* configure.ac: Autotoolery for elisp removal.
	* test-suite/tests/elisp.test: Comment out the body of the elisp test.
	  The tests themselves should be useful in the new world, though.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	local-eval will go away
	* module/ice-9/debugger/commands.scm:
	* module/ice-9/debugging/traps.scm:
	* module/ice-9/emacs.scm:
	* module/ice-9/gds-client.scm: Add some FIXMEs due to impending
	  local-eval removal.

	* module/oop/goops.scm (make-generic-bound-check-getter): Just the
	  compiled closure case here.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	no special treatment for memoized code in srcprop.c
	* libguile/srcprop.c (scm_set_source_properties_x): No need to treat
	  memoized code specially.

	* test-suite/tests/srcprop.test ("set-source-property!")
	  ("set-source-properties!"): Well, just throw 'unresolved on these for
	  now, because we need a few more things to land before these can be
	  fixed, or even considered.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	factor copy-tree and cons-source out of eval.[ch]
	* libguile.h:
	* libguile/Makefile.am
	* libguile/init.c (scm_i_init_guile): Add trees.[ch] to the build.

	* libguile/eval.c:
	* libguile/eval.h: Remove scm_copy_tree and scm_cons_source...

	* libguile/trees.h:
	* libguile/trees.c:
	* libguile/srcprop.h:
	* libguile/srcprop.c: ... factoring them out here and here,
	  respectively.

	* test-suite/tests/eval.test ("memoization"): Change expected exception
	  for circular data structures, given new copy-tree location.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	remove unused scm_eval_stack var
	* libguile/private-options.h:
	* libguile/eval.c (scm_eval_stack): Remove declaration and definition of
	  unused scm_eval_stack variable.

	remove evaluator-specific code from macros.c
	* libguile/macros.c (macro_print): No special printing for macros
	  whose code is an interpreted procedure.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	remove class-environment slot, goops grubs less in the evaluator
	* libguile/goops.h (scm_sys_tag_body): Remove declaration of undefined
	  function.
	  (SCM_CLASS_CLASS_LAYOUT, scm_si_environment, SCM_N_CLASS_SLOTS)
	  (scm_class_environment) Remove class environment slot and getter.

	* libguile/goops.c (compute_getters_n_setters): Use scm_primitive_eval
	  to produce the init thunk, instead of scm_i_eval_x; though really we
	  should be doing this in Scheme.
	  (scm_basic_basic_make_class, build_class_class_slots)
	  (create_basic_classes, scm_class_environment): Remove class
	  environment slot.
	  (get_slot_value, set_slot_value): Use scm_call_1 instead of evaluator
	  tricks.

	* module/oop/goops.scm: Remove class-environment export, and
	  environments throughout the file.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	fix to gdb_eval to use newer interfaces
	* libguile/gdbint.c (gdb_eval): Use scm_primitive_eval instead of
	  scm_i_eval_x.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	formally deprecate trampolines
	* libguile/eval.c:
	* libguile/deprecated.h:
	* libguile/deprecated.c (scm_trampoline_0, scm_trampoline_1)
	  (scm_trampoline_2): Actually deprecate trampolines.

	* srfi/srfi-1.c: Fix all trampoline uses in srfi-1.c.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	remove uses of trampolines within guile itself
	* libguile/eval.c (scm_map, scm_for_each)
	* libguile/hashtab.c (scm_hash_for_each_handle)
	* libguile/list.c (scm_filter, scm_filter_x)
	* libguile/quicksort.i.c:
	* libguile/sort.c (scm_restricted_vector_sort_x, scm_sorted_p)
	  (scm_merge, scm_merge_list_x, scm_merge_x)
	  (scm_merge_list_step, scm_sort_x, scm_sort, scm_merge_vector_x)
	  (scm_merge_vector_step, scm_stable_sort_x, scm_sort_list_x)
	  (scm_sort_list)nn
	* libguile/srfi-13.c (scm_string_any, scm_string_every)
	  (scm_string_tabulate, scm_string_trim, string_trim_right)
	  (scm_string_trim_both, scm_string_index, scm_string_index_right)
	  (scm_string_skip, scm_string_skip_right, scm_string_count)
	  (scm_string_map, scm_string_map_x, scm_string_for_each)
	  (scm_string_for_each_index, scm_string_filter, scm_string_delete):
	  Remove uses of trampolines.

	gut the backtrace implementation for memoized code
	* libguile/backtrace.c (display_header, display_expression)
	  (display_error_body, display_backtrace_get_file_line, display_frame):
	  Gut the implementation for memoized code, as memoized code as it is
	  currently understood is going away.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	remove some deprecated things, undeprecate scm_the_root_module()
	* libguile/deprecated.h
	* libguile/deprecated.c (SCM_ILOC00, SCM_IDINC, SCM_IDSTMSK)
	  (scm_s_expression, scm_s_test, scm_s_body, scm_s_bindings)
	  (scm_s_variable, scm_s_clauses, scm_s_formals, SCM_EVALIM2)
	  (SCM_EVALIM, SCM_XEVAL, SCM_XEVALCAR): Remove these macros and
	  constants, deprecated in 2003.
	  (scm_the_root_module): Undeprecate, it's actually a useful function,
	  that other parts of the code use.

	* libguile/modules.h (scm_the_root_module): Undeprecated.
	* libguile/modules.c (scm_the_root_module): Rename from
	  the_root_module. Use it in the rest of this file.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	tweak to eval.c
	* libguile/eval.c (eval_letrec_inits): Rename from ceval_letrec_inits.
	  Caller changed.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	eval.i.c -> eval.c
	* libguile/Makefile.am:
	* libguile/eval.i.c: Remove eval.i.c.

	* libguile/eval.c: Fold eval.i.c's contents into eval.c.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	more ceval excision
	* libguile/eval.c:
	* libguile/eval.i.c: Rename deval to eval. Substitute in some
	  preprocessor macros.

	remove code from eval.i.c that was only for CEVAL.
	* libguile/eval.i.c: Remove CEVAL-only code.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	Don't double-include eval.i.c -- let's only build deval.
	* libguile/eval.c (SCM_I_XEVAL, SCM_I_XEVALCAR): No more debug_p args,
	  we are always debugging. Adapt all callers.
	  (ceval_letrec_inits): For some reason this function is used by deval.
	  No idea why. Pull it out here.

	* libguile/eval.i.c (SCM_APPLY): scm_dapply is scm_apply.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	gut trampolines
	* libguile/eval.c: Gut the trampoline implementation. We'll be doing
	  much more clever things here that will obviate the need for the
	  procedure arg of map and for-each to be allocated in many cases...
	  trampolines were a noble attempt at optimizing in the wrong place.

	* srfi/srfi-1.c (scm_srfi1_lset_difference_x): Validate that we get a
	  proc, because the trampoline won't do it for us.

	* test-suite/tests/sort.test ("sort"):
	* test-suite/tests/srfi-1.test ("count", "fold", "list-index"):
	  Change expected exceptions, due to trampoline functions not doing any
	  computation.

2009-12-01  Andy Wingo  <wingo@pobox.com>

	expand out named let to letrec in the eval case
	* module/ice-9/psyntax.scm: In the eval case, expand out named let to
	  letrec.
	* module/ice-9/psyntax-pp.scm: Regenerated.

2009-11-29  Ludovic Courtès  <ludo@gnu.org>

	Make `SCM' type definition acceptable for C++ compilers.
	* libguile/tags.h (SCM) [SCM_DEBUG_TYPING_STRICTNESS == 1]: Use a named
	  struct to avoid errors from C++ compilers such as "error: non-local
	  function ‘<anonymous struct>* foo(<anonymous struct>*)’ uses anonymous
	  type".  This fixes a regression introduced in
	  c6054feaf03f8bde236f5e45a946f38827074923 ("Add support for static
	  allocation of cells, strings and stringbufs.").  Reported by Linas
	  Vepstas <linasvepstas@gmail.com>.

2009-11-28  Ludovic Courtès  <ludo@gnu.org>

	Remove remaining uses of discouraged constructs, really.
	* libguile/throw.c, libguile/vm-engine.h, libguile/vm-i-system.c,
	  libguile/vm.c:  Replace uses of discouraged constructs by their
	  current counterparts.

	Remove remaining uses of discouraged constructs.
	* libguile/frames.c, libguile/instructions.c, libguile/objcodes.c,
	  libguile/programs.c, libguile/throw.c, libguile/vm-i-scheme.c,
	  libguile/vm.c:  Replace uses of discouraged constructs by their
	  current counterparts.

2009-11-27  Ludovic Courtès  <ludo@gnu.org>

	Disable encoding scanning on non-seekable file ports.
	* libguile/read.c (scm_i_scan_for_encoding): Don't attempt to scan
	  non-seekable file ports.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	header tidyings
	* libguile/goops.h:
	* libguile/struct.h: c-backslash-region some vars.

	brace placement fixes
	* libguile/goops.c (scm_sys_allocate_instance):
	* libguile/vm-i-loader.c (load-wide-string): Fix some brace placements.

	push goops compile delay out to 30 invocations, for great justice
	* module/oop/goops/dispatch.scm (timer-init): Init to 30 for faster
	  goops load time.

	generic method cache begone
	* libguile/goops.h (SCM_GENERIC_METHOD_CACHE)
	  (SCM_SET_GENERIC_METHOD_CACHE, scm_si_generic_cache)
	* libguile/goops.c (create_standard_classes): Remove slot for generic
	  method cache. Yay!

2009-11-26  Andy Wingo  <wingo@pobox.com>

	remove code that manages the method cache
	* libguile/goops.h (SCM_MCACHE_N_SPECIALIZED)
	  (SCM_SET_MCACHE_N_SPECIALIZED, SCM_INITIAL_MCACHE_SIZE)
	  (scm_make_method_cache, scm_memoize_method, scm_mcache_lookup_cmethod)
	  (scm_mcache_compute_cmethod):
	* libguile/goops.c: Remove these procedures which managed the method
	  cache. There's still a slot there but it's not initialized. The method
	  cache is no longer necessary.

	* module/oop/goops/dispatch.scm (memoize-method!): Change to not take a
	  "cache" argument.

	* libguile/eval.i.c:
	* libguile/vm-i-system.c: Remove dispatch via the method cache.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	remove method cache management code from (oop goops dispatch)
	* module/oop/goops/dispatch.scm: Remove old method cache things.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	generics now dispatch as applicable structs
	* libguile/eval.i.c (CEVAL, SCM_APPLY): Dispatch applicable structs
	  before pure generics. In practice what this means is that we never hit
	  the mcache case, because all pure generics are applicable structs.
	  We're moving over to having generics dispatch themselves. Also, they
	  don't prepend the struct as an arg; in order to have that effect, the
	  user has closures.

	* libguile/goops.c (scm_apply_generic, scm_call_generic_0):
	  (scm_call_generic_1, scm_call_generic_2, scm_call_generic_3): Dispatch
	  directly to the struct procedures.
	  (scm_var_make_extended_generic): Remove a duplicate definition for
	  scm_var_make_extended_generic.
	  (create_standard_classes): Mark all instances of
	  <applicable-struct-class> (themselves classes) as applicable classes.
	  Meaning: generics are now applicable structs.

	* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT): The hashsets are actually
	  uw slots -- or at least, making subclasses maps the int slots to be uw
	  slots

	* libguile/vm-i-system.c (call, goto/args, mv-call): Dispatch applicable
	  structs in the VM.

	* module/oop/goops/dispatch.scm (emit-linear-dispatch): Fix bug in the
	  non-rest cache miss case.
	  (delayed-compile): Rework to avoid fluids.
	  (cache-dispatch): Don't call `equal?', it causes bootstrapping
	  problems with the primitive-generic equal?. Using our own version is
	  faster anyway.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	make sure that when equal? is extended, that the generic has a method
	* libguile/goops.h:
	* libguile/goops.c (scm_set_primitive_generic_x): New function, for now
	  local to the goops module.

	* module/oop/goops.scm (equal?): Make sure that when equal? is extended,
	  that the generic already has a default method.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	remove cache-mutex slot from generics
	* libguile/goops.c:
	* libguile/goops.h: Remove cache-mutex slot from generics, and renumber
	  other slots.

	remove locking in method memoization
	* libguile/goops.c (scm_memoize_method): Don't lock around method
	  memoization, as the new protocol will be reeentrant and lock-free.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	limn goops flags, remove foreign objs, rename entity to applicable-struct
	* libguile/goops.c (scm_class_applicable_struct)
	  (scm_class_applicable_struct_with_setter)
	  (scm_class_applicable_struct_class): Rename from
	  scm_class_entity, scm_class_entity_with_setter, and
	  scm_class_entity_class.
	  (scm_class_simple_method): Removed; this abstraction is not used.
	  (scm_class_foreign_class, scm_class_foreign_object): Remove these,
	  they are undocumented and unused. They might come back later.
	  (scm_sys_inherit_magic_x): Simply inherit the vtable flags from the
	  class's class. Flags are about layout, and it is the class that
	  determines the layout of the instance.
	  (scm_basic_basic_make_class): Don't bother setting GOOPS_OR_VALID,
	  inherit-magic will do that.
	  (scm_basic_make_class): Inherit magic after setting the layout. Allows
	  the struct magic checker to do its job.
	  (scm_accessor_method_slot_definition): Move implementation to Scheme.
	  Removes the need for the accessor flag.
	  (scm_sys_allocate_instance): Adapt to scm_i_alloc_struct name change,
	  and that alloc-struct will handle finalization.
	  (scm_compute_applicable_methods): Remove accessor check, as it's
	  unnecessary.
	  (scm_make): Adapt to new generic slot order, and no more
	  simple-method.
	  (create_standard_classes): What was the GF slot "dispatch-procedure"
	  is now the applicable-struct slot "procedure". No more foreign class,
	  foreign object, or simple method. Rename <entity> and friends to
	  <applicable-struct> and friends. No more entity-with-setter -- though
	  perhaps it will come back too. Instead generic-with-setter is its own
	  thing.

	* libguile/goops.h (SCM_CLASSF_METACLASS): "A goops class that is a
	  vtable" -- no need for a separate flag.
	  (SCM_CLASSF_FOREIGN, SCM_CLASSF_SIMPLE_METHOD)
	  (SCM_CLASSF_ACCESSOR_METHOD): Removed these unused flags.
	  (SCM_ACCESSORP): Removed.
	  Renumber generic slots, rename entity classes, and remove the foreign
	  class, foreign object, and simple method classes.

	* libguile/struct.c (scm_i_struct_inherit_vtable_magic): New function,
	  called when making new vtables.applicable structs
	  (scm_i_alloc_struct): Remove 8-bit alignment check, as libGC
	  guarantees this for us. Handle finalizer registration here.
	  (scm_make_struct): Factor some things to scm_i_alloc_struct and
	  scm_i_struct_inherit_vtable_magic.
	  (scm_make_vtable_vtable): Adapt to scm_i_alloc_struct name change.

	* libguile/struct.h (scm_i_alloc_struct): Change name from
	  scm_alloc_struct, and make internal.

	* module/oop/goops.scm (oop): Don't declare #:replace <class> et al,
	  because <class> isn't defined in the core any more.
	  (accessor-method-slot-definition): Defined in Scheme now.
	  Remove <foreign-object> methods.
	  (initialize on <class>): Prep layout before inheriting magic, as in
	  scm_basic_make_class.

	* module/oop/goops/dispatch.scm (delayed-compile)
	  (memoize-effective-method!): Adapt to 'procedure slot name change.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	%invalidate-method-cache invalidates the dispatch procedure too
	* libguile/goops.c (make_dispatch_procedure, clear_method_cache):
	  Properly reset the dispatch procedure.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	generic dispatch protocol in scheme, not yet wired up
	* module/oop/goops/dispatch.scm: Add a dispatch protocol in Scheme. The
	  idea is that instead of using a hardcoded C protocol, we compile
	  dispatch procedures at runtime. To avoid too much thrashing at bootup,
	  there is a simple JIT mechanism -- dispatch will be data-driven,
	  through the cache, for the first 5 invocations, then a dispatch
	  procedure will be compiled from the cache.

	  My initial timings indicate that interpreted dispatch takes about
	  100us, and that compiled dispatch takes about 60us. Compilation itself
	  takes about 16000us (16 ms). The compiled procedure dispatch times
	  will improve soon, hopefully.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	eqv? not a generic, equal? dispatches to generic only for objects
	* libguile/eq.c (scm_eqv_p): Not a generic any more. Since eqv? is used
	  by e.g. `case', which should be able to compile into dispatch tables,
	  it really doesn't make sense to dispatch out to a generic.
	  (scm_equal_p): So it was always the case that (equal? 'foo "foo") =>
	  #f. But (equal? 'foo 'bar) could actually be extended by a generic.
	  This was a bug, if you follow the other logic of the code. Changed so
	  that generic functions can only extend the domain of equal? when
	  operating on goops objects.

	* oop/goops.scm: No more eqv? generic.

	* test-suite/tests/goops.test: Remove eqv? tests.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	generic tweaks; realizing what the setter slot actually is
	* libguile/goops.h (scm_si_dispatch_procedure)
	  (scm_si_effective_methods): Rename the new generics slots to
	  "effective-methods" and "dispatch-procedure".
	  (scm_si_generic_setter): Rename this one from "%setter" to "setter",
	  and it's not a cache -- it's a pointer to the setter, which is also a
	  generic. I didn't realize that before. It's better this way (like it
	  always was.)
	  (SCM_SET_GENERIC_DISPATCH_PROCEDURE)
	  (SCM_CLEAR_GENERIC_EFFECTIVE_METHODS): New helper macros.

	* libguile/goops.c (clear_method_cache): Clear the new dispatch
	  procedure and the effective methods as well.
	  (create_standard_classes): Rename slots, and fix the setter slots.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	more clarity in (oop goops dispatch)
	* module/oop/goops/dispatch.scm (memoize-method!): If we don't have a
	  no-applicable-method, just call no-applicable-method directly.

	* test-suite/tests/goops.test ("no-applicable-method"): Add some tests.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	remove code-table slot from methods
	* libguile/goops.c (scm_sys_invalidate_method_cache_x, scm_make)
	  (create_standard_classes): Remove code-table slot from methods. The
	  generic cache completely does its job, afaict.

	* libguile/goops.h (scm_si_formals, scm_si_body, scm_si_make_procedure):
	  Renumber slots.

	* module/oop/goops.scm (initialize on <method>): No more code-table
	  slot.

	* module/oop/goops/compile.scm: Always "compile" a method, instead of
	  looking for a hit in an always-empty cache.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	remove used-by slot from generics
	* libguile/goops.c (clear_method_cache)
	  (scm_sys_invalidate_method_cache_x, scm_make)
	  (create_standard_classes): Remove the used-by method from generics, as
	  it is not used at all.

	* libguile/goops.h: Renumber generic slots.

	* module/oop/goops/dispatch.scm (memoize-method!): No more used-by slot.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	first step towards effective methods
	* libguile/goops.c (create_standard_classes):
	* libguile/goops.h *scm_si_applicable_methods, scm_si_effective_method)
	  (scm_si_applicable_setter_methods, scm_si_effective_setter_method):
	  Add space for the new form of the generic cache and effective method.

2009-11-26  Andy Wingo  <wingo@pobox.com>

	a very big commit cleaning up structs & goops. also applicable structs.
	I tried to split this one, and I know it's a bit disruptive, but this
	stuff really is one big cobweb. So instead we'll pretend like these are
	separate commits, by separating the changelog.

	Applicable struct runtime support.

	* libguile/debug.c (scm_procedure_source):
	* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
	  (scm_trampoline_2):
	* libguile/eval.i.c (CEVAL):
	* libguile/goops.c (scm_class_of):
	* libguile/procprop.c (scm_i_procedure_arity):
	* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Allow
	  for applicable structs. Whee!

	* libguile/deprecated.h (scm_vtable_index_vtable): Define as a synonym
	  for scm_vtable_index_self.
	  (scm_vtable_index_printer): Alias scm_vtable_index_instance_printer.
	  (scm_struct_i_free): Alias scm_vtable_index_instance_finalize.
	  (scm_struct_i_flags): Alias scm_vtable_index_flags.
	  (SCM_STRUCTF_FLAGS): Be a -1 mask, we have a whole word now.
	  (SCM_SET_VTABLE_DESTRUCTOR): Implement by hand.

	Hidden slots.

	* libguile/struct.c (scm_make_struct_layout): Add support for "hidden"
	  fields, writable fields that are not visible to make-struct. This
	  allows us to add fields to vtables and not break existing make-struct
	  invocations.
	  (scm_struct_ref, scm_struct_set_x): Always get struct length from the
	  vtable. Support hidden fields.

	* libguile/goops.c (scm_class_hidden, scm_class_protected_hidden): New
	  slot classes, to correspond to the new vtable slots.
	  (scm_sys_prep_layout_x): Turn hidden slots into 'h'.
	  (build_class_class_slots): Reorder the class slots to account for
	  vtable fields coming out of negative-land, for name as a vtable slot,
	  and for hidden fields.
	  (create_standard_classes): Define <hidden-slot> and
	  <protected-hidden-slot>.

	Clean up struct.h.

	* libguile/struct.h: Lay things out cleaner. There are no more hidden
	  (negative) words. Names are nicer. The exposition is nicer. But the
	  basics are the same. The incompatibilities are that <vtable> has more
	  slots now, and that scm_alloc_struct's signature has changed. The
	  former is ameliorated by the "hidden" slots mentioned before, and the
	  latter, well, it was always a very internal thing...
	  (scm_t_struct_finalize): New type, a finalizer function to be run when
	  instances of a vtable are collected.
	  (scm_t_struct_free): Removed, structs' data is managed by the GC now,
	  and not freed by vtable functions.

	* libguile/struct.c: (scm_vtable_p): Now we keep flags on
	  vtable-vtables, so this check is cheaper.
	  (scm_alloc_struct): No hidden words. Yippee.
	  (struct_finalizer_trampoline): Entersify.
	  (scm_make_struct): No need to babysit extra words, though now we have
	  to babysit flags. Propagate the vtable, applicable, and setter flags
	  appropriately.
	  (scm_make_vtable_vtable): Update for new simplicity.
	  (scm_print_struct): A better printer.
	  (scm_init_struct): Define <applicable-struct-vtable>, a magical vtable
	  like CL's funcallable-standard-class. Also define
	  <applicable-struct-with-setter-vtable>.

	Remove foreign object implementation.

	* libguile/goops.h:
	* libguile/goops.c (scm_make_foreign_object, scm_make_class)
	  (scm_add_slot, scm_wrap_object, scm_wrap_component): Remove, these
	  were undocumented and unworking.

	Clean up goops.h, a little.

	* libguile/goops.h:
	* libguile/goops.c: Also clean up.
	* module/oop/goops/dispatch.scm (hashset-index): Adapt for new hashset
	  index.

2009-11-25  Ludovic Courtès  <ludo@gnu.org>

	Remove uses of discouraged constructs.
	* libguile/vm-i-scheme.c, libguile/vm-i-system.c, libguile/vm.c: Replace
	  uses of discouraged constructs by their current counterparts.

	Don't build `inet-aton' and `inet-ntoa' when --disable-networking.
	* libguile/deprecated.c (scm_inet_aton, scm_inet_ntoa): Conditionalize
	  on `HAVE_NETWORKING'.

2009-11-24  Ludovic Courtès  <ludo@gnu.org>

	Use $(PATH_SEPARATOR) where appropriate.
	* examples/Makefile.am (AM_CFLAGS, AM_LIBS): Use $(PATH_SEPARATOR)
	  instead of `:'.
	  (installcheck): Likewise.

2009-11-24  Ludovic Courtès  <ludo@gnu.org>

	Fix makefile indentation.
	* benchmark-suite/Makefile.am, libguile/Makefile.am, meta/Makefile.am:
	  Use TAB instead of 8 spaces...

	* .x-sc_makefile_check: New file.

2009-11-24  Ludovic Courtès  <ludo@gnu.org>

	Properly quote the first argument to `AC_DEFINE{,_UNQUOTED}'.
	* acinclude.m4, configure.ac, examples/compat/acinclude.m4: Properly
	  quote the first argument for `AC_DEFINE' and `AC_DEFINE_UNQUOTED'.

	* .x-sc_m4_quote_check: New file.

2009-11-24  Ludovic Courtès  <ludo@gnu.org>

	Add `cfg.mk', for use by the top-level GNUmakefile.
	* cfg.mk: New file, with 1.9.5 `NEWS' hash.

	"filesystem" -> "file system"
	* doc/ref/misc-modules.texi, doc/sources/unix.texi,
	  module/ice-9/ftw.scm: Replace "filesystem" by "file system".

2009-11-24  Ludovic Courtès  <ludo@gnu.org>

	Don't rely on `HAVE_' macros in public header "tags.h".
	* configure.ac: Check for `intptr_t' and `uintptr_t'.  Substitute
	  `SCM_I_GSC_T_INTPTR' and `SCM_I_GSC_T_UINPTR'.

	* libguile/__scm.h (SCM_T_UINTPTR_MAX, SCM_T_INTPTR_MIN,
	  SCM_T_INTPTR_MAX): New macros.

	* libguile/_scm.h (SIZEOF_SCM_T_BITS): New macro.

	* libguile/gen-scmconfig.c (main): Produce typedefs for `scm_t_intptr'
	  and `scm_t_uintptr'.

	* libguile/gen-scmconfig.h.in (SCM_I_GSC_T_INTPTR, SCM_I_GSC_T_UINPTR):
	  New macros.

	* libguile/tags.h: Don't check for `HAVE_INTTYPES_H' and
	  `HAVE_STDINT_H'; don't include <inttypes.h> nor <stdint.h>.
	  (scm_t_signed_bits, scm_t_bits): Define unconditionally as aliases for
	  `scm_t_intptr' and `scm_t_uintptr', respectively.
	  (SCM_T_SIGNED_BITS_MAX, SCM_T_SIGNED_BITS_MIN, SCM_T_BITS_MAX):
	  Likewise.
	  (SIZEOF_SCM_T_BITS): Remove.

2009-11-24  Ludovic Courtès  <ludo@gnu.org>

	Remove unused, non-prefixed macros.
	* libguile/__scm.h (BIGNUMS, TICKS): Remove.

	Update to Gnulib v0.0-2923-g6575ab5.

	Really disable thread-local storage on NetBSD 5.0.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Adjust to match actual
	  NetBSD 5 triplet, `x86_64-unknown-netbsd5.0.' (note the final dot).

	Fix compilation `--without-threads'.
	* configure.ac: For `--without-threads' and `--with-threads=null', set
	  `SCM_I_GSC_HAVE_THREAD_STORAGE_CLASS=0'.  This fixes compilation of
	  `gen-scmconfig.c' in these cases.

2009-11-23  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `duplocale' module.
	* libguile/i18n.c (scm_make_locale): Simplify global locale handling,
	  using duplocale(3) for all kinds of locales.
	  (scm_init_i18n): Comment on why we don't just use `LC_GLOBAL_LOCALE'
	  for `global_locale_smob'.

	* m4/gnulib-cache.m4: Add `duplocale'.

2009-11-23  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `locale' module.
	* configure.ac: Remove test for <xlocale.h>.

	* libguile/i18n.c: Remove conditional <xlocale.h> inclusion on
	  `HAVE_XLOCALE_H'.

	* m4/gnulib-cache.m4: Add `locale' module.

2009-11-23  Ludovic Courtès  <ludo@gnu.org>

	Correct manual wrt. encoding names.
	* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
	  Don't suggest `latin1' as a good encoding name since Emacs cannot deal
	  with it.

	* libguile/read.c (scm_file_encoding): Fix "Emacs" spelling.

2009-11-21  Andy Wingo  <wingo@pobox.com>

	better printing of procedures with keyword arguments
	* module/system/vm/program.scm (arguments->lambda-list): Print keyword
	  arguments more sensibly.

	fix version-etc for older autoconf
	* lib/version-etc.c: Don't reference the undefined PACKAGE if
	  PACKAGE_URL is undefined. Probably should go upstream.

2009-11-18  Ludovic Courtès  <ludo@gnu.org>

	autogen.sh: Don't presume /usr/bin/m4.
	* autogen.sh: Don't presume /usr/bin/m4.

	Work around path name length limitations in `socket.test'.
	* test-suite/tests/socket.test (%tmpdir, %curdir): New variables.
	  Chdir to %TMPDIR.  Switch back to %CURDIR at the end.
	  (temp-file-path): Return a base file name, not an absolute path.

2009-11-18  Ludovic Courtès  <ludo@gnu.org>

	Remove conflicting definition of $PACKAGE from `GUILE-VERSION'.
	This obviates the need for the previous commit,
	53da7372beca90a58b7401a84627815289a53d11.

	* GUILE-VERSION (VERSION, PACKAGE): Remove.  The latter was conflicting
	  with Automake's definition, which is "guile", not "GNU Guile".

	* Makefile.am (distdir): Remove.

	* configure.ac: Hardcode the package name passed to `AC_INIT'.
	  (pkgdatadir, pkgincludedir, pkglibdir, pkglibexecdir): Remove.

2009-11-18  Ludovic Courtès  <ludo@gnu.org>

	Fix $(pkgdatadir) & co. so they refer to $(PACKAGE_TARNAME), not $(PACKAGE).
	This fixes a regression introduced in
	4f02b98d0ed4a314916c69a225d7a45dda3f5f8c ("Use Gnulib's
	`version-etc-fsf' for `--version' and `--help' output."), which led
	$(pkgdatadir) & co. to contain the string "GNU Guile" instead of
	"guile".

	* configure.ac (pkgdatadir, pkgincludedir, pkglibdir, pkglibexecdir):
	  New variables.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 1.9.5.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Don't use `-Werror' by default.
	* configure.ac (GUILE_ERROR_ON_WARNING): Default to "no".

	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.

	* NEWS: Update.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Fix copyright headers.
	* module/system/vm/debug.scm, module/system/vm/frame.scm,
	  module/system/vm/vm.scm: Switch to LGPLv3+.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Fix stylistic issues revealed by "make syntax-check".
	* libguile/gc-malloc.c (scm_must_free): Remove unnecessary `if' before
	  `free ()'.

	* libguile/stime.c (scm_localtime, scm_mktime): Likewise.

	* libguile/eval.i.c (ceval): Don't cast the result of alloca(3).

	* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Likewise.

	* test-suite/standalone/test-unwind.c: Likewise.

	* libguile/strings.c (scm_i_deprecated_string_chars): Don't end error
	  message in period.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Add Gnulib maintainer modules.
	* m4/gnulib-cache.m4: Add `announce-gen', `gendocs', `gitlog-to-changelog',
	  `gnupload', `gnu-web-doc-update', and `maintainer-makefile'.

	* .gnuploadrc, .x-sc_GPL_version, .x-sc_avoid_if_before_free,
	  .x-sc_error_message_period, .x-sc_cast_of_alloca_return_value,
	  .x-sc_cast_of_argument_to_free, .x-sc_error_message_uppercase,
	  .x-sc_error_message_warn_fatal: New files.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `version-etc-fsf' for `--version' and `--help' output.
	* m4/gnulib-cache.m4: Add `version-etc-fsf'.  Switch to LGPLv3+.

	* GUILE-VERSION (PACKAGE): Change to "GNU Guile".

	* Makefile.am (distdir): New variable.

	* libguile/script.c (scm_shell_usage): Improve formatting.  Use
	  `emit_bug_reporting_address ()'.
	  (scm_compile_shell_switches): Use `version_etc ()'.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Build the C code with additional GCC warnings.
	* configure.ac (POTENTIAL_GCC_CFLAGS): Add
	  `-Wdeclaration-after-statement -Wundef -Wswitch-enum'.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Remove references to undefined macros.
	The intent is to allow compilation with `-Wundef', which in turn should
	make it easier to catch erroneous uses of nonexistent macros.

	* libguile/__scm.h: Don't assume `BUILDING_LIBGUILE' is defined.

	* libguile/conv-uinteger.i.c (SCM_TO_TYPE_PROTO): Remove unneeded CPP
	  conditional on `TYPE_MIN == 0'.

	* libguile/fports.c: Check for the definition of `HAVE_CHSIZE' and
	  `HAVE_FTRUNCATE', not for their value.

	* libguile/ports.c: Likewise.

	* libguile/numbers.c (guile_ieee_init): Likewise with `HAVE_DINFINITY'
	  and `HAVE_DQNAN'.

	* test-suite/standalone/test-conversion.c (ieee_init): Likewise.

	* libguile/strings.c: Likewise with `SCM_STRING_LENGTH_HISTOGRAM'.

	* libguile/strings.h: Likewise.

	* libguile/tags.h: Likewise with `HAVE_INTTYPES_H' and `HAVE_STDINT_H'.

	* libguile/threads.c: Likewise with `HAVE_PTHREAD_GET_STACKADDR_NP'.

	* libguile/vm-engine.c (VM_NAME): Likewise with `VM_CHECK_IP'.

	* libguile/gen-scmconfig.c (main): Use "#ifdef HAVE_", not "#if HAVE_".

	* libguile/socket.c (scm_setsockopt): Likewise.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Remove now unneeded `putenv.c'.
	* libguile/Makefile.am (EXTRA_libguile_la_SOURCES): Remove `putenv.c'.

	* libguile/putenv.c: Remove.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Remove `qt/'.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Fix C99-style declarations after statements.
	* libguile/eval.i.c (ceval): Move declarations before statements.

	* libguile/read.c (scm_read_extended_symbol): Likewise.

	* libguile/struct.c (scm_make_struct_layout): Likewise.

	* libguile/threads.c (fat_mutex_unlock): Likewise.

	* libguile/vm-i-system.c (br_if_nargs_ne, br_if_nargs_lt): Likewise.

	* libguile/vm.c (make_vm): Likewise.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Remove deprecated guardian code.
	* libguile/guardians.c (guardian_apply): Remove `#if ENABLE_DEPRECATED'
	  section since it was never compiled in, not even in 1.8.
	  (scm_init_guardians): Likewise.

2009-11-17  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `warning' module.
	* m4/gnulib-cache.m4: Add `warnings'.

	* configure.ac: Use `gl_WARN_ADD' to check whether compiler flags are
	  supported.

	* libguile/Makefile.am (libguile_la_LIBADD): Add $(LTLIBICONV).
	  (libguile_la_LDFLAGS): Add $(INET_NTOP_LIB) $(INET_PTON_LIB).

2009-11-17  Andy Wingo  <wingo@pobox.com>

	fold 1.9.5 NEWS items into the main text
	* NEWS: Fold 1.9.5 things into the main text.

	Update NEWS.
	* NEWS: Update for 1.9.5. Still needs these entries to be folded into
	  the main section though.

2009-11-16  Andy Wingo  <wingo@pobox.com>

	with a rest arg, allow for keywords anywhere
	* libguile/vm-i-system.c (br-if-nargs-gt): Fix variable declaration
	  placement.
	  (bind-kwargs): Patch mostly by Ludovic: it seems that in the mode in
	  which we have rest args, the keywords can appear anywhere. Bummer.
	  Change to allow for this.

	* module/ice-9/optargs.scm (parse-lambda-case): Same, add a
	  permissive-keys clause that handles the case in which there's a rest
	  argument.

2009-11-16  Ken Raeburn  <raeburn@raeburn.org>

	SCM_DEBUG fix: Don't apply SCM_CAR to non-pairs when walking argument lists in method cache matching.
	* libguile/goops.c (scm_mcache_lookup_cmethod): Don't apply SCM_CAR to
	  non-pairs when walking argument lists in method cache matching.
	  Don't check for CLASSP or symbol in the car slot, since the end of
	  the specifier list is a non-pair.  Update comments to reflect new
	  structure of method cache entry.
	* module/oops/goops/dispatch.scm: Update comments here too.

2009-11-16  Ludovic Courtès  <ludo@gnu.org>

	Add `iconv_open-solaris.h' to remove dependency on gperf.
	* lib/iconv_open-solaris.h: New file.

2009-11-16  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `alignof' module.
	* m4/gnulib-cache.m4: Use `alignof'.

	* libguile/objcodes.c (scm_c_make_objcode_slice): Use `alignof_type'.

2009-11-16  Ludovic Courtès  <ludo@gnu.org>

	Deprecate `inet-ntoa' and `inet-aton'.
	Suggested by Bruno Haible.

	* libguile/inet_aton.c: Remove.

	* libguile/Makefile.am (EXTRA_libguile_la_SOURCES): Remove
	  `inet_aton.c'.

	* libguile/deprecated.c (scm_inet_aton, scm_inet_ntoa): New functions.

	* libguile/deprecated.h: Update accordingly.

	* libguile/socket.c (scm_inet_aton, scm_inet_ntoa): Remove.

	* doc/ref/posix.texi (Network Address Conversion): Mark `inet-ntoa' and
	  `inet-aton' as deprecated.

2009-11-16  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `inet_ntop' and `inet_pton' modules.
	* m4/gnulib-cache.m4: Add `inet_ntop' and `inet_pton'.

	* configure.ac: Don't check for `inet_ntop' and `inet_pton'.

	* libguile/socket.c (scm_inet_pton, scm_inet_ntop): Compile regardless
	  of `HAVE_INET_PTON' and `HAVE_INET_NTOP' respectively.

	* libguile/filesys.c: Use <stdlib.h> instead of <canonicalize.h>.

2009-11-16  Ludovic Courtès  <ludo@gnu.org>

	Re-add an indirection in bytevectors.
	The intent is to allow for mmap(3) bindings and to actually reuse
	user-provided buffers in `scm_c_take_bytevector ()'.

	* libguile/bytevectors.h (SCM_BYTEVECTOR_HEADER_SIZE): Increment.
	  (SCM_BYTEVECTOR_CONTENTS): Take the pointer from the second word.
	  (SCM_BYTEVECTOR_CONTIGUOUS_P): New macro.
	  (SCM_BYTEVECTOR_ELEMENT_TYPE): Adjust to live alongside the CONTIGUOUS
	  flag.

	* libguile/bytevectors.c (SCM_BYTEVECTOR_SET_CONTENTS,
	  SCM_BYTEVECTOR_SET_CONTIGUOUS_P): New macros.
	  (SCM_BYTEVECTOR_SET_ELEMENT_TYPE): Adjust.
	  (SCM_BYTEVECTOR_TYPED_LENGTH): Properly parenthesize.
	  (make_bytevector): Adjust to new bytevector header.
	  (make_bytevector_from_buffer): Reuse CONTENTS.
	  (scm_c_shrink_bytevector): Differentiate between contiguous and
	  non-contiguous bytevectors.

2009-11-16  Ludovic Courtès  <ludo@gnu.org>

	Remove unused internal bytevector functions.
	* libguile/bytevectors.c (scm_i_make_typed_bytevector,
	  scm_c_take_typed_bytevector): Remove.

	* libguile/bytevectors.h: Adjust accordingly.

2009-11-16  Ludovic Courtès  <ludo@gnu.org>

	Run the GC and retry `open-file' when getting `EMFILE'.
	* libguile/fports.c (scm_open_file): Run the GC and retry when getting
	  `EMFILE'.

2009-11-16  Ludovic Courtès  <ludo@gnu.org>

	Improve documentation of supported encoding names.
	* doc/ref/api-evaluation.texi (Character Encoding of Source Files):
	  Mention IANA as the list of supported character encodings.  Thanks to
	  Bruno Haible for pointing this out.

	* doc/ref/api-io.texi (Ports): Likewise.  Improve documentation of
	  `%default-port-encoding'.

2009-11-16  Ken Raeburn  <raeburn@raeburn.org>

	Fix off-by-one error in processing Emacs-style coding declaration.
	* libguile/read.c (scm_i_scan_for_encoding): Don't copy the first
	  character after the coding declaration into the new string.

2009-11-15  Andy Wingo  <wingo@pobox.com>

	opcodes for bit twiddling (ash, logand, logior, logxor)
	* module/language/tree-il/compile-glil.scm:
	* module/language/tree-il/primitives.scm:
	* libguile/vm-i-scheme.c (ash, logand, logior, logxor): New opcodes.

	class-of has an opcode
	* libguile/vm-i-scheme.c (class-of): New opcode.
	* module/language/tree-il/compile-glil.scm:
	* module/oop/goops.scm: Compile class-of into an opcode.

	faster conditionals
	* module/language/tree-il/compile-glil.scm (flatten): Compile `if'
	  statements with `eq?' and `null?', and their `not?' variants, into
	  more specific bytecode.

	fix (apply f) -- without the args list
	* module/language/tree-il/primitives.scm (apply): Only inline if we
	  actually have an argument to apply.

2009-11-15  Andy Wingo  <wingo@pobox.com>

	Revert "implement #:predicate" and remove predicate from <lambda-case>
	Turns out this was not a very useful idea, and semantically tricky to
	boot.

	This reverts commit 24bf130fd15afbc8b3a2ccdc50a027f9b6c9e623, and makes
	the following additional changes:

	* module/ice-9/optargs.scm (parse-lambda-case, let-optional)
	  (let-optional*, let-keywords, let-keywords*):
	* module/language/tree-il.scm: (<lambda-case>, parse-tree-il)
	  (unparse-tree-il, tree-il->scheme, tree-il-fold,
	  make-tree-il-folder)
	  (post-order!, pre-order!):
	* module/language/tree-il/analyze.scm (analyze-lexicals):
	* module/language/tree-il/compile-glil.scm (compile-glil):
	* module/language/tree-il/inline.scm (inline!): Remove all traces of
	  #:predicate from tree-il.

	* module/ice-9/psyntax.scm (build-simple-lambda, build-lambda-case)
	  (chi-lambda-case): Adapt to tree-il change.
	* module/ice-9/psyntax-pp.scm: Regenerated.

	* module/language/brainfuck/compile-tree-il.scm (compile-body):
	* module/language/ecmascript/compile-tree-il.scm (comp, comp-body):
	* test-suite/tests/tree-il.test: Adapt to tree-il change.

	* doc/ref/api-procedures.texi (Case-lambda): Remove mention of
	  #:predicate.

2009-11-15  Andy Wingo  <wingo@pobox.com>

	actually set all 8 hashsets in classes
	* libguile/goops.c (prep_hashsets): Actually set all 8 hashsets. Doh...

	remove goops-local %tag-body
	* libguile/goops.c (scm_sys_tag_body): Remove goops-local hack that is
	  no longer necessary.

	SCM_VALIDATE_VTABLE tweak
	* libguile/validate.h (SCM_VALIDATE_VTABLE): Simply call
	  scm_struct_vtable_p.

	fix printing-programs bug
	* module/system/vm/program.scm (write-program): Fix a bug if we couldn't
	  get a procedure's arity.

	values.c defines a vtable, not a vtable-vtable
	* libguile/values.c (scm_init_values): Define a vtable, not a
	  "metaclass".

	srfi-35 properly uses vtable-offset-user
	* module/srfi/srfi-35.scm (condition-type-id):
	  (condition-type-parent, condition-type-all-fields): Don't ref fixed
	  struct indices, use vtable-offset-user instead.

	fix a structs.test test
	* test-suite/tests/structs.test ("equal?"): Instantiate vtables, not
	  vtable-vtables. "hello" is not a valid vtable layout.

2009-11-15  Andy Wingo  <wingo@pobox.com>

	remove redundant, unnecessary instance size from struct vtables
	* libguile/struct.h (scm_struct_i_size): Remove this shared field -- I
	  mean, the slot is still there, but it's only used for flags.

	* libguile/goops.h (SCM_SET_CLASS_INSTANCE_SIZE):
	* libguile/goops.c (scm_sys_inherit_magic_x, scm_make_class): Remove
	  uses and definition of SCM_SET_CLASS_INSTANCE_SIZE. Light structs used
	  it, but you have that info in the layout; and foreign classes used it,
	  but that is going away soon anyway :)

2009-11-15  Andy Wingo  <wingo@pobox.com>

	fold objects.[ch] into goops.[ch]
	Remove objects.h #includes as appropriate.

2009-11-15  Andy Wingo  <wingo@pobox.com>

	remove support for "entities" -- a form of applicable struct
	Entities were meant to be a form of applicable struct. Unfortunately,
	the implementation is intertwingled with generics. Removing them, for
	now, will make it possible to cleanly re-add applicable struct support.

	* libguile/struct.h (SCM_STRUCTF_ENTITY): Remove.
	  (SCM_STRUCTF_GOOPS_HACK): New flag; sigh.
	* libguile/struct.c (scm_make_struct): We make "entity" structs if the
	  GOOPS_HACK flag is set. This will be fixed when we rework flags and
	  remove hidden words.

	* libguile/goops.c (scm_class_of): Structs are not applicable, for now
	  at least.
	  (scm_sys_inherit_magic_x, scm_basic_basic_make_class)
	  (scm_sys_allocate_instance, scm_sys_set_object_setter_x):
	  (make_struct_class): Adapt for no more entities (and thus no entity
	  flag).
	  (create_standard_classes): For some reason, generic functions were
	  getting the LIGHT flag set, after the ENTITY flag was removed; so for
	  now explicitly clear that flag.
	* libguile/goops.h (SCM_GENERIC_SETTER, SCM_SET_GENERIC_SETTER): New
	  macros.

	* libguile/objects.h:
	* libguile/objects.c: Remove code for entities.

	* libguile/debug.c: (scm_procedure_source): Only work with generics.

	* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
	  (scm_trampoline_2): Only handle generics.

	* libguile/eval.i.c (CEVAL): #ifdef out the pieces about entities.

	* libguile/procprop.c (scm_i_procedure_arity): Remove support for
	  entities.

	* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Remove
	  entity support.

2009-11-15  Andy Wingo  <wingo@pobox.com>

	SCM_GENERIC_METHOD_CACHE macro splits from SCM_ENTITY_PROCEDURE
	* libguile/goops.h (SCM_GENERIC_METHOD_CACHE)
	  (SCM_SET_GENERIC_METHOD_CACHE): Two new macros; the same as
	  SCM_[SET_]ENTITY_PROCEDURE, but more reflecting the reality of the
	  generic hack.

	* libguile/eval.i.c:
	* libguile/goops.c:
	* libguile/objects.c:
	* libguile/vm-i-system.c: Use the new macros when it is appropriate to
	  do so.

2009-11-15  Andy Wingo  <wingo@pobox.com>

	remove unused things from object.[ch]
	* libguile/objects.h:
	* libguile/objects.c (scm_object_procedure): Remove, it was only
	  compiled with SCM_DEBUG.

	* libguile/objects.h:
	* libguile/objects.c (scm_make_class_object, scm_make_subclass_object,
	  (scm_i_make_class_object, scm_metaclass_standard): Remove also. These
	  implemented an undocumented object system, and are totally replaced by
	  GOOPS.

2009-11-15  Andy Wingo  <wingo@pobox.com>

	remove operators

	generic dispatch in the vm (sorta)
	* libguile/vm-i-system.c (call, goto/args, mv-call): Add a case for
	  generics, so we can avoid the evaluator in that case. Still have to
	  cons up a list -- the real solution comes later.

	remove unused struct gc chain macros
	* libguile/struct.h (SCM_STRUCT_GC_CHAIN, SCM_SET_STRUCT_GC_CHAIN):
	  Remove, no longer necessary given topological finalization, provided
	  by libGC.

	de-inline goops dispatch from the evaluator
	* libguile/eval.i.c: De-inline goops dispatch from the evaluator. Part
	  of a refactor.

2009-11-14  Andreas Rottmann  <a.rottmann@gmx.at>

	add quasisyntax
	* module/Makefile.am:
	* module/ice-9/boot-9.scm:
	* module/ice-9/quasisyntax.scm: Add quasisyntax. Implementation by Andre
	  van Tonder, patch by Andreas Rottmann.
	* test-suite/tests/srfi-10.test: Hack to remove srfi-10's clobbering of
	  #,.
	* test-suite/tests/syncase.test: Add a quasisyntax test.

2009-11-14  Andy Wingo  <wingo@pobox.com>

	add include-from-path
	* module/ice-9/psyntax.scm (include-from-path): New syntax. Searches the
	  load path for a file, and includes it.

	psyntax.scm uses #' shorthand for (syntax ...)
	* module/ice-9/psyntax.scm: Convert to use #'.

2009-11-14  Ludovic Courtès  <ludo@gnu.org>

	Add currently failing tests for optargs.
	* test-suite/tests/optargs.test (exception:unrecognized-keyword,
	  exception:extraneous-arguments): New variables.
	  ("define*")["extraneous arguments", "unrecognized keyword", "rest
	  given before keywords"]: New tests.

	Explicitly disable TLS on NetBSD 5.0.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Explicitly disable TLS on
	  NetBSD 5.0.

2009-11-14  Ludovic Courtès  <ludo@gnu.org>

	Have `scm_scan_for_encoding ()' use GC-managed memory.
	* libguile/read.c (scm_scan_for_encoding): Rename to ...
	  (scm_i_scan_for_encoding): ... this; update callers.  Use
	  `scm_gc_strndup ()' instead of `scm_malloc ()'.

	* libguile/read.h: Update accordingly.

	* libguile/load.c (scm_primitive_load): Don't call free(3) on the value
	  returned by `scm_i_scan_for_encoding ()'.

2009-11-14  Ludovic Courtès  <ludo@gnu.org>

	Replace `setbinary' by a public `%default-port-encoding' fluid.
	* doc/ref/api-evaluation.texi (Character Encoding of Source Files): Add
	  reference to the "Ports" node.

	* doc/ref/api-io.texi (Ports): Document `%default-port-encoding'.

	* libguile/ports.c (scm_port_encoding_var): Rename to...
	  (default_port_encoding_var): ... this; update callers.  Make `static'.

	* libguile/posix.c (scm_setbinary): Remove.

	* libguile/posix.h: Adjust accordingly.

	* test-suite/tests/numbers.test: Remove unneeded `setbinary' call.

	* test-suite/tests/ports.test: Replace `setbinary' call by equivalent
	  `%default-port-encoding' mutation and `set-port-encoding!' calls.

	* test-suite/tests/r6rs-ports.test: Replace `setbinary' call by
	  equivalent `%default-port-encoding' mutation.

2009-11-14  Ludovic Courtès  <ludo@gnu.org>

	Explicitly require `sed'.
	* configure.ac: Use `AC_PROG_SED'.

2009-11-14  Andy Wingo  <wingo@pobox.com>

	fix bugs in ecmascript compiler
	* module/language/ecmascript/compile-tree-il.scm: Fix a number of bugs,
	  fallen out from the ghil->tree-il conversion.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add a hack
	  for "return" for javascript. Scheme shouldn't see this because it's
	  not an "interesting primitive".

2009-11-14  Andy Wingo  <wingo@pobox.com>

	fix scoping in let-keywords
	* module/ice-9/optargs.scm (let-keywords): I thought that I had the
	  scoping right here, but I didn't. Make sure that the lambda formals
	  for the initializers are new, fresh identifiers, so that let scoping
	  works appropriately.

	fix bug in string comparison
	* libguile/srfi-13.c (compare_strings): Switch the "longer" and
	  "shorter" arguments. All the callers of this function assumed that
	  shorter came first. Fixes (string<? "abc" "abcd").

2009-11-10  Ludovic Courtès  <ludo@gnu.org>

	Improve the printer of SRFI-35 error conditions.
	* module/srfi/srfi-35.scm (print-condition): Print the name and value of
	  each field.

2009-11-08  Ludovic Courtès  <ludo@gnu.org>

	Add support for multiple arities in `arity-mismatch-analysis'.
	* module/language/tree-il/analyze.scm (validate-arity)[arity]: Rename
	  to...
	  [arities]: ... this.  Return all the arities of PROC.
	  Update caller accordingly.

	* test-suite/tests/tree-il.test ("warnings")["arity
	  mismatch"]("case-lambda", "case-lambda with wrong number of
	  arguments", "case-lambda*", "case-lambda* with wrong arguments"): New
	  tests.

2009-11-08  Ludovic Courtès  <ludo@gnu.org>

	Update `.gitignore'.

	Fix C99-style comments.
	* libguile/generalized-vectors.c, libguile/programs.c, libguile/vm.c:
	  Replace C99-style comments by plain old C89 comments.

	Compile with `-Warity-mismatch'.
	* am/guilec (GUILE_WARNINGS): New variable; add `-Warity-mismatch'.
	  (.scm.go): Use it.

	Add tests for `unbound-variable-analysis'.
	* test-suite/tests/tree-il.test ("warnings")["unbound
	  variable"]("optional arguments are visible", "keyword arguments are
	  visible"): New tests.

	Fix optional argument handling in `unused-variable-analysis'.
	* module/language/tree-il/analyze.scm (unused-variable-analysis): Fix
	  optional argument handling in <lambda-case>.

2009-11-08  Ludovic Courtès  <ludo@gnu.org>

	Add support for keyword arguments in `arity-mismatch-analysis'.
	* module/language/tree-il/analyze.scm
	  (validate-arity)[filter-keyword-args]: New procedure.
	  [arity]: Get accurate arity for programs, return ALLOW-OTHER-KEYS? as
	  an additional value.
	  Update to `arity' change; use `filter-keyword-args'.

	* test-suite/tests/tree-il.test ("warnings")["arity mismatch"]("keyword
	  not passed and quiet", "keyword passed and quiet", "keyword passed to
	  global and quiet", "extra keyword", "extra keywords allowed"): New
	  tests.

2009-11-07  Ludovic Courtès  <ludo@gnu.org>

	Fix typos leading to wrong argument counts.
	* module/ice-9/channel.scm (eval): Fix number of arguments to
	  `guile:eval'.

	* module/oop/goops/save.scm (write-readably): Fix number of arguments to
	  `write-array'.

	* module/srfi/srfi-19.scm (priv:char->int): Fix number of arguments to
	  `priv:time-error'.

2009-11-07  Ludovic Courtès  <ludo@gnu.org>

	Fix typos in `psyntax'.
	* module/ice-9/psyntax.scm (lambda*-formals): Fix argument count in
	  `rest' invocations.
	  [pred]: Fix argument count in `syntax->datum' invocation.

2009-11-07  Ludovic Courtès  <ludo@gnu.org>

	Add `arity-mismatch' warning type.
	* module/language/tree-il/analyze.scm (<arity-info>): New record type.
	  (validate-arity, arity-analysis): New variables.

	* module/language/tree-il/compile-glil.scm (%warning-passes): Add
	  `arity-mismatch'.

	* module/system/base/message.scm (%warning-types): Likewise.

	* test-suite/tests/tree-il.test (read-and-compile): Remove, as it's now
	  public.
	  (%opts-w-arity): New.
	  ("warnings")["arity mismatch"]: New test prefix.

2009-11-06  Ludovic Courtès  <ludo@gnu.org>

	Coalesce tree traversals made for warnings.
	* module/language/tree-il/analyze.scm (<tree-analysis>): New type.
	  (analyze-tree): New procedure.
	  (report-unused-variables): Replace by...
	  (unused-variable-analysis): ... this, as a <tree-analysis>.
	  (report-possibly-unbound-variables): Replace by...
	  (unbound-variable-analysis): ... this, as a <tree-analysis>.

	* module/language/tree-il/compile-glil.scm (%warning-passes): Adjust
	  accordingly.
	  (compile-glil): Likewise.  Use `analyze-tree'.

2009-11-05  Ludovic Courtès  <ludo@gnu.org>

	Hold the GC lock when traversing weak hash table buckets.
	* libguile/hashtab.c (scm_fixup_weak_alist): Clarify comment.
	  (struct t_assoc_args): New.
	  (do_weak_bucket_assoc, weak_bucket_assoc): New.
	  (START_WEAK_BUCKET_FIXUP, END_WEAK_BUCKET_FIXUP): Remove.
	  (scm_hash_fn_get_handle, scm_hash_fn_create_handle_x,
	  scm_hash_fn_remove_x): Use `weak_bucket_assoc ()' instead of
	  `START_WEAK_BUCKET_FIXUP'/`END_WEAK_BUCKET_FIXUP'.

	Fix snarfing of `SCM_DEFINE' with static allocation.
	* libguile/snarf.h (SCM_DEFINE)[SCM_SUPPORT_STATIC_ALLOCATION]: Provide
	  a declaration for FNAME since the last argument to
	  `SCM_IMMUTABLE_SUBR ()' refers to it.

2009-11-04  Neil Jerram  <neil@ossau.uklinux.net>

	Fill code coverage holes in continuations.c and keywords.c
	* test-suite/Makefile.am (SCM_TESTS): Add tests/keywords.test.

	* test-suite/standalone/Makefile.am (test-loose-ends): New test.

	* test-suite/standalone/test-loose-ends.c: New file.

	* test-suite/tests/continuations.test: Three new tests.

	* test-suite/tests/keywords.test: New file.

2009-11-03  Neil Jerram  <neil@ossau.uklinux.net>

	Increase benchmark iterations to improve precision in comparisons over time
	* benchmark-suite/benchmarks/continuations.bm: Increase "call/cc"
	  iterations from 300 to 12000.

	* benchmark-suite/benchmarks/srfi-13.bm ("strings"): Increase "copy"
	  iterations from 1100 to 20000, and "pad" from 6800 to 34000.

	* benchmark-suite/benchmarks/uniform-vector-read.bm
	  ("uniform-vector-read!"): Increase "uniform-vector-write" iterations
	  from 500 to 4000, and "uniform-vector-read!" from 500 to 20000.

2009-11-02  Ludovic Courtès  <ludo@gnu.org>

	Allocate vectors in a contiguous memory area.
	* libguile/vectors.c (scm_c_make_vector): Allocate the whole vector and
	  header with `scm_gc_malloc ()'.
	  (scm_vector_copy): Use `scm_c_make_vector ()'.
	  (scm_i_vector_free, MAKE_WEAK_VECTOR): Remove.
	  (allocate_weak_vector): Rename to...
	  (make_weak_vector): ... this.  Change to return the whole weak vector,
	  allocated with `scm_gc_malloc_pointerless ()'.
	  (scm_i_make_weak_vector, scm_i_make_weak_vector_from_list): Use
	  `make_weak_vector ()'.

	* libguile/vectors.h (SCM_I_VECTOR_HEADER_SIZE): New macro.
	  (SCM_I_VECTOR_ELTS): Write in terms of `SCM_I_VECTOR_WELTS ()'.
	  (SCM_I_VECTOR_WELTS): Update to the new representation.
	  (SCM_I_WVECT_EXTRA, SCM_I_SET_WVECT_EXTRA): Likewise.
	  (SCM_I_WVECT_GC_CHAIN, SCM_I_SET_WVECT_GC_CHAIN): Remove.

	* libguile/weaks.h (SCM_I_WVECT_DELTA, SCM_I_SET_WVECT_DELTA): Remove.

2009-11-01  Ludovic Courtès  <ludo@gnu.org>

	Restore signature of `scm_search_path ()' as found in 1.8.
	The incompatibly was introduced by
	22f4ee48822db5e30df3abf9a11b6066f2bab9d3 ("make primitive-load-path load
	compiled files if available").

	* doc/ref/api-options.texi (Build Config): Update `search-path'
	  documentation.

	* libguile/load.c (scm_search_path): Change C prototype to expect only 3
	  arguments.  Parse the rest argument accordingly.  Update callers.

	* libguile/load.h (scm_search_path): Update accordingly.

2009-11-01  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'bdw-gc-static-alloc'
	Conflicts:
		acinclude.m4
		libguile/__scm.h
		libguile/bdw-gc.h
		libguile/eval.c

2009-10-30  Ken Raeburn  <raeburn@raeburn.org>

	Clean up some uses of old GC macros that don't exist any more.
	* libguile/deprecated.h (SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK):
	  Delete.
	* libguile/gc.c (scm_assert_cell_valid): Remove check of SCM_GC_MARK_P.

2009-10-30  Ken Raeburn  <raeburn@raeburn.org>

	Since support for "futures" in C has been completely disabled for some time, and should be easily implementable in Scheme with the current thread support, delete the C code.
	* libguile/futures.c, libguile/futures.h: Delete.
	* libguile/Makefile.am (libguile_la_SOURCES, DOT_X_FILES,
	  DOT_DOC_FILES, modinclude_HEADERS): Delete references to futures.*
	  files.

	* libguile.h: Don't include futures.h.
	* libguile/eval.c: Don't include futures.h.
	  (isymnames): Delete "#@future" entry.
	  (scm_m_future, s_future, scm_sym_future, unmemoize_future,
	  unmemoize_builtin_macro): Delete disabled futures code.
	* libguile/eval.i.c (CEVAL): Delete disabled futures code.
	* libguile/init.c: Don't include futures.h.
	  (scm_i_init_guile): Delete disabled futures initialization call.
	* libguile/tags.h (SCM_IM_FUTURE): Delete.
	  (SCM_IM_CALL_WITH_VALUES, SCM_IM_ELSE, SCM_IM_ARROW,
	  SCM_IM_NIL_COND, SCM_IM_BIND): Renumber.

	* doc/ref/api-scheduling.texi: Delete commented-out node on Futures.
	* doc/maint/guile.texi: Delete make-future and future-ref mentions.

2009-10-30  Ken Raeburn  <raeburn@raeburn.org>

	* meta/gdb-uninstalled-guile.in: Specify a path to libtool.

	Fix autogen.sh for Mac OS X.
	* autogen.sh: If uname indicates that the OS is Darwin, run "glibtool"
	  instead of "libtool" for the version number check.

2009-10-28  Michael Gran  <spk121@yahoo.com>

	Fix incorrect display of wide strings in decompilation
	A byte ordering error caused incorrect display of wide strings
	when using the ",c" decompilation from the REPL.

	* module/language/assembly/decompile-bytecode.scm (decode-bytecode):
	  wide strings are encoded in native endianness

2009-10-28  Michael Gran  <spk121@yahoo.com>

	Modify bytevectors/string conversions to allow wide strings
	The bytevector to string conversion functions were accomplished
	by converting via locale strings.  This did not allow conversions
	of wide strings in an 8-bit locale.  This is avoided by using knowledge
	of the storage format of the string.

	* libguile/bytevectors.c (STRING_TO_UTF, scm_string_to_utf8): modify
	  string to bytevector conversion to use internal string information
	  (UTF_TO_STRING, scm_utf8_to_string): modify bytevector to string
	  conversion

2009-10-27  Mark H Weaver  <mhw@netris.org>

	fix nil handling in the vm
	* libguile/vm-i-scheme.c (not, not-not): Treat nil as false.
	  (null?, not-null?): Treat nil as null.

	* libguile/vm-i-system.c (br-if, br-if-not): Treat nil as false.
	  (br-if-null, br-if-not-null): Treat nil as null.

2009-10-27  Mark H Weaver  <mhw@netris.org>

	the cube of lisp booleans (#f nil () #t)
	 * Renumbers the IFLAG constants.

	 * Adds several macros related to boolean type tests, null tests, and
	   boolean-truth testing (including lisp-style boolean-truth tests).

	 * Adds compile-time checks to verify the necessary IFLAG numbering
	   properties needed for the checks to work properly.

	 * Changes some existing code to use the new optimized macros, without
	   changing the semantics of the code at all (except that scm_is_bool
	   is changed from a function to a macro).

	I added the following macros, whose names explicitly state how %nil
	should be handled.  See the comments in the patch for more information
	about these.

	  scm_is_false_assume_not_lisp_nil  scm_is_true_assume_not_lisp_nil
	  scm_is_false_and_not_lisp_nil     scm_is_true_or_lisp_nil
	  scm_is_false_or_lisp_nil          scm_is_true_and_not_lisp_nil

	  scm_is_lisp_false                 scm_is_lisp_true

	  scm_is_null_assume_not_lisp_nil
	  scm_is_null_and_not_lisp_nil
	  scm_is_null_or_lisp_nil

	  scm_is_bool_and_not_lisp_nil
	  scm_is_bool_or_lisp_nil

	The following already-existing macros are defined as aliases, such
	that their semantics is unchanged (although scm_is_bool used to be a
	function and is now a macro).

	  scm_is_null   -->  scm_is_null_and_not_lisp_nil
	  scm_is_false  -->  scm_is_false_and_not_lisp_nil
	  scm_is_true   -->  scm_is_true_or_lisp_nil
	  scm_is_bool   -->  scm_is_bool_and_not_lisp_nil

	(I still believe that these should be changed to versions that handle
	 %nil properly, but await approval on that point, so these patches do
	 not make those changes)

	Also, if the preprocessor macro SCM_ENABLE_ELISP is not true (this
	macro already existed and was used in lang.h), all overheads
	associated with %nil handling are eliminated from the above macros.

	* libguile/tags.h (SCM_BOOL_F, SCM_BOOL_T, SCM_UNSPECIFIED)
	  (SCM_UNDEFINED, SCM_UNBOUND, SCM_ELISP_NIL): Renumber, so that a
	  number of important distinctions (false versus true, end-of-list, etc)
	  can be made by masking a single bit. Also define a number of
	  build-time tests to assert that this condition holds.

	* libguile/boolean.h (scm_is_false_and_not_nil, scm_is_true_or_nil)
	  (scm_is_false_assume_not_nil, scm_is_true_assume_not_nil):
	  (scm_is_false_or_nil, scm_is_true_and_not_nil)
	  (scm_is_bool_or_nil, scm_is_bool_and_not_nil): New exciting macros to
	  test certain boolean/end-of-list properties.
	  (scm_is_false, scm_is_true): Use a restrictive definition, where only
	  SCM_BOOL_F is false. Should probably change in the future.
	  (scm_is_bool): Incompatible change: changed to be a macro. Was a
	  function before. Probably should allow nil as a boolean, but that will
	  be for a later patch.
	  (scm_is_lisp_false, scm_is_lisp_true): New macros, implementing the
	  standard Lisp boolean predicates, where '() is actually false.

	* libguile/eval.i.c (CEVAL): Fix a number of false-or-nil and similar
	  tests to use the new macros.

	* libguile/lang.h (SCM_NULL_OR_NIL_P): Use scm_is_null_or_nil.

	* libguile/pairs.c: Add a compile-time check that null and nil differ by
	  only one bit.

	* libguile/pairs.h (scm_is_null_and_not_nil, scm_is_null_assume_not_nil)
	  (scm_is_null_or_nil): New exciting macros!
	  (scm_is_null): Just be scm_is_null_and_not_nil, for now.

	* libguile/print.c: Adapt to the reordering, and print suitably nasty
	  things for the not-to-be-used values.

2009-10-27  Ludovic Courtès  <ludo@gnu.org>

	Use proper fold/for-each function types in `hashtab.h'.
	* libguile/hashtab.h (scm_t_hash_fold_fn, scm_t_hash_handle_fn): New
	  types.
	  (scm_internal_hash_fold, scm_internal_hash_for_each_handle): Use them.

	* libguile/hashtab.c (scm_internal_hash_fold): Take an
	  `scm_t_hash_fold_fn'.  Update callers.
	  (scm_internal_hash_for_each_handle): Take an `scm_t_hash_handle_fn'.
	  Update callers.

2009-10-27  Ludovic Courtès  <ludo@gnu.org>

	Use proper assoc/hash function types in `hashtab.c'.
	This is a followup to d587c9e8b27219e68f8813fb648fc6913c93be0f ("Use
	proper types for hash/assoc functions in `hashtab.h'.").

	* libguile/hashtab.c (scm_i_rehash, scm_hash_fn_create_handle_x,
	  scm_hash_fn_ref, scm_hash_fn_set_x, scm_hash_fn_remove_x): Use
	  `scm_t_hash_fn' and `scm_t_assoc_fn' as appropriate.

2009-10-27  Andy Wingo  <wingo@pobox.com>

	update procedure docs for programs, lambda*, case-lambda
	* module/system/vm/program.scm: Export the arity things again, and
	  program-arity. Why not.

	* doc/ref/api-procedures.texi (Compiled Procedures): Update for current
	  API.
	  (Optional Arguments): Update to assume lambda* and define* are always
	  available, and (ice-9 optargs) is now the ghetto.
	  (Case-lambda): Now here, moved from SRFI-16 docs. Also docs
	  case-lambda*.

	* doc/ref/srfi-modules.texi: Point to core case-lambda docs.

2009-10-26  Andy Wingo  <wingo@pobox.com>

	implement #:predicate
	will be useful for making e.g. typecase-lambda. Tough to tell though.

	* module/ice-9/psyntax.scm (lambda-formals, lambda*-formals): Parse out
	  a #:predicate, which goes right before the rest args. The vanilla
	  lambda doesn't parse it out of course, but it does return another
	  value.
	  (chi-lambda-case, lambda*, lambda): Expand and pass the predicate on
	  to build-lambda-case.

	* module/ice-9/psyntax-pp.scm: Regenerate.

	* module/language/tree-il/compile-glil.scm (flatten): Compile a failing
	  predicate without an else clause into a call to `error'. Also, fix
	  something the compile warnings caught.

2009-10-26  Ludovic Courtès  <ludo@gnu.org>

	Don't use memset(3) after `GC_MALLOC ()' calls.
	* libguile/gc-malloc.c (scm_gc_calloc): Don't use memset(3) as it's not
	  needed.  Reported by Andy Wingo.

2009-10-25  Julian Graham  <julian.graham@aya.yale.edu>

	Resolve warning in gcc-4.3 about transposed parameters passed to memset
	* libguile/gc-malloc.c (scm_gc_calloc): Add explicit check on size parameter

2009-10-25  Ludovic Courtès  <ludo@gnu.org>

	SRFI-35: Provide nice vtable names, to make GOOPS happier.
	* module/srfi/srfi-35.scm (%make-condition-type): New procedure.
	  (make-condition-type, make-compound-condition-type): Use it.

	* test-suite/tests/srfi-35.test ("condition
	  types")["struct-vtable-name"]: New test.

2009-10-25  Ludovic Courtès  <ludo@gnu.org>

	Fix GOOPS `class-of' for nameless structs.
	* libguile/goops.c (scm_class_of): Fix second argument for
	  `scm_make_extended_class_from_symbol ()' for nameless structs.

	* test-suite/tests/goops.test ("classes for built-in types")["struct
	  vtable"]: New test case.

2009-10-25  Andy Wingo  <wingo@pobox.com>

	srfi-16 just re-exports psyntax's case-lambda
	* module/srfi/srfi-16.scm (case-lambda): Just re-export the core's
	  case-lambda, it's semantically the same but faster and better
	  integrated.

2009-10-25  Andy Wingo  <wingo@pobox.com>

	case-lambda, case-lambda* in psyntax
	* module/ice-9/psyntax.scm (case-lambda, case-lambda*): Add
	  implementations of these, present in the base environment.

	* module/ice-9/psyntax-pp.scm: Regenerated.

	* module/srfi/srfi-16.scm (case-lambda): Replace the core's case-lambda
	  definition with our own. We're not quite ready to switch yet.

2009-10-25  Andy Wingo  <wingo@pobox.com>

	assembly/disassembly support for br-if-nargs-*
	* module/language/assembly/compile-bytecode.scm (write-bytecode): Handle
	  br-if-nargs compilation.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  And decompile them nicely as well.

	* module/language/assembly/disassemble.scm (code-annotation): And,
	  present the disassembly if br-if-nargs-* nicely.

2009-10-25  Andy Wingo  <wingo@pobox.com>

	arities can have noncontiguous starts and ends
	* module/language/glil/compile-assembly.scm (open-arity, close-arity)
	  (begin-arity, glil->assembly): Refactor so that arities can have
	  noncontiguous starts and ends. So within a prelude there is no arity
	  -- only before (the previous arity) or after (the new arity).

	* module/system/vm/program.scm (arity:end): Add this private accessor.
	  Arities are expected to be in the new format. While not a change in
	  objcode format, it is an incompatible change, so I'll bump the objcode
	  cookie.
	  (program-arity): Check that the ip is within both bounds of the arity.

	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

	* libguile/programs.c (scm_i_program_arity): Update for new arity format.

	* module/system/vm/frame.scm (vm-frame-arguments): Avoid throwing an
	  error in this function, which is called from the backtrace code.

2009-10-25  Andy Wingo  <wingo@pobox.com>

	refactor psyntax.scm's treatment of lambda and lambda*
	* module/ice-9/psyntax.scm (lambda-formals, chi-simple-lambda)
	  (lambda*-formals, chi-lambda-case): Refactor the lambda
	  transformations with an eye to being able to do case-lambda.

	* module/ice-9/psyntax-pp.scm: Regenerated.

	* test-suite/tests/syntax.test: Adapted tests so that the errors we
	  expect match what is given by psyntax.

2009-10-24  Andy Wingo  <wingo@pobox.com>

	define* in psyntax
	* module/ice-9/optargs.scm:
	* module/ice-9/psyntax-pp.scm:
	* module/ice-9/psyntax.scm: Make define* available in the default
	  environment, as lambda* is available there.

	procedure property table is only key-weak, not doubly-weak
	* libguile/procprop.c: Make the procedure property table only key-weak.
	  It seems that we want the association as long as the key is around.

2009-10-23  Ken Raeburn  <raeburn@raeburn.org>

	Reduce some errors under -DSCM_DEBUG=1.
	* goops.c (scm_sys_modify_instance, scm_sys_modify_class): Use
	SCM_{,SET_}CELL_WORD_[01] instead of SCM_{,SET}C[AD]R since the
	objects passed are not pairs.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	(ice-9 optargs) based on the new lambda* work
	* module/ice-9/optargs.scm (let-optional, let-optional*, let-keywords)
	  (let-keywords*): Implement in terms of parse-lambda-case, so all the
	  logic is in one place.
	  (lambda*): Re-export from the default environment -- it's all in the
	  VM now :-))
	  (define*, define*-public, defmacro*, defmacro*-public): Implement with
	  syntax-case.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	lambda* in psyntax
	* module/ice-9/psyntax.scm (build-lambda-case): Take an "inits" arg.
	  Also work around a nasty memoizer bug: see
	  http://article.gmane.org/gmane.lisp.guile.devel/9561.
	  (lambda*): Implement in psyntax, in the default environment. Exciting
	  stuff!

	* module/ice-9/psyntax-pp.scm: Regenerated.

	* module/ice-9/optargs.scm (parse-lambda-case): Helper for lambda* when
	  we're running under the interpreter.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	separate "inits" field in <lambda-case>; compile fixes for inits, kwargs
	* module/language/tree-il.scm (<lambda-case>): Add "inits" field, so we
	  don't have to parse it out of opt and kw. Adapt the traversal
	  procedures.
	* module/language/tree-il/analyze.scm (analyze-lexicals): Analyze
	  lexicals in the <lambda-case> init expressions as well. Fix keyword
	  allocation.

	* module/language/tree-il/compile-glil.scm (compile-glil): Adapt to
	  make-lambda-case change.
	  (flatten): Adapt to "inits" slot, actually init uninitialized args,
	  and fix bugs related to keyword arguments.

	* module/language/tree-il/inline.scm (inline!): Adapt a little bit --
	  but with no effect.

	* module/language/glil/compile-assembly.scm (glil->assembly): Flesh out
	  <glil-kw-prelude> compilation some more. Add a "bound?" op for
	  <glil-lexical>, which will push #t if the local is bound.

	* module/ice-9/psyntax.scm (build-simple-lambda, build-lambda-case):
	  Update for new signature of make-lambda-case.
	* module/ice-9/psyntax-pp.scm: Regenerated.

	* module/language/brainfuck/compile-tree-il.scm (compile-body):
	* module/language/ecmascript/compile-tree-il.scm (comp):
	* test-suite/tests/tree-il.test ("lambda"): Update for new lambda-case
	  syntax.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	add some optargs tests
	* libguile/modules.c (scm_module_lookup, scm_lookup): Throw to
	  'unbound-variable, like eval.i.c does.

	* test-suite/tests/optargs.test: Add an optargs test. Run optargs tests
	  under both the VM and the interpreter.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	vm support for optional/kwarg init code, and bugfixes
	* libguile/vm-i-system.c (local-bound?, long-local-bound?)
	  (variable-bound?): New instructions, push #f unless the local is
	  bound. You can get unbound locals from optional arguments.
	  (bind-optionals/shuffle): A number of bugfixes.
	  (bind-kwargs): Bugfixes. If we enocunter an improper kwarg list but
	  the procedure has a rest argument, just stop kwarg processing, but
	  without an error.
	  Renumbered ops.

	* libguile/_scm.h (SCM_OBJCODE_MAJOR_VERSION): Bump.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	more work towards compiling and interpreting keyword args
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bumparoo
	* libguile/vm-i-system.c (push-rest, bind-rest): Logically there are
	  actually two rest binders -- one that pops, conses, and pushes, and
	  one that pops, conses, and local-sets. The latter is used on keyword
	  arguments, because the keyword arguments themselves have been shuffled
	  up on the stack. Renumber ops again.

	* module/language/tree-il/compile-glil.scm (flatten): Attempt to handle
	  compilation of lambda-case with keyword arguments. Might need some
	  help.

	* module/ice-9/psyntax.scm (build-lambda-case): An attempt to handle the
	  interpreted case correctly. This might need a couple iterations, but
	  at least it looks like the compile-glil code.

	* module/ice-9/psyntax-pp.scm: Regenerated.

	* module/language/glil.scm (<glil>): Rename "rest?" to "rest" in
	  <glil-opt-prelude> and <glil-kw-prelude>, as it is no longer a simple
	  boolean, but if true is an integer: the index of the local variable to
	  which the rest should be bound.

	* module/language/glil/compile-assembly.scm (glil->assembly): Adapt to
	  "rest" vs "rest?". In the keyword case, use "bind-rest" instead of
	  "push-rest".

	* test-suite/tests/tree-il.test: Update for opt-prelude change.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	finish support for optional & keyword args; update ecmascript compiler
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
	* libguile/vm-i-system.c (br-if-nargs-ne, br-if-args-lt)
	  (br-if-nargs-gt): New instructions, for use by different lambda cases.
	  (bind-optionals, bind-optionals/shuffle, bind-kwargs): New
	  instructions, for binding optional and keyword arguments. Renumber
	  other ops.

	* module/language/ecmascript/compile-tree-il.scm (comp, comp-body):
	  Update for new tree-il. Use the new optional argument mechanism
	  instead of emulating it with rest arguments.

	* module/language/glil/compile-assembly.scm (glil->assembly): Tweaks for
	  optional and keyword argument compilation.

	* module/language/tree-il.scm (parse-tree-il, unparse-tree-il): Make the
	  else case optional, in the s-expression serialization of tree-il.

	* module/language/tree-il/compile-glil.scm (flatten): Handle all of the
	  lambda-case capabilities.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	fix brainfuck for new tree-il, and add tests
	* test-suite/Makefile.am:
	* test-suite/tests/brainfuck.test: Add a brainfuck test.

	* module/system/base/compile.scm: Also export read-and-compile.

	* module/language/tree-il/spec.scm (join): Fix the joiner in the
	  0-expression case.

	* module/language/tree-il/primitives.scm (+): Recognize (+ x -1) as 1-.

	* module/language/brainfuck/parse.scm (read-brainfuck): Return EOF if we
	  actually received EOF, and there were no expressions read.

	* module/language/brainfuck/compile-tree-il.scm (compile-body): Fix the
	  compiler for the new format of "lambda" in tree-il.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	tree-il support for case-lambda
	* module/language/tree-il.scm (<lambda>, <lambda-case>): Split lambda
	  into the lambda itself, denoting the procedure, and lambda-case,
	  denoting a particular arity case. Lambda-case is fairly featureful,
	  and has not yet been fully tested.
	  (<let-values>): Use a <lambda-case> as the binding expression. Seems
	  to suit the purpose well.
	  Adapt parsers, unparsers, traversal operators, etc. Sometimes in this
	  first version we assume there are no optional args, rest args, or a
	  predicate.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Adapt for the
	  new case-lambda regime. Fairly well commented. It actually simplifies
	  things.
	  (report-unused-variables): Update for new tree-il.

	* module/language/tree-il/compile-glil.scm: Adapt for the new tree-il.
	  There are some first stabs here at proper case-lambda compilation, but
	  they are untested as of yet.

	* module/language/tree-il/inline.scm (inline!): Rework so we can
	  recurse on a single node; though these transformations are strictly
	  reductive, so they should complete in bounded time. Simplify
	  accordingly, and adapt to case-lambda. Oh, and we handle lambda->let
	  in not just the nullary case.

	* module/ice-9/psyntax.scm (build-simple-lambda, build-case-lambda)
	  (build-lambda-case): New constructors. The idea is that after syntax
	  expansion, we shouldn't have to deal with improper lists any more.
	  Build-simple-lambda is a shortcut for the common case. The others are
	  not fully exercised yet. Adapt callers.
	  (syntax): Add some debugging in the lambda case. I don't fully
	  understand this, but in practice we don't seem to see rest args here.
	  (lambda): Inline chi-lambda-clause, and adapt for build-simple-lambda.
	* module/ice-9/psyntax-pp.scm: Regenerated.

	* test-suite/tests/tree-il.test: Update tests for new tree-il lambda
	  format, and to expect post-prelude labels for all glil programs.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	procedure property efficiency tweak
	* libguile/procprop.c (scm_procedure_property)
	  scm_set_procedure_property_x): Fix to not call
	  scm_procedure_properties(), and thus to avoid consing up the arity as
	  well.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	flesh out glil support for optional and keyword arguments
	* libguile/vm-i-system.c (bind-rest): Renamed from push-rest-list.
	  (reserve-locals): Change so that instead of reserving space for some
	  additional number of locals, reserve-locals takes the absolute number
	  of locals, including the arguments.

	* module/language/glil.scm (<glil-std-prelude>, <glil-opt-prelude>)
	  (<glil-kw-prelude>): New GLIL constructs, to replace <glil-arity>.

	* module/language/glil/compile-assembly.scm (glil->assembly): Compile
	  the new preludes. Some instructions are not yet implemented, though.

	* module/language/tree-il/analyze.scm (analyze-lexicals): The nlocs for
	  a lambda will now be the total number of locals, including arguments.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Update to
	  write the new prelude.

	* module/system/vm/program.scm (program-bindings-for-ip): If a given
	  index doesn't have a binding at the ip given, don't cons it on the
	  resulting list.

	* test-suite/tests/tree-il.test: Update for GLIL changes.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	de-nargs struct scm_objcode; procedure-property refactor
	* libguile/objcodes.h (struct scm_objcode): Remove nargs, nrest, and
	  nlocs, as they are no longer needed. Also obviates the need for a
	  padding word.

	* libguile/procs.c (scm_thunk_p): Use scm_i_program_arity for programs.

	* libguile/procprop.c (scm_i_procedure_arity): Use scm_i_program_arity
	  for programs.
	  (scm_procedure_properties, scm_set_procedure_properties_x)
	  (scm_procedure_property, scm_set_procedure_property_x): Rework so that
	  non-closure properties are stored directly in a weak hash, instead of
	  needing a weak hash of "stand-in" closures to hold the properties. Fix
	  docstrings also.

	* libguile/root.h (scm_stand_in_procs): Remove from the scm_sys_protects
	  set. Actually with libGC, we should be able to store the elements of
	  scm_sys_protects directly as global variables.
	* libguile/gc.c (scm_init_storage): Remove scm_stand_in_procs
	  initialization.

	* libguile/programs.c (scm_i_program_arity): New private accessor, tries
	  to determine the "minimum arity" of a program.

	* libguile/vm.c (really_make_boot_program): Adapt to changes in
	  struct scm_objcode.

	* module/language/assembly.scm (*program-header-len*, byte-length):
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  Adapt to changes in objcode.

	* module/system/xref.scm (program-callee-rev-vars): Adapt to changes in
	  assembly.

	* module/language/glil.scm: Remove nargs, nrest, and nlocs from
	  glil-program.

	* module/language/glil/compile-assembly.scm (make-meta, glil->assembly):
	* module/language/glil/decompile-assembly.scm (decompile-toplevel):
	  (decompile-load-program): Adapt to changes in GLIL and assembly.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Adapt to
	  changes in GLIL.

	* test-suite/tests/asm-to-bytecode.test: Adapt to assembly and bytecode
	  changes.
	* test-suite/tests/tree-il.test: Adapt to GLIL changes.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	callees now check their args, cons rest list, reserve locals
	* gdbinit: Ignore SIGPWR and SIGXCPU, which the BDW GC seems to use.

	* libguile/vm-engine.h (FETCH_WIDTH): Remove unused macro.
	  (INIT_ARGS, INIT_FRAME): Remove; callees now check their args and
	  reserve space for their locals.

	* libguile/vm-engine.c:
	* libguile/vm-i-system.c: Turn on callee arg checking and local
	  reservation. Seems to work!

2009-10-23  Andy Wingo  <wingo@pobox.com>

	callees reserve their own local vars
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
	* libguile/vm-i-system.c (reserve-locals): New instruction, to reserve
	  space for local vars. Other ops renumbered.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Emit
	  reserve-locals instructions as necessary.

	* test-suite/tests/tree-il.test: Update to expect reserve-locals as
	  appropriate.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	runtime and debugging support for callee-parsed procedure args
	* libguile/objcodes.h: Bump for metadata format change.

	* libguile/frames.h: Rework so we don't frob the program's nargs, nlocs,
	  etc at runtime. Instead we don't really know what's a local var, an
	  argument, or an intermediate value. It's a little unfortunate, but
	  this will allow for case-lambda, and eventually for good polymorphic
	  generic dispatch; and the nlocs etc can be heuristically
	  reconstructed. Such a reconstruction would be better done at the
	  Scheme level, though.
	  (SCM_FRAME_STACK_ADDRESS): New macro, the pointer to the base of the
	  stack elements (not counting the program).
	  (SCM_FRAME_UPPER_ADDRESS): Repurpose to be the address of the last
	  element in the bookkeeping part of the stack -- i.e. to point to the
	  return address.

	* libguile/vm-engine.h:
	* libguile/vm-i-system.c: Adapt to removal of stack_base. Though we
	  still detect stack-smashing underflow, we don't do so as precisely as
	  we did before, because now we only detect overwriting of the frame
	  metadata.

	* libguile/vm-engine.c (vm_engine): Remove the stack_base variable. It
	  is unnecessary, and difficult to keep track of in the face of
	  case-lambda. Also fix miscommented "ra" and "mvra" pushes. Push the
	  vp->ip as the first ra...
	* libguile/vm-i-system.c (halt): ...because here we can restore the
	  vp->ip instead of setting ip to 0. Allows us to introspect ips all
	  down the stack, including in recursive VM invocations.

	* libguile/frames.h:
	* libguile/frames.c (scm_vm_frame_stack): Removed, because it's getting
	  more difficult to tell what's an argument and what's a temporary stack
	  element.
	  (scm_vm_frame_num_locals): New accessor.
	  (scm_vm_frame_instruction_pointer): New accessor.
	  (scm_vm_frame_arguments): Defer to an implementation in Scheme.
	  (scm_vm_frame_num_locals scm_vm_frame_local_ref)
	  (scm_vm_frame_local_set_x): Since we can get not-yet-active frames on
	  the stack now, with our current calling convention, we have to add a
	  heuristic here to jump over those frames -- because frames have
	  pointers in them, not Scheme values.

	* libguile/programs.h:
	* libguile/programs.c (scm_program_arity): Remove, in favor of..
	  (scm_program_arities): ...this, which a list of arities, in a new
	  format, occupying a slot in the metadata.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Fix mv-call decompilation.

	* module/system/vm/frame.scm (vm-frame-bindings, vm-frame-binding-ref)
	  (vm-frame-binding-set!): New functions, to access bindings by name in
	  a frame.
	  (vm-frame-arguments): Function now implemented in Scheme. Commented
	  fairly extensively.

	* module/system/vm/program.scm (program-bindings-by-index)
	  (program-bindings-for-ip): New accessors, parsing the program bindings
	  metadata into something more useful.
	  (program-arities, program-arguments): In a case-lambda world, we have
	  to assume that programs can have multiple arities. But it's tough to
	  detect this algorithmically; instead we're going to require that the
	  program metadata include information about the arities, and the parts
	  of the program that that metadata applies to.
	  (program-lambda-list): New accessor.
	  (write-program): Show multiple arities.

	* module/language/glil/compile-assembly.scm (glil->assembly): Add
	  "arities" to the state of the compiler, and add arities entries as
	  appropriate.

2009-10-23  Andy Wingo  <wingo@pobox.com>

	steps on the way to have the callee check the number of arguments
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

	* libguile/vm-i-system.c (assert-nargs-ee, assert-nargs-ge)
	  (push-rest-list): New instructions, which for now don't actually do
	  anything. Renumber the rest of the ops in this file.

	* module/language/glil.scm (<glil-arity>): New GLIL type, an entity that
	  checks the number of args for a block, optionally consing a rest list,
	  and either branching or erroring if the arity doesn't match.

	* module/language/glil/compile-assembly.scm (glil->assembly): Compile
	  <glil-arity> to assembly. Some of these VM ops are not implemented --
	  notably the branching case.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Emit
	  <glil-arity>.

	* test-suite/tests/tree-il.test: Update.

2009-10-22  Ludovic Courtès  <ludo@gnu.org>

	Compile Guile modules with `-Wunbound-variable'.
	* am/guilec (.scm.go): Compile with `-Wunbound-variable'.

2009-10-22  Ludovic Courtès  <ludo@gnu.org>

	Fix typos leading to unbound variable references.
	* module/ice-9/session.scm (help): Fix unbound reference to `env'.

	* module/system/vm/program.scm (program-property): Fix typo.

	* module/system/vm/frame.scm: Add missing `#:use-module (system vm
	  objcode)'.

	* module/system/repl/command.scm (guile:load): New.
	  (load): Use either `primitive-load' or `load'.

	* module/srfi/srfi-18.scm (thread-sleep!): Fix typo.

	* module/srfi/srfi-19.scm: Use `(ice-9 rdelim)'.
	  (date->broken-down-time, priv:year-day, priv:char->int): Fix typo.
	  (time-*->time-*, time-*->time-*!): Fix reference to unbound variable
	  `caller'.

	* module/oop/goops.scm (bound-check-get): Fix typo.

	* module/language/glil/compile-assembly.scm (glil->assembly): Fix typo.

	* module/language/glil.scm (parse-glil): Fix typo.

	* module/language/ecmascript/base.scm (object->value/string,
	  object->value/number, ->number): Fix typos.

	* module/language/assembly/disassemble.scm (disassemble-free-vars): Fix
	  typo.

2009-10-22  Ludovic Courtès  <ludo@gnu.org>

	Adjust `unbound-variable' GOOPS heuristic for `goops.scm'.
	* module/language/tree-il/analyze.scm (goops-toplevel-definition): Add
	  ENV argument.  Deal with GOOPS macros expanded within `goops.scm'.
	  (report-possibly-unbound-variables): Adjust.

	Fix bytecode disassembler.
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Add missing argument to `ensure-label'.

	SRFI-88: Call `read-set!' at compile time and run time.
	* module/srfi/srfi-88.scm: Call `read-set!' both at compile time and run
	  time.

	Remove obsolete `save-stack' case.
	* module/ice-9/boot-9.scm (save-stack): Remove obsolete `tk-stack' case.

2009-10-22  Ludovic Courtès  <ludo@gnu.org>

	Have `-Wunbound-variable' account for GOOPS top-level definitions.
	* module/language/tree-il/analyze.scm (goops-toplevel-definition): New
	  procedure.
	  (report-possibly-unbound-variables): Check for GOOPS top-level
	  definitions.

	* test-suite/tests/tree-il.test ("warnings")["GOOPS definitions are
	  visible"]: New test.

2009-10-21  Ludovic Courtès  <ludo@gnu.org>

	Add a `guile-2' SRFI-0 feature.
	* doc/ref/srfi-modules.texi (SRFI-0): Mention the `guile-2' feature.

	* module/ice-9/boot-9.scm (%cond-expand-features): Add `guile-2'.

2009-10-20  Ludovic Courtès  <ludo@gnu.org>

	Use proper types for hash/assoc functions in `hashtab.h'.
	Partly fixes bug #23681 ("Function declarators with empty parentheses
	should not be used").

	* libguile/goops.c (scm_wrap_component): Cast `scm_sloppy_assq'.

	* libguile/hashtab.c (scm_hash_fn_get_handle): Update to take functions
	  of type `scm_t_hash_fn' and `scm_t_assoc_fn'.  Update callers.
	  (scm_ihashx): Change to match `scm_t_hash_fn'.
	  (scm_sloppy_assx): Change to match `scm_t_assoc_fn'.

	* libguile/hashtab.h (scm_t_hash_fn, scm_t_assoc_fn): New types.
	  (scm_t_hashtable)[hash_fn]: Change to `scm_t_hash_fn'.
	  (scm_i_rehash, scm_hash_fn_get_handle, scm_hash_fn_create_handle_x,
	  scm_hash_fn_ref, scm_hash_fn_set_x, scm_hash_fn_remove_x): Change to
	  take `scm_t_hash_fn' and `scm_t_assoc_fn' parameters.

	* libguile/srcprop.h (scm_whash_get_handle, scm_whash_create_handle,
	  scm_whash_lookup): Implement in terms of `scm_hashq_*' instead of
	  `scm_hash_fn_*'.

	* libguile/struct.c (scm_struct_ihashq): Change to match
	  `scm_t_hash_fn'.
	  (scm_struct_create_handle): Cast `scm_sloppy_assq'.

	* libguile/struct.h (scm_struct_ihashq): Update, make internal.

2009-10-19  Julian Graham  <julian.graham@aya.yale.edu>

	Fix typo in psyntax.scm related to syntax-violation reporting.
	* module/ice-9/psyntax.scm (chi-macro): Replace `s' with `(wrap-subst w)'.

2009-10-19  Ludovic Courtès  <ludo@gnu.org>

	Add support for R6RS/SRFI-30 nested block comments.
	Suggested by Andreas Rottmann <a.rottmann@gmx.at>.

	* libguile/read.c (flush_ws, scm_read_sharp): Add support for
	  R6RS/SRFI-30 block comments.
	  (scm_read_r6rs_block_comment): New function.

	* test-suite/tests/reader.test (exception:unterminated-block-comment):
	  Adjust to match both block comment styles.
	  ("reading")["R6RS/SRFI-30 block comment", "R6RS/SRFI-30 nested block
	  comment", "R6RS/SRFI-30 block comment syntax overridden"]: New tests.
	  ("exceptions")["R6RS/SRFI-30 unterminated nested block comment"]: New
	  test.

	* doc/ref/api-evaluation.texi (Block Comments): Mention SRFI-30/R6RS
	  block comments.

	* doc/ref/srfi-modules.texi (SRFI-30): New node.

2009-10-16  Andy Wingo  <wingo@pobox.com>

	comment fixups to tree-il/compile-glil.scm
	* module/language/tree-il/compile-glil.scm: Remove some outdated
	  comments.

2009-10-16  Andy Wingo  <wingo@pobox.com>

	jumps encoded using 24 bits, not 19; blocks no longer aligned
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.
	* libguile/vm-i-system.c (FETCH_OFFSET, BR): Labels are no longer 8-byte
	  aligned; instead, jumps are encoded into 3 bytes instead of 2.
	  (br, br-if, br-if-not, br-if-eq, br-if-not-eq, br-if-null)
	  (br-if-not-null, mv-call): Adapt for new length of br instructions (3
	  bytes instead of 2).

	* libguile/vm.c (really_make_boot_program): Adapt hand-coded bytecode
	  for new offset regime.

	* module/language/assembly.scm (align-block): No alignment necessary.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
	  out breaks as 24-bit relative jumps.
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Decompile break instructions.

2009-10-16  Andy Wingo  <wingo@pobox.com>

	compilation enviroments are always modules; simplifications & refactorings
	* module/ice-9/boot-9.scm (make-fresh-user-module): New public function,
	  makes an anonymous beautified module.

	* module/language/objcode/spec.scm: We used to have some things in here
	  that allowed lexical variable names and values to be a part of the
	  environment, but no more. Now an environment is just a module. If you
	  want to "inject" free variables into code, just use lambda.

	* module/language/scheme/compile-tree-il.scm (compile-tree-il): Same
	  here. Also, rely on the fact that an environment *will* be a module --
	  because (system base compile) guarantees that for us.

	* module/language/scheme/spec.scm (scheme): In the reader, rely on the
	  environment being a module. Define a #:make-default-environment
	  handler, which returns a beautified module, augmented with a fresh
	  definition for current-reader, so that side effects to current-reader
	  are restricted to the compilation unit.

	* module/language/tree-il/analyze.scm
	  (report-possibly-unbound-variables):
	* module/language/tree-il/compile-glil.scm (compile-glil):
	* module/language/tree-il/optimize.scm (optimize!): The environment will
	  be a module.

	* module/system/base/language.scm (<language>): New field,
	  `make-default-environment'. Defaults to `make-fresh-user-module'.
	  (default-environment): New accessor, returns a default environment for
	  a language.

	* module/system/repl/common.scm (repl-compile): Always compile relative
	  to the current module, because a module is always acceptable as an
	  environment.

	* module/system/base/compile.scm (compile-file, compile-and-load): Both
	  of these have a new keyword argument, #:env. For `compile-file', it
	  defaults to the default environment of the source language, and for
	  `compile-and-load', to the current module.
	  (read-and-compile): If there are no expressions read, pass the joiner
	  its default environment (via `default-environment joint').

2009-10-16  Andy Wingo  <wingo@pobox.com>

	no more *compilation-environment* fluid
	* module/system/base/compile.scm (current-compilation-environment):
	  Remove, as the only thing that needed it (language readers) now get
	  the environment as an argument.
	  (read-and-compile, compile): Rework for no *compilation-environment*,
	  and default the environment using the define* mechanism.

	* module/language/tree-il/analyze.scm (env-module): Hack around the lack
	  of a current compilation module. Will fix this in the next commit so
	  that the environment is always valid.

2009-10-16  Andy Wingo  <wingo@pobox.com>

	language-readers receive environment as an arg
	* module/language/assembly/spec.scm:
	* module/language/brainfuck/spec.scm:
	* module/language/bytecode/spec.scm:
	* module/language/ecmascript/spec.scm:
	* module/language/glil/spec.scm:
	* module/language/scheme/spec.scm:
	* module/language/tree-il/spec.scm: Language-readers now take two
	  arguments: the port and the environment. This should allow for
	  compile-environment-specific reader behavior.

	* module/system/base/compile.scm (read-and-compile):
	* module/system/repl/common.scm (repl-read): Pass the environment to the
	  language-reader.

	* module/system/repl/repl.scm (meta-reader, prompting-meta-read):
	* module/system/repl/command.scm (define-meta-command): Use the second
	  argument to repl-reader, so we avoid frobbing current-reader.

2009-10-16  Andy Wingo  <wingo@pobox.com>

	repl-reader accepts optional "read" argument
	* module/ice-9/boot-9.scm (repl-reader): Accept an optional second
	  argument, the reader to use. If it is given, use it instead of
	  dereferencing the current-reader fluid.

	* guile-readline/ice-9/readline.scm (activate-readline): Make our
	  replacement definition of repl-reader compatible with boot-9.

2009-10-16  Andy Wingo  <wingo@pobox.com>

	remove GHIL, Elisp, and R5RS languages
	GHIL is obsolete, and it's about time we got rid of it. Elisp and R5RS
	were unmodified since their import from Guile-VM, so we ditch them too.

	R5RS compilation is supported via compiling Scheme within an R5RS
	environment.

	Elisp will be supported when we merge in Daniel's work.

2009-10-16  Andy Wingo  <wingo@pobox.com>

	bitvector tweaks
	* libguile/arrays.c (scm_from_contiguous_typed_array):
	* libguile/bytevectors.c (scm_uniform_array_to_bytevector): Error if the
	  uniform element size is more than 8 bits, but not divisible by 8 --
	  because our math could overflow in that case.

	* module/ice-9/deprecated.scm (#\y): Indeed, #* is the valid bitvector
	  syntax :)

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Improve TLS detection for systems with compiler support but no libc support.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Use `AC_LINK_IFELSE'
	  instead of `AC_COMPILE_IFELSE'.

	Bump version number for 1.9.4.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Fix compilation of literal bitvectors.
	* libguile/arrays.c (scm_from_contiguous_typed_array): Fix BYTE_LEN
	  sanity check for bitvectors.

	* test-suite/tests/unif.test ("syntax")["bitvector is self-evaluating"]:
	  New test.

	* module/ice-9/deprecated.scm (#\y): Fix deprecation comment: `#*' is
	  not a read syntax.

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Fix segfault for `(uniform-array->bytevector (bitvector))'.
	* libguile/bytevectors.c (scm_uniform_array_to_bytevector): Fix BYTE_LEN
	  computation for bitvectors.

	* test-suite/tests/bytevectors.test ("uniform-array->bytevector"): New
	  test prefix.

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Fix `gitlog-to-changelog' on NixOS.

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Document the interaction of the "compilee" with the compiler's current module.
	This is a followup to 87c595c757b7db84ffdcfda96f736ab235e674a8 ("Compile
	in a fresh module by default.") and
	f65e2b1ec5ae1962e57322ac3085ab4d44025694 ("Honor and confine
	expansion-time side-effects to `current-reader'.").

	* doc/ref/api-evaluation.texi (Loading): Explain how to change
	  `current-reader' in a compiler-friendly way.

	* doc/ref/compiler.texi (The Scheme Compiler): Explain use of a fresh
	  compilation module and separate `current-reader' fluid.

	* test-suite/tests/compiler.test ("current-reader")["with eval-when"]:
	  New test.

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Fix REPL environment for languages other than scheme.
	* module/system/repl/common.scm (repl-compile): Use `#:env #f' for
	  languages other than scheme.

2009-10-15  Andy Wingo  <wingo@pobox.com>

	signedness fix fix fix
	* libguile/inline.h: Fix signedness fix fix.

	`load' autocompiles -- in the current module.
	* module/ice-9/boot-9.scm (load): Pull `autocompiled-file-name' inside
	  `load', and make it autocompile in the current module. Should fix
	  Julian's issue noted in
	  http://article.gmane.org/gmane.lisp.guile.devel/9483.

	update NEWS for 1.9.4

	fix scm_array_handle_ref signedness fix
	* libguile/inline.h: Fix signedness fix.

	add back support for #y bitvector read syntax
	* module/ice-9/deprecated.scm (#\y): Add deprecated support for
	  #y(1 0 1 ...) bitvectors.

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Use pointer-less memory for `scm_gc_strdup ()'.
	* libguile/gc-malloc.c (scm_gc_strndup): Use `GC_MALLOC_ATOMIC ()'
	  instead of `GC_MALLOC ()'.

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Restore signature of `scm_primitive_load_path ()' as found in 1.8.
	The incompatibility was introduced by
	0fb81f95b0222c5ba49efd3e36cf797df54c0863 ("add exception_on_error
	optional arg to primitive-load-path").

	* libguile/load.c (scm_primitive_load_path): Change to take 1 rest
	  argument.  Interpret the argument as either a file name (C-level
	  backward compatibility with 1.8) or an actual argument list.
	  (scm_c_primitive_load_path): Update caller.

	* libguile/load.h (scm_primitive_load_path): Update accordingly.

	* doc/ref/api-evaluation.texi (Loading): Update documentation of
	  `primitive-load-path' and `scm_primitive_load_path ()'.

2009-10-15  Ludovic Courtès  <ludo@gnu.org>

	Use GC-managed memory for port->encoding.
	* libguile/ports.c (scm_new_port_table_entry): Use `scm_gc_strdup ()'
	  instead of `strdup ()' for `entry->encoding'.
	  (scm_i_set_port_encoding_x): Likewise.  Remove free(3) call.
	  (scm_i_remove_port): Don't explicitly free memory.
	  (scm_unget_byte): Remove outdated and misleading comment.

2009-10-14  Ludovic Courtès  <ludo@gnu.org>

	Fix signed/unsigned mismatch in `scm_array_handle_{ref,set} ()'.
	* libguile/inline.h (scm_array_handle_ref, scm_array_handle_set): Cast
	  `h->base' so that it matches the signedness of `p'.

2009-10-13  Ken Raeburn  <raeburn@raeburn.org>

	Flush output before forking, to make test output consistent and avoid duplication.
	* test-suite/tests/socket.test: Before calling primitive-fork, call
	  force-output on the current output and error ports.

2009-10-13  Andy Wingo  <wingo@pobox.com>

	add $libir to the ltdl path, not $pkglibdir; add extensionsdir
	* libguile/Makefile.am (libpath.h): Fix SCM_LIB_DIR to point to the
	  libdir, not pkglibdir. Add SCM_EXTENSIONS_DIR, for a dir to put in the
	  dynamic-link search path that's not managed by ldconfig or the like;
	  and put this dir in the "extensionsdir" key of %guile-build-info.

	* libguile/dynl.c (sysdep_dynl_init): Rename the installed-libdir
	  environment var to GUILE_SYSTEM_EXTENSIONS_PATH (from
	  GUILE_SYSTEM_LTDL_PATH). Also add SCM_EXTENSIONS_DIR to the ltdl
	  search path in the default case.
	* meta/uninstalled-env.in: Adapt override to match.

	* meta/guile-2.0.pc.in: Add extensionsdir, so you can pkg-config
	  --variable=extensionsdir guile-2.0.

2009-10-12  Michael Gran  <spk121@yahoo.com>

	Modify regexp.test to work better with mac/darwin
	* test-suite/tests/regexp.test (set-latin-1): also add .ISO8859-1 as a
	  possible extension for latin-1 locales.  Use set-latin-1 exclusively
	  to set the locale for tests.

2009-10-09  Michael Gran  <spk121@yahoo.com>

	Revert changes that gather thread-specific local language
	The method used was not portable.  However, the underlying problem
	still exists: the uc_locale_language used by libunistring does not
	work with thread-specific locale_t locales.

	* libguile/i18n.c (locale_language): avoid unpacking semi-opaque type
	  locale_t.

	* test-suite/tests/i18n.test: set Turkish string and char locale upcase
	  and downcase tests to throw untested

2009-10-09  Ludovic Courtès  <ludo@gnu.org>

	Adjust to match changes in libgc's CVS (pre-7.2).
	In libgc CVS the `GC_do_blocking ()' declaration is now public but it
	uses a slightly different signature for its first argument.

	* configure.ac: Check for `GC_fn_type'.

	* libguile/threads.c (GC_fn_type)[HAVE_GC_DO_BLOCKING &&
	  !HAVE_GC_FN_TYPE]: New typedef.
	  (scm_without_guile): Explicitly cast `without_guile_trampoline' to
	  `GC_fn_type'.  This is because the upstream definition currently
	  looks like `typedef void * (extern *GC_fn_type)(void *);', which
	  isn't compatible.

2009-10-09  Ludovic Courtès  <ludo@gnu.org>

	Use TLS when available for `SCM_I_CURRENT_THREAD'.
	* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): New macro.

	* configure.ac: Use it.

	* libguile/__scm.h (SCM_THREAD_LOCAL): New macro.

	* libguile/gen-scmconfig.c (main): Define `SCM_HAVE_THREAD_STORAGE_CLASS'.

	* libguile/gen-scmconfig.h.in (SCM_I_GSC_HAVE_THREAD_STORAGE_CLASS):
	  New.

	* libguile/threads.c
	  (scm_i_current_thread)[SCM_HAVE_THREAD_STORAGE_CLASS]: New.
	  (SET_CURRENT_THREAD): New macro.
	  (guilify_self_1, on_thread_exit, init_thread_key): Use it.

	* libguile/threads.h
	  (scm_i_current_thread)[SCM_HAVE_THREAD_STORAGE_CLASS]: New
	  declaration.
	  (SCM_I_CURRENT_THREAD)[SCM_HAVE_THREAD_STORAGE_CLASS]: New macro.
	  (init_thread_key_once, init_thread_key): Conditionalize on
	  `!defined SCM_HAVE_THREAD_STORAGE_CLASS'.
	  (scm_i_init_thread_for_guile): Update accordingly.

2009-10-09  Ludovic Courtès  <ludo@gnu.org>

	Arrange so that `SCM_I_CURRENT_THREAD' is not accessed outside of libguile.
	* libguile/__scm.h (scm_async_tick): New declaration.
	  (SCM_ASYNC_TICK)[!BUILDING_LIBGUILE]: Use `scm_async_tick ()'.

	* libguile/async.c (scm_critical_section_start,
	  scm_critical_section_end, scm_async_tick): New functions.

	* libguile/async.h (scm_i_critical_section_mutex): Made internal.
	  (scm_critical_section_start, scm_critical_section_end): New
	  declarations.
	  (SCM_CRITICAL_SECTION_START,
	  SCM_CRITICAL_SECTION_END)[!BUILDING_LIBGUILE]: Use the same-named
	  function (lower-case).

	* libguile/stackchk.h (SCM_STACK_OVERFLOW_P): Conditionalize on
	  `BUILDING_LIBGUILE'.

	* libguile/threads.h (SCM_I_CURRENT_THREAD, scm_i_dynwinds,
	  scm_i_set_dynwinds, scm_i_last_debug_frame,
	  scm_i_set_last_debug_frame): Conditionalize on `BUILDING_LIBGUILE'.

2009-10-09  Ludovic Courtès  <ludo@gnu.org>

	Deprecate `scm_mask_ints'.
	* libguile/async.h (scm_mask_ints): Remove.

	* libguile/deprecated.c (scm_i_mask_ints): New.

	* libguile/deprecated.h (scm_mask_ints): New macro.
	  (scm_i_mask_ints): New declaration.

2009-10-07  Neil Jerram  <neil@ossau.uklinux.net>

	Revert "Change dynwind flag enums to #defines, for greater portability"
	This reverts commit b25aa0b9373d2798469e0fe999cd915e8beedc4f.

2009-10-06  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in `scm_array_p_2 ()'.
	* libguile/generalized-arrays.c (scm_array_p_2)[FUNC_NAME]: Fix.

2009-10-06  Ludovic Courtès  <ludo@gnu.org>

	Add compiler warning for possibly unbound variables.
	* module/language/tree-il/analyze.scm (<toplevel-info>): New record
	  type.
	  (env-module, report-possibly-unbound-variables): New procedures.

	* module/language/tree-il/compile-glil.scm (%warning-passes): Add
	  `unbound-variable'.

	* module/system/base/message.scm (%warning-types): Likewise.

	* test-suite/tests/tree-il.test (read-and-compile, %opts-w-unbound):
	  New.
	  ("warnings")["unbound variable"]: New test prefix.

2009-10-06  Ludovic Courtès  <ludo@gnu.org>

	tree-il: Pass the environment to warning passes.
	* module/language/tree-il/analyze.scm (report-unused-variables): Taken a
	  new parameter, ENV.

	* module/language/tree-il/compile-glil.scm (compile-glil): Pass E to
	  individual warning passes.

2009-10-02  Neil Jerram  <neil@ossau.uklinux.net>

	Change dynwind flag enums to #defines, for greater portability
	Thanks to Inge Gutheil for raising this problem.

	* doc/ref/api-control.texi (Dynamic Wind): Remove doc for
	  scm_t_dynwind_flags, and change uses of scm_t_dynwind_flags to int.
	  Mention possible flags inside doc for scm_dynwind_begin instead.
	  Similarly for scm_t_wind_flags.  In this case the doc on possible
	  flags is moved to after the four functions that can use them.

	* libguile/dynwind.c (scm_dynwind_begin): Change scm_t_dynwind_flags
	  to int.
	  (scm_dynwind_unwind_handler): Change scm_t_wind_flags to int.
	  (scm_dynwind_rewind_handler): Ditto.
	  (scm_dynwind_unwind_handler_with_scm): Ditto.
	  (scm_dynwind_rewind_handler_with_scm): Ditto.

	* libguile/dynwind.h (SCM_F_DYNWIND_REWINDABLE): Use #define instead
	  of typedef enum.
	  (SCM_F_WIND_EXPLICITLY): Ditto.
	  (function declarations): Change scm_t_dynwind_flags and
	  scm_t_wind_flags to int.

	* test-suite/standalone/test-unwind.c (check_cont_body): Change
	  scm_t_dynwind_flags to int.

2009-10-02  Ludovic Courtès  <ludo@gnu.org>

	Use `SCM_DEPRECATED' in declarations of deprecated functions/variables.
	* libguile/deprecated.c (SCM_BUILDING_DEPRECATED_CODE): New macro.

	* libguile/async.c (SCM_BUILDING_DEPRECATED_CODE): Likewise.

	* libguile/macros.c (SCM_BUILDING_DEPRECATED_CODE): Likewise.

	* libguile/async.h, libguile/deprecated.h, libguile/eval.h,
	  libguile/gc.h, libguile/gc.h, libguile/macros.h, libguile/ports.h,
	  libguile/srfi-4.h, libguile/strings.h: Change declarations of
	  deprecated functions and variables to use `SCM_DEPRECATED' instead of
	  `SCM_API'.

2009-10-02  Ludovic Courtès  <ludo@gnu.org>

	Add `SCM_DEPRECATED' macro to declare deprecated C functions/variables.
	* libguile/__scm.h (SCM_DEPRECATED): New macro.

2009-10-02  Ludovic Courtès  <ludo@gnu.org>

	Fix the argument list of gsubr stack frames.
	This fixes a bug introduced in e20d7001c3f7150400169fecb0bf0eefdf122fe2
	and reported by Neil.

	* libguile/eval.i.c (CEVAL)[DEVAL]: Don't duplicate ARG1 in
	  `debug.info->a.args' for gsubr stack frames.
	  (scm_apply): Likewise.

	* test-suite/tests/eval.test ("stacks")["arguments of a gsubr stack
	  frame"]: New test.

2009-10-02  Neil Jerram  <neil@ossau.uklinux.net>

	Fix doc for inet-ntop: always produces a string
	Thanks to Scott McPeak for reporting this.

	* libguile/socket.c (scm_inet_ntop): In docstring, add quotes around
	  IPv6 address (+ reflow a bit).

	* doc/ref/posix.texi (Network Address Conversion): Corresponding
	  change.

	* doc/maint/guile.texi: Corresponding change.

2009-10-02  Neil Jerram  <neil@ossau.uklinux.net>

	Fix handling of IPv6 addresses
	Thanks to Scott McPeak for reporting this and providing a patch.

	* libguile/socket.c (scm_to_ipv6): When address is the wrong type,
	  provide more information in the exception message.

	  (scm_to_sockaddr): scm_to_ipv6 expects just an address, not the
	  whole vector.

	* test-suite/tests/socket.test ("AF_INET6/SOCK_STREAM"): New set of
	  tests.

2009-10-01  Neil Jerram  <neil@ossau.uklinux.net>

	Fix incorrect doc mentions of INADDR_LOCALHOST
	Thanks to Scott McPeak for reporting this.

	* doc/ref/posix.texi (Network Sockets and Communication): Change
	  INADDR_LOCALHOST to INADDR_LOOPBACK.

2009-10-01  Neil Jerram  <neil@ossau.uklinux.net>

	Add define-module to signals.test
	* test-suite/tests/signals.test (test-suite): Add define-module form.

	Change signals.test to LGPLv3+
	* test-suite/tests/signals.test: Update licence statement.

	Remove unused environments code and tests
	* libguile/environments.c, libguile/environments.h,
	  test-suite/tests/environments.nottest: Deleted.

2009-09-30  Neil Jerram  <neil@ossau.uklinux.net>

	Fix spurious `throw from within critical section' errors
	The crux of this problem was that the thread doing a throw, and so
	checking scm_i_critical_section_level, was different from the thread
	that was in a critical section.

	* libguile/async.h (scm_i_critical_section_level): Removed, replaced
	  by per-thread critical_section_level.
	  (SCM_CRITICAL_SECTION_START, SCM_CRITICAL_SECTION_END): Use
	  per-thread critical_section_level.

	* libguile/continuations.c (scm_dynthrow): Check per-thread
	  critical_section_level.

	* libguile/threads.c (guilify_self_1): Init per-thread
	  critical_section_level.
	  (scm_i_critical_section_level): Removed.

	* libguile/threads.h (scm_i_thread): New critical_section_level field.

	* libguile/throw.c (scm_ithrow): Check per-thread critical_section_level.

2009-09-30  Neil Jerram  <neil@ossau.uklinux.net>

	Avoid throw from critical section, given invalid sigaction call
	* libguile/scmsigs.c (scm_sigaction_for_thread): Exit critical section
	  before raising out-of-range error.

	* test-suite/Makefile.am (SCM_TESTS): Add signals.test.

	* test-suite/tests/signals.test: New file.

2009-09-28  Ludovic Courtès  <ludo@gnu.org>

	Make `weaks.test' slightly more robust.
	* test-suite/tests/weaks.test (global-weak): Use `string-copy' on all
	  the keys, in case one of them is retained in `scm_source_whash' or
	  similar.

	Improve description of `scm_set_smob_mark ()'.
	* doc/ref/api-smobs.texi (Smobs): Improve description of
	  `scm_set_smob_mark ()'.  Mention malloc(3) regions.

2009-09-28  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded SMOB/port mark/free procedures.
	* libguile/arrays.c (array_mark, array_free): Remove.
	  (scm_init_arrays): Adjust accordingly.

	* libguile/bitvectors.c (bitvector_free): Remove.
	  (scm_c_make_bitvector): Use `scm_gc_malloc_pointerless ()'.
	  (scm_init_bitvectors): Adjust accordingly.

	* libguile/strports.c (scm_make_stptob): Remove `scm_set_port_mark ()'
	  call.

	* libguile/vports.c (scm_make_sfptob): Likewise.

2009-09-28  Ludovic Courtès  <ludo@gnu.org>

	Remove default port/SMOB finalizers.
	* libguile/ports.c (scm_port_free0): Remove.
	  (scm_make_port_type): Set `free' to NULL.

	* libguile/smob.c (scm_make_smob_type): Leave `free' to NULL.
	  (scm_smob_free): Remove.

	* libguile/smob.h (scm_smob_free): Remove.

	* libguile/deprecated.c (scm_smob_free): New.

	* libguile/deprecated.h (scm_smob_free): New declaration.

2009-09-26  Neil Jerram  <neil@ossau.uklinux.net>

	Clean meta/guile-config
	* meta/Makefile.am (CLEANFILES): New, containing guile-config.

2009-09-25  Neil Jerram  <neil@ossau.uklinux.net>

	Don't include guile-config and guile-tools in distribution
	They need to be regenerated, with the correct prefix, when configure
	and make run.

	* meta/Makefile.am (EXTRA_DIST): Remove bin_SCRIPTS.

2009-09-25  Neil Jerram  <neil@ossau.uklinux.net>

	Fix make distcheck by looking for guile-config in $(srcdir)
	make distcheck is currently failing for me with:

	In file included from /usr/local/include/libguile/threads.h:35,
	                 from /usr/local/include/libguile/async.h:28,
	                 from /usr/local/include/libguile.h:37,
	                 from ../../examples/box/box.c:22:
	/usr/local/include/libguile/pthread-threads.h:33:31: error: libguile/boehm-gc.h: No such file or directory
	In file included from /usr/local/include/libguile.h:93,
	                 from ../../examples/box/box.c:22:

	- which is because it's picking up a load of installed headers,
	instead of those in the _inst tree

	- which is because there is no output from the preceding guile-config
	invocation:

	PATH=/home/neil/SW/Guile/ovnight/guile-master-20090924/_inst/bin:$PATH PKG_CONFIG_PATH=/home/neil/SW/Guile/ovnight/guile-master-20090924/_inst/lib/pkgconfig /home/neil/SW/Guile/ovnight/guile-master-20090924/_inst/bin/guile-config compile

	- which is because .../_inst/bin/guile-config is empty

	- which is because the rule in meta/Makefile.am that generates
	guile-config is missing $(srcdir), and so doesn't find
	guile-config.in.

	* meta/Makefile.am (guile-config): Look for guile-config.in in
	  $(srcdir).

2009-09-25  Michael Gran  <spk121@yahoo.com>

	Missing free in nl-langinfo
	This is a regression.

	* libguile/i18n.c (scm_nl_langinfo): free c_result

2009-09-25  Michael Gran  <spk121@yahoo.com>

	Fix encoding of strings returned by nl-langinfo
	Strings returned by nl-langinfo were always being encoded using the
	global setlocale and not the scm_t_locale passed to the function.

	* libguile/i18n.c (scm_nl_langinfo): fix encoding of strings

2009-09-24  Michael Gran  <spk121@yahoo.com>

	Language-specific case-conversion doesn't honor locale
	Libunistring uses a function uc_locale_language to extract the
	current language from the locale information.  It does this by calling
	setlocale.  This makes incompatible with Guile functions that use the
	locale_t thread-specific locale API, because the values returned by the
	call to setlocale ignore the locale set by uselocale.

	As a workaround, this patch extracts the language from the locale_t
	structure's __names field.

	A more complete solution is needed.  Perhaps that solution would test
	that the __names field exists in the configure step and revert to
	!USE_GNU_LOCALE_API in that case.

	* libguile/i18n.c (locale_language): new function that performs the
	  same job as uc_locale_language but is compatible with uselocale
	  (u32_locale_casecoll, u32_locale_tocase): replace uc_locale_language
	  with locale_language

2009-09-24  Michael Gran  <spk121@yahoo.com>

	Tests for locale-specific case conversion
	* test-suite/tests/i18n.test: add tests for case conversion of Turkish
	  letters 'i' to verify that the language is being honored.

	Try to adjust i18n for strict aliasing
	* libguile/i18n.c (u32_locale_tocase, scm_char_locale_downcase)
	  (scm_char_locale_upcase, scm_string_locale_downcase)
	  (scm_string_locale_upcase): use the scm_t_uint32 type for buffers
	  that are used primarily for libunistring and not for Guile strings.

2009-09-24  Ludovic Courtès  <ludo@gnu.org>

	Move "-z relro" out of $LDFLAGS so it's not in `guile-2.0.pc'.
	* acinclude.m4 (GUILE_GNU_LD_RELRO): Substitute `GNU_LD_FLAGS'.

	* libguile/Makefile.am (libguile_la_LDFLAGS): Add $(GNU_LD_FLAGS).

	* srfi/Makefile.am (AM_LDFLAGS): New.

2009-09-24  Ludovic Courtès  <ludo@gnu.org>

	Have `guile-config' close over `pkg-config' and $(pkgconfigdir).
	* meta/Makefile.am (guile-config): New target.
	  (EXTRA_DIST): Add `guile-config.in'.

	* meta/guile-config.in: New, formerly `guile-config'.  Use the right
	  installed `guile', with the right $PKG_CONFIG_PATH.  Disable
	  auto-compilation.
	  (%pkg-config-program): New variable.
	  (pkg-config): Use it.

2009-09-24  Ludovic Courtès  <ludo@gnu.org>

	Partially revert e5f5113c21f396705d7479a570c96690135c9d36.
	The intent is to maintain the readability of `pmatch' invocations.

	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  Don't use wildcards in `pmatch' invocations, even when the matched
	  elements are unused.

	* module/language/glil/decompile-assembly.scm (decompile-toplevel,
	  decompile-load-program): Likewise.

	* module/system/xref.scm (program-callee-rev-vars): Likewise.

	* module/language/assembly.scm (byte-length): Likewise.

	* module/language/tree-il/compile-glil.scm (flatten): Likewise.

2009-09-24  Ludovic Courtès  <ludo@gnu.org>

	Reinstate backward-compatible `scm_array_p ()'.
	* libguile/generalized-arrays.c (scm_array_p_2): New, formerly
	  `scm_array_p ()'.
	  (scm_array_p): Add second argument, for compatibility with 1.8 and
	  earlier and to match what the doc says and what `SCM_VALIDATE_ARRAY'
	  expects.

	* libguile/generalized-arrays.h (scm_array_p_2): New.
	  (scm_array_p): Adjust.

2009-09-23  Michael Gran  <spk121@yahoo.com>

	Modify char and string locale upcase and downcase for Unicode
	* libguile/i18n.c (u32_locale_tocase): new helper function
	  (scm_char_locale_downcase, scm_char_locale_upcase): add capability
	  for UCS-4 characters.
	  (scm_string_locale_downcase, scm_string_locale_upcase): modify for
	  the new scheme strings.

2009-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	Manual link from `Guile Initialization' to `Initialization'
	Thanks to Dale Smith for suggesting this.

	* doc/ref/libguile-linking.texi: Add ref to full doc of Guile
	  initialisation functions.

2009-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	Changes so that benchmark-guile runs successfully
	* benchmark-suite/benchmarks/bytevectors.bm: Add "coding: latin1"
	  comment where Guile will find it.

	* benchmark-suite/benchmarks/chars.bm: Ditto.

	* benchmark-suite/benchmarks/srfi-13.bm: Ditto.

	* benchmark-suite/benchmarks/read.bm ("read"): Divide numbers of
	  iterations by 10, so that the benchmarks complete within a few
	  minutes.

	* benchmark-suite/lib.scm (benchmark): Use `run-benchmark' in macro
	  definition, not `,run-benchmark'.

	* benchmark-suite/benchmarks/0-reference.bm,
	  benchmark-suite/benchmarks/continuations.bm,
	  benchmark-suite/benchmarks/if.bm,
	  benchmark-suite/benchmarks/logand.bm: Add define-module.

	* benchmark-suite/results/neil-arudy: New file, containing benchmark
	  results from my computer.

2009-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	GDS usability: operation without a mouse
	Derek Peschel provided this patch and described it as follows.

	"Most of the time I use Terminal in OS X, rather than xterm.  I also don't
	bother with the GUI versions of Emacs.  So unfortunately I have no mouse
	support in Emacs.  Also the system I'm testing Guile on thinks my terminal
	doesn't support color and I haven't fixed it yet.  The attached patch makes
	GDS more usable for me.

	"With no mouse, the "[click here to show error stack]" design is very
	inconvenient.  You added a C-M (return) binding at some point.  I copied
	that, but I also changed the message to show it.  And I made the return
	work when the cursor is after the right bracket."

	* emacs/gds-scheme.el (gds-display-results): Make "click here" message
	  more helpful for people without mice.  Also extend text properties
	  so that a RET key press works at the end of that line.

2009-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	Typo fixes

	Fix GDB in Emacs incantation

2009-09-21  Michael Gran  <spk121@yahoo.com>

	Tests for record types
	* test-suite/tests/records.test: new tests

2009-09-21  Michael Gran  <spk121@yahoo.com>

	More tests for strings
	* test-suite/tests/vectors.test: test make-vector and interactions between
	  strings and vectors

	* test-suite/tests/strings.test: test string-null?, string? and backslash
	  escapes

	* test-suite/tests/srfi-13.test: test null input strings in string-any and
	  string-every

2009-09-21  Ludovic Courtès  <ludo@gnu.org>

	Remove unused variables in system/language.
	* module/language/assembly.scm (byte-length): Don't match unused
	  record slots.

	* module/language/tree-il.scm (tree-il->scheme, post-order!,
	  pre-order!): Likewise.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Likewise.

	* module/language/tree-il/compile-glil.scm (flatten): Likewise.

	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  Don't match unused list elements.

	* module/language/glil/decompile-assembly.scm (decompile-toplevel,
	  decompile-load-program): Likewise.

	* module/system/xref.scm (program-callee-rev-vars): Likewise.

	* module/language/assembly/compile-bytecode.scm
	  (write-bytecode)[write-sized-loader]: Remove.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Factorize `pad' variables.

	* module/language/ecmascript/base.scm (object->value/string,
	  object->value/number)[v]: Remove.

	* module/language/ecmascript/tokenize.scm (read-slash)[c0]: Remove.

	* module/language/objcode/spec.scm (decompile-value)[nargs]: Remove.

	* module/system/repl/command.scm (time)[vms-start, vms-end]: Remove.

	* module/system/repl/repl.scm (prompting-meta-read): Use `prompt'.

2009-09-21  Ludovic Courtès  <ludo@gnu.org>

	Remove unused variables in ice-9/goops/srfi/scripts.
	* module/ice-9/boot-9.scm (scm-style-repl)[-abort]: Remove.

	* module/oop/goops.scm (class)[slot-defs]: Remove.
	  (compute-slot-accessors)[name]: Remove.
	  (compute-get-n-set)[env]: Remove.

	* module/oop/goops/active-slot.scm (compute-get-n-set)[env, name]:
	  Remove.

	* module/oop/goops/dispatch.scm (cache-try-hash!)[max-misses]: Remove.

	* module/oop/goops/save.scm (make-mapper)[dims]: Remove.

	* module/scripts/autofrisk.scm (>>checks)[prog]: Remove.

	* module/srfi/srfi-19.scm (priv:read-directives)[ireaderf, eireader4]:
	  Remove.

2009-09-20  Ludovic Courtès  <ludo@gnu.org>

	Honor and confine expansion-time side-effects to `current-reader'.
	* module/language/scheme/spec.scm (scheme)[#:reader]: Honor the
	  compilation environment's `current-reader'.

	* module/system/base/compile.scm (*compilation-environment*): New
	  fluid.
	  (current-compilation-environment): New procedure.
	  (make-compilation-module): Provide a fresh `current-reader' fluid.
	  (read-and-compile): Set `*compilation-environment*' appropriately.
	  (compile): Likewise.

	* test-suite/tests/compiler.test (read-and-compile): New.
	  ("current-reader"): New test prefix.

2009-09-20  Ludovic Courtès  <ludo@gnu.org>

	Fix copyright in `(srfi srfi-4 gnu)'.

2009-09-20  Ludovic Courtès  <ludo@gnu.org>

	Compile in a fresh module by default.
	* module/system/base/compile.scm (make-compilation-module,
	  language-default-environment): New procedures.
	  (read-and-compile, compile): Have ENV default to
	  `(language-default-environment from)'.
	  (compile-and-load): Compile in `(current-module)'.

	* module/system/repl/common.scm (repl-compile): Explicitly compile in
	  the current module so that macro definitions are visible.

	* libguile/load.c (kw_env): New variable.
	  (do_try_autocompile): Call `compile-file' with `#:env (current-module)'.

	* test-suite/tests/compiler.test ("psyntax")["compile uses a fresh module by
	  default", "compile-time definitions are isolated"]: New tests.
	  ["compile in current module"]: Specify `#:env (current-module)'.
	  ["redefinition"]: Adjust.

	* test-suite/tests/bytevectors.test (c&e): Explicitly compile in the
	  current module so that its imports are visible.

2009-09-18  Andy Wingo  <wingo@pobox.com>

	fix bitvectors after the array handle refactoring
	* libguile/uniform.h (scm_array_handle_uniform_element_bit_size): New
	  public accessor.

	* libguile/uniform.c (scm_array_handle_uniform_element_size): Better
	  errors in non-byte-aligned arrays.
	  (scm_uniform_vector_element_type, scm_uniform_vector_element_size)
	  (scm_c_uniform_vector_ref, scm_c_uniform_vector_set_x):
	  (scm_uniform_vector_to_list): Don't require byte-aligned access.

	* libguile/bytevectors.c (scm_uniform_array_to_bytevector):
	* libguile/arrays.c (scm_from_contiguous_typed_array):  Fix for
	  uniform arrays whose element size is not a multiple of the byte size.

2009-09-18  Andy Wingo  <wingo@pobox.com>

	fix thinko in api-memory.texi

2009-09-18  Ludovic Courtès  <ludo@gnu.org>

	i18n: Remove non-local exists from `u32_locale_casecoll ()'.
	* libguile/i18n.c (u32_locale_casecoll): Add RESULT argument.  Return
	  zero or ERRNO.
	  (compare_u32_strings_ci): Adjust accordingly.

2009-09-18  Ludovic Courtès  <ludo@gnu.org>

	i18n: Always use locale-dependent string collation.
	* libguile/i18n.c (compare_u32_strings, compare_u32_strings_ci): Always
	  use locale-dependent string collation.

	* test-suite/tests/i18n.test: Recoded in UTF-8.
	  (%french-utf8-locale-name): New.
	  (under-locale-or-unresolved): New.  Don't catch errors on GNU systems.
	  (under-french-locale-or-unresolved): Use it.
	  (under-french-utf8-locale-or-unresolved): New.
	  ("text collation (French)")["string-locale-ci=? (2 args, wide
	  strings)", "string-locale-ci=? (3 args, wide strings)",
	  "string-locale-ci<>? (wide strings)", "string-locale-ci<>? (wide and
	  narrow strings)", "char-locale-ci<>? (wide)"]: New tests.

2009-09-18  Ludovic Courtès  <ludo@gnu.org>

	i18n: Avoid needless heap allocation.
	* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Allocate buffers on the stack
	  rather on the heap.
	  (SCM_U32_BUF_FREE): Remove.  Callers updated.

	i18n: Simplify `RUN_IN_LOCALE_SECTION' (GNU version).
	* libguile/i18n.c (RUN_IN_LOCALE_SECTION)[USE_GNU_LOCALE_API]: Remove
	  extraneous uselocale(3) call.

2009-09-18  Ludovic Courtès  <ludo@gnu.org>

	Add the `%host-type' global variable.
	* configure.ac: Define `HOST_TYPE'.

	* libguile/load.c (sys_host_type): New variable.

	* doc/ref/api-options.texi (Build Config): Document `%host-type'.

2009-09-17  Michael Gran  <spk121@yahoo.com>

	Adapt i18n string and char comparison funcs for Unicode
	* libguile/i18n.c (RUN_IN_LOCALE_SECTION) [USE_GNU_LOCALE_API]: new
	  macro for this define.  Should work the same as the !USE_GNU_LOCAL_API
	  version
	  (SCM_STRING_TO_U32_BUF, SCM_U32_BUF_FREE): helper macros
	  (compare_u32_strings, compare_u32_strings_ci): new functions that
	  compare scheme strings in the presence of the locale
	  (u32_locale_casecoll): new helper function for compare_u32_strings_ci
	  (compare_strings, compare_strings_ci): removed and replaced by
	  compare_u32_strings and compare_u32_strings_ci
	  (scm_string_locale_lt, scm_string_locale_gt, scm_string_locale_ci_lt)
	  (scm_string_locale_ci_gt, scm_string_locale_ci_eq): modified to
	  use new compare_u32_strings and compare_u32_strings_ci comparison
	  functions
	  (scm_char_locale_lt, scm_char_locale_gt, scm_char_locale_ci_lt)
	  (scm_char_locale_ci_gt, scm_char_locale_ci_eq): modified to use
	  new compare_u32_strings and compare_u32_strings_ci comparison
	  functions

2009-09-17  Neil Jerram  <neil@ossau.uklinux.net>

	Remove deprecation warnings from the build
	* module/srfi/srfi-35.scm: Remove explicit use of (ice-9 syncase).

	* test-suite/tests/r5rs_pitfall.test: Same again.

	* test-suite/tests/syncase.test: Remove "(ice-9 syncase) loads" test;
	  syncase is always loaded now.

2009-09-17  Neil Jerram  <neil@ossau.uklinux.net>

	Convenience for running GDB on Guile in Emacs
	* meta/gdb-uninstalled-guile.in: Add (in a comment) an elisp form that
	  can be evaluated to run GDB on Guile in Emacs.

2009-09-17  Neil Jerram  <neil@ossau.uklinux.net>

	Fix omission of VM frames from backtrace
	From the time when a #<program> was a SMOB, really_make_boot_program
	in vm.c was still using SCM_SET_SMOB_FLAGS to set the
	SCM_F_PROGRAM_IS_BOOT flag - which meant that it was setting flag
	1<<32 :-) which obviously was then missed by the SCM_PROGRAM_IS_BOOT
	calls in stacks.c.

	* libguile/programs.h (SCM_F_PROGRAM_IS_BOOT): Use a less significant
	  bit for this flag, now that programs use a tc7 type.

	* libguile/vm.c (really_make_boot_program): Don't use
	  SCM_SET_SMOB_FLAGS, now that programs aren't SMOBs.

2009-09-17  Neil Jerram  <neil@ossau.uklinux.net>

	Fix incorrect stack count warnings
	* libguile/stacks.c (stack_depth): Decrement depth count for a
	  macro-expansion frame.  (Missing this decrement will cause a "stack
	  count incorrect" warning but is actually benign, as it only means
	  that scm_make_stack allocates a bit more space for the stack than it
	  really needs.)

	  (read_frames): Increment count of remaining unused frames, when
	  cutting out a macro transformer application frame.  (Missing this
	  increment could cause the "stack count incorrect" warning, and could
	  make read_frames think it's filled up all the available stack frames
	  when there's actually still one frame unused; this wasn't benign,
	  because it could cause information to be missing from a stack
	  trace.)

2009-09-17  Neil Jerram  <neil@ossau.uklinux.net>

	Remove unhittable else branch for nonexistent type of debug frame
	* libguile/stacks.c (stack_depth): Remove unhittable else branch
	  apparently catering to a kind of frame that isn't an eval, apply or
	  void frame - in fact there are no other kinds of frames.

2009-09-16  Andy Wingo  <wingo@pobox.com>

	add the libdir to the ltdl lib search path
	* libguile/Makefile.am (libpath.h): Fix pkgdatadir, pkglibdir, and
	  pkgincludedir entries. Add a new define, SCM_LIB_DIR.

	* libguile/dynl.c (sysdep_dynl_init): Add the libdir to the libltdl
	  search path. Should fix
	  http://thread.gmane.org/gmane.lisp.guile.bugs/4289/focus=4296 -- that
	  is, it should allow guile to be invoked from whereever it is
	  installed, without munging LTDL_LIBRARY_PATH or the like variables.

	  There is a trick though -- during the build, we don't want to be
	  looking in the $libdir for loadable modules. So as with
	  GUILE_SYSTEM_PATH, we have GUILE_SYSTEM_LTDL_PATH.

	* meta/uninstalled-env.in: Set GUILE_SYSTEM_LTDL_PATH to "" when
	  building.

2009-09-15  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 1.9.3.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

2009-09-15  Ludovic Courtès  <ludo@gnu.org>

	Use fixnums for int32 when the native word size of greater than 4 bytes.
	This should also fix "condition is always true" warnings.

	* libguile/vm-i-scheme.c (bv_u32_native_ref, bv_s32_native_ref,
	  bv_u32_native_set, bv_s32_native_set): Conditionalize use of
	  `BV_FIXABLE_INT_REF' vs. `BV_INT_REF' based on `SIZEOF_VOID_P'.

2009-09-15  Ludovic Courtès  <ludo@gnu.org>

	Keep the weak pair API internal.
	* libguile/weaks.h (scm_weak_car_pair, scm_weak_cdr_pair,
	  scm_doubly_weak_pair): Make them internal.

2009-09-15  Ludovic Courtès  <ludo@gnu.org>

	Fix bug #27450 ("Fat mutexes not GC'd until their owner dies").
	* libguile/threads.c (do_thread_exit): Deal with `t->mutexes' being a
	  weak list.
	  (fat_mutex_lock): Use weak-car pairs when building up `t->mutexes'.

	* test-suite/tests/threads.test ("mutex-ownership")["mutex with owner
	  not retained (bug #27450)"]: New test.

2009-09-15  Ludovic Courtès  <ludo@gnu.org>

	Fix the (currently unused) weak pair accessors.
	* libguile/weaks.h (SCM_WEAK_PAIR_WORD): Fixed; changed to return
	  `SCM_UNDEFINED' when the word has been nullified.

2009-09-15  Ludovic Courtès  <ludo@gnu.org>

	"Document" the `set-module-eval-closure!' weak hash table glitch.
	* module/ice-9/boot-9.scm (set-module-eval-closure!): Add link to an
	  explanation.

	* test-suite/tests/gc.test ("gc")["Unused modules are removed"]:
	  Increase the `cleanup' loop.

2009-09-15  Ludovic Courtès  <ludo@gnu.org>

	Nitpick in `srfi-14.c'.
	* libguile/srfi-14.c (scm_i_ucs_range_to_char_set): Fix warning about
	  the position of BASE_CS.

	Make the precise stack mark procedure more robust.
	* libguile/vm.c (vm_stack_mark): Return if VM is NULL.

	Use GC-robust queues/lists in `threads.c'.
	* libguile/threads.c (remqueue, dequeue, on_thread_exit): Initialize the
	  "next" link of the item returned/removed.

	Remove explicit thread/condvar/mutex finalization.
	* libguile/threads.c (fat_mutex_free): Remove explicit `scm_gc_free ()'
	  call.
	  (fat_cond_free, thread_free): Remove.
	  (scm_threads_prehistory): Adjust accordingly.

2009-09-14  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

2009-09-14  Ludovic Courtès  <ludo@gnu.org>

	Merge `libguile-i18n' into `libguile'.
	* GUILE-VERSION (LIBGUILE_I18N_MAJOR, LIBGUILE_I18N_INTERFACE_CURRENT,
	  LIBGUILE_I18N_INTERFACE_REVISION, LIBGUILE_I18N_INTERFACE_AGE,
	  LIBGUILE_I18N_INTERFACE): Remove.

	* doc/ref/api-i18n.texi (i18n Introduction): Don't mention
	  `libguile-i18n'.

	* libguile.h: Include "libguile/i18n.h".

	* libguile/Makefile.am (lib_LTLIBRARIES): Remove `libguile-i18n-v*'.
	  (libguile_la_SOURCES): Add `i18n.c'.
	  (libguile_i18n_v_*_SOURCES, libguile_i18n_v_*_CFLAGS,
	  libguile_i18n_v_*_LIBADD, libguile_i18n_v_*_LDFLAGS): Remove.

	* libguile/i18n.c (scm_bootstrap_i18n): New function.

	* libguile/i18n.h (scm_nl_langinfo, scm_init_i18n): Made internal.
	  (scm_bootstrap_i18n): New declaration.

	* libguile/init.c (scm_i_init_guile): Invoke `scm_bootstrap_i18n ()'.

	* module/ice-9/i18n.scm: Load from `libguile' instead of
	  `libguile-i18n-v-0'.

2009-09-14  Ludovic Courtès  <ludo@gnu.org>

	Switch the `encoding*.test' files to LGPLv3+.
	* test-suite/tests/encoding-escapes.test,
	  test-suite/tests/encoding-iso88591.test,
	  test-suite/tests/encoding-iso88597.test,
	  test-suite/tests/encoding-utf8.test: Switch to LGPLv3+ for the sake of
	  consistency.

	Update `scm_without_guile ()' documentation.
	* doc/ref/api-scheduling.texi (Blocking): Mention that
	  `scm_without_guile ()' & co. aren't needed any longer.

2009-09-14  Ludovic Courtès  <ludo@gnu.org>

	Rename "boehm-gc.h" to "bdw-gc.h"; add to the distribution.
	* libguile/Makefile.am (modinclude_HEADERS): Add `bdw-gc.h'.

	* libguile/bdw-gc.h: Rename from "boehm-gc.h"; users updated.  Update to
	  LGPLv3+.

2009-09-14  Ludovic Courtès  <ludo@gnu.org>

	Remove unused IA64 macro.
	* libguile/threads.c (SCM_MARK_BACKING_STORE): Remove.

2009-09-11  Michael Gran  <spk121@yahoo.com>

	More setlocale robustness in regexp tests
	* test-suite/tests/regexp.test (mysetlocale, set-latin-1): new functions
	  (with-latin1-locale): removed
	  (regexp-quote tests): try to print test names in locale but run tests
	  in ISO-8859-1.

2009-09-11  Ludovic Courtès  <ludo@gnu.org>

	Remove `scm_enter_guile ()' and `scm_leave_guile ()'.
	* libguile/threads.c (scm_t_guile_ticket): Remove type.
	  (resume, scm_enter_guile, suspend, scm_leave_guile): Remove.
	  (scm_i_init_thread_for_guile): Set `t->top' to NULL, which has the
	  same effect as calling `scm_enter_guile ()'.
	  (scm_leave_guile_cleanup, scm_i_with_guile_and_parent): Remove
	  `scm_leave_guile ()' call.

2009-09-11  Ludovic Courtès  <ludo@gnu.org>

	Add `λ' macro as an alternative to `lambda'.
	* module/ice-9/boot-9.scm (λ): New macro.

	* NEWS: Update.

2009-09-11  Ludovic Courtès  <ludo@gnu.org>

	Report missing libunistring at `configure'-time.
	* configure.ac: Reinstate libunistring check from
	  1ee2c72eafaae5f91f4c899bc4b4853af5c16f28.

2009-09-10  Ludovic Courtès  <ludo@gnu.org>

	Remove unnecessary uses of `scm_{leave,enter}_guile ()'.
	* libguile/threads.c (scm_pthread_cond_wait,
	  scm_pthread_cond_timedwait): Remove `scm_{leave,enter}_guile ()'
	  calls.

2009-09-10  Ludovic Courtès  <ludo@gnu.org>

	Link with `-z relro' when available.
	* acinclude.m4 (GUILE_GNU_LD_RELRO): New macro.

	* configure.in: Use `GUILE_GNU_LD_RELRO'.

2009-09-09  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc_os_dep.c

	Avoid unneeded `scm_dynwind_free ()'.
	* libguile/array-map.c (indices_gc_hint): New variable.
	  (scm_ramapc, scm_array_index_map_x): Avoid `scm_dynwind_free ()' using
	  `scm_gc_malloc_pointerless ()'.

2009-09-09  Ludovic Courtès  <ludo@gnu.org>

	Update doc of `scm_gc_protect_object ()' and SMOB mark/free.
	* doc/ref/api-memory.texi (Garbage Collection
	  Functions)[scm_gc_protect_object]: Explain that it's equivalent to
	  storing in a global variable.

	* doc/ref/api-smobs.texi (Smobs)[scm_set_smob_free]: Expand on the
	  relationship with `scm_gc_malloc ()'.
	  [scm_set_smob_mark]: Explain that it's usually not needed.

2009-09-09  Michael Gran  <spk121@yahoo.com>

	Avoid prematurely ending regexp test when ISO-8859-1 locale not found
	* test-suite/tests/regexp.test (with-latin1-locale): new function
	  Call tests in context of with-latin1-locale

2009-09-09  Michael Gran  <spk121@yahoo.com>

	Make scm_i_from_stringn into API for use with libguilereadline
	* libguile/strings.c (scm_i_from_stringn): renamed to scm_from_stringn.
	  All callers changed.

	* libguile/strings.h: change declaration of scm_i_from_stringn to
	  scm_from_stringn

	* libguile/strports.c (scm_strport_to_string): scm_i_from_stringn ->
	  scm_from_stringn

	* guile-readline/readline.c (internal_readline): scm_i_from_stringn ->
	  scm_from_stringn

2009-09-09  Ludovic Courtès  <ludo@gnu.org>

	Update documentation of `scm_gc_malloc ()' & co.
	* doc/ref/api-memory.texi (Memory Blocks): Update description of
	  `scm_gc_malloc ()' & co.  Add `scm_gc_malloc_pointerless ()'.

	Update `README'.

2009-09-08  Ludovic Courtès  <ludo@gnu.org>

	Fix misleading comments in `gc-benchmarks/run-benchmark.scm'.
	* gc-benchmarks/run-benchmark.scm (pretty-print-result): Fix comments.

	Improve `gc-benchmarks/run-benchmark.scm'.
	* gc-benchmarks/run-benchmark.scm (pretty-print-result)[ref-heap,
	  ref-time]: New variable.
	  [distance, score, score-string]: New procedures.
	  [print-line]: Use `score-string'.
	  (print-raw-result): New procedure.
	  (%options)["raw", "load-results"]: New options.
	  (%default-options): Add `printer' pair.
	  (show-help): Update.
	  (main): Add support for `--raw' and `--load-results'.

2009-09-08  Michael Gran  <spk121@yahoo.com>

	8-bit locale needed for 8-bit regexp tests
	Since the regex library expects 8-bit clean characters and
	an 8-bit locale, tests of 8-bit characters need to occur within
	the context of an 8-bit locale.

	* test-suite/tests/regexp.test (regexp-quote tests): wrap them in an
	  ISO-8859-1 locale

2009-09-08  Michael Gran  <spk121@yahoo.com>

	Fix broken interaction between readline and Unicode
	This requires separate small fixes.

	Readline has internal logic to deal with multi-byte characters, so
	it wants bytes, not characters.

	scm_c_read gets called by the vm when readline is activated, and it was
	truncating multi-byte characters because soft ports didn't have the
	UCS-4 capability.

	Soft ports need the capability to read UCS-4 characters.  Since soft ports
	may have a single byte buffer, full characters need to be stored into the
	pushback buffer.

	This broke the optimizations in scm_c_read for using an alternate buffer
	for single-byte-buffered ports, because the opimization wasn't expecting
	anything in the pushback buffer.

	* libguile/vports.c (sf_fill_input): store complete chars, not single bytes

	* libguile/ports.c (scm_c_read): don't use optimized path for non Latin-1.
	  Add debug prints.

	* libguile/string.h: make scm_i_from_stringn and scm_i_string_ref public
	  so that readline can use them

	* guile-readline/readline.c: read bytes, not complete chars, from the
	  input port.  Convert output to the output port's locale

2009-09-06  Andy Wingo  <wingo@pobox.com>

	fix compile-time bug compiling (+ "foo" " bar")
	* module/language/tree-il/primitives.scm (+, -): Avoid calling exact? on
	  non-numeric args.

2009-09-06  Andy Wingo  <wingo@pobox.com>

	update news; ready for 1.9.3
	* doc/ref/api-control.texi:
	* doc/ref/goops.texi: Fix some typos.

	* NEWS: Update.

2009-09-06  Andy Wingo  <wingo@pobox.com>

	update NEWS
	* NEWS: Minor text revisions, and fold new NEWS entries into the main
	  body too.

2009-09-05  Michael Gran  <spk121@yahoo.com>

	Avoid string buffer overrun in scm_scan_for_encoding
	* libguile/read.c (scm_scan_for_encoding): possible overrun if
	  coding declaration is at end of file

2009-09-05  Michael Gran  <spk121@yahoo.com>

	Doc updates for character encoding of source code files
	* NEWS

	* doc/ref/scheme-scripts.texi: doc updates for character encoding of
	  source code

	* doc/ref/api-evaluation.texi: doc updates for character encoding of
	  source code

2009-09-04  Michael Gran  <spk121@yahoo.com>

	Doc updates for Unicode string escapes and port encodings
	* NEWS: string and port changes

	* doc/ref/api-data.texi: string escapes and string-ci

	* doc/ref/api-io.texi: port encoding functions

2009-09-04  Michael Gran  <spk121@yahoo.com>

	Remove locale u8vector functions
	Locale u8vector functions deemed harmful.

	* libguile/strports.c (scm_strport_to_locale_u8vector)
	  (scm_call_with_output_locale_u8vector, scm_open_input_locale_u8vector)
	  (scm_get_output_locale_u8vector): removed

	* libguile/strports.h: removed declarations for
	  scm_strport_to_locale_u8vector,
	  scm_call_with_output_u8vector,
	  scm_input_locale_u8vector,
	  scm_get_output_locale_u8vector

	* test-suite/tests/encoding-iso88591.test: display tests removed

	* test-suite/tests/encoding-iso88597.test: display tests removed

2009-09-04  Michael Gran  <spk121@yahoo.com>

	Initialize string ports with UTF-8 encoding
	String ports should be able to accept any string characters, regardless
	of the current locale.  Setting it to UTF-8 achieves that.

	* libguile/strports.c (scm_i_mkstrport): set port's locale to UTF-8
	  (scm_mkstrport): convert input string to UTF-8

2009-09-04  Michael Gran  <spk121@yahoo.com>

	write-char should handle UCS-4 characters
	* libguile/print.c (scm_write_char): call UCS-4 printing routine, instead
	  of 8-bit primitive

2009-09-03  Ken Raeburn  <raeburn@raeburn.org>

	Make test-case compilation with -DSCM_DEBUG=1 work.
	* gc.h (scm_i_expensive_validation_check): Declare SCM_API.

2009-09-03  Michael Gran  <spk121@yahoo.com>

	Doc updates for srfi-14 character sets
	* NEWS: updates for srfi-14 character sets

	* doc/ref/api-data.texi: update char-set section and some spellchecking

2009-09-03  Michael Gran  <spk121@yahoo.com>

	Update docs and docstrings for Unicode characters
	* doc/ref/api-data.texi: more info about characters and codepoints

	* libguile/chars.c: replace 'code point' with 'Unicode code point' in
	  docstrings

2009-09-03  Michael Gran  <spk121@yahoo.com>

	Add char-set debugging function
	* libguile/srfi-14.c (scm_sys_char_set_dump): new function

	* libguile/srfi-14.h: declaration of scm_sys_char_set_dump

2009-09-03  Michael Gran  <spk121@yahoo.com>

	Distinguish between all codepoints and designated codepoints in char-sets
	* libguile/unidata_to_charset.pl (designated): renamed from full

	* libguile/srfi-14.c (scm_char_set_designated): new char-set

	* libguile/srfi-14.i.c (cs_designated): renamed from cs_full

2009-09-03  Michael Gran  <spk121@yahoo.com>

	Modify read and print of combining characters
	Since combining characters, such as accents, modify the appearance of the
	previous letter, it looks awkward in its character literal form (#\name)
	since it modified the backslash.  This instead prints the combining
	character on a small circle.

	* libguile/chars.h (SCM_CODEPOINT_DOTTED_CIRCLE): new #define

	* libguile/print.c (iprint1): print combining characters on dotted circles

	* libguile/read.c (scm_read_character): parse the combination of combining
	  characters and dotted circles

2009-09-03  Ludovic Courtès  <ludo@gnu.org>

	Fix invalid syntax in `dynamic-input-large.sch' (gc-benchmarks).
	* gc-benchmarks/larceny/dynamic-input-large.sch: Remove invalid "\;"
	  escape.

2009-09-03  Ludovic Courtès  <ludo@gnu.org>

	Add test case for `scm_take_u8vector ()'.
	This is a followup to commit d7e7a02a6251c8ed4f76933d9d30baeee3f599c0
	("Fix leaky behavior of `scm_take_TAGvector ()'.") and a reminder that
	the uniform vector implementation can't do away with the cell->buffer
	indirection.

	* test-suite/standalone/Makefile.am (test_scm_take_u8vector_SOURCES,
	  test_scm_take_u8vector_CFLAGS, test_scm_take_u8vector_LDADD): New.
	  (check_PROGRAMS, TESTS): Add `test-scm-take-u8vector'.

	* test-suite/standalone/test-scm-take-u8vector.c: New file.

2009-09-02  Michael Gran  <spk121@yahoo.com>

	Remove always-true range checks in scm_i_ucs_range_to_char_set
	* libguile/srfi-14.c (scm_i_ucs_range_to_char_set): limits are always
	  non-negative due to the type of the variable

	More srfi-14 char-set tests
	* test-suite/tests/srfi-14.test: many new tests

	Unreachable code in charset set operator
	* libguile/srfi-14.c (scm_i_charset_set): remove unreachable code
	  in scm_i_charset_set

	Optimize charset union operator
	* libguile/srfi-14.c (charsets_union): call scm_i_charset_set_range
	  instead of setting characters one-by-one.

	The charset complement operator should not include surrogates
	* libguile/srfi-14.c (charsets_complement): skip over surrogates
	  when making a charset complement

	char-set-filter! does not properly iterate over the charset
	* libguile/srfi-14.c (scm_char_set_filter_x): iterate over
	  codepoints

	ucs-range->char-set should not store surrogates and has off-by-one error
	* libguile/srfi-14.c (scm_i_ucs_range_to_char_set): new function that
	  contains the functionality of ucs_range_to_char_set, fixes
	  off-by-one, and doesn't store surroges
	  (scm_ucs_range_to_char_set, scm_ucs_range_to_char_set_x): call
	  scm_i_ucs_range_to_char_set
	  (scm_i_charset_set_range): new helper function

	char-set-any improperly unpacks charset data
	* libguile/srfi-14.c (scm_char_set_any): unpack the charset correctly

2009-09-02  Michael Gran  <spk121@yahoo.com>

	char-set-xor! should modify the input parameter
	char-set-xor! was not modifying its input parameter.  It isn't
	technically required to do so by the spec, but, the other similar
	functions do it.

	* libguile/srfi-14.c (scm_char_set_xor_x): modify the input parameter

2009-09-02  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc
	Conflicts:
		acinclude.m4
		libguile/strings.c

2009-09-01  Ludovic Courtès  <ludo@gnu.org>

	Fix leaky behavior of `scm_take_TAGvector ()'.
	* libguile/srfi-4.c (free_user_data): New function.

	* libguile/srfi-4.i.c (scm_take_TAGvector): Register `free_user_data ()'
	  as a finalizer for DATA.

	* libguile/objcodes.c (scm_objcode_to_bytecode): Allocate with
	  `scm_malloc ()' since the memory taken by `scm_take_u8vector ()' will
	  eventually be free(3)d.

	* libguile/vm.c (really_make_boot_program): Likewise.

2009-09-01  Andy Wingo  <wingo@pobox.com>

	fix nontail loops within loops
	* module/language/tree-il/compile-glil.scm (flatten): Fix compilation of
	  loops within loops in non-tail positions. Will add a test case soon,
	  but one way to reproduce it was with the following function:

	(define (test)
	  (let lp ()
	    (pk 'zero)
	    (let ((fk (lambda ()
	                (let ((fk2 (lambda () (pk 'two))))
	                  (let ((fk3 (lambda () (if #t (pk 'three) (fk2)))))
	                    (if #t
	                        (fk3)
	                        (fk2)))))))
	      (pk 'one)
	      (fk))
	    (lp)))

	One would expect to see a sequence of "zero one three", but in fact zero
	only showed once.

	This should fix simplex as well.

2009-09-01  Ludovic Courtès  <ludo@gnu.org>

	Remove the distinction between inline/outline storage for stringbufs.
	* libguile/strings.c (STRINGBUF_HEADER_SIZE, STRINGBUF_HEADER_BYTES):
	  New macros.
	  (STRINGBUF_F_INLINE, STRINGBUF_INLINE, STRINGBUF_OUTLINE_CHARS,
	  STRINGBUF_OUTLINE_LENGTH, STRINGBUF_INLINE_CHARS,
	  STRINGBUF_INLINE_LENGTH, STRINGBUF_MAX_INLINE_LEN): Remove.
	  (STRINGBUF_CHARS, STRINGBUF_WIDE_CHARS): Adjust to return a fixed
	  location.
	  (STRINGBUF_LENGTH): Get the length from word 1.
	  (make_stringbuf, make_wide_stringbuf): Adjust to use a contiguous
	  memory region.
	  (wide_stringbuf): Renamed from `widen_stringbuf'.  Adjust similarly.
	  Return the new stringbuf.  Callers updated.
	  (narrow_stringbuf): Likewise.
	  (scm_sys_string_dump, scm_sys_symbol_dump): Remove `stringbuf-inline'
	  pair.

	* test-suite/tests/strings.test ("string internals")["null strings are
	  inlined", "short Latin-1 encoded strings are inlined", "long Latin-1
	  encoded strings are not inlined", "short UCS-4 encoded strings are not
	  inlined", "long UCS-4 encoded strings are not inlined"]: Remove.

	* test-suite/tests/symbols.test ("symbol internals")["null symbols are
	  inlined", "short Latin-1 encoded symbols are inlined", "long Latin-1
	  encoded symbols are not inlined", "short UCS-4 encoded symbols are not
	  inlined", "long UCS-4 encoded symbols are not inlined"]: Remove.

2009-09-01  Ludovic Courtès  <ludo@gnu.org>

	Fix leaky handling of `scm_take_locale_{symbol,string} ()'.
	* libguile/strings.c (scm_i_take_stringbufn, scm_i_c_take_symbol):
	  Remove.
	  (scm_take_locale_stringn): Rewrite in terms of `scm_from_locale_stringn ()'.

	* libguile/strings.h (scm_i_c_take_symbol, scm_i_take_stringbufn):
	  Remove declarations.

2009-08-31  Michael Gran  <spk121@yahoo.com>

	Update docs for Unicode characters
	* NEWS: add note about Unicode characters

	* doc/ref/api-data.texi: update Characters subsection

	* libguile/chars.c: update docstrings to match manual

2009-08-31  Michael Gran  <spk121@yahoo.com>

	Tests for display and writing of characters
	* test-suite/tests/encoding-iso88591.test: tests for writing and display
	  of characters

	* test-suite/tests/encoding-iso88597.test: tests for writing and display
	  of characters

	* test-suite/tests/encoding-utf8.test: tests for writing and display
	  of characters

2009-08-31  Michael Gran  <spk121@yahoo.com>

	Fix escape sequence normalization for wide strings
	* libguile/strings.c (scm_to_stringn): convert unistring escapes to
	  guile escapes for both wide and narrow strings

2009-08-31  Michael Gran  <spk121@yahoo.com>

	Fix encoding errors with strings returned by string ports
	String ports, being 8-bit, store strings using the character encoding
	of the port.  This fixes a bug where the default character encoding, and
	not the port's encoding, was being used to convert the string port data
	back to a string.

	* libguile/strports.c: extra comments
	  (scm_strport_to_string):  use port's encoding when converting port data
	  to a string

	* libguile/strings.c (scm_i_from_stringn): renamed from scm_from_stringn
	  and made internal.  All callers changed.
	  (scm_from_stringn): renamed to scm_i_from_stringn.

	* libguile/strings.h: declaration for scm_i_from_stringn

2009-08-31  Ludovic Courtès  <ludo@gnu.org>

	Fix `benchmark-guile'.
	* benchmark-guile.in (guile): Use `meta/guile', not `pre-inst-guile'.

2009-08-31  Ludovic Courtès  <ludo@gnu.org>

	Remove the distinction between inline/outline storage for bytevectors.
	* libguile/bytevectors.c (SCM_BYTEVECTOR_INLINE_THRESHOLD,
	  SCM_BYTEVECTOR_INLINEABLE_SIZE_P, SCM_BYTEVECTOR_SET_CONTENTS,
	  SCM_BYTEVECTOR_SET_INLINE): Remove.
	  (SCM_BYTEVECTOR_HEADER_BYTES): New macro.
	  (SCM_BYTEVECTOR_SET_ELEMENT_TYPE): Adjust to new flag layout.
	  (make_bytevector): Remove content inlining machinery; use
	  `scm_gc_malloc_pointerless ()' in all cases; special-case zero-sized
	  vu8 buffers.
	  (make_bytevector_from_buffer): Simplified.
	  (scm_c_shrink_bytevector): New, formerly `scm_i_shrink_bytevector ()'.
	  Remove buffer inlining machinery.
	  (scm_bootstrap_bytevectors): Use `make_bytevector ()' for
	  SCM_NULL_BYTEVECTOR.

	* libguile/bytevectors.h (SCM_BYTEVECTOR_HEADER_SIZE): New macro.
	  (SCM_BYTEVECTOR_CONTENTS): Adjust to new layout.
	  (SCM_SET_BYTEVECTOR_FLAGS): Properly cast F.
	  (SCM_F_BYTEVECTOR_INLINE, SCM_BYTEVECTOR_INLINE_P): Remove.
	  (SCM_BYTEVECTOR_ELEMENT_TYPE): Adjust.
	  (scm_c_shrink_bytevector): Remove macro, make a C function
	  declaration.

2009-08-30  Ludovic Courtès  <ludo@gnu.org>

	Use a TC7 tag instead of a SMOB for bytevectors.
	* libguile/bytevectors.c (scm_tc16_bytevector): Remove.
	  (SCM_BYTEVECTOR_SET_LENGTH, SCM_BYTEVECTOR_SET_CONTENTS,
	  SCM_BYTEVECTOR_SET_INLINE, SCM_BYTEVECTOR_SET_ELEMENT_TYPE,
	  make_bytevector_from_buffer, scm_is_bytevector,
	  scm_bootstrap_bytevectors): Adjust to the SMOB->tc7 change.
	  (scm_i_print_bytevector): New, formerly `print_bytevector ()'.
	  (bytevector_equal_p): Remove.

	* libguile/bytevectors.h (SCM_BYTEVECTOR_LENGTH,
	  SCM_BYTEVECTOR_CONTENTS, SCM_BYTEVECTOR_P): Adjust to SMOB->tc7
	  change.
	  (SCM_BYTEVECTOR_FLAGS, SCM_SET_BYTEVECTOR_FLAGS): New macros.
	  (scm_tc16_bytevector): Remove declaration.
	  (scm_i_print_bytevector): New declaration.

	* libguile/eq.c (scm_equal_p): Handle `scm_tc7_bytevector'.

	* libguile/evalext.c (scm_self_evaluating_p): Likewise.

	* libguile/print.c (iprin1): Likewise.

	* libguile/tags.h (scm_tc7_bytevector): New.
	  (scm_tc7_unused_8): Remove.

	* libguile/validate.h (SCM_VALIDATE_BYTEVECTOR): Adjust.

	* test-suite/tests/bytevectors.test ("Datum
	  Syntax")["self-evaluating?"]: New test.

2009-08-30  Neil Jerram  <neil@ossau.uklinux.net>

	Export readline history functions
	* guile-readline/ice-9/readline.scm: Export history functions.

2009-08-29  Michael Gran  <spk121@yahoo.com>

	Range check octal-escaped characters
	* libguile/read.c (scm_read_character): range check octal escapes

2009-08-29  Michael Gran  <spk121@yahoo.com>

	More tests for chars.test
	Testing out-of-range octals, bad charnames, and write format

	* test-suite/tests/chars.test

2009-08-29  Michael Gran  <spk121@yahoo.com>

	More tests for chars.test
	* test-suite/tests/chars.test: more tests

2009-08-29  Michael Gran  <spk121@yahoo.com>

	Surrogate characters shouldn't be in charsets
	* libguile/srfi-14.c (charsets_complement): use surrogate #defines instead
	  of hardcoded numbers

	* libguile/srfi-14.i.c (cs_full_ranges): remove surrogates from full
	  charset

	* libguile/unidata_to_charset.pl (full): test for surrogates

2009-08-29  Michael Gran  <spk121@yahoo.com>

	Better range check for codepoints
	* libguile/chars.h (SCM_IS_UNICODE_CHAR): check for negative codepoints

2009-08-29  Michael Gran  <spk121@yahoo.com>

	Cast the input to isalpha et al to integer
	* libguile/gc_os_dep.c (GC_linux_stack_base) [LINUX_STACKBOTTOM]: cast
	  input of ctype functions to int

	* libguile/inet_aton.c (inet_aton): cast input of ctype functions to int

	* libguile/read.c (scm_scan_for_encoding): cast input of isalnum to int

	* libguile/win32-socket.c (scm_i_socket_uncomment): cast input of isspace
	  to int

2009-08-28  Ludovic Courtès  <ludo@gnu.org>

	Add `BDW_GC_CFLAGS' to the `.pc' files.
	This is needed because <gc/gc.h> is included in public headers (via
	<libguile/boehm-gc.h>.

	* meta/guile-2.0-uninstalled.pc.in (Cflags): Add `@BDW_GC_CFLAGS'.

	* meta/guile-2.0.pc.in (Cflags): Likewise.

2009-08-28  Ludovic Courtès  <ludo@gnu.org>

	Remove deprecated variables/macros from the GC headers.
	* libguile/deprecated.c (scm_mtrigger, scm_mallocated,
	  scm_max_segment_size): New global variables, from gc.c.
	  (scm_map_free_list,
	  scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New stubs.

	* libguile/deprecated.h (scm_mallocated, scm_mtrigger,
	  scm_max_segment_size): New declarations.
	  (scm_map_free_list,
	  scm_gc_set_debug_check_freelist_x)[GUILE_DEBUG_FREELIST]: New
	  declarations.

	* libguile/gc-malloc.c (scm_i_minyield_malloc): Remove.
	  (scm_gc_init_malloc): Remove references to `scm_i_minyield_malloc' and
	  `scm_mtrigger'.

	* libguile/gc.c (scm_mtrigger, scm_mallocated): Remove.
	  (scm_init_storage): Remove reference to `SCM_HEAP_SEG_SIZE'.

	* libguile/gc.h (scm_max_segment_size, SCM_SET_FREELIST_LOC,
	  SCM_FREELIST_LOC, scm_i_master_freelist, scm_i_master_freelist2,
	  scm_mallocated, scm_mtrigger): Remove.
	  (scm_map_free_list,
	  scm_gc_set_debug_check_freelist_x)[SCM_ENABLE_DEPRECATED &&
	  GUILE_DEBUG_FREELIST]: Remove.

	* libguile/private-gc.h (SCM_DEFAULT_INIT_HEAP_SIZE_1,
	  SCM_DEFAULT_MIN_YIELD_1, SCM_DEFAULT_MIN_YIELD_2,
	  DEFAULT_SWEEP_AMOUNT, SCM_DEFAULT_MAX_SEGMENT_SIZE,
	  SCM_MIN_HEAP_SEG_SIZE, SCM_HEAP_SEG_SIZE,
	  SCM_GC_CARD_BVEC_SIZE_IN_LONGS, SCM_GC_IN_CARD_HEADERP): Remove.
	  (scm_getenv_int): Made internal.
	  (scm_i_marking, scm_mark_all, scm_i_deprecated_memory_return,
	  scm_i_find_heap_calls, scm_gc_init_malloc, scm_gc_init_freelist,
	  scm_gc_init_segments, scm_gc_init_mark): Remove declarations.

	* libguile/gc-segment-table.c: Remove, finally.

2009-08-28  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/Makefile.am
		libguile/bytevectors.c
		libguile/gc-card.c
		libguile/gc-mark.c
		libguile/programs.c
		libguile/srcprop.c
		libguile/srfi-14.c
		libguile/symbols.c
		libguile/threads.c
		libguile/unif.c
		libguile/vm.c

2009-08-28  Andy Wingo  <wingo@pobox.com>

	fix case in which compiled path had stale .go, but fallback had fresh .go
	* libguile/load.c (scm_primitive_load_path): If the compiled path was
	  out of date, but the fallback path was current, we correctly detected
	  that case, but loaded the wrong file. So here fix the typo.

2009-08-28  Michael Gran  <spk121@yahoo.com>

	Don't presume existence or success of setlocale in test-suite
	* test-suite/lib.scm (with-locale, with-locale*): new test functions

	* test-suite/tests/encoding-escapes: don't fail if en_US.utf8 doesn't exist

	* test-suite/tests/encoding-iso88591.test: set and restore locale, if
	  possible

	* test-suite/tests/encoding-iso88597.test: set and restore locale, if
	  possible

	* test-suite/tests/encoding-utf8.test: set and restore locale, if possible

	* test-suite/tests/srfi-14.test: don't need to setlocale to Latin-1 to
	  test Latin-1 since string conversion is handled at read/compile time.
	  Set and restore locale, if possible.

2009-08-28  Michael Gran  <spk121@yahoo.com>

	scm_getc improperly handles Latin-1 characters
	Upper-plane Latin-1 characters should be converted to codepoints.

	* libguile/ports.c (scm_getc): improper conversion of char to scm_t_wchar

2009-08-28  Michael Gran  <spk121@yahoo.com>

	Fix FUNC_NAME definitions and #endif in srfi-14.[ch]
	* libguile/srfi-14.c: whitespace and FUNC_NAME fixes

	* libguile/srfi-14.h: #endif comment

2009-08-28  Michael Gran  <spk121@yahoo.com>

	Script to generate srfi-14 charsets from UnicodeData.txt
	This script was used to generate srfi-14.i.c from the UnicodeData.txt
	file supplied by ftp://www.unicode.org/Public/UNIDATA/

	* libguile/unidata_to_charset.pl

2009-08-28  Neil Jerram  <neil@ossau.uklinux.net>

	Fix GDS utility client startup
	* emacs/gds-scheme.el (gds-start-utility-guile): Use buffer-local
	  variable gds-client instead of client, as client is actually unbound
	  when the process-filter lambda runs.  (i.e. This isn't Scheme code!)

2009-08-28  Ludovic Courtès  <ludo@gnu.org>

	Add missing `FUNC_NAME' definition.
	* libguile/load.c (scm_sys_warn_autocompilation_enabled): Define
	  `FUNC_NAME'.

2009-08-27  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'ossau-gds-dev'
	Conflicts:

		THANKS

2009-08-27  Neil Jerram  <neil@ossau.uklinux.net>

	Fix doc of let*-values
	Thanks to Judy Hawkins for reporting this.

	* doc/ref/api-modules.texi (Included Guile Modules): Change
	  `let-values*' to `let*-values'.

2009-08-27  Neil Jerram  <neil@ossau.uklinux.net>

	Make GDS resilient to autocompilation comments
	* emacs/gds-scheme.el (gds-start-utility-guile): Make the extraction
	  of client number more robust; in particular when the client emits
	  comments (about auto compilation) before the number.

2009-08-27  Neil Jerram  <neil@ossau.uklinux.net>

	Incorporate ice-9-debugger-extensions properly
	i.e. put the extensions where they need to be, and delete
	ice-9-debugger-extensions.scm.

	* doc/ref/api-debug.texi (Single Stepping through a Procedure's Code):
	  Change mentions of (ice-9 debugging ice-9-debugger-extensions)
	  module to whatever is appropriate now (or just remove them).

	* module/Makefile.am (NOCOMP_SOURCES): Remove
	  ice-9-debugger-extensions.scm.

	* module/ice-9/debugger.scm (debug-trap): Move here from
	  ice-9-debugger-extensions.scm.

	* module/ice-9/debugger/command-loop.scm ("continue", "finish",
	  "step", "next"): Move here from ice-9-debugger-extensions.scm.

	* module/ice-9/debugger/commands.scm (assert-continuable, continue,
	  finish, step, next): Move here from ice-9-debugger-extensions.scm.

	* module/ice-9/debugging/breakpoints.scm: Don't use
	  ice-9-debugger-extensions module.

	* module/ice-9/debugging/ice-9-debugger-extensions.scm: Removed.

	* module/ice-9/debugging/trace.scm, module/ice-9/debugging/traps.scm:
	  Remove more old version code.

	* module/ice-9/debugging/traps.scm (guile-trap-features): Hardcoded as
	  '(tweaking).

2009-08-27  Neil Jerram  <neil@ossau.uklinux.net>

	Remove superfluous ice-9-debugger-extensions code for old Guile versions
	* module/ice-9/debugging/ice-9-debugger-extensions.scm: Remove all
	  code checking for version < 1.7, and move code for versions >= 1.7
	  up to top level.  Comment out dummy mutex definitions for now, as
	  I'm not sure how to rewrite them correctly for psyntax.

2009-08-27  Daniel Kraft  <d@domob.eu>

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

	Support circular structures in elisp reader.
	* module/language/elisp/lexer.scm: Recognize circular markers.
	* module/language/elisp/parser.scm: Handle them correctly.
	* test-suite/tests/elisp-reader.test: Check circular structure parsing.

2009-08-27  Michael Gran  <spk121@yahoo.com>

	Default srfi-14 character set information
	* libguile/srfi-14.i.c: structures containing the default srfi-14
	  sets

2009-08-27  Daniel Kraft  <d@domob.eu>

	Replaced generated elisp parser with hand-written one to fix source properties.
	* module/language/elisp/parser.scm: Hand-written parser.
	* test-suite/tests/elisp-reader.test: Test for source properties.

2009-08-27  Michael Gran  <spk121@yahoo.com>

	Always cast input to toupper as int
	* libguile/read.c (scm_scan_for_encoding): add cast to int

	Segfault when writing non-Latin-1 characters under Latin-1 locale
	* libguile/print.c (iprin1): handle write of non-Latin-1 characters
	  under the Latin-1 locale

2009-08-27  Michael Gran  <spk121@yahoo.com>

	Unicode-capable srfi-14 charsets
	* libguile/Makefile.am: distribute new files srfi-14.i.c and
	  unidata_to_charset.pl

	* chars.c (scm_c_upcase, scm_c_downcase): use unicode-enable toupper
	  and tolower

	* libguile/srfi-14.h (scm_t_char_range, scm_t_char_set): new structures
	  to describe char-sets
	  (scm_t_char_set_cursor): new structure to describe char-set-cursors
	  (SCM_BITS_PER_LONG): removed
	  (SCM_CHARSET_GET): calls function
	  New declarations for scm_i_charset_get, scm_i_charset_set,
	  scm_i_charset_unset, and scm_debug_char_set.

	* test-suite/tests/srfi-14.test: new tests

	* libguile/srfi-14.c (SCM_CHARSET_DATA): new macro
	  (SCM_CHARSET_SET, SCM_CHARSET_UNSET): call function
	  (BYTES_PER_CHARSET, LONGS_PER_CHARSET): removed
	  (scm_i_charset_get, scm_i_charset_set, scm_i_charset_unset)
	  (charsets_equal, charsets_leq, charsets_union)
	  (charsets_intersection, charsets_complement, charsets_xor): new
	  functions that are low-level charset operators
	  (charset_print, charset_free): modified for new charset struct
	  (charset_cursor_print, charset_cursor_free): new function
	  (make_char_set, scm_char_set_p, scm_char_set_eq, scm_car_set_leq)
	  (scm_char_set_hash, scm_char_set_cursor, scm_char_set_ref)
	  (scm_char_set_cursor_next, scm_end_of_char_set_p, scm_char_set_fold)
	  (scm_char_set_unfold, scm_char_set_unfold_x, scm_char_set_for_each)
	  (scm_char_set_map, scm_char_set_copy, scm_char_set, scm_list_to_char_set)
	  (scm_list_to_char_set_x, scm_string_to_char_set, scm_string_to_char_set_x)
	  (scm_char_set_filter, scm_char_set_filter_x, scm_ucs_range_to_char_set)
	  (scm_ucs_range_to_char_set_x, scm_to_char_set, scm_char_set_size)
	  (scm_char_set_count, scm_char_set_to_list, scm_char_set_to_string)
	  (scm_char_set_contains_p, scm_char_set_every, scm_char_set_any)
	  (scm_char_set_adjoin, scm_char_set_delete, scm_char_set_adjoin_x)
	  (scm_char_set_delete_x, scm_char_set_complement, scm_char_set_union)
	  (scm_char_set_intersection, scm_char_set_difference, scm_char_set_xor)
	  (scm_char_set_diff_plus_intersection, scm_char_set_complement_x)
	  (scm_char_set_union_x, scm_char_set_intersection_x, scm_char_set_difference_x)
	  (scm_char_set_xor_x, scm_char_set_diff_plus_intersection_x): modified
	  to use new charset and charset-cursor data structures
	  (CSET_BLANK_PRED, CSET_SYMBOL_PRED, CSET_PUNCT_PRED, CSET_LOWER_PRED)
	  (CSET_UPPER_PRED, CSET_LETTER_PRED, CSET_DIGIT_PRED, CSET_WHITESPACE_PRED)
	  (CSET_CONTROL_PRED, CSET_HEX_DIGIT_PRED, CSET_ASCII_PRED, CSET_LETTER_PRED)
	  (CSET_LETTER_AND_DIGIT_PRED, CSET_PRINTING_PRED, CSET_TRUE_PRED)
	  (CSET_FALSE_PRED): removed
	  (scm_srfi_14_compute_char_sets): removed - too slow to iterate
	  over all of unicode at startup
	  (scm_debug_char_set) [SCM_CHARSET_DEBUG]: new function

2009-08-27  Daniel Kraft  <d@domob.eu>

	Don't accept backquote/unquote/unquote-splicing any longer in elisp.
	The real names \`, \, and \,@ should be used instead and are returned
	now by the real reader.

	* module/language/elisp/compile-tree-il.scm: Only accept correct names.

2009-08-27  Andy Wingo  <wingo@pobox.com>

	Revert "eval is actually compile"
	This reverts commit afe5e6baa76796b1467890fd55416a7f304bed5c.

2009-08-27  Ken Raeburn  <raeburn@raeburn.org>

	Don't leave and reenter guile mode if mutex is available
	On Aug 5, 2009, at 10:06, Ken Raeburn wrote:
	> (1) In scm_pthread_mutex_lock, we leave and re-enter guile mode so
	> that we don't block the thread while in guile mode.  But we could
	> use pthread_mutex_trylock first, and avoid the costs scm_leave_guile
	> seems to incur on the Mac.  If we can't acquire the lock, it should
	> return immediately, and then we can do the expensive, blocking
	> version.  A quick, hack version of this changed my run time for
	> A(3,8) from 17.5s to 14.5s, saving about 17%; sigaltstack and
	> sigprocmask are still in the picture, because they're called from
	> scm_catch_with_pre_unwind_handler.  I'll work up a nicer patch
	> later.

	Ah, we already had scm_i_pthread_mutex_trylock lying around; that made
	things easy.
	A second timing test with A(3,9) and this version of the patch (based
	on 1.9.1) shows the same improvement.

	* libguile/threads.c (scm_pthread_mutex_lock): Try the mutex before
	  leaving and reentering guile mode.

2009-08-27  Ken Raeburn  <raeburn@raeburn.org>

	Pick up in tree headers rather than installed ones
	From Ken Raeburn:

	The Mac build off of "master" fails for me currently in srfi-13.c,
	with the comparison-always-false warning Greg discussed.  I hacked
	around that, but then guile-readline doesn't build:

	Making all in guile-readline
	../libguile/guile-snarf -o readline.x ../../guile-readline/readline.c
	-
	DHAVE_CONFIG_H  -I. -I.. -I../../guile-readline/.. -I../../guile-
	readline/lib -I./lib  -g -O2
	In file included from ../../guile-readline/readline.c:29:
	../../guile-readline/../libguile.h:25:17: error: gmp.h: No such file
	or directory
	In file included from ../../guile-readline/../libguile.h:95,
	                 from ../../guile-readline/readline.c:29:
	../../guile-readline/../libguile/strings.h:26:21: error: uniconv.h: No
	such file or directory

	Neither the path specified for libgmp nor the path specified for
	libunistring at configure time is included here.

	I don't think any of this is Mac-specific; I'm surprised that it works
	on GNU/Linux systems.  Perhaps I'm building it in ways that are
	unusual for the other developers (build dir != src dir, libgmp and
	guile-1.8 installed in the same place, libgmp and libunistring
	installed in different nonstandard directories)?

	If I use CPPFLAGS=... and LDFLAGS=... instead of --with-libfoo-prefix
	configure options to specify paths to find libgmp and libunistring,
	the tests still pick old, installed Guile headers (which this time
	I've poisoned to highlight the problem) from those locations instead
	of the in-tree versions:

	Making all in test-suite
	Making all in standalone
	../../libguile/guile-snarf -o test-asmobs-lib.x ../../../test-suite/
	standalone/test-asmobs-lib.c -DHAVE_CONFIG_H
	-I. -I../../../test-suite/ standalone -I../.. -I/opt/local/include
	-I/Users/raeburn/dev/guile/ libunistring-0.9.1/I/include -g -O2
	-I../../.. -I../../../lib -I../../ lib -I../..
	In file included from /opt/local/include/libguile.h:30,
	                 from ../../../test-suite/standalone/test-asmobs-
	lib.c:23:
	/opt/local/include/libguile/__scm.h:3:2: error: #error Poison!

	I might be building Guile as part of a larger package
	(*cough*Emacs*cough*) that wants to include stuff from the same system
	directories (e.g., for MacPorts, pkgsrc, whatever) where an old
	version of Guile is installed, and thus Guile gets passed CPPFLAGS/
	LDFLAGS settings that add that old version to the search paths.  So I
	think the CPPFLAGS/LDFLAGS version needs to be made to work, as well
	as the --with-libfoo-prefix version.

	With the attached patch, I can get guile to build with CPPFLAGS= and
	LDFLAGS= ... someone more familiar than I am with automake will have
	to fix the guile-readline stuff.

2009-08-26  Daniel Kraft  <d@domob.eu>

	Error in lexer when 'empty' symbol would have been read.

	Parser for elisp and use it as reader.
	* module/language/elisp/parser.scm: New parser file.
	* module/language/elisp/lexer.scm: Fix lexer/1 and add unquote-splicing support.
	* module/language/elisp/spec.scm: Use new elisp-reader.
	* module/language/elisp/README: Document we've got a reader now.
	* test-suite/tests/elisp-reader.test: Test the parser.

	get-lexer/1 for elisp that finishes after the first full expression is read.
	* module/language/elisp/lexer.scm: Add get-lexer/1.
	* test-suite/tests/elisp-reader.test: Test lexer/1.

	Character and string literal support for the elisp lexer.
	* module/language/elisp/lexer.scm: Handle character and string literals.
	* test-suite/tests/elisp-reader.test: Test it.

	A first, rough lexer for elisp still missing some stuff.
	* module/language/elisp/lexer.scm: New lexer file.
	* test-suite/Makefile.am: Register elisp-reader.test as new test.
	* test-suite/tests/elisp-reader.test: New test-case.

2009-08-26  Andy Wingo  <wingo@pobox.com>

	fix uninitialized variable in scm_read_character
	* libguile/read.c (scm_read_character): Fix uninitialized variable.

	actually install guile-tools
	* meta/Makefile.am (bin_SCRIPTS): Re-add guile-tools here (removed in
	  54b38caf19deb0e5a6e8146c65b3e176e7fffa60). Otherwise guile-tools
	  doesn't get installed. I think that 1.9.2 had this bug.

	fix guile-readline linker bug
	* acinclude.m4 (GUILE_READLINE): Fix typo that caused readline not to be
	  linked to termcap.

2009-08-25  Ludovic Courtès  <ludo@gnu.org>

	Remove the `scm_tc_free_cell' SMOB type.
	* libguile/deprecated.h (SCM_FREEP, SCM_NFREEP): Changed to constants.

	* libguile/gc.c (scm_i_tag_name): Remove reference to
	  `scm_tc_free_cell'.

	* libguile/gc.h (SCM_FREE_CELL_CDR, SCM_SET_FREE_CELL_CDR): Remove.

	* libguile/smob.c (free_print): Remove.
	  (scm_smob_prehistory): Don't create the "free" SMOB type.

	* libguile/struct.c (struct_finalizer_trampoline): Use a bare
	  `scm_tc3_struct' tag for finalized structs instead of
	  `scm_tc_free_cell'.

	* libguile/tags.h (scm_tc_free_cell): Remove.

2009-08-25  Andy Wingo  <wingo@pobox.com>

	Merge commit 'origin/master'
	Conflicts:
		libguile/unif.c

	Merge wip-array refactor, up to cd43fdc5b7a7c
	Conflicts:
		NEWS
		libguile/print.c

2009-08-25  Michael Gran  <spk121@yahoo.com>

	Add full Unicode capability to ports and the default reader
	Ports are given two additional properties: a character encoding and
	a conversion failure strategy.  These properties have getters and setters.
	The new properties are used to convert any locale text to/from the
	internal representation of strings.

	If unspecified, ports use a default value. The default value of these
	properties is held in a fluid.  The default character encoding can be
	modified by calling setlocale.

	ISO-8859-1 is treated specially.  Since it is a native encoding of
	strings, it can be processed more quickly.  Source code is assumed to be
	ISO-8859-1 unless otherwise specified.  The encoding of a source code
	file can be given as 'coding: XXXXX' in a magic comment at the top of a
	file.

	The C functions that deal with encoding often use a null pointer
	as shorthand for the native Latin-1 encoding, for efficiency's sake.

	* test-suite/tests/encoding-iso88591.test: new tests
	* test-suite/tests/encoding-iso88597.test: new tests
	* test-suite/tests/encoding-utf8.test: new tests
	* test-suite/tests/encoding-escapes.test: new tests
	* test-suite/tests/numbers.test: declare 'binary' encoding
	* test-suite/tests/ports.test: declare 'binary' encoding
	* test-suite/tests/r6rs-ports.test: declare 'binary' encoding

	* module/system/base/compile.scm (compile-file): use source-code
	  file's self-declared encoding when compiling files

	* libguile/strports.c: store string ports in locale encoding
	  (scm_strport_to_locale_u8vector, scm_call_with_output_locale_u8vector)
	  (scm_open_input_locale_u8vector, scm_get_output_locale_u8vector):
	  new functions

	* libguile/strings.h: new declaration for scm_i_string_contains_char

	* libguile/strings.c (scm_i_string_contains_char): new function
	  (scm_from_stringn, scm_to_stringn):  use NULL for Latin-1
	  (scm_from_locale_stringn, scm_to_locale_stringn): respect character
	  encoding of input and output ports

	* libguile/read.h: declaration for scm_scan_for_encoding

	* libguile/read.c:
	  (read_token): now takes scheme string instead of C string/length
	  (read_complete_token): new function
	  (scm_read_sexp, scm_read_number, scm_read_mixed_case_symbol)
	  (scm_read_number_and_radix, scm_read_quote, scm_read_semicolon_comment)
	  (scm_read_srfi4_vector, scm_read_bytevector, scm_read_guile_bit_vector)
	  (scm_read_scsh_block_comment, scm_read_commented_expression)
	  (scm_read_extended_symbol, scm_read_sharp_extension, scm_read_shart)
	  (scm_read_expression): use scm_t_wchar for char type, use read_complete_token
	  (scm_scan_for_encoding): new function to find a file's character encoding
	  (scm_file_encoding): new function to find a port's character encoding

	* libguile/rdelim.c: don't unpack strings

	* libguile/print.h: declaration for modified function
	  scm_i_charprint

	* libguile/print.c: use locale when printing characters and
	  strings
	  (scm_i_charprint): input parameter is now scm_t_wchar
	  (scm_simple_format): don't unpack strings

	* libguile/posix.h: new declaration for scm_setbinary.

	* libguile/posix.c (scm_setlocale): set default and stdio port
	  encodings based on the locale's character encoding
	  (scm_setbinary): new function

	* libguile/ports.h (scm_t_port): add encoding and failed
	  conversion handler to port type.  Declarations for new or modified
	  functions scm_getc, scm_unget_byte, scm_ungetc,
	  scm_i_get_port_encoding, scm_i_set_port_encoding_x,
	  scm_port_encoding, scm_set_port_encoding_x,
	  scm_i_get_conversion_strategy, scm_i_set_conversion_strategy_x,
	  scm_port_conversion_strategy, scm_set_port_conversion_strategy_x.

	* libguile/ports.c: assign the current ports to zero on startup so
	  we can see if they've been set.
	  (scm_current_input_port, scm_current_output_port,
	  scm_current_error_port): return #f if the port is not yet
	  initialized
	  (scm_new_port_table_entry): set up a new port's encoding and
	  illegal sequence handler based on the thread's current defaults
	  (scm_i_remove_port): free port encoding name when port is removed
	  (scm_i_mode_bits_n): now takes a scheme string instead of a c
	  string and length.  All callers changed.
	  (SCM_MBCHAR_BUF_SIZE): new const
	  (scm_getc): new function, since the scm_getc in inline.h is now
	  scm_get_byte_or_eof.  This pulls one codepoint from a port.
	  (scm_lfwrite_substr, scm_lfwrite_str): now uses port's encoding
	  (scm_unget_byte): new function, incorportaing the low-level functionality
	  of scm_ungetc
	  (scm_ungetc): uses scm_unget_byte

	* libguile/numbers.h (scm_t_wchar): compilation order problem with
	  scm_t_wchar being use in functions in multiple headers.  Forward
	  declare scm_t_wchar.

	* libguile/load.c (scm_primitive_load): scan for file encoding at
	  top of file and use it to set the load port's encoding

	* libguile/inline.h (scm_get_byte_or_eof): new function
	  incorporating most of the functionality of scm_getc.

	* libguile/fports.c (fport_fill_input): now returns scm_t_wchar

	* libguile/chars.h (scm_t_wchar): avoid compilation order problem
	  with declaration of scm_t_wchar

2009-08-23  Michael Gran  <spk121@yahoo.com>

	Avoid unpacking symbols in GOOPS
	* libguile/goops.c (scm_make_extended_class_from_symbol): new function
	  (scm_class_of): don't unpack symbol chars
	  (wrap_init): don't unpack symbol chars
	  (make_class_from_symbol): new function
	  (make_struct_class): don't unpack symbol chars

2009-08-23  Michael Gran  <spk121@yahoo.com>

	Modify socket and time functions for wide strings
	* libguile/socket.c (scm_recv): receive the message without holding the
	  stringbuf writing lock
	  (scm_send): try to narrow a string before using it

	* libguile/stime.c (strftime): convert string to UTF-8 so that it can
	  be safely passed to strftime
	  (strptime): convert input string to UTF-8 so that it can be safely
	  passed through strptime

	* libguile/strings.c (narrow_stringbuf): new function
	  (scm_i_try_narrow_string): new function

	* libguile/strings.h: new declaration for scm_i_try_narrow_string

2009-08-23  Michael Gran  <spk121@yahoo.com>

	Use string and symbol accessors in struct, throw, and array funcs
	* libguile/struct.c (scm_make_struct_layout, scm_struct_init)
	  (scm_struct_vtable_p, scm_struct_ref, scm_struct_set_x): use string
	  and symbol accessors and avoid unpacking strings and symbols

	* libguile/throw.c (scm_ithrow): allow wide symbols in the error message

	* libguile/unif.c (scm_enclose_array, scm_istr2bve): use string
	  accessors and avoid unpacking strings

2009-08-23  Michael Gran  <spk121@yahoo.com>

	Avoid type-punning warning in scm_gentemp
	Int and size_t may not have the same storage size

	* libguile/deprecated.c (scm_gentemp): use size_t for string length

2009-08-21  Neil Jerram  <neil@ossau.uklinux.net>

	Update NEWS

2009-08-22  Neil Jerram  <neil@ossau.uklinux.net>

	Avoid clash with system setjmp/longjmp on IA64
	Problem was that if an application includes both libguile.h and the
	system's setjmp.h, and is compiled on IA64, it gets compile errors
	because of jmp_buf, setjmp and longjmp being multiply defined.

	* libguile/__scm.h (__ia64__): Define scm_i_jmp_buf, SCM_I_SETJMP and
	  SCM_I_LONGJMP instead of jmp_buf, setjmp and longjmp.

	  (all other platforms): Map scm_i_jmp_buf, SCM_I_SETJMP and
	  SCM_I_LONGJMP to jmp_buf, setjmp and longjmp.

	* libguile/continuations.c (scm_make_continuation): Use `SCM_I_SETJMP'
	  instead of `setjmp'.
	  (copy_stack_and_call): Use `SCM_I_LONJMP' instead of `longjmp'.
	  (scm_ia64_longjmp): Use type `scm_i_jmp_buf' instead of `jmp_buf'.

	* libguile/continuations.h (scm_t_contregs): Use type `scm_i_jmp_buf'
	  instead of `jmp_buf'.

	* libguile/threads.c (suspend): Use `SCM_I_SETJMP' instead of
	  `setjmp'.

	* libguile/threads.h (scm_i_thread): Use type `scm_i_jmp_buf' instead
	  of `jmp_buf'.

	* libguile/throw.c (JBJMPBUF, make_jmpbuf, jmp_buf_and_retval): Use
	  type `scm_i_jmp_buf' instead of `jmp_buf'.
	  (scm_c_catch): Use `SCM_I_SETJMP' instead of `setjmp'.
	  (scm_ithrow): Use `SCM_I_LONGJMP' instead of `longjmp'.

2009-08-22  Neil Jerram  <neil@ossau.uklinux.net>

	Remove trailing whitespace

	Fix set-source-properties so that the special source properties work
	* libguile/srcprop.c (scm_set_source_properties_x): Look for the special
	  source properties, save them off, and then construct a srcprops object
	  using them.

2009-08-22  Neil Jerram  <neil@ossau.uklinux.net>

	In srcprop.c change all occurrences of "plist" to "alist"
	As with the previous commit, this is to avoid any suggestion that
	the source properties API uses the property list format, i.e.
	(key1 value1 key2 value2 ...).

	Also remove scm_srcprops_to_plist () from the API.  It doesn't have any
	external usefulness and has never documented.

2009-08-22  Neil Jerram  <neil@ossau.uklinux.net>

	Minor improvements to doc on source properties
	In particular avoid any suggestion that the API uses the
	property list format, i.e. (key1 value1 key2 value2 ...),
	as opposed to the alist format that it actually does use.

2009-08-21  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'wip-manual' of ssh://ossau@git.sv.gnu.org/srv/git/guile
	Conflicts:

		doc/ref/autoconf.texi
		doc/ref/vm.texi

2009-08-21  Michael Gran  <spk121@yahoo.com>

	Use uc_tolower in number conversion
	* libguile/numbers.c (XDIGIT2UINT): use uc_tolower

2009-08-21  Michael Gran  <spk121@yahoo.com>

	Use string accessors for string->number conversion
	* libguile/numbers.c (scm_i_print_fraction): use string accessors
	  (XDIGIT2UINT): use libunistring function
	  (mem2uinteger, mem2integer, mem2decimal_from_point, mem2ureal)
	  (mem2complex): take scheme string instead of c string; use accessors
	  (scm_i_string_to_number): new function
	  (scm_c_locale_string_to_number): use scm_i_string_to_number

	* libguile/numbers.h: declaration for scm_i_string_to_number

	* libguile/strings.c (scm_i_string_strcmp): new function

	* libguile/strings.h: declaration for scm_i_string_strcmp

2009-08-21  Michael Gran  <spk121@yahoo.com>

	Add initial support for wide symbols
	* libguile/hash.c (scm_i_string_hash): new function
	  (scm_hasher): don't unpack string: use scm_i_string_hash

	* libguile/hash.h: new declaration for scm_i_string_hash

	* libguile/print.c (quote_keywordish_symbol): use symbol accessors
	  (scm_i_print_symbol_name): new function
	  (scm_print_symbol_name): call scm_i_print_symbol_name
	  (iprin1): use scm_i_print_symbol_name to print symbols

	* libguile/print.h: new declaration for scm_i_print_symbol_name

	* libguile/symbols.c (lookup_interned_symbol): now takes scheme string
	  instead of c string; callers changed
	  (lookup_interned_symbol): add wide symbol support
	  (scm_i_c_mem2symbol): removed
	  (scm_i_mem2symbol): removed and replaced with scm_i_str2symbol
	  (scm_i_str2symbol): new function
	  (scm_i_mem2uninterned_symbol): removed and replaced with
	  scm_i_str2uninterned_symbol
	  (scm_i_str2uninterned_symbol): new function
	  (scm_make_symbol, scm_string_to_symbol, scm_from_locale_symbol)
	  (scm_from_locale_symboln): use scm_i_str2symbol

	* test-suite/tests/symbols.test: new tests

2009-08-21  Michael Gran  <spk121@yahoo.com>

	Use symbol accessors in scm_gc_mark_dependencies
	* libguile/gc-mark.c (scm_gc_mark_dependencies): don't unpack symbols.
	  Use symbol accessors.

	Use string accessors in scm_basename and scm_dirname
	* libguile/filesys.c (basename, dirname): don't unpack strings.
	  Use string accessor functions.

	Avoid type-limits warning in SCM_TO_TYPE_PROTO
	* libguile/conv-uinteger.i.c (SCM_TO_TYPE_PROTO): avoid a comparison
	  that is always true due to the limited range of the data type

	Type-limits error in GC environment initialization
	* libguile/gc-malloc.c (scm_gc_init_malloc): GUILE_INIT_MALLOC_LIMIT
	  is cast to unsigned then tested as if it were still signed

2009-08-21  Michael Gran  <spk121@yahoo.com>

	Avoid accessing symbol internals in call_dsubr_1 and DEVAL
	The symbol's characters are only accessed in case they are needed
	for an error message.  This can be avoided by passing the symbol
	all the way to a error message function.

	* libguile/__scm.h (SCM_WTA_DISPATCH_1_SUBR): new macro

	* libguile/error.c (scm_i_wrong_type_arg_symbol): new error function

	* libguile/error.h: declaration of scm_i_wrong_type_arg_symbol

	* libguile/eval.c (call_dsubr_1): use new macro SCM_WTA_DISPATCH_1_SUBR
	  to avoid having to unpack the symbol's chars

	* libguile/eval.i.c: use new macro SCM_WTA_DISPATCH_1_SUBR

2009-08-21  Michael Gran  <spk121@yahoo.com>

	Use string and symbol accessors with obarrays and keyword-dash-symbols
	* libguile/deprecated.c (intern_obarray_soft): new function
	  (scm_intern_obarray_soft, scm_string_to_obarray_symbol): use
	  intern_obarray_soft
	  (scm_gentemp): don't unpack string chars, use intern_obarray_soft

	* libguile/discouraged.c (scm_make_keyword_from_dash_symbol): use
	  symbol accessor

2009-08-21  Ludovic Courtès  <ludo@gnu.org>

	Aggregate `guile-readline' makefiles.
	* configure.ac: Don't produce `guile-readline/ice-9/Makefile'.

	* guile-readline/Makefile.am (SUBDIRS): Remove.
	  (ice9dir, nobase_ice9_DATA): New, formerly under `ice-9'.
	  (ETAGS_ARGS, EXTRA_DIST): Augment.
	  (DEFS): Move outside of `if'.
	  (MKDEP): Remove.

	* guile-readline/ice-9/Makefile.am: Remove.

2009-08-21  Ludovic Courtès  <ludo@gnu.org>

	Don't use a sub-`configure' for `guile-readline'.
	* acinclude.m4 (GUILE_READLINE): New macro, based on the former
	  `guile-readline/configure.ac'.

	* configure.ac: Remove `AC_CONFIG_SUBDIRS' invocation.  Add
	  `GUILE_READLINE' invocation.  Produce files under `guile-readline'.

	* guile-readline/Makefile.am: Conditionalize the meat under
	  `HAVE_READLINE'.
	  (INCLUDES): Rename to...
	  (AM_CPPFLAGS): this.  Users updates.
	  (AM_CFLAGS): New variable.
	  (libguilereadline_v_@LIBGUILEREADLINE_MAJOR@_la_LIBADD): Add
	  $(READLINE_LIBS).

	* guile-readline/readline.c: Include <config.h>.

	* guile-readline/configure.ac, guile-readline/autogen.sh: Remove.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	eval is actually compile
	* module/ice-9/boot-9.scm (eval): Here at the tail of boot-9, replace
	  the root definition of `eval' with a procedure that will call
	  `compile'.

	* test-suite/tests/syntax.test ("top-level define"):
	  ("internal define"): Run unmemoization tests in the interpreter, using
	  primitive-eval.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	programs have their own tc7 now
	* libguile/tags.h (scm_tc7_program):
	* libguile/programs.h: Programs now have their own tc7 code. Fix up the
	  macros appropriately.

	* libguile/programs.c: Remove smobby bits, leaving marking, printing,
	  and application for other parts of Guile.

	* libguile/debug.c (scm_procedure_source):
	* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
	  (scm_trampoline_2): Add cases for tc7_program.
	* libguile/eval.i.c (CEVAL, SCM_APPLY):
	* libguile/evalext.c (scm_self_evaluating_p):
	* libguile/gc-card.c (scm_i_sweep_card, scm_i_tag_name):
	* libguile/gc-mark.c (1):
	* libguile/print.c (iprin1):
	* libguile/procs.c (scm_procedure_p, scm_thunk_p)
	* libguile/vm-i-system.c (make-closure): Adapt to new procedure
	  representation.

	* libguile/procprop.c (scm_i_procedure_arity): Do the right thing for
	  programs.
	* test-suite/tests/procprop.test ("procedure-arity"): Arity test now
	  succeeds.

	* libguile/goops.c (scm_class_of): Programs now belong to the class
	  <procedure>, not a smob class.

	* libguile/vm.h (struct vm, struct vm_cont):
	* libguile/vm-engine.c (vm_engine):
	* libguile/frames.h (SCM_FRAME_BYTE_CAST, struct vm_frame):
	* libguile/frames.c (scm_c_make_vm_frame): Fix usages of scm_byte_t,
	  changing them to scm_t_uint8.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	eval-elisp uses primitive-eval
	* lang/elisp/interface.scm (eval-elisp): Use primitive-eval, as we will
	  be switching the evaluator soon.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	define @bind using syntax-case
	* module/ice-9/boot-9.scm (@bind): Define a VM-compatible syntax
	  definition for this old evaluator primitive.

	* test-suite/tests/dynamic-scope.test: Change the expected error
	  messages.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	use primitive-eval in run-vm-tests.scm
	* testsuite/run-vm-tests.scm (run-vm-tests): Use primitive-eval, as
	  we'll be changing eval soon.

	better VM error messages
	* libguile/vm-engine.c: Attempt to make error messages more friendly
	  and uniform with historical expectation.

	update docs for calling convention change
	* doc/ref/vm.texi: Update.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	push new frame on stack before procedure & args
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump

	* libguile/vm-engine.c (vm_engine): Push a frame corresponding to the
	  mv-call.

	* libguile/vm-i-system.c: Renumber ops.
	  (new-frame): New op, pushes a frame.
	  (call, mv-call): No need to shuffle args, though we do need to pop the
	  frame in the non-vm call case.
	  (goto/args): Inconsequential tweaks.
	  (call/cc): Push a frame if needed.

	* module/language/tree-il/compile-glil.scm (flatten): Emit `new-frame'
	  as appropriate.

	* test-suite/tests/tree-il.test: Fix to expect new-frame.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	reorder frame layout
	* libguile/frames.h: Reorder the frame layout so the return address
	  comes below the arguments.working
	  (SCM_FRAME_SET_RETURN_ADDRESS, SCM_FRAME_SET_MV_RETURN_ADDRESS): New
	  macros.

	* libguile/frames.c (scm_vm_frame_arguments): Use the macros to access
	  the arguments.

	* libguile/vm-engine.c (vm_engine): Fix for new calling convention.

	* libguile/vm-engine.h (INIT_FRAME): New macro. Does part of what
	  NEW_FRAME used to do.

	* libguile/vm-i-system.c (call, mv-call): Shuffle args up to make room
	  for the stack, and adapt to new calling convention.
	  (goto/args): Shuffling down is easier now.
	  (return, return/args): Adapt to new frame layout.

	* libguile/vm.c (vm_mark_stack): Adapt to new frame layout, and the
	  possibility of there being crap on the stack.
	  (really_make_boot_program): Remove extraneous comment.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	remove dead weight from vm-i-system.c
	* libguile/vm-i-system.c: Remove mark, list-mark, cons-mark,
	  vector-mark, and list-break, as they are no longer used.
	  (call, goto/args, mv-call): Remove bits about trampolines, which was
	  slower, and VM continuations, which are not used (we use Guile's
	  continuations as the applicable objects).

	  Renumber ops.

	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	disable autocompilation in the test suite
	* check-guile.in: Disable autocompilation while working in the test
	  suite, for now at least. We'll enable it again later.

2009-08-20  Andy Wingo  <wingo@pobox.com>

	autocompiled files before installation go to a cache dir in the builddir
	* libguile/load.c (scm_init_load_path): Append a slash after
	  XDG_CACHE_HOME.

	* meta/gdb-uninstalled-guile.in:
	* meta/guile.in (XDG_CACHE_HOME): Export this var so we write to a cache
	  within the build directory. Probably we should have a GUILE_CACHE_DIR
	  to be more specific, though.

	* Makefile.am (clean-local): Clear the cache when making clean.

2009-08-20  Michael Gran  <spk121@yahoo.com>

	type limits error in string-tabulate
	* libguile/srfi-13.c (scm_string_tabulate): test range of signed integer
	  before casting it to unsigned size_t

2009-08-20  Ludovic Courtès  <ludo@gnu.org>

	Relax assumptions made in the precise VM stack marking procedure.
	* libguile/vm.c (vm_stack_mark): Change assertions into checks to
	  determine whether VM points to a sane (initialized) object.  The
	  assumption previously was that free-list elements would be zeroed, as
	  implied by the comment in <gc/gc_mark.h>, but this doesn't appear to
	  be the case.

2009-08-20  Michael Gran  <spk121@yahoo.com>

	Update srfi-13 functions for Unicode
	* libguile/srfi-13.c (MY_SUBF_VALIDATE_SUBSTRING_SPEC): new macro
	  (MY_VALIDATE_SUBSTRING_SPEC_COPY): now unused, removed
	  (MY_VALIDATE_SUBSTRING_SPEC_UCOPY): now unused, removed
	  (REF_IN_CHARSET): new macro
	  (race_error)[0]: unused, removed
	  (scm_string_any, scm_string_every, scm_string_tabulate)
	  (scm_substring_to_list, scm_reverse_string_to_list)
	  (scm_reverse_list_to_string, scm_string_join)
	  (s_scm_srfi13_substring_copy, scm_string_copy, scm_string_copy_x)
	  (scm_string_pad, scm_string_pad_right, scm_string_trim)
	  (scm_string_trim_right, scm_string_trim_both, scm_substring_fill_x):
	  (scm_string_compare, scm_string_compare_ci): modified for
	  both wide and narrow strings
	  (compare_string): new function
	  (scm_string_eq, scm_string_neq, scm_string_lt, scm_string_gt)
	  (scm_string_le, scm_string_ge, scm_string_ci_eq, scm_string_ci_neq)
	  (scm_string_ci_lt, scm-string_ci_gt, scm_string_ci_le, scm_string_ci_gt)
	  (scm_substring_hash, scm_string_prefix_length, scm_string_suffix_length)
	  (scm_string_prefix_length_ci, scm_string_suffix_length_ci)
	  (scm_string_prefix_p, scm_string_prefix_ci_p, scm_string_suffix_p)
	  (scm_string_suffix_ci_p, scm_string_index, scm_string_index_right)
	  (scm_string_skip, scm_string_skip_right, scm_string_count)
	  (scm_string_contains, scm_string_contains_ci, string_upcase_x)
	  (scm_substring_upcase_x, scm_substring_upcase, string_downcase_x)
	  (scm_string_downcase_x, scm_string_downcase, scm_string_titlecase_x)
	  (scm_string_titlecase, scm_string_capitalize, scm_string_reverse)
	  (scm_string_reverse_x, scm_string_map, scm_string_map_x)
	  (scm_string_fold, scm_string_fold_right, scm_string_unfold)
	  (scm_string_unfold_right, scm_xsubstring, scm_string_xcopy_x)
	  (scm_string_replace, scm_string_tokenize, scm_string_split)
	  (scm_string_filter, scm_string_delete): modified for both wide and
	  narrow strings

	Some srfi-13 test with wide strings
	* test-suite/tests/srfi-13.test: more tests

2009-08-20  Michael Gran  <spk121@yahoo.com>

	Updates to benchmarks for srfi-13
	Test more of the positive paths.  Add test for string-prefix-ci?
	string-suffix-ci? and string-hash-ci.  Update the counts per test
	to give approximately the same bench/interp time for each test for
	1.8.7.

	* benchmark-suite/benchmarks/srfi-13.bm: update benchmarks

2009-08-20  Michael Gran  <spk121@yahoo.com>

	Avoid possible mutex hang on error message output
	Avoid possible mutex hang when scm_lfwrite_substr is used in error
	message output and when an error has caused the stringbuf write
	mutex to not be unlocked.  scm_lfwrite_substr makes a substring:
	making a substring requires that mutex.

	Hopefully, all cases of non-local jumps when the stringbuf write
	lock is held have been eliminated anyway, making this O.B.E.

	* libguile/ports.c (scm_lfwrite_str): include functionality in this
	  function instead of making this a special case of scm_lfwrite_substr

2009-08-20  Michael Gran  <spk121@yahoo.com>

	Add VM exception in strings.test
	* test-suite/tests/strings.test (exception:wrong-type-arg): change regex

	Try to optimize scm_string for speed
	* libguile/strings.c (scm_string): optimize for speed

2009-08-20  Michael Gran  <spk121@yahoo.com>

	Rename string-width to string-bytes-per-char
	* libguile/strings.h: rename scm_string_width to scm_string_bytes_per_char

	* libguile/strings.c (scm_string_width): renamed to scm_string_bytes_per_char
	  (scm_string_bytes_per_char): renamed from scm_string_width

	* module/language/assembly/compile-bytecode.scm (write-bytecode): string-width
	  -> string-bytes-per-char

	* module/language/glil/compile-assembly.scm (dump-object): string-width
	  -> string-bytes-per-char

2009-08-20  Michael Gran  <spk121@yahoo.com>

	Misleading error message text in scm_i_string_writable_wide_chars
	* libguile/strings.c (scm_i_string_writable_wide_chars): change error text

2009-08-20  Ludovic Courtès  <ludo@gnu.org>

	Implement precise marking of the VM stack.
	Suggested by Andy Wingo.

	* libguile/vm.c (VM_ENABLE_PRECISE_STACK_GC_SCAN): New macro.
	  (vm_stack_gc_kind): New variable.
	  (make_vm)[VM_ENABLE_PRECISE_STACK_GC_SCAN]: Use `GC_generic_malloc ()'
	  to allocate the stack.
	  (vm_stack_mark): New function.
	  (scm_bootstrap_vm)[VM_ENABLE_PRECISE_STACK_GC_SCAN]: Initialize
	  `vm_stack_gc_kind'.

2009-08-20  Ludovic Courtès  <ludo@gnu.org>

	Fix bogus computation of `vm->stack_limit'.
	* libguile/vm.c (make_vm): Remove bogus "- 3" when computing
	  `stack_size'.

	* libguile/vm-engine.h (CHECK_OVERFLOW): Change accordingly.

2009-08-20  Ludovic Courtès  <ludo@gnu.org>

	Simplify the creation of the SMOB GC "kind".
	* libguile/smob.c (smob_freelist): Remove.
	  (scm_smob_prehistory): Adjust accordingly.

	Include "scmconfig.h" in <libguile/boehm-gc.h>.
	* libguile/boehm-gc.h: Use "scmconfig.h".  Check for
	  `SCM_USE_PTHREAD_THREADS', not `SCM_I_GSC_USE_PTHREAD_THREADS'.

2009-08-19  Andy Wingo  <wingo@pobox.com>

	procedure-documentation works on vm procedures
	* libguile/procs.c (scm_procedure_documentation): Add a hack so that
	  this function works for compiled procedures too.

2009-08-19  Michael Gran  <spk121@yahoo.com>

	Display wide strings using escapes
	* libguile/print.c (iprin1): for now, display wide strings
	  as escaped strings

2009-08-19  Michael Gran  <spk121@yahoo.com>

	Avoid double-casts of stringbuf
	Conversion from char to scm_t_wchar require an intermediate cast to
	unsigned char.  By changing the return type of SCM_STRINGBUF_INLINE_CHARS
	to unsigned char *, doublecasts in the code can be avoided.  Also,
	some clarification of return types.

	* libguile/strings.c (STRINGBUF_OUTLINE_CHARS)
	(STRINGBUF_INLINE_CHARS): now returns unsigned char *; all callers changed.

2009-08-19  Michael Gran  <spk121@yahoo.com>

	Avoid compilation warnings in SCM_MAKE_CHAR
	* libguile/chars.h (SCM_MAKE_CHAR): change inequality

2009-08-19  Michael Gran  <spk121@yahoo.com>

	Benchmarks for common character and string procedures
	* benchmark-suite/benchmarks/chars.bm: new benchmarks

	* benchmark-suite/benchmarks/srfi-13.bm: new benchmarks

2009-08-19  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded `scm_without_guile ()' call.
	* libguile/scmsigs.c (read_without_guile_data, do_read_without_guile,
	  read_without_guile): Remove.
	  (signal_delivery_thread): Use read(2) instead of `read_without_guile ()'.

	Reinstate missing IA64 helper functions.
	* libguile/threads.c (scm_ia64_register_backing_store_base,
	  scm_ia64_ar_bsp): New, formerly in `gc.c', which was removed in the
	  BDW-GC branch.

2009-08-18  Ludovic Courtès  <ludo@gnu.org>

	Use `scm_gc_malloc_pointerless ()' for bytevectors.
	* libguile/bytevectors.c (make_bytevector): Use
	  `scm_gc_malloc_pointerless ()' for the buffer itself.

	* libguile/r6rs-ports.c (scm_get_bytevector_some,
	  scm_get_bytevector_all, bop_buffer_grow): Likewise.

2009-08-18  Andy Wingo  <wingo@pobox.com>

	remove (ice-9 lineio)'s dependency on (ice-9 readline)
	* module/ice-9/lineio.scm: Use (ice-9 rdelim) instead of (ice-9
	  readline) to remove readline dependency.

2009-08-18  Andy Wingo  <wingo@pobox.com>

	`load' autocompiles
	* libguile/load.h:
	* libguile/load.c (scm_sys_warn_autocompilation_enabled): New primitive,
	  not exported. Since `load' autocompiles now, it should warn in the
	  same way that the bits hardcoded into C warn.
	  (scm_try_autocompile): Use scm_sys_warn_autocompilation_enabled.

	* module/ice-9/boot-9.scm (autocompiled-file-name): New helper.
	  (load): Try autocompiling the argument, if appropriate. Will
	  autocompile files passed on Guile's command line. `primitive-load' is
	  unaffected.

2009-08-18  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded SMOB mark/free procedures.
	* libguile/bytevectors.c (free_bytevector): Remove.
	  (scm_bootstrap_bytevectors): Update accordingly.

	* libguile/r6rs-ports.c (bip_mark, cbp_mark, bop_free, bop_proc_mark):
	  Remove.
	  (initialize_bytevector_input_ports,
	  initialize_custom_binary_input_ports,
	  initialize_bytevector_output_ports,
	  initialize_custom_binary_output_ports): Update accordingly.

2009-08-18  Ludovic Courtès  <ludo@gnu.org>

	Fix malloc/scm_c_take_bytevector mismatch.
	* libguile/bytevectors.c (STRING_TO_UTF): Use `make_bytevector ()'
	  instead of `scm_c_take_bytevector ().
	  (scm_string_to_utf8): Likewise.

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		lib/Makefile.am
		libguile/Makefile.am
		libguile/frames.c
		libguile/gc-card.c
		libguile/gc-freelist.c
		libguile/gc-mark.c
		libguile/gc-segment.c
		libguile/gc_os_dep.c
		libguile/load.c
		libguile/macros.c
		libguile/objcodes.c
		libguile/programs.c
		libguile/strings.c
		libguile/vm.c
		m4/gnulib-cache.m4
		m4/gnulib-comp.m4
		m4/inline.m4

2009-08-17  Ludovic Courtès  <ludo@gnu.org>

	Thanks, Mike.

	Update `NEWS' for commit d8dd381fa781c236ae777ca1ac55b73d3ca91c2a.

2009-08-15  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 1.9.2.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

	Turn off auto-compilation to stand-alone tests.
	* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Add
	  "GUILE_AUTO_COMPILE=0".

2009-08-15  Ludovic Courtès  <ludo@gnu.org>

	Update the manual and `NEWS' regarding `guile-2.0.pc'.
	* NEWS: Mention `guile-2.0.pc'.

	* doc/ref/autoconf.texi (Autoconf Macros): Update to `guile-2.0'.

2009-08-15  Ludovic Courtès  <ludo@gnu.org>

	Add proper `--help' and `--version' for `guile-tools compile'.
	* configure.ac: Produce `meta/guile-tools'.

	* meta/Makefile.am (EXTRA_DIST): Add `guile-tools.in'.
	  (bin_SCRIPTS): Remove `guile-tools'.

	* meta/uninstalled-env.in (PATH): Add "${top_builddir}/meta".

	* module/scripts/compile.scm (%options): Add `--version'.
	  (parse-args): Show the offending option name upon error.
	  (show-version): New.
	  (compile): Use `%guile-bug-report-address'.

2009-08-15  Andy Wingo  <wingo@pobox.com>

	update NEWS for 1.9.2
	* NEWS: Update.

2009-08-15  Ludovic Courtès  <ludo@gnu.org>

	Update `.gitignore' for GNU Global.

2009-08-15  Ludovic Courtès  <ludo@gnu.org>

	Switch from `guile-1.8.pc' to `guile-2.0.pc'.
	* configure.ac: Produce guile-2.0*.pc.

	* meta/Makefile.am (EXTRA_DIST): Rename guile-1.8*.pc.in to
	  guile-2.0*.pc.in.
	  (pkgconfig_DATA): Update accordingly.

	* meta/guile-config (guile-module): Likewise.

2009-08-13  Ludovic Courtès  <ludo@gnu.org>

	Uncomment run-time objcode alignment check.
	This should now work thanks to the changes in
	28b119ee3da0f4b14cb87e638794d22843778cda ("make sure all programs are
	8-byte aligned").  This commit is a follow-up to
	ec99fe8ecb412e49e8e981246eb62ca46b32754b ("Add FIXMEs about misaligned
	objcode-metas.").

	* libguile/objcodes.c (scm_c_make_objcode_slice): Uncomment assertion
	  that checks for proper alignment of PTR.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Update
	  comment about META's alignment.

2009-08-13  Ludovic Courtès  <ludo@gnu.org>

	Remove deprecated semi-public memoizers.
	* libguile/eval.c (scm_m_expand_body, scm_macroexp, scm_unmemocar):
	  Remove.
	  (scm_m_undefine): Make `static'.

	* libguile/eval.h (scm_m_undefine, scm_m_expand_body, scm_unmemocar,
	  scm_macroexp): Remove declarations.

2009-08-13  Ludovic Courtès  <ludo@gnu.org>

	Make the evaluator's memoizers private.
	* libguile/eval.c (macroexp): Move upwards.
	  (scm_m_quote, scm_m_begin, scm_m_if, scm_m_set_x, scm_m_and, scm_m_or,
	  scm_m_case, scm_m_cond, scm_m_lambda, scm_m_letstar, scm_m_do,
	  scm_m_quasiquote, scm_m_delay, scm_m_generalized_set_x,
	  scm_m_define, scm_m_letrec, scm_m_let, scm_m_at, scm_m_atat,
	  scm_m_apply, scm_m_cont, scm_m_nil_cond, scm_m_atfop,
	  scm_m_atbind, scm_m_atslot_ref, scm_m_atslot_set_x,
	  scm_m_at_call_with_values, scm_m_eval_when): New static
	  declarations; definitions made static.
	  (s_atslot_ref, s_atslot_set_x): New, from `goops.c'.

	* libguile/eval.h (scm_m_quote, scm_m_begin, scm_m_if, scm_m_set_x,
	  scm_m_vref, scm_m_vset, scm_m_and, scm_m_or, scm_m_case, scm_m_cond,
	  scm_m_lambda, scm_m_letstar, scm_m_do, scm_m_quasiquote, scm_m_delay,
	  scm_m_generalized_set_x, scm_m_future, scm_m_define, scm_m_letrec,
	  scm_m_let, scm_m_at, scm_m_atat, scm_m_apply, scm_m_cont,
	  scm_m_nil_cond, scm_m_atfop, scm_m_atbind, scm_m_atslot_ref,
	  scm_m_atslot_set_x, scm_m_atdispatch, scm_m_at_call_with_values,
	  scm_m_eval_when): Remove public declarations.

	* libguile/goops.c (s_atslot_ref, s_atslot_set_x): Remove.

2009-08-13  Ludovic Courtès  <ludo@gnu.org>

	compiler.test: Enforce evaluation order.
	* test-suite/tests/compiler.test ("psyntax")["redefinition", "compile in
	  current module", "compile in fresh module"]: Use `begin' to enforce
	  evaluation order.  Thanks Andy!

2009-08-13  Ludovic Courtès  <ludo@gnu.org>

	Allow fresh modules to be passed to `compile'.
	* module/ice-9/boot-9.scm (module-name): When making MOD non-anonymous,
	  bind it in the `(%app modules)' name space.

	* test-suite/tests/compiler.test ("psyntax")["compile in current
	  module", "compile in fresh module"]: New tests.

	* test-suite/tests/modules.test ("foundations")["modules don't remain
	  anonymous"]: New test.

2009-08-13  Ludovic Courtès  <ludo@gnu.org>

	Allow redefinitions in compiled code as in `(define round round)'.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	* module/ice-9/psyntax.scm (chi-top)[define-form]: If a same-named
	  imported variable exists, take its value instead of `#f'.

	* test-suite/tests/compiler.test ("psyntax")["redefinition"]: New tests.

2009-08-12  Andy Wingo  <wingo@pobox.com>

	update docs for recent vm/compiler work
	* doc/ref/compiler.texi:
	* doc/ref/vm.texi: Update for recent changes.
	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  Don't print nops, they are distracting.

2009-08-12  Andy Wingo  <wingo@pobox.com>

	"fix" <let>-bound lambda expressions too
	* module/language/tree-il/compile-glil.scm (compile-glil): Compute
	  warnings before optimizing, as unreferenced variables will be
	  optimized out.

	* libguile/_scm.h: Fix C99 comment.

	* module/language/tree-il/fix-letrec.scm (partition-vars): Also analyze
	  let-bound vars.
	  (fix-letrec!): Fix a bug whereby a set! to an unreffed var would be
	  called for value, not effect. Also "fix" <let>-bound lambda
	  expressions -- really speeds up pmatch.

	* test-suite/tests/tree-il.test ("lexical sets", "the or hack"): Update
	  to take into account the new optimizations.

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Don't include libunistring headers in Guile public headers
	This requres the creation of a new type
	scm_t_string_failed_conversion_handler to replace libunistring's
	enum iconveh_ilseq_handler.

	* libguile/strings.h: don't include <uniconv.h>
	(scm_t_string_failed_conversion_handler): new enum type
	(SCM_FAILED_CONVERSION_ERROR, SCM_FAILED_CONVERSION_QUESTION_MARK):
	(SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE): new enum type values

	* libguile/strings.c (scm_to_stringn): now takes type
	scm_t_string_failed_conversion_handler.  All callers changed.

	* libguile/print.c: include <uniconv.h>

	* libguile/ports.c (scm_lfwrite_substr): use
	scm_t_string_conversion_handler's constants

	* libguile/gen-scmconfig.c (SCM_ICONVEH_ERROR):
	(SCM_ICONVEH_QUESTION_MARK, SCM_ICONVEH_ESCAPE_SEQUENCE): store
	iconveh_ilseq_hander constants as #define's

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Regression, scm_string fails to test for circular lists
	* libguile/string.c (scm_string): Restores the functionality
	  where scm_string tests for circular lists

	* test-suite/tests/strings.test: add test for circular lists

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Some signed/unsigned comparison and conversions
	* libguile/ports.c (scm_lfwrite_str, scm_lfwrite_substr): signed/unsigned
	  conversion and comparison

	* libguile/strings.c (scm_string_append): signed/unsigned comparison

2009-08-12  Andy Wingo  <wingo@oblong.net>

	rework the vm support for wide strings
	* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump.

	* libguile/vm-engine.c (vm_error_bad_wide_string_length): New error
	  case.

	* libguile/vm-i-loader.c (load-unsigned-integer, load-integer)
	  (load-keyword): Remove these instructions. The former two are
	  obsoleted by make-int64/make-uint64, the latter via make-keyword.
	  (load-string): Only handle narrow strings.
	  (load-symbol): Only handle narrow symbols. The wide case is handled
	  via make-symbol.
	  (load-wide-string): New instruction, for wide strings.

	* libguile/vm-i-system.c (define): Move here from loaders.c, as now it
	  just takes a sym on the stack.
	  (make-keyword, make-symbol): New instructions.

	* module/language/assembly.scm: Remove removed instructions. No more
	  width byte in load-string etc.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Adapt
	  to change in instruction set.

	* module/language/glil/compile-assembly.scm (glil->assembly): Compile
	  define by pushing the sym then emitting (define).
	  (dump-object): Dump narrow and wide strings differently. Use
	  make-keyword and make-symbol as appropriate.

	* module/language/tree-il/compile-glil.scm (flatten): When compiling a
	  ref to a primitive (not a call), first see if the primitive is
	  actually bound in the root module. (That's not the case with e.g.
	  bytevector-u8-ref).

	* module/system/xref.scm (program-callee-rev-vars): Don't parse out
	  "nexts".

	* test-suite/tests/asm-to-bytecode.test ("compiler"): Adapt to bytecode
	  format change.

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Fix disassembly of strings and symbols
	* module/language/assembly/decompile-bytecode.scm (decode-bytecode):
	  fix disassembly of strings, symbols, keywords, and defines

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Quiet signed/unsigned comparison warnings in chars.[ch]
	* libguile/chars.h (SCM_MAKE_CHAR): quiet signed/unsigned
	  comparison warnings

	* libguile/chars.c (scm_i_charname):
	  (scm_i_charname_to_char): quiet signed/unsigned comparison
	  warnings

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Avoid unitialized and unused warnings in scm_string_append
	* libguile/strings.c (scm_string_append): avoid warnings

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Revert to locale-dependent toupper and tolower
	To avoid leaving Guile in a broken state, the conversion
	from locale-dependent case modification to Unicode case modification
	should be an atomic commit

	* libguile/chars.c (scm_c_upcase): revert to locale-dependent
	  toupper and tolower

2009-08-12  Michael Gran  <spk121@yahoo.com>

	Only pass ints to tolower and toupper
	* libguile/strings.c (unistring_escapes_to_guile_escapes): cast
	  tolower's parameter to int

	* libguile/read.c (CHAR_DOWNCASE): cast tolower's parameter to int

2009-08-12  Andy Wingo  <wingo@pobox.com>

	debitrot the ecmascript compiler
	* module/Makefile.am (ECMASCRIPT_LANG_SOURCES):
	* module/language/ecmascript/compile-ghil.scm:
	* module/language/ecmascript/compile-tree-il.scm: SOURCES): Replace the
	  GHIL compiler with a ->tree-il compiler. Not fully functional, but the
	  basics work.

	* module/language/ecmascript/spec.scm: Only include the tree-il compiler.

	* module/language/ecmascript/tokenize.scm (read-punctuation): Avoid
	  mutating a constant.

2009-08-11  Andy Wingo  <wingo@pobox.com>

	make the fallback path look less like line noise
	* libguile/_scm.h:
	* libguile/load.c: Rework to only include the relevant pieces in the
	  fallback path.

2009-08-11  Andy Wingo  <wingo@pobox.com>

	include objcode cookie in the fallback path
	* libguile/_scm.h (SCM_OBJCODE_COOKIE): Move the objcode cookie define
	  here, so that load.c can use it. This is a private header.

	* libguile/load.c (FALLBACK_DIR): Include the objcode cookie in the
	  fallback path. Should fix problems when objcode changes incompatibly
	  during the 1.9 series.

	* libguile/objcodes.c: Adapt to SCM_OBJCODE_COOKIE move.

	This should fix http://article.gmane.org/gmane.lisp.guile.devel/9059.

2009-08-11  Michael Gran  <spk121@yahoo.com>

	More string and symbol tests
	        * test-suite/tests/strings.test: more tests

	        * test-suite/tests/symbols.test: more tests

2009-08-11  Michael Gran  <spk121@yahoo.com>

	Fix %string-dump and %symbol-dump fields
	        * libguile/strings.c (scm_sys_string_dump): don't print
	        stringbuf. Print read-only status.
	        (scm_sys_symbol_dump): don't print stringbuf.  Print interned
	        status.

2009-08-10  Ludovic Courtès  <ludo@gnu.org>

	Change `defined?' to accept a module as its second argument.
	Reported by Daniel Kraft <d@domob.eu>.

	* doc/ref/api-binding.texi (Binding Reflection): Update documentation of
	  `defined?'.

	* libguile/evalext.c (scm_defined_p): Expect a module as the second
	  argument, not a lexical environment.

2009-08-10  Michael Gran  <spk121@yahoo.com>

	Make scm_charprint and scm_i_string_wide_chars SCM_INTERNAL.
	Also, scm_charprint is renamed to scm_i_charprint.

	        * libguile/strings.h: make scm_i_string_wide_chars internal.

	        * libguile/print.h: rename scm_charprint to scm_i_charprint.  Make
	        internal.

	        * libguile/print.c (scm_i_charprint): renamed from scm_charprint
	        (scm_charprint): renamed to scm_i_charprint. All callers changed.

2009-08-10  Michael Gran  <spk121@yahoo.com>

	Improve %string-dump and %symbol-dump
	%string-dump and %symbol-dump are modified to return assocation lists
	of string and symbol attributes instead of printing to stderr.  They
	are no longer conditional on SCM_DEBUG.

	        * libguile/strings.c (scm_sys_string_dump)
	        (scm_sys_symbol_dump): now returns alist of properties.  No longer
	        require that SCM_DEBUG be defined.
	        (scm_sys_stringbuf_hist): now conditional on
	        SCM_STRING_LENGTH_HISTOGRAM

	        * libguile/strings.h: scm_sys_string_dump and scm_sys_symbol dump
	        are now declared as API

2009-08-10  Michael Gran  <spk121@yahoo.com>

	More comments for string functions
	        * libguile/strings.c: comments

	Missing parentheses in SCM_MAKE_CHAR macro
	* libguile/chars.h (SCM_MAKE_CHAR): missing parentheses

2009-08-10  Michael Gran  <spk121@yahoo.com>

	Port position macros shouldn't require enclosing braces
	The port position macros incorrectly required enclosing braces
	when used within if statements.

	        * libguile/ports.h (SCM_INCLINE, SCM_ZEROCOL, SCM_INCCOL)
	        (SCM_DECCOL, SCM_TABCOL): enclose macro in do/while

	        * libguile/ports.c (update_port_lf): remove extra braces

2009-08-09  Ludovic Courtès  <ludo@gnu.org>

	Use a linker version script for libguile.
	* libguile/Makefile.am (libguile_la_LDFLAGS)[HAVE_LD_VERSION_SCRIPT]:
	  Use `libguile.map'.
	  (EXTRA_DIST): Add `libguile.map'.

	* libguile/libguile.map: New file.

2009-08-09  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `lib-symbol-versions' module.
	* m4/gnulib-cache.m4: Add `lib-symbol-versions'.

	Remove bogus `configure' test for GNU libunistring.
	* configure.ac: Remove explicit test for libunistring, which conflicted
	  with Gnulib's own test.  This fixes commit
	  f4863880f5ef539cb545999c19b6b5c0eec9382d.

2009-08-09  Neil Jerram  <neil@ossau.uklinux.net>

	Misc GOOPS chapter updates
	* doc/ref/goops-tutorial.texi: Update intro text.  Fix `an' typo.

	* doc/ref/goops.texi: Update quick start intro text.  Simplify
	  example that uses `format'.

2009-08-09  Neil Jerram  <neil@ossau.uklinux.net>

	Use #:keyword syntax in preference to :keyword
	because that is Guile's default.

2009-08-09  Neil Jerram  <neil@ossau.uklinux.net>

	In general, use @lisp in preference to @smalllisp
	because it looks better in the DVI output.  Exceptions are

	- wide examples, which would cause overfull hboxes if they
	  used the bigger @lisp font

	- very large examples, which may look too big at the @lisp size.

2009-08-09  Neil Jerram  <neil@ossau.uklinux.net>

	Use @result{} instead of -->
	* doc/ref/goops.texi: Use @result{} instead of -->.

	Update GOOPS Getting Started section
	* doc/ref/goops.texi (Getting Started): Renamed `Quick Start', to fit
	  better with following Tutorial.  Also add a bit more text to the
	  Methods subsection.

2009-08-08  Neil Jerram  <neil@ossau.uklinux.net>

	Minor textual improvements to slot sections

	Move tutorial sections on slots before inheritance
	* doc/ref/goops-tutorial.texi (Instance creation and slot access, Slot
	  description): Move to before Inheritance.

	Change <complex> to <my-complex> in GOOPS tutorial
	* doc/ref/goops-tutorial.texi (Class Definition): Minor text
	  improvements.  Change the class being defined to <my-complex>, to
	  reduce the confusion with the built in <complex> class.

2009-08-08  Neil Jerram  <neil@ossau.uklinux.net>

	Start updating/merging GOOPS getting started / tutorial text
	* doc/ref/goops-tutorial.texi (Introduction): Merge this subsection's
	  non-duplicate text into the introductory text of the whole section,
	  then remove this subsection.

	  (Tutorial): Textual updates to introductory text.

	  (Class definition and instantiation): Rename `Class definition',
	  since that's all it covers.  Remove unnecessary footnote about
	  loading (oop goops) module.

	  (All @nodes): Remove explicit up, next and prev nodes.  (They make
	  the document harder to change.)

	* doc/ref/goops.texi (Tutorial): Move from the end of the GOOPS
	  chapter to the beginning of it.

	  (Running GOOPS): Removed; useful text merged into containing
	  section.

2009-08-08  Neil Jerram  <neil@ossau.uklinux.net>

	Remove page break after heading of Chapter 6 (Modules)
	This brings this chapter into line with the others, which do not have
	page breaks before the first section.

	Use GOOPS Introduction as intorudctory text for the whole GOOPS chapter

2009-08-08  Michael Gran  <spk121@yahoo.com>

	Merge commit 'origin/master'

2009-08-08  Michael Gran  <spk121@yahoo.com>

	Add Unicode strings and symbols
	This adds full Unicode strings as a datatype, and it adds some
	minimal functionality.  The terminal and port encoding is assumed
	to be ISO-8859-1.  Non-ISO-8859-1 characters are written or
	input as string character escapes.

	The string character escapes now have 3 forms: \xXX \uXXXX and
	\UXXXXXX, for unprintable characters that have 2, 4 or 6 hex digits.

	The process for writing to strings has been modified.  There is now a
	function scm_i_string_start_writing that does the copy-on-write
	conversion if necessary.

	To compile strings that may be wide, the VM storage of strings and
	string-likes has changed.

	Most string-using functions have not yet been updated and may break
	when used with wide strings.


	        * module/language/assembly/compile-bytecode.scm (write-bytecode):
	        use variable width string bytecode format

	        * module/language/assembly.scm (byte-length): use variable width
	        bytecode format

	        * libguile/vm-i-loader.c (load-string, load-symbol):
	        (load-keyword, define): use variable-width bytecode format

	        * libguile/vm-engine.h (FETCH_WIDTH): new macro

	        * libguile/strings.h: new declarations

	        * libguile/strings.c (make_wide_stringbuf): new function
	        (widen_stringbuf): new function
	        (scm_i_make_wide_string): new function
	        (scm_i_is_narrow_string): new function
	        (scm_i_string_wide_chars): new function
	        (scm_i_string_start_writing): new function
	        (scm_i_string_ref): new function
	        (scm_i_string_set_x): new function
	        (scm_i_is_narrow_symbol): new function
	        (scm_i_symbol_wide_chars, scm_i_symbol_ref): new function
	        (scm_string_width): new function
	        (unistring_escapes_to_guile_escapes): new function
	        (scm_to_stringn): new function
	        (scm_i_stringbuf_free): modify for wide strings
	        (scm_i_substring_copy): modify for wide strings
	        (scm_i_string_chars, scm_string_append): modify for wide strings
	        (scm_i_make_symbol, scm_to_locale_stringn): modify for wide strings
	        (scm_string_dump, scm_symbol_dump, scm_to_locale_stringbuf):
	        (scm_string, scm_i_deprecated_string_chars): modify for wide strings
	        (scm_from_locale_string, scm_from_locale_stringn): add null test

	        * libguile/srfi-13.c: add calls for scm_i_string_start_writing for
	        each call of scm_i_string_stop_writing
	        (scm_string_for_each): modify for wide strings

	        * libguile/socket.c: add calls for scm_i_string_start_writing for each
	        call of scm_i_string_stop_writing

	        * libguile/rw.c: add calls for scm_i_string_start_writing for each
	        call of scm_i_string_stop_writing

	        * libguile/read.c (scm_read_string): allow reading of wide strings

	        * libguile/print.h: add declaration for scm_charprint

	        * libguile/print.c (iprin1): print wide strings and add new string
	        escapes
	        (scm_charprint): new function

	        * libguile/ports.h: new declarations for scm_lfwrite_substr and
	        scm_lfwrite_str

	        * libguile/ports.c (update_port_lf): new function
	        (scm_lfwrite): use update_port_lf
	        (scm_lfwrite_substr): new function
	        (scm_lfwrite_str): new function

	        * test-suite/tests/asm-to-bytecode.test ("compiler"): add string
	        width byte to sting-like asm tests

2009-08-07  Andy Wingo  <wingo@pobox.com>

	lambda, the ultimate goto
	* module/language/tree-il/analyze.scm (analyze-lexicals): Rework to
	  actually determine when a fixed-point procedure may be allocated as a
	  label.
	* module/language/tree-il/compile-glil.scm (emit-bindings): Always emit
	  a <glil-bind>. Otherwise it's too hard to pair with unbindings.
	  (flatten-lambda): Consequently, here we only `bind' if there are any
	  vars to bind. This doesn't make any difference, given that lambdas
	  don't have trailing unbind instructions, but it does keep the GLIL
	  output the same for thunks -- no extraneous (bind) instructions. Keeps
	  tree-il.test happy.
	  (flatten): Some bugfixes. Yaaay, it works!!!

	implement compilation of label-allocated lambda expressions
	* module/language/tree-il/compile-glil.scm (flatten-lambda, flatten):
	  Implement compilation of label-allocated lambda expressions. Quite
	  tricky, we'll see if this works when the new analyzer lands.

2009-08-07  Andy Wingo  <wingo@pobox.com>

	add label alist to lambda allocations in tree-il->glil compiler
	* module/language/tree-il/analyze.scm: Add some more comments about
	  something that will land in a future commit: compiling fixpoint
	  lambdas as labels.
	  (analyze-lexicals): Reorder a bit, and add a label alist to procedure
	  allocations. Empty for now.

	* module/language/tree-il/compile-glil.scm (flatten): Adapt to the free
	  variables being in the cddr of the allocation, not the cdr.

2009-08-06  Andy Wingo  <wingo@pobox.com>

	loop detection in the house
	* libguile/vm-i-scheme.c (vector-ref, vector-set): Sync registers if we
	  call out to C.

	* module/language/tree-il/compile-glil.scm (flatten-lambda): Add an
	  extra argument, the self-label, which should be the gensym under which
	  the procedure is bound in a <fix> expression.
	  (flatten): If we see a call to a lexical ref to the self-label in a
	  tail position, rename and goto instead of goto/args, which will tear
	  down the frame -- or will, in the future. It's a primitive form of
	  loop detection.

	* module/language/tree-il/primitives.scm (zero?): Expand to (= x 0).

2009-08-06  Andy Wingo  <wingo@pobox.com>

	actually implement "fixing letrec"
	* module/Makefile.am (SOURCES): Reorganize so GHIL is compiled last,
	  along with ecmascript.

	* module/language/scheme/spec.scm: Remove references to GHIL, as it's
	  bitrotten and obsolete..

	* module/language/tree-il.scm (make-tree-il-folder): Rework so that we
	  only have down and up procs, and call down and up on each element.
	* module/language/tree-il/analyze.scm (analyze-lexicals): Fix a thinko
	  handling let-values.

	* module/language/tree-il/fix-letrec.scm: Actually implement fixing
	  letrec. The resulting code will perform better, but violations of the
	  letrec restriction are not detected. This behavior is allowed by the
	  spec, but it is undesirable. Perhaps that will be fixed later.

	* module/language/tree-il/inline.scm (inline!): Fix a case in which
	  ((lambda args foo)) would be erroneously inlined to foo. Remove empty
	  let, letrec, and fix statements.

	* module/language/tree-il/primitives.scm (effect-free-primitive?): New
	  public predicate.

2009-08-06  Andy Wingo  <wingo@pobox.com>

	actually inline call-with-values to tree-il's <let-values>
	* module/srfi/srfi-11.scm (let-values): In the one-clause case, avoid
	  going through temporary variables.

	* module/language/tree-il/inline.scm (inline!): Add another case:
	  (call-with-values (lambda () ...) (lambda ... ...) -> let-values.

	* module/language/tree-il/compile-glil.scm (flatten): Fix a bug
	  compiling applications in "vals" context.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Fix a couple
	  bugs with let-values and rest arguments.

2009-08-06  Neil Jerram  <neil@ossau.uklinux.net>

	Include GOOPS pictures in the distribution

2009-08-05  Andy Wingo  <wingo@pobox.com>

	let-values in terms of syntax-case, add make-tree-il-folder
	* module/language/tree-il.scm (tree-il-fold): Fix for let-values case.
	  (make-tree-il-folder): New public macro, makes a multi-valued folder
	  specific to the number of seeds that the user wants.
	* module/language/tree-il/optimize.scm (optimize!): Reverse the order of
	  inline! and fix-letrec!, as the latter might expose opportunities for
	  the former.
	* module/srfi/srfi-11.scm (let-values): Reimplement in terms of
	  syntax-case, so that its expressions may reference hygienically bound
	  variables. See the NEWS for the rationale.
	  (let*-values): An empty let*-values still introduces a local `let'
	  binding contour.
	* module/system/base/syntax.scm (record-case): Yukkkk. Reimplement in
	  terms of syntax-case. Ug-ly, but see the NEWS again: "Lexical bindings
	  introduced by hygienic macros may not be referenced by nonhygienic
	  macros."

2009-08-05  Andy Wingo  <wingo@pobox.com>

	add <fix> tree-il construct, and compile it
	* libguile/vm-i-system.c (fix-closure): New instruction, for wiring
	  together fixpoint procedures.

	* module/Makefile.am (TREE_IL_LANG_SOURCES): Add fix-letrec.scm.

	* module/language/glil/compile-assembly.scm (glil->assembly): Reindent
	  the <glil-lexical> case, and handle 'fix for locally-bound vars.

	* module/language/tree-il.scm (<fix>): Add the <fix> tree-il type and
	  accessors, for fixed-point bindings. This IL construct is taken from
	  the Waddell paper.
	  (parse-tree-il, unparse-tree-il, tree-il->scheme, tree-il-fold)
	  (pre-order!, post-order!): Update for <fix>.

	* module/language/tree-il/analyze.scm (analyze-lexicals): Update for
	  <fix>. The difference here is that the bindings may not be assigned,
	  and are not marked as such. They are not boxed.
	  (report-unused-variables): Update for <fix>.

	* module/language/tree-il/compile-glil.scm (flatten): Compile <fix> to
	  GLIL.

	* module/language/tree-il/fix-letrec.scm: A stub implementation of
	  fixing letrec -- will flesh out in a separate commit.

	* module/language/tree-il/inline.scm: Fix license, it was mistakenly
	  added with LGPL v2.1+.

	* module/language/tree-il/optimize.scm (optimize!): Run the fix-letrec!
	  pass.

2009-08-05  Andy Wingo  <wingo@pobox.com>

	add a brain-dead inliner
	* module/Makefile.am (TREE_IL_LANG_SOURCES):
	* module/language/tree-il/inline.scm: Add a brain-dead inliner, to
	  inline ((lambda () x)) => x.

	* module/language/tree-il/optimize.scm (optimize!): Invoke the inliner.

2009-08-05  Andy Wingo  <wingo@pobox.com>

	add1 and sub1 instructions
	* libguile/vm-i-scheme.c: Add add1 and sub1 instructions.
	* module/language/tree-il/compile-glil.scm: Compile 1+ and 1- to add1
	  and sub1.

	* module/language/tree-il/primitives.scm (define-primitive-expander):
	  Add support for `if' statements in the consequent.
	  (+, -): Compile (- x 1), (+ x 1), and (+ 1 x) to 1- or 1+ as
	  appropriate.
	  (1-): Remove this one. Seems we forgot 1+ before, but we weren't
	  compiling it nicely anyway.

	* test-suite/tests/tree-il.test ("void"): Fix expected compilation of (+
	  (void) 1) to allow for add1.

2009-08-04  Andy Wingo  <wingo@pobox.com>

	perform gmp/unistring compile checks with AC_LIB_HAVE_LINKFLAGS
	* configure.ac: Rework gmp and unistring checks to use
	  AC_LIB_HAVE_LINKFLAGS, so that the compilation checks run with the
	  right -L/-l flags.

	* libguile/Makefile.am (libguile_la_LIBADD): Adapt to need to add
	  $(LIBGMP) and $(LIBUNISTRING) here.

	Hopefully this solves
	http://article.gmane.org/gmane.lisp.guile.bugs/4288.

2009-08-04  Andy Wingo  <wingo@pobox.com>

	rename configure.in to configure.ac
	* configure.ac:
	* guile-readline/configure.ac: Rename from configure.in, as recommended
	  by the autoconf manual.

2009-08-04  Andy Wingo  <wingo@pobox.com>

	fix buffer overrun reading partial numbers: 1.0f, 1.0/, and 1.0+
	* libguile/numbers.c (mem2decimal_from_point, mem2ureal, mem2complex):
	  Fix a number of cases where, for invalid numbers, we could read past
	  the end of the buffer. This happened in e.g. "1.0+", "1/" and "1.0f".
	  But I couldn't figure out how to test for these, given that the
	  behavior depended on the contents of uninitialized memory in the
	  reader buffer. We'll just have to be happy with this.

	Thanks to Kjetil S. Matheussen for the report.

2009-08-04  Neil Jerram  <neil@ossau.uklinux.net>

	Git-Ignore effective-version.texi

	Fix overfull hboxes

	Typos

	Add an effective version variable for the manual

	Add copyright statements to goops.texi and goops-tutorial.texi

2009-08-04  Daniel Kraft  <d@domob.eu>

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

	Abstracted dynamic binding a little off the fluids.
	* module/language/elisp/compile-tree-il.scm: Move dynamic binding to one place
	  and changed names that refer to `fluids' for dynamic binding.
	* module/language/elisp/bindings.scm: Changed names referring to `fluids'.

2009-08-04  Neil Jerram  <neil@ossau.uklinux.net>

	Move GOOPS documentation into the main manual
	Nothing editorial here, just the minimum to move the GOOPS documentation
	into the main manual, and then still have everything build properly.

2009-08-03  Daniel Kraft  <d@domob.eu>

	Implement catch and unwind-protect as macros.
	* module/language/elisp/compile-tree-il.scm: Remove catch and unwind-protect.
	* module/language/elisp/runtime/macro-slot.scm: Re-implement them here.

2009-08-03  Neil Jerram  <neil@ossau.uklinux.net>

	Move `Continuation Barriers' to the section that covers continuations
	Since continuation barriers protect against non-local exits, it makes
	better sense to document them in the same section as continuations and
	exceptions.

	Review/update sections on arbiters and asyncs

	Miscellaneous small updates
	- Typos
	- Minor changes to texinfo markup
	- Minor wording changes

	Remove the idea of a separate manual edition number
	I don't believe this has ever been useful, and I doubt that we've
	consistently incremented it in the past.  The reality is that the
	manual evolves with the rest of Guile, so Guile's version number
	should apply to the manual too.  It is conceivable that we might
	one day revise the manual for an existing Guile release, so we keep
	a REVISION number to cover that.

2009-08-01  Michael Gran  <spk121@yahoo.com>

	Don't doubly define scm_t_wchar
	        * libguile/chars.h: don't define scm_t_wchar
	        * libguile/numbers.h: define scm_t_wchar here

2009-08-01  Michael Gran  <spk121@yahoo.com>

	Fix coding style compliance for recent 32-bit char changes
	        * libguile/print.c (iprin1): extra braces

	        * libguile/chars.h (SCM_IS_UNICODE_CHAR): coding style

2009-08-01  Michael Gran  <spk121@yahoo.com>

	Don't use GNU extensions for SCM_MAKE_CHAR macro
	Since the contents of SCM_MAKE_CHAR are evaluated more than once,
	don't use it in situations where this could cause side-effects.

	        * libguile/vm-i-system.c (make-char8): avoid side-effects with
	        SCM_MAKE_CHAR call

	        * libguile/chars.h (SCM_MAKE_CHAR): modified

2009-08-01  Michael Gran  <spk121@yahoo.com>

	Make charname declarations module-level and GCS
	Charname array declarations are corrected for style and
	are made module-level.  Array list length variables are
	replaced with macros.

	        * libguile/chars.c: variable declaration fixes

2009-08-01  Michael Gran  <spk121@yahoo.com>

	Update NEWS for charname changes
	        * NEWS: updated

2009-08-01  Daniel Kraft  <d@domob.eu>

	Allow lexical binding of lambda arguments.
	* module/language/elisp/compile-tree-il.scm: Rework lambda compiler to allow
	  opional lexical binding of (some) lambda arguments.
	* test-suite/tests/elisp-compiler.test: Check this.

2009-07-31  Daniel Kraft  <d@domob.eu>

	Compiler option to always bind certain symbols lexically. Affects so far let-bound symbols, lambda arguments to come in the future.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Add :always-lexical option.
	* test-suite/tests/elisp-compiler.test: Test it.

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-07-31  Ludovic Courtès  <ludo@gnu.org>

	Add unused variable analysis in the tree-il->glil compiler.
	* module/language/tree-il/analyze.scm (<binding-info>): New record type.
	  (report-unused-variables): New procedure.

	* module/language/tree-il/compile-glil.scm (%warning-passes): New
	  variable.
	  (compile-glil): Honor `#:warnings' from OPTS.

	* test-suite/tests/tree-il.test (call-with-warnings): New procedure.
	  (%opts-w-unused): New variable.
	  ("warnings"): New test prefix.

2009-07-31  Ludovic Courtès  <ludo@gnu.org>

	Add `(system base message)', a simple warning framework.
	* module/Makefile.am (SOURCES): Add `system/base/message.scm'.

	* module/scripts/compile.scm (%options): Add `--warn'.
	  (parse-args): Update default value for `warnings'.
	  (show-warning-help): New procedure.
	  (compile)[compile-opts]: Add `#:warnings'.
	  Update help message.

	* module/system/base/compile.scm (compile): Sanity-check the requested
	  warnings.

	* module/system/base/message.scm: New file.

2009-07-31  Ludovic Courtès  <ludo@gnu.org>

	Add `tree-il-fold', a purely functional iterator on `tree-il'.
	* module/language/tree-il.scm (tree-il-fold): New procedure.

	* test-suite/tests/tree-il.test ("tree-il-fold"): New test prefix.

2009-07-30  Daniel Kraft  <d@domob.eu>

	Use explicit guile-primitive forms in the macro expansion of dotimes and dolist.

	Implement some elisp constructs in macros instead of hard-coded compiler code.
	* module/language/elisp/compile-tree-il.scm: Remove implementation of prog1,
	  and, or, cond, dolist.
	* module/language/elisp/runtime/macro-slot.scm: Implement them here instead.

	Switch use of guile-primitive to now available funcall in test.

	without-void-checks as new extension for fine-control
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Handle without-void-checks.
	* test-suite/tests/elisp-compiler.test: Test it.

2009-07-29  Daniel Kraft  <d@domob.eu>

	funcall, apply and eval built-ins.
	* module/language/elisp/README: Document new features.
	* module/language/elisp/runtime/function-slot.scm: Implement funcall, apply and
	  eval by using the existing compiler code.
	* test-suite/tests/elisp-compiler.test: Test those.

2009-07-29  Michael Gran  <spk121@yahoo.com>

	Add 32-bit characters
	This adds the 32-bit standalone characters.  Strings are still
	8-bit.  Characters larger than 8-bit can only be entered or
	displayed in octal format at this point.  At this point, the
	terminal's display encoding is expected to be Latin-1.

	        * module/language/assembly/compile-bytecode.scm (write-bytecode):
	        add 32-bit char

	        * module/language/assembly.scm (object->assembly): add 32-bit char
	        (assembly->object): add 32-bit char

	        * libguile/vm-i-system.c (make-char32): new op

	        * libguile/print.c (iprin1): print 32-bit char

	        * libguile/numbers.h: add type scm_t_wchar

	        * libguile/numbers.c: add type scm_t_wchar

	        * libguile/chars.h: new type scm_t_wchar
	        (SCM_CODEPOINT_MAX): new
	        (SCM_IS_UNICODE_CHAR): new
	        (SCM_MAKE_CHAR): operate on 32-bit char

	        * libguile/chars.c: comparison operators now use Unicode
	        codepoints
	        (scm_c_upcase): now receives and returns scm_t_wchar
	        (scm_c_downcase): now receives and returns scm_t_wchar

2009-07-29  Daniel Kraft  <d@domob.eu>

	Added guile-primitive construct for references to primitives from Elisp.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Implement guile-primitive.
	* test-suite/tests/elisp-compiler.test: Switched a usage of guile-ref to
	  the now available guile-primitive.

	Added length built-in.
	* module/language/elisp/runtime/function-slot.scm: Add length built-in.
	* test-suite/tests/elisp-compiler.test: Test length.

	Implemented lexical-let and lexical-let* for elisp.
	* module/language/elisp/README: Document it.
	* module/language/elisp/bindings.scm: New fields in bindings data structure
	  to keep track of lexical bindings for symbols.
	* module/language/elisp/compile-tree-il.scm: Implement lexical-let(*).
	* test-suite/tests/elisp-compiler.test: Test lexical scoping with lexical-let.

2009-07-28  Michael Gran  <spk121@yahoo.com>

	Replace global charnames variables with accessors
	The global variables scm_charnames and scm_charnums are replaced with
	the accessor functions scm_i_charname and scm_i_charname_to_num.
	Also, the incomplete and broken EBCDIC support is removed.

	       * libguile/print.c (iprin1): use new func scm_i_charname

	        * libguile/read.c (scm_read_character): use new func
	        scm_i_charname_to_num

	        * libguile/chars.c (scm_i_charname): new function
	        (scm_i_charname_to_char): new function
	        (scm_charnames, scm_charnums): removed

	        * libguile/chars.h: new declarations

2009-07-27  Daniel Kraft  <d@domob.eu>

	In elisp-compiler.test, check that let* works without values given, too.

2009-07-26  Andy Wingo  <wingo@pobox.com>

	increase range of relative jumps by aligning blocks to 8-byte boundaries
	* libguile/objcodes.c (OBJCODE_COOKIE): Bump again, as our jump offsets
	  are now multiplied by 8.

	* libguile/vm-i-system.c (BR): Interpret the 16-bit offset as a relative
	  jump to the nearest 8-byte-aligned block -- increasing relative jump
	  range from +/-32K to +/-240K.
	  (mvra): Do the same for the mvra jump.

	* libguile/vm.c (really_make_boot_program): Align the mvra.

	* module/language/assembly.scm (align-block): New export, for aligning
	  blocks.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Emit
	  jumps to the nearest 8-byte-aligned block. Effectively our range is 18
	  bits in either direction. I would like to do this differently -- have
	  long-br and long-br-if, and all the other br instructions go to 8 bits
	  only. But the assembler doesn't have an appropriate representation to
	  allow me to do this yet, so for now this is what we have.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Decode the 19-bit jumps.

2009-07-26  Andy Wingo  <wingo@pobox.com>

	make sure all programs are 8-byte aligned
	* libguile/objcodes.c (OBJCODE_COOKIE): Bump objcode cookie, as we added
	  to struct scm_objcode.
	* libguile/objcodes.h (struct scm_objcode): Add a uint32 after metalen
	  and before base, so that if the structure has 8-byte alignment, base
	  will have 8-byte alignment too. (Before, base was 12 bytes from the
	  start of the structure, now it's 16 bytes.)

	* libguile/vm-engine.h (ASSERT_ALIGNED_PROCEDURE): Add a check that can
	  be turned on with VM_ENABLE_PARANOID_ASSERTIONS.
	  (CACHE_PROGRAM): Call ASSERT_ALIGNED_PROCEDURE.

	* libguile/vm-i-system.c (long-local-ref): Add a missing semicolon.

	* libguile/vm.c (really_make_boot_program): Rework to operate directly
	  on a malloc'd buffer, so that the program will be 8-byte aligned.

	* module/language/assembly.scm (*program-header-len*): Add another 4 for
	  the padding.
	  (object->assembly): Fix case in which we would return (make-int8 0)
	  instead of (make-int8:0). This would throw off compile-assembly.scm's
	  use of addr+.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
	  out the padding int.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  And pop off the padding int too.

	* module/language/glil/compile-assembly.scm (glil->assembly): Don't pack
	  the assembly, assume that assembly.scm has done it for us. If a
	  program has a meta, pad out the program so that meta will be aligned.

	* test-suite/tests/asm-to-bytecode.test: Adapt to expect programs to
	  have the extra 4-byte padding int.

2009-07-26  Andy Wingo  <wingo@pobox.com>

	fix alignment of subprograms of subprograms
	* module/language/glil/compile-assembly.scm (glil->assembly)
	  (dump-object): Fix an exciting bug! Subprograms of subprograms were
	  not being aligned correctly, because the code was generated too early.
	  So instead delay dumping the object table until the proper time.

	fix unused SCM_FRAME_SET_DYNAMIC_LINK macro
	* libguile/frames.h (SCM_FRAME_SET_DYNAMIC_LINK): Fix for new stack
	  layout, though this macro is not used.

	fix vmstack gdb macro for new stack frame layout
	* gdbinit (vmstack): No more external link.

2009-07-24  Andy Wingo  <wingo@pobox.com>

	check that jumps are within the range of a signed 16-bit int
	* module/language/assembly/compile-bytecode.scm (write-bytecode): Check
	  that the offset is within the range of a signed int16 value.

	fix gensym creation in psyntax
	* module/ice-9/psyntax.scm (build-lexical-var): Make our gensyms really
	  unique. Before, there was a chance that different lexicals could
	  result in the same gensym.
	* module/ice-9/psyntax-pp.scm: Regenerate.

	increase default stack size to 64 kilowords
	* libguile/vm.c (VM_DEFAULT_STACK_SIZE): Increase to 64 kilowords.
	  Really, we should simply add overflow handlers, but in the meantime,
	  this will do.

2009-07-24  Daniel Kraft  <d@domob.eu>

	Compiler option to disable void-checks in elisp.
	* module/language/elisp/README: Document the change.
	* module/language/elisp/compile-tree-il.scm: Add disable-void-check option.
	* test-suite/tests/elisp-compiler.test: Test it.

2009-07-24  Andy Wingo  <wingo@pobox.com>

	compiler support for nlocs >= 256
	* libguile/vm-i-system.c (long-local-ref, long-local-set)
	  (make-variable): New intructions, for handling nlocs >= 256.
	* module/language/glil/compile-assembly.scm (glil->assembly): Compile
	  <glil-lexical> with support for nlocs >= 256.

2009-07-24  Daniel Kraft  <d@domob.eu>

	Don't pass the bindings-data all around in compile-tree-il, but use fluids for this dynamic binding.
	* module/language/elisp/compile-tree-il.scm: Use fluid for bindings-data.

2009-07-24  Andy Wingo  <wingo@pobox.com>

	nlocs is now 16 bits wide
	* libguile/objcodes.h (struct scm_objcode): Remove the "unused" field --
	  the old "nexts" -- and expand nlocs to 16 bits.

	* module/language/assembly/compile-bytecode.scm (write-bytecode): Write
	  the nlocs as a uint16.

	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	  Decompile 16-bit nlocs. It seems this decompilation is little-endian
	  :-/

	* test-suite/tests/asm-to-bytecode.test: Fix up to understand nlocs as a
	  little-endian value. The test does the right thing regarding
	  endianness.

2009-07-24  Daniel Kraft  <d@domob.eu>

	Implemented the flet and flet* extensions.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Implement flet and flet*.
	* test-suite/tests/elisp-compiler.test: Test flet and flet*.

2009-07-23  Andy Wingo  <wingo@pobox.com>

	remove all mentions of "external" from the compiler and related code
	With this, GHIL is effectively bitrotten. I need to port the ECMAScript
	compiler to tree-il, then I'll remove it.

	* module/language/assembly.scm (byte-length):
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/disassemble.scm (disassemble-load-program):
	  (disassemble-free-vars, code-annotation):
	* module/language/glil.scm (<glil-program>, <glil-local>)
	  (<glil-exteral>, parse-glil, unparse-glil):
	* module/language/glil/compile-assembly.scm (make-meta):
	  (compile-assembly, glil->assembly):
	* module/language/glil/decompile-assembly.scm (decompile-toplevel):
	  (decompile-load-program):
	* module/language/objcode/spec.scm (decompile-value):
	* module/language/tree-il/compile-glil.scm (flatten-lambda):
	* module/system/vm/frame.scm (frame-binding-ref):
	  (frame-binding-set!):
	* module/system/vm/program.scm (binding:boxed?):
	* module/system/vm/trace.scm (trace-next):
	* test-suite/tests/asm-to-bytecode.test ("compiler"):
	* test-suite/tests/tree-il.test: Remove all mentions of "external", and
	  of <glil-local>. Docs updates will come soon.

2009-07-23  Andy Wingo  <wingo@pobox.com>

	rename "closure-ref" to "free-ref"; s/vars/variables/ in some names
	* libguile/programs.h:
	* libguile/programs.c: (SCM_PROGRAM_FREE_VARIABLES): Rename from
	  SCM_PROGRAM_FREE_VARS. Callers changed.
	* libguile/programs.c (scm_make_program): Rename arg to
	  "free_variables".
	  (scm_program_free_variables): Rename from program-free-vars.

	* libguile/vm-engine.h:
	* libguile/vm-engine.c (VM_CHECK_FREE_VARIABLES): Rename from
	  VM_CHECK_CLOSURE.
	  (vm_engine, CACHE_PROGRAM): Rename closure and closure_count to free_vars and
	  free_vars_vount.

	* libguile/vm-i-system.c (FREE_VARIABLE_REF): Rename from CLOSURE_REF.
	  (free-ref, free-boxed-ref, free-boxed-set): Rename from closure-ref,
	  closure-boxed-ref, closure-boxed-set.
	  (make-closure): Renamed from make-closure2.

	* module/language/glil/compile-assembly.scm (glil->assembly): Hack to
	  never write out the the old "make-closure" instruction. Will fix
	  better later. Change to emit free-ref etc instead of closure-ref.

	* module/language/tree-il/compile-glil.scm (flatten): Emit make-closure
	  instead of make-closure2, now that the old make-closure is gone.

	* module/system/vm/program.scm (system): Rename program-free-vars to
	  program-free-variables.

	* test-suite/tests/tree-il.test ("lambda"): Update for make-closure.

2009-07-23  Andy Wingo  <wingo@pobox.com>

	remove "externals" from the vm
	* libguile/frames.c (scm_frame_external_link): Removed.
	* libguile/frames.h: No need to have the "external link" in the stack
	  frame -- update macros to take the new situation into account.

	* libguile/objcodes.h (struct scm_objcode): Rename the nexts field to
	  "unused". In the future we can use it for nlocs, I think.
	  (SCM_OBJCODE_NEXTS): removed.

	* libguile/programs.h:
	* libguile/programs.c (scm_make_program): Expect the third argument to
	  be a vector of free variables, not a list of free variables.
	  SCM_BOOL_F indicates no free variables, not SCM_EOL.
	  (program_mark): Adapt.
	  (scm_program_arity): No more nexts.
	  (scm_program_free_vars): Replaces scm_program_externals.

	* libguile/vm-engine.c (VM_CHECK_EXTERNAL)
	  (vm_engine): No need for the "external" var.
	* libguile/vm-engine.h (CACHE_PROGRAM): Update for SCM_PROGRAM_FREE_VARS
	  instead of SCM_PROGRAM_EXTERNALS.
	  (NEW_FRAME): Update for new frame size, and no need to cons up
	  externals. Yay :)

	* libguile/vm-i-loader.c (load-program): Update for scm_make_program.

	* libguile/vm-i-system.c (external-ref, external-set): No more.
	  (make-closure): No more.
	  (goto/args): No need to re-cons externals here. Update for new stack
	  frame size.
	  (mv-call, return, return/values): Update for new frame size. No need
	  to reinstate externals on return.

	* libguile/vm.c (really_make_boot_program, scm_load_compiled_with_vm):
	  Update for scm_make_program.
	* module/language/objcode/spec.scm (objcode-env-externals): Treat '() as
	  #f, for the externals. Need to clean this up later...
	* module/system/vm/program.scm (arity:nexts): Remove. Rename
	  program-external to program-free-vars.

2009-07-23  Andy Wingo  <wingo@pobox.com>

	compile lexical variable access and closure creation to the new ops
	* module/language/glil.scm (<glil>): New GLIL type, <glil-lexical>,
	  which will subsume other lexical types.
	* module/language/glil/compile-assembly.scm: Compile <glil-lexical>.
	  (make-open-binding): Change the interpretation of the second argument
	  -- instead of indicating an "external" var, it now indicates a boxed
	  var.
	  (open-binding): Adapt to new glil-bind format.
	* module/language/tree-il/analyze.scm: Add a lot more docs.
	  (analyze-lexicals): Change the allocation algorithm and output format
	  to allow the tree-il->glil compiler to capture free variables
	  appropriately and to reference bound variables in boxes if necessary.
	  Amply documented.

	* module/language/tree-il/compile-glil.scm (compile-glil): Compile
	  lexical variable access to <glil-lexical>. Emit variable capture and
	  closure creation code here, instead of leaving that task to the
	  GLIL->assembly compiler.

	* test-suite/tests/tree-il.test: Update expected code emission.

2009-07-23  Daniel Kraft  <d@domob.eu>

	Implemented dynamic symbol access built-ins (set, fset, symbol-value, makunbound...)
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Moved ensure-fluid! to runtime function.
	* module/language/elisp/runtime.scm: Runtime functions to support dynamic value access.
	* module/language/elisp/runtime/function-slot.scm: Defined the built-ins.
	* test-suite/tests/elisp-compiler.test: Test them.

2009-07-22  Daniel Kraft  <d@domob.eu>

	Added guile-ref extension construct, change throw implementation to easier one using a built-in function and implement unwind-protect.
	* module/language/elisp/README: Document the changes.
	* module/language/elisp/compile-tree-il.scm: Implement unwind-protect.
	* module/language/elisp/runtime/function-slot.scm: throw as built-in.
	* test-suite/tests/elisp-compiler.test: Test unwind-protect.

	Implemented catch and throw in elisp.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement catch and throw.
	* test-suite/tests/elisp-compiler.test: Test catch/throw.

2009-07-22  Andy Wingo  <wingo@pobox.com>

	vm support for display closures
	* libguile/vm-i-system.c (box, empty-box): Boxing values and storing
	  them in local variables.
	  (local-boxed-ref, local-boxed-set): A combination of local-ref then
	  variable-ref/set.
	  (make-closure2, closure-ref, closure-boxed-ref, closure-boxed-set):
	  New ops. The idea is to migrate Guile over to using flat dispay
	  closures. See the paper "Three Implementation Models for Scheme" by
	  Kent Dybvig for more details; this is the "stack-based" model.

	* libguile/vm-engine.c:
	* libguile/vm-engine.h: Add the necessary infrastructure to keep track
	  of a "closure" variable, like our "externals" in semantics, but
	  minimal, flat, and O(1) in implementation.

2009-07-21  Andy Wingo  <wingo@pobox.com>

	renumber vm ops (objcode cookie bumped)
	* libguile/objcodes.c (OBJCODE_COOKIE): Bump.

	* libguile/vm-i-loader.c:
	* libguile/vm-i-scheme.c:
	* libguile/vm-i-system.c: Renumber instructions, so I can have a bit
	  more space to work.

2009-07-21  Daniel Kraft  <d@domob.eu>

	Don't ensure fluids all over the place but scan for variables needed and ensure just before the compiled code all those.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement it here, pass bindings all around the compilation.
	* module/language/elisp/bindings.scm: New module with symbol-tracking abilities needed for this.

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-07-20  Daniel Kraft  <d@domob.eu>

	Implemented prog1, prog2, dotimes, dolist control structures.
	* module/language/elisp/README: Document it and some further ideas written down.
	* module/language/elisp/compile-tree-il.scm: Implement prog1, dolist.
	* module/language/elisp/runtime/macro-slot.scm: prog2 and dotimes.
	* test-suite/tests/elisp-compiler.test: Test prog1, prog2, dotimes, dolist.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	fix (bytevector-ieee-single-native-set! x 0 0)
	* libguile/bytevectors.c (VALIDATE_REAL): SCM_VALIDATE_REAL is not what
	  we need for checking values for bytevector-ieee-single-native-set! et
	  al, so define our own validator.
	  (IEEE754_SET, IEEE754_NATIVE_SET): Use it.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	bytevectors have "element type" field, e.g. for generalized-vector-ref
	Bytevectors have a very close relationship to other forms of uniform
	vectors. Often you want to view a u64vector as a series of bytes, for
	writing over a socket; or to process an incoming stream using the
	convenient and less error-prone s16vector-ref API rather than
	bytevector-s16-native-ref.

	The essential needs of the representation of a bytevector and an
	s64vector are the same, so we take advantage of that and extend the
	bytevector implementation to have a "native type" field, which defaults
	to VU8.

	This commit doesn't actually expose any user-noticeable changes,
	however.

	* libguile/bytevectors.h (SCM_BYTEVECTOR_ELEMENT_TYPE): New internal
	  defines.
	  (scm_i_make_typed_bytevector, scm_c_take_typed_bytevector): New
	  internal functions.

	* libguile/bytevectors.c (SCM_BYTEVECTOR_SET_ELEMENT_TYPE):
	  (SCM_BYTEVECTOR_TYPE_SIZE):
	  (SCM_BYTEVECTOR_TYPED_LENGTH): New internal macros.
	  (make_bytevector, make_bytevector_from_buffer): Take an extra
	  argument, the element type. The length argument is interpreted as
	  being the number of elements, which corresponds to the number of bytes
	  in the default VU8 case. Doing it this way eliminates a class of bugs
	  -- e.g. a u32vector of length 3 bytes doesn't make sense. We do have
	  to check for another class of bugs: overflow. The length stored on the
	  bytevector itself is still the byte length, though.
	  (scm_i_make_typed_bytevector):
	  (scm_c_take_typed_bytevector): New internal functions.
	  (scm_i_shrink_bytevector): Make sure the new size is valid for the
	  bytevector's type.
	  (scm_i_bytevector_generalized_set_x): Remove this function, the
	  array-handle infrastructure takes care of this for us.
	  (print_bytevector): Print the bytevector according to its type.
	  (scm_make_bytevector, scm_bytevector_copy)
	  (scm_uniform_array_to_bytevector)
	  (scm_u8_list_to_bytevector, scm_bytevector_to_uint_list): Adapt to
	  make_bytevector extra arg.
	  (bv_handle_ref, bv_handle_set_x): Adapt to ref and set based on the
	  type of the bytevector, e.g. f64 or u8.
	  (bytevector_get_handle): Set the typed length of the vector, not the
	  byte length.

	Conflicts:

		libguile/bytevectors.c

2009-07-19  Andy Wingo  <wingo@pobox.com>

	bytevector inlinedness indicated by flag, not length
	* libguile/bytevectors.h (SCM_BYTEVECTOR_INLINE_P): Change to check a
	  flag instead of checking the length of the bytevector.

	* libguile/bytevectors.c (make_bytevector_from_buffer): Handle the len
	  <= inline threshold case as well. Set the inline flag as appropriate.
	  (make_bytevector): Updat the inline flag as appropriate.
	  (scm_c_take_bytevector): Just dispatch to make_bytevector_from_buffer.
	  (scm_i_shrink_bytevector): Update the inline flag as appropriate.
	  Update the length when shrinking an already-inlined vector.
	  (STRING_TO_UTF): Fix some indentation.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	any->u8vector and family now implemented in Scheme
	* module/Makefile.am:
	* module/srfi/srfi-4/gnu.scm: New module, for extensions to srfi-4.
	  Currently defines the any->FOOvector family.

	* libguile/srfi-4.c:
	* libguile/srfi-4.i.c: Dispatch scm_any_to_FOOvector calls to the
	  scheme-implemented functions in (srfi srfi-4 gnu).

2009-07-19  Andy Wingo  <wingo@pobox.com>

	make-typed-array builds backing vector via make-generalized-vector
	* libguile/arrays.c: Rework to use scm_make_generalized_vector instead
	  of our own type table.

	* libguile/bitvectors.c: Fix some includes.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	add registry of vector constructors, make-generalized-vector
	* libguile/generalized-vectors.h:
	* libguile/generalized-vectors.c: Add a registry of vector constructors.
	  (scm_make_generalized_vector): New public function, constructs a
	  vector of a given type.

	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/srfi-4.c:
	* libguile/strings.c:
	* libguile/vectors.c: Register vector constructors.

	* libguile/extensions.c (scm_init_extensions): No need to NULL the list
	  of registered extensions here, the static init does it for us. Allows
	  scm_c_register_extension to be called before scm_init_extensions.

	* libguile/init.c (scm_i_init_guile): Move array initialization earlier,
	  so e.g. scm_init_strings has access to a valid list of array element
	  types when registering its vector constructor.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	uniform vector functions to their own file
	* libguile/uniform.c:
	* libguile/uniform.h:
	* libguile/srfi-4.c:
	* libguile/srfi-4.h:
	* libguile/Makefile.am: Move uniform vector funcs out of srfi-4 to their
	  own file.

	* libguile.h:
	* libguile/arrays.c:
	* libguile/bytevectors.c: Update includers.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	generic vector ops to own file
	* libguile/Makefile.am:
	* libguile/vectors.c:
	* libguile/vectors.h:
	* libguile/generalized-vectors.c:
	* libguile/generalized-vectors.h: Move generic vector ops off into their
	  own file too. The implementation is now based on the generic
	  array-handle infrastructure.

	* libguile.h:
	* libguile/array-map.c:
	* libguile/bitvectors.c:
	* libguile/random.c:
	* libguile/srfi-4.c: Update includers.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	move generic array foo out to its own file
	* libguile/arrays.h:
	* libguile/arrays.c:
	* libguile/generalized-arrays.h:
	* libguile/generalized-arrays.c: Move some generic functionality out of
	  arrays.c to a new file.

	* libguile/array-map.c:
	* libguile/deprecated.c:
	* libguile/init.c: Update includers.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	remove enclosed arrays
	* libguile/arrays.h:
	* libguile/array-map.c:
	* libguile/arrays.c:
	* libguile/deprecated.c: Remove "enclosed arrays". The only user-facing
	  procedures that this affects are scm_enclose_array / enclose-array. If
	  enclosed arrays are added back, it should be through the generic array
	  interface; but really, it sounds like something that would be better
	  implemented in Scheme.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	add generic array implementation facility
	* libguile/array-handle.c (scm_i_register_array_implementation):
	  (scm_i_array_implementation_for_obj): Add generic array facility,
	  which will (in a few commits) detangle the array code.
	  (scm_array_get_handle): Use the generic array facility. Note that
	  scm_t_array_handle no longer has ref and set function pointers;
	  instead it has a pointer to the array implementation. It is unlikely
	  that code out there used these functions, however, as the supported
	  way was through scm_array_handle_ref/set_x.
	  (scm_array_handle_pos): Move this function here from arrays.c.
	  (scm_array_handle_element_type): New function, returns a Scheme value
	  representing the type of element stored in this array.

	* libguile/array-handle.h (scm_t_array_element_type): New enum, for
	  generically determining the type of an array.
	  (scm_array_handle_rank):
	  (scm_array_handle_dims): These are now just #defines.

	* libguile/arrays.c:
	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/srfi-4.c:
	* libguile/strings.c:
	* libguile/vectors.c: Register array implementations for all of these.

	* libguile/inline.h: Update for array_handle_ref/set change.
	* libguile/deprecated.h: Need to include arrays.h now.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	rename unif.[ch] to arrays.[ch]
	* libguile/Makefile.am:
	* libguile/unif.c:
	* libguile/unif.h:
	* libguile/arrays.c:
	* libguile/arrays.h: Rename unif.[ch] to arrays.[ch].

	* libguile.h:
	* libguile/array-handle.c:
	* libguile/array-map.c:
	* libguile/bitvectors.c:
	* libguile/bytevectors.c:
	* libguile/eq.c:
	* libguile/gc-card.c:
	* libguile/gc-malloc.c:
	* libguile/gc-mark.c:
	* libguile/gc.c:
	* libguile/init.c:
	* libguile/inline.h:
	* libguile/print.c:
	* libguile/random.c:
	* libguile/read.c:
	* libguile/socket.c:
	* libguile/sort.c:
	* libguile/srfi-4.c:
	* libguile/srfi-4.h:
	* libguile/strports.c:
	* libguile/vectors.c:
	* libguile/vectors.h: Update includers.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	bitvector exodus from unif.[ch]
	* libguile/Makefile.am:
	* libguile/unif.c:
	* libguile/unif.h:
	* libguile/bitvectors.c:
	* libguile/bitvectors.h: Move bitvector functionality out of unif.[ch].

	* libguile/array-handle.c:
	* libguile/array-map.c:
	* libguile/init.c:
	* libguile/read.c:
	* libguile/srfi-4.c:
	* libguile/vectors.c: Oh, what a tangled web we weave...

2009-07-19  Andy Wingo  <wingo@pobox.com>

	parts of unif.[ch] to array-handle.[ch]
	* libguile/array-handle.c:
	* libguile/array-handle.h: Move some parts of unif.c and unif.h to these
	  new files.

	* libguile/unif.c:
	* libguile/unif.h: Update includers. Since unif.h depends on the array
	  handle type, we include array-handle.h, which also means that there
	  will be no difference for our callers.

	* libguile/init.c: Call scm_init_array_handle, though it does nothing as
	  of yet.

	* libguile/Makefile.am: Adapt for new files.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	rename ramap.[ch] to array-map.[ch]
	* libguile/array-map.c:
	* libguile/array-map.h: Rename from ramap.c and ramap.h.

	* libguile.h:
	* libguile/Makefile.am:
	* libguile/eq.c:
	* libguile/init.c:
	* libguile/sort.c:
	* libguile/unif.c:
	* libguile/vectors.c: All referrers changed.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	rename scm_i_make_ra to scm_i_make_array
	* libguile/unif.c (scm_i_make_array): Rename from scm_i_make_ra. All
	  callers changed.

	clean up libguile/Makefile.am
	* libguile/Makefile.am: Clean up some of the file lists, should make
	  future diffs easier to parse.

	remove convert.{c,i.c,h}
	* libguile/convert.c:
	* libguile/convert.h:
	* libguile/convert.i.c: Remove these functions, which were undocumented,
	  not in the libguile/ header, and thus unlikely to have been used.

2009-07-19  Andy Wingo  <wingo@pobox.com>

	remove deprecated functions from unif.c
	* libguile/unif.h:
	* libguile/unif.c: Remove deprecated functions.

	* module/ice-9/deprecated.scm: Remove array-related deprecated
	  functions.

	* NEWS: Update.

2009-07-18  Daniel Kraft  <d@domob.eu>

	Implemented some important list built-ins.
	* module/language/elisp/runtime.scm: Updated/added convenience macros.
	* module/language/elisp/runtime/function-slot.scm: Implement list built-ins.
	* module/language/elisp/runtime/macro-slot.scm: Implement list built-ins.
	* test-suite/tests/elisp-compiler.test: Test the implemented built-ins.

	Implemented unless, when and dotimes using built-in macros.
	* module/language/elisp/README: Document that.
	* module/language/elisp/runtime.scm: Defined built-in-macro macro.
	* module/language/elisp/runtime/macro-slot.scm: Implement unless, when, dotimes.
	* test-suite/tests/elisp-compiler.test: Test for those constructs.

	Return correct value for setq form.
	* module/language/elisp/compile-tree-il.scm: Fix implementation of setq.
	* test-suite/tests/elisp-compiler.test: Check for value of setq form.

	Implemented real quotation (added support for backquotation).
	* module/language/elisp/README: Document that.
	* module/language/elisp/compile-tree-il.scm: Implement backquote.
	* test-suite/tests/elisp-compiler.test: Test quotation and backquotes.

	Implemented eq and equal built-in predicates.
	* module/language/elisp/runtime/function-slot.scm: Implement eq and equal.
	* test-suite/tests/elisp-compiler.test: Test them.

2009-07-16  Daniel Kraft  <d@domob.eu>

	Implemented macros in elisp compiler.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Implement defmacro and expansion.
	* module/language/elisp/runtime/macro-slot.scm: New module to keep definitions.
	* test-suite/Makefile.am: Add elisp-compiler.test to list of tests.
	* test-suite/tests/elisp-compiler.test: Basic macro tests.

	Extended test-suite to cover already implemented built-ins and fixed errors found.
	* module/language/elisp/runtime/function-slot.scm: Fixed errors in number preds.
	* test-suite/tests/elisp-compiler.test: Test built-ins already implemented.

2009-07-15  Ludovic Courtès  <ludo@gnu.org>

	Bump version number for 1.9.1.
	* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.

	Make the non-integrated VM test-suite less verbose.
	* testsuite/run-vm-tests.scm (run-vm-tests): Don't display the number of
	  tests passed since it's always 1 or 0.

2009-07-15  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-07-15  Ludovic Courtès  <ludo@gnu.org>

	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-*).

2009-07-15  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-07-15  Ludovic Courtès  <ludo@gnu.org>

	Switch remaining GPLv2+ Guile-VM headers to LGPLv3+.
	* module/system/base/compile.scm, module/system/base/syntax.scm,
	  module/system/repl/common.scm, module/system/repl/describe.scm,
	  module/system/vm/instruction.scm, module/system/vm/objcode.scm,
	  module/system/vm/profile.scm, module/system/vm/program.scm,
	  module/system/vm/trace.scm: Switch header from GPLv2+ to LGPLv3+.

2009-07-15  Daniel Kraft  <d@domob.eu>

	Test-suite for elisp compiler so far, excluding the built-ins.
	* test-suite/tests/elisp-compiler.test: Tests for compiler so far.

	Removed wrong not in zerop built-in.
	* module/language/elisp/runtime/function-slot.scm: Fix zerop.

2009-07-15  Ludovic Courtès  <ludo@gnu.org>

	Fix typo in the compile-type verification of `OBJCODE_COOKIE'.
	* libguile/objcodes.c: Fix `sizeof (OBJCODE_COOKIE)' assertion: the
	  trailing 0 must not be taken into account, and multiple of 8 means the
	  3 LSBs are clear.

	Make sure at compile-time that `OBJCODE_COOKIE' has the right size.
	* libguile/objcodes.c: Use `verify' to assert that the size of
	  `OBJCODE_COOKIE' is a multiple of 8.

	Explicitly use Gnulib's `verify' module.
	* m4/gnulib-cache.m4: Add `verify'.

	Augment `OBJCODE_COOKIE' to detect wrong endianness or word size.
	* libguile/objcodes.c (OBJCODE_ENDIANNESS, _OBJCODE_STRINGIFY,
	  OBJCODE_STRINGIFY, OBJCODE_WORD_SIZE): New macros.
	  (OBJCODE_COOKIE): Use them.  The intent is that `.go' files compiled
	  for a different endianness or word size are detected.

	Remove the `long_long' and `ulong_long' types.
	* libguile/gen-scmconfig.c (main): Don't emit typedefs for `long_long'
	  and `ulong_long'.  This was already deprecated in 1.8 and known to
	  cause conflicts with other libraries such as HDF5, as reported by Mark
	  Patterson <mpatterson@physics.queensu.ca>
	  (http://lists.gnu.org/archive/html/bug-guile/2009-02/msg00003.html).

2009-07-14  Andy Wingo  <wingo@pobox.com>

	update NEWS
	* NEWS: Update.

	NEWS has info on 1.9.N to 1.9.N+1 in addition to 1.8 to 2.0
	* NEWS: Update to have an incremental section in addition to a
	  comprehensive 1.8->2.0 section.

	fix race in which some instruction name symbols could go unmarked
	* libguile/instructions.c: In loops, replace scm_op_last with
	  SCM_VM_NUM_INSTRUCTIONS.
	  (fetch_instruction_table): Protect the instruction symbols from
	  collection. Before they were only marked by the name->opcode hash
	  table, leading to races in which they could be collected.
	  (scm_lookup_instruction_by_name): Protect the hash table earlier, as
	  it's not actually a stack variable, since it's static.

	fix bounds checks for the last element of bv-*-{ref,set}
	* libguile/vm-i-scheme.c (BV_FIXABLE_INT_REF, BV_INT_REF):
	  (BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET): Fix the
	  bounds check for the last element.

2009-07-14  Daniel Kraft  <d@domob.eu>

	Implemented defconst, defvar, defun special forms for elisp.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement defconst/defvar/defun.

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-07-14  Ludovic Courtès  <ludo@gnu.org>

	Remove potential "uninitialized variable" GCC warnings.
	* libguile/vm-i-scheme.c (vector_ref, vector_set, BV_FIXABLE_INT_REF,
	  BV_INT_REF, BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET,
	  BV_FLOAT_SET): Explicitly initialize all locals, to make some versions
	  of GCC happier.  Patch by Dale P. Smith <dsmich@roadrunner.com>.

	Fix tests that assumed little endian.
	* test-suite/tests/asm-to-bytecode.test (u32->u8-list): New procedure.
	  ("compiler")[(load-program 3 2 1 0 () 3 #f (make-int8 3) (return)),
	  (load-program 3 2 1 0 () 3 (load-program 3 2 1 0 ...))]: Make these
	  tests work on hosts whose endianness is not little endian.

2009-07-13  Daniel Kraft  <d@domob.eu>

	Some bug fixes on the way and mainly implemented some built-ins (arithmetic).
	* module/language/elisp/README: Document changes.
	* module/language/elisp/compile-tree-il.scm: Bug fixes to fluid-creation.
	* module/language/elisp/runtime.scm: Some helping definitions for built-ins.
	* module/language/elisp/runtime/function-slot.scm: Defined artihmetic built-ins.

	Automatically create fluids when necessary.
	* module/language/elisp/README: Document that.
	* module/language/elisp/compile-tree-il.scm: Create fluids when necessary.
	* module/language/elisp/runtime/function-slot.scm: Fix module name.

	Fixed lambda expressions and implemented function calls using the basic list notation.
	* module/language/elisp/README: Document that.
	* module/language/elisp/compile-tree-il.scm: Implement function calls.

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

	Lambda expressions in elisp, but not yet function calls.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement lambda expressions.

2009-07-07  Daniel Kraft  <d@domob.eu>

	Implemented let and let* in elisp.
	* module/language/elisp/README: Document it.
	* module/language/elisp/compile-tree-il.scm: Implement let and let*.

	Implemented while construct in elisp.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement while construct.

2009-07-05  Ludovic Courtès  <ludo@gnu.org>

	Use Gnulib's `vsnprintf' module.
	* m4/gnulib-cache.m4: Use `vsnprintf', needed by `deprecation.c'.

	Update `NEWS'.
	* NEWS: Update.

	Enclose `bit-operations.test' in its own module.
	* test-suite/tests/bit-operations.test: Use the `define-module' clause.

	Fix the `BUILD_PTHREAD_SUPPORT' Automake conditional when not using pthread.
	* configure.in: Set $build_pthread_support to "no" when thread support
	  isn't built.  This fixes the `BUILD_PTHREAD_SUPPORT' Automake
	  conditional.

2009-07-04  Daniel Kraft  <d@domob.eu>

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-07-03  Daniel Kraft  <d@domob.eu>

	Implemented fluid-based variable references and setting using setq.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement variable references, setq
	* module/language/elisp/runtime.scm: New file for runtime definitions.
	* module/language/elisp/runtime/function-slot.scm: Ditto.
	* module/language/elisp/runtime/value-slot.scm: Ditto.

2009-07-02  Andy Wingo  <wingo@pobox.com>

	fix error message for bad objcode cookie
	* libguile/objcodes.c: Whoop-dee :)

2009-07-02  Daniel Kraft  <d@domob.eu>

	Implemented elisp's or form.
	* module/language/elisp/README: Document this.
	* module/language/elisp/compile-tree-il.scm: Implement or.

	For elisp's (cond ...) and (condition) forms without body, return the condition as value.
	* compile-tree-il.scm: Fix compilation of (cond ...) for bodyless conditions.

2009-07-01  Neil Jerram  <neil@ossau.uklinux.net>

	Read complex numbers where both parts are inexact decimals
	Thanks to Bill Schottstaedt for reporting this problem!

	* libguile/numbers.c (mem2ureal): Don't be misled by *p_exactness
	  being INEXACT on entry (as is possible when reading a complex
	  number): use local exactness variable x which starts as EXACT.
	  Call mem2decimal_from_point () with &x instead of p_exactness.

	* test-suite/tests/numbers.test ("string->number"): Add complex number
	  tests suggested by Bill.

2009-07-01  Neil Jerram  <neil@ossau.uklinux.net>

	Correction to doc on Accessing Arrays from C
	Thanks to Ludovic for the new wording!

	* doc/ref/api-compound.texi (Accessing Arrays from C): Correct text to
	  reflect the current implementation of scm_array_get_handle and
	  scm_array_handle_release - which don't actuall do any dynwind stuff.

2009-06-29  Daniel Kraft  <d@domob.eu>

	Added make-nil instruction to VM and use it for Emacs' nil in the compiler.
	* doc/ref/vm.texi: Document new instruction.
	* libguile/vm-i-system.c: Add it to the VM.
	* module/language/assembly.scm: Compile (const %nil) to (make-nil) assembly.
	* module/language/glil/decompile-assembly.scm: Handle (make-nil)
	* module/language/elisp/compile-tree-il.scm: Use (const %nil) for nil.

2009-06-28  Ludovic Courtès  <ludo@gnu.org>

	Remove seek/truncate shortcuts to file ports.
	Suggested by Neil.

	* libguile/fports.c (fport_seek_or_seek64): Rename to `fport_seek ()'.
	  (fport_seek, scm_i_fport_seek, scm_i_fport_truncate): Remove.

	* libguile/fports.h (scm_i_fport_seek, scm_i_fport_truncate): Remove
	  declarations.

	* libguile/ports.c (scm_seek): Remove shortcut that would call out to
	  `scm_i_fport_seek ()'.
	  (scm_truncate_file): Likewise.

2009-06-27  Daniel Kraft  <d@domob.eu>

	Merge branch 'master' of git://git.savannah.gnu.org/guile into elisp

2009-06-26  Andy Wingo  <wingo@pobox.com>

	bytevector ops now compile down to low-level VM ops
	* libguile/instructions.c (scm_instruction_list): Fix a longstanding bug
	  in this humble function.

	* libguile/vm-i-scheme.c (BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET):
	  Fix some bugs in these macros -- now the bytevector ops work.

	* module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile
	  bytevector calls to VM ops.

	* module/language/tree-il/primitives.scm
	  (*interesting-primitive-names*): Resolve bytevector calls to primitive
	  calls.

2009-06-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-25  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-06-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-22  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-22  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-22  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-06-22  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-06-22  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-06-22  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-06-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-20  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-20  Andy Wingo  <wingo@pobox.com>

	better error in make_objcode_by_mmap
	* libguile/objcodes.c (make_objcode_by_mmap): Better error when the
	  object header is incorrect.

2009-06-20  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-19  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-19  Andy Wingo  <wingo@pobox.com>

	gnulib-tool --import canonicalize-lgpl

2009-06-19  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-19  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-19  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-19  Ludovic Courtès  <ludo@gnu.org>

	Fix the REPL's `,compile' command.
	* module/system/repl/command.scm (compile): Use `guile:disassemble'
	  instead of the former `disassemble-objcode'.

2009-06-19  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-06-19  Ludovic Courtès  <ludo@gnu.org>

	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

2009-06-14  Neil Jerram  <neil@ossau.uklinux.net>

	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.

2009-06-10  Andy Wingo  <wingo@oblong.net>

	bump default stack limit to 160000 words
	* libguile/eval.c (scm_debug_opts): Up the default stack limit by a
	  factor of 4. Psyntax expansions currently bounce back and forth between
	  the VM and the interpreter, due to `map'. (Hopefully that won't be the
	  case in the future, when have map in scheme, and we get an inliner.)
	  Anyway when expanding a big nested expression, as for example in
	  (language ecmascript compile-ghil) -- the pmatch code ends up being
	  super-nested -- we can consume loads o stack.

	  So given that on desktop machines, where rlimit is likely to be unset,
	  default rlimits are around 8 or 10 MB or so, let's bump up our default
	  limit to 640KB (on 32-bit). Should be enough for anyone.

	  See http://thread.gmane.org/gmane.lisp.guile.devel/8599/focus=8662 for
	  more info. Thanks to Mark H. Weaver for the diagnosis!

2009-06-10  Andy Wingo  <wingo@pobox.com>

	fix debug-options
	* module/ice-9/boot-9.scm (define-option-interface): Fix (debug-options
	  'full), along with other options. Thanks to Mark Weaver for the tip.

	* THANKS: Update, though many more names need to be added.

2009-06-09  Andy Wingo  <wingo@pobox.com>

	some attempts to solve the ecmascript stack overflow problem
	* module/language/ecmascript/compile-ghil.scm (comp): Just use pmatch,
	  not ormatch. Now with syncase running over everything, it doesn't
	  matter.

	* module/ice-9/boot-9.scm (false-if-exception): Avoid saving stacks
	  inside false-if-exception. There's probably a more general solution to
	  this, though. Fixes getting bogus backtraces sometimes.

	* module/Makefile.am (ECMASCRIPT_LANG_SOURCES): Reorder things so that
	  spec comes last.

2009-06-09  Daniel Kraft  <d@domob.eu>

	First code for elisp compilation, handling a very limited set of operations (but not really usable yet).
	* module/language/elisp/README: New file containing some notes.
	* module/language/elisp/compile-tree-il.scm: New file with compilation code.
	* module/language/elisp/spec.scm: Updated language definition.

2009-06-08  Andy Wingo  <wingo@pobox.com>

	a start to changing VM scheme copyrights
	* module/language/tree-il/primitives.scm: Change copyright to LGPLv2.1.
	  Others will follow.

2009-06-08  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-08  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-07  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-07  Andy Wingo  <wingo@pobox.com>

	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 :)

2009-06-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-05  Andy Wingo  <wingo@pobox.com>

	disable autocompilation when running guile-tools compile
	* module/scripts/compile.scm (compile): Disable autocompilation when
	  running guile-tools compile.

2009-06-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-05  Andy Wingo  <wingo@pobox.com>

	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 :-)

2009-06-03  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-03  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-03  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-03  Andy Wingo  <wingo@pobox.com>

	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.

2009-06-03  Andy Wingo  <wingo@pobox.com>

	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'.

2009-05-28  Ludovic Courtès  <ludo@gnu.org>

	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 #;.

2009-05-28  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-27  Neil Jerram  <neil@ossau.uklinux.net>

	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.

2009-05-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-26  Andy Wingo  <wingo@wingomac.bcn.oblong.net>

	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.

2009-05-26  Andy Wingo  <wingo@wingomac.bcn.oblong.net>

	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.

2009-05-22  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-22  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-22  Andy Wingo  <wingo@pobox.com>

	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

2009-05-22  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-22  Andy Wingo  <wingo@pobox.com>

	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!

2009-05-22  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-22  Andy Wingo  <wingo@pobox.com>

	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!

2009-05-22  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-21  Andy Wingo  <wingo@pobox.com>

	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...

2009-05-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-21  Andy Wingo  <wingo@pobox.com>

	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 ()'.

2009-05-21  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-05-21  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-05-21  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-05-20  Neil Jerram  <neil@ossau.uklinux.net>

	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 :)

2009-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-18  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-17  Andy Wingo  <wingo@pobox.com>

	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!

2009-05-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-17  Andy Wingo  <wingo@pobox.com>

	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

2009-05-07  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-07  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-07  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-07  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-04  Andy Wingo  <wingo@pobox.com>

	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.

2009-05-04  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-29  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-29  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-29  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-29  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-29  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-26  Andy Wingo  <wingo@pobox.com>

	remove sc-macro definition
	* module/ice-9/boot-9.scm (sc-macro): Remove sc-macro definition, yay.

2009-04-26  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-25  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-25  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-25  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	Merge branch 'master' into syncase-in-boot-9

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	ice-9 syncase now deprecated, woo
	Remove #:use-module (ice-9 syncase) from lots of places, as it's no
	longer needed.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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!

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-24  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-21  Andy Wingo  <wingo@pobox.com>

	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

2009-04-20  Andy Wingo  <wingo@wingomac.bcn.oblong.net>

	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.

2009-04-20  Andy Wingo  <wingo@wingomac.bcn.oblong.net>

	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.

2009-04-20  Andy Wingo  <wingo@wingomac.bcn.oblong.net>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	@ 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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	hygienic compilation
	* module/language/scheme/compile-ghil.scm (lookup-transformer): Recognize
	  macros as initial (@ ...) or (@@ ...) forms, enabling hygienic
	  compilation.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-04-16  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-28  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-28  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-27  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-27  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-27  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-26  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-03-24  Ludovic Courtès  <ludo@gnu.org>

	Include <alloca.h> in `gsubr.c'.
	* libguile/gsubr.c: Include <alloca.h>.  Reported by Carlo Bramini
	  <carlo.bramix@libero.it>.

2009-03-22  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded SMOB mark procedure in `i18n.c'.
	* libguile/i18n.c (smob_locale_mark): Remove.
	  (scm_init_i18n): Remove `scm_set_smob_mark ()' call.

2009-03-22  Ludovic Courtès  <ludo@gnu.org>

	Remove references to `scm_in_heap_p ()'.
	* libguile/gc.c (scm_i_expensive_validation_check): Don't call
	  `scm_in_heap_p ()'.  Cells don't necessarily live in the heap
	  nowadays.

	* libguile/gc.h (scm_in_heap_p): Remove declaration.

2009-03-22  Ludovic Courtès  <ludo@gnu.org>

	Remove unneeded VM SMOB mark/free procedures.
	* libguile/vm.c (vm_mark_stack, vm_cont_mark, vm_cont_free, vm_mark,
	  vm_free): Remove.
	  (scm_bootstrap_vm): Remove corresponding `scm_set_smob_mark ()' and
	  `scm_set_smob_free ()' calls.

	* libguile/frames.c (vm_frame_mark, vm_frame_free): Remove.
	  (scm_bootstrap_frames): Remove `scm_set_smob_mark ()' and
	  `scm_set_smob_free ()' calls.

	* libguile/objcodes.c (objcode_mark): Remove.
	  (scm_bootstrap_objcodes): Remove call to `scm_set_smob_mark ()'.

	* libguile/programs.c (program_mark): Remove.
	  (scm_bootstrap_programs): Remove call to `scm_set_smob_mark ()'.

2009-03-22  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/continuations.c
		libguile/gc-freelist.c
		libguile/gc-mark.c
		libguile/symbols.c
		libguile/threads.c
		module/ice-9/boot-9.scm

2009-03-20  Andy Wingo  <wingo@pobox.com>

	speed up goops rehashing
	* module/oop/goops/dispatch.scm (cache-try-hash!): Speed up goops
	  rehashing, in theory. I haven't measured, though.

	fix interpreted methods with empty bodies
	* module/oop/goops.scm (method): If a method has no body, subst in `(if
	  #f #f)' instead of `(begin)', to please the memoizer.

	add generic method-formals; fixes to method-source
	* module/oop/goops.scm (method-source): Don't throw an error if this
	  method has no source.
	  (method-formals): New generic function, the complement of
	  method-specializers for introspection.

	fix casts to unsigned long in objcodes.c
	* libguile/objcodes.c (scm_c_make_objcode_slice): Fix casts to unsigned
	  long.

2009-03-19  Ludovic Courtès  <ludo@gnu.org>

	Have `scm_take_locale_symbol ()' return an interned symbol (fixes bug #25865).
	* libguile/symbols.c (intern_symbol): New function, with code formerly
	  duplicated in `scm_i_c_mem2symbol ()' and `scm_i_mem2symbol ()'.
	  (scm_i_c_mem2symbol, scm_i_mem2symbol): Use it.
	  (scm_take_locale_symboln): Use `intern_symbol ()'.  This fixes
	  bug #25865.

	* test-suite/standalone/Makefile.am
	  (test_scm_take_locale_symbol_SOURCES,
	  test_scm_take_locale_symbol_CFLAGS,
	  test_scm_take_locale_symbol_LDADD): New variables.
	  (check_PROGRAMS, TESTS): Add `test-scm-take-locale-symbol'.

2009-03-18  Andy Wingo  <wingo@pobox.com>

	rework procedure-callers to stay correct as callees are redefined
	* module/system/xref.scm (procedure-callers): Rework to calculate the
	  callers of a *variable*, not of a value. This is because the
	  module-observers only get fired when the module changes, not with the
	  variables change values. Also accept either a variable, a symbol
	  (resolved in the current module), or a modname . symname pair.

	doubly-weak callers db
	* module/system/xref.scm (ensure-callers-db): Store the callers db as a
	  doubly-weak hash table.

2009-03-18  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-17  Andy Wingo  <wingo@pobox.com>

	add xref.scm
	* module/system/xref.scm: New module, will provide callers/callees info.

	* module/Makefile.am (SOURCES): Add xref.scm.

2009-03-17  Andy Wingo  <wingo@pobox.com>

	tweaks to the un-integrated test cases
	* testsuite/Makefile.am: Sortof turn these VM tests into more
	  automake-like tests. Needs further work.

2009-03-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-17  Andy Wingo  <wingo@pobox.com>

	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".

2009-03-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-17  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-17  Andy Wingo  <wingo@pobox.com>

	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

2009-03-17  Andy Wingo  <wingo@oblong.net>

	Merge commit 'e20d7001c3f7150400169fecb0bf0eefdf122fe2' into vm-check
	Conflicts:

		libguile/stacks.c

2009-03-17  Andy Wingo  <wingo@oblong.net>

	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

2009-03-17  Andy Wingo  <wingo@oblong.net>

	Merge commit '53d81399bef1d9396665e79fb6b9c25eb8e2a6ad' into vm-check
	Also cherry-picks the changes from 1405f1b60fa178303484cd428068ecd01ff6d322

	Conflicts:

		module/ice-9/session.scm

2009-03-17  Andy Wingo  <wingo@oblong.net>

	Merge commit 'ab878b0f8e675a741a7dd56f52638a7cc0419907' into vm-check

	Merge commit 'cbee5075d69cb057c4af4c5e24319da90367897f' into vm-check

	Merge commit '32a2609de06af65341e6b4db6961557b788821e8' into vm-check

	Merge commit 'e95d11110b7af0f528404d28209c3a464ab7074d' into vm-check

2009-03-17  Andy Wingo  <wingo@oblong.net>

	Merge commit '752be95a475132506c35922d284884cf776149d0' into vm-check
	Conflicts:

		INSTALL

2009-03-17  Andy Wingo  <wingo@oblong.net>

	Merge commit '8b0174c879bf74981efe702a00471ed5b8e6912e' into vm-check

2009-03-17  Andy Wingo  <wingo@pobox.com>

	revert annotation support in syncase. another day perhaps.
	* module/ice-9/syncase.scm: Revert support for annotations, as I'm seeing
	  wierd problems whereby syntax-object->datum does not fully strip its
	  input.

2009-03-16  Ludovic Courtès  <ludo@gnu.org>

	Allow the static allocation of all types of subrs.
	This is a follow-up to 46f9baf49a8ea4461e8494c75a88b87d0f5c5195 ("Allow
	the static initialization of subrs.") and
	e20d7001c3f7150400169fecb0bf0eefdf122fe2 ("Remove "compiled closures"
	("cclos") in favor of a simpler mechanism.").

	* libguile/procs.h (SCM_SUBR_ARITY_TO_TYPE): Return the appropriate type
	  for gsubrs instead of returning -1.

	* libguile/Makefile.am (snarf-gsubr.h): Remove target.
	  (BUILT_SOURCES, nodist_modinclude_HEADERS, MOSTLYCLEANFILES): Remove
	  `snarf-gsubr.h'.

	* libguile/snarf.h (SCM_DEFINE)[SCM_SUPPORT_STATIC_ALLOCATION]: Don't
	  include "libguile/snarf-gsubr.h".
	  (SCM_DEFINE_SUBR_reqX_optY_rstZ): Remove.

2009-03-16  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc
	Conflicts:
		libguile/procs.h

2009-03-09  Ludovic Courtès  <ludo@gnu.org>

	Update `NEWS'.

2009-03-08  Andy Wingo  <wingo@pobox.com>

	Fix errors when stripping annotations
	* module/ice-9/annotate.scm (set-annotation-stripped!): Fix prototype to
	  correspond to what syncase needs.

	* module/ice-9/psyntax.scm (strip-annotation): Use `if', not `when', for
	  portability.

	* module/ice-9/psyntax-pp.scm: Regenerate.

2009-03-08  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc-card.c
		libguile/gc-mark.c

	Aggregate `Makefile.am' files under `lang/'.
	* lang/Makefile.am (SUBDIRS): Remove.
	  (elisp_sources): Aggregate the value of `elisp_SOURCES' formerly found
	  in sub-directories' `Makefile.am'.

	Move `guardians.test' to its own module.
	* test-suite/tests/guardians.test: Add `define-module' clause.

2009-03-08  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-03-08  Ludovic Courtès  <ludo@gnu.org>

	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!

2009-03-06  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-06  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-06  Andy Wingo  <wingo@pobox.com>

	fix eval-when statements in boot-9
	* module/ice-9/boot-9.scm: Fix a couple eval-when statements.

2009-03-06  Andy Wingo  <wingo@pobox.com>

	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).

2009-03-02  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-02  Andy Wingo  <wingo@pobox.com>

	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.

2009-03-02  Ludovic Courtès  <ludo@gnu.org>

	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'.

2009-03-02  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-03-02  Ludovic Courtès  <ludo@gnu.org>

	Add subr invocation benchmark.
	* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add `subr.bm'.

2009-03-01  Paolo Bonzini  <bonzini@gnu.org>

	fix x86 shifts
	2009-03-01  Paolo Bonzini  <bonzini@gnu.org>

	        * lightning/i386/core-64.h: Use Mike's macros for x86-64 too.
	        * lightning/i386/core.h: Remove jit_replace.

		2009-02-27  Mike Spivey  <mike@comlab.ox.ac.uk>

	        * lightning/i386/core.h: Rewrite shift-handling macros.
	        * lightning/fp-common.h: Fix jit_extr_{f_d,d_f}.

2009-02-28  Ludovic Courtès  <ludo@gnu.org>

	Move `guardians.test' to its own module.
	* test-suite/tests/guardians.test: Add `define-module' clause.

	Increase chances that `guardians.test' can be successfully run.
	* test-suite/tests/guardians.test: Document overall test sloppiness.
	  ("g2-garbage saved"): Document failure.
	  ("guarding independent objects")["guarding non-immediate", "guarding
	  two non-immediates", "re-guarding non-immediates"]:
	  Improve chances to remove references to the dying object left on the
	  stack.
	  ("guarding weakly referenced objects")["guarded weak vector element
	  gets returned from guardian"]: Likewise.
	  ("guarding weak containers")["element of guarded weak vector gets
	  collected"]: Likewise.
	  ("guarding objects more than once")["guarding twice in one guardian",
	  "guarding twice in two guardians"]: Likewise.

	Add `DEBUG_GUARDIANS' macro for guardian finalization debugging.
	* libguile/guardians.c (finalize_guarded): Use `#ifdef DEBUG_GUARDIANS'
	  instead of `#if 0'.  Add "  guardian for %p vanished\n" debugging
	  statement.

2009-02-27  Andy Wingo  <wingo@pobox.com>

	make the ES compiler more readable via use of ->
	* module/language/ecmascript/compile-ghil.scm: Use -> to make the ES
	  compiler more readable. Fix bugs in do, while, and for, whereby we were
	  missing ->boolean calls.

	use -> macro in scheme->ghil compiler
	* module/language/scheme/compile-ghil.scm (->): New macro, makes GHIL
	  generation a bit more palatable. Use it in all the transformers.

2009-02-27  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-27  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-27  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-27  Andy Wingo  <wingo@pobox.com>

	common slot accessors are procedures-with-setters
	* module/system/base/syntax.scm (define-type): Common slot accessors are
	  also procedures-with-setters.

2009-02-27  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-27  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-25  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-22  Andy Wingo  <wingo@pobox.com>

	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) {}...

2009-02-22  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-22  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-22  Andy Wingo  <wingo@pobox.com>

	+ 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.

2009-02-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-21  Andy Wingo  <wingo@pobox.com>

	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).

2009-02-21  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-02-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-21  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-21  Andy Wingo  <wingo@pobox.com>

	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  Paolo Bonzini  <bonzini@gnu.org>

	fix blunder in operand order (i386)
	2009-02-17  Mike Spivey  <mike@comlab.ox.ac.uk>

		* lightning/i386/core.h: Fix blunder in operand order.

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..

2009-02-19  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-19  Andy Wingo  <wingo@pobox.com>

	var at toplevel works too
	* module/language/ecmascript/compile-ghil.scm (comp): Fix the var form at
	  toplevel.

2009-02-19  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-19  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-19  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-18  Andy Wingo  <wingo@pobox.com>

	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  Paolo Bonzini  <bonzini@gnu.org>

	another fix to jit_fp_btest
	2009-02-17  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/fp-32.h: Another fix to jit_fp_btest.

2009-02-17  Paolo Bonzini  <bonzini@gnu.org>

	fix problems with i386 32-bit floating point branches
	2009-02-17  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/fp-common.h: Define double branches if missing.
		* lightning/i386/asm.h: Define JC and JNC mnemonics.
		* lightning/i386/fp-32.h: Fix jit_fp_btest.  All reported
		by Mike Spivey.

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.

2009-02-14  Andy Wingo  <wingo@pobox.com>

	re-enable assembly packing
	* module/language/glil/compile-assembly.scm (glil->assembly): Enable
	  assembly packing, for e.g. (make-int8:0).

2009-02-14  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc
	Conflicts:
		.gitignore
		libguile/procs.h

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc-mark.c
		libguile/procs.c
		libguile/procs.h
		libguile/threads.c
		libguile/threads.h

2009-02-14  Andy Wingo  <wingo@pobox.com>

	a slight add-method speedup
	* module/oop/goops.scm (add-method-in-classes!): Use memq instead of
	  memv.

2009-02-14  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-13  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-13  Andy Wingo  <wingo@pobox.com>

	no keyword arguments in GHIL / GLIL, just optional args -- faster compiles
	* module/system/base/syntax.scm (define-record): So, in the generated
	  constructors, allow optional arguments, but not keyword arguments.
	  Conses much less in the constructors.
	  (define-record/keywords): And the old define-record is here.

	* module/language/ghil.scm (parse-ghil):
	* module/language/ghil/compile-glil.scm (codegen):
	* module/language/scheme/compile-ghil.scm (translate-1, quote)
	  (quasiquote): Don't use keywords in this compiler hotpath.

	* module/system/base/language.scm (<language>):
	* module/system/repl/common.scm (<repl>):
	* module/system/vm/debug.scm (<debugger>): Use define-record/keywords.

2009-02-12  Ludovic Courtès  <ludo@gnu.org>

	Link with `-z relro' when available.
	* acinclude.m4 (GUILE_GNU_LD_RELRO): New macro.

	* configure.in: Use `GUILE_GNU_LD_RELRO'.

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.

2009-02-12  Ludovic Courtès  <ludo@gnu.org>

	Use double-cells to store subrs.
	* libguile/procs.c (scm_subr_table, scm_subr_table_size,
	  scm_subr_table_room, subr_table_gc_hint, scm_init_subr_table,
	  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.

2009-02-11  Ludovic Courtès  <ludo@gnu.org>

	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  Ludovic Courtès  <ludo@gnu.org>

	Small cleanup relative to the use of double cells for subrs.
	* libguile/procs.c (scm_c_make_subr): Remove comments about the number
	  of subrs, improve formatting.

	* libguile/Makefile.am: Comment the generation of `snarf-gsubr.h'.

2009-02-11  Andy Wingo  <wingo@pobox.com>

	provide program apply_0, apply_1, apply_2 implementations
	* libguile/programs.c (program_apply_0, program_apply_1)
	  (program_apply_2, scm_bootstrap_programs): Provides some cons-less
	  smob application procedures. This molests some internal interfaces, but
	  hey, we're internal.

2009-02-11  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-10  Andy Wingo  <wingo@pobox.com>

	propagate much more source info through compilation
	* module/language/ghil/compile-glil.scm (codegen): Record source location
	  for offset 0 into a lambda, if we can.

	* module/language/scheme/compile-ghil.scm (translate-1)
	  (define-scheme-translator): In the retrans procedures, propagate the
	  location information from the enclosing expression if the subexpression
	  has no location information. Gives source information to many more
	  expressions.
	  (location): Just propagate the source properties as they are, the
	  glil->assembly compiler will interpret them.

	* module/language/glil.scm (<glil>): Change glil-source to take "props"
	  and not "loc", as it's the source properties that we're interested in.

	* module/language/glil/compile-assembly.scm (limn-sources): New function,
	  takes a list of addr-source property pairs and "compresses" them for
	  serialization to disk.
	  (glil->assembly): Limn the sources before writing them to disk. Avoid
	  non-tail recursion when determining total byte length of code.

	* module/system/vm/program.scm (source:file, source:line, source:column):
	  Update for new source representation.
	  (program-source): Export.
	  (write-program): Nicer pretty-printing of anonymous procedures.

	* libguile/backtrace.c (display_backtrace_get_file_line): Update for the
	  new VM source representation.

	* libguile/programs.h:
	* libguile/programs.c (scm_program_sources): Update for the new
	  serialized source representation, where the filename is not in the
	  stream unless it changes.
	  (scm_program_source): New exported function, looks up the source for a
	  given ip offset.
	  (scm_c_program_source): Update to return the last source information
	  that was <= the given IP, because we only serialize source info when it
	  changes.

2009-02-09  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'master' into ossau-gds-dev

	Clean lib-version.texi
	* doc/ref/Makefile.am (CLEANFILES): Add lib-version.texi.

2009-02-09  Andy Wingo  <wingo@pobox.com>

	nicety in the compiler
	* module/language/scheme/compile-ghil.scm (lookup-transformer): Use @@.
	  Delightfully metacircular.

	allow defmacros to unquote in macros into expanded expressions
	* module/language/scheme/compile-ghil.scm (lookup-transformer): Allow
	  macros to be unquoted into the car of any form that results from macro
	  expansion. This lets modules export defmacros built on other defmacros
	  that are not exported.

2009-02-09  Andy Wingo  <wingo@pobox.com>

	minor cleanups
	* libguile/stacks.c (scm_make_stack): Instead of aborting when we misread
	  the number of stack frames, just print a warning. I'd like to figure
	  out what these cases are, exactly.

	* module/language/scheme/compile-ghil.scm (lambda): Reindent the lambda
	  transformer.

	* module/system/base/compile.scm (call-with-compile-error-catch): Write
	  the expression instead of displaying it.
	  (call-with-output-file/atomic): Don't actually redirect output to this
	  port, as it's not necessary -- the language-printer should respect the
	  port that we pass.

2009-02-08  Neil Jerram  <neil@ossau.uklinux.net>

	Merge branch 'master' into ossau-gds-dev

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.

2009-02-08  Neil Jerram  <neil@ossau.uklinux.net>

	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.)

2009-02-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-05  Andy Wingo  <wingo@pobox.com>

	use append-map in goops
	* module/oop/goops.scm (ensure-metaclass, make-extended-generic): Some
	  minor optimizations to use append-map.

2009-02-05  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-04  Andy Wingo  <wingo@pobox.com>

	"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.

2009-02-04  Andy Wingo  <wingo@pobox.com>

	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().

2009-02-03  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-03  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-02-03  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-02-03  Ludovic Courtès  <ludo@gnu.org>

	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 ....)))).

2009-02-02  Andy Wingo  <wingo@pobox.com>

	tick in calls, procedure-name works on compiled procedures
	* module/system/vm/program.scm:
	* libguile/programs.h:
	* libguile/programs.c (scm_program_bindings, scm_program_bindings)
	  (scm_program_properties, scm_program_name): Unfortunately, implement
	  more procs in C, so that C can use them more easily.

	* libguile/debug.c (scm_procedure_name): Dispatch to scm_program_name as
	  appropriate.

	* libguile/vm-i-system.c (call): Tick in a call.

2009-02-02  Julian Graham  <julian@transmetropolitan.(none)>

	Update SRFI-11 docs to use correct name for let*-values.

2009-02-01  Ludovic Courtès  <ludo@gnu.org>

	Use `GC_base ()' to determine whether a pointer points to the heap.
	* libguile/boehm-gc.h (SCM_I_IS_POINTER_TO_THE_HEAP): Use `GC_base ()'
	  instead of `GC_{least,greatest}_plausible_heap addr' since the GC does
	  not assume that the heap is contiguous (suggested by Ivan Maidanski
	  and Hans Boehm).

2009-02-01  Andy Wingo  <wingo@pobox.com>

	fix the disassembler for load-string, load-symbol et al
	* module/language/assembly/decompile-bytecode.scm (decode-bytecode): Fix
	  decoding of lengths in loader instructions.

	no disasm in measure.scm
	* benchmark/measure.scm: Don't use (system vm disasm).

	don't make intermediate garbage when making vectors in the vm
	* libguile/vm-i-system.c (vector): Don't cons up a list just to make a
	  vector. Saves a couple percent in total cell allocation when loading
	  syncase. Probably not worth it, but foo!

2009-02-01  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-01  Andy Wingo  <wingo@pobox.com>

	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.

2009-02-01  Andy Wingo  <wingo@pobox.com>

	add metalen field to bytecode serialization
	* libguile/objcodes.h (struct scm_objcode): Add a new field, metalen, in
	  preparation for embedding metadata within a program.
	  (SCM_OBJCODE_META_LEN, SCM_OBJCODE_TOTAL_LEN): New defines.

	* libguile/vm.c (really_make_boot_program):
	* module/language/assembly.scm (*program-header-len*, byte-length):
	* module/language/assembly/compile-bytecode.scm (write-bytecode):
	* module/language/assembly/decompile-bytecode.scm (decode-load-program):
	* module/language/assembly/disassemble.scm (disassemble-load-program):
	* module/language/glil/compile-assembly.scm (glil->assembly):
	* test-suite/tests/asm-to-bytecode.test ("compiler"): Update for metalen
	  addition.

2009-02-01  Ludovic Courtès  <ludo@gnu.org>

	Fix invalid writes to read-only stringbufs.
	* libguile/strings.c (SET_STRINGBUF_SHARED): Don't modify BUF if it's
	  already marked as shared since it might be a read-only stringbuf.
	  This error can be caught when linking with GNU ld with "-z relro".

2009-01-31  Ludovic Courtès  <ludo@gnu.org>

	Allow the static initialization of subrs.
	* libguile/Makefile.am (snarf-gsubr.h): New target.
	  (BUILT_SOURCES, nodist_modinclude_HEADERS, MOSTLYCLEANFILES): Add
	  `snarf-gsubr.h'.

	* libguile/procs.h (SCM_SUBR_ARITY_TO_TYPE): New macro.

	* libguile/snarf.h (SCM_DEFINE): Rename to...
	  (SCM_DEFINE_GSUBR): this.
	  (SCM_DEFINE_SUBR)[SCM_SUPPORT_STATIC_ALLOCATION]: New macro.
	  (SCM_DEFINE_SUBR_reqX_optY_rstZ)[SCM_SUPPORT_STATIC_ALLOCATION]: New
	  set of macros.
	  (SCM_IMMUTABLE_SUBR): New macro.

2009-01-31  Andy Wingo  <wingo@pobox.com>

	cache 8 boot programs
	* libguile/vm.c (vm_make_boot_program): Cache boot programs for nargs <
	  8.

2009-01-31  Ludovic Courtès  <ludo@gnu.org>

	Allow several `SNARF_INIT ()' per CPP output line.
	* libguile/guile-snarf.in (modern_snarf): Allow several `SNARF_INIT ()'
	  per line.  This makes it possible to write snarffing macros that
	  contain several `SNARF_INIT ()' invocations.

	Improve CPP token pasting in <snarf.h>.
	* libguile/snarf.h (scm_i_paste, scm_i_paste3): New macros.
	  (SCM_SYMBOL, SCM_GLOBAL_SYMBOL, SCM_IMMUTABLE_STRING): Use them.

2009-01-31  Ludovic Courtès  <ludo@gnu.org>

	Don't register disappearing links for non-heap objects.
	* libguile/boehm-gc.h (SCM_I_IS_POINTER_TO_THE_HEAP,
	  SCM_I_REGISTER_DISAPPEARING_LINK): New.

	* libguile/vectors.c (scm_c_vector_set_x): Use
	  `SCM_I_REGISTER_DISAPPEARING_LINK ()' instead of
	  `GC_GENERAL_REGISTER_DISAPPEARING_LINK ()'.

	* libguile/weaks.c (scm_weak_car_pair, scm_weak_cdr_pair,
	  scm_doubly_weak_pair): Likewise.

2009-01-30  Andy Wingo  <wingo@pobox.com>

	remove conv.scm, disasm.scm; objcode->bytecode rename
	* module/system/vm/Makefile.am:
	* module/system/vm/conv.scm:
	* module/system/vm/disasm.scm: Remove these modules, as their
	  functionality is now in (language ...).

	* libguile/objcodes.h:
	* libguile/objcodes.c:
	* module/system/vm/objcode.scm: Rename objcode->u8vector to
	  objcode->bytecode.

	* module/system/vm/frame.scm:
	* module/language/bytecode/spec.scm: Fix for objcode->bytecode.

	* scripts/disassemble:
	* testsuite/run-vm-tests.scm: Fix for (system vm disasm) removal.

	* module/system/repl/command.scm: Use the right disassembler.

2009-01-30  Andy Wingo  <wingo@pobox.com>

	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.

2009-01-30  Andy Wingo  <wingo@pobox.com>

	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.

2009-01-30  Andy Wingo  <wingo@pobox.com>

	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.

2009-01-30  Andy Wingo  <wingo@pobox.com>

	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/.

2009-01-30  Andy Wingo  <wingo@pobox.com>

	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.

2009-01-29  Andy Wingo  <wingo@pobox.com>

	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.

2009-01-23  Neil Jerram  <neil@ossau.uklinux.net>

	Fix MinGW HAVE_STRUCT_TIMESPEC build problem
	Reported by Carlo Bramini.  See the comment in _scm.h.

	* THANKS: Add Carlo Bramini.

	* libguile/_scm.h: Undefine HAVE_STRUCT_TIMESPEC.

2009-01-21  Ludovic Courtès  <ludo@gnu.org>

	Use double-cells to store subrs.
	* libguile/procs.c (scm_subr_table, scm_subr_table_size,
	  scm_subr_table_room, subr_table_gc_hint, scm_init_subr_table): Remove.
	  (scm_c_make_subr): Simply return a double-cell, with the procedure
	  name and properties stored in a two-element array.

	* libguile/init.c (scm_i_init_guile): Remove call to
	  `scm_init_subr_table ()'.

	* libguile/procs.h (SCM_SUBR_META_INFO): New macro.
	  (SCM_SNAME, SCM_SUBR_PROPS): Use it.
	  (SCM_SUBR_GENERIC, SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC):
	  Update.
	  (scm_t_subr_entry, SCM_SUBR_ENTRY, SCM_SUBRNUM, scm_subr_table,
	  scm_init_subr_table): Remove.

2009-01-20  Ludovic Courtès  <ludo@gnu.org>

	Add `SCM_SET_SUBR_GENERIC ()' to replace `SCM_SUBR_GENERIC ()' as an lvalue.
	* libguile/goops.c (scm_c_extend_primitive_generic): Use
	  `SCM_SET_SUBR_GENERIC ()' instead of using `SCM_SUBR_GENERIC ()' as an
	  lvalue.

	* libguile/procs.c (scm_c_make_subr_with_generic): Use `SCM_SET_SUBR_GENERIC_LOC ()'.

	* libguile/procs.h (SCM_SET_SUBR_GENERIC, SCM_SET_SUBR_GENERIC_LOC): New macros.

2009-01-20  Ludovic Courtès  <ludo@gnu.org>

	Use `SCM_SNAME ()' when requesting the name of a subr.
	* libguile/gsubr.c (create_gsubr, create_gsubr_with_generic):
	  Use `SCM_SNAME ()' instead of `SCM_SUBR_ENTRY (subr).name'.

	* libguile/procs.c (scm_c_define_subr_with_generic, scm_makcclo):
	  Likewise.
	  (scm_c_make_subr_with_generic): Same with `SCM_SUBR_GENERIC ()'.

2009-01-19  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'boehm-demers-weiser-gc' into bdw-gc-static-alloc

2009-01-19  Andy Wingo  <wingo@pobox.com>

	add assembly intermediate language
	* configure.in:
	* module/language/Makefile.am:
	* module/language/assembly/Makefile.am: Automakery.

	* module/language/assembly.scm:
	* module/language/assembly/spec.scm: Add a new language, which is oddly
	  even lower than GLIL. I got tired of GLIL's terrible
	  compile-objcode.scm, and wanted a cleaner intermediate format.

	* module/language/glil/compile-assembly.scm: A purely-functional
	  assembler, that produces "assembly". Will document later.

	* module/language/glil/spec.scm: Declare the compiler to assembly.

2009-01-18  Ludovic Courtès  <ludo@gnu.org>

	Remove useless cooperative multi-threading source files.

2009-01-18  Ludovic Courtès  <ludo@gnu.org>

	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-18  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.

2009-01-18  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-01-18  Ludovic Courtès  <ludo@gnu.org>

	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.

2009-01-18  Ludovic Courtès  <ludo@gnu.org>

	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-01-18  Ludovic Courtès  <ludo@gnu.org>

	Use `scm_gc_malloc ()' when allocating GOOPS `t_extension' objects.
	* libguile/goops.c (extension_gc_hint): New.
	  (scm_c_extend_primitive_generic): Use `scm_gc_malloc ()' instead of
	  `scm_malloc ()'.
	  (setup_extended_primitive_generics): Don't call `free(3)' when
	  removing a `t_extension' object.

	Use `scm_gc_malloc ()' when allocating hook entries.
	* libguile/hooks.c (hook_entry_gc_hint): New.
	  (scm_c_hook_add): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.
	  (scm_c_hook_remove): Don't explicitly free(3) the entry, let the GC do
	  its job.

2009-01-18  Ludovic Courtès  <ludo@gnu.org>

	Use `scm_gc malloc_pointerless ()' in `scm_i allocate_string_pointers ()'.
	* libguile/dynl.c (free_string_pointers): Remove.
	  (scm_dynamic_args_call): Remove reference to `free_string_pointers ()'
	  and remove dynwind.

	* libguile/posix.c (free_string_pointers): Remove.
	  (scm_execl, scm_execlp, scm_execle, scm_environ): Remove references
	  to `free_string_pointers ()'.

	* libguile/simpos.c (free_string_pointers): Remove.
	  (scm_system_star): Remove reference to `free_string_pointers ()',
	  remove enclosing dynwind.

	* libguile/strings.c (scm_i_allocate_string_pointers): Use
	  `scm_gc_malloc_pointerless ()' and `scm_gc_malloc ()'
	  instead of `scm_malloc ()' and `scm_to_locale_string ()',
	  so that the result is automatically GC'd when no longer
	  referenced.  Remove unneeded dynwind.
	  (scm_i_free_string_pointers): Remove.

	* libguile/strings.h (scm_i_free_string_pointers): Remove declaration.

2009-01-18  Ludovic Courtès  <ludo@gnu.org>

	Use `scm_gc_malloc ()' when allocating the allocated fluid vector.
	* libguile/fluids.c (next_fluid_num): Use `scm_gc_malloc ()'.  Don't
	  explicitly free the previously allocated array.

	Remove useless cooperative multi-threading source files.

	Use `scm_gc_malloc ()' and friends when allocating the subr table.
	* libguile/procs.c (subr_table_gc_hint): New.
	  (scm_c_make_subr): Use `scm_gc_realloc ()' instead of `scm_realloc ()'.
	  (scm_init_subr_table): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.

2009-01-18  Ludovic Courtès  <ludo@gnu.org>

	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-18  Ludovic Courtès  <ludo@gnu.org>

	Don't use `scm_immutable_cell ()' for subrs.
	* libguile/procs.c (scm_c_make_subr): Use `scm_cell ()' instead of
	  `scm_immutable_cell ()' since subr cells can be mutated, e.g., via
	  `SCM_SUBR_GENERIC ()' as in `scm_c_extend_primitive_generic ()' (this
	  doesn't make any difference in practice as of libgc 7.1, though).

2009-01-17  Neil Jerram  <neil@ossau.uklinux.net>

	Remove `INSTALL'
	* INSTALL: Removed.

2009-01-17  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		lib/Makefile.am
		m4/gnulib-cache.m4
		m4/gnulib-comp.m4

2009-01-17  Andy Wingo  <wingo@pobox.com>

	move module and meta inside programs' object tables
	* libguile/programs.h (struct scm_program): Remove the module and meta
	  fields.

	* libguile/programs.c (scm_c_make_program): Add a new argument, `objs'.
	  If it's a vector, we'll look for the module and the metadata in there,
	  instead of having them in the scm_program structure.
	  (scm_c_make_closure, program_mark, scm_program_meta)
	  (scm_c_program_source, scm_program_module): Adapt to the new program
	  representation.

	* libguile/objcodes.c (scm_objcode_to_program): Pass #f as the object
	  table when making the program.

	* libguile/vm-engine.h (CACHE_PROGRAM):
	* libguile/vm-engine.c (vm_run): Rework to use the simple vector API for
	  getting the current object table. Call the helper,
	  vm_make_boot_program, to make the boot program.

	* libguile/vm-i-loader.c (load-program): Set the current module and the
	  meta in the object vector, which we pass to scm_c_make_program.

	* libguile/vm-i-system.c (toplevel-ref, toplevel-set): Adapt to the new
	  program representation.

	* module/language/glil/compile-objcode.scm (codegen): Clarify.

2009-01-17  Andy Wingo  <wingo@pobox.com>

	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

2009-01-15  Andy Wingo  <wingo@pobox.com>

	Merge commit 'origin/master' into vm
	Conflicts:

		INSTALL

2009-01-15  Neil Jerram  <neil@ossau.uklinux.net>

	Invoke gnulib-tool with --no-vc-files option, and
	remove files that should not have been committed to the repository.

	Revert lib/.gitignore and m4/.gitignore to how they should be
	(before my confused Gnulib commits...)

	Revert unintended change to INSTALL made by commit 4a462e35440fdc3f10b0f88b3fb737fa76ed146d

	Add more missing Gnulib files

2009-01-14  Neil Jerram  <neil@ossau.uklinux.net>

	Add more missing Gnulib files

	Add missing Gnulib file (m4/localcharset.m4)

2009-01-14  Ludovic Courtès  <ludo@gnu.org>

	Add support for static allocation of cells, strings and stringbufs.
	* libguile/__scm.h (SCM_ALIGNED): New macro.

	* libguile/_scm.h: Include "libguile/strings.h", to make the
	  string/stringbuf-related constants visible to snarffed code.

	* libguile/snarf.h (SCM_SUPPORT_STATIC_ALLOCATION): New macro.
	  (SCM_SYMBOL, SCM_GLOBAL_SYMBOL)[SCM_SUPPORT_STATIC_ALLOCATION]: New
	  alternative versions of these macros with support for (almost) static
	  allocation via the use of `string->symbol'.
	  (SCM_IMMUTABLE_DOUBLE_CELL, SCM_IMMUTABLE_STRINGBUF,
	  SCM_IMMUTABLE_STRING): New macros.

	* libguile/tags.h (SCM)[SCM_DEBUG_TYPING_STRICTNESS==1]: Use a pointer
	  type that is compatible with other pointer types, to avoid potential
	  violation of strict aliasing rules.

2009-01-13  Ludovic Courtès  <ludo@gnu.org>

	Expose some of the string/stringbuf internal flags and tags.
	* libguile/strings.h (scm_tc7_ro_string, SCM_I_STRINGBUF_F_SHARED,
	  SCM_I_STRINGBUF_F_INLINE): New macros.

	* libguile/strings.c (STRINGBUF_F_SHARED): Alias for
	  `SCM_I_STRINGBUF_F_SHARED'.
	  (STRINGBUF_F_INLINE): Alias for `SCM_I_STRINGBUF_F_INLINE'.
	  (RO_STRING_TAG): Alias for `scm_tc7_ro_string'.

2009-01-13  Andy Wingo  <wingo@pobox.com>

	fix marking empty VM continuations
	* libguile/vm.h (struct scm_vm_cont):
	* libguile/vm.c (capture_vm_cont, reinstate_vm_cont): Change so we just
	  store the registers as they are, with the reloc.
	  (vm_cont_mark): Only mark the stack if it has elements on it, otherwise
	  we get a bogus fp.

	* libguile/stacks.c (scm_make_stack): Update for change to vm
	  continuations.

2009-01-12  Andy Wingo  <wingo@pobox.com>

	Merge branch 'master' into vm

2009-01-12  Ludovic Courtès  <ludo@gnu.org>

	Fixlet for `run-benchmark.scm'.
	* gc-benchmarks/run-benchmark.scm (%default-options): Default to the
	  empty list for `input'.

	gc-benchmarks: Adapt `gcold.scm' so that if conforms to the framework.
	* gc-benchmarks/larceny/gcold.scm (main): Rename to `gcold-benchmark'.
	  (GCOld): Fix the order of the predicate and run-maker.

	gc-benchmarks: Add `gcold.scm', by Clinger, Hansen et al.
	See http://www.ccs.neu.edu/home/will/Twobit/benchmarksAbout.html for
	details.

	gc-benchmarks: Add `run-benchmark.scm'.

	gc-profile: Show the result of `(version)'.
	* gc-benchmarks/gc-profile.scm (main): Show `(version)'.

	gc-benchmarks: Allow the iteration count to be passed to `gc-profile.scm'.
	* gc-benchmarks/gc-profile.scm (*iteration-count*): New parameter.
	  (run-benchmark): Moved from `twobit-compat.scm'.  Honor
	  `*iteration-count*'.
	  (%options): Add `--iterations'.
	  (show-help): Document it.
	  (main): Parameterize `*iteration-count*'.

	Import GC benchmarks from Larceny, by Hansen, Clinger, et al.
	These GPLv2+-licensed GC benchmarks are available from
	http://www.ccs.neu.edu/home/will/GC/sourcecode.html .

	gc-benchmarks: Add a Larceny/Twobit benchmark compatibility layer.
	* gc-benchmarks/gc-profile.scm: Load "twobit-compat.scm".
	  (save-directory-excursion, load-larceny-benchmark): New procedures.
	  (%options): New variable.
	  (show-help, parse-args): New procedures.
	  (main): Use `parse-args' and `load-larceny-benchmark'.

	Add GC benchmarks.

2009-01-12  Neil Jerram  <neil@ossau.uklinux.net>

	Make sure that we have a real on-the-stack alloca()
	Because of how Guile saves and restores continuations (by copying the
	stack), and how it uses alloca to create space for debug information
	on the stack, we must have an alloca() that really does use the stack,
	and not one that uses the heap.

	To do this, we use the Gnulib "alloca-opt" module instead of "alloca".

	This commit also updates the Gnulib sources from the current Gnulib
	Git repository.

2009-01-12  Andy Wingo  <wingo@pobox.com>

	remove a paranoid define; fix bitrot in measure.scm.
	* benchmark/measure.scm (measure): Fix bitrot.

	* libguile/vm.c (VM_ENABLE_STACK_NULLING): Undefine this, as it hasn't
	  caught any errors in quite a while.

2009-01-12  Andy Wingo  <wingo@pobox.com>

	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

2009-01-12  Andy Wingo  <wingo@pobox.com>

	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

2009-01-11  Andy Wingo  <wingo@pobox.com>

	word tweaks
	* doc/ref/guile.texi: Finish some wording.

	* doc/ref/compiler.texi: Fix some goofiness.

2009-01-11  Andy Wingo  <wingo@pobox.com>

	tweaks to compiler.texi
	* doc/ref/compiler.texi: Minor tweaks.

2009-01-11  Andy Wingo  <wingo@pobox.com>

	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.

2009-01-11  Andy Wingo  <wingo@pobox.com>

	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.

2009-01-11  Andy Wingo  <wingo@pobox.com>

	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.

2009-01-09  Andy Wingo  <wingo@pobox.com>

	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.

2009-01-09  Andy Wingo  <wingo@pobox.com>

	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 ^.

2009-01-08  Andy Wingo  <wingo@pobox.com>

	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!

2009-01-08  Andy Wingo  <wingo@pobox.com>

	(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.

2009-01-08  Andy Wingo  <wingo@pobox.com>

	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

2009-01-04  Neil Jerram  <neil@ossau.uklinux.net>

	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.

2008-12-26  Andy Wingo  <wingo@pobox.com>

	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.

2008-12-26  Andy Wingo  <wingo@pobox.com>

	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.

2008-12-19  Andy Wingo  <wingo@pobox.com>

	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>.

2008-12-18  Ludovic Courtès  <ludo@gnu.org>

	srfi-19: Fix `string->date' weekday lookup.
	* srfi/srfi-19.scm (priv:locale-abbr-weekday->index): Use
	  `locale-day-short' since it expects integers in the range 1-7, unlike
	  `priv:locale-abbr-weekday'.
	  (priv:locale-long-weekday->index): Likewise.

	* test-suite/tests/srfi-19.test ("SRFI date/time
	  library")["string->date works on Sunday"]: New test.

2008-12-14  Ludovic Courtès  <ludo@gnu.org>

	Fixlet for `run-benchmark.scm'.
	* gc-benchmarks/run-benchmark.scm (%default-options): Default to the
	  empty list for `input'.

	Fix typo in makefile.
	* libguile/Makefile.am (DOT_X_FILES): Substitute `gettext.x' to
	  `gettext.c'.

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		lib/Makefile.am
		libguile/struct.c
		libguile/threads.c
		m4/gnulib-cache.m4
		m4/gnulib-comp.m4

2008-12-13  Neil Jerram  <neil@ossau.uklinux.net>

	Ignore gds-test.debug and gds-test.transcript

2008-12-13  Neil Jerram  <neil@ossau.uklinux.net>

	Support multiple concurrent instances of Emacs + GDS server
	By:

	- Making the Unix socket name unique (for each Emacs instance), by
	  appending Emacs's PID to it.

	- Changing the GDS server to listen on both Unix domain and TCP (and
	  not to mind if the TCP bind fails, which will happen if another GDS
	  instance has already bound to the TCP port number).

	- Adding this unique Unix socket name to the environment (as
	  GDS_UNIX_SOCKET_NAME), so that Guile clients started from inside
	  Emacs can pick it up.

	- Changing the GDS client code to look for GDS_UNIX_SOCKET_NAME in the
	  environment, and to connect to the Unix socket with that name
	  instead of over TCP.

	  Guile clients started outside Emacs will not find
	  GDS_UNIX_SOCKET_NAME and so will fall back to using TCP.  This means
	  they will connect to whichever Emacs + GDS server instance started
	  first.

	* emacs/gds-server.el (gds-start-server): Take both Unix socket name
	  and TCP port args, instead of just one (which could be either Unix
	  or TCP), and pass these on to `run-server'.  Remove unused optional
	  bufname arg.

	* emacs/gds.el (gds-unix-socket-name, gds-tcp-port): New variables.
	  (gds-socket-type-alist): Removed.
	  (gds-run-debug-server): Pass gds-unix-socket-name and gds-tcp-port
	  to gds-start-server.  Add the Unix socket name to the environment.
	  (gds-server-socket-type): Note now obsolete.

	* ice-9/gds-client.scm (connect-to-gds): Get Unix socket name from
	  environment, and connect to this in preference to using TCP.

	* ice-9/gds-server.scm (run-server): Take both Unix socket name and
	  TCP port args.  Listen and accept connections on both.

2008-12-12  Neil Jerram  <neil@ossau.uklinux.net>

	Thank people who provided reports or fixes for GDS
	(while it was a standalone project)

	* THANKS (R Clayton, John Steele Scott, Thomas Wawrzinek): Added.

2008-12-12  Neil Jerram  <neil@ossau.uklinux.net>

	Add more files that I wrote to the list in AUTHORS
	* AUTHORS (Neil Jerram): Several files added.

2008-12-12  Neil Jerram  <neil@ossau.uklinux.net>

	Add GDS test and documentation files
	(Transferred from the remains of the old standalone guile-debugging
	project at gna.org.)

	* emacs/gds-faq.txt, emacs/gds-test.el, emacs/gds-test.sh,
	  emacs/gds-test.stdin, emacs/gds-tutorial.txt: New files.

2008-12-11  Neil Jerram  <neil@ossau.uklinux.net>

	Add a GDS protocol hook, that we can use for testing
	* emacs/gds.el (gds-protocol-hook): New hook.
	  (gds-debug-protocol): Run this hook for each received protocol form.

2008-12-10  Neil Jerram  <neil@ossau.uklinux.net>

	Revert "(scm_shell_usage): Note need for subscription to bug-guile@gnu.org."
	This reverts commit f3e3f530c28cfa5c7830c5d9b01de6fc388bc42a, which is
	appropriate because subscription is not now required for someone to
	send a message to bug-guile@gnu.org.

	Conflicts:

2008-12-10  Neil Jerram  <neil@ossau.uklinux.net>

	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:

2008-12-10  Neil Jerram  <neil@ossau.uklinux.net>

	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:

2008-12-10  Neil Jerram  <neil@ossau.uklinux.net>

	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.

2008-12-07  Ludovic Courtès  <ludo@gnu.org>

	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.

2008-12-02  Ludovic Courtès  <ludo@gnu.org>

	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.

2008-11-30  Ludovic Courtès  <ludo@gnu.org>

	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.

2008-11-30  Ludovic Courtès  <ludo@gnu.org>

	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).

2008-11-30  Ludovic Courtès  <ludo@gnu.org>

	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.

2008-11-24  Ludovic Courtès  <ludo@gnu.org>

	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.

2008-11-24  Ludovic Courtès  <ludo@gnu.org>

	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.

2008-11-20  Andy Wingo  <wingo@pobox.com>

	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'.

2008-11-14  Ludovic Courtès  <ludo@gnu.org>

	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).

2008-11-13  Ludovic Courtès  <ludo@gnu.org>

	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).

2008-11-11  Andy Wingo  <wingo@pobox.com>

	add parsers and unparser for ghil; ,language ghil works now
	* module/system/repl/common.scm (repl-print): Slightly refine the meaning
	  of "language-printer": a language printer prints an expression of a
	  language, not the result of evaluation. `write' prints values.

	* module/language/ghil/spec.scm (ghil): Define a language printer, and a
	  translator for turning s-expressions (not scheme, mind you) into GHIL.

	* module/language/scheme/translate.scm (quote, quasiquote): Add some
	  #:keyword action, so that we can (quote #:keywords).

	* module/system/base/language.scm (<language>):
	* module/system/base/compile.scm (read-file-in): Don't require that a
	  language have a read-file; instead error when read-file is called.
	  (compile-passes, compile-in): Refactor to call a helper method to turn
	  the language + set of options into a set of compiler passes.

	* module/system/base/syntax.scm (define-type): Allow the type to be a
	  list, with the car being the name and the cdr being keyword options.
	  Interpret #:printer as a printer, and pass it down to...
	  (define-record): Here.

	* module/system/il/ghil.scm (print-ghil, <ghil>): New printer for GHIL,
	  yay!
	  (parse-ghil, unparse-ghil): New lovely functions. Will document them in
	  the manual.

2008-11-11  Ludovic Courtès  <ludo@gnu.org>

	gc-benchmarks: Adapt `gcold.scm' so that if conforms to the framework.
	* gc-benchmarks/larceny/gcold.scm (main): Rename to `gcold-benchmark'.
	  (GCOld): Fix the order of the predicate and run-maker.

	gc-benchmarks: Add `gcold.scm', by Clinger, Hansen et al.
	See http://www.ccs.neu.edu/home/will/Twobit/benchmarksAbout.html for
	details.

	gc-benchmarks: Add `run-benchmark.scm'.

	gc-profile: Show the result of `(version)'.
	* gc-benchmarks/gc-profile.scm (main): Show `(version)'.

2008-11-10  Ludovic Courtès  <ludo@gnu.org>

	Have `version' return `PACKAGE_VERSION'.
	* libguile/version.c (scm_version): Return `PACKAGE_VERSION' instead of
	  "MAJOR.MINOR.MICRO".

	Change `GUILE_VERSION' to `1.9.0-bdwgc'.
	* GUILE-VERSION (GUILE_VERSION): Add `-bdwgc' prefix.

	Use `pkg-config' to detect BDW-GC at configure-time.
	* configure.in: Use `PKG_CHECK_MODULES' to look for libgc.  This only
	  works with GC 7.x+, which is what we want anyway.

	gc-benchmarks: Allow the iteration count to be passed to `gc-profile.scm'.
	* gc-benchmarks/gc-profile.scm (*iteration-count*): New parameter.
	  (run-benchmark): Moved from `twobit-compat.scm'.  Honor
	  `*iteration-count*'.
	  (%options): Add `--iterations'.
	  (show-help): Document it.
	  (main): Parameterize `*iteration-count*'.

	Import GC benchmarks from Larceny, by Hansen, Clinger, et al.
	These GPLv2+-licensed GC benchmarks are available from
	http://www.ccs.neu.edu/home/will/GC/sourcecode.html .

	gc-benchmarks: Add a Larceny/Twobit benchmark compatibility layer.
	* gc-benchmarks/gc-profile.scm: Load "twobit-compat.scm".
	  (save-directory-excursion, load-larceny-benchmark): New procedures.
	  (%options): New variable.
	  (show-help, parse-args): New procedures.
	  (main): Use `parse-args' and `load-larceny-benchmark'.

2008-11-10  Andy Wingo  <wingo@pobox.com>

	remove .cvsignore files

2008-11-05  Ludovic Courtès  <ludo@gnu.org>

	Work around unintentional retention of modules by the GC.
	This reverts par of "Document the failure of `gc.test' wrt. unused modules."
	(commit 328efeb9a66dddcf78a24fad96d3db58e9c3375d.)

	* ice-9/boot-9.scm (set-module-eval-closure!): Don't set the `module' property
	  on CLOSURE.

	* libguile/modules.c (scm_lookup_closure_module): Call `abort ()' to make it
	  clear that code that uses the `module' property no longer works.  That code
	  is unused anyway.

2008-11-04  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/threads.c

2008-11-02  Ludovic Courtès  <ludo@gnu.org>

	Remove the SMOB mark procedure for source properties.
	* libguile/srcprop.c (srcprops_mark): Remove.
	  (scm_init_srcprop): Remove call to `scm_set_smob_mark ()'.

2008-11-02  Andy Wingo  <wingo@pobox.com>

	proper printing of thunks, reduced disasm verbosity
	* module/system/vm/disasm.scm (disassemble-program): Don't print the
	  nargs= nrest= etc line, it's redundant.

	* module/system/vm/program.scm (program-bindings-as-lambda-list): If the
	  program bindings is null, then that's that.

2008-11-01  Andy Wingo  <wingo@pobox.com>

	define macros before functions using macros; more MV fixen in srfi-69
	* module/srfi/srfi-69.scm: Move the macros up before the functions that
	  use them, so that the compiler can do its job.
	  (hash-table-walk): While it is true about what I said about R5RS
	  before, it seems that for R6 this will have to change. Anyway. In the
	  meantime, since the test suite checks that hash-table-walk procedures'
	  return values and number of return values are ignored, call that
	  procedure within a call-with-values.

2008-11-01  Andy Wingo  <wingo@pobox.com>

	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.

2008-11-01  Andy Wingo  <wingo@pobox.com>

	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.

2008-11-01  Andy Wingo  <wingo@pobox.com>

	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.

2008-11-01  Andy Wingo  <wingo@pobox.com>

	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.

2008-11-01  Andy Wingo  <wingo@pobox.com>

	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.

2008-11-01  Andy Wingo  <wingo@pobox.com>

	move guilec.mk to am/guilec
	* am/Makefile.am:
	* am/guilec: guilec moved here from /guilec.mk.

	All includers of guilec adapted.

2008-11-01  Andy Wingo  <wingo@pobox.com>

	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).

2008-11-01  Andy Wingo  <wingo@pobox.com>

	move ice-9/ and oop/ under module/
	Moved ice-9/ and oop/ under module/, with the idea being that we have
	only scheme under module/. Adjusted configure.in and Makefile.am
	appropriately. Put oop/ at the end of the compilation order.

2008-10-31  Ludovic Courtès  <ludo@gnu.org>

	Fix initialization of the SMOB GC "kind".
	* libguile/smob.c (scm_smob_prehistory): When initializing
	  SMOB_GC_KIND, pass 1 as the CLEAR_NEW_OBJECTS argument to
	  `GC_new_kind ()'.  Without this, an assertion failure is
	  triggered in libgc's `reclaim.c'.

2008-10-31  Andy Wingo  <wingo@pobox.com>

	compile goops accessors. woot!
	* oop/goops.scm: Define compiler hooks for dealing with @slot-ref and
	  @slot-set!.
	  (make-bound-check-get, make-get, make-set): Compile these indexed
	  accessors instead of having them be closures. Probably slower for the
	  memoizer, but faster for the vm... not sure what the perfect solution
	  is.

	* test-suite/tests/goops.test ("defining classes"): Add a test that
	  defining a class with accessors works (it didn't until I figured out
	  that (@ (system base compile) compile) thing).

2008-10-31  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-31  Andy Wingo  <wingo@pobox.com>

	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...

2008-10-31  Andy Wingo  <wingo@pobox.com>

	fix chaining up from interpreted to compiled methods; allow compiled init-thunk
	* libguile/goops.c (scm_sys_initialize_object): Don't assume that an init
	  thunk is a closure; just go through scm_call_0 instead.

	* oop/goops/compile.scm (make-make-next-method/memoizer): Allow for the
	  case that the next method is compiled.

2008-10-31  Ludovic Courtès  <ludo@gnu.org>

	Don't invoke `on_thread_exit ()' from a pthread key destructor.
	The `on_thread_exit ()' function allocates memory via libgc.  When
	called from the context of a pthread key detructor, the thread is
	essentially "dead" already and `GC_lookup_thread ()' returns NULL,
	which triggers an assertion in libgc's `thread_local_alloc.c'.  This
	patch arranges so that `on_thread_exit ()' is called from a suitable
	context.

	* libguile/threads.c (on_thread_exit): Remove now invalid comment
	  about access to libgc's TLS.
	  (init_thread_key): Don't pass `on_thread_exit ()' to
	  `scm_i_pthread_key_create ()'.
	  (scm_leave_guile_cleanup): Invoke `do_thread_exit ()'.
	  (really_launch): Invoke `pthread_exit ()'.

2008-10-31  Andy Wingo  <wingo@pobox.com>

	compile goops
	The pending task is to make the accessors compiled too, and also to
	compile compile.scm and dispatch.scm, and to integrate dispatch into the
	VM.

	* oop/Makefile.am (SOURCES): VM-ify the makefile, so we compile goops.scm
	  by default.

	* oop/goops.scm (load-toplevel): Load goops builtins when compiling too.
	  (method): Fix a literal #<unspecified> in the generated procedure (for
	  an empty body).
	  (internal-add-method!): Cleverness when bootstrapping add-method!.
	  Neat!
	  (initialize for <generic>): Use the `method' macro so we get
	  compilation support.

	* oop/goops/dispatch.scm (cache-methods): Don't assume entries are pairs.

2008-10-30  Andy Wingo  <wingo@pobox.com>

	compile occam-channel
	* ice-9/Makefile.am (SOURCES): Compile the goops-using occam-channel.scm.

2008-10-30  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-30  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-30  Andy Wingo  <wingo@pobox.com>

	recompiling with compile environments, fluid languages, cleanups
	* ice-9/boot-9.scm (compile-time-environment): Remove definition from
	  boot-9 -- instead, autoload it and `compile' from (system base
	  compile).

	* libguile/objcodes.h:
	* libguile/objcodes.c (scm_objcode_to_program): Add an optional argument,
	  `external', the external list to set on the returned program.

	* libguile/vm-i-system.c (externals): New instruction, returns the
	  external list. Only used by (compile-time-environment).

	* libguile/vm.c (scm_load_compiled_with_vm): Adapt to
	  scm_objcode_to_program change.

	* module/language/scheme/translate.scm (translate): Actually pay
	  attention to the environment passed as an argument.
	  (custom-transformer-table): Expand out (compile-time-environment) to
	  something that can be passed to `compile'.

	* module/system/base/compile.scm (*current-language*): Instead of
	  hard-coding `scheme' in various places, use a current language fluid,
	  initialized to `scheme'.
	  (compile-file, load-source-file): Adapt to *current-language*.
	  (load-source-file): Ada
	  (scheme-eval): Removed, no one used this.
	  (compiled-file-name): Don't hard-code "scm" and "go"; instead use the
	  %load-extensions and %load-compiled-extensions.
	  (cenv-module, cenv-ghil-env, cenv-externals): Some accessors for
	  compile-time environments.
	  (compile-time-environment): Here we define (compile-time-environment)
	  to something that will return #f; the compiler however produces
	  different code as noted above.
	  (compile): New function, compiles an expression into a thunk, then runs
	  the thunk to get the value. Useful for procedures. The optional second
	  argument can be either a module or a compile-time-environment; in the
	  latter case, we can recompile even with lexical bindings.
	  (compile-in): If the env specifies a module, set that module for the
	  duration of the compilation.

	* module/system/base/syntax.scm (%compute-initargs): Fix a bug where the
	  default value for a field would always replace a user-supplied value.
	  Whoops.

	* module/system/il/ghil.scm (ghil-env-dereify): New function, takes the
	  result of ghil-env-reify and turns it back into a GHIL environment.

	* scripts/compile (compile): Remove some of the tricky error handling, as
	  the library procedures handle this for us.

	* test-suite/tests/compiler.test: Add a test for the dynamic compilation
	  bits.

2008-10-28  Ludovic Courtès  <ludo@gnu.org>

	Document the impossibility to call the GC from within `on_thread_exit ()'.
	* libguile/threads.c (on_thread_exit): Add `FIXME' comment.

2008-10-26  Neil Jerram  <neil@ossau.uklinux.net>

	Fix stack calibration-related errors when running make distcheck.
	* libguile/Makefile.am (stack-limit-calibration.scm): Use $(srcdir), to
	  support building in a different directory.
	  (MOSTLYCLEANFILES): Add stack-limit-calibration.scm.

2008-10-25  Andy Wingo  <wingo@pobox.com>

	add `formals', `body', and `compile-env' slots to <method>
	* ice-9/boot-9.scm (compile-time-environment): Return #f instead of
	  erroring under the interpreter, a bit more sane.

	* libguile/goops.c (create_standard_classes):
	* libguile/goops.h (scm_si_formals, scm_si_body, scm_si_compile_env):
	* oop/goops.scm (method, initialize): Add `formals', `body', and
	  `compile-env' slots to <method>.

2008-10-25  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-25  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-25  Andy Wingo  <wingo@pobox.com>

	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.

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.

2008-10-23  Ludovic Courtès  <ludo@gnu.org>

	Expose `GC_dump ()' at the Scheme level.
	* libguile/gc.h (scm_gc_dump): New declaration.

	* libguile/gc.c (scm_gc_dump): New function.

2008-10-23  Andy Wingo  <wingo@pobox.com>

	method is a defmacro.
	* oop/goops.scm (method): Make into a defmacro.

	define-method is a defmacro
	* oop/goops.scm (define-method): Make into a defmacro -- didn't change
	  any of the logic, but the logic is a bit dodgy (see the note in the
	  source).

	define-generic, define-accessor are defmacros too
	* oop/goops.scm (define-generic, define-accessor): Define as defmacros. I
	  find their semantics to be a bit odd, though -- but the test case
	  checks for this behavior, so we'll follow the test cases.

	make `define-class' and `class' into defmacros
	* oop/goops.scm: Use srfi-1, as util.scm already does.
	  (kw-do-map): New helper for processing keyword args.
	  (define-class-pre-definition, define-class): Rework so that
	  define-class is a defmacro without side effects. There are two
	  functional differences: we don't check that define-class is called only
	  at the toplevel, because defining a lexical class might makes sense,
	  and defmacros don't give us the toplevel check that we would want.
	  Second in the redefinition case, we don't do a `define', as we don't
	  actually need a new variable.
	  (class): Similarly, make `class' a defmacro.

2008-10-18  Andy Wingo  <wingo@pobox.com>

	fix typo in assembler
	* module/system/vm/assemble.scm (dump-object!): Whoops, spell `nexts'
	  correctly.

2008-10-18  Andy Wingo  <wingo@pobox.com>

	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!

2008-10-18  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-16  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-16  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-16  Andy Wingo  <wingo@pobox.com>

	fix asyncs running in the vm; re-enable popen.scm compilation
	* libguile/vm-i-system.c (goto/args): Sync the registers before doing the
	  SCM_TICK. We probably need a different SCM_TICK that saves the regs
	  only if necessary. This fixes GC problems with a compiled popen.scm.

	* ice-9/Makefile.am: Re-enable popen.scm compilation.

2008-10-15  Andy Wingo  <wingo@pobox.com>

	fix `(help)'
	* ice-9/session.scm (help): Return valid scheme forms in the no-arg and
	  no-regex cases.

	fix mv-call disasm bug
	* module/system/vm/disasm.scm (code-annotation): Fix bug with mv-call.

	fix disasm bugs, add some more instruction annotations
	* module/system/vm/disasm.scm (disassemble-program): Fix misunderstanding
	  of nlocs: the *actual* number of locals is nlocs + nargs, even if the
	  arg is heap-allocated -- because our calling convention always puts the
	  initial val on the stack. Also: don't disassemble the objects, they are
	  now woven into the text.
	  (code-annotation): Fix external-{ref,set} handling to allow for
	  referencing externals from enclosed stack frames. Really this should be
	  statically determined, though. Add late-variable-{ref,set} handling.

2008-10-12  Ludovic Courtès  <ludo@gnu.org>

	Add GC benchmarks.

2008-10-12  Andy Wingo  <wingo@pobox.com>

	make disassembly better -- a more woven text.
	* module/system/vm/assemble.scm (pop): Define a pop here too.
	  (codegen): Rework how bindings are represented in a program's
	  meta-info, so they declare their range in the binding list instead of
	  you having to figure out when they end.

	* module/system/vm/conv.scm (make-byte-decoder): Return the end-address
	  as well; requires a change to callers.

	* module/system/vm/disasm.scm (disassemble-objcode, disassemble-program)
	  (disassemble-bytecode, disassemble-objects, disassemble-externals)
	  (disassemble-meta, source->string, make-int16, code-annotation)
	  (print-info): Rework to display my domination of `format', and, more
	  seriously, start to integrate the "subsections" of the disassembly into
	  the main disassembly text.

	* module/system/vm/program.scm (program-bindings-as-lambda-list): Update
	  for new bindings format; should be more correct.

2008-10-11  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/Makefile.am
		libguile/threads.c

2008-10-11  Andy Wingo  <wingo@pobox.com>

	simplify disassembly annotations a bit
	* module/system/vm/disasm.scm (original-value): Simplify a bit to
	  normally dispatch on the instruction, only trying code->object at the
	  end.

	make each invocation of `while' throw to different keys
	* ice-9/boot-9.scm (while): Further fixes to while, brought out by the
	  test suite. Also updated documentary comments.

	relax an assertion -- the test suite completes without aborting, whee
	* libguile/vm-i-system.c (call/cc, goto/cc): Don't assert that ip matches
	  vp->ip, because vp->ip is not restored by vm_reset_stack, and indeed
	  it's re-set to 0 by `halt'. But still, perhaps reset_stack and halt
	  should indeed reset vp->ip.

2008-10-11  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-09  Ludovic Courtès  <ludo@gnu.org>

	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>.

2008-10-09  Ludovic Courtès  <ludo@gnu.org>

	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.

2008-10-09  Andy Wingo  <wingo@pobox.com>

	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.

2008-10-09  Andy Wingo  <wingo@pobox.com>

	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-09  Paolo Bonzini  <bonzini@gnu.org>

	subtract 1 from the final byte being flushed in PPC jit_flush_code
	2008-10-09  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/ppc/funcs.h (jit_flush_code): Subtract 1 from end.
		Reported by Eli Barzilay and Matthew Flatt.

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.

2008-10-03  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-30  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-30  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-30  Andy Wingo  <wingo@pobox.com>

	Merge commit 'origin/master' into vm
	Conflicts:

		doc/Makefile.am
		ice-9/Makefile.am
		libguile/gc.c

2008-09-30  Andy Wingo  <wingo@pobox.com>

	(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 @@.

2008-09-30  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-29  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-28  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-28  Andy Wingo  <wingo@pobox.com>

	don't compile psyntax.scm
	* ice-9/Makefile.am: Don't try to compile psyntax.scm

2008-09-26  Ludovic Courtès  <ludo@gnu.org>

	Don't use `scm_leave_guile ()' in mutex/cond-related procedures.
	* libguile/threads.c (scm_pthread_mutex_lock, scm_pthread_cond_wait,
	  scm_pthread_cond_timedwait): Don't call `scm_{leave,enter}_guile ()'.

	Implement `scm_std_select ()' in terms of `scm_without_guile ()'.
	* libguile/threads.c (struct select_args): New.
	  (do_std_select): New function.
	  (scm_std_select): Don't use `scm_{leave,enter}_guile ()' since they don't
	  have any effect; use `scm_without_guile ()' instead.

2008-09-26  Andy Wingo  <wingo@pobox.com>

	rename psyntax.ss to psyntax.scm to hack around makefile foo
	* ice-9/Makefile.am (SOURCES):
	* ice-9/syncase.scm:
	* ice-9/psyntax.scm: Renamve psyntax.ss to psyntax.scm. This way the
	  guilec rules won't delete it on a make clean. Doh!

2008-09-26  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-26  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-25  Ludovic Courtès  <ludo@gnu.org>

	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.

2008-09-25  Andy Wingo  <wingo@pobox.com>

	compile `delay' into `make-promise' with a thunk
	* module/language/scheme/translate.scm (custom-transformer-table):
	  Translate `delay' into `make-promise'.

2008-09-25  Andy Wingo  <wingo@pobox.com>

	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/.

2008-09-25  Andy Wingo  <wingo@pobox.com>

	enable compilation of more modules
	* ice-9/Makefile.am: Compile most modules. There are still a couple that
	  fail to compile.

2008-09-25  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-25  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-25  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-25  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-25  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-24  Andy Wingo  <wingo@pobox.com>

	the vm is a fluid
	* module/system/vm/vm.scm:
	* libguile/vm.h:
	* libguile/vm.c: Make the `the-vm' procedure access a fluid, `*the-vm*'.
	  Export that fluid from vm.h and vm.scm.

2008-09-23  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc

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.

2008-09-23  Ludovic Courtès  <ludo@gnu.org>

	Make `symbol->string' return a read-only string.
	* libguile/strings.c (scm_i_symbol_substring): Return a read-only string
	  since R5RS requires `symbol->string' to return a read-only string.
	  Reported by Bill Schottstaedt <bil@ccrma.Stanford.EDU>.

	* test-suite/tests/symbols.test: Add `define-module' clause.
	  (exception:immutable-string): Adjust to current exception.
	  ("symbol->string")["result is an immutable string"]: Use
	  `pass-if-exception' instead of `expect-fail-exception'.

	* NEWS: Update.

2008-09-22  Neil Jerram  <neil@ossau.uklinux.net>

	Fix for incorrect (gcd -2) => -2; should give 2.
	(reported by Bill Schottstaedt)

	* libguile/numbers.c (scm_gcd): When only one arg given, use scm_abs
	  to ensure that result is non-negative.

	* test-suite/tests/numbers.test ("gcd"): New test, (gcd -2).

2008-09-19  Ludovic Courtès  <ludo@gnu.org>

	Use GC's accessors rather than its global variables.
	* libguile/gc.c (scm_storage_prehistory): Use `GC_set_free_space_divisor ()'
	  instead of accessing the global variable directly.

2008-09-18  Ludovic Courtès  <ludo@gnu.org>

	Fix `strftime' documentation wrt. `%Z'.
	* doc/ref/posix.texi (Time)[strftime]: Remove erroneous note saying
	  that `%Z' ignores `tm:zone'.  Reported by Neil Jerram.

2008-09-18  Andy Wingo  <wingo@pobox.com>

	don't poke installed scm, go, etc files when running pre-inst-guile
	* libguile/load.c (scm_init_load_path): If GUILE_SYSTEM_PATH is set, use
	  that instead of the compiled-in suffix to the load path. And, as a
	  special case, GUILE_SYSTEM_PATH= is interpreted as '(). A bit nasty.

	* pre-inst-guile-env.in (top_builddir): Set GUILE_SYSTEM_PATH to the
	  empty string, if it is not set.

2008-09-18  Ludovic Courtès  <ludo@gnu.org>

	Implement `scm_without_guile ()' in terms of `GC_do_blocking ()'.
	* libguile/threads.c (guilify_self_1): Initialize `t->guile_mode'.
	  (guilify_self_2): Likewise.
	  (struct without_guile_arg): New type.
	  (without_guile_trampoline): New function.
	  (scm_without_guile): Implement in terms of `GC_do_blocking ()'.

	* libguile/threads.h (scm_i_thread)[guile_mode]: New field.

2008-09-18  Ludovic Courtès  <ludo@gnu.org>

	Remove double inclusion of <config.h> in `threads.c'.

	configure: Look for `GC_do_blocking ()' and its declaration.
	* configure.in: Look for `GC_do_blocking ()' and its declaration.

2008-09-18  Andy Wingo  <wingo@pobox.com>

	lambda-lifting for (lambda () ...) as consumer of call-with-values
	* libguile/vm-engine.c (vm_run): Add new error case,
	  vm_error_not_enough_values.

	* libguile/vm-i-system.c (goto/nargs, call/nargs): So, in these cases, if
	  we get too many values, we don't truncate the values like we do in the
	  single-value continuation case, or in the mvbind case. What to do? I
	  guess we either truncate them here, or only allow the correct number of
	  values. Dunno. Mark the code as a fixme.
	  (truncate-values): New instruction, for mv-bind: checks that the number
	  of values on the stack is compatible with the number of bindings we
	  have arranged for them, truncating if necessary.

	* module/language/scheme/translate.scm (custom-transformer-table):
	  Compile receive as a primary form -- not so much because it is a
	  primary form, but more to test the mv-bind machinery. Also it's more
	  efficient, I think.

	* module/system/il/compile.scm (lift-variables!): New helper, factored
	  out of `optimize'.
	  (optimize): Add a few more cases. Adapt `lambda' optimization, which
	  isn't much. I'm not happy with ghil as a mungeable language.
	  Add a case for call-with-values with the second argument is
	  a lambda: lift the lambda. Untested.
	  (codegen): Refactor the push-bindings! code. Compile mv-bind.

	* module/system/il/ghil.scm (<ghil-mv-bind>): Add mv-bind construct,
	  along with its procedures.

	* module/system/il/glil.scm (<glil-mv-bind>): Add mv-bind construct,
	  different from the high-level one. It makes sense in the source, I
	  think.

	* module/system/vm/assemble.scm (codegen): Assemble glil-mv-bind by
	  pushing onto the bindings list, and actually push some code to truncate
	  the values.

2008-09-18  Ludovic Courtès  <ludo@gnu.org>

	Use the `GC_FREE_SPACE_DIVISOR' environment variable.
	* libguile/gc.c (scm_storage_prehistory): Initialize `GC_free_space_divisor'
	  using the `GC_FREE_SPACE_DIVISOR' environment variable.

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-18  Ludovic Courtès  <ludo@gnu.org>

	Remove per-thread `gc_running_p'.
	* libguile/gc.c (scm_gc): Don't use `scm_gc_running_p' as
	  an lvalue.

	* libguile/gc.h (scm_gc_running_p): Define to 0.

	* libguile/threads.h (scm_i_thread)[gc_running_p]: Remove.

2008-09-17  Ludovic Courtès  <ludo@gnu.org>

	Remove GC-related fields from `scm_i_thread'.
	* libguile/gc.h (scm_i_freelist, scm_i_freelist2): Remove declarations.

	* libguile/threads.c (resume): Don't use `t->clear_freelists_p' and
	  `scm_i_freelist{,2}'.
	  (scm_enter_guile, scm_leave_guile, guilify_self_1): Don't use
	  the `heap_mutex' and other fields removed from `scm_i_thread'.
	  (scm_i_freelist, scm_i_freelist2): Remove.

	* libguile/threads.h (scm_i_thread)[heap_mutex, freelist, freelist2,
	  clear_freelists_p]: Remove.

2008-09-17  Ludovic Courtès  <ludo@gnu.org>

	Remove code intended to put threads to sleep.
	Actually, threads would "go to sleep" either by blocking on a heap
	allocation, or by noticing `scm_i_thread_go_to_sleep' is set when
	running `SCM_TICK', which limits the applicability of this technique
	(e.g., it was not appropriate for the shared string code).

	* libguile/threads.c (scm_i_thread_go_to_sleep, scm_i_thread_put_to_sleep,
	  scm_i_thread_invalidate_freelists, scm_i_thread_wake_up,
	  scm_i_thread_sleep_for_gc): Remove.

	* libguile/threads.h (scm_i_thread_go_to_sleep, scm_i_thread_put_to_sleep,
	  scm_i_thread_invalidate_freelists, scm_i_thread_wake_up,
	  scm_i_thread_sleep_for_gc): Remove declarations.
	  (SCM_THREAD_SWITCHING_CODE): Do nothing.

2008-09-17  Ludovic Courtès  <ludo@gnu.org>

	Remove use of `scm_i_thread_put_to_sleep ()' in the string code.
	* libguile/strings.c (scm_i_string_writable_chars): Remove use of
	  `scm_i_thread_put_to_sleep ()'.  This leaves a race condition,
	  which is hopefully not harmful.

2008-09-17  Ludovic Courtès  <ludo@gnu.org>

	Remove GC-related code from fluids.
	* libguile/fluids.c (all_dynamic_states, all_fluids): Remove.  Together,
	  they prevented dynamic states and fluids to be collected.  Callers no
	  longer use them.
	  (resize_all_states): Remove.
	  (grow_dynamic_state): New function.
	  (next_fluid_num): Don't call `resize_all_states ()'.
	  (scm_i_fluid_num, scm_i_fast_fluid_ref, scm_i_fast_fluid_set_x): Remove,
	  as they broke encapsulation and would have needed duplication of the lazy
	  dynamic state growing code.
	  (scm_fluid_ref, scm_fluid_set_x): Lazily grow the dynamic state's fluid
	  vector.
	  (scm_fluids_prehistory): Don't set an `scm_after_sweep_c_hook'.

	* libguile/fluids.h (SCM_FLUID_NUM, SCM_FAST_FLUID_REF, SCM_FAST_FLUID_SET_X,
	  scm_i_fluid_num, scm_i_fast_fluid_set_x, scm_i_fast_fluid_ref): Remove.

	* libguile/load.c (the_reader_fluid_num): Remove.
	  (scm_primitive_load): Use `scm_fluid_ref ()' instead of
	  `SCM_FAST_FLUID_REF ()'.
	  (scm_init_load): Likewise.

2008-09-16  Ludovic Courtès  <ludo@gnu.org>

	Use immutable cells for vectors.
	* libguile/vectors.c (scm_c_make_vector): Use `scm_immutable_cell ()'.

	Use immutable double-cells for symbols.
	* libguile/strings.c (scm_i_make_symbol): Use `scm_immutable_double_cell ()'.

	Add `scm_immutable_double_cell ()'.
	* libguile/inline.h (scm_immutable_double_cell): New.

2008-09-16  Andy Wingo  <wingo@pobox.com>

	compile call-with-values, woot!
	* libguile/vm-engine.c (vm_run): Add another byte onto the bootstrap
	  program, as the offset passed to mv-call now takes two bytes.

	* module/system/vm/frame.scm (bootstrap-frame?): Update for the new
	  bootstrap length. Really we should just check for 'halt though.

	* libguile/vm-i-system.c (FETCH_OFFSET): New helper, used in BR().
	  (goto/nargs, call/nargs): Versions of goto/args and call, respectively,
	  that take the number of arguments from a value on the top of the stack.
	  (mv-call): Call FETCH_OFFSET to get the offset.

	* module/language/scheme/translate.scm (custom-transformer-table):
	  Compile call-with-values to <ghil-mv-call>. There is some trickery
	  because of the r4rs.scm call-with-values trampolines.

	* module/system/il/ghil.scm: Add <ghil-mv-call> and accessors.

	* module/system/il/compile.scm (codegen): Compile <ghil-mv-call>.

	* module/system/il/glil.scm: Add <glil-mv-call>, which needs some special
	  assembly because of the label. Fix some typos.

	* module/system/vm/assemble.scm (byte-length): New helper, factored out
	  and made more general.
	  (codegen): Assemble mv-call, including the label.
	  (check-length): New helper, makes sure that the addressing is
	  consistent within the produced object code.
	  (stack->bytes): Rewrite to be more generic -- now `br' instructions
	  aren't the only ones jumping around in the instruction stream.

	* module/system/vm/conv.scm (make-byte-decoder): Return two values in the
	  #f case.

	* module/system/vm/disasm.scm (disassemble-bytecode): Rewrite, because
	  the previous implementation depended on a guile interpreter quirk:
	  namely, that multiple values could be represented within one value, and
	  destructured later.

2008-09-15  Ludovic Courtès  <ludo@gnu.org>

	Use immutable cells for closures.
	* libguile/eval.c (scm_closure): Use `scm_immutable_cell ()' instead
	  of `scm_cell ()'.

	* libguile/procs.h (SCM_SETCODE, SCM_SETENV): Remove.

2008-09-15  Ludovic Courtès  <ludo@gnu.org>

	Use immutable cells (aka. libgc "stubborn") for subrs.
	* libguile/procs.c (scm_c_make_subr): Use `scm_immutable_cell ()' instead
	  of `scm_cell ()'.
	  (scm_free_subr_entry): Remove.

	* libguile/procs.h (SCM_SET_SUBRNUM, SCM_SET_SUBRF): Remove.
	  (scm_free_subr_entry): Remove declaration.

2008-09-15  Ludovic Courtès  <ludo@gnu.org>

	Add `scm_immutable_cell ()'.
	* libguile/inline.h (scm_immutable_cell): New.

2008-09-15  Ludovic Courtès  <ludo@gnu.org>

	Remove unused GC string/symbol functions.
	* libguile/strings.c (scm_i_stringbuf_mark, scm_i_stringbuf_free,
	  scm_i_string_mark, scm_i_string_free, scm_i_symbol_mark,
	  scm_i_symbol_free): Remove.

	* libguile/strings.h: Remove corresponding declarations.

2008-09-15  Ludovic Courtès  <ludo@gnu.org>

	Conditionalize GC 6.x code.
	* libguile/gc.c (scm_storage_prehistory): Have `GC_init ()' called only
	  with GC 6.x (it doesn't hurt with 7.x, though).

2008-09-15  Neil Jerram  <neil@ossau.uklinux.net>

	Make multi-byte reads on unbuffered ports more efficient.
	Idea and original patch were by Ludovic Court�s, this is Neil Jerram's
	reworking of it.

		* libguile/srfi-4.c (scm_uniform_vector_read_x): Use scm_c_read,
		instead of equivalent code here.

		* libguile/ports.c (scm_fill_input): Add assertion that read
		buffer is empty when called.
		(port_and_swap_buffer, swap_buffer): New, for...
		(scm_c_read): Use caller's buffer for reading, to avoid making N
		1-byte low-level read calls, in the case where the port is
		unbuffered (or has a very small buffer).

2008-09-15  Ludovic Courtès  <ludo@gnu.org>

	Add `uniform-vector-read!' benchmark.

2008-09-15  Andy Wingo  <wingo@pobox.com>

	add special case for (apply values ...)
	* libguile/vm-engine.c (vm_run): Move nvalues to the top level, to avoid
	  (spurious, it seems) gcc warnings about it being used uninitialized.

	* libguile/vm-i-system.c (halt, return/values): Adapt to gcc silliness.
	  Deindent some of return/values.
	  (return/values*): New instruction, does what (apply values . args)
	  would do.

	* module/language/scheme/translate.scm (custom-transformer-table): Move
	  the apply and @apply cases here from inline.scm, because we need some
	  more cleverness when dealing with cases like (apply values . args).
	  (lookup-apply-transformer): Define an eval transformer for `values',
	  turning it into ghil-values*.

	* module/system/il/compile.scm (codegen): Compile <ghil-values*> into
	  return/values*.

	* module/system/il/ghil.scm: Add <ghil-values*> and accessors.
	  (ghil-lookup): Add optional argument, define?, which if false tells us
	  not to actually cache the binding if it is not found in the toplevel.

	* module/system/il/inline.scm: Remove apply clauses.

	* module/system/vm/frame.scm (bootstrap-frame?): Update heuristic for
	  bootstrap-frame?, as the bootstrap frame is now 5 bytes since it
	  accepts multiple values.

2008-09-14  Ludovic Courtès  <ludo@gnu.org>

	Fix detection of the GC version.
	* libguile/boehm-gc.h: Don't expect `GC_VERSION_MAJOR' to be defined,
	  as it's defined only since 7.x.

2008-09-14  Andy Wingo  <wingo@pobox.com>

	add multiple values support to the vm
	* libguile/vm-engine.c (vm_run): The bootstrap program now uses mv_call,
	  so as to allow multiple values out of the VM. (It did before, because
	  multiple values were represented internally as single scm_values
	  objects, but now that values go on the stack, we need to note the boot
	  frame as accepting multiple values.)
	  (vm_error_no_values): New error, happens if you pass no values into a
	  single-value continuation. Passing more than one is OK though, it just
	  takes the first one.

	* libguile/vm-i-system.c (halt): Assume that someone has pushed the
	  number of values onto the stack, and package up that number of values
	  as a scm_values() object, for communication with the interpreter.
	  (mv-call): New instruction, calls a procedure with a multiple-value
	  continuation, even handling calls out to the interpreter.
	  (return/values): New instruction, returns multiple values to the
	  continuation. If the continuation is single-valued, takes the first
	  value or errors if there are no values. Otherwise it returns to the
	  multiple-value return address, pushing the number of values on top of
	  the values.

	* module/system/il/compile.scm (codegen): Compile <ghil-values> forms.

	* module/system/il/ghil.scm (<ghil-values>) Add new GHIL data structure
	  and associated procedures.

	* module/language/scheme/translate.scm (custom-transformer-table):
	  Compile (values .. ) forms into <ghil-values>.

2008-09-14  Andy Wingo  <wingo@pobox.com>

	look up scheme translators by value, not by name
	* module/language/scheme/translate.scm (custom-transformer-table): Rename
	  from `primitive-syntax-table', because now it will handle procedural
	  values as well.
	  (lookup-transformer): Update for renaming. Look up custom transformers
	  by value, not name.
	  (make-pmatch-transformers): Key the transformer table by value, not
	  name.

2008-09-13  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		lib/Makefile.am
		libguile/gc-card.c
		libguile/gc-freelist.c
		libguile/gc-mark.c
		libguile/gc-segment.c
		libguile/gc.c
		libguile/gc.h
		libguile/gc_os_dep.c
		libguile/private-gc.h
		m4/.cvsignore
		m4/gnulib-cache.m4
		m4/gnulib-comp.m4

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.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	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'.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	(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.

2008-09-13  Andy Wingo  <wingo@pobox.com>

	fix *another* bug in compiling `or'. incredible.
	* module/system/il/compile.scm (codegen): Fix *another* bug in compiling
	  `or' -- in the case in which the value was being discarded, as in `or'
	  used as a control structure, we were sometimes leaving a value on the
	  stack.

	* testsuite/t-or.scm: Add another test case for `or'.

2008-09-12  Andy Wingo  <wingo@pobox.com>

	untabify process-define-module
	* ice-9/boot-9.scm (process-define-module): Untabify.

	correctly disassemble program bindings (arguments, locals, externals)
	* module/system/vm/disasm.scm (disassemble-bindings): New function,
	  properly disassembles the bindings data. Neat!

2008-09-11  Ludovic Courtès  <ludo@gnu.org>

	Revert "Use Gnulib's `count-one-bits' module."
	We don't need it in this branch.

	This reverts commit d7014610b16cd5f273479e70db253bff2f0124fc.

2008-09-11  Ludovic Courtès  <ludo@gnu.org>

	Adjust to be usable with `libgc' 7.1.
	* libguile/boehm-gc.h: Only include <gc/gc_local_alloc.h> with
	  `libgc' 6.x.  Define `GC_PTR' for `libgc' 7.x+.

	Fix bug in port eviction code
	* libguile/fports.c (scm_i_evict_port): Check whether PORT has a
	  ptab entry associated with it.  It's unclear when this can happen.

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Fix broken hash-table merge.
	* libguile/hashtab.c (scm_hash_fn_create_handle_x): Return IT only when
	  it satisfies `scm_is_pair ()'.

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Fix broken GC and threads merge.
	* libguile/private-gc.h (scm_i_tag_name): New declaration.

	* libguile/threads.c: Include <config.h>.

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Fix broken port merge.
	* libguile/ports.c (finalize_port): Don't call `scm_remove_from_port_table ()'.
	  (scm_flush): Don't refer to `scm_i_port_table_size'.
	  (scm_ports_prehistory): Don't allocate `scm_i_port_table'.

	* libguile/ports.h (scm_i_port_table_room): Remove declaration.

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Merge branch 'master' into boehm-demers-weiser-gc
	Conflicts:
		libguile/Makefile.am
		libguile/coop-defs.h
		libguile/gc-card.c
		libguile/gc-freelist.c
		libguile/gc-malloc.c
		libguile/gc-mark.c
		libguile/gc-segment.c
		libguile/gc.c
		libguile/gc.h
		libguile/gc_os_dep.c
		libguile/hashtab.c
		libguile/hashtab.h
		libguile/inline.h
		libguile/private-gc.h
		libguile/struct.c
		libguile/struct.h
		libguile/threads.c
		libguile/threads.h
		libguile/vectors.h
		libguile/weaks.h
		test-suite/tests/gc.test

2008-09-10  Ludovic Courtes  <ludo@gnu.org>

	Document the failure of `gc.test' wrt. unused modules.
	* test-suite/tests/gc.test (Unused modules are removed): Use guardians
	  instead of `gc-live-object-stats'.  Explain failure (FIXME).

	* ice-9/boot-9.scm (make-module): Add `FIXME' about circular reference.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-9

2008-09-10  Ludovic Courtes  <ludo@gnu.org>

	Add comment about `GC_local_malloc ()' upon thread destruction.
	* libguile/threads.c (on_thread_exit): Add caveat about possible
	  segfault.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-8

2008-09-10  Ludovic Courtes  <ludo@gnu.org>

	Remove `scm_get_stack_base ()'.
	* libguile/threads.c: Replace `scm_get_stack_base ()' by
	  `GC_stackbottom'.

	* libguile/gc.h (scm_get_stack_base): Remove declaration.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-7

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Merge commit '2e77f7202b11ad0003831fcff94ec7db80cca015' into boehm-demers-weiser-gc
	Conflicts:
		libguile/threads.c

	Merge commit '29776e85da637ec4d44b2b2822d6934a50c0084b' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc-card.c
		libguile/gc.c
		libguile/gc.h
		libguile/ports.c

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed warnings due to unused stuff.
	* libguile/gc.c (scm_cells_allocated, scm_last_cells_allocated,
	  scm_gc_cells_collected, scm_gc_cells_collected_1,
	  scm_gc_malloc_collected, scm_gc_time_taken, t_before_gc,
	  scm_gc_mark_time_taken, scm_gc_times, scm_gc_cells_swept,
	  scm_gc_cells_marked_acc, scm_gc_cells_swept_acc,
	  scm_gc_cell_yield_percentage, scm_gc_malloc_yield_percentage):
	  Removed.

	* libguile/gc.h: Updated accordingly.

	* libguile/gdbint.c (port_mark_p, stream_mark_p, string_mark_p,
	  unmark_port, remark_port): Removed.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-4

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Merge commit '7337d56d5714227865aeca2b40b6bd97cce296d2' into boehm-demers-weiser-gc
	Conflicts:
		libguile/struct.c

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	scm_gc_malloc: Handle zero-octet allocations.
	* libguile/gc-malloc.c (scm_gc_malloc): Pass a non-zero size to
	  `GC_MALLOC ()' when SIZE is zero.

	git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-2

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Merge commit '032913739218c756f673bfb9c8f66ef9f8f02330' into boehm-demers-weiser-gc
	Conflicts:
		libguile/gc.c
		libguile/srcprop.c
		libguile/srcprop.h

2008-09-10  Ludovic Court`es  <ludovic.courtes@laas.fr>

	Reverted inappropriate merge in `gc.c'.
	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-53

2008-09-10  Ludovic Courtès  <ludo@gnu.org>

	Merge commit 'f30e1bdf97ae8b2b2918da585f887a4d3a23a347' into boehm-demers-weiser-gc
	Conflicts:
		libguile/Makefile.am
		libguile/coop-pthreads.c
		libguile/gc-freelist.c
		libguile/gc-segment.c
		libguile/gc.c
		libguile/private-gc.h
		test-suite/tests/environments.nottest

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Use thread-local allocation (significant perf. improvement!); added the `boehm-gc.h' header.
	* libguile/Makefile.am (modinclude_HEADERS): Added `boehm-gc.h'.

	* libguile/coop-defs.h: Use "libguile/boehm-gc.h" instead of <gc/gc.h>.

	* libguile/coop-threads.h: Likewise.

	* libguile/coop.c: Likewise.

	* libguile/gc.c: Likewise.
	  (scm_storage_prehistory): Invoke `GC_init ()'.

	* libguile/guardians.c: Use "libguile/boehm-gc.h" instead of <gc/gc.h>.

	* libguile/inline.h: Likewise.
	  (scm_double_cell): Use `GC_MALLOC' instead of `GC_malloc'.

	* libguile/pthread-threads.h: Use "libguile/boehm-gc.h" instead of
	  <gc/gc.h>.

	* libguile/smob.c: Likewise.

	* libguile/smob.h: Likewise.

	* libguile/struct.c: Likewise.

	* libguile/threads.c: Likewise.

	* libguile/weaks.c: Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-51

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Removed `scm_gc_registered_roots' and `scm_permobjs'.
	* libguile/gc.c (scm_permanent_object): Use `scm_gc_protect_object ()'.
	  (scm_gc_register_root): Do nothing.
	  (scm_init_storage): Removed initialization of `scm_permobjs' and
	  `scm_gc_register_roots'.

	* libguile/root.h (scm_permobjs): Removed.
	  (scm_gc_registered_roots): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-50

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Expand heap size at startup time.
	* libguile/gc.c (scm_storage_prehistory): Invoke `GC_expand_hp ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-49

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Turn "all interior pointers" off (slight performance gain).
	* libguile/gc.c (scm_storage_prehistory): Set `GC_all_interior_pointers'
	  to 0.  Register `scm_tc3_cons' and `scm_tc3_closure' as valid
	  displacements.

	* libguile/struct.c (scm_alloc_struct): Register additional
	  displacements.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-48

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Implemented `gc-stats' using `libgc' information.
	* libguile/gc.c (protected_obj_count): Made `static'.
	  (scm_heap_size): Mapped to `heap-size' rather than `cell-heap-size'.
	  (scm_heap_free_size): New.
	  (scm_heap_total_allocated): New.
	  (scm_gc_stats): Rewritten.  Return the (little) information available
	  from `libgc'.
	  (scm_gc_disable): New.
	  (scm_gc_enable): New.
	  (scm_storage_prehistory): Don't call `GC_add_roots ()' with
	  SCM_SYS_PROTECTS.  Use `GC_is_visible ()' to check whether
	  SCM_SYS_PROTECTS is visible.

	* libguile/gc.h (scm_gc_enable): New declaration.
	  (scm_gc_disable): New declaration.
	  (scm_gc_for_alloc): Removed.
	  (scm_gc_for_newcell): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-46

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Have source properties only use regular GC mechanisms.
	* libguile/srcprop.c: Include "libguile/gc.h".
	  (srcprops_chunklist): Removed.
	  (srcprops_freelist): Removed.
	  (srcprops_free): Removed.
	  (scm_make_srcprops): Use `scm_gc_malloc ()' rather than
	  SRCPROPS_FREELIST et al.
	  (scm_init_srcprop): Don't call `scm_set_smob_free ()'.
	  (scm_finish_srcprop): Do nothing.

	* libguile/srcprop.h (SRCPROPS_CHUNKSIZE): Removed.
	  (scm_t_srcprops_chunk): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-45

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed symbols so that interned symbols are only weakly referenced.
	* libguile/symbols.c (lookup_interned_symbol): When a deleted weak pair
	  is encountered, remove it and update the hashtable's item count.  Also,
	  check the hash table threshold and trigger a rehashing if needed.
	  (scm_i_c_mem2symbol): Allocate CELL using `scm_weak_car_pair ()' rather
	  than `scm_cons ()'.
	  (scm_i_mem2symbol): Likewise.
	  (scm_symbols_prehistory): Don't invoke `scm_permanent_object ()' for
	  SYMBOLS.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-44

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Re-fixed the hash table element counting in `scm_i_rehash ()'.
	* libguile/hashtab.c (scm_i_rehash): Don't invoke
	  `SCM_HASHTABLE_DECREMENT ()' when a weak pair is encountered in the
	  source bucket.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-43

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed `guardians.test' so that it does not use symbols.
	* test-suite/tests/guardians.test: Use strings instead of symbols for
	  `g3-garbage' et al.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-42

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Allow guardians to be GC'd before the objects they guard.
	* libguile/guardians.c (finalize_guarded): While traversing
	  GUARDIANS_LIST, check for deleted weak-car pairs.
	  (scm_i_guard): Instantiate GUARDIANS_FOR_OBJ using `scm_weak_car_pair ()'
	  rather than `scm_cons ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-41

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Minor weak hashtables fixes.
	* libguile/hashtab.c (scm_fixup_weak_alist): Cosmetic change.
	  (scm_i_rehash): Call `SCM_HASHTABLE_DECREMENT ()' when a deleted weak
	  pair is encountered.
	  (scm_internal_hash_fold): Call `SCM_HASHTABLE_DECREMENT ()' instead of
	  a complicated `SCM_SET_HASHTABLE_N_ITEMS ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-40

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Moved weak pair code into `weaks.[ch]'.
	* libguile/hashtab.c: Don't include <gc/gc_typed.h> and <gc/gc.h>.
	  Updated users of weak
	  (wcar_cell_descr): Removed.
	  (wcdr_cell_descr): Removed.
	  (scm_weak_car_cell): Removed.
	  (scm_weak_cdr_cell): Removed.
	  (scm_doubly_weak_cell): Removed.
	  (SCM_WEAK_CELL_*_DELETED_P): Removed.
	  (SCM_WEAK_CELL_WORD): Removed.
	  (SCM_WEAK_CELL_C[AD]R): Removed.
	  (scm_hashtab_prehistory): Don't initialize weak pairs.

	* libguile/init.c (scm_i_init_guile): Invoke `scm_weaks_prehistory ()'
	  before `scm_hashtab_prehistory ()' in order to initialize weak pairs.

	* libguile/weaks.c: Include <gc/gc.h> and <gc/gc_typed.h>.
	  (wc[ad]r_cell_descr): New.
	  (scm_weak_c[ad]r_pair): New.
	  (scm_doubly_weak_pair): New.
	  (scm_weaks_prehistory): New.

	* libguile/weaks.h (scm_weak_c[ad]r_pair): New declaration.
	  (scm_doubly_weak_pair): New declaration.
	  (SCM_WEAK_PAIR_WORD_DELETED_P): New.
	  (SCM_WEAK_PAIR_CAR_DELETED_P): New.
	  (SCM_WEAK_PAIR_CDR_DELETED_P): New.
	  (SCM_WEAK_PAIR_DELETED_P): New.
	  (SCM_WEAK_PAIR_WORD): New.
	  (SCM_WEAK_PAIR_CAR): New.
	  (SCM_WEAK_PAIR_CDR): New.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-39

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Implemented rehashing of weak hash tables.
	* libguile/hashtab.c (weak_hashtables): Removed.
	  (SCM_WEAK_CELL_DELETED_P): New macro.
	  (START_WEAK_BUCKET_FIXUP): Added the HASHFN argument.  Invoke
	  `scm_i_rehash ()' when pairs have been removed.
	  (END_WEAK_BUCKET_FIXUP): Added the HASHFN argument.
	  (make_hash_table): Use `SCM_NEWSMOB2 ()' instead of `SCM_NEWSMOB3 ()'
	  -- last argument used to be WEAK_HASHTABLES.
	  (scm_i_rehash): Handle weak hash tables.
	  (to_rehash): Removed.
	  (scm_internal_hash_fold): Use `SCM_WEAK_CELL_DELETED_P ()' rather than
	  hand-written equivalent code.
	  (rehash_after_gc): Removed.
	  (scm_hashtab_prehistory): Don't add it as an after-gc hook.

	* libguile/hashtab.h (SCM_HASHTABLE_NEXT): Removed.
	  (SCM_HASHTABLE_NEXTLOC): Removed.
	  (SCM_SET_HASHTABLE_NEXT): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-38

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Implemented port finalization.
	* libguile/ports.c (register_finalizer_for_port): New.
	  (finalize_port): New.
	  (scm_new_port_table_entry): Call `register_finalizer_for_port ()'
	  before returning the new port.
	  (scm_ports_prehistory): Use `scm_gc_malloc_pointerless ()' instead of
	  `scm_gc_malloc ()' when allocating room for SCM_I_PORT_TABLE.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-37

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Use `scm_gc_malloc_pointerless' in various places (improves performance).
	* libguile/fports.c (scm_fport_buffer_add): Use
	  `scm_gc_malloc_pointerless ()' instead of `scm_gc_malloc ()' when
	  allocating room for the read/write buffers.

	* libguile/numbers.c (scm_c_make_rectangular): Likewise.

	* libguile/ports.c (scm_ungetc): Likewise.

	* libguile/random.c (scm_i_copy_rstate): Likewise.
	  (scm_c_make_rstate): Likewise.

	* libguile/regex-posix.c (scm_make_regexp): Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-36

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Removed the now-useless `scm_struct_free_*' functions.
	* libguile/struct.c (scm_alloc_struct): Set the `scm_struct_i_free'
	  element to 0 instead of `scm_struct_free_standard'.
	  (scm_struct_free_0): Removed.
	  (scm_struct_free_light): Removed.
	  (scm_struct_free_standard): Removed.
	  (scm_struct_free_entity): Removed.

	* libguile/struct.h (scm_struct_free_0): Removed.
	  (scm_struct_free_light): Removed.
	  (scm_struct_free_standard): Removed.
	  (scm_struct_free_entity): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-35

2008-09-10  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Removed unnecessary uses of class destructors.
	* libguile/goops.c (scm_sys_inherit_magic_x): Don't invoke
	  `SCM_SET_CLASS_DESTRUCTOR' for legacy destructors that are no longer
	  needed (e.g., `scm_struct_free_entity ()', etc.).

	* libguile/objects.c (scm_init_objects): Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-34

2008-09-09  Andy Wingo  <wingo@pobox.com>

	really newline on eof
	* module/system/repl/repl.scm (next-char): Another newline-on-eof case.

	fix program disassembly for meta-in-a-thunk
	* module/system/vm/disasm.scm (disassemble-program): Fix for recent
	  meta-in-a-thunk change.

2008-09-09  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-09  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-09  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-09  Andy Wingo  <wingo@pobox.com>

	final de-:prefixification
	* scripts/compile: Don't (read-set! keywords 'prefix) here either.

2008-09-09  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-07  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-07  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-07  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-07  Andy Wingo  <wingo@pobox.com>

	improve backtraces
	* module/system/vm/frame.scm (frame-call-representation): Show more of
	  lists.
	  (program-name): Avoid a traceback if (frame-address link) is #f. Not
	  sure when this can happen, but it does, and since this is already in
	  the backtrace function, there be badness there.

	update .gitignore files
	* .gitignore:
	* libguile/.gitignore: Update

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Added support for the free function of structures.
	* libguile/struct.c (struct_finalizer_trampoline): New.
	  (scm_struct_gc_init): Removed.
	  (scm_i_structs_to_free): Removed.
	  (scm_free_structs): Removed.
	  (scm_make_struct): Register a finalizer for the new struct if need be.
	  (scm_struct_prehistory): Cleared.

	* libguile/struct.h (scm_i_structs_to_free): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-33

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Use the SMOB API in `coop-pthreads.c' rather than low-level primitives.
	* libguile/coop-pthreads.c: Include "smob.h".
	  (make_thread): Use `SCM_NEWSMOB' rather than `scm_cell'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-32

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed a warning in `symbols.c'.
	* libguile/symbols.c (lookup_interned_symbol): When checking for `NULL',
	  use `SCM2PTR' rather than `SCM_UNPACK' (this fixes a warning).

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-31

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed the SMOB mark procedure so that it handles free-list objects.
	* libguile/smob.c (smob_mark): Check the 7-bit type tag and ignore those
	  whose type tag is not that of a SMOB in order to cleanly handle
	  free-list objects (this fixes a bug which showed up on SPARC64).
	  Also, don't mark & push ADDR itself.
	  (scm_gc_mark): Moved the definition and undefinition of
	  `CURRENT_MARK_PTR' and `CURRENT_MARK_LIMIT' here.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-30

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed use of finalizers for guardians and SMOBs (undoes patches 23-24).
	* libguile/gc.c (finalizer_trampoline): Removed.
	  (scm_gc_register_finalizer): Removed (undoes patches 23 and 24).

	* libguile/gc.h (scm_gc_register_finalizer): Removed.

	* libguile/guardians.c (finalize_guarded): Undid patch 23.  Added support
	  for "proxied finalizers".
	  (scm_i_guard): Likewise.

	* libguile/smob.c (scm_i_finalize_smob): Adapted to
	  `GC_finalization_proc'.

	* libguile/smob.h: Include <gc/gc.h>.
	  (SCM_NEWSMOB): Use `GC_REGISTER_FINALIZER_NO_ORDER' instead of
	  `scm_gc_register_finalizer ()'.
	  (SCM_NEWSMOB3): Likewise.
	  (scm_i_finalize_smob): Updated.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-29

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Removed a lot of now-useless SMOB mark/free functions.
	* libguile/arbiters.c (scm_init_arbiters): Don't invoke `scm_set_smob_mark'.

	* libguile/async.c (async_gc_mark): Removed.
	  (scm_init_async): Don't invoke `scm_set_smob_mark'.

	* libguile/coop-pthreads.c (thread_mark): Removed.
	  (create_thread): Use `scm_gc_malloc' instead of `scm_malloc' when
	  allocating `launch_data'.
	  (mutex_mark): Removed.
	  (scm_threads_init): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/debug.c (scm_init_debug): Don't invoke `scm_set_smob_mark'.

	* libguile/dynl.c (dynl_obj_mark): Removed.
	  (scm_init_dynamic_linking): Don't invoke `scm_set_smob_mark'.

	* libguile/dynwind.c (winder_mark): Removed.
	  (scm_init_dynwind): Don't invoke `scm_set_smob_mark'.

	* libguile/environments.c (environment_mark): Removed.
	  (environment_free): Removed.
	  (observer_mark): Removed.
	  (core_environments_mark): Removed.
	  (core_environments_finalize): Removed.
	  (leaf_environment_mark): Removed.
	  (leaf_environment_free): Removed.
	  (leaf_environment_funcs): Don't refer to the above funcs.
	  (eval_environment_mark): Removed.
	  (eval_environment_free): Removed.
	  (eval_environment_funcs): Don't refer to the above funcs.
	  (import_environment_mark): Removed.
	  (import_environment_free): Removed.
	  (import_environment_funcs): Don't refer to the above funcs.
	  (export_environment_mark): Removed.
	  (export_environment_free): Removed.
	  (export_environment_funcs): Don't refer to the above funcs.
	  (scm_environments_prehistory): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/environments.h (scm_environment_funcs)[mark]: Removed.
	  [free]: Removed.

	* libguile/eval.c (promise_mark): Removed.
	  (promise_free): Removed.
	  (scm_init_eval): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/fluids.c (fluid_free): Removed.
	  (scm_fluids_prehistory): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/futures.c (future_mark): Removed.
	  (scm_init_futures): Don't invoke `scm_set_smob_mark'.

	* libguile/hashtab.c (hashtable_free): Removed.
	  (scm_hashtab_prehistory): Don't invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/hooks.c (scm_init_hooks): Don't invoke `scm_set_smob_mark'.

	* libguile/keywords.c (scm_init_keywords): Don't invoke
	  `scm_set_smob_mark'.

	* libguile/macros.c (scm_init_macros): Don't invoke `scm_set_smob_mark'.

	* libguile/modules.c (scm_init_modules): Don't invoke
	  `scm_set_smob_mark'.

	* libguile/print.c (scm_init_print): Don't invoke `scm_set_smob_mark'.

	* libguile/random.c (scm_i_copy_rstate): Use `scm_gc_malloc' instead of
	  `scm_malloc'.
	  (scm_c_make_rstate): Likewise.
	  (rstate_free): Removed.
	  (scm_init_random): Don't invoke `scm_set_smob_free'.

	* libguile/srcprop.c (srcprops_mark): Removed.
	  (scm_init_srcprop): Don't invoke `srcprops_mark'.

	* libguile/srfi-14.c (charset_free): Removed.
	  (scm_init_srfi_14): Don't invoke `scm_set_smob_free'.

	* libguile/srfi-4.c (uvec_mark): Removed.
	  (uvec_free): Removed.
	  (scm_init_srfi_4): Don't invoke `scm_set_smob_free' and
	  `scm_set_smob_mark'.

	* libguile/threads.c (thread_mark): Removed.
	  (fat_mutex_mark): Removed.
	  (fat_cond_mark): Removed.
	  (scm_init_threads): Dont invoke `scm_set_smob_mark' and
	  `scm_set_smob_free'.

	* libguile/unif.c (bitvector_free): Removed.
	  (array_mark): Removed.
	  (array_free): Removed.
	  (scm_init_unif): Don't invoke `scm_set_smob_free' and
	  `scm_set_smob_mark'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-28

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed the undocumented `scm_make_smob ()' function.
	* libguile/smob.c (scm_make_smob): Use `SCM_RETURN_NEWSMOB ()' instead of
	  `scm_cell ()' when instantiating the SMOB.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-27

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Added support for SMOBs free function (via finalizers).
	* libguile/smob.c (scm_i_finalize_smob): New.

	* libguile/smob.h (SCM_NEWSMOB): Register `scm_i_finalize_smob ()' as a
	  finalizer for Z if its SMOB type has a free function.
	  (SCM_NEWSMOB3): Likewise.
	  (scm_i_finalize_smob): New declaration.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-26

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Removed the free function from the malloc-object SMOB type.
	* libguile/mallocs.c (malloc_free): Removed.
	  (scm_init_mallocs): Don't invoke `scm_set_smob_free ()' because the
	  memory allocated by `scm_gc_malloc ()' will automatically be freed.
	  Furthermore, `malloc_free ()' used to invoke `free ()' instead of
	  `scm_gc_free ()' which is incorrect.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-25

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed `scm_gc_register_finalizer ()' to avoid bootstrap problem.
	* libguile/gc.c (finalizer_trampoline): Don't use `scm_call_2 ()' to
	  invoke the finalizer: directly call the C function instead.
	  (scm_gc_register_finalizer): Don't create a real subr with
	  `scm_c_make_gsubr ()': simply convert the C function pointer to an
	  `SCM' object instead.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-24

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Generalized BGC's finalizer mechanism.  Use it in `guardians.c'.
	* libguile/gc.c (finalizer_trampoline): New.
	  (scm_gc_register_finalizer): New.

	* libguile/gc.h (scm_gc_register_finalizer): New declaration.

	* libguile/guardians.c (finalize_guarded): Updated to the new prototype.
	  (scm_i_guard): Use `scm_gc_register_finalizer ()' instead of
	  `GC_REGISTER_FINALIZER_NO_ORDER ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-23

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Added support for SMOB custom mark procedures.
	* libguile/gc.c (scm_gc_mark): Removed.
	  (scm_gc_mark_dependencies): Removed.
	  (scm_mark_locations): Removed.

	* libguile/gc.h (scm_gc_mark_dependencies): Removed.
	  (scm_mark_locations): Removed.

	* libguile/inline.h (scm_cell): Use `GC_MALLOC ()' instead of `GC_malloc ()'.

	* libguile/smob.c (smob_freelist): New.
	  (smob_gc_kind): New.
	  (smob_mark): New.
	  (scm_gc_mark): New.
	  (scm_i_new_smob_with_mark_proc): New.
	  (scm_smob_prehistory): Initialize `smob_freelist' and `smob_gc_kind'.

	* libguile/smob.h (scm_i_new_smob_with_mark_proc): New declaration.
	  (SCM_NEWSMOB): Use it if a mark procedure is available.
	  (SCM_NEWSMOB2): Likewise.
	  (SCM_NEWSMOB3): Likewise.

	* libguile/threads.c (guilify_self_1): Initialize the
	  `current_mark_stack_*' fields.

	* libguile/threads.h (scm_i_thread)[current_mark_stack_ptr]: New field.
	  [current_mark_stack_limit]: New field.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-22

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Removed the mark/free functions of continuations and threads.
	* libguile/continuations.c (continuation_mark): Removed.
	  (continuation_free): Removed.
	  (scm_init_continuations): Don't use them.

	* libguile/coop-pthreads.c (scm_threads_mark_stacks): Removed (was
	  unused).

	* libguile/threads.c (scm_threads_mark_stacks): Likewise.

	* libguile/threads.h (scm_threads_mark_stacks): Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-21

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Removed useless files; beautified `libguile/Makefile.am'.
	* libguile/Makefile.am: Beautified backslashification (complements `patch-1').

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-20

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Disabled the `environments' unit test.
	* test-suite/Makefile.am (SCM_TESTS): Removed `tests/environments.test'.

	* test-suite/tests/environments.nottest: Disabled.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-19

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	procs/weaks/hashtab: Removed a bit of useless mark/free code.
	* libguile/hashtab.c (UNMARKED_CELL_P): Removed.
	  (scm_i_scan_weak_hashtables): Removed.

	* libguile/hashtab.h (scm_i_scan_weak_hashtables): Removed.

	* libguile/procs.c (scm_mark_subr_table): Removed.

	* libguile/procs.h (scm_mark_subr_table): Removed.

	* libguile/weaks.c (UNMARKED_CELL_P): Removed.
	  (scm_i_remove_weaks): Removed.
	  (scm_i_remove_weaks_from_weak_vectors): Removed.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-18

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Tiny updates in `environments.c'.
	* libguile/environments.c (scm_make_environment): Use
	  `SCM_RETURN_NEWSMOB' instead of `scm_cell'.
	  (core_environments_observe): Use `SCM_NEWSMOB3' instead of
	  `scm_double_cell'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-17

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixes in weak hash tables handling, notably in `hash-fold'.
	* libguile/hashtab.c (scm_i_rehash): Return immediately if TABLE is weak.
	  (scm_hash_fn_create_handle_x): Explicitly mention that we don't support
	  weak alist vectors.
	  (scm_internal_hash_fold): Handle weak pairs within buckets.

	* libguile/modules.c (scm_module_reverse_lookup): Handle weak alists
	  (currently, don't do anything if a NULL pair is met).

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-16

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed a typo/bug in `make-doubly-weak-alist-vector'.
	* libguile/weaks.c (scm_make_doubly_weak_alist_vector): Fixed typo
	  (endless recursive call).

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-15

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed printing of weak vectors.
	* libguile/print.c (iprin1): When displaying a weak vector, access
	  elements via `scm_c_vector_ref ()', not via the macro.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-14

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed `list->weak-vector'.
	* libguile/vectors.c (scm_i_allocate_weak_vector): Removed.
	  (MAKE_WEAK_VECTOR): New macro.
	  (allocate_weak_vector): New.
	  (scm_i_make_weak_vector): New.
	  (scm_i_make_weak_vector_from_list): New.

	* libguile/vectors.h: Updated.

	* libguile/weaks.c (scm_make_weak_vector): Use `scm_i_make_weak_vector ()'.
	  (scm_weak_vector): Use `scm_i_make_weak_vector_from_list ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-13

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed weak alist vectors by having them use weak hash tables instead.
	* libguile/weaks.c (scm_make_weak_key_alist_vector): Use
	  `scm_make_weak_key_hash_table ()'.
	  (scm_make_weak_value_alist_vector): Use `scm_make_weak_value_hash_table ()'.
	  (scm_make_doubly_weak_alist_vector): Use `scm_make_doubly_weak_hash_table ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-12

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	First stab at the guardian implementation.  Works fine at first glance!
	* libguile/guardians.c: Overhauled.  Removed the `tconc' structure.
	  Much, much, simpler.
	  (finalize_guarded): New function.

	* libguile/init.c (scm_i_init_guile): Call `scm_init_guardians ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-11

2008-09-05  Ludovic Court`es  <ludovic.courtes@laas.fr>

	Tell `libgc' that we're using POSIX threads.  This fixes Guile on PPC.
	* libguile/coop-defs.h: If `GUILE_PTHREAD_COMPAT' is defined, then define
	  `GC_THREADS' and include <gc/gc.h> after <pthread.h>.

	* libguile/coop-pthreads.h: Likewise.

	* libguile/pthread-threads.h: Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-10

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed `scm_fixup_weak_alist ()'; update weak hash table size as needed.
	* libguile/hashtab.c (scm_fixup_weak_alist): Added a REMOVED_ITEMS
	  parameter.  Fixed a bug in the case where PREV is `SCM_EOL'.
	  (IS_WEAK_THING): New macro.
	  (START_WEAK_BUCKET_FIXUP): New macro.
	  (END_WEAK_BUCKET_FIXUP): New macro.
	  (scm_hash_fn_get_handle)[buckets]: New variable.  Use the above
	  macros.
	  (scm_hash_fn_create_handle_x): Likewise.
	  (scm_hash_fn_remove_x): Likewise.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-9

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed the weak cell implementation (for weak hash tables).
	* libguile/hashtab.c (wcar_cell_descr): New.
	  (wcdr_cell_descr): New.
	  (scm_weak_car_cell): Use `GC_malloc_explicitly_typed ()' instead of
	  `scm_gc_malloc_pointerless ()'.
	  (scm_weak_cdr_cell): Likewise.
	  (SCM_WEAK_CELL_WORD_DELETED_P): Use `SCM_CELL_OBJECT' instead of
	  `SCM_CELL_WORD'.
	  (scm_hash_fn_get_handle): Call `GC_disable ()' before calling
	  `scm_fixup_weak_alist ()' and `GC_enable ()' afterwards.
	  (scm_hash_fn_create_handle_x): Likewise.
	  (scm_hash_fn_remove_x): Likewise.
	  (scm_hashtab_prehistory): Initialize WCAR_CELL_DESCR and
	  WCDR_CELL_DESCR.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-8

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	First stab at implementing weak hash tables and vectors.  Unable to run the REPL.
	* libguile/hashtab.c (scm_weak_car_cell): New.
	  (scm_weak_cdr_cell): New.
	  (scm_doubly_weak_cell): New.
	  (SCM_WEAK_CELL_WORD_DELETED_P): New.
	  (SCM_WEAK_CELL_WORD): New.
	  (scm_fixup_weak_alist): New.
	  (make_hash_table): Always use non-weak vectors.  Allocate
	  `scm_t_hashtable' objects as pointerless.
	  (scm_i_rehash): Always make NEW_BUCKETS a non-weak vector.
	  (scm_hash_fn_get_handle): Call `scm_fixup_weak_alist ()' on weak
	  buckets before calling ASSOC_FN.
	  (scm_hash_fn_remove_x): Likewise.
	  (scm_hash_fn_create_handle_x): Likewise.  Also, use `scm_.*weak.*cell
	  ()' for HANDLE when needed.

	* libguile/symbols.c (lookup_interned_symbol): Check for nullified
	  pairs.

	* libguile/vectors.c (scm_vector_elements): Abort on weak vectors.
	  (scm_vector_writable_elements): Likewise.
	  (scm_c_vector_ref): Check whether the referenced element has been
	  nullified.
	  (scm_c_vector_set_x): Use `GC_GENERAL_REGISTER_DISAPPEARING_LINK ()'.
	  (scm_i_allocate_weak_vector): Use `scm_gc_malloc_pointerless ()'
	  instead of `scm_gc_malloc ()' when allocating room for the vector
	  itself.

	* libguile/weaks.c (scm_make_weak_key_alist_vector): Use
	  `scm_make_vector ()' instead of `scm_i_allocate_weak_vector ()'.
	  (scm_make_weak_value_alist_vector): Likewise.
	  (scm_make_doubly_weak_alist_vector): Likewise.
	  (weak_vectors): Removed.
	  (scm_i_init_weak_vectors_for_gc): Removed.
	  (scm_i_mark_weak_vector): Removed.
	  (scm_i_mark_weak_vector_non_weaks): Removed.
	  (scm_i_mark_weak_vectors_non_weaks): Removed.
	  (scm_i_remove_weaks_from_weak_vectors): Commented out.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-7

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed GC initialization and static roots.
	* libguile/gc.c (scm_storage_prehistory): Call `GC_INIT ()'.  Invoke
	  `GC_add_roots ()' as well.
	  (scm_init_gc): Removed call to `GC_init ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-6

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Added `scm_gc_malloc_pointerless ()', equivalent to `GC_MALLOC_ATOMIC ()'.
	* libguile/gc-malloc.c (scm_gc_register_collectable_memory): Tidied.
	  (scm_gc_unregister_collectable_memory): Likewise.
	  (scm_gc_malloc_pointerless): New.

	* libguile/gc.h (scm_gc_malloc_pointer_less): New declaration.

	* libguile/strings.c (make_stringbuf): Use it.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-5

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Fixed garbage collection of ports: basics work (no SMOBs, no guardians, no WHT).
	* libguile/gc.c (scm_init_storage): Do not initialize SCM_I_PORT_TABLE
	  here: this is done in `scm_ports_prehistory ()'.  This fixes the bug
	  mentioned in the previous patch log.

	* libguile/ports.c (scm_new_port_table_entry): Slightly clarified the
	  code.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-4

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	First ``working'' Guile!  Crashes in `flush-all-ports' (relates to SCM_I_PORT_TABLE).
	* libguile/gc.c (scm_gc_stats): Fixed so that it returns a relevant
	  result instead of just `SCM_EOL'.

	* libguile/ports.c: Include `assert.h'.  Don't include `malloc.h'.
	  (scm_make_port_type): Use `scm_gc_realloc ()' instead of `realloc ()'.
	  (scm_new_port_table_entry): Likewise.
	  (scm_flush): Added an assertion on the port number.
	  (scm_ports_prehistory): Use `scm_gc_malloc ()' instead of `scm_malloc ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-3

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Small fixes.  Gets to the REPL and `abort ()'s soon after.
	* libguile/inline.h (scm_cell): Re-added comment about the assignment
	  order of CAR/CDR.

	* libguile/srcprop.c (scm_make_srcprops): Use `scm_gc_malloc ()' instead
	  of `malloc' + `scm_gc_register_collectable_memory ()'.

	* libguile/threads.c (guilify_self_1): Likewise.
	  (guilify_self_2): Likewise.

	* libguile/strings.c (make_stringbuf): Use `GC_MALLOC_ATOMIC ()' instead
	  of `scm_gc_malloc ()'.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-2

2008-09-05  Ludovic Courtes  <ludovic.courtes@laas.fr>

	Merge from lcourtes@laas.fr--2005-mobile
	Patches applied:

	 * lcourtes@laas.fr--2005-mobile/guile-core--boehm-gc--1.9  (base, patch 1)

	   - tag of lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--base-0
	   - Initial hack for Boehm's GC support: nothing works.

	git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-1

2008-09-02  Andy Wingo  <wingo@pobox.com>

	superstition with no important effect
	* module/system/vm/assemble.scm (dump-object!): Some superstition, use
	  bit arithmetic instead of int arithmetic. Makes me happier.

2008-09-02  Andy Wingo  <wingo@pobox.com>

	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").

2008-09-02  Andy Wingo  <wingo@pobox.com>

	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.

2008-09-02  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-28  Andy Wingo  <wingo@pobox.com>

	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>.

2008-08-26  Andy Wingo  <wingo@pobox.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>.

2008-08-26  Andy Wingo  <wingo@pobox.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>.

2008-08-26  Andy Wingo  <wingo@pobox.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>.

2008-08-26  Andy Wingo  <wingo@pobox.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>

2008-08-26  Andy Wingo  <wingo@pobox.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-23  Paolo Bonzini  <bonzini@gnu.org>

	fix installation bug
	2008-08-23  Nix  <nix@esperi.org.uk>

		* lightning/i386/Makefile.frag: fp-32.h and fp-64.h are target files.

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?

2008-08-22  Andy Wingo  <wingo@pobox.com>

	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!

2008-08-20  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-11  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-11  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-09  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-08  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-08  Andy Wingo  <wingo@pobox.com>

	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/.

2008-08-08  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-07  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-07  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-07  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-05  Andy Wingo  <wingo@pobox.com>

	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().

2008-08-05  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-03  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-02  Andy Wingo  <wingo@pobox.com>

	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.

2008-08-02  Andy Wingo  <wingo@pobox.com>

	merge guile-vm to guile
	An attempt to pull in the original history from guile-vm into guile itself.

2008-07-10  Laurent Michel  <ldm@engr.uconn.edu>

	fix miscellaneous PPC-32 back-end bugs
	2008-07-02  Laurent Michel  <ldm@engr.uconn.edu>

		* lightning/ppc/funcs.h (jit_flush_code): modified the computation
		of start/end. The pointer arithmetic was done without casting. It
		prevented compilation with recent gcc versions.
		* lightning/ppc/core.h (jit_pushr_i): The offset for the store was
		incorrect. Should have been 4 bytes below SP (not above).
		* lightning/ppc/core.h (jit_popr_i): The offset for the load was
		incorrect. Should have been 0 (not +8).

2008-06-17  Paolo Bonzini  <bonzini@gnu.org>

	fix IMULQir and IMULQirr
	2008-06-17  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-64.h: Forward IMULQir to IMULQirr,
		fix REXQ order for IMULQirr.

2008-06-17  Paolo Bonzini  <bonzini@gnu.org>

	fix _rN vs. _rR
	2008-06-17  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core.h: Fix _rN vs. _rR.

2008-06-17  Paolo Bonzini  <bonzini@gnu.org>

	move JIT_R1/JIT_R2 to R10/R11 for the x86_64 backend
	2008-06-16  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core.h: Use jit_save in jit_replace.  Move JIT_R
		definition...
		* lightning/i386/core-32.h: ... here; define jit_save so that
		the core.h has no effect on the 32-bit backend.
		* lightning/i386/core-64.h: Place JIT_R1/JIT_R2 in R10/R11,
		place outgoing arguments in the right spot from the beginning,
		define jit_save, fix jit_reg8/jit_reg16.

2008-06-16  Paolo Bonzini  <bonzini@gnu.org>

	rewrite x86-64 argument passing to support up to 6 arguments
	2008-06-15  Paolo Bonzini  <bonzini@gnu.org>

	        * lightning/i386/core-64.h: Rewrite argument passing to
		support up to 6 arguments and generate less code.

2008-06-16  Laurent Michel  <ldm@thorgal.homelinux.org>

	fix x86-64 jit_movi_l (x, 0) and 16-byte stack alignment in the prolog
	2008-06-14  Laurent Michel  <ldm@thorgal.homelinux.org>

		* lightning/i386/core-64.h (jit_movi_l): When the operand is 0,
		the XOR should be on a quadword.
		* lightning/i386/core-64.h (jit_prolog): Keep 16-byte stack
		alignment.
		(jit_ret): Always use LEAVE.

2008-06-14  Laurent Michel  <ldm@thorgal.homelinux.org>

	add (void) casts for C++ compatibility
	2008-06-13  Laurent Michel  <ldm@thorgal.homelinux.org>

		* lightning/i386/core-64.h: Add (void) casts for C++ compatibility.
		* lightning/i386/asm.h: Likewise.

2008-06-13  Paolo Bonzini  <bonzini@gnu.org>

	move x86-64 JIT_V1/JIT_V2 in R12/R13
	2008-06-12  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core.h: Move JIT_V definition...
		* lightning/i386/core-32.h: ... here.
		* lightning/i386/core-64.h: ... and here.  Avoid dancing between
		RSI/RDI and R12/R13, and place JIT_V1/JIT_V2 in R12/R13.

2008-06-12  Paolo Bonzini  <bonzini@gnu.org>

	detect 32-/64-bit variant of i386 back-end at include time (not configure time)
	2008-06-11  Paolo Bonzini  <bonzini@gnu.org>

		* build-aux/lightning.m4: Adjust LIGHTNING_BACKENDS, don't
		use suffix support to distinguish i386/x86_64.
		* lightning/i386/Makefile.frag: Use LIGHTNING_TARGET_FILES
		to distribute *-32.h and *-64.h files now.
		* lightning/i386/asm-i386: Moved to...
		* lightning/i386/asm.h: Include the appropriate subtarget file.
		* lightning/i386/core-i386: Moved to...
		* lightning/i386/core.h: Include the appropriate subtarget file.
		* lightning/i386/fp.h: New, include the appropriate subtarget file.
		* lightning/i386/asm-32: Do not include asm-i386.h.
		* lightning/i386/asm-64.h: Likewise.
		* lightning/i386/core-32: Do not include core-i386.h.
		* lightning/i386/core-64.h: Likewise.
		* lightning/Makefile.am: Adjust for renamed files.

		* configure.ac: Define LIGHTNING_TARGET here.
		* opcode/disass.c: Change list of valid LIGHTNING_TARGET values.

		* lightningize.in: Robustify against missing subtarget files.

2008-06-11  Paolo Bonzini  <bonzini@gnu.org>

	use MOVLir directly to implement i386 32-bit jit_movi_p
	2008-06-11  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-32.h: Use MOVLir instead of jit_movi_l
		to implement jit_movi_p.

2008-06-11  Paolo Bonzini  <bonzini@gnu.org>

	fix stack alignment for Apple 32-bit ABI
	2008-06-11  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-32.h: Use separate __APPLE__ and SysV
		prolog/ret macros.  Subtract 12 bytes in __APPLE__ case to
		keep stack aligned, and always use LEAVE in the epilog.

2008-06-11  Paolo Bonzini  <bonzini@gnu.org>

	fix C++ incompatibility in i386 back-end
	2008-06-11  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-i386.h: Fix C++ incompatibility.

2008-06-11  Laurent Michel  <ldm@engr.uconn.edu>

	fix jit_replace8 for case when one of the operands is _EAX.
	2008-06-10  Laurent Michel  <ldm@engr.uconn.edu>

		* lightning/i386/core-i386.h: Fix jit_replace8 for
		case when one of the operands is _EAX.

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.

2008-05-25  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-25  Andy Wingo  <wingo@pobox.com>

	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

2008-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-20  Andy Wingo  <wingo@pobox.com>

	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?)

2008-05-20  Andy Wingo  <wingo@pobox.com>

	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/.

2008-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-20  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-19  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-19  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-19  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-19  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-19  Paolo Bonzini  <bonzini@gnu.org>

	avoid CRLF issues on mingw
	2008-05-19  Paolo Bonzini  <bonzini@gnu.org>

		* tests/run-test: Avoid CRLF issues on mingw.

2008-05-19  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-15  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-15  Andy Wingo  <wingo@pobox.com>

	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'.

2008-05-15  Andy Wingo  <wingo@pobox.com>

	`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.

2008-05-15  Andy Wingo  <wingo@pobox.com>

	remove some debugging info
	* module/system/vm/assemble.scm: remove a pk

2008-05-15  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-15  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-15  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-14  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-14  Andy Wingo  <wingo@pobox.com>

	(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

2008-05-13  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-12  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-12  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-11  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-11  Andy Wingo  <wingo@pobox.com>

	<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.

2008-05-11  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-09  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-09  Andy Wingo  <wingo@pobox.com>

	more exports cleanups
	* module/system/repl/common.scm: Declare exports in the module
	  declaration.

2008-05-09  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-04  Andy Wingo  <wingo@pobox.com>

	Removed dot-expander syntax foo
	* module/system/base/syntax.scm (expand-dot!, expand-symbol, syntax):
	  Removed, we don't use this syntax any more.

2008-05-04  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-04  Andy Wingo  <wingo@pobox.com>

	more dedottification, almost done
	* module/system/repl/common.scm:
	* module/system/base/compile.scm: Export some more things.

	* module/system/repl/command.scm: Dedottify.

2008-05-04  Andy Wingo  <wingo@pobox.com>

	Dedottify some more
	* module/system/il/compile.scm: Dedottify.

	* module/system/il/ghil.scm: Export some more thingies.

2008-05-04  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-04  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-04  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-04  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-03  Andy Wingo  <wingo@pobox.com>

	bugfix to make-cenv
	* module/system/base/compile.scm (make-cenv): Fix make-cenv.

2008-05-03  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-03  Andy Wingo  <wingo@pobox.com>

	s/match-lambda\*/case-lambda/g
	* module/system/il/macros.scm: Use case-lambda from srfi-16 rather than
	  match-lambda*.

2008-05-03  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-03  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-03  Andy Wingo  <wingo@pobox.com>

	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.

2008-05-03  Andy Wingo  <wingo@pobox.com>

	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*.

2008-05-02  Andy Wingo  <wingo@pobox.com>

	remove module.scm
	* module/system/base/module.scm: Removed module.scm, as it was unused
	  (see 9419ff9ae91c93983972797e607e135ecd1233bb).

2008-05-02  Andy Wingo  <wingo@pobox.com>

	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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	* 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

2008-04-25  Ludovic Courtes  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	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

2008-04-25  Ludovic Court`es  <ludovic.courtes@laas.fr>

	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

2008-04-10  Paolo Bonzini  <bonzini@gnu.org>

	add .gitattributes file

2008-03-21  Paolo Bonzini  <bonzini@gnu.org>

	fix several load/store patterns for x86-64.
	2008-03-21  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-64.h: Fix jit_{ld,st}{,x}i_{i,l}.
		Remove jit_ld{,x}i_ul.
		* lightning/core-common.h: Make jit_ld{,x}{i,r}_ul
		always a synonym of the _l variant.
		* doc/porting.texi: Document this.

2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	fix uses of jit_qop_ with 4 parameters
	2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-64.h: Fix uses of jit_qop_.

2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	add long boolean operations for x86-64
	2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-64.h: Add boolean operations.

2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	add LEAQmr for x86-64
	2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-64.h: Add LEAQmr.

2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	misc. x86-64 bugfixes
	2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-64.h: Misc bugfixes.

2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	add missing x86-64 memory operations
	2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-i386.c: Remove jit_ldr_i, jit_ldxr_i.
		* lightning/i386/core-32.h: Add jit_ldr_i, jit_ldxr_i.
		* lightning/i386/core-64.h: Add jit_ld{r,xr,i,xi}_{ui,l,ul},
		jit_ldr_i, jit_ldxr_i, jit_str_l, jit_stxr_l.

2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	add _s32P
	2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/asm-common.h: Add _s32P.

2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	implement long mul/div/mod for x86-64
	2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-64.h: Implement long mul/div/mod.

2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

	cast memory address to long for JCCim
	2008-03-19  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-i386.h: Cast memory address to long for JCCim.

2008-03-17  Paolo Bonzini  <bonzini@gnu.org>

	add underscores around __unused__ attribute
	2008-03-15  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/asm-common.h: Add underscores around __unused__
		attribute.

2008-03-17  Paolo Bonzini  <bonzini@gnu.org>

	warning patrol (allocai.c, ppc)
	2008-03-15  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/ppc/core.h: Avoid some "value computed is not used"
		warnings.
		* lightning/ppc/funcs.h: Remove unused variables.
		* lightnings/tests/allocai.c: Silence other warnings.

2008-03-16  Paolo Bonzini  <bonzini@gnu.org>

	fix some problems (not all) with lightningize
	2008-03-14  Paolo Bonzini  <bonzini@gnu.org>

		* lightningize.in: Fix some problems (not all).

2008-03-16  Paolo Bonzini  <bonzini@gnu.org>

	avoid "value computed is not used" in jit_allocai
	2008-03-14  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-32.h: Avoid some "value computed is not used"
		warnings; reported by Sam Steingold.

2008-03-08  Paolo Bonzini  <bonzini@gnu.org>

	Fix stxr_c(_EAX, _EBX, _ESI).
	2008-03-08  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-32.h: Fix stxr_c(_EAX, _EBX, _ESI).

2008-02-21  Paolo Bonzini  <bonzini@gnu.org>

	commit source files for separate using/porting manuals

2008-02-14  Paolo Bonzini  <bonzini@gnu.org>

	avoid redefinition of _r1
	2008-02-13  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-32.h: Avoid redefinition of _r1, reported by
		Sam Steingold.
		* lightning/i386/asm-64.h: Likewise.

2008-02-08  Paolo Bonzini  <bonzini@gnu.org>

	don't use _VOID symbol, reserved by newlib (cygwin)
	2008-02-08  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-i386.h: Don't define _VOID, reported
		by Reini Urban.

2008-02-03  Paolo Bonzini  <bonzini@gnu.org>

	add --with-lightning-prefix option to lightning.m4
	2008-02-03  Paolo Bonzini  <bonzini@gnu.org>

		* build-aux/lightning.m4: Add --with-lightning-prefix option, suggested
		by Sam Steingold.

2008-01-14  Paolo Bonzini  <bonzini@gnu.org>

	use CALLsr, not CALLLsr
	2008-01-14  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-64.h: Use CALLsr, not CALLLsr.

2008-01-13  Paolo Bonzini  <bonzini@gnu.org>

	don't truncate function pointers on amd64
	2008-01-13  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-i386.h: Move jit_calli and jit_callr...
		* lightning/i386/core-32.h: ... here.
		* lightning/i386/core-64.h: Redefine them.

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix i386 floating-point sub(a,0,a)
	2008-01-05  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/fp-32.h: Fix sub(a,0,a).
		* lightning/tests/3to2.c: Add new testcases.
		* lightning/tests/3to2.ok: Add new testcases.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-61

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	add Matthew Flatt to THANKS file
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-59

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	add 3to2 test and fix bug
	2008-01-02  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/fp-32.h: Fix sub(a,b,a) with a ~= JIT_FPR0.
		* lightning/tests/3to2.c: New.
		* lightning/tests/3to2.ok: New.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-58

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix -I flags for opcode subdirectory
	2007-11-07  Paolo Bonzini  <bonzini@gnu.org>

		* opcode/Makefile.am: Fix AM_CPPFLAGS.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-57

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	improve set* encoding for i386, add testcase
	2007-08-12  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-i386.h: Improve encoding of set* instructions.
		* lightning/i386/core-64.h: Fix jit_bra_l.
		* tests/sete.c: New.
		* tests/sete.ok: New.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-56
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-60

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	switch to GPLv3
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-55

	fix imprecisions in the ChangeLog
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-54

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	add clean-local target to lightning/Makefile.am
	Patches applied:

	 * thomas.g.girard@free.fr--2007-archives/smalltalk--stable--2.3--patch-2
	   fix lightning clean: target

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-53

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	use CVTT instruction, fix lightning/Makefile.am
	2006-12-02  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-i386.h: Add CVTTS?2SIL.
		* lightning/i386/asm-64.h: Add CVTTS?2SIQ.
		* lightning/i386/fp-64.h: Use it.

		* lightning/Makefile.am: Place files in nodist_lightning_HEADERS.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-52

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	refine ludovic's doc patch
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-51

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	merge from ludovic
	Patches applied:

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-38
	   Doc: Mention `JIT_R_NUM' and `JIT_V_NUM'.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-43
	   Removed C99/C++ comments from `asm-i386.h'.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-50

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	add floating-point for x86-64
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-49

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	merge some bugfixes, give right meaning to jit_retval_[fd]
	2006-11-22  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-i386.h: Move x86-64 instructions...
		* lightning/i386/asm-64.h: ... here.
		* lightning/i386/fp-32.h: Fix bugfixes worked around in froofyJIT.
		Add JIT_FPRET.
		* lightning/sparc/fp.h: Likewise.
		* lightning/ppc/fp.h: Likewise.
		* lightning/fp-common.h: Adjust for JIT_FPRET.
		* tests/funcfp.c: Adjust for JIT_FPRET.
		* tests/rpnfp.c: Adjust for JIT_FPRET.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-47
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-48

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	give credit to whom credit is due
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-46

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	add an underscore to macros without a parameter [x86]
	2006-11-20  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-i386.h:  Add an underscore to macros without
		a parameter.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-45

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	x86-64 now passes test suite
	2006-11-20  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/core-i386.h: Move jit_movip, jit_check8, jit_reg8,
		jit_reg16, jit_movbrm...
		* lightning/i386/core-32.h: ... here.
		* lightning/i386/core-64.h: Redefine them.  Fix other bugs.

		* tests/printf.c: Do not do a varargs call.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-44

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	checkin rewrite of i386 assembler
	2006-11-20  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-i386.h: Check in rewrite from aranym.
		* lightning/i386/asm-32.h: Adjust.
		* lightning/i386/asm-64.h: Adjust.
		* lightning/i386/fp-32.h: Adjust.

		* lightning/i386/core-32.h: Adjust.  Add jit_{ld,ldx,st,stx}i*.
		* lightning/i386/core-64.h: Adjust.  Add jit_{ld,ldx,st,stx}i*.
		* lightning/i386/core-i386.h: Adjust. Remove these patterns.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-43

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	merge 64-bit cleanliness changes from mzscheme
	2006-11-20  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm-i386.h: Merge 64-bit cleanliness changes from mzscheme.
		* lightning/i386/asm-64.h: Likewise.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-41
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-42

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	add JIT_NEED_PUSH_POP and merge correct implementation of push/pop for SPARC
	2006-11-20  Paolo Bonzini  <bonzini@gnu.org>
		    Ludovic Courtes  <ludo@chbouib.org>

		* lightning/i386/core-32.h: Disable jit_push and jit_pop if stack not needed.
		* lightning/i386/core-64.h: Disable jit_push and jit_pop if stack not needed.
		* lightning/sparc/core.h: Merge final implementation of jit_pushr and jit_popr.
		* lightning/ppc/core.h: Fix implementation of jit_pushr and jit_popr to
		work (more or less) across function calls.

		* tests/push-pop.c, tests/push-pop.ok: New test.
		* tests/Makefile.am: Run it.

	Patches applied:

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-32
	   Added missing SPARC changes from lightning@sv.gnu.org/lightning--stable--1.2--patch-10.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-33
	   SPARC: Fixed pushr/popr using %l7 to hold the pushed register offset.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-34
	   tests/push-pop.c: define `JIT_NEED_PUSH_POP'.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-40

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix x86-64 builds
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-39

	update manual for jit_allocai
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-38

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	remove pushr/popr from testsuite
	2006-11-04  Paolo Bonzini  <bonzini@gnu.org>

		* tests/rpn.c: Remove pushr/popr.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-37

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	finish jit_allocai implementation
	2006-11-04  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/ppc/core.h: Implement jit_allocai, define JIT_FP to be R1.
		* lightning/ppc/funcs.h: Store frame size into _jitl.  Store R1 before
		the STMW, so that the offset is unchanged when we patch the STMW.
		* lightning/i386/core.h: Define JIT_FP to be EBP.
		* lightning/i386/core-32.h: Implement jit_allocai, put LEAVE in the
		epilog if jit_allocai was used.
		* lightning/i386/core-64.h: Implement jit_allocai, put LEAVE in the
		epilog if jit_allocai was used.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-36

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	add jit_allocai for SPARC
	Patches applied:

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-28
	   Implemented `jit_allocai' for SPARC.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-29
	   tests/allocai.c: New test case.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-30
	   Fixed `_d22 ()' on SPARC (fixes "displacement too large" errors).

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-35

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix powerpc jit_bms
	2006-11-03  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/ppc/core.h: Fix jit_bms using BNE rather than BGT.
		"AND." does signed comparisons.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-34

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	prepare for automatic variables support
	2006-10-31  Paolo Bonzini  <bonzini@gnu.org>

		* doc/porting.texi: Rename JIT_FP to JIT_AP.
		* lightning/core-common.h: Likewise.
		* lightning/i386/core-i386.h: Likewise.
		* lightning/fp-common.h: Provide default versions of jit_getarg_[fd].
		* lightning/i386/fp-32.h: Don't provide jit_getarg_[fd].
		* lightning/ppc/fp.h: Likewise.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-33

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	added ret test and clarified JIT_RET documentation
	Patches applied:

	 * lcourtes@laas.fr--2005-libre/lightning--sparc-fixes--1.2--base-0
	   tag of lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-18

	 * lcourtes@laas.fr--2005-libre/lightning--sparc-fixes--1.2--patch-1
	   tests/push-pop.c: Use more `pushr's.

	 * lcourtes@laas.fr--2005-libre/lightning--sparc-fixes--1.2--patch-3
	   Added a test for `JIT_RET' (fails on SPARC).

	 * lcourtes@laas.fr--2005-libre/lightning--sparc-fixes--1.2--patch-4
	   Fixed use of `JIT_RET': Move %o0 into %i0 after `calli' and `callr'.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-19
	   Merge from `sparc-fixes': Fixed `pushr' and `popr', fixed `JIT_RET'.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-20
	   Undoed `lightning--sparc-fixes--1.2--patch-4' (about `JIT_RET') which was wrong.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-21
	   tests/ret.c: Use `jit_retval_i' to copy the function's return value.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-22
	   Doc: Clarified the use of `JIT_RET' and documented `jit_retval'.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-32

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	cherrypick from ludovic courtes
	2006-10-31  Paolo Bonzini  <bonzini@gnu.org>
		    Ludovic Courtes  <ludo@chbouib.org>

		* tests/divi.c, tests/divi.ok, tests/movi.c, tests/movi.ok: New.
		* tests/ldxi.c: Ensure large pointer is generated.
		* tests/Makefile.am: Point to new tests.
		* lightning.h: Include funcs-common.h before funcs.h.
		* lightning/sparc/core.h: Fix bugs in modi/divi.

	Patches applied:

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-11
	   Fixed a typo in `lightning/sparc/core.h'.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-12
	   SPARC: Fixed `jit_immsize' (untested!).

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-13
	   Added a `divi' test case (does not catch the bug fixed by the previous patch).

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-14
	   `divi' test case: Return non-zero on failure.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-15
	   `ldxi.c' (test case): Make sure we use a large pointer operand.

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-16
	   Added a `movi' test case (for `jit_movi_p' with large operands).

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-31

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	first merge of x86-64 backend and related configury changes
	Patches applied:

	 * bonzini@gnu.org--2004b/lightning--x86-64--1.3--base-0
	   tag of bonzini@gnu.org--2004b/lightning--stable--1.2--patch-28

	 * bonzini@gnu.org--2004b/lightning--x86-64--1.3--patch-1
	   start merging from mzscheme...

	 * bonzini@gnu.org--2004b/lightning--x86-64--1.3--patch-2
	   fix i386

	 * bonzini@gnu.org--2004b/lightning--x86-64--1.3--patch-3
	   fix distribution hiccups

	 * bonzini@gnu.org--2004b/lightning--x86-64--1.3--patch-4
	   adapt for usage outside distribution.

	 * bonzini@gnu.org--2004b/lightning--x86-64--1.3--patch-6
	   fixes for GNU Smalltalk

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-30

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	Fix assertion failures in i386 movs and movz opcodes
	2006-10-30  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm.h (MOVS*, MOVZ*): Use correct _r[124] macros.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-29

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix i386 syntax error
	2006-10-16  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/i386.h (jit_flush_code): Fix syntax error. :-(

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-28

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	upgrade to autoconf 2.60
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-27

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	bump version, add ldxi test case
	Patches applied:

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-7
	   Added a test case for `ldxi' with big immediate operands.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-26

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix `make dist' bug and prepare for releasing 1.2a
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-25

	one more tweak to fix distribution
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-24

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	clarify bundling documentation and improve autoconf macro
	2006-07-06  Paolo Bonzini  <bonzini@gnu.org>
		    Ludovic Courtes  <ludovic.courtes@laas.fr>

		* doc/using.texi: Clarify "Using autoconf" section
		and rename it to "Bundling lightning"
		* lightning.m4: Work also if lightning is not bundled.

	Patches applied:

	 * lcourtes@laas.fr--2005-libre/lightning--stable--1.2--patch-2
	   Fixed `LIGHTNING_CONFIGURE_IF_NOT_FOUND' in the case where `lightning.h' is not found.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-23

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix PPC modi
	2006-07-06  Paolo Bonzini  <bonzini@gnu.org>
		    Ludovic Courtes  <ludovic.courtes@laas.fr>

		* lightning/ppc/core.h (_jit_mod): Replace with...
		(_jit_mod_big, _jit_mod_small): ... these.
		(jit_modi_i, jit_modi_ui): Rewrite.
		* tests/modi.c, tests/modi.ok: New tests.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-22

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix mprotect for i386
	2006-05-18  Matthew Flatt  <mflatt@cs.utah.edu>

		* lightning/i386/asm.h: Fix test for extending the mprotect area
		towards lower addresses.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-21

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	don't use __func__ nor __FUNCTION__ if not compiling with GNU C.
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-20

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix PPC jit_ldxi_* with big displacement
	2006-02-16  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/ppc/core.h: Fix jit_ldxi_* with big displacement.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-19

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	Fix comments in config.h.in git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-18

	fix heading in ppc/fp.h and sparc/fp.h
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-17

	update FSF address
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-15
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-16

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	add JC/JNC
	2005-04-27  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/asm.h (JCm, JCSm, JNCm, JNCSm): New.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-14

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	remove unused variable.
	2004-11-26  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/ppc/funcs.h (_jit_epilog): Remove unused variable.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-12

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	include sys/mman.h under Linux/i386
	2004-11-13  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/i386/funcs.h [__linux__]: Include sys/mman.h.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-11

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	add more autotools-generated files
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-10

	add autotools-generated files
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-9

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fixes to sparc floating point
	2004-11-09  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/sparc/fp.h: Fix fp-to-integer conversions.
		* lightning/ppc/testfp.c: Test fp-to-integer conversions
		of integer numbers.
		* lightning/ppc/testfp.ok: Adjust for the above.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-8

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix testfp to pass on ppc
	2004-11-08  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/ppc/testfp.c: Always flush code before
		testing it.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-6
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-7

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix ppc tests
	2004-11-08  Paolo Bonzini  <bonzini@gnu.org>

		* lightning/ppc/fp.h: Do not clobber f31.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-5

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	use autoheader like every other package in this world
	2004-11-08  Paolo Bonzini  <bonzini@gnu.org>

		* lightning.h: New name of...
		* lightning-inst.h: ... this file.
		* lightning.h.in: Removed.

		* opcodes/disass.c: Include config.h.
		* tests/add.c: Include config.h.
		* tests/bp.c: Include config.h.
		* tests/fib.c: Include config.h.
		* tests/fibdelay.c: Include config.h.
		* tests/fibit.c: Include config.h.
		* tests/funcfp.c: Include config.h.
		* tests/incr.c: Include config.h.
		* tests/printf.c: Include config.h.
		* tests/printf2.c: Include config.h.
		* tests/rpn.c: Include config.h.
		* tests/rpnfp.c: Include config.h.
		* tests/testfp.c: Include config.h.

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-4

2008-01-09  Paolo Bonzini  <bonzini@gnu.org>

	fix for out-of-srcdir build
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-3

	big merge
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-1
	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--patch-2

	add .gitignore

2004-10-10  Paolo Bonzini  <bonzini@gnu.org>

	initial import
	(automatically generated log message)

	git-archimport-id: bonzini@gnu.org--2004b/lightning--stable--1.2--base-0

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
