summaryrefslogtreecommitdiff
path: root/module/rnrs.scm
AgeCommit message (Collapse)AuthorFilesLines
2019-09-12Define top-level bindings for aux syntax: else, =>, _, ...Andy Wingo1-2/+2
* 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.
2016-06-21Add R6RS bytevector->string, string->bytevectorAndy Wingo1-0/+1
* 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-21Export &i/o-decoding, &i/o-encoding from (rnrs)Andy Wingo1-1/+6
* 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-21Implement R6RS output-port-buffer-modeAndy Wingo1-1/+1
* 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.
2012-11-12Add missing R6RS `open-file-input/output-port' procedureAndreas Rottmann1-1/+1
* 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'.
2011-03-13Enhance transcoder-related functionality of `(rnrs io ports)'Andreas Rottmann1-2/+4
* 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-13Add `get-string-n' and `get-string-n!' for R6RS portsAndreas Rottmann1-1/+2
* 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-01-21implement port-eof?Andy Wingo1-2/+3
* 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.
2010-11-24Work towards a more complete implementation of `(rnrs io ports)'Andreas Rottmann1-2/+18
* 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-24Reorganize the R6RS I/O condition typesAndreas Rottmann1-39/+1
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-17Add exports for missing functions from `(rnrs base)'.Julian Graham1-8/+8
* 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-09-02back-compat in (rnrs) for deprecated modules-in-value-namespaceAndy Wingo1-5/+14
* module/rnrs.scm (rnrs): Work around some unavoidable (I think) behavior when back-compatible unified namespaces are enabled; see comments in source.
2010-08-06letrec* in docs, and some r6rs fixesAndy Wingo1-1/+1
* 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-06-21fix rnrs duplicate bindings warningsAndy Wingo1-1/+41
* module/rnrs.scm: Fix i/o duplicate bindings warnings by excluding some bindings.
2010-06-19add rnrs unicode to the compound rnrs moduleAndreas Rottmann1-2/+14
* module/rnrs.scm: import rnrs unicode and export all of its procedures.
2010-06-18add open-string-{input,output}-port to rnrs io portsAndy Wingo1-0/+1
* 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-16remove encoding of versions into the file system (for now?)Andy Wingo1-0/+239
* 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.