bpt/guile.git
11 years agoUpdate to gnulib 0.0.7865-a828.
Andy Wingo [Mon, 18 Feb 2013 17:48:48 +0000 (18:48 +0100)]
Update to gnulib 0.0.7865-a828.

11 years agoArray documentation fixes
Daniel Llorens [Wed, 23 Jan 2013 08:59:58 +0000 (09:59 +0100)]
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?

11 years agodeprecate generalized vectors in favor of arrays
Andy Wingo [Mon, 21 Jan 2013 16:04:09 +0000 (17:04 +0100)]
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.

11 years agooptimize access to arrays of rank 1 or 2
Andy Wingo [Mon, 18 Feb 2013 15:38:24 +0000 (16:38 +0100)]
optimize access to arrays of rank 1 or 2

* libguile/array-handle.c (scm_array_handle_pos_1):
  (scm_array_handle_pos_2): New functions.

* libguile/generalized-arrays.c (scm_c_array_ref_1, scm_c_array_ref_2):
  (scm_c_array_set_1_x, scm_c_array_set_2_x): New functions.
  (scm_i_array_ref, scm_i_array_set_x): New subr bindings for array-ref
  and array-set! that avoid consing for arrays of rank 1 or 2.

* test-suite/tests/arrays.test ("array-set!"): Fix expected exception
  for wrong number of indices.

11 years agoarray handle inline functions defined in array-handle.h.
Andy Wingo [Mon, 18 Feb 2013 11:46:00 +0000 (12:46 +0100)]
array handle inline functions defined in array-handle.h.

* libguile/inline.h:
* libguile/array-handle.h (scm_array_handle_ref):
  (scm_array_handle_set): Move definitions here from inline.h.

* libguile/inline.c: Include array-handle.h.

11 years agoadd hash-count for native tables
Daniel Hartwig [Sun, 17 Feb 2013 08:38:31 +0000 (16:38 +0800)]
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.

11 years agoFix `getgroups' for when zero supplementary group IDs exist.
Ludovic Courtès [Sat, 16 Feb 2013 17:40:39 +0000 (18:40 +0100)]
Fix `getgroups' for when zero supplementary group IDs exist.

* libguile/posix.c (scm_getgroups): Return the empty vector when NGROUPS
  is zero.  Reported by Mike Gran <spk121@yahoo.com>.

11 years agolocal rewrite for apply to a let-bound rest list
Andy Wingo [Fri, 15 Feb 2013 14:20:40 +0000 (15:20 +0100)]
local rewrite for apply to a let-bound rest list

* module/language/tree-il/peval.scm (peval): Add a special-case inlining
  pattern for apply to a let-bound rest arg that preserves effect
  ordering.

* test-suite/tests/peval.test ("partial evaluation"): Add a test, and
  update an older test with a better result.

11 years agoinline call-with-values consumers with optional and/or rest args
Andy Wingo [Fri, 15 Feb 2013 13:21:21 +0000 (14:21 +0100)]
inline call-with-values consumers with optional and/or rest args

* module/language/tree-il/peval.scm (peval): Inline call-with-values
  whose consumers have optional and rest arguments.

* test-suite/tests/peval.test ("partial evaluation"): Add test.

11 years agomore rest argument inlining improvements
Andy Wingo [Fri, 15 Feb 2013 13:15:15 +0000 (14:15 +0100)]
more rest argument inlining improvements

* module/language/tree-il/peval.scm (peval): Correct comment on
  find-definition, and allow a find-definition to fall back on a source
  expression.  Avoid copying non-constant expressions.

* test-suite/tests/peval.test ("partial evaluation"): Add a test that
  inlining rest arguments works with complicated argument expressions,
  and a test that order of effects in rest args is preserved.

11 years agobetter inlining of `apply' with rest arguments
Andy Wingo [Fri, 15 Feb 2013 11:11:29 +0000 (12:11 +0100)]
better inlining of `apply' with rest arguments

* module/language/tree-il/peval.scm (peval): Move up the find-definition
  helper.  Use it to speculatively destructure conses and lists into the
  tail position of an `apply' form.

* test-suite/tests/peval.test ("partial evaluation"): Add tests.

11 years agoprocedures with rest arguments can get inlined
Andy Wingo [Fri, 15 Feb 2013 10:19:10 +0000 (11:19 +0100)]
procedures with rest arguments can get inlined

* module/language/tree-il/peval.scm (peval): Allow inlining of
  procedures with rest arguments.

* test-suite/tests/peval.test ("partial evaluation"): Add a test.

11 years agopeval can inline let-bound lambdas
Andy Wingo [Thu, 14 Feb 2013 16:33:40 +0000 (17:33 +0100)]
peval can inline let-bound lambdas

* module/language/tree-il/peval.scm (peval): Better inlining of
  complicated operators.

* test-suite/tests/peval.test ("partial evaluation"): Add a couple
  tests.

11 years agoupdate old references in FFI doc
Daniel Hartwig [Thu, 14 Feb 2013 03:23:51 +0000 (11:23 +0800)]
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.

11 years agoallow (define-macro name (lambda ...))
Andy Wingo [Tue, 12 Feb 2013 08:40:55 +0000 (09:40 +0100)]
allow (define-macro name (lambda ...))

* module/ice-9/boot-9.scm (define-macro): Allow define-macro NAME
  LAMBDA.  A bugfix.  Thanks to Akop Pogosian.

11 years ago(texinfo): add a command-spec for @math{}.
Andy Wingo [Sat, 9 Feb 2013 17:19:28 +0000 (18:19 +0100)]
(texinfo): add a command-spec for @math{}.

* module/texinfo.scm (texi-command-specs): Add `math' as inline-text.

11 years ago(texinfo docbook): informaltable is a block element.
Andy Wingo [Sat, 9 Feb 2013 17:19:06 +0000 (18:19 +0100)]
(texinfo docbook): informaltable is a block element.

* module/texinfo/docbook.scm (*sdocbook-block-commands*): informaltable
  is a block element.

11 years ago(texinfo plain-text): Pass @math{} through as-is.
Andy Wingo [Sat, 9 Feb 2013 17:18:28 +0000 (18:18 +0100)]
(texinfo plain-text): Pass @math{} through as-is.

* module/texinfo/plain-text.scm (tag-handlers): Pass `math' through
  as-is.

11 years ago(texinfo serialize): don't break words when wrapping
Andy Wingo [Sat, 9 Feb 2013 17:17:48 +0000 (18:17 +0100)]
(texinfo serialize): don't break words when wrapping

* module/texinfo/serialize.scm (wrap): Don't break long words by
  default; that could break @-commands.

11 years agoAdd copyright notice to gen-scmconfig.c.
Mark H Weaver [Sat, 2 Feb 2013 13:55:04 +0000 (08:55 -0500)]
Add copyright notice to gen-scmconfig.c.

* libguile/gen-scmconfig.c: Add copyright notice.

11 years agoAdd foreign types: ssize_t and ptrdiff_t.
Mark H Weaver [Sat, 2 Feb 2013 09:04:49 +0000 (04:04 -0500)]
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.

11 years agoAdd scm_from_ptrdiff_t and scm_to_ptrdiff_t.
Mark H Weaver [Sat, 2 Feb 2013 09:02:24 +0000 (04:02 -0500)]
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.

11 years agoFix typo in comment generated by gen-scmconfig.c.
Mark H Weaver [Sat, 2 Feb 2013 08:57:17 +0000 (03:57 -0500)]
Fix typo in comment generated by gen-scmconfig.c.

* libguile/gen-scmconfig.c (main): Fix typo in generated comment.

11 years agoguild: Gracefully handle failures to install the locale.
Ludovic Courtès [Fri, 1 Feb 2013 17:19:27 +0000 (18:19 +0100)]
guild: Gracefully handle failures to install the locale.

* meta/guild.in (main): Catch `system-error' when calling `setlocale',
  and gracefully handle any error.

11 years agoSkip FFI tests that rely on `-export-dynamic' behavior when not available.
Ludovic Courtès [Fri, 1 Feb 2013 17:17:09 +0000 (18:17 +0100)]
Skip FFI tests that rely on `-export-dynamic' behavior when not available.

* test-suite/tests/foreign.test ("make-pointer")["equal? modulo
  finalizer", "equal? modulo finalizer (set-pointer-finalizer!)"]: Skip
  when `scm_is_pair' cannot be found, as is the case on Cygwin.
  Reported by "objc" <objcjohn@hotmail.com>.

11 years agoDo not defer expansion of internal define-syntax forms.
Mark H Weaver [Wed, 23 Jan 2013 22:49:38 +0000 (17:49 -0500)]
Do not defer expansion of internal define-syntax forms.

* module/ice-9/psyntax.scm (expand-body): As required by R6RS, evaluate
  the right-hand-sides of internal 'define-syntax' forms and add their
  transformers to the compile-time environment immediately, so that the
  newly-defined keywords may be used in definition context within the
  same lexical contour.  Fixes #13509.

11 years agoBump copyright year to 2013 in REPL greeting.
Mark H Weaver [Thu, 31 Jan 2013 05:32:57 +0000 (00:32 -0500)]
Bump copyright year to 2013 in REPL greeting.

* module/system/repl/common.scm: Add not only 2013, but also 2012 to the
  copyright notice at the top of the file, since the file was changed in
  2012.
  (*version*): Bump copyright year to 2013 in REPL greeting.

11 years agoRevert "detect and consume byte-order marks for textual ports"
Andy Wingo [Wed, 30 Jan 2013 14:30:31 +0000 (15:30 +0100)]
Revert "detect and consume byte-order marks for textual ports"

This reverts commit b2cb557d75e4daf8c7c8cd43313f4cc51d9a3f1b, which was
pushed accidentally.

11 years agoadd #:doctype-handler to xml->sxml
Andy Wingo [Wed, 30 Jan 2013 14:29:18 +0000 (15:29 +0100)]
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.

11 years agoquick fix to ssax.scm
Andy Wingo [Wed, 30 Jan 2013 12:55:59 +0000 (13:55 +0100)]
quick fix to ssax.scm

* module/sxml/ssax.scm: Fix previous commit.

11 years agofix ssax:warn to work as intended
Andy Wingo [Wed, 30 Jan 2013 12:52:47 +0000 (13:52 +0100)]
fix ssax:warn to work as intended

* module/sxml/ssax.scm (ssax:warn): Fix to make more sense.

11 years agodetect and consume byte-order marks for textual ports
Andy Wingo [Wed, 30 Jan 2013 09:17:25 +0000 (10:17 +0100)]
detect and consume byte-order marks for textual ports

* libguile/ports.h:
* libguile/ports.c (scm_consume_byte_order_mark): New procedure.

* libguile/fports.c (scm_open_file): Call consume-byte-order-mark if we
  are opening a file in "r" mode.

* libguile/read.c (scm_i_scan_for_encoding): Don't do anything about
  byte-order marks.

* libguile/load.c (scm_primitive_load): Add a note about the duplicate
  encoding scan.

* test-suite/tests/filesys.test: Add tests for UTF-8, UTF-16BE, and
  UTF-16LE BOM handling.

11 years agorequire automake 1.12 for `serial-tests'.
Andy Wingo [Wed, 30 Jan 2013 10:59:37 +0000 (11:59 +0100)]
require automake 1.12 for `serial-tests'.

* configure.ac: Require automake 1.12 for `serial-tests'.

11 years agobuild: Allow use of Automake 1.13.
Ludovic Courtès [Mon, 28 Jan 2013 21:28:00 +0000 (22:28 +0100)]
build: Allow use of Automake 1.13.

Fixes <http://bugs.gnu.org/13558>.
Reported by DNS <dns@rbose.org>.

* configure.ac: Use the `serial-tests' Automake option to cope with
  Automake 1.13, which uses `parallel-tests' by default.

11 years agoRemove unneeded SMOB mark procedure in `memoize.c'.
Ludovic Courtès [Mon, 28 Jan 2013 20:54:21 +0000 (21:54 +0100)]
Remove unneeded SMOB mark procedure in `memoize.c'.

* libguile/memoize.c (scm_init_memoize): Remove unnecessary call to
  `scm_set_smob_mark'.

11 years agoFix argument count for various format string escape sequences.
Ian Price [Sat, 19 Jan 2013 17:05:27 +0000 (17:05 +0000)]
Fix argument count for various format string escape sequences.

* module/language/tree-il/analyze.scm (format-string-argument-count):
  Handle ~t and ~k options case-insensitively.
  ~! ~| ~/ ~q and ~Q should not update the min-count or max-count.
  ~^ returns the min-count and 'any
  + - # and ' should not increase the argument count.
* test-suite/tests/tree-il.test (*): Tests for new parameters.

11 years agoxml->sxml argument can be a port or a string
Andy Wingo [Mon, 28 Jan 2013 11:01:16 +0000 (12:01 +0100)]
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.

11 years agomake (sxml simple)'s xml->sxml more capable
Andy Wingo [Sun, 27 Jan 2013 20:56:07 +0000 (21:56 +0100)]
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.

11 years agossax: treat *DEFAULT* as a fallback handler in entity alist
Andy Wingo [Sun, 27 Jan 2013 21:20:02 +0000 (22:20 +0100)]
ssax: treat *DEFAULT* as a fallback handler in entity alist

* module/sxml/upstream/SSAX.scm (ssax:handle-parsed-entity):
  Interpret *DEFAULT* as being a default handler procedure for parsed
  entities.  Includes test.

11 years agobegin rewriting SXML docs
Andy Wingo [Mon, 28 Jan 2013 09:48:42 +0000 (10:48 +0100)]
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.

11 years agocurrent-ssax-error-port is a parameter
Andy Wingo [Sun, 27 Jan 2013 20:53:49 +0000 (21:53 +0100)]
current-ssax-error-port is a parameter

* module/sxml/ssax.scm (current-ssax-error-port): Change to be a
  parameter.

11 years agoFix source annotation bug in psyntax 'expand-body'.
Mark H Weaver [Wed, 23 Jan 2013 22:27:50 +0000 (17:27 -0500)]
Fix source annotation bug in psyntax 'expand-body'.

* module/ice-9/psyntax.scm (expand-body): Apply source-annotation to an
  expression, not to the expression's compile-time environment.

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

11 years agoAdd 'for-humans?' flag to <language> specifications.
Mark H Weaver [Sun, 27 Jan 2013 15:10:21 +0000 (10:10 -0500)]
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?'.

11 years agoAdd tests for `--language'.
Ludovic Courtès [Sat, 26 Jan 2013 20:49:17 +0000 (21:49 +0100)]
Add tests for `--language'.

* test-suite/standalone/Makefile.am (top_srcdir): Add `top_srcdir'.
  (check_SCRIPTS, TESTS): Add `test-language'.
  (EXTRA_DIST): Add `test-language.el' and `test-language.js'.
* test-suite/standalone/test-language,
  test-suite/standalone/test-language.el,
  test-suite/standalone/test-language.js: New files.

11 years agoecmascript: Fix conversion to boolean for non-numbers.
Ludovic Courtès [Sat, 26 Jan 2013 18:18:31 +0000 (19:18 +0100)]
ecmascript: Fix conversion to boolean for non-numbers.

* module/language/ecmascript/base.scm (->boolean): Call `zero?' and
  `nan?' only when X is a number.
* test-suite/tests/ecmascript.test ("compiler"): Add test case.

11 years agoClarify the copyright status of GOOPS.
Ludovic Courtès [Sat, 26 Jan 2013 14:41:05 +0000 (15:41 +0100)]
Clarify the copyright status of GOOPS.

* module/oop/goops.scm, module/oop/goops/active-slot.scm,
  module/oop/goops/composite-slot.scm, module/oop/goops/describe.scm:
  Add a copyright line for Érick Gallesio.  Mention the STk version
  GOOPS was derived from.  Remove mentions of the ‘COPYRIGHTS’ file.
  Thanks to Karl Berry <karl@freefriends.org> for pointing it out, and
  to Michael Djurfeldt <mikael@djurfeldt.com>.

11 years agoRegenerate psyntax-pp.scm.
Mark H Weaver [Wed, 23 Jan 2013 22:25:18 +0000 (17:25 -0500)]
Regenerate psyntax-pp.scm.

* module/ice-9/psyntax-pp.scm: Regenerate.  This should have been done
  in commit 84f5a8251710c7d2a01590aa083d9dd409a56279 (`include' relative
  paths relative to including file).

11 years agooop goops save: fix compile-time availability of write-component
Andy Wingo [Wed, 23 Jan 2013 15:53:54 +0000 (16:53 +0100)]
oop goops save: fix compile-time availability of write-component

* module/oop/goops/save.scm (write-component)
  (write-component-procedure): Move definitions up so that syntax
  definition is available when compiling the rest of the file.

11 years agofix regression in -l
Andy Wingo [Wed, 23 Jan 2013 15:11:31 +0000 (16:11 +0100)]
fix regression in -l

* module/ice-9/command-line.scm (compile-shell-switches): Fix regression
  with -l argument, which was loading arg0 instead.

11 years agoload files from the command line relative to the cwd
Andy Wingo [Wed, 23 Jan 2013 15:05:13 +0000 (16:05 +0100)]
load files from the command line relative to the cwd

* module/ice-9/command-line.scm (load/lang): Load files from the command
  line relative to the current working directory (fixes regression).

11 years agoadd --language argument
Andy Wingo [Mon, 21 Jan 2013 11:28:22 +0000 (12:28 +0100)]
add --language argument

* module/ice-9/command-line.scm (*usage*): Make usage of capitalization
  and sentences consistent (lower-case and semicolons, as in ls
  --help).
  Be less specific about languages (Scheme is the default but not the
  only language).
  Document --language.
  (load/lang, eval-string/lang): New helpers.
  (compile-shell-switches): Parse a --language argument, and use it to
  set (current-language).

11 years agofix dynamic-call doc
Andy Wingo [Wed, 23 Jan 2013 08:37:59 +0000 (09:37 +0100)]
fix dynamic-call doc

* doc/ref/api-foreign.texi (Foreign Functions): Fix doc: interrupts are
  not deferred in a dynamic-call.

11 years agopaameterize in read-and-compile
Andy Wingo [Tue, 22 Jan 2013 14:40:08 +0000 (15:40 +0100)]
paameterize in read-and-compile

* module/system/base/compile.scm (read-and-compile): Use
  current-language parameter.

11 years agodocstring in rdelim
Andy Wingo [Tue, 22 Jan 2013 14:39:37 +0000 (15:39 +0100)]
docstring in rdelim

* module/ice-9/rdelim.scm: Update docstring.

11 years agocurrent-language is a parameter in boot-9
Andy Wingo [Mon, 21 Jan 2013 10:21:19 +0000 (11:21 +0100)]
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.

11 years agoadd fluid->parameter
Andy Wingo [Mon, 21 Jan 2013 10:16:29 +0000 (11:16 +0100)]
add fluid->parameter

* module/ice-9/boot-9.scm (make-parameter): Add a docstring.
  (fluid->parameter): New interface.  Use it when turning port fluids
  into parameters.

* doc/ref/api-scheduling.texi (Parameters): Deffn instead of defun for
  make-parameter documentation.  Add docs for fluid->parameter.

11 years agoadd read-string and read-string! to (ice-9 rdelim)
Andy Wingo [Tue, 22 Jan 2013 09:12:59 +0000 (10:12 +0100)]
add read-string and read-string! to (ice-9 rdelim)

* module/ice-9/rdelim.scm (read-string!, read-string): New functions.
* test-suite/tests/rdelim.test: Add tests.
* doc/ref/api-io.texi: Add docs.

* module/ice-9/iconv.scm:
* module/rnrs/io/ports.scm:
* module/web/uri.scm: Use the new functions.

11 years ago`include' relative paths relative to including file
Andy Wingo [Sun, 20 Jan 2013 19:26:59 +0000 (20:26 +0100)]
`include' relative paths relative to including file

* module/ice-9/psyntax.scm (include): Like `load', interpret relative
  paths as being relative to the file that does the `include'.

* doc/ref/api-evaluation.texi: Update docs.

11 years agolibguile examples use scm_c_vector functions instead of SCM_SIMPLE_VECTOR_*
Andy Wingo [Tue, 22 Jan 2013 10:48:47 +0000 (11:48 +0100)]
libguile examples use scm_c_vector functions instead of SCM_SIMPLE_VECTOR_*

* doc/ref/libguile-concepts.texi (Multi-Threading): Use functions in the
  example instead of macros.  Performance is really not a concern with
  this interface, especially now that scm_car and scm_cdr are inline
  functions.

11 years agodocumentation recommends scm_new_smob instead of SCM_NEWSMOB
Andy Wingo [Tue, 22 Jan 2013 10:35:25 +0000 (11:35 +0100)]
documentation recommends scm_new_smob instead of SCM_NEWSMOB

* doc/ref/api-smobs.texi (Smobs): Document scm_new_smob and
  scm_new_double_smob instead of the SCM_NEWSMOB / SCM_RETURN_NEWSMOB
  family of macros.

* doc/ref/libguile-smobs.texi (Creating Smob Instances): Use
  scm_new_smob.

11 years agofix compilation of glil to assembly
Andy Wingo [Tue, 22 Jan 2013 08:19:39 +0000 (09:19 +0100)]
fix compilation of glil to assembly

* libguile/vm-i-scheme.c (VM_VALIDATE_STRUCT): Fix the error message if
  the value was not a struct.

* module/system/base/compile.scm (find-language-joint): Default to
  joining at the target language.
  (default-language-joiner): Allow sequences of one compiled expression
  to pass through.  Otherwise error as before.
  (read-and-parse): New helper; actually parses.
  (read-and-compile): Use read-and-parse, and fall back to
  default-language-joiner.

Thanks to Nala Ginrut for the report.

11 years agoFix http-get* deprecation note
Andy Wingo [Mon, 21 Jan 2013 21:13:16 +0000 (22:13 +0100)]
Fix http-get* deprecation note

* module/web/client.scm (http-get*): Fix deprecation warning.  Thanks to
  Daniel Hartwig for the report.

11 years agoadd dynl.x dep on libpath.h
Andy Wingo [Mon, 21 Jan 2013 21:10:28 +0000 (22:10 +0100)]
add dynl.x dep on libpath.h

* libguile/Makefile.am (dynl.x): Add dep on libpath.h.  Thanks to Bogdan
  Marinescu for the report.

11 years agoread-and-compile closes input file after seeing EOF
Andy Wingo [Mon, 21 Jan 2013 18:07:19 +0000 (19:07 +0100)]
read-and-compile closes input file after seeing EOF

* module/system/base/compile.scm (read-and-compile): Close the input
  port after we read all of its data.  Perhaps this cleans up some NFS
  ghosts that David Pirotte was seeing.

11 years agofix try-module-autoload, which did not detect failure to find the file
Andy Wingo [Sun, 20 Jan 2013 18:33:42 +0000 (19:33 +0100)]
fix try-module-autoload, which did not detect failure to find the file

* libguile/load.c (scm_primitive_load_path): If the second argument is a
  procedure, call it like a thunk.

* doc/ref/api-evaluation.texi (Load Paths): Update docs.

* module/ice-9/boot-9.scm (resolve-interface): Use `unless'.
  (try-module-autoload): Use the new primitive-load-path to detect
  failure to find an appropriate file.  Fixes a bug reported by Diogo
  F. S. Ramos.  Thanks to Noah Lavine for tracking it down.

11 years agoFix attempt to get handle of weak table in (oop goops save)
Andy Wingo [Sun, 20 Jan 2013 12:28:31 +0000 (13:28 +0100)]
Fix attempt to get handle of weak table in (oop goops save)

* module/oop/goops/save.scm (readable?): Fix.  Thanks to Andrew Gaylard
  for the report.

11 years agowarn on multithreaded fork
Andy Wingo [Thu, 17 Jan 2013 11:38:56 +0000 (12:38 +0100)]
warn on multithreaded fork

* libguile/posix.c (scm_fork): Issue a warning on a multithreaded fork.
* doc/ref/posix.texi (Processes): Add note about multithreaded fork.

* test-suite/tests/00-socket.test: Moved here, from socket.test, so as
  to run before any threads are created.
* test-suite/Makefile.am: Adapt.

11 years agotrace: limit length of "| | | "... prefix
Andy Wingo [Wed, 16 Jan 2013 12:20:54 +0000 (13:20 +0100)]
trace: limit length of "| | | "... prefix

* module/system/vm/trace.scm (build-prefix): New helper.
  (print-application, print-return): Use the helper.
  (trace-calls-to-procedure, trace-calls-in-procedure):
  (trace-instructions-in-procedure, call-with-trace): Add #:max-indent
  argument, defaulting to the terminal width less 40 characters.

* doc/ref/scheme-using.texi: Update `trace' docs.

Based on a patch by Nala Ginrut.

11 years agopeval-introduced gensyms infix " "
Andy Wingo [Wed, 16 Jan 2013 12:27:55 +0000 (13:27 +0100)]
peval-introduced gensyms infix " "

* module/language/tree-il/peval.scm (peval): Gensyms use whitespace as
  an infix, not a dash.  Helps gensym?-like procedures like those in the
  unused lexical analysis.

11 years agoan end to the generated-documentation experiment
Andy Wingo [Wed, 16 Jan 2013 09:03:44 +0000 (10:03 +0100)]
an end to the generated-documentation experiment

* doc/ref/statprof.texi:
* doc/ref/sxml.texi:
* doc/ref/texinfo.texi: New files, containing the documentation that was
  previously generated from source and rendered into
  standard-library.texi.  The documentation is still horrible, but at
  least now it is user-editable.

11 years agodoc/ref/hierarchy.png: conform to hierarchy.txt and manual
Greg Benison [Sat, 24 Dec 2011 19:27:12 +0000 (11:27 -0800)]
doc/ref/hierarchy.png: conform to hierarchy.txt and manual

hierarchy.png (and .pdf, .eps) were changed to add one node
to the graph, getting them in sync with hierarchy.txt
(and the GOOPS section of the manual).

Also added hierarchy.dot, a file to generate said figure
using graphviz.

11 years agofix string->bytevector for utf-8 and non-error conversion strategies
Andy Wingo [Tue, 15 Jan 2013 14:08:20 +0000 (15:08 +0100)]
fix string->bytevector for utf-8 and non-error conversion strategies

* module/ice-9/iconv.scm (call-with-encoded-output-string):
  (string->bytevector, bytevector->string): Only call string->utf8 and
  utf8->string if the conversion strategy is `error'.

11 years agocase-lambda* clauses fail to match if too many positionals
Andy Wingo [Mon, 14 Jan 2013 10:38:09 +0000 (11:38 +0100)]
case-lambda* clauses fail to match if too many positionals

* doc/ref/api-procedures.texi (Case-lambda): Expand case-lambda*
  documentation.

* module/ice-9/eval.scm (primitive-eval):
* libguile/eval.c (prepare_boot_closure_env_for_apply): Dispatch to the
  next case-lambda clause if there are too many positionals.

* doc/ref/vm.texi (Function Prologue Instructions):
* libguile/vm-i-system.c (bind-optionals/shuffle-or-br): New
  instruction, like bind-optionals/shuffle but can dispatch to the next
  clause if there are too many positionals.

* module/language/assembly/disassemble.scm (code-annotation):
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
* module/language/assembly/compile-bytecode.scm (compile-bytecode): Add
  case for bind-optionals/shuffle-or-br.
* module/language/glil/compile-assembly.scm (glil->assembly): If there
  is an alternate, use bind-optionals/shuffle-or-br instead of
  bind-optionals/shuffle.

* test-suite/tests/optargs.test ("case-lambda*"): Add tests.

11 years agoDocstrings in (ice-9 iconv)
Andy Wingo [Fri, 11 Jan 2013 20:28:51 +0000 (21:28 +0100)]
Docstrings in (ice-9 iconv)

* module/ice-9/iconv.scm: Add docstrings.

11 years agoChange iconv procedures to take optional instead of keyword arg
Andy Wingo [Fri, 11 Jan 2013 20:15:28 +0000 (21:15 +0100)]
Change iconv procedures to take optional instead of keyword arg

* module/ice-9/iconv.scm (call-with-encoded-output-string):
  (string->bytevector, bytevector->string): Take an optional instead of
  a keyword argument.

* doc/ref/api-data.texi (Representing Strings as Bytes): Adapt docs to
  change, and fix a number of errors.  Thanks to Ludovic Courtès for the
  pointers.

* test-suite/tests/iconv.test ("wide non-ascii string"): Add a test for
  the 'substitute path.

11 years agoAdd http-post, http-put, et cetera
Andy Wingo [Fri, 11 Jan 2013 10:15:28 +0000 (11:15 +0100)]
Add http-post, http-put, et cetera

* module/web/client.scm (ensure-uri): New helper.
  (open-socket-for-uri): Accept a URI as a string or as a URI object.
  (extend-request, sanitize-request): New helpers, like the
  corresponding functions in (web server).
  (decode-response-body): Add a reference to the HTTP/1.1 spec, and
  use (ice-9 iconv).
  (request): New helper, factoring all aspects of sending an HTTP
  request and getting a response.
  (http-get): Redefine in terms of http-get.  Deprecate the
  #:extra-headers argument in favor of #:headers.  Allow a body.  Add a
  #:streaming? argument, subsuming the functionality of http-get*.
  (http-get*): Deprecate.
  (http-head, http-post, http-put, http-delete, http-trace)
  (http-options): Define interfaces for all HTTP verbs.

* test-suite/tests/web-client.test: Add tests.

* doc/ref/web.texi: Update documentation.

Thanks to Gregory Benison for the initial patch.

11 years agoread-response-body always returns bytevector or #f
Andy Wingo [Fri, 11 Jan 2013 10:30:29 +0000 (11:30 +0100)]
read-response-body always returns bytevector or #f

* module/web/response.scm (read-response-body): Fix to always return
  either a bytevector or #f.  Previously, reading a 0-length body could
  return the EOF object.

11 years agoremove (web http) TODO list
Andy Wingo [Fri, 11 Jan 2013 10:10:43 +0000 (11:10 +0100)]
remove (web http) TODO list

* module/web/http.scm: Remove outdated TODO list.

11 years ago(web server) uses (ice-9 iconv)
Andy Wingo [Fri, 11 Jan 2013 10:10:24 +0000 (11:10 +0100)]
(web server) uses (ice-9 iconv)

* module/web/server.scm (sanitize-response): Use the procedures
  from (ice-9 iconv) to encode the response.

11 years agoadd bytevector->string and string->bytevector in new (ice-9 iconv) module
Andy Wingo [Thu, 10 Jan 2013 21:50:27 +0000 (22:50 +0100)]
add bytevector->string and string->bytevector in new (ice-9 iconv) module

* module/Makefile.am:
* module/ice-9/iconv.scm: New module implementing procedures to encode
  and decode representations of strings as bytes.

* test-suite/Makefile.am:
* test-suite/tests/iconv.test: Add tests.

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

11 years agofix ice-9/slib
Andy Wingo [Thu, 10 Jan 2013 16:30:38 +0000 (17:30 +0100)]
fix ice-9/slib

* module/ice-9/slib.scm: Change to just load up slib.init directly.  The
  recently submitted patch to slib-discuss and guile-user should make
  this work correctly.

11 years agodeprecate SCM_CHAR_CODE_LIMIT and char-code-limit
Andy Wingo [Thu, 10 Jan 2013 15:01:06 +0000 (16:01 +0100)]
deprecate SCM_CHAR_CODE_LIMIT and char-code-limit

* libguile/__scm.h:
* libguile/deprecated.h (SCM_CHAR_CODE_LIMIT): Move declaration here
  from __scm.h.

* libguile/feature.c:
* module/ice-9/deprecated.scm (char-code-limit): Move definition here.

* test-suite/tests/regexp.test: Update to not use char-code-limit.

11 years agoslight open-pipe* / open-process refactor
Andy Wingo [Tue, 8 Jan 2013 11:58:05 +0000 (12:58 +0100)]
slight open-pipe* / open-process refactor

* libguile/posix.c (scm_open_process): Return the ports as values
  instead of calling out to Scheme again to make-rw-port.  This
  function is private to (ice-9 popen).

* module/ice-9/popen.scm (open-pipe*): Adapt to change.

11 years agohttp-get: don't shutdown write end of socket
Andy Wingo [Mon, 7 Jan 2013 22:21:16 +0000 (23:21 +0100)]
http-get: don't shutdown write end of socket

* module/web/http.scm ("Connection"): Write the "close" token in
  lower-case.

* module/web/client.scm (http-get): Don't shutdown the writing side of
  the pipe if we are not doing a keepalive, as this may prevent the
  request from being sent at all.  Prevented http://friendfeed.com/ from
  being correctly fetched.

11 years agoFix partial commit of documentation update
Andy Wingo [Mon, 7 Jan 2013 22:19:10 +0000 (23:19 +0100)]
Fix partial commit of documentation update

* doc/ref/api-procedures.texi (Compiled Procedures): Fix
  partially-committed doc update.

11 years agoMore procedure-arguments-alist documentation and a bugfix
Andy Wingo [Mon, 7 Jan 2013 21:02:26 +0000 (22:02 +0100)]
More procedure-arguments-alist documentation and a bugfix

* doc/ref/api-procedures.texi (Compiled Procedures): Expand
  program-arguments-alist and program-lambda-list documentation.

* module/system/vm/program.scm (arity->arguments-alist): Fix the rest
  arg if there are also keyword args, a bug found while documenting!

* test-suite/tests/session.test ("procedure-arguments"): Update.

11 years agodocument program-arguments-alist and program-lambda-list
Cedric Cellier [Wed, 11 Jan 2012 16:12:48 +0000 (17:12 +0100)]
document program-arguments-alist and program-lambda-list

11 years agominor cleanup in values.c
Andy Wingo [Mon, 7 Jan 2013 19:36:41 +0000 (20:36 +0100)]
minor cleanup in values.c

* libguile/values.c (scm_c_value_ref): Use scm_from_size_t to assimilate
  a size_t.

11 years agotests: Remove leftover `pk'.
Ludovic Courtès [Wed, 19 Dec 2012 22:31:05 +0000 (23:31 +0100)]
tests: Remove leftover `pk'.

* test-suite/tests/posix.test ("system*"): Remove `pk'.

11 years agoChange `system*' to not leave dangling processes behind.
Ludovic Courtès [Wed, 19 Dec 2012 22:15:45 +0000 (23:15 +0100)]
Change `system*' to not leave dangling processes behind.

Fixes <http://bugs.gnu.org/13166>.

* libguile/simpos.c (scm_system_star): In the child, call `_exit'
  instead of `SCM_SYSERROR' when `execvp' fails.
* test-suite/tests/posix.test ("system*"): New test prefix.

11 years agoweb: Correctly detect "No route to host" conditions.
Ludovic Courtès [Sun, 16 Dec 2012 23:27:00 +0000 (00:27 +0100)]
web: Correctly detect "No route to host" conditions.

* module/web/client.scm (open-socket-for-uri): Delete addrinfos
  with the same address.  Always open SOCK_STREAM/IPPROTO_IP sockets.
  Fix the error handler's condition to determine what to do.
  Reported by Nikita Karetnikov <nikita.karetnikov@gmail.com> at
  <http://lists.gnu.org/archive/html/bug-guix/2012-12/msg00150.html>.

11 years agobuild: Require Automake 1.11.2 or later.
Ludovic Courtès [Mon, 10 Dec 2012 22:38:48 +0000 (23:38 +0100)]
build: Require Automake 1.11.2 or later.

* configure.ac: Require Automake 1.11.2 or later.
  Reported by Sjoerd van Leent Privé <svanleent@gmail.com>
  in <http://bugs.gnu.org/13117>.

11 years agorepl: add repl-option for customized print
Daniel Hartwig [Tue, 4 Dec 2012 03:41:35 +0000 (11:41 +0800)]
repl: add repl-option for customized print

Closes <http://bugs.gnu.org/13077>.

* module/system/repl/common.scm (repl-default-options)
  (repl-print): Add option to use customized print procedure.
* doc/ref/scheme-using.texi (REPL Commands): Update.

11 years agotest-suite: Skip `EACCES' test of `file-system-fold' when run as root.
Ludovic Courtès [Mon, 10 Dec 2012 22:16:13 +0000 (23:16 +0100)]
test-suite: Skip `EACCES' test of `file-system-fold' when run as root.

* test-suite/tests/ftw.test ("file-system-fold")["EACCES"]: Use
  `pass-if-equal'.  Throw `unresolved' when run as root.
  Reported by Andreas Enge <andreas@enge.fr> at
  <http://lists.gnu.org/archive/html/bug-guix/2012-12/msg00073.html>.

11 years agoVerify the value of `SHUT_RD' and related constants.
Ludovic Courtès [Mon, 10 Dec 2012 22:14:10 +0000 (23:14 +0100)]
Verify the value of `SHUT_RD' and related constants.

* libguile/socket.c: Add `verify' clauses for the values of `SHUT_RD',
  `SHUT_WR', and `SHUT_RDWR'.

11 years agodoc: Update `release.org'.
Ludovic Courtès [Mon, 10 Dec 2012 22:12:07 +0000 (23:12 +0100)]
doc: Update `release.org'.

* doc/release.org (Use porter boxes): Mention Snakebite.

11 years agoThanks Jozef Chraplewski.
Mark H Weaver [Fri, 7 Dec 2012 17:03:49 +0000 (12:03 -0500)]
Thanks Jozef Chraplewski.

* THANKS: Jozef Chraplewski.

11 years agoAvoid signed integer overflow in scm_product
Mark H Weaver [Fri, 7 Dec 2012 16:53:00 +0000 (11:53 -0500)]
Avoid signed integer overflow in scm_product

* libguile/numbers.c (scm_product): Avoid signed integer overflow, which
  modern C compilers are allowed to assume will never happen, thus
  allowing them to optimize out our overflow checks.

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

11 years agodoc: remove more references to hash-tables-as-vectors
Daniel Hartwig [Fri, 30 Nov 2012 01:40:36 +0000 (09:40 +0800)]
doc: remove more references to hash-tables-as-vectors

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

11 years agodoc: Update `release.org'.
Ludovic Courtès [Fri, 30 Nov 2012 20:22:45 +0000 (21:22 +0100)]
doc: Update `release.org'.

* doc/release.org: Fix typos, and update.