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

15149 commits

Author SHA1 Message Date
Ludovic Courtès
1acb290f66 Fix signed/unsigned pointer mismatches.
* libguile/foreign.c (scm_pointer_to_bytevector,
  scm_bytevector_to_pointer): Use pointers of the same signedness.
2012-01-14 22:22:22 +01:00
Mark H Weaver
c5f6c2e47f Don't diverge when serializing cyclic lists during compilation
* module/language/glil/compile-assembly.scm (scheme-list?): Don't
  diverge when serializing cyclic lists.
2012-01-14 04:39:00 -05:00
Mark H Weaver
39eb0b7297 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.
2012-01-14 03:27:35 -05:00
Andy Wingo
88c0a1d591 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.
2012-01-12 15:15:41 +01:00
Andy Wingo
486bd70d53 update NEWS
* NEWS: Minor edits.  Remove a THANKS; we need to assemble a larger
  THANKS for this release.
2012-01-12 00:42:46 +01:00
Ludovic Courtès
0f4f2d9a30 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.
2012-01-12 00:38:56 +01:00
Ludovic Courtès
ea3cef045a 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.
2012-01-12 00:38:56 +01:00
Andy Wingo
f41ef41680 update NEWS
* NEWS: Update.
2012-01-12 00:32:11 +01:00
Andy Wingo
e2e8ca4240 print-options doc update
* doc/ref/api-evaluation.texi (Scheme Write): Update print-options.
2012-01-12 00:32:00 +01:00
Andy Wingo
f43622a27b fluids.c docstring
* libguile/fluids.c (scm_make_fluid_with_default): Update docstring.
2012-01-12 00:10:44 +01:00
Andy Wingo
99db1bc2e2 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.
2012-01-12 00:10:25 +01:00
Andy Wingo
cd3370bac1 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.
2012-01-12 00:09:39 +01:00
Mark H Weaver
bbe3408ae4 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.
2012-01-10 15:59:49 -05:00
Mark H Weaver
69cd5299e3 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.
2012-01-10 10:13:43 -05:00
Mark H Weaver
17bec5451b 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.
2012-01-10 09:39:57 -05:00
Mark H Weaver
d6a569c191 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.
2012-01-10 07:50:28 -05:00
Mark H Weaver
7532125912 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.
2012-01-10 06:33:17 -05:00
Mike Gran
3248c954db Typo in documentation of local-boxed-set
* doc/ref/vm.texi: modified
2012-01-09 21:35:41 -08:00
Andy Wingo
91ee7515da Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/__scm.h
	libguile/array-map.c
	libguile/procprop.c
	libguile/tags.h
	module/ice-9/deprecated.scm
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	test-suite/standalone/test-num2integral.c
	test-suite/tests/regexp.test
2012-01-10 00:41:42 +01:00
Mark H Weaver
86c63a8251 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).
2012-01-09 18:24:22 -05:00
Andy Wingo
0bdd43515e Merge commit 'f78a1ccede' 2012-01-10 00:23:49 +01:00
Andy Wingo
bbc2364a3e Merge commit 'cc8afa2b36'
Conflicts:
	module/ice-9/psyntax-pp.scm
	module/language/tree-il/peval.scm
2012-01-10 00:21:48 +01:00
Daniel Hartwig
0e947e1d14 permit non-date values for Expires header
* module/web/http.scm ("Expires"): Permit (some) non-date values.
2012-01-09 23:36:59 +01:00
Ludovic Courtès
9d608ede96 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.
2012-01-09 23:25:02 +01:00
Ludovic Courtès
211e71a184 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.
2012-01-09 23:16:20 +01:00
Ludovic Courtès
67543d0761 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'.
2012-01-09 22:16:49 +01:00
Ludovic Courtès
94a751bdcc 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'.
2012-01-09 21:23:46 +01:00
Ludovic Courtès
17cdda2181 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.
2012-01-09 21:23:46 +01:00
Ludovic Courtès
002aab40bc 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.
2012-01-09 21:23:46 +01:00
Andy Wingo
ff1feca9bd 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.
2012-01-09 17:56:21 +01:00
Andy Wingo
b2637c985c 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.
2012-01-09 17:50:56 +01:00
Andy Wingo
017eb4a6be 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.
2012-01-09 16:15:00 +01:00
Rob Browning
9858e52962 Define _GNU_SOURCE to fix the GNU/kFreeBSD build.
Author: Petr Salinger <Petr.Salinger@seznam.cz>
Closes: #401168
2012-01-09 15:42:31 +01:00
Rob Browning
7b87f5de55 Fix the SRFI 60 copy-bit documentation. 2012-01-09 15:42:28 +01:00
Andy Wingo
8f47877fc7 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.
2012-01-09 15:38:51 +01:00
Mark H Weaver
b2fb40a903 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.
2012-01-08 20:10:11 -05:00
Andy Wingo
c60e6ed4b8 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.
2012-01-08 17:55:01 +01:00
Andy Wingo
fb2be758b7 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.
2012-01-08 16:37:22 +01:00
Ludovic Courtès
20c360b298 Fix typo in `test-num2integral.c'.
* test-suite/standalone/test-num2integral.c (out_of_range_handler): Use
  `scm_is_eq' when comparing KEY.
2012-01-08 16:16:21 +01:00
Ludovic Courtès
be96155b50 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.
2012-01-08 16:16:21 +01:00
Andy Wingo
9a38439301 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.
2012-01-08 16:01:28 +01:00
Andy Wingo
866ecf54c0 syntax parameters doc formatting
* doc/ref/api-macros.texi (Syntax Parameters): Some copy-editing on
  Ian's lovely syntax-parameters documentation.
2012-01-08 14:36:17 +01:00
Andy Wingo
4f5fb35194 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.
2012-01-08 14:27:03 +01:00
Ian Price
729b62bd95 document syntax parameters
* doc/ref/api-macros.texi (Macros): Add subsection for "Syntax Parameters"
2012-01-08 13:28:35 +01:00
Mark H Weaver
49d09292ac 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.
2012-01-07 10:36:22 -05:00
Mark H Weaver
a7e392c1ff 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.
2012-01-07 04:46:46 -05:00
Andy Wingo
213544e0dc 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!
2012-01-07 02:07:09 +01:00
Ian Price
ab66fb3cd1 `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.
2012-01-07 01:36:34 +01:00
Andy Wingo
eaaf94c4ec remove duplicate write-uri definition
* module/web/http.scm: Remove duplicate write-uri definition.
2012-01-07 01:26:00 +01:00
Andy Wingo
992a387958 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.
2012-01-07 00:45:44 +01:00