1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

122 commits

Author SHA1 Message Date
Andreas Rottmann
ead04a04cd Enhance transcoder-related functionality of `(rnrs io ports)'
* module/rnrs/io/ports.scm (transcoder-eol-style)
  (transcoder-error-handling-mode): Export these.
  (textual-port?): Implement this procedure and export it.
* module/rnrs.scm: Export these here as well.

* module/rnrs/io/ports.scm (port-transcoder): Implement this procedure.
  (binary-port?): Treat only ports without an encoding as binary ports,
  add docstring.
  (standard-input-port, standard-output-port, standard-error-port):
  Ensure these are created without an encoding.
  (eol-style): Add `none' as enumeration member.
  (native-eol-style): Switch to `none' from `lf'.

* test-suite/tests/r6rs-ports.test (7.2.7 Input ports)
  (8.2.10 Output ports): Test binary-ness of `standard-input-port',
  `standard-output-port' and `standard-error-port'.
  (8.2.6 Input and output ports): Add test for `port-transcoder'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2011-03-13 23:14:43 +01:00
Andreas Rottmann
74571cfd3b Export current-*-port' from (rnrs io ports)'
* module/rnrs/io/ports.scm: Export `current-input-port',
  `current-output-port' and `current-error-port' (see R6RS 8.2.7 "Input
  ports" and 8.2.10 "Output ports").

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2011-03-13 22:39:26 +01:00
Andreas Rottmann
a6c377f7d8 Add get-string-n' and get-string-n!' for R6RS ports
* libguile/r6rs-ports.c (scm_get_string_n_x): Implement `get-string-n!'
  in C for efficiency.
* libguile/r6rs-ports.h: Add prototype for this function.
* module/ice-9/binary-ports.scm: Export `get-string-n!'.

* module/rnrs/io/ports.scm (get-string-n): Implement based on
  `get-string-n!'.
  Export both `get-string-n!' and `get-string-n'.
* module/rnrs.scm: Also export these.

* test-suite/tests/r6rs-ports.test (8.2.9 Textual input): Add a few
  tests for `get-string-n' and `get-string-n!'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2011-03-13 22:39:14 +01:00
Ludovic Courtès
630b6588b7 Make `(rnrs base)' independent of other rnrs modules.
* module/rnrs/base.scm (define-proxy): New macro.
  (raise, condition, make-error, make-assertion-violation,
  make-who-condition, make-message-condition, make-irritants-condition):
  Use it.
2011-02-22 00:32:39 +01:00
Andy Wingo
dd0d987fbd add (ice-9 binary-ports)
* module/ice-9/binary-ports.scm: New module.
* module/Makefile.am: Add to makefile.

* module/rnrs/io/ports.scm: Re-export bindings from (ice-9 binary
  ports).  This will allow the compiler to not pull (rnrs) into its
  included module set.
2011-02-18 16:01:21 +01:00
Andreas Rottmann
32b6312952 install r6rs exception printer
* module/rnrs/exceptions.scm: Install an exception printer for R6RS
  exceptions.
2011-02-11 16:07:44 +01:00
Ludovic Courtès
eed98cbc92 R6RS: Have put-char', put-string', etc. raise an `&i/o-encoding-error'.
* module/rnrs/io/ports.scm (&i/o-encoding): New error condition type.
  (with-i/o-encoding-error): New macro.
  (put-char, put-datum, put-string): Use it.

* test-suite/tests/r6rs-ports.test ("8.2.6  Input and output
  ports")["transcoded-port, output [error handling mode = raise]"]: New
  test.
2011-02-02 18:06:29 +01:00
Ludovic Courtès
b1e76e8f2c R6RS: Have get-char', get-line', etc. raise an `&i/o-decoding-error'.
* module/rnrs/io/ports.scm (&i/o-decoding): New error condition type.
  (with-i/o-decoding-error): New macro.
  (get-char, get-datum, get-line, get-string-all, lookahead-char): Use
  it.

* test-suite/tests/r6rs-ports.test ("8.2.6  Input and output
  ports")["transcoded-port [error handling mode = raise]"]: Use `guard'
  and `i/o-decoding-error?'.
2011-02-02 18:06:28 +01:00
Ludovic Courtès
b8fff11ed9 Avoid circular dependency between (rnrs base) and (rnrs exceptions).
* module/rnrs/base.scm (raise): Define as a macro instead of a
  procedure.
2011-02-02 18:06:28 +01:00
Mark H Weaver
ff62c16828 Add two new sets of fast quotient and remainder operators
* libguile/numbers.c (scm_euclidean_quo_and_rem, scm_euclidean_quotient,
  scm_euclidean_remainder, scm_centered_quo_and_rem,
  scm_centered_quotient, scm_centered_remainder): New extensible
  procedures `euclidean/', `euclidean-quotient', `euclidean-remainder',
  `centered/', `centered-quotient', `centered-remainder'.

* libguile/numbers.h: Add function prototypes.

* module/rnrs/base.scm: Remove incorrect stub implementations of `div',
  `mod', `div-and-mod', `div0', `mod0', and `div0-and-mod0'.  Instead do
  renaming imports of `euclidean-quotient', `euclidean-remainder',
  `euclidean/', `centered-quotient', `centered-remainder', and
  `centered/', which are equivalent to the R6RS operators.

* module/rnrs/arithmetic/fixnums.scm (fxdiv, fxmod, fxdiv-and-mod,
  fxdiv0, fxmod0, fxdiv0-and-mod0): Remove redundant checks for division
  by zero and unnecessary complexity.
  (fx+/carry): Remove unneeded calls to `inexact->exact'.

* module/rnrs/arithmetic/flonums.scm (fldiv, flmod, fldiv-and-mod,
  fldiv0, flmod0, fldiv0-and-mod0): Remove redundant checks for division
  by zero and unnecessary complexity.  Remove unneeded calls to
  `inexact->exact' and `exact->inexact'

* test-suite/tests/numbers.test: (test-eqv?): New internal predicate for
  comparing numerical outputs with expected values.

  Add extensive test code for `euclidean/', `euclidean-quotient',
  `euclidean-remainder', `centered/', `centered-quotient',
  `centered-remainder'.

* test-suite/tests/r6rs-arithmetic-fixnums.test: Fix some broken test
  cases, and remove `unresolved' test markers for `fxdiv', `fxmod',
  `fxdiv-and-mod', `fxdiv0', `fxmod0', and `fxdiv0-and-mod0'.

* test-suite/tests/r6rs-arithmetic-flonums.test: Remove `unresolved'
  test markers for `fldiv', `flmod', `fldiv-and-mod', `fldiv0',
  `flmod0', and `fldiv0-and-mod0'.

* doc/ref/api-data.texi (Arithmetic): Document `euclidean/',
  `euclidean-quotient', `euclidean-remainder', `centered/',
  `centered-quotient', and `centered-remainder'.

  (Operations on Integer Values): Add cross-references to `euclidean/'
  et al, from `quotient', `remainder', and `modulo'.

* doc/ref/r6rs.texi (rnrs base): Improve documentation for `div', `mod',
  `div-and-mod', `div0', `mod0', and `div0-and-mod0'.  Add
  cross-references to `euclidean/' et al.

* NEWS: Add NEWS entry.
2011-01-30 23:00:38 +01:00
Mark H Weaver
8f2339c436 Implement R6RS real-valued?', rational-valued?', `integer-valued?'
* module/rnrs/base.scm (real-valued?, rational-valued?,
  integer-valued?): Implement in compliance with R6RS.

* test-suite/tests/r6rs-base.test: Add test cases for
  `real-valued?', `rational-valued?', and `integer-valued?'.

* NEWS: Add NEWS entries.
2011-01-30 13:08:53 +01:00
Mark H Weaver
7112615f73 Implement finite?' in core and fix R6RS finite?' and `infinite?'
* libguile/numbers.c (scm_finite_p): Add new predicate `finite?' from
  R6RS to guile core, which returns #t if and only if its argument is
  neither infinite nor a NaN.  Note that this is not the same as (not
  (inf? x)) or (not (infinite? x)), since NaNs are neither finite nor
  infinite.

* test-suite/tests/numbers.test: Add test cases for `finite?'.

* module/rnrs/base.scm: Import `inf?' as `infinite?' instead of
  reimplementing it.  Previously, the R6RS implementation of
  `infinite?' did not detect non-real complex infinities, nor did it
  throw exceptions for non-numbers.  (Note that NaNs _are_ considered
  numbers by scheme, despite their name).

  Import `finite?' instead of reimplementing it.  Previously, the R6RS
  implementation of `finite?' returned #t for both NaNs and non-real
  complex infinities, in violation of R6RS.

* NEWS: Add NEWS entries, and reorganize existing numerics-related
  entries together under one subheading.

* doc/ref/api-data.texi (Real and Rational Numbers): Add docs for
  `finite?' and scm_finite_p.
2011-01-28 12:21:14 +01:00
Andy Wingo
b04f841d5f implement port-eof?
* module/rnrs/io/ports.scm (port-eof?): Implement.
* module/rnrs.scm: Re-export port-eof?.

* test-suite/tests/r6rs-ports.test ("7.2.5 End-of-File Object"): Add
  test.

Thanks to Göran Weinholt for the report.
2011-01-21 08:27:08 +01:00
Andy Wingo
ed3fd27adb rnrs control only depends on (guile)
* module/rnrs/control.scm: Depend only on (guile).
2010-12-10 18:04:02 +01:00
Andreas Rottmann
c0f6c1638b Some tweaks to the R6RS support
* module/rnrs/base.scm (error, assert): Define -- they were missing.
  (assertion-violation): Properly treat a #f `who' argument.

* module/rnrs/conditions.scm (condition): Use `assertion-violation'
  instead of the undefined `raise'.
  (define-condition-type): Fix for multiple fields.
* test-suite/tests/r6rs-conditions.test: Test accessors of a
  multiple-field condition.  Also import `(rnrs base)' to allow
  stand-alone running of the tests; apparently the `@' references
  scattered throughout the R6RS modules make the libraries sensitive to
  their load order -- for instance, trying to load `(rnrs conditions)'
  before `(rnrs base)' is loaded fails.

* module/rnrs/records/inspection.scm: Use `assertion-violation' instead
  of an explicit `raise'.
* module/rnrs/records/syntactic.scm (process-fields): Use
  `syntax-violation' instead of bogus invocations of `error'.
2010-11-25 23:04:12 +01:00
Ludovic Courtès
d4b8163784 Honor R6RS transcoder error handling modes, when possible.
* module/rnrs/io/ports.scm (transcoded-port): Change RESULT's conversion
  strategy based on TRANSCODER's error-handling mode.

* test-suite/tests/r6rs-ports.test ("8.2.6  Input and output
  ports")["transcoded-port [error handling mode = raise]",
  "transcoded-port [error handling mode = replace]"]: New tests.
2010-11-24 23:04:24 +01:00
Andreas Rottmann
1044537dff Add implementation of "transcoded ports"
* libguile/r6rs-ports.c (make_tp, tp_write, tp_fill_input, tp_flush)
  (tp_close, initialize_transcoded_ports, scm_i_make_transcoded_port): New
  functions.
  (scm_init_r6rs_ports): Call `initialize_transcoded_ports'.
* module/rnrs/ports.scm (transcoded-port): Actually implement,
  using `%make-transcoded-port'.
* test-suite/tests/r6rs-ports.test ("8.2.6 Input and output ports"): Added a
  few tests for `transcoded-port'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2010-11-24 23:04:24 +01:00
Andreas Rottmann
a5484153b8 Work towards a more complete implementation of `(rnrs io ports)'
* module/rnrs/io/ports.scm: (file-options, buffer-mode, eol-style)
  (error-handling-mode, make-transcoder, native-transcoder)
  (latin-1-codec, utf-8-codec, utf-16-codec)
  (call-with-bytevector-output-port, open-file-input-port)
  (open-file-output-port, make-custom-textual-output-port)
  (flush-output-port, put-char, put-datum, put-string, get-char)
  (get-datum, get-line, get-string-all, lookahead-char)
  (standard-input-port, standard-output-port, standard-error-port):
  Define all of these.

  (call-with-port): Don't use `dynamic-wind', as it is against its
  specification in R6RS 8.2.6.

* module/rnrs.scm: Export procedures added.

* module/rnrs/io/simple.scm (call-with-input-file)
  (call-with-output-file): Define these in terms of R6RS procedures to
  get correct exception behavior.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2010-11-24 23:04:24 +01:00
Andreas Rottmann
50851f1d18 Reorganize the R6RS I/O condition types
Move the I/O condition types from `(rnrs conditions)', where they were
not exported, to `(rnrs files)', where they are.

* module/rnrs/conditions.scm: Remove definition of I/O condition types.
* module/rnrs/files.scm: Replace references to I/O condition types
  inside `(rnrs conditions)' with the actual definitions.
* module/rnrs/io/simple.scm: Don't `@@'-reference the I/O condition types, just
  imported them from `(rnrs files)'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2010-11-24 23:04:24 +01:00
Andreas Rottmann
baa5705ca7 Turn `(rnrs io ports)' into an R6RS library
* module/rnrs/io/ports.scm: Change into an R6RS library from a "regular"
  Guile module, so the bookkeeping for #:re-export and #:replace is done
  automatically and we gain control over the imports from `(guile)'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2010-11-24 23:04:24 +01:00
Julian Graham
015a4aaedb Enumeration set universe comparisons should be done with `equal?'
* module/rnrs/enums.scm (enum-set-union, enum-set-intersection,
  enum-set-difference): Compare enum-set universes with `equal?' to support
  sets generated using constructor syntax bound by `define-enumeration'.
* test-suite/tests/r6rs-enums.test (enum-set-union, enum-set-intersection,
  enum-set-difference): New test cases for syntactically-generated sets.
2010-11-21 15:35:44 -05:00
Julian Graham
b98d5a5a76 Add exports for missing functions from `(rnrs base)'.
* module/rnrs.scm (boolean=?): New export.
  Fix typo in export of`integer-valued?'.
* module/rnrs/base.scm: Add exports for `exact' and `inexact'.
  (boolean=?, symbol=?, infinite?, finite?, exact-integer-sqrt,
  integer-valued?, rational-valued?, real-valued?): New functions.
* test-suite/tests/r6rs-base.test (boolean=?, symbol=?, infinite?,
  finite?, exact-integer-sqrt, integer-valued?, rational-valued?,
  real-valued?): New test prefixes and tests.
2010-11-17 00:59:45 -05:00
Julian Graham
fe15364988 Improve performance of R6RS records implementation
Reimplement record-type descriptors as vtables for record structs, saving
us what was an expensive inspection of a record's vtable layout string to
determine its type.

* module/rnrs/records/inspection.scm (record-field-mutable?): Check
  mutability using the bit field stored in the record-type descriptor
  instead of the record struct's vtable.
* module/rnrs/records/procedural.scm (record-internal?): Reimplement as a
  delegation to a check of the passed struct's vtable against
  `record-type-descriptor?'.
  (record-type-vtable): Modify to include base vtable layout as a prefix
  of the record-type-descriptor layout so that all record-type instances
  are now also vtables.
  (make-record-type-descriptor): Remove field vtable; build up a mutability
  bit field to use for fast mutability checks.
  (record-accessor, record-mutator): Use field struct and mutability bit
  field.
2010-10-22 14:34:49 -04:00
Göran Weinholt
7bcbdce17c Fix make-variable-transformer export
* module/rnrs/syntax-case.scm: Add make-variable-transformer to the
  imports. This was causing an unbound variable error even though
  (rnrs) had been imported.
2010-09-19 12:15:37 +02:00
Andreas Rottmann
23988e8c50 Several fixes to R6RS libraries
* module/rnrs/arithmetic/fixnums.scm (fixnum-width): Make this return an
  an exact integer instead of an inexact number.

* module/rnrs/base.scm (assertion-violation): Implement.

* module/rnrs/conditions.scm (simple-conditions): Allow also simple
  conditions as argument.

* module/rnrs/enums.scm (define-enumeration): Properly construct empty
  enumeration sets.

* module/rnrs/exceptions.scm (guard): Don't restrict the body to a
  single expression.

* module/rnrs/records/syntactic.scm (define-record-type0): Expand into a
  series of definitions only.
2010-08-28 10:16:30 -07:00
Julian Graham
802b47bdc6 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.
2010-08-08 20:23:14 -04:00
Julian Graham
b24b7deb00 Explicit definitions for vector-for-each' and vector-map'; Guile's SRFI-1
`for-each' and `map' implementations do not operate on lists and vectors
interchangeably.

* module/rnrs/base.scm (vector-for-each, vector-map): New functions.
* test-suite/Makefile.am: Add test-suite/tests/r6rs-base.test to SCM_TESTS.
* test-suite/tests/r6rs-base.test: New file.
2010-08-08 19:32:23 -04:00
Andy Wingo
935c7acac7 letrec* in docs, and some r6rs fixes
* doc/ref/api-binding.texi: Add docs for letrec*, and revise some other
  text.
* doc/ref/compiler.texi: Update <letrec> for in-order?.
* doc/ref/r6rs.texi: Add letrec* entry.

* module/rnrs.scm:
* module/rnrs/base.scm: Export letrec*.
2010-08-06 11:52:27 +02:00
Julian Graham
3fdc1d05ae Fix argument passing for external hash functions in `(rnrs hashtables)'.
Guile implements this library in terms of SRFI-69, which is a bit vague on
the arity of hash functions, whereas `(rnrs hashtables)' explicitly
specifies unary ones.

* module/rnrs/hashtables.scm (wrap-hash-function): Assume SRFI-69 will pass
  the table capacity as the second argument; return the result of proc
  modulo the capacity.

* test-suite/tests/r6rs-hashtables.test (make-hashtable): New test case for
  hash functions that return large values.
2010-07-14 01:16:19 -04:00
Andy Wingo
73b03e98a7 ensure unicode-capable rnrs string ports
* module/rnrs/io/ports.scm (open-string-input-port):
  (open-string-output-port): Ensure that the ports are unicode-capable
  by binding %default-port-encoding to "UTF-8".
2010-06-20 23:15:29 +02:00
Andy Wingo
23b4c817b1 typo in mutable-strings
* module/rnrs/mutable-strings.scm: Fix typo.
2010-06-19 15:40:25 +02:00
Andy Wingo
0f8e69a44e *unspecified* in rnrs exceptions
* module/rnrs/exceptions.scm (rnrs): Import *unspecified*.
2010-06-19 15:40:11 +02:00
Andy Wingo
0ce1c83bbe fix ^L typo
* module/rnrs/mutable-pairs.scm: Fix ^L typo.
2010-06-19 14:45:03 +02:00
Andy Wingo
c399333044 add open-string-{input,output}-port to rnrs io ports
* module/rnrs/io/ports.scm (open-string-input-port)
  (open-string-output-port): New procedures.

* module/rnrs.scm (rnrs): Export the new (rnrs io ports) procedures.
2010-06-18 19:27:52 +02:00
Julian Graham
00f79aa4a0 Fix `define-condition-type' to use condition-accessors, not record
accessors.

* module/rnrs/conditions.scm (define-condition-type): The generated
  accessors should be condition accessors, which know how to unpack a
  compound condition; these can then delegate to the appropriate record
  accessors.
* test-suite/tests/r6rs-conditions.test: New test case to verify above.
2010-06-18 09:49:30 -04:00
Andy Wingo
e44d2e4d98 remove encoding of versions into the file system (for now?)
* module/ice-9/boot-9.scm (find-versioned-module): Remove. Still had
  some bugs (e.g. for "." in the path and in finding compiled files),
  did too much computation and statting, and we don't really want to
  promote versioning. Nor do we want to hard-code a particular encoding
  of versions in the file-system. Perhaps the real way to do this is to
  be extensible somehow.
  (try-module-autoload): Just dispatch to primitive-load-path in all cases.

* module/rnrs
* module/rnrs.scm:
* module/rnrs/arithmetic/bitwise.scm:
* module/rnrs/arithmetic/fixnums.scm:
* module/rnrs/arithmetic/flonums.scm:
* module/rnrs/base.scm:
* module/rnrs/conditions.scm:
* module/rnrs/control.scm:
* module/rnrs/enums.scm:
* module/rnrs/eval.scm:
* module/rnrs/exceptions.scm:
* module/rnrs/files.scm:
* module/rnrs/hashtables.scm:
* module/rnrs/io/simple.scm:
* module/rnrs/lists.scm:
* module/rnrs/mutable-pairs.scm:
* module/rnrs/mutable-strings.scm:
* module/rnrs/programs.scm:
* module/rnrs/r5rs.scm:
* module/rnrs/records/inspection.scm:
* module/rnrs/records/procedural.scm:
* module/rnrs/records/syntactic.scm:
* module/rnrs/sorting.scm:
* module/rnrs/syntax-case.scm:
* module/rnrs/unicode.scm: Move these files, eliding the "6/" infix, so
  that they are in the normal (unversioned) module path.
2010-06-16 22:20:28 +02:00
Andy Wingo
c08adae460 add #:version (6) to rnrs bytevectors and ports
* module/rnrs/bytevectors.scm:
* module/rnrs/io/ports.scm: Add #:version (6) to these modules.

* module/6/rnrs.scm: Add versions to the import specs for bytevectors
  and ports.
2010-06-02 22:19:40 +02:00
Andy Wingo
07d22c0259 rename (rnrs bytevector) to (rnrs bytevectors)
* module/rnrs/bytevectors.scm: Rename to (rnrs bytevectors), from (rnrs
  bytevector), to match the name from the R6RS.

* benchmark-suite/benchmarks/bytevectors.bm:
* doc/ref/api-data.texi:
* doc/ref/api-foreign.texi:
* libguile/bytevectors.c:
* module/6/rnrs.scm:
* module/language/assembly.scm:
* module/language/assembly/compile-bytecode.scm:
* module/language/assembly/decompile-bytecode.scm:
* module/language/glil/compile-assembly.scm:
* module/language/tree-il/primitives.scm:
* module/srfi/srfi-4.scm:
* module/srfi/srfi-4/gnu.scm:
* module/system/foreign.scm:
* test-suite/standalone/test-ffi:
* test-suite/tests/asm-to-bytecode.test:
* test-suite/tests/bytevectors.test:
* test-suite/tests/foreign.test:
* test-suite/tests/r6rs-ports.test: Update all referrers.
2010-06-01 13:26:11 +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
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