bpt/guile.git
11 years agoImplement SRFI-105 curly infix expressions.
Mark H Weaver [Fri, 26 Oct 2012 21:20:16 +0000 (17:20 -0400)]
Implement SRFI-105 curly infix expressions.

* libguile/private-options.h: Add SCM_CURLY_INFIX_P macro, and increment
  SCM_N_READ_OPTIONS.

* libguile/read.c (sym_nfx, sym_bracket_list, sym_bracket_apply): New
  variables.
  (scm_read_opts): Add curly-infix reader option.  Reformat to comply
  with GNU coding standards.
  (scm_t_read_opts): Add curly_infix_p and neoteric_p fields.
  (init_read_options): Initialize new fields.
  (CHAR_IS_DELIMITER): Add '{', '}', '[', and ']' as delimiters if
  curly_infix_p is set.

  (set_port_square_brackets_p, set_port_curly_infix_p): New functions.

  (read_inner_expression): New function which contains the code that was
  previously in 'scm_read_expression'.  Handle curly braces when
  curly_infix_p is set.  If curly_infix_p is set and square_brackets_p
  is unset, follow the Kawa convention: [...] => ($bracket-list$ ...)

  (scm_read_expression): New function body to handle neoteric
  expressions where appropriate.

  (scm_read_shebang): Handle the new reader directives: '#!curly-infix'
  and the non-standard '#!curly-infix-and-bracket-lists'.

  (scm_read_sexp): Handle curly infix lists.

* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-105 feature
  identifier.

* doc/ref/srfi-modules.texi (SRFI-105): Add stub doc for SRFI-105.

* doc/ref/api-evaluation.texi (Scheme Read): Add documentation for the
  'curly-infix' read option, and the '#!curly-infix' and
  '#!curly-infix-and-bracket-lists' reader directives.

* doc/ref/api-options.texi (Runtime Options): Add 'curly-infix' to the
  list of read options.

* test-suite/Makefile.am: Add tests/srfi-105.test.

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

11 years agoImplement #!fold-case and #!no-fold-case reader directives.
Mark H Weaver [Wed, 24 Oct 2012 18:37:36 +0000 (14:37 -0400)]
Implement #!fold-case and #!no-fold-case reader directives.

* libguile/read.c (set_port_case_insensitive_p): New function.

  (scm_read_shebang): Handle #!fold-case and #!no-fold-case.

* doc/ref/api-evaluation.texi (Case Sensitivity, Scheme Read): Document
  the #!fold-case and #!no-fold-case reader directives.

* test-suite/tests/reader.test ("per-port-read-options"): Add tests.

11 years agoImplement per-port read options.
Mark H Weaver [Tue, 23 Oct 2012 21:28:43 +0000 (17:28 -0400)]
Implement per-port read options.

* libguile/read.c (scm_t_read_opts): Update comment to mention the
  per-port read options.

  (sym_port_read_options): New variable.

  (set_port_read_option): New function.

  (init_read_options): Add new 'port' parameter, and consult the
  per-port read option overrides when initializing the 'scm_t_read_opts'
  struct.  Move to bottom of file.

  (scm_read): Pass 'port' parameter to init_read_options.

11 years agoRepurpose scm_i_port_weak_hash to associate an alist with each port.
Mark H Weaver [Tue, 23 Oct 2012 04:36:12 +0000 (00:36 -0400)]
Repurpose scm_i_port_weak_hash to associate an alist with each port.

* libguile/ports.c (scm_i_port_weak_hash): Document that the values in
  this hash table will now be alists.  Previously the value slots were
  unused.

  (scm_new_port_table_entry): Change the initial value of the entry in
  scm_i_port_weak_hash from SCM_BOOL_F to SCM_EOL.

11 years agoGeneralize scm_read_shebang to handle other reader directives.
Mark H Weaver [Tue, 23 Oct 2012 04:29:07 +0000 (00:29 -0400)]
Generalize scm_read_shebang to handle other reader directives.

* libguile/read.c (READER_DIRECTIVE_NAME_MAX_SIZE): New C macro.
  (scm_read_shebang): Rewrite to handle arbitrary reader directives.

11 years agoAdd source properties to more datum types in scm_read_sharp_extension.
Mark H Weaver [Tue, 23 Oct 2012 04:21:12 +0000 (00:21 -0400)]
Add source properties to more datum types in scm_read_sharp_extension.

* libguile/read.c (scm_read_sharp_extension): Attach source properties
  to the result of a custom token reader if the returned datum is not
  immediate.  Previously, source properties were added to pairs only.

11 years agoChange reader to pass read options to helpers via explicit parameter.
Mark H Weaver [Tue, 23 Oct 2012 21:11:41 +0000 (17:11 -0400)]
Change reader to pass read options to helpers via explicit parameter.

* libguile/read.c (enum t_keyword_style, struct t_read_opts,
  scm_t_read_opts): New types.
  (init_read_options): New function.

  (CHAR_IS_DELIMITER): Look up square-brackets option via local 'opts'.

  (scm_read): Call 'init_read_options', and pass 'opts' to helpers.

  (flush_ws, maybe_annotate_source, read_complete_token, read_token,
  scm_read_bytevector, scm_read_character,
  scm_read_commented_expression, scm_read_expression,
  scm_read_guile_bit_vector, scm_read_keyword,
  scm_read_mixed_case_symbol, scm_read_nil, scm_read_number,
  scm_read_number_and_radix, scm_read_quote, scm_read_sexp,
  scm_read_sharp, scm_read_sharp_extension, scm_read_shebang,
  scm_read_srfi4_vector, scm_read_string, scm_read_syntax,
  scm_read_vector, scm_read_array): Add 'opts' as an additional
  parameter, and use it to look up read options.  Previously the global
  read options were consulted directly.

11 years agoMinor tweaks to delimiter handling in read.c
Mark H Weaver [Tue, 23 Oct 2012 03:28:56 +0000 (23:28 -0400)]
Minor tweaks to delimiter handling in read.c

* libguile/read.c (CHAR_IS_R5RS_DELIMITER, CHAR_IS_DELIMITER): Move the
  '[' and ']' delimiters from CHAR_IS_R5RS_DELIMITER to
  CHAR_IS_DELIMITER.  Parenthesize all references to the macro
  parameter.  Don't check the global square-brackets read option until
  after we know the character is '[' or ']'.
  (scm_read_sexp): Don't check the global square-brackets read option
  until after we know the character is ']'.

11 years agoMove array reader from arrays.c to read.c
Mark H Weaver [Tue, 23 Oct 2012 03:23:45 +0000 (23:23 -0400)]
Move array reader from arrays.c to read.c

* libguile/arrays.c (read_decimal_integer): Move to read.c.
  (scm_i_read_array): Remove.  Incorporate the code into the
  'scm_read_array' static function in read.c.

* libguile/arrays.h (scm_i_read_array): Remove prototype.

* libguile/read.c (read_decimal_integer): Move here from read.c.
  (scm_read_array): Incorporate the code from 'scm_i_read_array'.  Call
  'scm_read_vector' and 'scm_read_sexp' instead of 'scm_read'.

11 years agoFix typo in scheme-using.texi
Ian Price [Wed, 19 Sep 2012 16:40:17 +0000 (17:40 +0100)]
Fix typo in scheme-using.texi

* doc/ref/scheme-using.texi (System Commands): Fix typo.

11 years agoFix @@ usage in --listen option
Ian Price [Wed, 19 Sep 2012 16:33:29 +0000 (17:33 +0100)]
Fix @@ usage in --listen option

* module/ice-9/command-line.scm (compile-shell-switches): Fix usage of
  @@, which no longer supports arbitrary expressions, only identifiers.

11 years agoRemove prototype for scm_read_token, which does not exist.
Mark H Weaver [Sun, 14 Oct 2012 00:41:45 +0000 (20:41 -0400)]
Remove prototype for scm_read_token, which does not exist.

* libguile/read.h: Remove prototype for scm_read_token.

11 years agoImprove formatting of options help given long option names
Mark H Weaver [Sun, 14 Oct 2012 00:28:27 +0000 (20:28 -0400)]
Improve formatting of options help given long option names

* module/ice-9/boot-9.scm (define-option-interface): When printing
  options help, e.g. for (read-options 'help), expand the width of the
  first column by another tab stop, to accommodate option names of up to
  23 characters.

11 years agoweb: Fix possible file descriptor leak in `open-socket-for-uri'.
Ludovic Courtès [Sat, 13 Oct 2012 19:13:10 +0000 (21:13 +0200)]
web: Fix possible file descriptor leak in `open-socket-for-uri'.

* module/web/client.scm (open-socket-for-uri): Always close S in the
  `system-error' handler.

11 years agoweb: Pass `AI_NUMERICSERV' when given a port number.
Ludovic Courtès [Fri, 12 Oct 2012 21:09:44 +0000 (23:09 +0200)]
web: Pass `AI_NUMERICSERV' when given a port number.

* module/web/client.scm (open-socket-for-uri)[addresses]: Pass
  AI_NUMERICSERV as the `getaddrinfo' hint when (uri-port URI) is true.

11 years agoweb: Change `http-get' to try all the addresses for the given URI.
Ludovic Courtès [Fri, 12 Oct 2012 21:05:22 +0000 (23:05 +0200)]
web: Change `http-get' to try all the addresses for the given URI.

* module/web/client.scm (open-socket-for-uri): Try all the addresses
  returned by `getaddrinfo' until one succeeds.

11 years agoImplement `hash' for structs.
Ludovic Courtès [Fri, 12 Oct 2012 21:03:39 +0000 (23:03 +0200)]
Implement `hash' for structs.

* libguile/hash.c (scm_hasher): Call `scm_i_struct_hash' upon
  `scm_tcs_struct'.
* libguile/struct.c (scm_i_struct_hash): New function.
* libguile/struct.h (scm_i_struct_hash): New declaration.

* test-suite/tests/structs.test ("hash"): New test prefix.

11 years agoThanks Daniel Hartwig.
Mark H Weaver [Fri, 12 Oct 2012 12:26:34 +0000 (08:26 -0400)]
Thanks Daniel Hartwig.

* THANKS (Contributors since the last release): Add Daniel Hartwig.

11 years agoIn string-split, add support for character sets and predicates.
Daniel Hartwig [Mon, 8 Oct 2012 10:35:00 +0000 (18:35 +0800)]
In string-split, add support for character sets and predicates.

* libguile/srfi-13.c (string-split): Add support for splitting on
  character sets and predicates, like string-index and others.
* test-suite/tests/strings.test (string-split): Add tests covering
  the new argument types.
* doc/ref/api-data.texi (string-split): Update.

Signed-off-by: Mark H Weaver <mhw@netris.org>
11 years agoRevert "Preserve keyword identifier in 'syntax-rules' and 'define-syntax-rule'"
Mark H Weaver [Wed, 10 Oct 2012 17:13:19 +0000 (13:13 -0400)]
Revert "Preserve keyword identifier in 'syntax-rules' and 'define-syntax-rule'"

This reverts commit 3e3d32dd9b2d71ffb0703dedc4d47387e981c9b5.

11 years agoPreserve keyword identifier in 'syntax-rules' and 'define-syntax-rule'
Mark H Weaver [Mon, 8 Oct 2012 18:08:43 +0000 (14:08 -0400)]
Preserve keyword identifier in 'syntax-rules' and 'define-syntax-rule'

* module/ice-9/psyntax-pp.scm (syntax-rule, define-syntax-rule):
  Preserve the keyword identifier.

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

11 years agoSimplify calls to 'eqv?' when one argument is an immediate constant.
Mark H Weaver [Mon, 8 Oct 2012 15:56:10 +0000 (11:56 -0400)]
Simplify calls to 'eqv?' when one argument is an immediate constant.

* module/language/tree-il/primitives.scm (maybe-simplify-to-eq): New
  helper procedure shared by expanders for 'eqv?' and 'equal?'.
  (*primitive-expand-table*): Add expansion rule for 'eqv?'.

* test-suite/tests/tree-il.test ("primitives"): Add tests.

11 years agoDon't simplify 'equal?' to 'not' or 'null?'.
Mark H Weaver [Mon, 8 Oct 2012 04:37:09 +0000 (00:37 -0400)]
Don't simplify 'equal?' to 'not' or 'null?'.

* module/language/tree-il/primitives.scm (*primitive-expand-table*):
  Don't simplify 'equal?' to 'not' or 'null?', but only to 'eq?'.

* test-suite/tests/tree-il.test ("primitives"): Adjust tests.

11 years agoDon't simplify 'equal?' to 'eq?' when constant is an *inexact* small integer.
Mark H Weaver [Mon, 8 Oct 2012 03:57:13 +0000 (23:57 -0400)]
Don't simplify 'equal?' to 'eq?' when constant is an *inexact* small integer.

* module/language/tree-il/primitives.scm (*primitive-expand-table*):
  Refine test for fixnums to verify that the small integer is exact.

* test-suite/tests/tree-il.test ("primitives"): Add test.

11 years agoSimplify calls to `equal?' when one argument is a constant.
Ludovic Courtès [Fri, 5 Oct 2012 23:24:46 +0000 (01:24 +0200)]
Simplify calls to `equal?' when one argument is a constant.

* module/language/tree-il/primitives.scm (*primitive-expand-table*): Add
  expansion rules for `equal?', when called with one constant and
  another argument.

* test-suite/tests/tree-il.test (pass-if-primitives-resolved): New
  macro.
  ("primitives"): New test prefix.

11 years agoImprove error reporting in 'append!'
Mark H Weaver [Sat, 6 Oct 2012 10:04:29 +0000 (06:04 -0400)]
Improve error reporting in 'append!'

* libguile/list.c (scm_append_x): Report correct argument number when
  validating arguments.  Validate that the last cdr of each argument is
  null or nil.  Rename formal rest argument from 'lists' to 'args'.

* test-suite/tests/list.test (append!): Update tests to expect correct
  handling of improper lists.

11 years agoChange inappropriate uses of expect-fail X to pass-if not X in chars.test
Mark H Weaver [Thu, 4 Oct 2012 11:57:27 +0000 (07:57 -0400)]
Change inappropriate uses of expect-fail X to pass-if not X in chars.test

* test-suite/tests/chars.test (basic char handling): Change
  inappropriate uses of 'expect-fail' to 'pass-if' with 'not' applied to
  the test.

11 years agoIn fold-matches, set regexp/notbol unless matching string start.
Chris K. Jester-Young [Sun, 16 Sep 2012 06:27:19 +0000 (02:27 -0400)]
In fold-matches, set regexp/notbol unless matching string start.

* module/ice-9/regex.scm (fold-matches): Set regexp/notbol if the
  starting position is nonzero.
* test-suite/tests/regexp.test (fold-matches): Check that when
  matching /^foo/ against "foofoofoofoo", only one match results.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
11 years agoDon't stat(2) and access(2) the .go location before using it.
Ludovic Courtès [Tue, 11 Sep 2012 21:44:59 +0000 (23:44 +0200)]
Don't stat(2) and access(2) the .go location before using it.

* module/system/base/compile.scm (ensure-directory): Rename to...
  (ensure-directory): ... this.  Update callers.  When ERRNO is EEXIST,
  assume DIR is a writable directory instead of calling `stat' and
  `access?' again.  Fixes UID/EUID mismatches for setuid binaries.
  Reported by rixed@happyleptic.org at
  <http://lists.gnu.org/archive/html/guile-user/2012-06/msg00023.html>.

11 years agoRewrite SRFI-31 in terms of `syntax-rules'.
Ludovic Courtès [Tue, 11 Sep 2012 21:39:32 +0000 (23:39 +0200)]
Rewrite SRFI-31 in terms of `syntax-rules'.

* module/srfi/srfi-31.scm: Use `#:export' instead of `#:export-syntax'.
  (rec): Rewrite using `syntax-rules'.

* test-suite/tests/srfi-31.test ("rec special form"): Change exception
  type to EXCEPTION:SYNTAX-PATTERN-UNMATCHED.

11 years agoDocument (ice-9 curried definitions)
Ian Price [Thu, 6 Sep 2012 20:21:47 +0000 (21:21 +0100)]
Document (ice-9 curried definitions)

* doc/ref/Makefile.am (guile_TEXINFOS): Add curried.texi to list
* doc/ref/curried.texi: New file.
* doc/ref/guile.texi (Guile Modules): Add "Curried Definitions" to menu.
* doc/ref/scheme-ideas.texi (Lambda Alternatives): Refer to "Curried Definitions"
  from the `define' section.

11 years ago`define-public' is no a longer curried definition by default.
Ian Price [Tue, 4 Sep 2012 12:18:58 +0000 (13:18 +0100)]
`define-public' is no a longer curried definition by default.

* module/ice-9/boot-9.scm (define-public): Remove currying functionality.
* module/ice-9/curried-definitions.scm (define-public): New export.

11 years agobuild: Fix race between installing `guild' and the `guile-tools' symlink.
Ludovic Courtès [Mon, 3 Sep 2012 20:40:46 +0000 (22:40 +0200)]
build: Fix race between installing `guild' and the `guile-tools' symlink.

Fixes <http://bugs.gnu.org/12015>.
Report and patch by Song.Li <Song.Li@windriver.com>.

* meta/Makefile.am (install-data-hook): Rename to...
  (install-exec-hook): ... this.

11 years agodoc: Use scm_{to,from}_double instead of old API in example.
Ludovic Courtès [Mon, 3 Sep 2012 20:35:33 +0000 (22:35 +0200)]
doc: Use scm_{to,from}_double instead of old API in example.

Fixed <http://bugs.gnu.org/12241>.
Reported by Kurt W. Gochko <kgochko@comcast.net>.

* doc/ref/tour.texi (Writing Guile Extensions): Change example to use
  scm_{to,from}_double instead of the pre-1.8 API.

11 years agobuild: Use Automake's `color-tests'.
Ludovic Courtès [Mon, 3 Sep 2012 20:33:45 +0000 (22:33 +0200)]
build: Use Automake's `color-tests'.

* configure.ac: Use Automake's `color-tests'.

11 years agoISO 8601 time format specifies zero padding for hours, not blank padding.
Ian Price [Tue, 21 Aug 2012 11:13:25 +0000 (12:13 +0100)]
ISO 8601 time format specifies zero padding for hours, not blank padding.

* doc/ref/srfi-modules.texi ("SRFI-19 Date to string"): Fix iso 8601 format strings.
* module/srfi/srfi-19.scm (directives): Fix iso 8601 format strings.

11 years agodoc: Fix description of regexp/locale encoding interaction.
Ludovic Courtès [Sun, 26 Aug 2012 22:09:30 +0000 (00:09 +0200)]
doc: Fix description of regexp/locale encoding interaction.

* doc/ref/api-regex.texi (Regexp Functions): Update paragraph that
  mentions locale encoding and strings-as-bytes.

* test-suite/tests/regexp.test ("nonascii locales")["match structures
  refer to char offsets, non-ASCII pattern"]: New test.

11 years agoUpdate `texinfo.test' to match latest change.
Ludovic Courtès [Sun, 26 Aug 2012 21:42:09 +0000 (23:42 +0200)]
Update `texinfo.test' to match latest change.

* test-suite/tests/texinfo.test ("test-texinfo->stexinfo")["@url{arg}"]:
  Update test as a follow-up to
  dc7a9cefbf5434b6e7e503fe83faa07b24a1a6cd ("more robust texinfo alias
  handling").

11 years agoFix uri-encoding for strings with no unreserved chars
Ian Price [Mon, 20 Aug 2012 22:12:23 +0000 (23:12 +0100)]
Fix uri-encoding for strings with no unreserved chars

* module/web/uri.scm (uri-encode): Change test to check for unreserved
  chars instead of reserved chars.
* test-suite/tests/web-uri.test ("encode"): Add test.

11 years agoFix uri-encoding for octets 0-15
Ian Price [Mon, 20 Aug 2012 22:03:38 +0000 (23:03 +0100)]
Fix uri-encoding for octets 0-15

* module/web/uri.scm (uri-encode): All encoded octets should be of the
  form % HEXDIGIT HEXDIGIT.
* test-suite/tests/web-uri.test ("encode"): Add test.

11 years agomore robust texinfo alias handling
Andy Wingo [Sat, 25 Aug 2012 09:52:44 +0000 (11:52 +0200)]
more robust texinfo alias handling

* module/texinfo.scm (command-spec): Resolve aliases here.
  (complete-start-command, make-command-parser):
  (make-dom-parser, parse-environment-args): Reload command after
  resolving spec, so we get the alias target.

11 years agoMicro-optimize (ice-9 format).
Ludovic Courtès [Mon, 20 Aug 2012 22:36:50 +0000 (00:36 +0200)]
Micro-optimize (ice-9 format).

* module/ice-9/format.scm (format): Use `call-with-output-string'
  instead of `with-output-to-string'.

11 years agoOptimize `scm_lfwrite_substr', used by `scm_simple_format'.
Ludovic Courtès [Mon, 20 Aug 2012 21:38:21 +0000 (23:38 +0200)]
Optimize `scm_lfwrite_substr', used by `scm_simple_format'.

Fixes <http://bugs.gnu.org/12033>.
Reported by nalaginrut <nalaginrut@gmail.com>.

* libguile/print.c (scm_i_display_substring): New function.
* libguile/print.h (scm_i_display_substring): New internal declaration.
* libguile/ports.c (scm_lfwrite_substr): Use it instead of `scm_display'
  + `scm_c_substring'.

11 years agoreinstate type check to scm_to_utf8_stringn
Andy Wingo [Fri, 17 Aug 2012 14:41:27 +0000 (16:41 +0200)]
reinstate type check to scm_to_utf8_stringn

* libguile/strings.c (scm_to_utf8_stringn): Re-add missing type check,
  inadvertantly removed in e3d4597469a543d97c4997b128509c2ceb13ca2b.

11 years agoRevert "Add tests for 'exp' and 'expt' that should produce complex NaNs"
Mark H Weaver [Tue, 7 Aug 2012 22:14:32 +0000 (18:14 -0400)]
Revert "Add tests for 'exp' and 'expt' that should produce complex NaNs"

This reverts commit cc26b9de1d3c21cb4be49cc61c4b5872b8f607c5.

11 years agoRevert "Avoid cexp, whose C standard definition is mathematically incorrect"
Mark H Weaver [Tue, 7 Aug 2012 22:13:48 +0000 (18:13 -0400)]
Revert "Avoid cexp, whose C standard definition is mathematically incorrect"

This reverts commit ecbded71bb423a6055c541d6272796aefd1486f9.

11 years agoAvoid cexp, whose C standard definition is mathematically incorrect
Mark H Weaver [Wed, 1 Aug 2012 02:52:17 +0000 (22:52 -0400)]
Avoid cexp, whose C standard definition is mathematically incorrect

* libguile/numbers.c (scm_exp): Do not use cexp.

11 years agoAdd tests for 'exp' and 'expt' that should produce complex NaNs
Mark H Weaver [Sat, 28 Jul 2012 17:07:38 +0000 (13:07 -0400)]
Add tests for 'exp' and 'expt' that should produce complex NaNs

* test-suite/tests/numbers.test (exp, expt): Add tests that should
  produce complex NaNs, but apparently don't on all systems.

11 years agoset struct names for <standard-vtable>, etc
Andy Wingo [Sat, 28 Jul 2012 10:28:21 +0000 (12:28 +0200)]
set struct names for <standard-vtable>, etc

* libguile/struct.c (scm_init_struct): Set the struct names for
  <standard-vtable>, <applicable-struct-vtable>, and
  <applicable-struct-with-setter-vtable>.

11 years agoupdate tests after vtable-vtable deprecation
Andy Wingo [Sat, 28 Jul 2012 10:58:46 +0000 (12:58 +0200)]
update tests after vtable-vtable deprecation

* test-suite/tests/goops.test ("classes for built-in types"): Use a
  vtable instead of a vtable-vtable.

* test-suite/tests/structs.test (ball-root)
  ("low-level struct procedures", "make-struct"): Rework to use normal
  vtables instead of making new vtable-vtable.

11 years agodeprecate make-vtable-vtable
Andy Wingo [Fri, 18 Nov 2011 10:50:50 +0000 (11:50 +0100)]
deprecate make-vtable-vtable

* libguile/struct.h:
* libguile/struct.c (scm_make_vtable_vtable): Deprecate, as you can
  handle most of the use cases with make-vtable, and we don't want to
  promote the creation of new roots to the type hierarchy.
  (scm_i_make_vtable_vtable): The internal replacement.

11 years agoimprove documentation for structs
Andy Wingo [Sat, 28 Jul 2012 10:43:46 +0000 (12:43 +0200)]
improve documentation for structs

* doc/ref/api-compound.texi (Structures): Update to describe
  <standard-vtable>, to remove documentation for make-vtable-vtable, to
  describe meta-vtables, and to add a long example.

11 years agoupdate structure documentation
Andy Wingo [Tue, 24 Jul 2012 21:18:33 +0000 (23:18 +0200)]
update structure documentation

* doc/ref/api-compound.texi (Records): Add a link to SRFI-9 records.
  (Structures): Add a link to Records.  Describe tail arrays as
  deprecated, and add a rationale and some details.

11 years agoAngle of -0.0 is pi, not zero
Mark H Weaver [Sat, 28 Jul 2012 06:45:05 +0000 (02:45 -0400)]
Angle of -0.0 is pi, not zero

* libguile/numbers.c (scm_angle): Check the sign of an inexact real
  zero, to ensure that (angle -0.0) => pi and (angle 0.0) => 0.0.

* test-suite/tests/numbers.test (angle): Add tests, and increase
  precision of tests where the angle should be pi.

11 years agoDocument (ice-9 and-let-star)
Noah Lavine [Sat, 30 Jun 2012 12:42:44 +0000 (08:42 -0400)]
Document (ice-9 and-let-star)

* doc/ref/srfi-modules.texi: note that (srfi srfi-2) is the same as
  (ice-9 and-let-star).

11 years agobuild: Use `AM_PROG_AR'.
Ludovic Courtès [Sat, 7 Jul 2012 09:41:39 +0000 (11:41 +0200)]
build: Use `AM_PROG_AR'.

* configure.ac: Use `AM_PROG_AR', as suggested by Automake
  1.12.1 ("warning: 'libguilereadline-v-@LIBGUILEREADLINE_MAJOR@.la':
  linking libtool libraries using a non-POSIX archiver requires
  'AM_PROG_AR' in 'configure.ac'").

11 years agoFix typos in `NEWS'.
Ludovic Courtès [Sat, 7 Jul 2012 09:32:38 +0000 (11:32 +0200)]
Fix typos in `NEWS'.

* NEWS: Fix typos.

11 years agoBump version number for 2.0.6.
Ludovic Courtès [Sat, 7 Jul 2012 09:29:38 +0000 (11:29 +0200)]
Bump version number for 2.0.6.

* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
  (LIBGUILE_INTERFACE_CURRENT): Increment, to account for new C
  functions like `scm_c_nvalues', `scm_to_pointer', etc.
  (LIBGUILE_INTERFACE_AGE): Increment.

11 years agoStore the `git-version-gen' patch.
Ludovic Courtès [Sat, 7 Jul 2012 09:10:49 +0000 (11:10 +0200)]
Store the `git-version-gen' patch.

* gnulib-local/build-aux/git-version-gen.diff: New file.
* Makefile.am (EXTRA_DIST): Add it.

11 years agoWork around `gl_CANONICALIZE_LGPL' bug when cross-compiling to GNU/Hurd.
Ludovic Courtès [Fri, 6 Jul 2012 23:52:45 +0000 (01:52 +0200)]
Work around `gl_CANONICALIZE_LGPL' bug when cross-compiling to GNU/Hurd.

* gnulib-local/m4/canonicalize.m4.diff: New file.
* Makefile.am (EXTRA_DIST): Add it.

11 years agoWork around `gl_CANONICALIZE_LGPL' bug when cross-compiling.
Ludovic Courtès [Fri, 6 Jul 2012 23:36:08 +0000 (01:36 +0200)]
Work around `gl_CANONICALIZE_LGPL' bug when cross-compiling.

* gnulib-local/m4/canonicalize.m4.diff: New file.
* Makefile.am (EXTRA_DIST): Add it.

11 years agoAdd missing `m4/clock_time.m4'.
Ludovic Courtès [Fri, 6 Jul 2012 22:20:20 +0000 (00:20 +0200)]
Add missing `m4/clock_time.m4'.

11 years agoUse `clock-time' directly from Gnulib, but with a local patch.
Ludovic Courtès [Fri, 6 Jul 2012 21:56:05 +0000 (23:56 +0200)]
Use `clock-time' directly from Gnulib, but with a local patch.

This is equivalent to the previous situation, but more easily
maintainable.

* acinclude.m4 (gl_CLOCK_TIME): Remove.

* configure.ac: Remove explicit use of `gl_CLOCK_TIME'.

* m4/gnulib-cache.m4 (gl_MODULES): Add `clock-time'.

* gnulib-local/m4/clock_time.m4.diff: New file.
* Makefile.am (EXTRA_DIST): Add it.

11 years agoUpdate Gnulib to v0.0-7509-g98a2286.
Ludovic Courtès [Fri, 6 Jul 2012 21:25:57 +0000 (23:25 +0200)]
Update Gnulib to v0.0-7509-g98a2286.

* Makefile.am (EXTRA_DIST): Add `m4/gnulib-cache.m4'.
* build-aux/git-version-gen: Keep unchanged.

11 years agoadd http/1.1 transfer codings to the NEWS
Andy Wingo [Fri, 6 Jul 2012 20:24:25 +0000 (22:24 +0200)]
add http/1.1 transfer codings to the NEWS

* doc/ref/web.texi (Transfer Codings): Add a note about modules.
* NEWS: Add NEWS for transfer codings.

11 years agoDocument and export `declare-opaque-header!'
Ian Price [Mon, 7 May 2012 23:18:59 +0000 (00:18 +0100)]
Document and export `declare-opaque-header!'

* module/web/http.scm (declare-opaque-header!): Add docstring. New export.
* doc/ref/web.texi (HTTP): Add documentation.

11 years agoAdd HTTP Chunked Encoding support to web modules.
Ian Price [Mon, 7 May 2012 23:06:01 +0000 (00:06 +0100)]
Add HTTP Chunked Encoding support to web modules.

* doc/ref/web.texi(Transfer Codings): New subsection for transfer codings.
* module/web/http.scm(make-chunked-input-port,
  make-chunked-output-port): New procedures.
* module/web/response.scm (read-response-body): Handle chunked responses.
* test-suite/tests/web-response.test: Add test.
* test-suite/tests/web-http.test: Add tests.

afd

11 years agoFix @ and @@ to not capture lexicals; new @@ @@ form for R6RS libraries
Mark H Weaver [Thu, 8 Mar 2012 06:24:25 +0000 (01:24 -0500)]
Fix @ and @@ to not capture lexicals; new @@ @@ form for R6RS libraries

* module/ice-9/psyntax.scm (@): Return top-wrap instead of the wrap
  applied to the '@' form, so that the symbol will be interpreted as a
  top-level identifier and never refer to any lexical variable.

  (@@): Change the syntax used to support R6RS 'library' forms to:
  (@@ @@ (mod ...) body).  Change the behavior of the documented
  (@@ (mod ...) id) form to be the same as that of @, except for the use
  of 'private' instead of 'public' in the psyntax mod: use syntax->datum
  on the identifier, and return top-wrap instead of the wrap applied to
  the '@@' form.

  This fixes <http://bugs.gnu.org/10756> reported by Ludovic Courtès.

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

* module/ice-9/r6rs-libraries.scm (library): Use '@@ @@' syntax instead
  of the older '@@' syntax.

* test-suite/tests/syncase.test (changes to expansion environment): Use
  '@@ @@' syntax.

* module/Makefile.am: Add explicit dependencies for boot-9.go on the
  files that it includes: quasisyntax.scm and r6rs-libraries.scm.

11 years agosimplify %condition-type-vtable
Andy Wingo [Fri, 18 Nov 2011 10:35:07 +0000 (11:35 +0100)]
simplify %condition-type-vtable

* module/srfi/srfi-35.scm (%condition-type-vtable): Use make-vtable
  instead of make-vtable-vtable.

11 years agorecord-type-vtable is not a new root of the vtable hierarchy
Andy Wingo [Fri, 18 Nov 2011 10:32:24 +0000 (11:32 +0100)]
record-type-vtable is not a new root of the vtable hierarchy

* module/ice-9/boot-9.scm (record-type-vtable): Simplify to use
  make-vtable instead of make-vtable-vtable.

11 years agoScheme standard-vtable-fields binding
Andy Wingo [Fri, 18 Nov 2011 10:31:52 +0000 (11:31 +0100)]
Scheme standard-vtable-fields binding

* libguile/struct.c (scm_init_struct): Export standard-vtable-fields to
  Scheme.

11 years agoadd Scheme binding for scm_standard_vtable_vtable
Andy Wingo [Fri, 18 Nov 2011 10:15:43 +0000 (11:15 +0100)]
add Scheme binding for scm_standard_vtable_vtable

* libguile/struct.c (scm_init_struct): Export <standard-vtable> to
  Scheme.

11 years agosimplify scm_init_print
Andy Wingo [Fri, 18 Nov 2011 09:50:35 +0000 (10:50 +0100)]
simplify scm_init_print

* libguile/print.c (scm_init_print): Simplify creation of print-state
  vtable.

11 years agodeprecate struct-vtable-tag
Andy Wingo [Fri, 6 Jul 2012 16:12:59 +0000 (18:12 +0200)]
deprecate struct-vtable-tag

* libguile/deprecated.c:
* libguile/deprecated.h:
* libguile/struct.c:
* libguile/struct.h:
* doc/ref/api-compound.texi: Deprecate struct-vtable-tag.

11 years agodisable some uri tests if --disable-networking
Andy Wingo [Fri, 6 Jul 2012 15:45:23 +0000 (17:45 +0200)]
disable some uri tests if --disable-networking

* test-suite/tests/web-uri.test: Disable some tests if we don't have
  inet-pton.

11 years agoadd --match pattern to git-version-gen
Andy Wingo [Fri, 6 Jul 2012 14:13:57 +0000 (16:13 +0200)]
add --match pattern to git-version-gen

* configure.ac: Add --match pattern so we only get v2.0.x tagx.

11 years agogit-version-gen: add --match argument
Andy Wingo [Fri, 6 Jul 2012 13:51:05 +0000 (15:51 +0200)]
git-version-gen: add --match argument

* build-aux/git-version-gen (Options): Add --match argument.
  (v_from_git): Remove path without --match.

11 years agoupdate git-version-gen from gnulib
Andy Wingo [Fri, 6 Jul 2012 13:17:07 +0000 (15:17 +0200)]
update git-version-gen from gnulib

* build-aux/git-version-gen: Import from gnulib.

11 years agofixed repl command ,describe to also handle syntax
Daniel Krueger [Wed, 28 Mar 2012 16:25:15 +0000 (18:25 +0200)]
fixed repl command ,describe to also handle syntax

11 years agoAdd alignment for Sun Studio 12
Dagobert Michelsen [Mon, 6 Feb 2012 08:45:41 +0000 (09:45 +0100)]
Add alignment for Sun Studio 12

11 years agomore uri-related ipv6 fixes
Andy Wingo [Fri, 6 Jul 2012 11:13:19 +0000 (13:13 +0200)]
more uri-related ipv6 fixes

* module/web/uri.scm (ipv6-regexp): IPv6 numeric addresses do not have
  brackets.  It's only in URIs that they have them.
  (ipv6-host-pat, authority-regexp, parse-authority): Refactor ipv6
  detection to fix a bug with |, and to extract IPv6 hosts from their
  brackets.  This way we can pass the uri-host directly to inet-pton.
  (uri->string): If the host contains a `:', assume it is ipv6 and add
  brackets.

* test-suite/tests/web-uri.test ("build-uri"): Adapt tests to assume
  that the address returned by uri-host and passed to build-uri #:host
  does not have brackets.

11 years agoenhance IPv6 support
Daniel Hartwig [Fri, 30 Dec 2011 16:16:42 +0000 (00:16 +0800)]
enhance IPv6 support

* module/web/uri.scm (valid-host?): Support dotted-quad notation
  in IPv6 addresses.
  (parse-authority): Support IPv6 literals.
* test-suite/tests/web-uri.test: Add and fix tests.

11 years agosupport URIs with domain names starting with numbers
Daniel Hartwig [Fri, 30 Dec 2011 09:49:37 +0000 (17:49 +0800)]
support URIs with domain names starting with numbers

* module/web/uri.scm (valid-host?): Fix regexp to support
domain names starting with numbers.
* test-suite/tests/web-uri.scm: Add tests for above and
IP literals.

11 years agofix typo in web.texi
Andy Wingo [Fri, 6 Jul 2012 10:23:39 +0000 (12:23 +0200)]
fix typo in web.texi

* doc/ref/web.texi (HTTP Headers): Fix typo in example.  Fixes
  http://bugs.gnu.org/10890.

11 years agobetter procedure-arguments for interpreted procs with opt, rest, kwargs
Andy Wingo [Fri, 6 Jul 2012 10:19:12 +0000 (12:19 +0200)]
better procedure-arguments for interpreted procs with opt, rest, kwargs

* module/ice-9/session.scm (procedure-arguments): Arrange to interpret
  numbers in the "req" and "opt" positions of an 'arglist as N arguments
  with unknown name.

* module/ice-9/eval.scm (primitive-eval): Set 'arglist on "complex"
  procedures.  Fixes http://bugs.gnu.org/10922.

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

11 years agoadd check for fchmod
Andy Wingo [Fri, 6 Jul 2012 09:01:51 +0000 (11:01 +0200)]
add check for fchmod

* configure.ac: Add a check for fchmod.

* libguile/filesys.c (scm_chmod): Guard the fchmod case with
  HAVE_FCHMOD.

11 years agoremove mkdir alias in filesys.c for mingw
Andy Wingo [Fri, 6 Jul 2012 08:56:02 +0000 (10:56 +0200)]
remove mkdir alias in filesys.c for mingw

* libguile/filesys.c (mkdir): Remove alias, as gnulib handles this for
  us.

11 years agofix warnings in mingw in expand.c
Andy Wingo [Fri, 6 Jul 2012 08:50:31 +0000 (10:50 +0200)]
fix warnings in mingw in expand.c

* libguile/expand.c (VOID_, CONST_): Add trailing underscores to avoid
  name conflicts on MinGW.

11 years agofix warning about vsnprintf on mingw
Andy Wingo [Fri, 6 Jul 2012 08:43:29 +0000 (10:43 +0200)]
fix warning about vsnprintf on mingw

* libguile/deprecation.c: Remove a vsnprintf alias for mingw, now that
  gnulib handles it correctly.

11 years agobe sure to include time.h for struct timespec
Andy Wingo [Fri, 6 Jul 2012 08:43:02 +0000 (10:43 +0200)]
be sure to include time.h for struct timespec

* libguile/gen-scmconfig.c: The GNU libc manual says that struct
  timespec is defined in time.h.  So, just include both sys/time.h and
  time.h, if they are available.

11 years agofix `vector' instruction emission for big vectors
Andy Wingo [Thu, 5 Jul 2012 21:26:38 +0000 (23:26 +0200)]
fix `vector' instruction emission for big vectors

* module/language/glil/compile-assembly.scm (dump-constants): Only use
  the `vector' instruction for vectors whose length can fit in 16 bits.

  Fixes http://bugs.gnu.org/11087.

11 years agofix-letrec uses effects.scm for effects analysis
Andy Wingo [Thu, 5 Jul 2012 18:40:56 +0000 (20:40 +0200)]
fix-letrec uses effects.scm for effects analysis

* module/language/tree-il/fix-letrec.scm: Use effects.scm for effects
  analysis, instead of primitives.scm.
  (simple-expression?, partition-vars): Adapt.

11 years agosimplify one kind of degenerate prompt
Andy Wingo [Thu, 5 Jul 2012 18:39:16 +0000 (20:39 +0200)]
simplify one kind of degenerate prompt

* module/language/tree-il/peval.scm (<operand>): Instead of having a
  `residualize?' field, have it be a use count.
  (peval): Adapt to <operand> change.  Add function to kill uses of an
  operand.  Use it in the <prompt> inliner.  Add another kind of
  degenerate prompt to elide.  We should really switch to CPS though, as
  that will allow us to contify more aggressively.

* test-suite/tests/peval.test ("partial evaluation"): Adapt (while #t
  #t) test, which was sensitive to how far the recursive inlining got.
  Add a test for the degenerate prompt elision.

11 years agofix bugs in effects analysis of "effect+exception-free-primitives"
Andy Wingo [Thu, 5 Jul 2012 18:34:28 +0000 (20:34 +0200)]
fix bugs in effects analysis of "effect+exception-free-primitives"

* module/language/tree-il/effects.scm (make-effects-analyzer): Be more
  precise regarding the effects of the so-called
  effect+exception-free-primitives: now we check their arities.

* test-suite/tests/cse.test ("cse"): Add a test that we don't
  elide (cons 1 2 3) in effect context.

11 years agooptimize (apply foo 0 (list 1 2)) => (foo 0 1 2)
Andy Wingo [Thu, 5 Jul 2012 18:30:18 +0000 (20:30 +0200)]
optimize (apply foo 0 (list 1 2)) => (foo 0 1 2)

* module/language/tree-il/peval.scm (peval): Inline applications where
  we know the contents of the tail.

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

11 years agocompile ecmascript's `return' as an abort
Andy Wingo [Thu, 5 Jul 2012 09:06:29 +0000 (11:06 +0200)]
compile ecmascript's `return' as an abort

* module/language/ecmascript/compile-tree-il.scm (current-return-tag):
  (with-return-prompt, comp): Compile `return' as an abort instead of a
  primcall to `return'.  Fixes beta-reduction by the optimizer -- it
  doesn't make sense for `return' to move from one function to another!

11 years agofix goops compilation when current language is not scheme
Andy Wingo [Thu, 5 Jul 2012 08:15:02 +0000 (10:15 +0200)]
fix goops compilation when current language is not scheme

* module/oop/goops/dispatch.scm (compute-dispatch-procedure): Set source
  language to Scheme, not (current-language).

11 years agoadd scm_c_nvalues to news
Andy Wingo [Wed, 4 Jul 2012 15:54:57 +0000 (17:54 +0200)]
add scm_c_nvalues to news

* NEWS: Add scm_c_nvalues.

11 years agoadd scm_c_nvalues with docs; also, docs for scm_c_values
Andy Wingo [Wed, 4 Jul 2012 15:48:06 +0000 (17:48 +0200)]
add scm_c_nvalues with docs; also, docs for scm_c_values

* libguile/values.h:
* libguile/values.c (scm_c_nvalues): New function.

* doc/ref/api-control.texi (Multiple Values): Add docs for scm_c_values
  and scm_c_nvalues.

Fixes http://bugs.gnu.org/11764.

11 years agoadd scm_{to,from}_pointer docs
Andy Wingo [Wed, 4 Jul 2012 15:43:53 +0000 (17:43 +0200)]
add scm_{to,from}_pointer docs

* doc/ref/api-foreign.texi: Add documentation for scm_to_pointer and
  scm_from_pointer.