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

38 commits

Author SHA1 Message Date
Andy Wingo
075599e5b0 Implement R6RS custom textual ports
* module/ice-9/textual-ports.scm (custom-textual-port-read+flush-input):
(custom-textual-port-write):
(custom-textual-port-seek):
(custom-textual-port-close):
(custom-textual-port-random-access?):
(make-custom-textual-input-port):
(make-custom-textual-output-port):
(make-custom-textual-input/output-port): New procedures.
* doc/ref/api-io.texi (Ports): Update docs.
* doc/ref/r6rs.texi (rnrs io ports): Mention custom textual port
interfaces.
* module/rnrs/io/ports.scm: Re-export custom textual port interfaces
from (ice-9 textual-ports).
* test-suite/tests/r6rs-ports.test: Add minimal tests for textual ports.
2023-06-08 10:21:02 +02:00
Andy Wingo
b2b1666d4c Document call-with-port
* doc/ref/api-io.texi (Ports): Add docs.
* doc/ref/r6rs.texi (rnrs io ports): Remove docs.
2021-01-12 12:21:15 +01:00
Jan Synacek
ab861be9b2 doc: Fix typos in the manual.
* doc/ref/api-control.texi:
* doc/ref/r6rs.texi:
* doc/ref/sxml.texi: Fix typos.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-05-27 22:41:00 +02:00
Andy Wingo
59febb4b2d Fix port-position documentation
* doc/ref/r6rs.texi (rnrs io ports): Update the translation for
  port-position.
2019-11-25 09:47:04 +01:00
Andy Wingo
44ee8c5559 Update documentation for with-exception-handler et al
* doc/ref/api-control.texi (Prompt Primitives): Reference the newer
  exception facilities.
  (Exceptions): Rewrite to use the new exception primitives.
  (Exception Terminology): Remove superfluous section.
  (Exception Objects): New section.
  (Raising and Handling Exceptions): New section.
  (Throw and Catch): New section, coalescing the previous catch,
  with-throw-handler, and throw sections.
  (Exceptions and C): New section, for miscellaneous procedures.
  (Handling Errors): Mention the transitional period regarding exception
  handling.
* doc/ref/api-debug.texi (Catching Exceptions): Rewrite to use newer
  exception facilities.
  (Capturing Stacks): Remove, as it's not really recommendable any
  more.
  (Pre-Unwind Debugging): Rewrite to use the new primitives.
  (Standard Error Handling): Add note about transitional status.
  (Stack Overflow): Reference new exception section.
* doc/ref/api-scheduling.texi (Mutexes and Condition Variables):
  Reference new exception section.
* doc/ref/r6rs.texi (rnrs exceptions, rnrs conditions): Update to
  mention compatibility with SRFI-34/35 and to relate to core
  exceptions.
* doc/ref/srfi-modules.texi (SRFI-34): Document.
2019-11-13 22:33:09 +01:00
Andy Wingo
42c69ae669 Fix doc syntax error
* doc/ref/r6rs.texi (R6RS Incompatibilities): Fix syntax error.
2019-09-27 22:52:57 +02:00
Andy Wingo
714d0b9d9f Better R6RS compatibility
* module/ice-9/boot-9.scm (install-r6rs!): Also enable
  `hungry-eol-escapes'.
* doc/ref/r6rs.texi (R6RS Incompatibilities): Document lack of unicode
  escapes in symbols.
2019-09-27 14:08:02 +02:00
Andy Wingo
afcc22f639 Add --r6rs command-line option
* doc/ref/guile-invoke.texi (Command-line Options): Document --r6rs.
* doc/ref/r6rs.texi (R6RS Incompatibilities): Mention that --r6rs calls
  install-r6rs!.
* module/ice-9/command-line.scm (*usage*, compile-shell-switches):
  Implement --r6rs.
2019-09-25 22:08:12 +02:00
Andy Wingo
0bb980f120 New function: install-r6rs!
* doc/ref/r6rs.texi (R6RS Incompatibilities): Document install-r6rs!.
* module/ice-9/boot-9.scm (install-r6rs!): New function.
2019-09-25 22:06:38 +02:00
Mark H Weaver
2095033b42 Fix documentation of R6RS 'binary-port?' to reflect reality.
* doc/ref/r6rs.texi (rnrs io ports): Improve the descriptions of
'binary-port?' and 'textual-port?'.
* module/rnrs/io/ports.scm (binary-port?, textual-port?): Update the
docstrings.
2019-06-18 03:09:42 -04:00
Andy Wingo
1a1c3bbe59 Implement R6RS custom binary input/output ports
* NEWS: Add new feature.
* doc/ref/r6rs.texi (rnrs io ports):
* doc/ref/api-io.texi (Custom Ports): Document new procedure.
* libguile/r6rs-ports.h:
* libguile/r6rs-ports.c (make_custom_binary_input_output_port)
  (scm_make_custom_binary_input_output_port)
  (custom_binary_input_output_port_random_access_p)
  (initialize_custom_binary_input_output_ports)
  (scm_init_r6rs_ports): Implement custom binary input/output ports.
* module/rnrs/io/ports.scm (rnrs):
* module/ice-9/binary-ports.scm (ice-9): Export
  make-custom-binary-input/output-port.
2016-08-04 22:29:51 +02:00
Andy Wingo
498cd58cb4 Fix R6RS fold-left documentation
* doc/ref/r6rs.texi (rnrs lists): Fix documentation of fold-left.
2016-06-23 21:39:23 +02:00
Andy Wingo
a21f6467ac Big ports documentation update
* doc/ref/api-io.texi: Update to document ports more thoroughly.  Still
  some work needed.

* doc/ref/r6rs.texi: Move ports documentation back to r6rs.texi, now
  that Guile has a more thorough binary/textual I/O story, heavily based
  on R6RS.

* doc/ref/api-control.texi:
* doc/ref/api-data.texi:
* doc/ref/api-options.texi:
* doc/ref/misc-modules.texi:
* doc/ref/posix.texi:
* doc/ref/srfi-modules.texi: Update references.
2016-06-08 10:19:27 +02:00
Mark H Weaver
8acd457958 Document 'equal?' in list of R6RS incompatibilities.
* doc/ref/r6rs.texi (R6RS Incompatibilities): Mention that 'equal?'
  may not terminate when applied to cyclic datums.
2014-02-05 23:25:32 -05:00
Mark H Weaver
71539c1cd3 Cross reference 'SRFI-9 Records' directly instead of 'SRFI-9'.
* doc/ref/api-compound.texi (Record Overview, Records):
  doc/ref/api-modules.texi (Included Guile Modules):
  doc/ref/r6rs.texi (R6RS Records): Cross reference 'SRFI-9 Records'
  directly instead of 'SRFI-9'.
2013-04-04 03:21:40 -04:00
Mike Gran
14ae4725ab Document quit and exit
* doc/ref/posix.texi (Processes): document `quit' and `exit'
* doc/ref/r6rs.texi (rnrs programs): xref exit
2013-03-21 09:20:31 -07:00
Ludovic Courtès
183d2ace57 doc: Fix build with Texinfo 5.0.
* doc/ref/api-control.texi (Handling Errors): Move misplaced description
  for `scm_memory_error' & co.
* doc/ref/r6rs.texi (rnrs base): Change `deffnx' of `let-syntax' and
  `letrec-syntax' to fit on one line.
2013-03-01 17:50:05 +01:00
Ian Price
085552d83d Fix docs for `hashtable-copy'
* doc/ref/r6rs.texi (rnrs hashtables): a true mutable argument means a
  mutable copy.
2012-11-26 01:24:51 +00:00
Bake Timmons
df0a100250 Make notation for Scheme repeated arguments more consistent in manual.
* doc/ref/api-compound.texi
* doc/ref/api-control.texi
* doc/ref/api-data.texi
* doc/ref/api-debug.texi
* doc/ref/api-evaluation.texi
* doc/ref/api-macros.texi
* doc/ref/api-memory.texi
* doc/ref/api-modules.texi
* doc/ref/api-procedures.texi
* doc/ref/api-regex.texi
* doc/ref/api-scheduling.texi
* doc/ref/api-utility.texi
* doc/ref/goops.texi
* doc/ref/match.texi
* doc/ref/misc-modules.texi
* doc/ref/posix.texi
* doc/ref/r6rs.texi
* doc/ref/scheme-using.texi
* doc/ref/srfi-modules.texi
* doc/ref/sxml-match.texi: Make notation for Scheme repeated arguments more
  consistent in manual.
2012-02-04 00:10:13 +01:00
Andy Wingo
9accf3d98f add when, unless
* module/ice-9/boot-9.scm (when, unless): New forms.

* doc/ref/api-control.texi (Conditionals): Add docs.  Rename this
  node from "if cond case".

* doc/ref/r6rs.texi:
* doc/ref/scheme-ideas.texi:
* doc/ref/srfi-modules.texi: Update referrers.
2012-01-20 19:51:45 +01:00
Andreas Rottmann
2252321bb7 Make the R6RS simple I/O library use conditions
* module/rnrs/io/ports.scm (display): Implement as an
  exception-converting wrapper around Guile's core display.
* module/rnrs/io/simple.scm: Don't export Guile's corresponding core
  procedures, but use `(rnrs io ports)' instead.  This way, we get the
  conditions required by R6RS raised.

* doc/ref/r6rs.texi (rnrs io simple): Mention that these procedures are
  supposed to raise R6RS conditions.
2011-05-07 23:48:46 +02:00
Ludovic Courtès
96128014bf Make sure binary ports pass `binary-port?' regardless of the locale.
* libguile/r6rs-ports.c (make_bip, make_cbip, make_bop, make_cbop):
  Set `c_port->encoding' to NULL.

* test-suite/tests/r6rs-ports.test ("7.2.7 Input
  Ports")["bytevector-input-port is binary"]: New test.
  ("7.2.7 Input Ports")["make-custom-binary-input-port"]: Make sure PORT
  passes `binary-port?' and `input-port?'.
  ("8.2.10 Output ports")["bytevector-output-port is binary"]: New test.
  ["make-custom-binary-output"]: Rename to...
  ["make-custom-binary-output-port"]: ... this.

* test-suite/tests/ports.test ("string ports")["read-char, wrong
  encoding, error", "read-char, wrong encoding, escape", "read-char,
  wrong encoding, substitute", "peek-char, wrong encoding, error"]: Use
  `set-port-encoding!' instead of `%default-port-encoding' to set the
  encoding of bytevector input ports.

* test-suite/tests/rdelim.test ("read-line")["decoding error", "decoding
  error, substitute"]: Likewise.

* doc/ref/api-io.texi (R6RS Port Manipulation): Document `binary-port?'
  and `textual-port?'.

* doc/ref/r6rs.texi (R6RS Incompatibilities): Mention the soft
  distinction between textual and binary ports.
2011-04-22 23:58:00 +02:00
Mark H Weaver
882c89636a Fix the R6RS exact-integer-sqrt and import into core guile
* libguile/numbers.c (scm_exact_integer_sqrt): New C procedure to
  compute exact integer square root and remainder.
  (scm_i_exact_integer_sqrt): New Scheme procedure `exact-integer-sqrt'
  from the R6RS, imported into core guile.

* libguile/numbers.h: Add prototypes.

* module/rnrs/base.scm: Remove broken stub implementation, which would
  fail badly when applied to large integers.

* doc/ref/api-data.texi: Add documentation.

* doc/ref/r6rs.texi: Change documentation for `exact-integer-sqrt' to a
  stub that xrefs the core docs, as is done for other operations
  available in core.

* test-suite/tests/numbers.test: Add tests.

* NEWS: Add news entries.
2011-04-09 16:11:49 -04:00
Mark H Weaver
4f1bbedb6d Fix description of the R6RS `finite?' in manual
* doc/ref/r6rs.texi (rnrs base): `(finite? x)' returns true iff x is
  neither infinite nor a NaN.  Previously, it stated that `finite?' was
  the negation of `infinite?', which was incorrect because NaNs are
  neither finite nor infinite.  Combine description of 'nan?' with those
  of `finite?' and `infinite?'.
2011-03-08 17:50:57 -05:00
Andy Wingo
450aee6790 update R6RS incompatibilities
* doc/ref/r6rs.texi (R6RS Incompatibilities): Update.
2011-02-27 13:07:04 +01:00
Ralf Wildenhues
ecb8733562 docs: fix typos in manual, and a couple in code comments.
* doc/ref/api-binding.texi, doc/ref/api-compound.texi,
doc/ref/api-control.texi, doc/ref/api-debug.texi,
doc/ref/api-io.texi, doc/ref/api-macros.texi,
doc/ref/api-procedures.texi, doc/ref/api-scheduling.texi,
doc/ref/api-undocumented.texi, doc/ref/api-utility.texi,
doc/ref/compiler.texi, doc/ref/goops.texi,
doc/ref/libguile-concepts.texi, doc/ref/misc-modules.texi,
doc/ref/posix.texi, doc/ref/r6rs.texi, doc/ref/slib.texi,
doc/ref/srfi-modules.texi, doc/ref/sxml-match.texi,
doc/ref/tools.texi, doc/ref/vm.texi, doc/ref/web.texi,
doc/sources/env.texi, doc/sources/jimb-org.texi,
doc/sources/scheme-concepts.texi, doc/sources/unix.texi,
module/ice-9/optargs.scm: Fix typos.
* doc/r4rs/r5rs.texi: Likewise.  Do not capitalize code symbols
even at the start of a sentence.
* doc/ref/api-data.texi: Likewise.  Also, remove executable bit.
2011-02-09 22:28:49 +00:00
Mark H Weaver
644350c8b1 Update copyright date of manual, and a small fix
* doc/ref/guile.texi: Update copyright date to 2011.

* doc/ref/r6rs.texi (rnrs base): Fix typo: `rem0' -> `div0'.
2011-02-01 21:07:39 +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
Ludovic Courtès
93003b16b0 Assorted `syntax-check' fixes.
* doc/ref/Makefile.am ($(snarf_doc).am): Untabify.

* libguile/eval.c: Remove unnecessary <assert.h> inclusion.

* .x-sc_m4_quote_check: Update.

* libguile/error.c (scm_error_scm): Use `EXIT_FAILURE' instead of 1.
* libguile/init.c (fixconfig, scm_boot_guile): Likewise.
* libguile/null-threads.h (scm_i_pthread_exit): Likewise.
* libguile/script.c (scm_compile_shell_switches): Likewise.
* test-suite/standalone/test-conversion.c: Likewise.
* test-suite/standalone/test-list.c: Likewise.
* test-suite/standalone/test-unwind.c: Likewise.

* libguile/async.c: Remove unnecessary inclusion of <signal.h>.

* NEWS: "filesystem" -> "file system".
* doc/ref/r6rs.texi: Ditto.

* cfg.mk (local-checks-to-skip): New variable.

* .x-sc_m4_quote_check, .x-sc_obsolete_symbols, .x-sc_program_name,
  .x-sc_prohibit_atoi_atof, .x-sc_prohibit_magic_number_exit: New
  files.

* .gitignore: Update.
2010-08-27 18:59:42 +02:00
Andy Wingo
58daadd982 further rnrs incompat note
* doc/ref/r6rs.texi: Note about rnrs io ports.
2010-08-08 14:33:46 +02:00
Andy Wingo
3470a29911 more r6rs incompat
* doc/ref/r6rs.texi (R6RS Incompatibilities): Add section on string
  syntax.
2010-08-08 13:00:57 +02:00
Andy Wingo
08fc523b0e add section on toplevel expansion to r6rs incompatibilities
* doc/ref/r6rs.texi (R6RS Incompatibilities): Add a section about
  toplevel expansion, before taking a look at fixing it...
2010-08-08 12:58:05 +02: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
Neil Jerram
2604f1ad85 Fix TeXing of doc/ref/r6rs.texi
* doc/ref/r6rs.texi (rnrs conditions): Add "{Condition Type}" to
  @deffn line for each condition type.  Add one missing "{Scheme
  Procedure}".
2010-07-04 21:09:02 +01:00
Julian Graham
5b379729bb Edits to R6RS standard libraries documentation proposed by Ludovic Courtès.
* doc/ref/r6rs.texi: Fix erroneous usage of @pxref; add pointers from
  `(rnrs conditions)' and `(rnrs arithmetic bitwise)' to SRFI-35 and
  SRFI-60 sections; remove reference to `fold'.
2010-06-23 23:44:43 -04:00
Julian Graham
ea28e98134 Integrate complete R6RS standard libraries documentation.
* doc/ref/r6rs.texi: Reshuffle Andy Wingo's introductory notes; add more
  detailed @subsubsections for each library.
2010-06-21 23:16:36 -04:00
Andy Wingo
bfccdcd530 add support for variable transformers: settable identifier syntax
* module/ice-9/psyntax.scm (set!): Handle variable transformers; though,
  they cannot produce definitions.
  (make-variable-transformer): New procedure.
  (identifier-syntax): Allow the R6RS form that makes variable
  transformers.

* module/ice-9/psyntax-pp.scm: Regenerated.

* doc/ref/r6rs.texi (R6RS Incompatibilities): Remove letrec* item, and
  add set! restriction.
2010-06-19 12:43:40 +02:00
Andy Wingo
845cbcfeb9 r6rs docs in the manual
* doc/ref/r6rs.texi (R6RS Support): Skeleton of docs on our R6RS
  support.

* doc/ref/guile.texi:
* doc/ref/Makefile.am: Add r6rs.texi.

* doc/ref/intro.texi: Add a link to r6rs.texi.
2010-06-01 14:10:59 +02:00