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

1681 commits

Author SHA1 Message Date
Mark H Weaver
26d148066f Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/deprecated.c
	libguile/deprecated.h
	libguile/filesys.h
	libguile/fluids.c
	libguile/fports.c
	libguile/gc.c
	libguile/guile.c
	libguile/numbers.c
	libguile/objcodes.c
	libguile/r6rs-ports.c
	libguile/smob.c
	libguile/socket.c
	libguile/threads.h
	module/language/scheme/decompile-tree-il.scm
	module/language/tree-il/peval.scm
	test-suite/tests/syncase.test
2013-03-28 05:09:53 -04:00
Mark H Weaver
579127cce4 SRFI-41 stream-null is a Scheme Variable, not a Constant.
Suggested by Ludovic Courtès <ludo@gnu.org>.

* doc/ref/srfi-modules.texi (SRFI-41 Stream Primitives):
  Label 'stream-null' as a Scheme Variable, not a Constant.
2013-03-27 21:11:06 -04:00
Mark H Weaver
80b809f114 Add full documentation for SRFI-41.
* doc/ref/misc-modules.texi (Streams): Add cross-reference to SRFI-41.

* doc/ref/srfi-modules.texi (SRFI-41): Replace stub with full
  documentation.
  (SRFI-41 Stream Fundamentals, SRFI-41 Stream Primitives,
  SRFI-41 Stream Library): New subsubsections.
2013-03-27 13:37:45 -04:00
Chris K. Jester-Young
50d08cd894 Add SRFI-41.
Incorporates suggestions from Mark H Weaver <mhw@netris.org>
and Ian Price <ianprice90@googlemail.com>.

* module/srfi/srfi-41.scm: New file.

* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-41.scm.

* test-suite/tests/srfi-41.test: New file.

* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-41.test.

* doc/ref/srfi-modules.texi (SRFI Support): Add SRFI-41.
  (SRFI-41): New node which refers the reader to
  <http://srfi.schemers.org/srfi-41/srfi-41.html>.
2013-03-27 13:37:45 -04:00
Ludovic Courtès
8a177d316c futures: Limit the number of nested futures on the same stack.
Fixes <http://bugs.gnu.org/13188>.
Reported by Nala Ginrut <nalaginrut@gmail.com>.

* module/ice-9/futures.scm (%nesting-level): Rename to...
  (%nesting-level): ... this.  Default to 0 instead of #f.  Update
  users.
  (%max-nesting-level): New variable.
  (touch): When FUTURE is queued and (%nesting-level) is above
  %MAX-NESTING-LEVEL, abort to %FUTURE-PROMPT.
* test-suite/tests/future.test ("nested futures")["loop"]: Remove
  `compile' call.
* test-suite/tests/threads.test ("par-map")["long list"]: New test.
* doc/ref/api-scheduling.texi (Futures): Add a paragraph about stack
  consumption.
2013-03-27 18:09:49 +01:00
Ludovic Courtès
8cd109bf0a Document `and=>'.
* module/ice-9/boot-9.scm (and=>): Add docstring.
* doc/ref/api-procedures.texi (Higher-Order Functions): Add `and=>'.
2013-03-27 18:09:49 +01:00
Ludovic Courtès
c548da6949 doc: Use a preferred naming convention in SRFI-9 examples.
* doc/ref/api-compound.texi (SRFI-9 Records): Use "Scheme Syntax"
  instead of "library syntax".  Remove `get-' from getter names, and add
  an exclamation mark in setter names.  Change `employee-type' to
  `<employee>'.
2013-03-27 18:09:49 +01:00
Mark H Weaver
41502bd00f Manual: xref SRFI-45 from core Delayed Evaluation section.
* doc/ref/api-evaluation.texi (Delayed Evaluation): Add cross-reference
  to SRFI-45.
2013-03-26 21:25:12 -04:00
Mark H Weaver
d291d7990d SRFI-45: add promise? predicate.
* module/srfi/srfi-45.scm (promise?): Export.

* doc/ref/srfi-modules.texi (SRFI-45): Update docs.

* test-suite/tests/srfi-45.test: Add test.  Add FSF copyright for 2010
  and 2013.  Add missing year to André van Tonder's copyright notice.
2013-03-26 21:22:11 -04:00
Mark H Weaver
65ad02b96d Revert "SRFI-45: Support multiple values; add promise? predicate."
This reverts commit 1d64b4edb9.
2013-03-26 21:16:26 -04:00
Ludovic Courtès
5bb40f9df0 getaddrinfo: Document the missing errno value for EAI_SYSTEM.
In response to <http://bugs.gnu.org/13958>.
Reported by Lluís Batlle i Rossell <viric@viric.name>.

* doc/ref/posix.texi (Network Databases): Document the missing errno
  value for EAI_SYSTEM.
* libguile/net_db.c (scm_getaddrinfo): Likewise.
2013-03-25 22:46:53 +01:00
Ludovic Courtès
fbac7c6113 Add bindings for `sendfile'.
* configure.ac: Check for <sys/sendfile.h> and `sendfile'.
* libguile/filesys.c (scm_sendfile): New function.
* libguile/filesys.h (scm_sendfile): New declaration.
* test-suite/tests/filesys.test ("sendfile"): New test prefix.
* doc/ref/posix.texi (File System): Document `sendfile'.
2013-03-22 22:21:13 +01: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
Mark H Weaver
edb6de0bec Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list.
* module/ice-9/boot-9.scm (%cond-expand-features): Remove redundant list
  of feature identifiers in the comment.  Explain more clearly what
  belongs in this list.  Remove srfi-6.

* module/srfi/srfi-4.scm, module/srfi/srfi-27.scm,
  module/srfi/srfi-31.scm, module/srfi/srfi-38.scm,
  module/srfi/srfi-39.scm, module/srfi/srfi-42.scm,
  module/srfi/srfi-45.scm, module/srfi/srfi-67.scm: Add missing
  'cond-expand-provide'.

* module/srfi/srfi-69.scm: Fix erroneous 'cond-expand-provide'.

* doc/ref/srfi-modules.texi (SRFI-0): Update the list of features in
  Guile core.
2013-03-21 12:50:04 -04:00
Mark H Weaver
8edab37f17 Mention the non-conformance of the core SRFI-6 procedures in the manual.
* doc/ref/srfi-modules.texi (About SRFI Usage): Use SRFI-13 as an
  example of a module which is included in core Guile, instead of
  SRFI-6.

  (SRFI-6): Mention the non-conformance of the core 'open-input-string'
  and 'open-output-string' procedures.  Remove the claim that importing
  this module does nothing.  Recommend that users import the module.
2013-03-21 12:48:03 -04:00
Mark H Weaver
1d64b4edb9 SRFI-45: Support multiple values; add promise? predicate.
* module/srfi/srfi-45.scm (eager): Accept any number of arguments.
  Store the list of arguments in the value record.  Previously, only one
  argument was accepted, and that value was stored in the value record.
  (delay): Support expressions that return any number of arguments.
  (force): Return the list of values stored in the value record.
  (promise?): Export.

* doc/ref/srfi-modules.texi (SRFI-45): Update docs.  Remove typing
  for simplicity in discussing multiple values.

* test-suite/tests/srfi-45.test: Add tests.  Add FSF copyright for 2010
  and 2013.  Add missing year to André van Tonder's copyright notice.
2013-03-19 10:29:44 -04:00
Ludovic Courtès
a9ea4f909b Avoid rebuild of `guile.info' at the user's site.
* configure.ac: Remove `doc/ref/effective-version.texi' from the
  `AC_CONFIG_FILES'.
* doc/ref/Makefile.am ($(srcdir)/effective-version.texi): New target.
2013-03-18 22:30:13 +01:00
Ludovic Courtès
5f24f1b53e Define the new Linux-specific `SO_REUSEPORT'.
* libguile/socket.c (scm_init_socket)[SO_REUSEPORT]: Define
  `SO_REUSEPORT'.
  (scm_setsockopt, scm_getsockopt): Update docstring.
* doc/ref/posix.texi (Network Sockets and Communication): List
  `SO_REUSEPORT'.
2013-03-18 22:30:13 +01:00
Daniel Hartwig
dc87126115 minor tweaks to web documentation
* doc/ref/web.texi: Say `World Wide Web'; the hyphenated form is almost
  never used (c.f. w3.org).

  General predicate arguments are named `obj'.  Fill in arguments
  omitted from some procedure definitions (e.g. `request-method').

  Minor tweaks, such as using en-dash and missing markup as appropriate.
  Wrap very long deffn lines.

* module/web/*.scm: Expand texinfo markup in doc strings.  Synchronize
  with changes in web.texi.
2013-03-16 17:53:53 +08:00
Andy Wingo
912f5f3445 fix doc build
* doc/ref/api-data.texi (Bitwise Operations): Don't use @-commands in
  @math.  Fixes doc build.
* doc/ref/api-macros.texi (Syntax Rules): Fix example result.
2013-03-15 19:22:18 +01:00
Andy Wingo
8ae26afefe add #:resolve-syntax-parameters? kwarg to syntax-local-binding
* doc/ref/api-macros.texi (Syntax Transformer Helpers): Document.

* module/ice-9/psyntax.scm (syntax-local-binding): Add
  #:resolve-syntax-parameters? kwarg.  Fixes bug 10991.
* module/ice-9/psyntax-pp.scm: Regenerate.

* test-suite/tests/syncase.test ("syntax-local-binding"): Add test.
2013-03-13 11:43:35 +01:00
Mark H Weaver
e08a12b535 Add 'round-ash', a rounding arithmetic shift operator
* libguile/numbers.c (left_shift_exact_integer,
  floor_right_shift_exact_integer, round_right_shift_exact_integer): New
  static functions.

  (scm_round_ash): New procedure.

  (scm_ash): Reimplement in terms of 'left_shift_exact_integer' and
  'floor_right_shift_exact_integer'.

* libguile/numbers.h: Add prototype for scm_round_ash.  Rename the
  second argument of 'scm_ash' from 'cnt' to 'count'.

* test-suite/tests/numbers.test (round-ash, ash): Add new unified
  testing framework for 'ash' and 'round-ash'.  Previously, the tests
  for 'ash' were not very comprehensive; for example, they did not
  include a single test where the number to be shifted was a bignum.

* doc/ref/api-data.texi (Bitwise Operations): Add documentation for
  'round-ash'.  Improve documentation for `ash'.
2013-03-12 15:39:20 -04:00
Jason Earl
988ca6b212 add %site-ccache-dir
* libguile/load.h:
* libguile/load.c (scm_sys_site_ccache_dir): New procedure.

* doc/ref/scheme-using.texi (Installing Site Packages):
* doc/ref/api-options.texi (Build Config): Add docs.

Fixes bug 10326.
2013-03-10 23:20:22 +01:00
Jason Earl
a4b4fbbdaa excise use of "iff" in the manual
* doc/ref/api-compound.texi:
* doc/ref/api-control.texi:
* doc/ref/api-data.texi:
* doc/ref/api-macros.texi:
* doc/ref/api-modules.texi:
* doc/ref/api-procedures.texi:
* doc/ref/api-scheduling.texi:
* doc/ref/api-smobs.texi:
* doc/ref/api-undocumented.texi:
* doc/ref/api-utility.texi:
* doc/ref/compiler.texi:
* doc/ref/intro.texi:
* doc/ref/scheme-using.texi:
* doc/ref/sxml.texi:
* doc/ref/web.texi: Change uses of "iff" to "if, otherwise".  Fixes bug
  10302.
2013-03-10 22:29:18 +01:00
Stefan Israelsson Tampe
aab9d46c83 add GUILE_STACK_SIZE environment variable
* libguile/vm.c (initialize_default_stack_size): New helper.
  (scm_bootstrap_vm): Call initialize_default_stack_size.

* doc/ref/guile-invoke.texi (Environment Variables): Add docs.

Based on a patch by Stefan Israelsson Tampe.
2013-03-07 14:25:36 +01:00
Andy Wingo
8d48877d2c ,option evaluates its right-hand-side
* doc/ref/scheme-using.texi (System Commands): Better documentation for
  ,option.

* module/system/repl/command.scm (option): Evaluate the RHS when setting
  an option.  Fixes bug 13076.
2013-03-07 11:29:01 +01:00
Andy Wingo
83dce818ec GUILE_INSTALL_LOCALE=1 during build
* doc/ref/Makefile.am (autoconf-macros.texi):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.scm.gen, ice-9/psyntax-pp.go):
* test-suite/Makefile.am (GUILE_AUTO_COMPILE):
* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
* test-suite/vm/Makefile.am (TESTS_ENVIRONMENT):
* am/guilec (.scm.go): Set GUILE_INSTALL_LOCALE to 1 during the build.
  Fixes bug 12887.
2013-03-07 11:02:33 +01:00
Ludovic Courtès
7f893030ab Install the current locale if GUILE_INSTALL_LOCALE is nonzero.
* libguile/guile.c (get_integer_from_environment)
  (should_install_locale): New functions.
  (main): Add `setlocale' call.

* doc/ref/guile-invoke.texi (Environment Variables): Add documentation.
2013-03-07 10:48:44 +01:00
Mark H Weaver
f57ea23ac8 Fix thread-unsafe lazy initializations.
* libguile/debug.c (scm_local_eval):
  libguile/ports.c (scm_current_warning_port):
  libguile/strports.c (scm_eval_string_in_module): Perform
  lazy-initialization while holding a mutex.  Use SCM_UNDEFINED as the
  uninitialized value.  Use 'scm_c_*_variable'.

* doc/ref/api-modules.texi (Accessing Modules from C): Fix
  'my_eval_string' example to be thread-safe.
2013-03-05 16:04:55 -05:00
Ludovic Courtès
29ace173b1 doc: Rename "Texinfo" node to "Texinfo Processing".
* doc/ref/texinfo.texi (Texinfo): Rename to...
  (Texinfo Processing): ... this.
* doc/ref/guile.texi (Guile Modules): Update menu.
2013-03-04 09:04:16 +01:00
Bake Timmons
994d87be35 Improve keyword notation of Texinfo function definitions.
* doc/ref/api-debug.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-modules.texi:
* doc/ref/compiler.texi:
* doc/ref/web.texi: Make Texinfo function headers more consistent.
  Change lesser used keyword notation to the predominant form.

* doc/ref/api-procedures.texi: Fix an argument name in a header that should
  use repeated argument notation.

* doc/ref/srfi-modules.texi: Update references in Texinfo function
  definition body to match previously updated variable notation in
  definition header.
2013-03-02 20:34:29 +01: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
Mark H Weaver
444b26f739 Revert "random-state-from-platform: simplify pid conditional, and clarify docs."
This reverts commit 08904661a2.
2013-02-25 13:33:14 -05:00
Mark H Weaver
08904661a2 random-state-from-platform: simplify pid conditional, and clarify docs.
* libguile/random.c (random_state_of_last_resort): Simplify optional
  inclusion of PID in the random state.  Clarify in the comments that
  the PID is only included where scm_getpid is present.

* doc/ref/api-data.texi (Random): Clarify that
  'random-state-from-platform' includes the PID in the random state only
  if scm_getpid is present.
2013-02-24 19:57:00 -05:00
Andy Wingo
9b977c836b Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/array-handle.c
	libguile/deprecated.h
	libguile/inline.c
	libguile/inline.h
	module/ice-9/deprecated.scm
	module/language/tree-il/peval.scm
2013-02-18 17:59:38 +01:00
Daniel Llorens
739941679c Array documentation fixes
* libguile/generalized-arrays.c: Fix wording of docstring for array-length.
* doc/ref/api-compund.texi:
  - Document scm_array_type(), scm_array_ref(), array-length,
    scm_array_length(), scm_c_array_length().
  - Fix wording of documentation for array-in-bounds?
2013-02-18 16:57:16 +01:00
Andy Wingo
118ff892be deprecate generalized vectors in favor of arrays
* libguile/generalized-arrays.h:
* libguile/generalized-arrays.c (scm_c_array_length):
  (scm_array_length): New functions.

* module/ice-9/deprecated.scm:
* libguile/generalized-vectors.c:
* libguile/generalized-vectors.h:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_generalized_vector_p)
  (scm_generalized_vector_length, scm_generalized_vector_ref)
  (scm_generalized_vector_set_x, scm_generalized_vector_to_list):
  Deprecate.

* libguile/uniform.c (scm_uniform_vector_to_list): Use
  scm_array_to_list.

* module/ice-9/boot-9.scm (case): Arrays are generalized vectors.

* module/srfi/srfi-4/gnu.scm (define-any->vector): Use the array
  functions instead of the generalized-vector functions.

* test-suite/tests/arrays.test: Remove generalized-vector->list test;
  covered by array->list test.

* test-suite/tests/bitvectors.test:
* test-suite/tests/bytevectors.test:
* test-suite/tests/srfi-4.test: Adapt to test using array interfaces
  instead of generalized-vector interfaces.

* doc/ref/api-compound.texi: Remove generalized vector docs.
* doc/ref/api-data.texi:
* doc/ref/srfi-modules.texi: Adapt.
2013-02-18 16:57:15 +01:00
Daniel Hartwig
3330f00f54 add hash-count for native tables
* libguile/hashtab.c (scm_hash_count): New function.  Count the number
  of elements in a hash table.

* doc/ref/api-compound.texi (Hash Tables): Update examples and
  reference.

* test-suite/tests/hash.test (hash-count): New test.
2013-02-18 10:21:43 +08:00
Daniel Hartwig
5ad85ba15f update old references in FFI doc
* doc/ref/api-foreign.texi (Foreign Types): Replace references to the
  old foreign->bytevector and bytevector->foreign with the new procedure
  names using pointer.
2013-02-14 10:45:27 +01:00
Mark H Weaver
3a3bea729f Add foreign types: ssize_t and ptrdiff_t.
* libguile/foreign.c (sym_ssize_t, sym_ptrdiff_t): New symbols.
  (scm_init_foreign): Add bindings for ssize_t and ptrdiff_t.

* module/system/foreign.scm: Export ssize_t and ptrdiff_t.

* doc/ref/api-foreign.texi (Foreign Types): Add docs.
2013-02-02 04:13:44 -05:00
Mark H Weaver
7facc08a80 Add scm_from_ptrdiff_t and scm_to_ptrdiff_t.
* libguile/numbers.h (scm_from_ptrdiff_t, scm_to_ptrdiff_t):
  New macros (function aliases).

* doc/ref/api-data.texi: Add docs.
2013-02-02 04:13:37 -05:00
Andy Wingo
180ac9d7b0 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	module/language/bytecode/spec.scm
	module/language/tree-il/spec.scm
2013-01-31 11:52:42 +01:00
Andy Wingo
e10c250928 add #:doctype-handler to xml->sxml
* module/sxml/simple.scm (read-internal-doctype-as-string): New helper.
  (xml->sxml): Add #:doctype-handler argument.

* doc/ref/sxml.texi (Reading and Writing XML): Document
  #:doctype-handler.  Fix some other examples, and fix the default value
  of #:declare-namespaces?.

* test-suite/tests/sxml.simple.test: Add all tests from the manual
  here.
2013-01-30 15:29:18 +01:00
Andy Wingo
a14b6e1825 xml->sxml argument can be a port or a string
* module/sxml/simple.scm (xml->sxml): Allow the optional arg to be a
  port or a string.
* doc/ref/sxml.texi (Reading and Writing XML): Update docs.
2013-01-28 12:01:16 +01:00
Andy Wingo
1488753a66 make (sxml simple)'s xml->sxml more capable
* module/sxml/simple.scm (xml->sxml): Add #:namespaces,
  #:declare-namespaces?, #:entities, #:default-entity-handler, and
  #:trim-whitespace? arguments.

* doc/ref/sxml.texi (Reading and Writing XML): Document the new
  options.
2013-01-28 11:54:11 +01:00
Andy Wingo
3e31e75a46 begin rewriting SXML docs
* doc/ref/sxml.texi (SXML): Reorder and begin rewriting.  Fix formatting
  throughout, provide a new introduction, and the beginning of proper
  SSAX documentation.

* doc/ref/sxml-match.texi:
* doc/ref/texinfo.texi:
* doc/ref/web.texi: Update references to new node names.
2013-01-28 10:52:44 +01:00
Mark H Weaver
b34e25359a Add 'for-humans?' flag to <language> specifications.
* module/system/base/language.scm (<language>): Add 'for-humans?'
  field, and export new 'language-for-humans?' predicate.

* doc/ref/compiler.texi (Compiler Tower): Document.

* module/language/assembly/spec.scm, module/language/bytecode/spec.scm,
  module/language/glil/spec.scm, module/language/objcode/spec.scm,
  module/language/tree-il/spec.scm, module/language/value/spec.scm:
  Mark these languages as 'for-humans?'.
2013-01-27 10:16:40 -05:00
Andy Wingo
747bd5347d merge stable-2.0
There are some bugs with command-line handling that will be sorted out
with the next commit.
2013-01-23 16:12:08 +01:00
Andy Wingo
8cdb03c23e fix dynamic-call doc
* doc/ref/api-foreign.texi (Foreign Functions): Fix doc: interrupts are
  not deferred in a dynamic-call.
2013-01-23 09:38:13 +01:00
Andy Wingo
5745de9172 current-language is a parameter in boot-9
* module/ice-9/boot-9.scm (current-language): New parameter.

* module/system/base/language.scm (*current-language*): Pull fluid from
  parameter.
  (current-language): Now a re-exported parameter.

* doc/ref/compiler.texi: Update reference from *current-language* fluid
  to current-language parameter.

* module/system/base/compile.scm (compile-and-load):
* module/ice-9/top-repl.scm (top-repl): Default to the current language,
  not to Scheme.

* module/ice-9/eval-string.scm:
* module/system/base/language.scm:
* module/system/repl/command.scm:
* module/system/repl/repl.scm: Update to use current-language parameter
  and parameterize.
2013-01-22 15:38:04 +01:00