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

17820 commits

Author SHA1 Message Date
Andy Wingo
20718dd94b Add with-input-from-port, etc documentation
* doc/ref/api-io.texi (Default Ports): Add documentation for
  with-input-from-port, with-output-to-port, and with-error-to-port.
  Fixes #20919.
2016-06-24 09:05:05 +02:00
Andy Wingo
f84006c564 Clarify use of the term "scanning" in the manual
* doc/ref/api-memory.texi (Garbage Collection Functions):
* doc/ref/libguile-concepts.texi (Garbage Collection): Attempt to be
  clear that scanning is a thing that happens in the mark phase.  Fixes
  #20907 I think.
2016-06-24 08:56:21 +02:00
Andy Wingo
f23dfc0fb5 Locale is default port encoding
* libguile/ports.c (scm_init_ports): Use the locale as the default
  charset.  After the switch to default GUILE_INSTALL_LOCALE=1, this
  harmonizes the default port encoding with the installed locale.
2016-06-24 07:43:58 +02:00
Andy Wingo
8a072fc2d6 Add weak hash table documentation
* doc/ref/api-memory.texi (Weak hash tables): Update documentation.
  Fixes #20551.
2016-06-23 22:37:23 +02:00
Andy Wingo
498cd58cb4 Fix R6RS fold-left documentation
* doc/ref/r6rs.texi (rnrs lists): Fix documentation of fold-left.
2016-06-23 21:39:23 +02:00
Andy Wingo
3df22933b6 Static default for define-module #:duplicates
* module/ice-9/boot-9.scm (define-module*): Leaving off #:duplicates
  defaults to installing the duplicate binding handlers specified in the
  manual, not the value of some other dynamic parameter.
  (default-duplicate-binding-procedures):
  (default-duplicate-binding-handler): Instead of closing over a
  separate fluid, close over the handlers of the current module.  That
  way when a user does (default-duplicate-binding-handler ...) in a
  script, then it applies to the right module.
2016-06-23 17:56:27 +02:00
Andy Wingo
04d87db927 Fix default-duplicate-binding-handlers for compilation
* module/ice-9/boot-9.scm (define-module*): Capture value of
  `default-duplicate-binding-procedures' when the module is created.
  Fixes #20093.
2016-06-23 17:13:41 +02:00
Andy Wingo
1d72d46951 Don't serialize uninterned symbols
* module/system/vm/assembler.scm (intern-constant): Don't serialize
  uninterned symbols.
* test-suite/tests/rtl.test ("bad constants"): Add a test.
2016-06-23 15:45:53 +02:00
Andy Wingo
2c8ea5a008 Fix memory leak in scm_from_{u,}int64 on 32-bit platforms
* libguile/conv-integer.i.c (SCM_FROM_TYPE_PROTO):
* libguile/conv-uinteger.i.c (SCM_FROM_TYPE_PROTO): Fix a big in which
  scm_from_int64 and scm_from_uint64 on a 32-bit platform leaked memory
  if they needed to allocate a bignum.  Fixes #20079.
2016-06-23 14:57:50 +02:00
Daniel Llorens
e7f1038aca Remove unused doc/maint 2016-06-23 13:21:32 +02:00
Andy Wingo
c01a2a757e Fix race between SMOB marking and finalization
* libguile/smob.c (clear_smobnum): New helper.
  (finalize_smob): Re-set the smobnum to the "finalized smob" type
  before finalizing.  Fixes #19883.
  (scm_smob_prehistory): Pre-register a "finalized smob" type, which has
  no mark procedure.
* test-suite/standalone/test-smob-mark-race.c: New file.
* test-suite/standalone/Makefile.am: Arrange to build and run the new
  test.
2016-06-23 12:13:02 +02:00
Andy Wingo
9a95167871 Fix relative file name canonicalization on paths with "."
* libguile/filesys.c (scm_i_relativize_path): Canonicalize the file
  names elements that we will be using as prefixes.  Fixes the case
  where a load path contains a relative file name: #19540.
* test-suite/tests/ports.test ("%file-port-name-canonicalization"): Add
  tests that elements of the load path are canonicalized.
2016-06-23 10:17:57 +02:00
Andy Wingo
d84f25c271 Remove unused internal i18n functions
* libguile/i18n.c (str_upcase, str_downcase, str_upcase_l)
  (str_downcase_l): Remove unused inline functions.  Based on a patch by
  Pedro Aguilar <paguilar@paguilar.org>.  Fixes #19172.
2016-06-22 16:47:40 +02:00
Andy Wingo
0ef4b76221 Remove a stale variable use in libguile/Makefile.am
* libguile/Makefile.am (BUILT_SOURCES): Remove a use of a variable that
  doesn't exist in 2.2.
2016-06-22 16:47:40 +02:00
Andy Wingo
3abd8e1ac1 Fix SCM_DEBUG_TYPING_STRICTNESS bug
* libguile/ports.c (scm_setvbuf): Fix bad use of SCM as a test value.
  Actually all ports have read buffers, so we can remove the condition
  entirely.  Thanks Hydra for building in this way :)
2016-06-22 12:50:16 +02:00
Andy Wingo
0472af4c58 Fix (< 'foo) compilation
* module/language/tree-il/primitives.scm (expand-chained-comparisons):
  Fix (< 'foo) compilation.
* test-suite/tests/compiler.test ("regression tests"): Add test case.
2016-06-21 23:17:25 +02:00
Andy Wingo
2546849642 Fix srfi-64.test for #:select borkage. The irony...
* test-suite/tests/srfi-64.test: Fix for recent #:select borkage.
2016-06-21 22:46:03 +02:00
Andy Wingo
f1c0434403 `define!' instruction returns the variable
* doc/ref/vm.texi (Top-Level Environment Instructions): Update
  documentation.
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump, sadly.
* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump.
* libguile/vm-engine.c (define!): Change to store variable in dst slot.
* module/language/tree-il/compile-cps.scm (convert):
* module/language/cps/compile-bytecode.scm (compile-function): Adapt to
  define! change.
* module/language/cps/effects-analysis.scm (current-module): Fix define!
  effects.  Incidentally here was the bug: in Guile 2.2 you can't have
  effects on different object kinds in one instruction, without
  reverting to &unknown-memory-kinds.
* test-suite/tests/compiler.test ("regression tests"): Add a test.
2016-06-21 22:40:31 +02:00
Andy Wingo
1f6a8f2a6e Use source file permissions for compiled files
* module/system/base/compile.scm (call-with-output-file/atomic): Use the
  permissions of the source file, if available, as the permissions of
  the compiled file.  Fixes #18477.
2016-06-21 17:51:07 +02:00
Andy Wingo
7e88ca6f8a Document pretty-print #:max-expr-width
* doc/ref/misc-modules.texi (Pretty Printing): Document #:max-expr-width
  keyword argument.  Fixes #17657.
2016-06-21 16:45:37 +02:00
Andy Wingo
d0d14f410d Importing modules with #:select no longer grovels private bindings
* module/ice-9/boot-9.scm (resolve-interface): Don't look in private
  interface for #:select bindings.  Fixes #17418.
* module/system/repl/coop-server.scm: Don't rely on bad #:select
  behavior.
* NEWS: Add entry.
2016-06-21 16:01:50 +02:00
Andy Wingo
bcc3c6b61b Detect too-old libunistring at configure-time.
* configure.ac: Detect too-old libunistring at configure-time.  Fixes
  #17399.
2016-06-21 15:38:00 +02:00
Andy Wingo
b8f5cdce15 Update and-let-star.test
* test-suite/tests/and-let-star.test ("and-let*"): Update test
  expectations.
2016-06-21 13:40:02 +02:00
Taylan Ulrich Bayırlı/Kammer
daf8d33036 Add SRFI-2 (and-let*) test suite.
* test-suite/tests/srfi-2.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add it.
2016-06-21 13:40:01 +02:00
Taylan Ulrich Bayırlı/Kammer
8ffcd28fde Fix SRFI-2 (and-let*) implementation.
* module/ice-9/and-let-star.scm (%and-let*): Re-implemented this in a
  more verbose but accurate way.
2016-06-21 13:40:01 +02:00
Andy Wingo
4e27e3c054 Add R6RS bytevector->string, string->bytevector
* module/rnrs/io/ports.scm (string->bytevector):
  (bytevector->string): New procedures.
* module/rnrs.scm: Export new procedures.
* test-suite/tests/r6rs-ports.test: Add string->bytevector and
  bytevector->string tests.
2016-06-21 11:29:14 +02:00
Andy Wingo
59f062ec78 Export &i/o-decoding, &i/o-encoding from (rnrs)
* module/rnrs/io/ports.scm (&i/o-decoding, &i/o-encoding): Rename from
  &i/o-decoding-error and &i/o-encoding-error, to conform to R6RS.
* module/rnrs.scm (rnrs): Export &i/o-decoding, &i/o-encoding, their
  accessors and constructors.
2016-06-21 11:07:34 +02:00
Andy Wingo
5d9516637b Implement R6RS output-port-buffer-mode
* module/rnrs/io/ports.scm (r6rs-open): Set buffer-mode on new port.
  (output-port-buffer-mode): Implement and export.
* module/rnrs.scm (rnrs): Export output-port-buffer-mode
* test-suite/tests/r6rs-ports.test (test-output-file-opener): Add
  tests.
2016-06-21 11:06:25 +02:00
Taylan Ulrich Bayırlı/Kammer
d545e4551d (rnrs hashtables): Hash functions of eq? and eqv? hashtables
Also pinging this thread with a (very slightly) updated patch. :-)

[2. text/x-diff; 0001-Hashtable-hash-function-returns-f-on-eq-and-eqv-tabl.patch]

From 17599f6ce7ba0beb100e80455ff99af07333d871 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Tue, 21 Jun 2016 00:23:29 +0200
Subject: [PATCH] Hashtable-hash-function returns #f on eq and eqv tables.

* module/rnrs/hashtables.scm (r6rs:hashtable)[type]: New field.
(r6rs:hashtable-type): New procedure.
* test-suite/tests/r6rs-hashtables.test: Add related tests.
2016-06-21 09:48:36 +02:00
Taylan Ulrich Bayırlı/Kammer
c1abe68dbc (rnrs hashtables): Mutation of immutable hashtable ignored
Pinging this thread with a (very slightly) updated patch. :-)

[2. text/x-diff; 0001-Hashtable-set-errors-on-immutable-hashtable.patch]

From 7f35d515d711e255bba5a89a013d9d92034edf41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Tue, 21 Jun 2016 00:25:19 +0200
Subject: [PATCH] Hashtable-set! errors on immutable hashtable.

* module/rnrs/hashtables.scm (hashtable-set!): Raise an assertion
  violation error when the hashtable is immutable.
* test-suite/tests/r6rs-hashtables.test: Fix accordingly.
2016-06-21 09:47:07 +02:00
Andy Wingo
beea6302e0 Fix fixnum-range changes in R6RS fixnum bitops
* module/rnrs/arithmetic/fixnums.scm (fxcopy-bit, fxbit-field)
  (fxcopy-bit-field, fxarithmetic-shift)
  (fxarithmetic-shift-left, fx-arithmetic-shift-right)
  (fxrotate-bit-field, fxreverse-bit-field): Enforce range on amount by
  which to shift.  Fixes #14917.
* test-suite/tests/r6rs-arithmetic-fixnums.test ("fxarithmetic-shift-left"):
  Update test to not shift left by a negative amount.
2016-06-21 09:32:30 +02:00
Andy Wingo
845c873acf Add another code coverage test
* test-suite/tests/coverage.test ("line-execution-counts"): Add a test
  from Taylan Ulrich B, from bug #14849.
2016-06-21 09:07:26 +02:00
Andy Wingo
e877e1bccb Document sigaction + SA_RESTART
* doc/ref/posix.texi (Signals): Document interaction between Guile's
  signal handling and SA_RESTART.  Fixes #14640.
2016-06-21 08:35:59 +02:00
Andy Wingo
fff013215f Fix peval on (call-with-values foo (lambda (x) x))
* module/language/tree-il/peval.scm (peval): Don't
  inline (call-with-values foo (lambda (x) exp)) to (let ((x (foo)))
  exp).  The idea is that call-with-values sets up an explicit context
  in which we are requesting an explicit return arity, and that dropping
  extra values when there's not a rest argument is the wrong thing.
  Fixes #13966.
* test-suite/tests/peval.test ("partial evaluation"): Update test.
2016-06-20 22:04:45 +02:00
Andy Wingo
5b6eaa91d2 Document char-ready? limitations.
* doc/ref/api-io.texi (Venerable Port Interfaces): Document limitations
  of char-ready?.  See http://debbugs.gnu.org/10627.
2016-06-20 21:21:20 +02:00
Andy Wingo
dc7bc06f69 Fix size measurement in bytevector_large_set
* libguile/bytevectors.c (bytevector_large_set): Fix computation of
  value size in words.
* test-suite/tests/bytevectors.test: Add test.

Thanks to Ben Rocer <fleabyte@mail.com> for the bug report and fix.
2016-06-20 17:15:21 +02:00
Andy Wingo
687d393e2c Fix uri-decode behavior for "+"
* module/web/uri.scm (uri-decode): Add #:decode-plus-to-space? keyword
  argument.
  (split-and-decode-uri-path): Don't decode plus to space.
* doc/ref/web.texi (URIs): Update documentation.
* test-suite/tests/web-uri.test ("decode"): Add tests.
* NEWS: Add entry.

Based on a patch by Brent <brent@tomski.co.za>.
2016-06-20 14:48:15 +02:00
Diogo F. S. Ramos
4cf81b7ba0 Add reference to the lack of "non-greedy" variants
While describing special characters, remind the reader that
"non-greedy" variants are not supported.  They might not be familiar
with POSIX extended regular expression and expect it to work.

* doc/ref/api-regex.texi: Add "non-greedy" observation
2016-06-19 17:39:41 +02:00
Diogo F. S. Ramos
ff040ee033 Remove link to Emacs' regexp syntax
Linking to Emacs' regexps as an example of regexp syntax gives the
wrong impression that Guile supports it, which is not true.

* doc/ref/api-regex.texi: Remove link to Emacs' regexp syntax
2016-06-19 17:38:49 +02:00
Andy Wingo
3bea4c6970 Bump version to 2.1.3
* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to 2.1.3.
2016-06-18 21:55:24 +02:00
Andy Wingo
d88869539d Minor NEWS updates
* NEWS: Minor updates.
2016-06-18 13:16:04 +02:00
Andy Wingo
0c1ee6eae6 Fix ports bug when size_t is 32 bits
* libguile/ports.c (scm_end_input): I am a complete idiot.  I had no
  idea that `- (uint32_t) x' is actually still a uint32_t.
2016-06-18 13:08:12 +02:00
Andy Wingo
8b87567085 Fix 64->32 bit cross-compilation of large-ish fixnums
* module/system/vm/assembler.scm (immediate-bits): Fix a bug whereby
  compiling to a 32-bit target from a 64-bit host would treat all
  integers whose representation fit into 32 bits as immediates.  This
  would result in integer constants between #x20000000 and 0x3fffffff
  being residualized in such a way that they would be loaded as negative
  numbers.
2016-06-17 15:05:39 +02:00
Andy Wingo
7142005a05 Skip incompatible .go files
* libguile/load.c (load_thunk_from_path, try_load_thunk_from_file): New
  functions.
  (search_path): Simplify.
  (scm_primitive_load_path, scm_init_eval_in_scheme): Use the new
  functions to load compiled files.
* module/ice-9/boot-9.scm (load-in-vicinity): Skip invalid .go files.

Inspired by a patch from Jan Nieuwenhuizen <janneke@gnu.org>.
2016-06-12 10:32:45 +02:00
Andy Wingo
2cb7c4c4d7 Remove unused static definitions
* libguile/expand.c:
* libguile/vm.c: Remove unused static definitions.
2016-06-11 18:29:35 +02:00
Andy Wingo
be6194e32a Fix shuffling of unboxed stack elements on 32-bit systems
* libguile/vm-engine.c (SP_REF_SLOT, SP_SET_SLOT): New defines.
  (push, pop, mov, long-mov): Move full slots.  Fixes 32-bit with
  unboxed 64-bit stack values; before when shuffling these values
  around, we were only shuffling the lower 32 bits on 32-bit platforms.
2016-06-11 14:44:59 +02:00
Andy Wingo
100b048097 VM type checking refactor
* libguile/vm-engine.c (VM_VALIDATE): Refactor some type-related
  assertions to use a common macro.
  (vector-length, vector-set!/immediate): Fix the proc mentioned in the
  error message.
2016-06-11 13:03:20 +02:00
Andy Wingo
ddce05e819 vm: Make sure IP is stored before potentially GCing.
* libguile/vm-engine.c: Add a number of SYNC_IP calls that were missing
  before calls that could GC.
2016-06-11 12:26:26 +02:00
Andy Wingo
7e502d57e0 Fix bad backtraces
* libguile/vm-engine.c (BV_REF, BV_BOUNDED_SET, BV_SET, integer->char)
  (char->integer): Use VM_ASSERT so that we save the IP before erroring
  out.
2016-06-10 15:33:09 +02:00
Andy Wingo
d1b99ea2ae Minor VM fixes
* libguile/vm-engine.c (string-ref): Unpack the index into a 64-bit
  integer.
  (br-if-u64-<-scm): Tighten up the fast path.
2016-06-10 08:23:04 +02:00