Ludovic Courtès [Fri, 1 Mar 2013 16:36:21 +0000 (17:36 +0100)]
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'.
Daniel Hartwig [Tue, 19 Feb 2013 01:55:14 +0000 (09:55 +0800)]
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.
Mark H Weaver [Thu, 28 Feb 2013 23:43:09 +0000 (18:43 -0500)]
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.
Mark H Weaver [Thu, 28 Feb 2013 11:26:22 +0000 (06:26 -0500)]
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.
Mark H Weaver [Tue, 26 Feb 2013 22:25:51 +0000 (17:25 -0500)]
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.
Ludovic Courtès [Thu, 28 Feb 2013 08:42:31 +0000 (09:42 +0100)]
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.
David Kastrup [Thu, 28 Feb 2013 01:45:08 +0000 (20:45 -0500)]
Let reverse! accept arbitrary types as second argument (new_tail)
* libguile/list.c (scm_reverse_x): remove typecheck for 2nd arg.
Signed-off-by: Mark H Weaver <mhw@netris.org>
Ludovic Courtès [Wed, 27 Feb 2013 19:39:51 +0000 (20:39 +0100)]
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.
Ludovic Courtès [Wed, 27 Feb 2013 19:36:52 +0000 (20:36 +0100)]
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.
Ludovic Courtès [Wed, 27 Feb 2013 19:07:12 +0000 (20:07 +0100)]
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.
Ludovic Courtès [Wed, 27 Feb 2013 18:59:09 +0000 (19:59 +0100)]
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.
Ludovic Courtès [Wed, 27 Feb 2013 18:25:39 +0000 (19:25 +0100)]
Fix cross-compilation of `c-tokenize.o'.
* libguile/Makefile.am (c-tokenize.$(OBJEXT)): Pass -I$(top_builddir)
when cross-compiling.
Mark H Weaver [Tue, 26 Feb 2013 03:14:41 +0000 (22:14 -0500)]
Update copyright dates on random.c
* libguile/random.c: Add 2012 and 2013 to the copyright notice.
Mark H Weaver [Mon, 25 Feb 2013 18:38:55 +0000 (13:38 -0500)]
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.
Mark H Weaver [Mon, 25 Feb 2013 18:33:28 +0000 (13:33 -0500)]
Revert "random_state_of_last_resort doesn't rely on HAVE_POSIX"
This reverts commit
eaf21539d4afb8df5d1b549215fd397b23004947.
Mark H Weaver [Mon, 25 Feb 2013 18:33:14 +0000 (13:33 -0500)]
Revert "random-state-from-platform: simplify pid conditional, and clarify docs."
This reverts commit
08904661a2b1c6d461b2f5abfe3226a4023453fb.
Mark H Weaver [Mon, 25 Feb 2013 00:57:00 +0000 (19:57 -0500)]
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.
Andy Wingo [Sun, 24 Feb 2013 14:45:26 +0000 (15:45 +0100)]
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).
Andy Wingo [Sun, 24 Feb 2013 14:11:14 +0000 (15:11 +0100)]
deprecate (ice-9 mapping)
* module/ice-9/mapping.scm: Add deprecation warning.
Daniel Hartwig [Wed, 28 Nov 2012 16:17:26 +0000 (00:17 +0800)]
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.
Andy Wingo [Sun, 24 Feb 2013 13:15:06 +0000 (14:15 +0100)]
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.
Andy Wingo [Sun, 24 Feb 2013 13:07:13 +0000 (14:07 +0100)]
simplify scm_stat on mingw
* libguile/filesys.c (scm_stat): Don't munge the filename on MinGW;
gnulib does that for us.
Andy Wingo [Sun, 24 Feb 2013 12:48:02 +0000 (13:48 +0100)]
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.
Andy Wingo [Sun, 24 Feb 2013 12:03:42 +0000 (13:03 +0100)]
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.
Andy Wingo [Sun, 24 Feb 2013 11:46:48 +0000 (12:46 +0100)]
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().
Mike Gran [Thu, 21 Feb 2013 14:44:42 +0000 (06:44 -0800)]
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
Andy Wingo [Wed, 20 Feb 2013 21:57:02 +0000 (22:57 +0100)]
net_db.c doesn't import winsock2.h
* libguile/net_db.c: Don't include winsock2.h; gnulib handles this for
us as necessary.
Andy Wingo [Wed, 20 Feb 2013 20:20:55 +0000 (21:20 +0100)]
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.
Andy Wingo [Wed, 20 Feb 2013 15:02:30 +0000 (16:02 +0100)]
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!
Andy Wingo [Tue, 19 Feb 2013 22:03:19 +0000 (23:03 +0100)]
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.
Andy Wingo [Tue, 19 Feb 2013 21:36:22 +0000 (22:36 +0100)]
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.
Eli Zaretskii [Tue, 19 Feb 2013 15:34:32 +0000 (16:34 +0100)]
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).
Andy Wingo [Tue, 19 Feb 2013 14:09:32 +0000 (15:09 +0100)]
add link to doc about UNC names
* module/ice-9/boot-9.scm (compile-time-case): Add link to docs about
UNC names.
Andy Wingo [Tue, 19 Feb 2013 10:41:44 +0000 (11:41 +0100)]
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.
Mark H Weaver [Mon, 18 Feb 2013 23:44:15 +0000 (18:44 -0500)]
Remove flawed test that assumed (eq? 1/2 2/4) would return false.
* test-suite/tests/hash.test ("hash-count"): Remove flawed test.
Ludovic Courtès [Mon, 18 Feb 2013 20:43:30 +0000 (21:43 +0100)]
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.
Andy Wingo [Mon, 18 Feb 2013 18:06:34 +0000 (19:06 +0100)]
add gnulib `times' module
* lib: Add `times' module. Should fix socket.c on MinGW. Thanks to Eli
Zaretskii for the report.
Andy Wingo [Mon, 18 Feb 2013 17:53:46 +0000 (18:53 +0100)]
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.
Andy Wingo [Mon, 18 Feb 2013 17:48:48 +0000 (18:48 +0100)]
Update to gnulib 0.0.7865-a828.
Daniel Llorens [Wed, 23 Jan 2013 08:59:58 +0000 (09:59 +0100)]
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?
Andy Wingo [Mon, 21 Jan 2013 16:04:09 +0000 (17:04 +0100)]
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.
Andy Wingo [Mon, 18 Feb 2013 15:38:24 +0000 (16:38 +0100)]
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.
Andy Wingo [Mon, 18 Feb 2013 11:46:00 +0000 (12:46 +0100)]
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.
Daniel Hartwig [Sun, 17 Feb 2013 08:38:31 +0000 (16:38 +0800)]
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.
Ludovic Courtès [Sat, 16 Feb 2013 17:40:39 +0000 (18:40 +0100)]
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>.
Andy Wingo [Fri, 15 Feb 2013 14:20:40 +0000 (15:20 +0100)]
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.
Andy Wingo [Fri, 15 Feb 2013 13:21:21 +0000 (14:21 +0100)]
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.
Andy Wingo [Fri, 15 Feb 2013 13:15:15 +0000 (14:15 +0100)]
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.
Andy Wingo [Fri, 15 Feb 2013 11:11:29 +0000 (12:11 +0100)]
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.
Andy Wingo [Fri, 15 Feb 2013 10:19:10 +0000 (11:19 +0100)]
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.
Andy Wingo [Thu, 14 Feb 2013 16:33:40 +0000 (17:33 +0100)]
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.
Daniel Hartwig [Thu, 14 Feb 2013 03:23:51 +0000 (11:23 +0800)]
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.
Andy Wingo [Tue, 12 Feb 2013 08:40:55 +0000 (09:40 +0100)]
allow (define-macro name (lambda ...))
* module/ice-9/boot-9.scm (define-macro): Allow define-macro NAME
LAMBDA. A bugfix. Thanks to Akop Pogosian.
Andy Wingo [Sat, 9 Feb 2013 17:19:28 +0000 (18:19 +0100)]
(texinfo): add a command-spec for @math{}.
* module/texinfo.scm (texi-command-specs): Add `math' as inline-text.
Andy Wingo [Sat, 9 Feb 2013 17:19:06 +0000 (18:19 +0100)]
(texinfo docbook): informaltable is a block element.
* module/texinfo/docbook.scm (*sdocbook-block-commands*): informaltable
is a block element.
Andy Wingo [Sat, 9 Feb 2013 17:18:28 +0000 (18:18 +0100)]
(texinfo plain-text): Pass @math{} through as-is.
* module/texinfo/plain-text.scm (tag-handlers): Pass `math' through
as-is.
Andy Wingo [Sat, 9 Feb 2013 17:17:48 +0000 (18:17 +0100)]
(texinfo serialize): don't break words when wrapping
* module/texinfo/serialize.scm (wrap): Don't break long words by
default; that could break @-commands.
Mark H Weaver [Sat, 2 Feb 2013 13:55:04 +0000 (08:55 -0500)]
Add copyright notice to gen-scmconfig.c.
* libguile/gen-scmconfig.c: Add copyright notice.
Mark H Weaver [Sat, 2 Feb 2013 09:04:49 +0000 (04:04 -0500)]
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.
Mark H Weaver [Sat, 2 Feb 2013 09:02:24 +0000 (04:02 -0500)]
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.
Mark H Weaver [Sat, 2 Feb 2013 08:57:17 +0000 (03:57 -0500)]
Fix typo in comment generated by gen-scmconfig.c.
* libguile/gen-scmconfig.c (main): Fix typo in generated comment.
Ludovic Courtès [Fri, 1 Feb 2013 17:19:27 +0000 (18:19 +0100)]
guild: Gracefully handle failures to install the locale.
* meta/guild.in (main): Catch `system-error' when calling `setlocale',
and gracefully handle any error.
Ludovic Courtès [Fri, 1 Feb 2013 17:17:09 +0000 (18:17 +0100)]
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>.
Mark H Weaver [Wed, 23 Jan 2013 22:49:38 +0000 (17:49 -0500)]
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.
Mark H Weaver [Thu, 31 Jan 2013 05:32:57 +0000 (00:32 -0500)]
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.
Andy Wingo [Wed, 30 Jan 2013 14:30:31 +0000 (15:30 +0100)]
Revert "detect and consume byte-order marks for textual ports"
This reverts commit
b2cb557d75e4daf8c7c8cd43313f4cc51d9a3f1b, which was
pushed accidentally.
Andy Wingo [Wed, 30 Jan 2013 14:29:18 +0000 (15:29 +0100)]
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.
Andy Wingo [Wed, 30 Jan 2013 12:55:59 +0000 (13:55 +0100)]
quick fix to ssax.scm
* module/sxml/ssax.scm: Fix previous commit.
Andy Wingo [Wed, 30 Jan 2013 12:52:47 +0000 (13:52 +0100)]
fix ssax:warn to work as intended
* module/sxml/ssax.scm (ssax:warn): Fix to make more sense.
Andy Wingo [Wed, 30 Jan 2013 09:17:25 +0000 (10:17 +0100)]
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.
Andy Wingo [Wed, 30 Jan 2013 10:59:37 +0000 (11:59 +0100)]
require automake 1.12 for `serial-tests'.
* configure.ac: Require automake 1.12 for `serial-tests'.
Ludovic Courtès [Mon, 28 Jan 2013 21:28:00 +0000 (22:28 +0100)]
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.
Ludovic Courtès [Mon, 28 Jan 2013 20:54:21 +0000 (21:54 +0100)]
Remove unneeded SMOB mark procedure in `memoize.c'.
* libguile/memoize.c (scm_init_memoize): Remove unnecessary call to
`scm_set_smob_mark'.
Ian Price [Sat, 19 Jan 2013 17:05:27 +0000 (17:05 +0000)]
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.
Andy Wingo [Mon, 28 Jan 2013 11:01:16 +0000 (12:01 +0100)]
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.
Andy Wingo [Sun, 27 Jan 2013 20:56:07 +0000 (21:56 +0100)]
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.
Andy Wingo [Sun, 27 Jan 2013 21:20:02 +0000 (22:20 +0100)]
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.
Andy Wingo [Mon, 28 Jan 2013 09:48:42 +0000 (10:48 +0100)]
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.
Andy Wingo [Sun, 27 Jan 2013 20:53:49 +0000 (21:53 +0100)]
current-ssax-error-port is a parameter
* module/sxml/ssax.scm (current-ssax-error-port): Change to be a
parameter.
Mark H Weaver [Wed, 23 Jan 2013 22:27:50 +0000 (17:27 -0500)]
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.
Mark H Weaver [Sun, 27 Jan 2013 15:10:21 +0000 (10:10 -0500)]
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?'.
Ludovic Courtès [Sat, 26 Jan 2013 20:49:17 +0000 (21:49 +0100)]
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.
Ludovic Courtès [Sat, 26 Jan 2013 18:18:31 +0000 (19:18 +0100)]
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.
Ludovic Courtès [Sat, 26 Jan 2013 14:41:05 +0000 (15:41 +0100)]
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>.
Mark H Weaver [Wed, 23 Jan 2013 22:25:18 +0000 (17:25 -0500)]
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).
Andy Wingo [Wed, 23 Jan 2013 15:53:54 +0000 (16:53 +0100)]
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.
Andy Wingo [Wed, 23 Jan 2013 15:11:31 +0000 (16:11 +0100)]
fix regression in -l
* module/ice-9/command-line.scm (compile-shell-switches): Fix regression
with -l argument, which was loading arg0 instead.
Andy Wingo [Wed, 23 Jan 2013 15:05:13 +0000 (16:05 +0100)]
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).
Andy Wingo [Mon, 21 Jan 2013 11:28:22 +0000 (12:28 +0100)]
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).
Andy Wingo [Wed, 23 Jan 2013 08:37:59 +0000 (09:37 +0100)]
fix dynamic-call doc
* doc/ref/api-foreign.texi (Foreign Functions): Fix doc: interrupts are
not deferred in a dynamic-call.
Andy Wingo [Tue, 22 Jan 2013 14:40:08 +0000 (15:40 +0100)]
paameterize in read-and-compile
* module/system/base/compile.scm (read-and-compile): Use
current-language parameter.
Andy Wingo [Tue, 22 Jan 2013 14:39:37 +0000 (15:39 +0100)]
docstring in rdelim
* module/ice-9/rdelim.scm: Update docstring.
Andy Wingo [Mon, 21 Jan 2013 10:21:19 +0000 (11:21 +0100)]
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.
Andy Wingo [Mon, 21 Jan 2013 10:16:29 +0000 (11:16 +0100)]
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.
Andy Wingo [Tue, 22 Jan 2013 09:12:59 +0000 (10:12 +0100)]
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.
Andy Wingo [Sun, 20 Jan 2013 19:26:59 +0000 (20:26 +0100)]
`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.
Andy Wingo [Tue, 22 Jan 2013 10:48:47 +0000 (11:48 +0100)]
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.
Andy Wingo [Tue, 22 Jan 2013 10:35:25 +0000 (11:35 +0100)]
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.
Andy Wingo [Tue, 22 Jan 2013 08:19:39 +0000 (09:19 +0100)]
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.
Andy Wingo [Mon, 21 Jan 2013 21:13:16 +0000 (22:13 +0100)]
Fix http-get* deprecation note
* module/web/client.scm (http-get*): Fix deprecation warning. Thanks to
Daniel Hartwig for the report.