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

2191 commits

Author SHA1 Message Date
Mark H Weaver
654b2823be Improve discussion of exactness propagation in manual
* doc/ref/api-data.texi (Exact and Inexact Numbers): Improve the
  discussion of exactness propagation.  Mention that there are
  exceptions to the rule that calculations involving inexact numbers
  must product an inexact result.
2011-02-01 21:14:18 +01: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
ac6ce16bc9 Rename {euclidean,centered}_quo_rem to {euclidean,centered}_divide
* libguile/numbers.c (euclidean_quo_rem): Rename to euclidean_divide.
  (centered_quo_rem): Rename to {euclidean,centered}_divide.

* libguile/numbers.h: Rename euclidean_quo_rem to euclidean_divide and
  centered_quo_rem to centered_divide.

* doc/ref/api-data.texi: Rename euclidean_quo_rem to euclidean_divide and
  centered_quo_rem to centered_divide.
2011-01-31 20:22:42 +01:00
Ludovic Courtès
6e0975603e Add `pointer?'.
* libguile/foreign.c (scm_pointer_p): New function.
* libguile/foreign.h (scm_pointer_p): New declaration.
* module/system/foreign.scm: Export `pointer?'.

* test-suite/tests/foreign.test ("null pointer")["pointer?"]: New
  test.
  ("make-pointer")["pointer?"]: New test.

* doc/ref/api-foreign.texi (Foreign Variables): Document `pointer?'.
2011-01-30 23:29:30 +01:00
Ludovic Courtès
1f4f7674bc Add `define-wrapped-pointer-type'.
* module/system/foreign.scm (define-wrapped-pointer-type): New macro.

* doc/ref/api-foreign.texi (Foreign Types): Mention the `*' symbol.
  (Void Pointers and Byte Access): Document `define-wrapped-pointer-type'.

* test-suite/tests/foreign.test ("define-wrapped-pointer-type"): New
  test prefix.
2011-01-30 23:29:29 +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
c960e55600 Infinities and NaNs are no longer rational
* libguile/numbers.c (scm_rational_p): Return #f for infinities and
  NaNs, per R6RS.  Previously it returned #t for real infinities
  and NaNs.  They are still considered real by scm_real `real?'
  however, per R6RS.  Also simplify the code.

  (scm_real_p): New implementation to reflect the fact that the
  rationals and reals are no longer the same set.  Previously it just
  called scm_rational_p.

  (scm_integer_p): Simplify the code.

* test-suite/tests/numbers.test: Add test cases for `rational?'
  and `real?' applied to infinities and NaNs.

* doc/ref/api-data.texi (Real and Rational Numbers): Update docs to
  reflect the fact that infinities and NaNs are no longer rational, and
  that `real?'  no longer implies `rational?'.  Improve discussion of
  infinities and NaNs.

* NEWS: Add NEWS entries, and combine with an earlier entry about
  infinities no longer being integers.
2011-01-30 13:08:53 +01:00
Ludovic Courtès
41d82ac990 Don't remove `standard-library.texi' upon "make clean".
* doc/ref/Makefile.am (CLEANFILES): Rename to...
  (DISTCLEANFILES): ... this.  So that "make clean" doesn't remove
  `standard-library.texi'.  Reported by Hans Åberg <haberg-1@telia.com>.
2011-01-29 23:31:38 +01:00
Ludovic Courtès
d21a1dc841 Have recv!', send', etc. accept a bytevector.
* libguile/socket.c (scm_recv, scm_send, scm_recvfrom, scm_sendto):
  Expect the buffer to be a bytevector.  Move the string-handling
  code under `#if SCM_ENABLE_DEPRECATED == 1' and issue a deprecation
  warning.

* test-suite/tests/socket.test ("AF_UNIX/SOCK_DGRAM")["sendto",
  "sendto/sockaddr"]: Adjust accordingly.

* doc/ref/posix.texi (Network Sockets and Communication): Update
  documentation of `recv!', `send', `recvfrom!', and `sendto'.
2011-01-29 21:36:59 +01:00
Andy Wingo
043bca0326 update api-evaluation.texi
* doc/ref/api-evaluation.texi (Compilation): Update compile-file and
  compiled-file-name docs.
2011-01-28 17:16:22 +01:00
Andy Wingo
10391e06e0 domain of inf?, finite?, nan? is the real numbers
* libguile/numbers.c (scm_inf_p, scm_finite_p, scm_nan_p): The domain of
  these functions is the real numbers.  Error on other input.

* doc/ref/api-data.texi (Reals and Rationals): Update the documentation
  accordingly.

* test-suite/tests/numbers.test ("finite?", "inf?"): Update tests.
2011-01-28 13:43:37 +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
9fd01bce22 fix format ~f documentation for width combined with overflowchar
* doc/ref/misc-modules.texi (Formatted Output): Adapt ~f documentation
  to indicate that the output will always have a decimal point.  Thanks
  to Fu-gangqiang for the report.

* THANKS: Update.
2011-01-26 20:13:31 +01:00
Julian Graham
c5fc8f8c56 Additional documentation for symbol manipulation functions.
* doc/ref/api-data.texi (Symbol Primitives): Document `symbol',
  `list->symbol', and `symbol-append'.
2011-01-26 03:32:48 -05:00
Ludovic Courtès
647dc1ac23 Add `scm_{to,from}_utf32_string'.
* libguile/strings.c (scm_from_utf32_string, scm_from_utf32_stringn,
  scm_to_utf32_string, scm_to_utf32_stringn): New functions.

* libguile/strings.h (scm_from_utf32_string, scm_from_utf32_stringn,
  scm_to_utf32_string, scm_to_utf32_stringn): New declarations.

* doc/ref/api-data.texi (Conversion to/from C): Document
  `scm_{to,from}_{utf8,utf32}_stringn'.
2011-01-26 00:29:50 +01:00
Ludovic Courtès
eda0622095 Choose the input source file encoding in a locale-independent way.
This is so that compiling the same code on environments with different
locale settings yields the same result.

* module/system/base/compile.scm (compile-file): When ENC if #f, default
  to "UTF-8" instead of `(fluid-ref %default-port-encoding)'.

* doc/ref/api-evaluation.texi (Compilation): Document the default output
  file name and default source file encoding for `compile-file' and
  `guile-tools compile'.
2011-01-24 21:44:44 +01:00
Andy Wingo
8e43ed5d0b infinities are no longer integers
* libguile/numbers.c (scm_is_integer): Infinities are not integers, per
  the R6RS.
  (scm_even_p, scm_odd_p): Passing an infinity to even? or odd? is an
  error.

* test-suite/tests/numbers.test ("integer?"): Adapt test.
  ("expt"): Add tests for +inf.0 and -inf.0 exponents.

* NEWS: Add NEWS entries.
2011-01-23 00:06:24 +01:00
Andy Wingo
0715410946 web.texi fix
* doc/ref/web.texi (HTTP Headers): Fix transfer-encoding example.
2011-01-22 19:56:23 +01:00
Andy Wingo
c869f0c157 document hungry-eol-escapes
* doc/ref/api-data.texi (String Syntax): Document hungry-eol-escapes.
* doc/ref/api-evaluation.texi (Scheme Read):
* doc/ref/api-options.texi (Runtime Options): Update read-options 'help
  output.
2011-01-21 09:24:36 +01:00
Neil Jerram
91a60e5701 Document missing Guile command line options
Thanks to Mark Harig for pointing this out and suggesting the text.

* doc/ref/scheme-scripts.texi (Invoking Guile): Mention --autocompile
  and --no-autocompile.
2011-01-15 20:57:01 +00:00
Neil Jerram
0b452f2c53 Confront the MOP
* doc/ref/goops.texi (The Metaobject Protocol): Bring forward to
  before `Class Options', and add intro text to explain why.  All of
  the sections now remaining are ones where the MOP is more likely to
  be relevant than not.
2011-01-14 21:53:37 +00:00
Neil Jerram
12fe9fcf51 Move GOOPS Error Handling' to after Introspection'
* doc/ref/goops.texi (GOOPS Error Handling): Move to just after
  `Introspection'.
2011-01-14 21:23:54 +00:00
Neil Jerram
9320479a18 Move Handling Slot Access Errors' inside Accessing Slots'
* doc/ref/goops.texi (Accessing Slots): Move `Handling Slot Access
  Errors' here; update relevant references.
2011-01-14 21:19:51 +00:00
Neil Jerram
2cb8cf04b9 Merge small sections into `GOOPS Object Miscellany'
* doc/ref/goops.texi (GOOPS Object Miscellany): New section, combining
  previous `Object Comparison', `Cloning Objects' and `Write and
  Display'.  Replace `Object Comparison' text with something that
  makes sense.  Add a snippet to the end of the write/display section.
2011-01-14 20:34:41 +00:00
Neil Jerram
5f9b75a355 Remove content-free `Generic Functions and Accessors'
* doc/ref/goops.texi (GOOPS): Remove `Generic Functions and
  Accessors'.  There was nothing here that wasn't better covered
  elsewhere.
2011-01-14 20:10:33 +00:00
Neil Jerram
3617da95ab Move Accessing Slots' inside Introspection'.
* doc/ref/goops.texi (Introspection): Move `Accessing Slots' into
  here, and flatten it, except for `Handling Slot Access Errors'.
  (GOOPS Error Handling): Move `Handling Slot Access Errors' here.
2011-01-14 20:06:34 +00:00
Neil Jerram
c7b154588b Reorder `Introspection'
* doc/ref/goops.texi (Instances): Move `Instances' before `Slots', as
  it feels more important.
2011-01-14 20:03:34 +00:00
Neil Jerram
dc08a490e3 Edit `Introspection'
* doc/ref/goops.texi (Introspection): Make a bit snappier.
  (Classes): Add intro.  Remove "the" and "metaobject" everywhere.
  Remove `class-environment', since I don't know what it's useful for.
  (Instances): Remove implementation notes.
  (Built-in classes): Merge with `Instances'.  Reorder text points.
  (Generic Functions): Add intro.  Remove "the" and "metaobject"
  everywhere.
  (Generic Function Methods): Merge with `Generic Functions'.
2011-01-14 19:45:38 +00:00
Neil Jerram
62d7cba3d5 Move `Introspection' earlier
* doc/ref/goops.texi (Introspection): Move to after `Generic Functions
  and Methods'.  The idea is to have all of that sections that make
  sense without needing to understand the MOP, before sections that
  really depend on the MOP.
2011-01-14 19:08:46 +00:00
Neil Jerram
68f4fee187 Improve doc on generic functions and inheritance
* doc/ref/goops.texi (Methods and Generic Functions): More explanation
  of generic function invocation.  Created (or moved) subsections here
  to cover material on the following that was previously spread elsewhere:
  accessors; extending primitives; merging generics; generic function
  examples; handling invocation errors.  Edited for clarity throughout.
  (Generic functions and methods, Example): Nodes deleted, with their
  material incorporated above.
  (Class Precedence List): Edited to improve clarity.
  (Sorting Methods): New subsection.
2011-01-12 23:42:40 +00:00
Andy Wingo
2e6f5ea4cd web.texi defun -> deffn
* doc/ref/web.texi (URIs): Change instances of @defun to @deffn with
  {Scheme Procedure}.
2011-01-10 22:44:41 -08:00
Andy Wingo
f4ec6877bb more web.texi foo
* doc/ref/web.texi (Web Server, Web Examples): Update.
2011-01-10 22:44:41 -08:00
Andy Wingo
de54fb6d5e update web.text documentation for requests and responses
* doc/ref/web.texi (Requests, Responses): Update, and add a note on
  character encodings.
2011-01-10 22:44:41 -08:00
Andy Wingo
ff8339db69 update web.texi for (web http) changes
* doc/ref/web.texi (HTTP Headers): Update to reflect current code, and
  to reformat. Not sure if it's an improvement...
2011-01-10 09:32:26 -08:00
Andy Wingo
32de1aa783 update (web http) docs
* doc/ref/web.texi (HTTP): Update docs to correspond with current code.
2011-01-08 15:20:28 -08:00
Andy Wingo
58baff08bc revert unfinished web.texi changes
These were prematurely committed in
17072fd2c6.
2011-01-07 09:31:36 -08:00
Andy Wingo
17072fd2c6 lookup_interned_symbol uses get_handle_by_hash
* libguile/symbols.c (lookup_interned_symbol): Change to use
  scm_hash_fn_get_handle_by_hash.
2011-01-07 09:18:37 -08:00
Andy Wingo
929ccf48fc read-header returns EOF at end, update (web http) docs
* doc/ref/web.texi (HTTP): Add an example for declaring a header, and
  adapt to read-header change.

* module/web/http.scm (read-header): Return EOF for both values if there
  are no more headers, instead of #f.
  (read-headers): Adapt.
2011-01-07 09:18:36 -08:00
Andy Wingo
569269b4b2 update URI documentation
* doc/ref/web.texi (Types and the Web): Fix spacing.
  (URIs): Give default values, and clarify a number of procedure docs.
  Update "encoding" name, and string->uri name.
2011-01-07 09:18:36 -08:00
Andy Wingo
b3f9444892 clarify uri fragment discussion
* doc/ref/web.texi (URIs): Clarify the discussion of URI fragments.
2011-01-07 09:18:36 -08:00
Andy Wingo
d75a81b128 rewrite web.texi intro
* doc/ref/web.texi (Web): Rewrite the intro.
  (Types and the Web): New subsection, a mini-rant.
2011-01-07 09:18:36 -08:00
Ludovic Courtès
66d8613108 Change getaddrinfo' test to handle the GNU-specific EAI_NODATA'.
* doc/ref/posix.texi (Network Databases): Mention `EAI_NODATA'.

* libguile/net_db.c (scm_getaddrinfo): Likewise for the docstring.

* test-suite/tests/net-db.test ("getaddrinfo")["no name"]: Handle
  `EAI_NODATA'.
2011-01-05 22:17:26 +01:00
Ludovic Courtès
9dfcd9e2d6 Document `scm_misc_error' (bug #31969).
* doc/ref/api-control.texi (Handling Errors): Add `scm_misc_error'.
  Suggested by Bake Timmons <b3timmons@speedymail.org> (bug #31969).
2011-01-04 18:29:55 +01:00
Ludovic Courtès
bf7c2e964e Improve doc of string-index', string-index-right', and `string-rindex'.
Suggested by Noah Lavine <noah.b.lavine@gmail.com>.

* doc/ref/api-data.texi (String Searching): Mention the return value of
  `string-index', `string-index-right', and `string-rindex' when no
  match is found.

* libguile/srfi-13.c (scm_string_index, scm_string_index_right,
  scm_string_rindex): Adjust docstring accordingly.
2011-01-04 18:08:58 +01:00
Neil Jerram
03f6e5ed4c Manual typo fix
* doc/ref/api-overview.texi (API Overview): bot -> but
2010-12-23 12:17:26 +00:00
Ludovic Courtès
3e0e4f1d87 Clarify doc regarding threading of par-map' and par-for-each'.
* doc/ref/api-scheduling.texi (Parallel Forms): Refine wording for
  `par-map' and `par-for-each'.
2010-12-17 21:55:56 +01:00
Andy Wingo
863f11969d add www-commit rule in doc/ref
* doc/ref/Makefile.am (www-commit): Add rule to update docs on web site.
2010-12-17 16:41:58 +01:00
Andy Wingo
cdab9fc625 add ,reload meta-command and document it and reload-module
* module/ice-9/boot-9.scm (reload-module): Add docstring.
* module/system/repl/command.scm (reload): New meta-command.

* doc/ref/scheme-using.texi (Module Commands): Document the ,reload
  meta-command.
* doc/ref/api-modules.texi (Module System Reflection): Document
  reload-module.
2010-12-17 13:27:43 +01:00
Andy Wingo
626e36e5cb document variable-unset!
* doc/ref/api-modules.texi (Variables): Document variable-unset!.

* NEWS: Update.
2010-12-17 13:16:36 +01:00
Andy Wingo
d09c07fb10 document make-unbound-fluid et al
* doc/ref/api-scheduling.texi (Fluids and Dynamic States): Document the
  new fluid routines.

* NEWS: Update.
2010-12-17 13:14:13 +01:00