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

17 commits

Author SHA1 Message Date
Andy Wingo
374c1e5807 Define top-level bindings for aux syntax: else, =>, _, ...
* module/ice-9/boot-9.scm (else, =>, ..., _): New definitions.  These
  are specified by the r6rs and the r7rs.
* module/ice-9/sandbox.scm (core-bindings): Include the aux syntax
  definitions.
* module/rnrs/base.scm:
* module/rnrs.scm: Re-export aux syntax.
2019-09-12 21:50:51 +02:00
Andy Wingo
4e27e3c054 Add R6RS bytevector->string, string->bytevector
* module/rnrs/io/ports.scm (string->bytevector):
  (bytevector->string): New procedures.
* module/rnrs.scm: Export new procedures.
* test-suite/tests/r6rs-ports.test: Add string->bytevector and
  bytevector->string tests.
2016-06-21 11:29:14 +02:00
Andy Wingo
59f062ec78 Export &i/o-decoding, &i/o-encoding from (rnrs)
* module/rnrs/io/ports.scm (&i/o-decoding, &i/o-encoding): Rename from
  &i/o-decoding-error and &i/o-encoding-error, to conform to R6RS.
* module/rnrs.scm (rnrs): Export &i/o-decoding, &i/o-encoding, their
  accessors and constructors.
2016-06-21 11:07:34 +02:00
Andy Wingo
5d9516637b Implement R6RS output-port-buffer-mode
* module/rnrs/io/ports.scm (r6rs-open): Set buffer-mode on new port.
  (output-port-buffer-mode): Implement and export.
* module/rnrs.scm (rnrs): Export output-port-buffer-mode
* test-suite/tests/r6rs-ports.test (test-output-file-opener): Add
  tests.
2016-06-21 11:06:25 +02:00
Andreas Rottmann
3ae5a02f1d Add missing R6RS `open-file-input/output-port' procedure
* module/rnrs/io/port.scm (r6rs-open): New internal helper procedure for
  opening files.
  (open-file-input-port, open-file-output-port): Make use of
  `r6rs-open'.
  (open-file-input/output-port): Implement in terms of `r6rs-open',
  add to exported identifiers list.

* module/rnrs.scm (open-file-input/output-port): Add to exported
  identifiers.

* test-suite/tests/r6rs-ports.test (test-input-file-opener): New
  procedure, collects several tests for opening file input ports.
  ("7.2.7 Input Ports"): Use `test-input-file-opener' for checking
  `open-file-input-port'.
  (test-output-file-opener): New procedure, collects several tests for
  opening file output ports.
  ("8.2.10 Output ports"): Use `test-output-file-opener' for checking
  `open-file-output-port'.
  ("8.2.13 Input/output ports"): New test prefix, making use of both
  `test-input-file-opener' and `test-output-file-opener' to check
  `open-file-input/output-port'.
2012-11-12 20:47:57 +01:00
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
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
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
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
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
Andy Wingo
61bac799dd back-compat in (rnrs) for deprecated modules-in-value-namespace
* module/rnrs.scm (rnrs): Work around some unavoidable (I think)
  behavior when back-compatible unified namespaces are enabled; see
  comments in source.
2010-09-02 21:31:55 -07: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
Andy Wingo
8d10ccae79 fix rnrs duplicate bindings warnings
* module/rnrs.scm: Fix i/o duplicate bindings warnings by excluding some
  bindings.
2010-06-21 00:07:46 +02:00
Andreas Rottmann
a2e0b12608 add rnrs unicode to the compound rnrs module
* module/rnrs.scm: import rnrs unicode and export all of its procedures.
2010-06-19 14:51:04 +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
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
Renamed from module/6/rnrs.scm (Browse further)