1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 21:10:27 +02:00
Commit graph

4452 commits

Author SHA1 Message Date
Andy Wingo
d6e70467ba define* in load
* module/ice-9/boot-9.scm (load): Use define*.
2010-05-21 23:37:35 +02:00
Andy Wingo
02851b26c7 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.
2010-05-21 23:36:47 +02:00
Andy Wingo
52c9a3381d define* in file-set-position
* module/ice-9/boot-9.scm (file-set-position): Use define*.
2010-05-21 23:36:00 +02:00
Andy Wingo
d44a0d12b4 define* in record-constructor
* module/ice-9/boot-9.scm (record-constructor): Use define*.
2010-05-21 23:35:24 +02:00
Andy Wingo
b2669c41a7 define* in make-record-type
* module/ice-9/boot-9.scm (make-record-type): Use define*.
2010-05-21 23:34:54 +02:00
Andy Wingo
a4c8a02e09 lambda* in string-any, string-every
* module/ice-9/boot-9.scm (string-any, string-every): Use lambda*.
2010-05-21 23:34:06 +02:00
Andy Wingo
f31b7b6a1c lambda* in catch
* module/ice-9/boot-9.scm (catch): Use lambda*.
2010-05-21 23:33:28 +02:00
Andy Wingo
d648f56989 lambda* in make-prompt-tag
* module/ice-9/boot-9.scm (make-prompt-tag): Use lambda*.
2010-05-21 23:32:43 +02:00
Julian Graham
b766109224 Explicitly import `*unspecified*' to support R6RS library purification
enhancements.

* module/rnrs/6/hashtables.scm: Add explicit import for `*unspecified*'.
2010-05-20 21:46:12 -04:00
Julian Graham
2470bda772 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 `@@'.
2010-05-20 21:18:04 -04:00
Julian Graham
5f29551e4d 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)'.
2010-05-20 21:18:04 -04:00
Julian Graham
d9c40da983 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.
2010-05-20 21:18:04 -04:00
Julian Graham
2d56d2dfdd 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.
2010-05-20 21:18:04 -04:00
Julian Graham
8794d769bd 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.
2010-05-20 21:18:04 -04:00
Julian Graham
b01818d752 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.
2010-05-20 21:18:03 -04:00
Julian Graham
15ce5cafbc 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.
2010-05-20 21:18:03 -04:00
Julian Graham
bc4db0905f 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.
2010-05-20 21:18:03 -04:00
Julian Graham
ace75ab775 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.
2010-05-20 21:18:03 -04:00
Julian Graham
0c7398a7dc 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.
2010-05-20 21:18:03 -04:00
Julian Graham
2359a9a49e 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.
2010-05-20 21:18:03 -04:00
Julian Graham
a725e27bda 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.
2010-05-20 21:18:03 -04:00
Julian Graham
3d5bc1ad6f 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.
2010-05-20 21:18:03 -04:00
Julian Graham
d1c83d388a 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.
2010-05-20 21:18:03 -04:00
Julian Graham
0113507eee 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.
2010-05-20 21:18:03 -04:00
Julian Graham
805b4179bf 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.
2010-05-20 21:18:03 -04:00
Julian Graham
adf73f9ab4 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.
2010-05-20 21:18:03 -04:00
Julian Graham
949532501a 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
2010-05-20 21:18:03 -04:00
Julian Graham
2b95784c8d 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.
2010-05-20 21:18:03 -04:00
Julian Graham
f797da47f8 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.
2010-05-20 21:18:02 -04:00
Julian Graham
00532e348e (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).
2010-05-20 21:18:02 -04:00
Julian Graham
b3961e7ab3 Fix missing export of string->symbol in (rnrs base).
* module/rnrs/6/base.scm: Add string->symbol to library exports.
2010-05-20 21:18:02 -04:00
Julian Graham
60b240e9ae 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.
2010-05-20 21:18:02 -04:00
Julian Graham
55684b5e3b 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.
2010-05-20 21:18:02 -04:00
Julian Graham
8b58ea4539 Remove needless import of (rnrs io simple).
* module/rnrs/6/conditions.scm: Remove (rnrs io simple (6)) from imports.
2010-05-20 21:18:02 -04:00
Julian Graham
ce543a9f70 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.
2010-05-20 21:18:02 -04:00
Julian Graham
aa439b3908 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.
2010-05-20 21:18:02 -04:00
Julian Graham
bf745816f2 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.
2010-05-20 21:18:02 -04:00
Julian Graham
2a435f1f91 Implementation and test cases for the R6RS (rnrs arithmetic bitwise)
library.

* module/rnrs/arithmetic/6/bitwise.scm: New file.
* test-suite/tests/r6rs-arithmetic-bitwise.test: New file.
2010-05-20 21:18:02 -04:00
Andy Wingo
520caaeba4 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.
2010-05-20 17:52:44 +02:00
Andy Wingo
e6c7e9ed9c pure r6rs modules
* module/ice-9/r6rs-libraries.scm (library): Make pure modules.
  (import): Also process imports at expand time, for the `eval' case.
2010-05-20 13:59:34 +02:00
Andy Wingo
4ffa827584 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.
2010-05-20 13:47:49 +02:00
Andy Wingo
82c45730af lambda* usage in psyntax.scm
* module/ice-9/psyntax.scm (macroexpand): Use lambda*.
* module/ice-9/psyntax-pp.scm: Regenerated.
2010-05-20 13:28:25 +02:00
Andy Wingo
cc63545b3e tree-il->scheme for lambda* et al
* module/language/tree-il.scm (tree-il->scheme): Fix lambda* /
  case-lambda / case-lambda* transformation.
2010-05-20 13:27:49 +02:00
Andy Wingo
131ae7b49d remove *mode* fluid from psyntax
* module/ice-9/psyntax.scm: Remove the *mode* fluid. Whee :)
  (macroexpand): No need to bind aa *mode* fluid.

* module/ice-9/psyntax-pp.scm: Regenerated.
2010-05-20 12:54:47 +02:00
Andy Wingo
632ddbf02b iron out inconsistency between eval and compile expansion
* libguile/expand.c (expand_lambda_star_case): Harmonize with tree-il,
  expanding keywords to (aok? (kw name gensym) ...), not
  (aok? (kw . index) ...).

* libguile/memoize.c (memoize): Process the (kw name gensym) format into
  (kw . index).

* module/ice-9/psyntax.scm (build-lambda-case): Remove a
  compile-versus-eval special case.

* module/ice-9/psyntax-pp.scm: Regenerate.
2010-05-20 12:53:21 +02:00
Andy Wingo
a310a1d12e primitive-eval takes expanded, not memoized, source
* module/ice-9/eval.scm (primitive-eval):
* libguile/eval.c (scm_c_primitive_eval): Don't expect a memoized
  expression -- expect either raw source or an *expanded* expression. We
  handle memoization ourselves.

* libguile/expand.c (scm_macroexpand): Settle down into its proper name,
  "macroexpand", even as we comment that it is but a fleeting boot
  expander.
  (scm_macroexpanded_p): New predicate for expanded code.

* libguile/expand.h: Add scm_macroexpanded_p.

* libguile/memoize.c (scm_memoize_expression): Require that the
  expression be expanded.
  (scm_init_memoize): Don't alias memoize-expression to macroexpand.

* module/ice-9/psyntax-pp.scm:
* module/ice-9/psyntax.scm: Always produce macroexpanded expressions,
  and hand them to primitive-eval. No more calls to memoize-expression
  here.

* test-suite/tests/optargs.test: Remove some tests, as unfortunately we
  have no way to invoke the boot expander after boot.
2010-05-20 12:25:52 +02:00
Andy Wingo
bdf7759c2b psyntax produces "expanded" structures directly
* module/ice-9/psyntax.scm: Remove a number of eval-versus-compile
  cases, instead producing "expanded" structures directly, which happen
  to coincide with tree-il.

* module/ice-9/psyntax-pp.scm: Regenerate.
2010-05-20 00:01:10 +02:00
Andy Wingo
3d10018e7f expanded type constructors in psyntax
* module/ice-9/psyntax.scm (define-expansion-constructors): Define
  constructors for expanded types.

* module/ice-9/psyntax-pp.scm: Regenerated.
2010-05-19 23:37:27 +02:00
Andy Wingo
f7b61b39d3 tree-il on expanded-vtables
* module/language/tree-il.scm: In a somewhat daring move, inherit
  the "core" tree-il constructs from %expanded-vtables.
2010-05-19 23:27:14 +02:00
Andy Wingo
dc3e203e07 separate boot expansion from memoization
* libguile/Makefile.am:
* libguile/init.c:
* libguile/expand.c:
* libguile/expand.h: Add new expander. The idea is that macroexpansion
  is one thing, and whether to compile or interpret the result of that
  is another thing.

* libguile/memoize.c: Adapt to expand as necessary, and then memoize
  expanded source without worrying about syntax errors.

* module/ice-9/eval.scm (make-general-closure): Allow alt clauses to not
  possess the full make-general-closure arity.
2010-05-19 22:51:31 +02:00