bpt/guile.git
12 years agoadd when, unless
Andy Wingo [Fri, 20 Jan 2012 18:47:02 +0000 (19:47 +0100)]
add when, unless

* module/ice-9/boot-9.scm (when, unless): New forms.

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

* doc/ref/r6rs.texi:
* doc/ref/scheme-ideas.texi:
* doc/ref/srfi-modules.texi: Update referrers.

12 years agoavoid gensym when making labels in psyntax
Andy Wingo [Thu, 19 Jan 2012 12:08:19 +0000 (13:08 +0100)]
avoid gensym when making labels in psyntax

* module/ice-9/psyntax.scm (gen-label): Avoid gensym, as we don't need
  to make symbols.

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

12 years agoadd syntax-local-binding
Andy Wingo [Sun, 15 Jan 2012 16:51:02 +0000 (17:51 +0100)]
add syntax-local-binding

* module/ice-9/boot-9.scm (syntax-local-binding): New binding.

* module/ice-9/psyntax.scm: Locally define a fluid that holds the
  "transformer environment".  with-transformer-environment calls a
  procedure with the transformer environment, or raises an error if
  called outside the extent of a transformer.  Bind
  transformer-environment in expand-macro.
  (resolve-identifier): Backport this helper from master.
  (syntax-local-binding): New procedure to return binding information of
  a bound identifier (a lexical, macro, a pattern variable, a displaced
  lexical, a global, or some other form).

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

* doc/ref/api-macros.texi (Syntax Transformer Helpers): Add docs for
  syntax-local-binding, and syntax-source, and move some other
  descriptions to this new section.

12 years agoAdd `scm_c_value_ref' to allow access to multiple returned values from C
Mark H Weaver [Wed, 18 Jan 2012 22:52:43 +0000 (17:52 -0500)]
Add `scm_c_value_ref' to allow access to multiple returned values from C

Based on a patch by Julian Graham <julian@member.fsf.org>

* libguile/values.c, libguile/values.h (scm_c_value_ref): New function.
* doc/ref/api-control.texi (Multiple Values): Add documentation.
* test-suite/standalone/test-scm-values.c: New test program.
* test-suite/standalone/Makefile.am: Add test-scm-values test.

12 years agoUpdate Gnulib to v0.0-6827-g39c3009; use the `dirfd' module.
Ludovic Courtès [Mon, 16 Jan 2012 22:49:21 +0000 (23:49 +0100)]
Update Gnulib to v0.0-6827-g39c3009; use the `dirfd' module.

* m4/gnulib-cache.m4: Use `dirfd'.

* libguile/filesys.c: Include Gnulib's <dirent.h> directly.
  (dirfd): Remove.  Suggested by Bruno Haible <bruno@clisp.org>.

12 years agoImprove wording in README regarding `pkg-config'.
Ludovic Courtès [Mon, 16 Jan 2012 21:17:50 +0000 (22:17 +0100)]
Improve wording in README regarding `pkg-config'.

* README: Mention $PKG_CONFIG_PATH, and make it clear that $BDW_GC_LIBS,
  etc. aren't normally needed.

12 years agoFix typo in threads.c on IA64.
Ludovic Courtès [Mon, 16 Jan 2012 21:16:34 +0000 (22:16 +0100)]
Fix typo in threads.c on IA64.

* libguile/threads.c (guilify_self_1)[__ia64__]: Fix typo.  Reported by
  Bruno Haible <bruno@clisp.org>.

12 years agoSkip `tr_TR' tests on Solaris 2.10.
Ludovic Courtès [Mon, 16 Jan 2012 20:09:21 +0000 (21:09 +0100)]
Skip `tr_TR' tests on Solaris 2.10.

* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved):
  Special-case Solaris 2.10.

12 years agoAdd #ifdefs for langinfo items that don't exist on OpenBSD.
Chris K. Jester-Young [Sun, 15 Jan 2012 18:59:49 +0000 (13:59 -0500)]
Add #ifdefs for langinfo items that don't exist on OpenBSD.

* libguile/i18n.c (define_langinfo_items): Add #ifdefs for ERA_* and
  ALT_DIGITS, as those constants don't exist on OpenBSD.

12 years agoCall scm-error with the correct argument order.
Chris K. Jester-Young [Fri, 14 Oct 2011 04:27:27 +0000 (00:27 -0400)]
Call scm-error with the correct argument order.

* module/ice-9/boot-9.scm (catch, with-throw-handler): Switch the order
  of the error key and function name arguments.

12 years agoHave `statprof.test' fail gracefully when samples could not be collected.
Ludovic Courtès [Sat, 14 Jan 2012 22:02:03 +0000 (23:02 +0100)]
Have `statprof.test' fail gracefully when samples could not be collected.

* test-suite/tests/statprof.test ("statistical sample counts within
  expected range"): Throw unresolved when one of A-DATA, B-DATA, and
  C-DATA is #f, which means samples were not collected for this one.

12 years agoAvoid non-portable `tail' argument in `test-guile-snarf'.
Ludovic Courtès [Sat, 14 Jan 2012 21:25:59 +0000 (22:25 +0100)]
Avoid non-portable `tail' argument in `test-guile-snarf'.

* test-suite/standalone/test-guile-snarf (strip_first_line): New
  function.
  (snarf): Use it.

12 years agoFix signed/unsigned pointer mismatches.
Ludovic Courtès [Sat, 14 Jan 2012 21:22:22 +0000 (22:22 +0100)]
Fix signed/unsigned pointer mismatches.

* libguile/foreign.c (scm_pointer_to_bytevector,
  scm_bytevector_to_pointer): Use pointers of the same signedness.

12 years agoDon't diverge when serializing cyclic lists during compilation
Mark H Weaver [Sat, 14 Jan 2012 09:28:16 +0000 (04:28 -0500)]
Don't diverge when serializing cyclic lists during compilation

* module/language/glil/compile-assembly.scm (scheme-list?): Don't
  diverge when serializing cyclic lists.

12 years agoFix serialization of #nil-terminated lists during compilation
Mark H Weaver [Sat, 14 Jan 2012 08:27:35 +0000 (03:27 -0500)]
Fix serialization of #nil-terminated lists during compilation

* module/language/glil/compile-assembly.scm (scheme-list?): New
  predicate, like `list?' but requires that the last cdr must be '(),
  not #nil.

  (dump-object, dump-constants): Use `list' opcode to create a list only
  if it is terminated by '().  If it's terminated by #nil, we must use
  the more general `cons' opcode.

12 years agofix array printing
Andy Wingo [Thu, 12 Jan 2012 14:15:41 +0000 (15:15 +0100)]
fix array printing

* libguile/print.c (iprin1): Fix unmatched ENTER_NESTED_DATA.  Fixes
  http://debbugs.gnu.org/10482.  Thanks to Daniel Llorens for the
  report.

12 years agoupdate NEWS
Andy Wingo [Wed, 11 Jan 2012 23:39:50 +0000 (00:39 +0100)]
update NEWS

* NEWS: Minor edits.  Remove a THANKS; we need to assemble a larger
  THANKS for this release.

12 years agoMake sure `scm_spawn_thread' returns a thread.
Ludovic Courtès [Wed, 11 Jan 2012 23:38:22 +0000 (00:38 +0100)]
Make sure `scm_spawn_thread' returns a thread.

* libguile/threads.c (scm_spawn_thread): Add an assertion that
  DATA.thread is a thread.  This assertion is sometimes hit on
  x86_64-freebsd8.2.

12 years agoDisable statprof tests on platforms that lack `ITIMER_PROF' support.
Ludovic Courtès [Tue, 10 Jan 2012 20:44:32 +0000 (21:44 +0100)]
Disable statprof tests on platforms that lack `ITIMER_PROF' support.

* test-suite/tests/statprof.test (when-implemented): New macro.
  ("statistical sample counts within expected range", "accurate call
  counting"): Use it.

12 years agoupdate NEWS
Andy Wingo [Wed, 11 Jan 2012 23:32:11 +0000 (00:32 +0100)]
update NEWS

* NEWS: Update.

12 years agoprint-options doc update
Andy Wingo [Wed, 11 Jan 2012 23:32:00 +0000 (00:32 +0100)]
print-options doc update

* doc/ref/api-evaluation.texi (Scheme Write): Update print-options.

12 years agofluids.c docstring
Andy Wingo [Wed, 11 Jan 2012 23:10:44 +0000 (00:10 +0100)]
fluids.c docstring

* libguile/fluids.c (scm_make_fluid_with_default): Update docstring.

12 years agoMove parameters documentation to core
Andy Wingo [Wed, 11 Jan 2012 23:10:25 +0000 (00:10 +0100)]
Move parameters documentation to core

* doc/ref/api-scheduling.texi (Fluids and Dynamic States): Update for
  default values.
  (Parameters): Move here from srfi-39, and adapt.

12 years agoadd docs for scm_gc_register_allocation
Andy Wingo [Wed, 11 Jan 2012 23:09:39 +0000 (00:09 +0100)]
add docs for scm_gc_register_allocation

* doc/ref/api-memory.texi: Update for scm_gc_register_allocation.
  Remove docs for scm_gc_{un,}register_collectable_memory.

12 years agoRemove docs `procedure-environment', which no longer exists
Mark H Weaver [Tue, 10 Jan 2012 20:59:49 +0000 (15:59 -0500)]
Remove docs `procedure-environment', which no longer exists

* doc/ref/api-procedures.texi (Procedure Properties): Remove the entry
  for `procedure-environment', which no longer exists.

12 years agoUse a common null stringbuf in `scm_i_make_string'
Mark H Weaver [Tue, 10 Jan 2012 15:13:43 +0000 (10:13 -0500)]
Use a common null stringbuf in `scm_i_make_string'

* libguile/strings.c (scm_i_make_string): Use a common null stringbuf
  for newly-allocated empty strings.

12 years agoEmpty substrings no longer reference the original stringbuf
Mark H Weaver [Tue, 10 Jan 2012 14:39:57 +0000 (09:39 -0500)]
Empty substrings no longer reference the original stringbuf

* libguile/strings.c (scm_i_substring, scm_i_substring_read_only,
  scm_i_substring_shared): When asked to create an empty substring,
  return a freshly allocated null string.  Previously, an empty
  substring needlessly held a reference to the original stringbuf.

12 years agoscm_i_substring_copy tries to narrow the substring
Mark H Weaver [Tue, 10 Jan 2012 12:50:28 +0000 (07:50 -0500)]
scm_i_substring_copy tries to narrow the substring

* libguile/strings.c (scm_i_substring_copy): Try to narrow the substring
  if it came from a wide string.

12 years agoAvoid calling `u32_conv_from_encoding' on the null string
Mark H Weaver [Tue, 10 Jan 2012 11:18:31 +0000 (06:18 -0500)]
Avoid calling `u32_conv_from_encoding' on the null string

* libguile/strings.c (scm_from_stringn): Avoid calling
  `u32_conv_from_encoding' on the null string, by using the same
  fast-path code used if (encoding == NULL).  This is an optimization,
  and also avoids any possible encoding errors.

12 years agoTypo in documentation of local-boxed-set
Mike Gran [Tue, 10 Jan 2012 05:35:41 +0000 (21:35 -0800)]
Typo in documentation of local-boxed-set

* doc/ref/vm.texi: modified

12 years agoRemove null string optimization from scm_from_stringn
Mark H Weaver [Mon, 9 Jan 2012 23:24:22 +0000 (18:24 -0500)]
Remove null string optimization from scm_from_stringn

* libguile/strings.c (scm_from_stringn): Always return a freshly
  allocated string from scm_from_stringn, even when asked to construct
  the null string, in accordance with the R5RS.  Previously, we
  optimized the null string case by returning a reference to a global
  null string object (scm_nullstr).

12 years agopermit non-date values for Expires header
Daniel Hartwig [Tue, 27 Dec 2011 14:24:28 +0000 (22:24 +0800)]
permit non-date values for Expires header

* module/web/http.scm ("Expires"): Permit (some) non-date values.

12 years agoHave `cpu-word-size' error out on unknown CPUs; add support for MIPSEL.
Ludovic Courtès [Mon, 9 Jan 2012 22:25:02 +0000 (23:25 +0100)]
Have `cpu-word-size' error out on unknown CPUs; add support for MIPSEL.

* module/system/base/target.scm (cpu-word-size): Add support for
  `mipsel'.  Call `error' when CPU is unknown.

12 years agoMake sure `regexp-quote' tests use Unicode-capable string ports.
Ludovic Courtès [Mon, 9 Jan 2012 22:16:20 +0000 (23:16 +0100)]
Make sure `regexp-quote' tests use Unicode-capable string ports.

* test-suite/tests/regexp.test (with-unicode): New macro.
  ("regexp-quote"): Wrap all `regexp-quote' calls in it.  This fixes
  tests on machines where the default port encoding is US-ASCII.

12 years agoFix incorrect use of `SCM_UNPACK'.
Ludovic Courtès [Mon, 9 Jan 2012 21:16:49 +0000 (22:16 +0100)]
Fix incorrect use of `SCM_UNPACK'.

* libguile/arrays.c (scm_i_make_array): Cast the result of
  `scm_gc_malloc' directly to `scm_t_bits'.

12 years agoi18n: Fix gc_malloc/free mismatch on non-GNU systems.
Ludovic Courtès [Mon, 9 Jan 2012 20:23:07 +0000 (21:23 +0100)]
i18n: Fix gc_malloc/free mismatch on non-GNU systems.

* libguile/i18n.c (scm_i_locale_free): Remove.
  (smob_locale_free): Define only when USE_GNU_LOCALE_API.
  (scm_make_locale)[!USE_GNU_LOCALE_API]: Allocate
  `c_locale->locale_name' with `scm_gc_strdup', not `malloc'.

12 years agoi18n: Disable Turkish locale tests on FreeBSD 8.
Ludovic Courtès [Mon, 9 Jan 2012 20:20:21 +0000 (21:20 +0100)]
i18n: Disable Turkish locale tests on FreeBSD 8.

* test-suite/tests/i18n.test (under-turkish-utf8-locale-or-unresolved):
  Check %HOST-TYPE and throw `unresolved' on FreeBSD 8.

12 years agoFix loose typing in `test-scm-spawn-thread.c'.
Ludovic Courtès [Mon, 9 Jan 2012 00:16:16 +0000 (01:16 +0100)]
Fix loose typing in `test-scm-spawn-thread.c'.

* test-suite/standalone/test-scm-spawn-thread.c (inner_main): Use
  `SCM2PTR' instead of a cast.

12 years agoallocate a tc7 to bitvectors
Andy Wingo [Mon, 9 Jan 2012 16:52:46 +0000 (17:52 +0100)]
allocate a tc7 to bitvectors

* libguile/tags.h (scm_tc7_bitvector): Allocate a tc7 to bitvectors.

* libguile/print.c (iprin1):
* libguile/goops.c:
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/eq.c (scm_equal_p): Add cases for bitvectors.

* libguile/bitvectors.h: Declare internal print and equal? helpers.

* libguile/bitvectors.c: Use a tc7 instead of a smob type.

12 years agoallocate a tc7 to arrays
Andy Wingo [Mon, 9 Jan 2012 16:24:57 +0000 (17:24 +0100)]
allocate a tc7 to arrays

* libguile/tags.h (scm_tc7_array): Allocate a tag for arrays.
* libguile/arrays.h (SCM_I_ARRAYP): Change to use scm_tc7_array.  The
  previous definition was not externally usable because scm_i_tc16_array
  was internal.
  (scm_i_print_array): Declare, though internally.

* libguile/arrays.c (scm_i_make_array): Use scm_cell with the tc7
  instead of NEWSMOB.
  (scm_i_print_array): Make not static.
  (SCM_ARRAY_IMPLEMENTATION): Adapt.
  (scm_init_arrays): Remove array smob declaration.

* libguile/eq.c (scm_equal_p): Refactor to put the string, pointer, and
  bytevector cases in the switch.  Add a case for arrays.

* libguile/goops.c: Add <array> declarations.

* libguile/print.c (iprin1): Call scm_i_print_array as needed.

* libguile/evalext.c (scm_self_evaluating_p): Add a case for arrays.

12 years agoprimitive-load returns the value(s) of the last expression
Andy Wingo [Mon, 9 Jan 2012 15:07:46 +0000 (16:07 +0100)]
primitive-load returns the value(s) of the last expression

* libguile/load.c (scm_primitive_load): Return the values yielded from
  evaluating the last expression in the file.

* test-suite/tests/load.test ("return value of `load'"): Add tests.

12 years agoDefine _GNU_SOURCE to fix the GNU/kFreeBSD build.
Rob Browning [Sat, 23 Apr 2011 19:57:50 +0000 (14:57 -0500)]
Define _GNU_SOURCE to fix the GNU/kFreeBSD build.

Author: Petr Salinger <Petr.Salinger@seznam.cz>
Closes: #401168

12 years agoFix the SRFI 60 copy-bit documentation.
Rob Browning [Sat, 23 Apr 2011 19:57:49 +0000 (14:57 -0500)]
Fix the SRFI 60 copy-bit documentation.

12 years agotest-pthread-create-secondary: gc/gc.h, not gc/gc_version.h
Andy Wingo [Mon, 9 Jan 2012 14:38:51 +0000 (15:38 +0100)]
test-pthread-create-secondary: gc/gc.h, not gc/gc_version.h

* test-suite/standalone/test-pthread-create-secondary.c: Include
  gc/gc.h.  It works on libgc from git, and on 7.1.

12 years agoAvoid calling scm_i_string_start_writing if no chars will be mutated
Mark H Weaver [Mon, 9 Jan 2012 01:02:09 +0000 (20:02 -0500)]
Avoid calling scm_i_string_start_writing if no chars will be mutated

* libguile/srfi-13.c (scm_string_copy_x, scm_substring_fill_x,
  string_upcase_x, string_downcase_x, string_titlecase_x,
  string_reverse_x, scm_string_xcopy_x): Avoid calling
  `scm_i_string_start_writing' if the range of indices to be modified is
  empty.  This avoids the error that would be raised by
  `scm_i_string_start_writing' if the string is not mutable.
  Thanks to Bruce Korb <bkorb@gnu.org> for reporting this problem
  and suggesting the fix.

12 years agono need to warn people off of s_FOO generated by SCM_DEFINE
Andy Wingo [Sun, 8 Jan 2012 16:55:01 +0000 (17:55 +0100)]
no need to warn people off of s_FOO generated by SCM_DEFINE

* doc/ref/libguile-snarf.texi (Function Snarfing): The s_FOO binding
  isn't deprecated; no need to warn people to stop using it.  Thanks to
  Peter Brett for the hint.

12 years agoallow scm_display_error to use a stack as the first argument
Andy Wingo [Sun, 8 Jan 2012 15:37:22 +0000 (16:37 +0100)]
allow scm_display_error to use a stack as the first argument

* libguile/backtrace.c (scm_display_error): Allow a deprecated use of
  this function to pass a stack as the first argument.  Thanks to Peter
  Brett for pointing it out, in
  http://lists.gnu.org/archive/html/guile-user/2011-06/msg00000.html.

12 years agoFix typo in `test-num2integral.c'.
Ludovic Courtès [Sun, 8 Jan 2012 15:08:45 +0000 (16:08 +0100)]
Fix typo in `test-num2integral.c'.

* test-suite/standalone/test-num2integral.c (out_of_range_handler): Use
  `scm_is_eq' when comparing KEY.

12 years agoftw: Add an `error' parameter to `file-system-fold'.
Ludovic Courtès [Sun, 8 Jan 2012 15:06:35 +0000 (16:06 +0100)]
ftw: Add an `error' parameter to `file-system-fold'.

* module/ice-9/ftw.scm (errno-if-exception): New macro.
  (file-system-fold): Add an `error' parameter.  Wrap `opendir' and STAT
  calls in `errno-if-exception' and call ERROR when appropriate.
  (file-system-tree): Provide an `error' procedure.  Return #f when
  FILE-NAME is unreadable.
  (scandir): Provide an `error' procedure.

* test-suite/tests/ftw.test (%top-builddir): New variable.
  (make-file-tree, delete-file-tree): New procedures.
  (with-file-tree): New macro.
  ("file-system-fold"): Update tests to add an `error' procedure.
  ["ENOENT", "EACCES", "dangling symlink and lstat", "dangling symlink
  and stat"]: New tests.
  ("file-system-tree")["ENOENT"]: New test.
  ("scandir")["EACCES"]: New test.

* doc/ref/misc-modules.texi (File Tree Walk): Update `file-system-fold'
  documentation.

12 years agofix SCM_ASRTGO deprecation
Andy Wingo [Sun, 8 Jan 2012 15:01:28 +0000 (16:01 +0100)]
fix SCM_ASRTGO deprecation

* libguile/__scm.h (SCM_ASRTGO): Whoops, actually remove the ASRTGO
  definitions here.
* libguile/deprecated.h: Fix type of scm_i_deprecated_asrtgo.

12 years agosyntax parameters doc formatting
Andy Wingo [Sun, 8 Jan 2012 13:36:17 +0000 (14:36 +0100)]
syntax parameters doc formatting

* doc/ref/api-macros.texi (Syntax Parameters): Some copy-editing on
  Ian's lovely syntax-parameters documentation.

12 years agodeprecate SCM_ASRTGO
Andy Wingo [Sun, 8 Jan 2012 13:27:03 +0000 (14:27 +0100)]
deprecate SCM_ASRTGO

* libguile/deprecated.h: Mark scm_immutable_cell and
  scm_immutable_double_cell as being SCM_DEPRECATED, not SCM_API.
  Deprecate SCM_ASRTGO.

* libguile/deprecated.c (scm_i_deprecated_asrtgo): New support
  procedure.

* doc/ref/api-control.texi (Handling Errors): Remove ASRTGO docs.

12 years agodocument syntax parameters
Ian Price [Sat, 7 Jan 2012 01:59:33 +0000 (01:59 +0000)]
document syntax parameters

* doc/ref/api-macros.texi (Macros): Add subsection for "Syntax Parameters"

12 years agoFix bugs related to mutation-sharing substrings
Mark H Weaver [Wed, 4 Jan 2012 22:59:27 +0000 (17:59 -0500)]
Fix bugs related to mutation-sharing substrings

* libguile/strings.c (scm_i_is_narrow_string, scm_i_try_narrow_string,
  scm_i_string_set_x): Check to see if the provided string is a
  mutation-sharing substring, and do the right thing in that case.
  Previously, if such a string was passed to these functions, they would
  behave very badly: while trying to fetch and/or mutate the cell
  containing the stringbuf, they were actually fetching or mutating the
  cell containing the original shared string.  That's because
  mutation-sharing substrings store the original string in CELL_1,
  whereas all other strings store the stringbuf there.

12 years agoMake scm_nullstr mutable
Mark H Weaver [Fri, 6 Jan 2012 23:39:04 +0000 (18:39 -0500)]
Make scm_nullstr mutable

* libguile/strings.c (scm_init_strings): Make scm_nullstr mutable.  It
  is still usable as a common object, because of course it contains no
  characters to mutate anyway.  It is returned by several procedures
  that are specified to return mutable strings, and string mutators
  raise errors when passed an immutable string, even if it is the null
  string.

12 years agodon't leak file descriptors when mmaping objcode
Andy Wingo [Sat, 7 Jan 2012 01:07:09 +0000 (02:07 +0100)]
don't leak file descriptors when mmaping objcode

* libguile/objcodes.c (make_objcode_from_file): Close the mmap'd file,
  so that we don't leak the descriptor.  I was previously under the
  mistaken impression that closing the fd unmapped the memory, which is
  not the case.  Thanks to Cedric Cellier for the tip!

12 years ago`write-request-line' writes absolute paths, not absolute URIs.
Ian Price [Thu, 29 Sep 2011 02:12:00 +0000 (03:12 +0100)]
`write-request-line' writes absolute paths, not absolute URIs.

* module/web/http.scm (write-request-line): RFC 2616 says that absolute
  paths are used to identify resources on an origin server.

12 years agoremove duplicate write-uri definition
Andy Wingo [Sat, 7 Jan 2012 00:26:00 +0000 (01:26 +0100)]
remove duplicate write-uri definition

* module/web/http.scm: Remove duplicate write-uri definition.

12 years agoupdate api-modules.texi
Andy Wingo [Fri, 6 Jan 2012 23:45:44 +0000 (00:45 +0100)]
update api-modules.texi

* doc/ref/api-modules.texi (Modules): Add subsection for "Modules and
  the File System".  Move "Included Guile Modules" to the end.  Move
  "Module System Reflection" after "Variables", as we need to know about
  variables.  Flesh out "Module System Reflection" a bit, with docs on
  module-ref, module-variable, and other bindings.  General editing.

12 years agodeprecate fluid-let-syntax in favor of syntax-parameterize
Andy Wingo [Sat, 5 Nov 2011 12:53:33 +0000 (13:53 +0100)]
deprecate fluid-let-syntax in favor of syntax-parameterize

* module/ice-9/psyntax.scm (syntax-parameterize): Rename from
  fluid-let-syntax.

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

* module/ice-9/boot-9.scm (define-inlinable): Use syntax-parameterize
  (and define-syntax-parameter).

* module/ice-9/deprecated.scm (fluid-let-syntax): Add deprecated shim.

12 years agoadd define-syntax-parameter, same as define-syntax
Andy Wingo [Sat, 5 Nov 2011 11:40:58 +0000 (12:40 +0100)]
add define-syntax-parameter, same as define-syntax

* module/ice-9/psyntax.scm (define-syntax-parameter): New toplevel form.
  Will be used to implement syntax parameters, following Barzilay,
  Culpepper, and Flatt's 2011 SFP workshop paper, "Keeping it Clean with
  syntax-parameterize".  Adds a new binding type and definition form.

Conflicts:

module/ice-9/psyntax.scm

12 years agoFix the exception type of the (begin) test.
Ludovic Courtès [Thu, 5 Jan 2012 22:49:01 +0000 (23:49 +0100)]
Fix the exception type of the (begin) test.

* test-suite/tests/syntax.test (exception:zero-expression-sequence): New
  variable.
  ("begin")["legal (begin)"]: Rename to "valid (begin)".
  ["illegal (begin)"]: Ditto.  Expect `exception:zero-expression-sequence'.

12 years agoPlacate a number of `syntax-check' verifications.
Ludovic Courtès [Thu, 5 Jan 2012 22:38:10 +0000 (23:38 +0100)]
Placate a number of `syntax-check' verifications.

  - "filesystem" -> "file system"
  - remove doubled words
  - use EXIT_* macros instead of literal numbers
  - update `syntax-check' exclusion files

12 years agoRegenerate `psyntax-pp.scm'.
Ludovic Courtès [Thu, 5 Jan 2012 22:10:02 +0000 (23:10 +0100)]
Regenerate `psyntax-pp.scm'.

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

12 years agoFix erroneous check in `set-procedure-properties!'.
Ludovic Courtès [Thu, 5 Jan 2012 21:51:07 +0000 (22:51 +0100)]
Fix erroneous check in `set-procedure-properties!'.

* libguile/procprop.c
  (scm_set_procedure_properties_x)[SCM_ENABLE_DEPRECATED == 1]: Pass arguments
  to `scm_assq' in the right order, and check its return value with
  `scm_is_true'.  Reported by Mike Gran <spk121@yahoo.com>.

12 years agoRaise an error for (begin) when `--disable-deprecated'.
Ludovic Courtès [Thu, 5 Jan 2012 21:38:06 +0000 (22:38 +0100)]
Raise an error for (begin) when `--disable-deprecated'.

* module/ice-9/psyntax.scm (define-expansion-constructors)[begin-form]:
  Emit a syntax-violation error for empty sequences when
  --disable-deprecated.

* test-suite/tests/syntax.test (pass-if-syntax-error): Fix typo in error
  message.

12 years agoFix docs of string mutators to do so on a mutable string
Mark H Weaver [Wed, 4 Jan 2012 18:43:47 +0000 (13:43 -0500)]
Fix docs of string mutators to do so on a mutable string

* doc/ref/api-data.texi (String Modification): Change
  (define y "abcdefg") => (define y (string-copy "abcdefg"))
  before mutating the string bound to y in the example code.

12 years agoRework c-api.test to use test lib
Mike Gran [Wed, 4 Jan 2012 16:02:05 +0000 (08:02 -0800)]
Rework c-api.test to use test lib

The failure path for the c-api.test had been to call the undefined function
'fail', instead of logging the error like the other tests.

* test-suite/tests/c-api.test: modified

12 years agodoc: Fix typo in `define-wrapped-pointer-type' example.
Ludovic Courtès [Tue, 3 Jan 2012 22:31:30 +0000 (23:31 +0100)]
doc: Fix typo in `define-wrapped-pointer-type' example.

* doc/ref/api-foreign.texi (Void Pointers and Byte Access): Fix typo in
  `define-wrapped-pointer-type' example.

12 years agoFix documentation for vhash-fold and vhash-fold-right
Mark H Weaver [Sat, 31 Dec 2011 04:26:32 +0000 (23:26 -0500)]
Fix documentation for vhash-fold and vhash-fold-right

* doc/ref/api-compound.texi (VHashes): Add missing `init' parameter in
  documentation for vhash-fold and vhash-fold-right, and also improve
  description.

* module/ice-9/vlist.scm (vhash-fold, vhash-fold-right): Rename formal
  parameter `seed' to `init', to match documentation.  Improve
  docstrings.

12 years agoFix comment summarizing allocation table
Mark H Weaver [Sat, 31 Dec 2011 04:11:30 +0000 (23:11 -0500)]
Fix comment summarizing allocation table

* module/language/tree-il/analyze.scm (analyze-lexicals): Fix comment,
  which describes the compiler's allocation table, to match reality.

12 years agoUpdate comment: ~/.guile-ccache => ~/.cache/guile/ccache
Mark H Weaver [Sat, 31 Dec 2011 04:07:15 +0000 (23:07 -0500)]
Update comment: ~/.guile-ccache => ~/.cache/guile/ccache

* module/system/base/compile.scm: Update comment to match
  where the ccache dir now lives: ~/.cache/guile/ccache

12 years agoNew array-map! and array-for-each tests
Daniel Llorens [Thu, 22 Dec 2011 22:13:07 +0000 (17:13 -0500)]
New array-map! and array-for-each tests

* ramap.test: New tests.
  - array-map! with noncompact arrays and more than one argument.
  - array-for-each with noncompact arrays and more than two arguments.

12 years agofix generalized-vector-{ref,set!} for slices
Andy Wingo [Thu, 22 Dec 2011 22:03:04 +0000 (17:03 -0500)]
fix generalized-vector-{ref,set!} for slices

* libguile/generalized-vectors.c (scm_c_generalized_vector_ref):
  (scm_c_generalized_vector_set_x): Fix for the case in which base was
  not 1, lbnd was not 0, or inc was not 1.

* test-suite/tests/arrays.test (array): Add a test.  Thanks to Daniel
  Llorens for the report.

12 years agofreebsd itanium support
Andy Wingo [Thu, 22 Dec 2011 15:30:45 +0000 (10:30 -0500)]
freebsd itanium support

* libguile/threads.c (scm_ia64_register_backing_store_base)
  (scm_ia64_ar_bsp): Provide implementation of these itanium helpers on
  freebsd.  Thanks to Jim Pryor.

12 years agofreebsd implementation of get_thread_stack_base
Andy Wingo [Thu, 22 Dec 2011 15:28:23 +0000 (10:28 -0500)]
freebsd implementation of get_thread_stack_base

* configure.ac: Check for pthread_np.h and pthread_attr_get_np.  Patch
  by Jim Pryor.
* libguile/threads.c (get_thread_stack_base): Provide an implementation
  for FreeBSD.

12 years agostdlib.h, not malloc.h
Andy Wingo [Thu, 22 Dec 2011 14:54:24 +0000 (09:54 -0500)]
stdlib.h, not malloc.h

* configure.ac: Remove check for malloc.h.

* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/mallocs.c:
* libguile/smob.c: Use stdlib instead of malloc.h.

12 years agoMake the "Dia Primitives" section of the manual more clear.
Andy Wingo [Thu, 22 Dec 2011 14:32:09 +0000 (09:32 -0500)]
Make the "Dia Primitives" section of the manual more clear.

* doc/ref/libguile-program.texi (Dia Primitives): Use
  scm_assert_smob_type, and update the text.

12 years agoHTTP: Fix qstring writing of cache-extension values
Andy Wingo [Thu, 22 Dec 2011 13:18:05 +0000 (08:18 -0500)]
HTTP: Fix qstring writing of cache-extension values

* module/web/http.scm ("Cache-Control"): Write string values using the
  default val writer, to get quoting correct.

* test-suite/tests/web-http.test (pass-if-round-trip): New helper.
  ("general headers"): Check that cache-extensions round trip properly.

12 years agoExtend handling of "Cache-Control" header.
Daniel Hartwig [Sun, 27 Nov 2011 14:37:24 +0000 (22:37 +0800)]
Extend handling of "Cache-Control" header.

* module/web/http.scm ("Cache-Control"): Value for `max-stale' is
  optional.  Strict validation for value-less directives (`no-store',
  etc.).  String values optional for "cache-extension" directives.
* test-suite/tests/web-http.test: Value for `max-stale' is optional.

12 years agopeval fix: (cons 1 #nil) is not (list 1)
Andy Wingo [Thu, 22 Dec 2011 03:04:18 +0000 (22:04 -0500)]
peval fix: (cons 1 #nil) is not (list 1)

* module/language/tree-il/peval.scm (peval): (cons FOO #nil) is not
  (cons FOO '()).

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

12 years agopeval minor tweak
Andy Wingo [Thu, 22 Dec 2011 01:15:57 +0000 (20:15 -0500)]
peval minor tweak

* module/language/tree-il/peval.scm (peval): Record residual values in
  both value and values contexts.  No test cases, it just seemed like a
  good idea.

12 years agodocument invalidity of (begin) as expression; add back-compat shim
Andy Wingo [Thu, 22 Dec 2011 01:10:42 +0000 (20:10 -0500)]
document invalidity of (begin) as expression; add back-compat shim

* doc/ref/api-control.texi (begin): Update to distinguish between
  splicing begin and sequencing begin.

* module/ice-9/psyntax.scm (expand-expr): Add a back-compatibility shim
  for `(begin)'.
* module/ice-9/psyntax-pp.scm: Regenerate.

* test-suite/tests/syntax.test: Update to run illegal (begin) test only
  if we are not including deprecated features.

12 years agoftw: Include sub-directories in the result of `scandir'.
Ludovic Courtès [Mon, 19 Dec 2011 21:25:30 +0000 (22:25 +0100)]
ftw: Include sub-directories in the result of `scandir'.

* module/ice-9/ftw.scm (scandir)[skip]: Keep NAME in the resulting list.

* test-suite/tests/ftw.test ("scandir")["top-srcdir"]: New test.

12 years agofix scm_protects deprecation warning
Andy Wingo [Mon, 19 Dec 2011 14:55:07 +0000 (15:55 +0100)]
fix scm_protects deprecation warning

* libguile/gc.c: Fix warning about scm_protects being deprecated.

12 years agofix peval to preserve effects when folding (values) forms
Andy Wingo [Mon, 19 Dec 2011 14:51:54 +0000 (15:51 +0100)]
fix peval to preserve effects when folding (values) forms

* module/language/tree-il/peval.scm (singly-valued-expression?): New
  helper.
  (truncate-values): Use the helper.
  (make-operand): Minor refactor.
  (set-operand-residual-value!): Try to undo the effects of (values
  FOO), if the continuation will check itself for the correct number of
  values.
  (peval): Fold helpers into fold-constant.  Add a constant-expression?
  case for (values FOO).  Add a new context: "values", for contexts in
  which multiple values are allowed, either because of being in a tail
  context relative to a function, or because of let-values.  "value" is
  now for single values.  Don't visit operands for "values", as their
  binding form truncates to one value.  Add a case to fold (values ...)
  forms.  Fix folding of (lambda), to process the cases in values
  context instead of tail context (which could have been "value", which
  would cause the procedure to truncate).

12 years agoftw: Fix typos/thinkos in `file-system-fold' and `scandir'.
Ludovic Courtès [Mon, 19 Dec 2011 08:18:42 +0000 (09:18 +0100)]
ftw: Fix typos/thinkos in `file-system-fold' and `scandir'.

* module/ice-9/ftw.scm (file-system-fold): Fix reference to STAT instead
  of ST.
  (scandir)[enter?]: Change the argument name to `dir', to avoid
  confusion.
  [skip]: Return RESULT, not #f.

12 years agoftw: Clarify the behavior of `scandir' for flat files and unreadable dirs.
Ludovic Courtès [Mon, 19 Dec 2011 08:11:43 +0000 (09:11 +0100)]
ftw: Clarify the behavior of `scandir' for flat files and unreadable dirs.

* module/ice-9/ftw.scm (scandir)[leaf]: Only add NAME when RESULT is a
  pair.
  [down]: Ignore RESULT.
  Start with #f instead of the empty list.

* test-suite/tests/ftw.test ("scandir")["flat file"]: New test.

* doc/ref/misc-modules.texi (File Tree Walk): Update `scandir'
  documentation accordingly.

12 years agoAdd a deprecated alias for $expt
Christian Persch [Thu, 24 Nov 2011 22:10:21 +0000 (23:10 +0100)]
Add a deprecated alias for $expt

* module/ice-9/deprecated.scm: Add alias for $expt. $expt was removed
  in commit 6fc4d0124d633d1b3ddc5af82967f23bd17556f8 but no deprecated
  alias was added in ad79736c68a803a59814fbfc0cb4b092c2b4cddf like for
  all the other deprecated $sin, $cos, ... functions.

12 years agoFFI: Properly unpack small integer return values in closure call.
Andreas Schwab [Sat, 3 Dec 2011 11:17:46 +0000 (12:17 +0100)]
FFI: Properly unpack small integer return values in closure call.

Fixes <http://debbugs.gnu.org/10203>.

* libguile/foreign.c (unpack): Add parameter return_value_p.
  Properly store integer return values smaller than int.
  (scm_i_foreign_call): Update call to unpack.
  (invoke_closure): Likewise.

12 years agodoc: Add link from `opendir' to (ice-9 ftw).
Ludovic Courtès [Sun, 18 Dec 2011 20:27:56 +0000 (21:27 +0100)]
doc: Add link from `opendir' to (ice-9 ftw).

* doc/ref/posix.texi (File System): Add link to "File Tree Walk".

12 years agodoc: Use `@deffn {Scheme Procedure}' in `misc-modules.texi'.
Ludovic Courtès [Sun, 18 Dec 2011 20:25:24 +0000 (21:25 +0100)]
doc: Use `@deffn {Scheme Procedure}' in `misc-modules.texi'.

* doc/ref/misc-modules.texi: Use `@deffn {Scheme Procedure}' instead of
  `@defun'.

12 years agoftw: Add `scandir'.
Ludovic Courtès [Sun, 18 Dec 2011 20:14:33 +0000 (21:14 +0100)]
ftw: Add `scandir'.

Suggested by Nala Ginrut <nalaginrut@gmail.com>.

* module/ice-9/ftw.scm (scandir): New procedure.
* test-suite/tests/ftw.test ("scandir"): New test prefix.
* doc/ref/misc-modules.texi (File Tree Walk): Document `scandir'.

12 years agoftw: Add an optional `stat' parameter to `file-system-fold' and `-tree'.
Ludovic Courtès [Thu, 15 Dec 2011 22:32:24 +0000 (23:32 +0100)]
ftw: Add an optional `stat' parameter to `file-system-fold' and `-tree'.

* module/ice-9/ftw.scm (file-system-fold): Add an optional `stat'
  parameter.  Use it instead of `lstat'.  Handle the case where (STAT child)
  fails.
  (file-system-tree): Likewise, and pass it to `file-system-fold'.

* doc/ref/misc-modules.texi (File Tree Walk): Update the documentation
  of these functions.

12 years agoArrange to convert command-line arguments from the right encoding.
Ludovic Courtès [Thu, 15 Dec 2011 00:23:23 +0000 (01:23 +0100)]
Arrange to convert command-line arguments from the right encoding.

This is a temporary workaround for the 2.0 stable series.  The next
stable series should have an implicit `setlocale (LC_ALL, "")' call,
which will make this unnecessary.

* libguile/feature.c (progargs_fluid): Rename to...
  (scm_program_arguments_fluid): ... this.  Update users.

* libguile/feature.h (scm_program_arguments_fluid): New internal
  declaration.

* libguile/init.c (invoke_main_func): Call
  `scm_i_set_boot_program_arguments' instead of
  `scm_set_program_arguments'.

* libguile/script.c (locale_arguments_to_string_list,
  scm_i_set_boot_program_arguments): New functions.
  (scm_compile_shell_switches): Use `locale_arguments_to_string_list'.

* libguile/script.h (scm_i_set_boot_program_arguments): New internal
  declaration.

* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add
  `test-command-line-encoding'.
* test-suite/standalone/test-command-line-encoding: New file.

12 years agoUse Gnulib's `localcharset', with local patches.
Ludovic Courtès [Thu, 15 Dec 2011 00:31:16 +0000 (01:31 +0100)]
Use Gnulib's `localcharset', with local patches.

This follows Bruno Haible's suggestion at
<http://lists.gnu.org/archive/html/guile-devel/2011-11/msg00055.html>.

* m4/gnulib-cache.m4: Add `gl_LOCAL_DIR'; use `localcharset'.

* Makefile.am (EXTRA_DIST): Add gnulib-local/lib/localcharset.[ch].diff.
  (TESTS_ENVIRONMENT): New variable.

* gnulib-local/lib/localcharset.c.diff,
  gnulib-local/lib/localcharset.h.diff: New files.

* test-suite/Makefile.am (TESTS_ENVIRONMENT): Add
  @LOCALCHARSET_TESTS_ENVIRONMENT@.
* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Likewise.

12 years agoAugment `.gitignore'.
Ludovic Courtès [Wed, 14 Dec 2011 22:33:24 +0000 (23:33 +0100)]
Augment `.gitignore'.

12 years agoUpdate Gnulib to v0.0-6703-g4e0358a.
Ludovic Courtès [Wed, 14 Dec 2011 22:02:29 +0000 (23:02 +0100)]
Update Gnulib to v0.0-6703-g4e0358a.

12 years agoUse `alignof_type' instead of `alignof'.
Ludovic Courtès [Wed, 14 Dec 2011 22:44:30 +0000 (23:44 +0100)]
Use `alignof_type' instead of `alignof'.

* libguile/foreign.c: Use `alignof_type' instead of `alignof'; the
  latter was removed from Gnulib's <alignof.h> in
  408e170e3ae81f73fb65686c5834693d89a96594 (Nov. 1 2011).
* libguile/vm-i-scheme.c: Likewise.

12 years agodoc: Set document encoding to UTF-8; typeset my surname correctly.
Ludovic Courtès [Wed, 14 Dec 2011 21:26:15 +0000 (22:26 +0100)]
doc: Set document encoding to UTF-8; typeset my surname correctly.

* doc/ref/guile.texi: Add @documentencoding.
* doc/ref/history.texi: Always write "Court@`es".
* doc/ref/preface.texi (Contributors): Likewise.