Ludovic Courtès [Fri, 27 Aug 2010 16:58:13 +0000 (18:58 +0200)]
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)'.
Ludovic Courtès [Fri, 27 Aug 2010 13:44:55 +0000 (15:44 +0200)]
SRFI-1: Choose better benchmark names.
* benchmark-suite/benchmarks/srfi-1.bm ("fold"): Rename sub-tests to
"big" and "small".
Ludovic Courtès [Fri, 27 Aug 2010 13:43:30 +0000 (15:43 +0200)]
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'.
Ludovic Courtès [Fri, 27 Aug 2010 10:51:47 +0000 (12:51 +0200)]
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.
Ludovic Courtès [Fri, 27 Aug 2010 10:36:23 +0000 (12:36 +0200)]
Remove unneeded #:use-module.
* module/system/vm/frame.scm: Remove use of (srfi srfi-1).
Ludovic Courtès [Fri, 20 Aug 2010 19:08:49 +0000 (21:08 +0200)]
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.
Andy Wingo [Fri, 27 Aug 2010 16:16:44 +0000 (09:16 -0700)]
fix <letrec> docs
* doc/ref/compiler.texi (Tree-IL): Fix docs for external representation
of letrec. Thanks to No Itisnt.
Thien-Thi Nguyen [Thu, 26 Aug 2010 21:21:41 +0000 (23:21 +0200)]
[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.
Thien-Thi Nguyen [Thu, 26 Aug 2010 16:36:48 +0000 (18:36 +0200)]
[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.
Andy Wingo [Wed, 25 Aug 2010 14:24:27 +0000 (10:24 -0400)]
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.
Andy Wingo [Wed, 25 Aug 2010 13:49:09 +0000 (09:49 -0400)]
update download location in manual
* doc/ref/intro.texi (Obtaining and Installing Guile): Update download
location.
Thien-Thi Nguyen [Thu, 19 Aug 2010 09:11:25 +0000 (11:11 +0200)]
[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.
Andy Wingo [Thu, 19 Aug 2010 05:47:55 +0000 (22:47 -0700)]
objcodes.c comments
* libguile/objcodes.c: Comments from Noah Lavine
Noah Lavine [Sun, 18 Jul 2010 17:25:23 +0000 (13:25 -0400)]
Whitespace fix
Add a space in libguile/objcodes.c to comply with the GNU Coding Standards.
Thien-Thi Nguyen [Wed, 18 Aug 2010 17:34:46 +0000 (19:34 +0200)]
[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.
Thien-Thi Nguyen [Wed, 28 Jul 2010 12:27:42 +0000 (14:27 +0200)]
[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’.
Andy Wingo [Tue, 17 Aug 2010 15:48:49 +0000 (08:48 -0700)]
update scsh doc
* doc/ref/scsh.texi (The Scheme shell (scsh)): Remove broken link to
arglist.com/guile/, and add note about bitrotting.
Andy Wingo [Mon, 16 Aug 2010 17:28:59 +0000 (10:28 -0700)]
further discouraged excision
* libguile/gen-scmconfig.h.in: Remove a DISCOURAGED define.
Andy Wingo [Thu, 12 Aug 2010 11:04:08 +0000 (13:04 +0200)]
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".
Andy Wingo [Thu, 12 Aug 2010 09:14:38 +0000 (11:14 +0200)]
minor NEWS tweaks
* NEWS: Minor tweaks.
Andy Wingo [Mon, 9 Aug 2010 19:17:57 +0000 (21:17 +0200)]
reindent psyntax.scm
* module/ice-9/psyntax.scm: Reindent.
Andy Wingo [Mon, 9 Aug 2010 19:15:18 +0000 (21:15 +0200)]
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.
Andy Wingo [Tue, 17 Aug 2010 04:25:29 +0000 (21:25 -0700)]
@apply for multiple args in the boot memoizer
* libguile/memoize.c (m_apply): Fix for multiple arguments, as in
(@apply proc foo bar baz).
Ludovic Courtès [Mon, 16 Aug 2010 10:27:14 +0000 (12:27 +0200)]
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'.
Andreas Rottmann [Sun, 15 Aug 2010 14:52:00 +0000 (16:52 +0200)]
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.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Ludovic Courtès [Sun, 15 Aug 2010 14:42:33 +0000 (16:42 +0200)]
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'.
Ludovic Courtès [Fri, 6 Aug 2010 13:36:51 +0000 (15:36 +0200)]
Add `number->locale-string' tests.
* test-suite/tests/i18n.test ("number->locale-string"): New test prefix.
Julian Graham [Mon, 9 Aug 2010 00:23:14 +0000 (20:23 -0400)]
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.
Julian Graham [Sun, 8 Aug 2010 23:32:23 +0000 (19:32 -0400)]
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.
Andy Wingo [Sun, 8 Aug 2010 12:33:46 +0000 (14:33 +0200)]
further rnrs incompat note
* doc/ref/r6rs.texi: Note about rnrs io ports.
Andy Wingo [Sun, 8 Aug 2010 12:26:26 +0000 (14:26 +0200)]
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.
Andy Wingo [Sun, 8 Aug 2010 12:15:47 +0000 (14:15 +0200)]
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.
Andy Wingo [Sun, 8 Aug 2010 11:43:40 +0000 (13:43 +0200)]
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.
Andy Wingo [Sun, 8 Aug 2010 11:00:57 +0000 (13:00 +0200)]
more r6rs incompat
* doc/ref/r6rs.texi (R6RS Incompatibilities): Add section on string
syntax.
Andy Wingo [Sun, 8 Aug 2010 10:58:05 +0000 (12:58 +0200)]
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...
Andy Wingo [Fri, 6 Aug 2010 15:42:04 +0000 (17:42 +0200)]
more NEWS updates
* NEWS: Update some more.
Andy Wingo [Fri, 6 Aug 2010 15:39:44 +0000 (17:39 +0200)]
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)'.
Andy Wingo [Fri, 6 Aug 2010 15:28:10 +0000 (17:28 +0200)]
,x unbound does not quit repl
* module/system/repl/repl.scm (run-repl): Catch errors executing
metacommands. Feature on top of feature...
Andy Wingo [Fri, 6 Aug 2010 11:45:26 +0000 (13:45 +0200)]
update NEWS for 1.9.12 (mostly)
* NEWS: Update for 1.9.12.
Andy Wingo [Fri, 6 Aug 2010 11:43:47 +0000 (13:43 +0200)]
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.
Andy Wingo [Fri, 6 Aug 2010 11:41:58 +0000 (13:41 +0200)]
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.
Andy Wingo [Fri, 6 Aug 2010 11:15:58 +0000 (13:15 +0200)]
s/extensionsdir/extensiondir/
* libguile/Makefile.am (libpath.h): Change "extensionsdir" to
"extensiondir".
* meta/guile-2.0.pc.in (extensiondir): Likewise.
Andy Wingo [Fri, 6 Aug 2010 11:15:29 +0000 (13:15 +0200)]
%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.
Andy Wingo [Fri, 6 Aug 2010 10:27:11 +0000 (12:27 +0200)]
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.
Andy Wingo [Fri, 6 Aug 2010 10:16:49 +0000 (12:16 +0200)]
add settable identifier syntax docs
* doc/ref/api-macros.texi (Identifier Macros): Add documentation for
settable identifier syntax.
Andy Wingo [Fri, 6 Aug 2010 09:52:27 +0000 (11:52 +0200)]
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*.
Andy Wingo [Thu, 5 Aug 2010 09:17:09 +0000 (11:17 +0200)]
fold 1.9.11 news into main body
* NEWS: Update.
Andy Wingo [Wed, 4 Aug 2010 19:48:00 +0000 (21:48 +0200)]
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.
Yan Li [Wed, 4 Aug 2010 07:02:43 +0000 (15:02 +0800)]
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.
Signed-off-by: Yan Li <yan.i.li@intel.com>
Andreas Rottmann [Sun, 1 Aug 2010 19:53:29 +0000 (21:53 +0200)]
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'.
Ludovic Courtès [Wed, 28 Jul 2010 10:02:50 +0000 (12:02 +0200)]
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.
Ludovic Courtès [Wed, 28 Jul 2010 10:01:54 +0000 (12:01 +0200)]
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.
Ludovic Courtès [Tue, 27 Jul 2010 16:46:23 +0000 (18:46 +0200)]
Remove unused parameter from `bytevector->pointer'.
* libguile/foreign.c (scm_bytevector_to_pointer): Remove unused LEN
parameter. Update docstring.
Ludovic Courtès [Tue, 27 Jul 2010 16:44:45 +0000 (18:44 +0200)]
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.
Ludovic Courtès [Tue, 27 Jul 2010 12:54:53 +0000 (14:54 +0200)]
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.
Andy Wingo [Tue, 27 Jul 2010 09:32:31 +0000 (11:32 +0200)]
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.
Ludovic Courtès [Mon, 26 Jul 2010 17:36:03 +0000 (19:36 +0200)]
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.
Ludovic Courtès [Mon, 26 Jul 2010 15:44:43 +0000 (17:44 +0200)]
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.
Ludovic Courtès [Mon, 26 Jul 2010 14:36:24 +0000 (16:36 +0200)]
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.
Ludovic Courtès [Mon, 26 Jul 2010 09:56:25 +0000 (11:56 +0200)]
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.
Andy Wingo [Mon, 26 Jul 2010 14:36:15 +0000 (16:36 +0200)]
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?
Andy Wingo [Mon, 26 Jul 2010 13:12:42 +0000 (15:12 +0200)]
update docs
* doc/ref/api-data.texi:
* libguile/random.c: Update datum->random-state and random-state->datum
docs.
Andy Wingo [Mon, 26 Jul 2010 12:57:46 +0000 (14:57 +0200)]
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.
Andy Wingo [Thu, 22 Jul 2010 19:26:19 +0000 (21:26 +0200)]
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.
Andy Wingo [Thu, 22 Jul 2010 18:56:55 +0000 (20:56 +0200)]
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.
Andreas Rottmann [Thu, 22 Jul 2010 16:26:00 +0000 (18:26 +0200)]
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'.
Thien-Thi Nguyen [Sat, 24 Jul 2010 20:25:24 +0000 (22:25 +0200)]
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.
Thien-Thi Nguyen [Thu, 22 Jul 2010 20:55:02 +0000 (22:55 +0200)]
Update AUTHORS to reflect now-removed guile-snarf-docs-texi; nfc.
Thien-Thi Nguyen [Thu, 22 Jul 2010 19:02:45 +0000 (21:02 +0200)]
[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.
Thien-Thi Nguyen [Thu, 22 Jul 2010 12:25:27 +0000 (14:25 +0200)]
Add copyright notice to acinclude.m4.
* acinclude.m4: Add copyright notice, with years derived from "git log" output.
Thien-Thi Nguyen [Thu, 22 Jul 2010 12:22:42 +0000 (14:22 +0200)]
[build] Move GUILE_CONFIG_SCRIPT to acinclude.m4.
* configure.ac (GUILE_CONFIG_SCRIPT): Move from here...
* acinclude.m4 (GUILE_CONFIG_SCRIPT): ...to here.
Thien-Thi Nguyen [Thu, 22 Jul 2010 12:17:26 +0000 (14:17 +0200)]
[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.
Thien-Thi Nguyen [Thu, 22 Jul 2010 11:59:12 +0000 (13:59 +0200)]
[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.
Andy Wingo [Wed, 21 Jul 2010 10:15:50 +0000 (12:15 +0200)]
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.
Ludovic Courtès [Mon, 12 Jul 2010 22:07:12 +0000 (00:07 +0200)]
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.
Ludovic Courtès [Tue, 20 Jul 2010 08:27:38 +0000 (10:27 +0200)]
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.
Andreas Rottmann [Mon, 19 Jul 2010 20:40:56 +0000 (22:40 +0200)]
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.
Andy Wingo [Sat, 17 Jul 2010 11:30:50 +0000 (13:30 +0200)]
recommend #:replace
* doc/ref/api-modules.texi (Creating Guile Modules): Update text to
recommend #:replace.
* module/srfi/srfi-19.scm (current-time): #:replace.
Andy Wingo [Sat, 17 Jul 2010 10:22:17 +0000 (12:22 +0200)]
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.
Andy Wingo [Sat, 17 Jul 2010 10:10:52 +0000 (12:10 +0200)]
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.
Michael Gran [Sat, 17 Jul 2010 11:16:57 +0000 (04:16 -0700)]
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
Michael Gran [Sat, 17 Jul 2010 10:45:28 +0000 (03:45 -0700)]
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
Andy Wingo [Fri, 16 Jul 2010 11:19:33 +0000 (13:19 +0200)]
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.
Andy Wingo [Fri, 16 Jul 2010 11:14:23 +0000 (13:14 +0200)]
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.
Andy Wingo [Fri, 16 Jul 2010 11:10:54 +0000 (13:10 +0200)]
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.
Andy Wingo [Fri, 16 Jul 2010 10:44:44 +0000 (12:44 +0200)]
update tour.texi examples
* doc/ref/tour.texi (Running Guile Interactively): Update examples for
formatting.
Andy Wingo [Fri, 16 Jul 2010 10:41:04 +0000 (12:41 +0200)]
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.
Andy Wingo [Fri, 16 Jul 2010 09:54:19 +0000 (11:54 +0200)]
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.
Andy Wingo [Fri, 16 Jul 2010 09:50:59 +0000 (11:50 +0200)]
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.
Andy Wingo [Fri, 16 Jul 2010 09:50:51 +0000 (11:50 +0200)]
lower fill-column in .dir-locals.el
* .dir-locals.el: Fill-columns back down to 72.
Michael Gran [Fri, 16 Jul 2010 13:44:59 +0000 (06:44 -0700)]
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
Michael Gran [Fri, 16 Jul 2010 12:39:52 +0000 (05:39 -0700)]
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
Ludovic Courtès [Thu, 15 Jul 2010 16:49:12 +0000 (18:49 +0200)]
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'.
Ludovic Courtès [Thu, 15 Jul 2010 16:45:29 +0000 (18:45 +0200)]
Expose `scm_encoding_error'.
* libguile/strings.c (scm_encoding_error): Make public.
* libguile/strings.h (scm_encoding_error): New internal declaration.
Ludovic Courtès [Thu, 15 Jul 2010 16:39:49 +0000 (18:39 +0200)]
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.
Ludovic Courtès [Thu, 15 Jul 2010 16:38:39 +0000 (18:38 +0200)]
Declare `ice-9/psyntax-pp.scm.gen' as a phony target.
* module/Makefile.am (.PHONY): Add `ice-9/psyntax-pp.scm.gen'.
Andy Wingo [Thu, 15 Jul 2010 10:47:58 +0000 (12:47 +0200)]
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.
Andy Wingo [Thu, 15 Jul 2010 10:46:02 +0000 (12:46 +0200)]
error-handling tweak
* module/system/repl/error-handling.scm (call-with-error-handling):
Remove extra newline.
Andy Wingo [Thu, 15 Jul 2010 10:44:15 +0000 (12:44 +0200)]
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.
Andy Wingo [Thu, 15 Jul 2010 10:13:15 +0000 (12:13 +0200)]
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.