Andy Wingo [Fri, 21 May 2010 22:49:52 +0000 (00:49 +0200)]
update NEWS for things that were true and aren't, or vice versa
* NEWS: Misc updates.
Andy Wingo [Fri, 21 May 2010 22:13:21 +0000 (00:13 +0200)]
pre-prepare NEWS
* NEWS: Integrate 1.9.10 entries into the main text.
Julian Graham [Sat, 22 May 2010 22:20:00 +0000 (18:20 -0400)]
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.
Ludovic Courtès [Sat, 22 May 2010 21:54:16 +0000 (23:54 +0200)]
Fix disassembly of free variable lists.
* module/language/assembly/disassemble.scm (disassemble-free-vars):
Handle FREE-VARS as a list, not a vector.
Andy Wingo [Fri, 21 May 2010 21:44:15 +0000 (23:44 +0200)]
boot-9 comment cleanup
* module/ice-9/boot-9.scm: Remove needless comment.
Andy Wingo [Fri, 21 May 2010 21:43:58 +0000 (23:43 +0200)]
lambda* in make-mutable-parameter
* module/ice-9/boot-9.scm (make-mutable-parameter): Use lambda*.
Andy Wingo [Fri, 21 May 2010 21:43:35 +0000 (23:43 +0200)]
define* in repl-reader
* module/ice-9/boot-9.scm (repl-reader): Use define*.
Andy Wingo [Fri, 21 May 2010 21:43:16 +0000 (23:43 +0200)]
define* in try-module-autoload
* module/ice-9/boot-9.scm (try-module-autoload): Use define*.
Andy Wingo [Fri, 21 May 2010 21:42:54 +0000 (23:42 +0200)]
define* in resolve-interface
* module/ice-9/boot-9.scm (resolve-interface): Use define* with proper
keyword arguments, for great justice.
Andy Wingo [Fri, 21 May 2010 21:42:17 +0000 (23:42 +0200)]
lambda* in resolve-module
* module/ice-9/boot-9.scm (resolve-module): Use lambda*.
Andy Wingo [Fri, 21 May 2010 21:41:49 +0000 (23:41 +0200)]
define* in load-module
* module/ice-9/boot-9.scm (load-module): Use define*.
Andy Wingo [Fri, 21 May 2010 21:37:54 +0000 (23:37 +0200)]
define* in module-observe-weak
* module/ice-9/boot-9.scm (module-observe-weak): Use define*.
Andy Wingo [Fri, 21 May 2010 21:37:21 +0000 (23:37 +0200)]
define* in load
* module/ice-9/boot-9.scm (load): Use define*.
Andy Wingo [Fri, 21 May 2010 21:36:47 +0000 (23:36 +0200)]
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.
Andy Wingo [Fri, 21 May 2010 21:36:00 +0000 (23:36 +0200)]
define* in file-set-position
* module/ice-9/boot-9.scm (file-set-position): Use define*.
Andy Wingo [Fri, 21 May 2010 21:35:24 +0000 (23:35 +0200)]
define* in record-constructor
* module/ice-9/boot-9.scm (record-constructor): Use define*.
Andy Wingo [Fri, 21 May 2010 21:34:54 +0000 (23:34 +0200)]
define* in make-record-type
* module/ice-9/boot-9.scm (make-record-type): Use define*.
Andy Wingo [Fri, 21 May 2010 21:34:06 +0000 (23:34 +0200)]
lambda* in string-any, string-every
* module/ice-9/boot-9.scm (string-any, string-every): Use lambda*.
Andy Wingo [Fri, 21 May 2010 21:33:28 +0000 (23:33 +0200)]
lambda* in catch
* module/ice-9/boot-9.scm (catch): Use lambda*.
Andy Wingo [Fri, 21 May 2010 21:32:43 +0000 (23:32 +0200)]
lambda* in make-prompt-tag
* module/ice-9/boot-9.scm (make-prompt-tag): Use lambda*.
Julian Graham [Fri, 21 May 2010 01:46:12 +0000 (21:46 -0400)]
Explicitly import `*unspecified*' to support R6RS library purification
enhancements.
* module/rnrs/6/hashtables.scm: Add explicit import for `*unspecified*'.
Julian Graham [Thu, 20 May 2010 13:33:39 +0000 (09:33 -0400)]
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 `@@'.
Julian Graham [Fri, 14 May 2010 01:41:38 +0000 (21:41 -0400)]
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)'.
Julian Graham [Sat, 10 Apr 2010 05:01:46 +0000 (01:01 -0400)]
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.
Julian Graham [Fri, 9 Apr 2010 04:23:28 +0000 (00:23 -0400)]
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.
Julian Graham [Sun, 4 Apr 2010 18:53:06 +0000 (14:53 -0400)]
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.
Julian Graham [Sun, 4 Apr 2010 03:05:46 +0000 (23:05 -0400)]
Fix typo in license comment.
* test-suite/tests/r6rs-eval.test: Lice6nse => License.
Julian Graham [Sun, 4 Apr 2010 03:04:24 +0000 (23:04 -0400)]
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.
Julian Graham [Tue, 30 Mar 2010 18:38:27 +0000 (14:38 -0400)]
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.
Julian Graham [Tue, 30 Mar 2010 18:27:00 +0000 (14:27 -0400)]
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.
Julian Graham [Mon, 29 Mar 2010 02:31:45 +0000 (22:31 -0400)]
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.
Julian Graham [Sun, 28 Mar 2010 23:40:16 +0000 (19:40 -0400)]
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.
Julian Graham [Sun, 28 Mar 2010 23:31:49 +0000 (19:31 -0400)]
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.
Julian Graham [Sat, 27 Mar 2010 19:28:24 +0000 (15:28 -0400)]
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.
Julian Graham [Sat, 27 Mar 2010 15:39:28 +0000 (11:39 -0400)]
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.
Julian Graham [Sat, 27 Mar 2010 00:57:52 +0000 (20:57 -0400)]
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.
Julian Graham [Sat, 27 Mar 2010 00:47:39 +0000 (20:47 -0400)]
Fix test suite title in comment
* test-suite/tests/r6rs-records-procedural.test: `(rnrs control)' =>
`(rnrs records procedural)'
Julian Graham [Sun, 21 Mar 2010 23:26:48 +0000 (19:26 -0400)]
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.
Julian Graham [Sun, 21 Mar 2010 21:12:38 +0000 (17:12 -0400)]
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.
Julian Graham [Sun, 21 Mar 2010 21:03:35 +0000 (17:03 -0400)]
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.
Julian Graham [Sun, 21 Mar 2010 20:19:06 +0000 (16:19 -0400)]
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
Julian Graham [Sun, 21 Mar 2010 00:51:37 +0000 (20:51 -0400)]
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.
Julian Graham [Sat, 20 Mar 2010 19:14:46 +0000 (15:14 -0400)]
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.
Julian Graham [Sat, 20 Mar 2010 19:10:11 +0000 (15:10 -0400)]
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.
Julian Graham [Sat, 20 Mar 2010 18:57:49 +0000 (14:57 -0400)]
(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).
Julian Graham [Sat, 20 Mar 2010 12:36:17 +0000 (08:36 -0400)]
Fix missing export of string->symbol in (rnrs base).
* module/rnrs/6/base.scm: Add string->symbol to library exports.
Julian Graham [Sat, 20 Mar 2010 00:03:46 +0000 (20:03 -0400)]
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.
Julian Graham [Wed, 10 Mar 2010 06:36:15 +0000 (01:36 -0500)]
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.
Julian Graham [Wed, 10 Mar 2010 06:26:12 +0000 (01:26 -0500)]
Remove needless import of (rnrs io simple).
* module/rnrs/6/conditions.scm: Remove (rnrs io simple (6)) from imports.
Julian Graham [Mon, 8 Mar 2010 14:00:42 +0000 (09:00 -0500)]
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.
Julian Graham [Sat, 6 Mar 2010 07:04:25 +0000 (02:04 -0500)]
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.
Julian Graham [Sat, 6 Mar 2010 06:28:46 +0000 (01:28 -0500)]
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.
Julian Graham [Mon, 8 Feb 2010 14:45:54 +0000 (09:45 -0500)]
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.
Julian Graham [Sat, 8 May 2010 21:15:52 +0000 (17:15 -0400)]
Documentation for the R6RS `library' and `import' forms.
* doc/ref/api-modules.texi (R6RS Libraries): New section, documents
`library' and `import'.
Andy Wingo [Thu, 20 May 2010 15:52:44 +0000 (17:52 +0200)]
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.
Andy Wingo [Thu, 20 May 2010 11:59:34 +0000 (13:59 +0200)]
pure r6rs modules
* module/ice-9/r6rs-libraries.scm (library): Make pure modules.
(import): Also process imports at expand time, for the `eval' case.
Andy Wingo [Thu, 20 May 2010 11:47:49 +0000 (13:47 +0200)]
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.
Andy Wingo [Thu, 20 May 2010 11:28:25 +0000 (13:28 +0200)]
lambda* usage in psyntax.scm
* module/ice-9/psyntax.scm (macroexpand): Use lambda*.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Thu, 20 May 2010 11:27:49 +0000 (13:27 +0200)]
tree-il->scheme for lambda* et al
* module/language/tree-il.scm (tree-il->scheme): Fix lambda* /
case-lambda / case-lambda* transformation.
Andy Wingo [Thu, 20 May 2010 10:54:47 +0000 (12:54 +0200)]
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.
Andy Wingo [Thu, 20 May 2010 10:53:21 +0000 (12:53 +0200)]
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.
Andy Wingo [Thu, 20 May 2010 10:25:52 +0000 (12:25 +0200)]
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.
Andy Wingo [Wed, 19 May 2010 23:00:37 +0000 (01:00 +0200)]
%null-pointer properly aligned
* libguile/foreign.c: Allocate %null-pointer on the heap, to assure
proper alignment.
Andy Wingo [Wed, 19 May 2010 21:56:00 +0000 (23:56 +0200)]
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.
Andy Wingo [Wed, 19 May 2010 21:37:27 +0000 (23:37 +0200)]
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.
Andy Wingo [Wed, 19 May 2010 21:27:14 +0000 (23:27 +0200)]
tree-il on expanded-vtables
* module/language/tree-il.scm: In a somewhat daring move, inherit
the "core" tree-il constructs from %expanded-vtables.
Andy Wingo [Wed, 19 May 2010 21:25:50 +0000 (23:25 +0200)]
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.
Andy Wingo [Wed, 19 May 2010 20:57:52 +0000 (22:57 +0200)]
%expanded-vtables is a vector
* libguile/expand.c (scm_init_expand): %expanded-vtables is a vector.
Andy Wingo [Wed, 19 May 2010 20:51:31 +0000 (22:51 +0200)]
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.
Andy Wingo [Tue, 18 May 2010 20:30:58 +0000 (22:30 +0200)]
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.
Andy Wingo [Sun, 16 May 2010 10:21:27 +0000 (12:21 +0200)]
scm_memoize_lambda update
* libguile/memoize.h:
* libguile/memoize.c (scm_memoize_lambda): Update to memoize
"full-arity" lambdas.
Andy Wingo [Thu, 13 May 2010 21:27:00 +0000 (23:27 +0200)]
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.
Andy Wingo [Thu, 13 May 2010 19:43:35 +0000 (21:43 +0200)]
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.
Andy Wingo [Thu, 13 May 2010 15:15:10 +0000 (17:15 +0200)]
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.
Andy Wingo [Thu, 13 May 2010 14:56:31 +0000 (16:56 +0200)]
tweak to lambda* memoization format
* libguile/memoize.c (FULL_ARITY): Change the form to more closely
approximate <lambda-case>.
(unmemoize): Unmemoize lambda* expressions.
Andy Wingo [Wed, 12 May 2010 10:17:18 +0000 (12:17 +0200)]
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.
Andy Wingo [Wed, 12 May 2010 10:02:09 +0000 (12:02 +0200)]
scm_badargsp is deprecated
* libguile/eval.h:
* libguile/eval.c:
* libguile/deprecated.h
* libguile/deprecated.c (scm_badargsp): Deprecate scm_badargsp.
Ludovic Courtès [Tue, 11 May 2010 20:54:14 +0000 (22:54 +0200)]
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.
Andy Wingo [Fri, 7 May 2010 21:12:34 +0000 (23:12 +0200)]
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.
Andy Wingo [Fri, 7 May 2010 20:19:36 +0000 (22:19 +0200)]
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.
Andy Wingo [Fri, 7 May 2010 08:51:28 +0000 (10:51 +0200)]
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.
Ludovic Courtès [Fri, 7 May 2010 13:59:50 +0000 (15:59 +0200)]
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.
Ludovic Courtès [Sun, 2 May 2010 12:17:41 +0000 (14:17 +0200)]
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.
Ludovic Courtès [Tue, 20 Apr 2010 23:05:42 +0000 (01:05 +0200)]
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.
Ludovic Courtès [Wed, 21 Apr 2010 21:30:48 +0000 (23:30 +0200)]
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.
Ludovic Courtès [Sun, 18 Apr 2010 22:27:47 +0000 (00:27 +0200)]
Fix the type tag produced by `SCM_STATIC_PROGRAM'.
* libguile/snarf.h (SCM_STATIC_PROGRAM): Fix typo.
Ludovic Courtès [Wed, 14 Apr 2010 21:46:41 +0000 (23:46 +0200)]
When printing a VM, show the type of engine being used.
* libguile/vm.c (scm_i_vm_print): Print the engine type.
Andy Wingo [Thu, 6 May 2010 20:34:36 +0000 (22:34 +0200)]
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.
Andy Wingo [Thu, 6 May 2010 20:32:50 +0000 (22:32 +0200)]
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 @@.
Andy Wingo [Thu, 6 May 2010 19:12:09 +0000 (21:12 +0200)]
@@ 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.
Andy Wingo [Wed, 5 May 2010 22:15:06 +0000 (00:15 +0200)]
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.
Andy Wingo [Wed, 5 May 2010 20:59:32 +0000 (22:59 +0200)]
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.
Andy Wingo [Tue, 4 May 2010 21:47:22 +0000 (23:47 +0200)]
add explanatory comment to chi-macro
* module/ice-9/psyntax.scm (chi-macro): Add comment.
Andy Wingo [Tue, 4 May 2010 21:20:12 +0000 (23:20 +0200)]
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.
Andy Wingo [Mon, 3 May 2010 17:09:35 +0000 (19:09 +0200)]
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.
Julian Graham [Sat, 6 Feb 2010 17:33:20 +0000 (12:33 -0500)]
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.
Andy Wingo [Mon, 3 May 2010 20:06:44 +0000 (22:06 +0200)]
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.
Andy Wingo [Mon, 3 May 2010 14:34:12 +0000 (16:34 +0200)]
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.
Andy Wingo [Mon, 3 May 2010 14:31:32 +0000 (16:31 +0200)]
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
Andy Wingo [Mon, 3 May 2010 13:38:29 +0000 (15:38 +0200)]
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.