guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-156-gaab9d


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-156-gaab9d46
Date: Thu, 07 Mar 2013 19:09:23 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=aab9d46c83c2ad03abb0a2dc000167e552de2c29

The branch, stable-2.0 has been updated
       via  aab9d46c83c2ad03abb0a2dc000167e552de2c29 (commit)
       via  d0ecf8eb9e154dcc253b1ea302d67d41bcc4ee36 (commit)
       via  8d48877d2cacebeb1352404b0e2514a60416c8a4 (commit)
       via  83dce818ec912def820808c059ee6f9c3801585e (commit)
       via  7f893030abaf49711f948d76f124e18bfa9e4181 (commit)
      from  1b787ef9ec3a08f12d7b46403f4d508e583499a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit aab9d46c83c2ad03abb0a2dc000167e552de2c29
Author: Stefan Israelsson Tampe <address@hidden>
Date:   Wed Dec 12 17:37:44 2012 +0100

    add GUILE_STACK_SIZE environment variable
    
    * libguile/vm.c (initialize_default_stack_size): New helper.
      (scm_bootstrap_vm): Call initialize_default_stack_size.
    
    * doc/ref/guile-invoke.texi (Environment Variables): Add docs.
    
    Based on a patch by Stefan Israelsson Tampe.

commit d0ecf8eb9e154dcc253b1ea302d67d41bcc4ee36
Author: Andy Wingo <address@hidden>
Date:   Thu Mar 7 13:59:18 2013 +0100

    support calls and tail-calls with more than 255 formals
    
    * module/language/tree-il/compile-glil.scm (flatten-lambda-case):
      Support calls and tail-calls with more than 255 formals.
    
    * test-suite/tests/tree-il.test ("many args"): Add a test.

commit 8d48877d2cacebeb1352404b0e2514a60416c8a4
Author: Andy Wingo <address@hidden>
Date:   Thu Mar 7 11:29:01 2013 +0100

    ,option evaluates its right-hand-side
    
    * doc/ref/scheme-using.texi (System Commands): Better documentation for
      ,option.
    
    * module/system/repl/command.scm (option): Evaluate the RHS when setting
      an option.  Fixes bug 13076.

commit 83dce818ec912def820808c059ee6f9c3801585e
Author: Andy Wingo <address@hidden>
Date:   Thu Mar 7 11:02:33 2013 +0100

    GUILE_INSTALL_LOCALE=1 during build
    
    * doc/ref/Makefile.am (autoconf-macros.texi):
    * libguile/Makefile.am (snarf2checkedtexi):
    * module/Makefile.am (ice-9/psyntax-pp.scm.gen, ice-9/psyntax-pp.go):
    * test-suite/Makefile.am (GUILE_AUTO_COMPILE):
    * test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
    * test-suite/vm/Makefile.am (TESTS_ENVIRONMENT):
    * am/guilec (.scm.go): Set GUILE_INSTALL_LOCALE to 1 during the build.
      Fixes bug 12887.

commit 7f893030abaf49711f948d76f124e18bfa9e4181
Author: Ludovic Courtès <address@hidden>
Date:   Tue Nov 22 12:11:48 2011 +0100

    Install the current locale if GUILE_INSTALL_LOCALE is nonzero.
    
    * libguile/guile.c (get_integer_from_environment)
      (should_install_locale): New functions.
      (main): Add `setlocale' call.
    
    * doc/ref/guile-invoke.texi (Environment Variables): Add documentation.

-----------------------------------------------------------------------

Summary of changes:
 am/guilec                                |    2 +-
 doc/ref/Makefile.am                      |    3 +-
 doc/ref/guile-invoke.texi                |   30 +++++++++++++++++++++-
 doc/ref/scheme-using.texi                |    7 +++-
 libguile/Makefile.am                     |    3 +-
 libguile/guile.c                         |   41 ++++++++++++++++++++++++++++-
 libguile/vm.c                            |   18 +++++++++++-
 module/Makefile.am                       |    5 ++-
 module/language/tree-il/compile-glil.scm |   17 ++++++++++--
 module/system/repl/command.scm           |   12 +++++---
 test-suite/Makefile.am                   |    4 ++-
 test-suite/standalone/Makefile.am        |    4 +-
 test-suite/tests/tree-il.test            |   18 ++++++++++++-
 test-suite/vm/Makefile.am                |    3 +-
 14 files changed, 142 insertions(+), 25 deletions(-)

diff --git a/am/guilec b/am/guilec
index 7634a97..f5849d0 100644
--- a/am/guilec
+++ b/am/guilec
@@ -26,7 +26,7 @@ AM_V_GUILEC_0 = @echo "  GUILEC" $@;
 
 SUFFIXES = .scm .go
 .scm.go:
-       $(AM_V_GUILEC)GUILE_AUTO_COMPILE=0                      \
+       $(AM_V_GUILEC)GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0 \
        $(top_builddir)/meta/uninstalled-env                    \
        guild compile --target="$(host)" $(GUILE_WARNINGS)      \
          -L "$(abs_srcdir)" -L "$(abs_builddir)"               \
diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am
index 260bb14..4b1706e 100644
--- a/doc/ref/Makefile.am
+++ b/doc/ref/Makefile.am
@@ -118,7 +118,8 @@ EXTRA_DIST = ChangeLog-2008 $(PICTURES)
 
 libguile-autoconf.texi: autoconf-macros.texi
 autoconf-macros.texi: $(top_srcdir)/meta/guile.m4
-       GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env guild \
+       GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0 \
+       $(top_builddir)/meta/uninstalled-env guild \
          snarf-guile-m4-docs $(top_srcdir)/meta/guile.m4 \
          > $(srcdir)/$@
 
diff --git a/doc/ref/guile-invoke.texi b/doc/ref/guile-invoke.texi
index 5a9a3f7..397bc47 100644
--- a/doc/ref/guile-invoke.texi
+++ b/doc/ref/guile-invoke.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 
2010, 2011
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 
2010, 2011, 2013
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -291,6 +291,34 @@ This variable names the file that holds the Guile REPL 
command history.
 You can specify a different history file by setting this environment
 variable.  By default, the history file is @file{$HOME/.guile_history}.
 
address@hidden GUILE_INSTALL_LOCALE
address@hidden GUILE_INSTALL_LOCALE
+This is a flag that can be used to tell Guile whether or not to install
+the current locale at startup, via a call to @code{(setlocale LC_ALL
+"")}.  @xref{Locales}, for more information on locales.
+
+You may explicitly indicate that you do not want to install
+the locale by setting @env{GUILE_INSTALL_LOCALE} to @code{0}, or
+explicitly enable it by setting the variable to @code{1}.
+
+Usually, installing the current locale is the right thing to do.  It
+allows Guile to correctly parse and print strings with non-ASCII
+characters.  However, for compatibility with previous Guile 2.0
+releases, this option is off by default.  The next stable release series
+of Guile (the 2.2 series) will install locales by default.
+
address@hidden GUILE_STACK_SIZE
address@hidden GUILE_STACK_SIZE
+Guile currently has a limited stack size for Scheme computations.
+Attempting to call too many nested functions will signal an error.  This
+is good to detect infinite recursion, but sometimes the limit is reached
+for normal computations.  This environment variable, if set to a
+positive integer, specifies the number of Scheme value slots to allocate
+for the stack.
+
+In the future we will implement stacks that can grow and shrink, but for
+now this hack will have to do.
+
 @item GUILE_LOAD_COMPILED_PATH
 @vindex GUILE_LOAD_COMPILED_PATH
 This variable may be used to augment the path that is searched for
diff --git a/doc/ref/scheme-using.texi b/doc/ref/scheme-using.texi
index e0f91af..8157660 100644
--- a/doc/ref/scheme-using.texi
+++ b/doc/ref/scheme-using.texi
@@ -430,8 +430,11 @@ Garbage collection.
 Display statistics.
 @end deffn
 
address@hidden {REPL Command} option [key value]
-List/show/set options.
address@hidden {REPL Command} option [name] [exp]
+With no arguments, lists all options.  With one argument, shows the
+current value of the @var{name} option.  With two arguments, sets the
address@hidden option to the result of evaluating the Scheme expression
address@hidden
 @end deffn
 
 @deffn {REPL Command} quit
diff --git a/libguile/Makefile.am b/libguile/Makefile.am
index 0a40120..8df2f7c 100644
--- a/libguile/Makefile.am
+++ b/libguile/Makefile.am
@@ -703,7 +703,8 @@ load.x: libpath.h
 dynl.x: libpath.h
 
 alldotdocfiles    = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES)
-snarf2checkedtexi = GUILE_AUTO_COMPILE=0 $(top_builddir)/meta/uninstalled-env 
guild snarf-check-and-output-texi
+snarf2checkedtexi = GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0 \
+       $(top_builddir)/meta/uninstalled-env guild snarf-check-and-output-texi
 dotdoc2texi       = cat $(alldotdocfiles) | $(snarf2checkedtexi)
 
 guile.texi: $(alldotdocfiles) guile$(EXEEXT)
diff --git a/libguile/guile.c b/libguile/guile.c
index ac22b83..2c3be8e 100644
--- a/libguile/guile.c
+++ b/libguile/guile.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 1996,1997,2000,2001, 2006, 2008, 2011 Free Software 
Foundation, Inc.
- * 
+/* Copyright (C) 1996, 1997, 2000, 2001, 2006, 2008,
+ *   2011, 2013 Free Software Foundation, Inc.
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  * as published by the Free Software Foundation; either version 3 of
@@ -36,6 +37,7 @@
 #include <libguile/scmconfig.h>
 #endif
 #include <ltdl.h>
+#include <locale.h>
 
 #ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
@@ -64,9 +66,44 @@ inner_main (void *closure SCM_UNUSED, int argc, char **argv)
 #endif /* __MINGW32__ */
 }
 
+static int
+get_integer_from_environment (const char *var, int def)
+{
+  char *end = 0;
+  char *val = getenv (var);
+  long res = def;
+  if (!val)
+    return def;
+  res = strtol (val, &end, 10);
+  if (end == val)
+    {
+      fprintf (stderr, "guile: warning: invalid %s: %s\n", var, val);
+      return def;
+    }
+  return res;
+}
+
+static int
+should_install_locale (void)
+{
+  /* If the GUILE_INSTALL_LOCALE environment variable is set to a
+     nonzero value, we should install the locale via setlocale().  This
+     behavior is off by default for compatibility with previous 2.0.x
+     releases.  It will be on by default in 2.2.  */
+  return get_integer_from_environment ("GUILE_INSTALL_LOCALE", 0);
+}
+
 int
 main (int argc, char **argv)
 {
+  /* If we should install a locale, do it right at the beginning so that
+     string conversion for command-line arguments, along with possible
+     error messages, use the right locale.  See
+     <https://lists.gnu.org/archive/html/guile-devel/2011-11/msg00041.html>
+     for the rationale.  */
+  if (should_install_locale () && setlocale (LC_ALL, "") == NULL)
+    fprintf (stderr, "guile: warning: failed to install locale\n");
+
   scm_install_gmp_memory_functions = 1;
   scm_boot_guile (argc, argv, inner_main, 0);
   return 0; /* never reached */
diff --git a/libguile/vm.c b/libguile/vm.c
index 5dec106..6a4ecd8 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, 
Inc.
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -37,6 +37,8 @@
 #include "programs.h"
 #include "vm.h"
 
+#include "private-gc.h" /* scm_getenv_int */
+
 static int vm_default_engine = SCM_VM_REGULAR_ENGINE;
 
 /* Unfortunately we can't snarf these: snarfed things are only loaded up from
@@ -633,7 +635,17 @@ resolve_variable (SCM what, SCM program_module)
     }
 }
   
+#define VM_MIN_STACK_SIZE      (1024)
 #define VM_DEFAULT_STACK_SIZE  (64 * 1024)
+static size_t vm_stack_size = VM_DEFAULT_STACK_SIZE;
+
+static void
+initialize_default_stack_size (void)
+{
+  int size = scm_getenv_int ("GUILE_STACK_SIZE", vm_stack_size);
+  if (size >= VM_MIN_STACK_SIZE)
+    vm_stack_size = size;
+}
 
 #define VM_NAME   vm_regular_engine
 #define FUNC_NAME "vm-regular-engine"
@@ -670,7 +682,7 @@ make_vm (void)
 
   vp = scm_gc_malloc (sizeof (struct scm_vm), "vm");
 
-  vp->stack_size  = VM_DEFAULT_STACK_SIZE;
+  vp->stack_size= vm_stack_size;
 
 #ifdef VM_ENABLE_PRECISE_STACK_GC_SCAN
   vp->stack_base = (SCM *)
@@ -1086,6 +1098,8 @@ scm_bootstrap_vm (void)
                             "scm_init_vm",
                             (scm_t_extension_init_func)scm_init_vm, NULL);
 
+  initialize_default_stack_size ();
+
   sym_vm_run = scm_from_latin1_symbol ("vm-run");
   sym_vm_error = scm_from_latin1_symbol ("vm-error");
   sym_keyword_argument_error = scm_from_latin1_symbol 
("keyword-argument-error");
diff --git a/module/Makefile.am b/module/Makefile.am
index 79957c1..c47d0b4 100644
--- a/module/Makefile.am
+++ b/module/Makefile.am
@@ -80,14 +80,15 @@ ETAGS_ARGS +=                                       \
   ice-9/ChangeLog-2008
 
 ice-9/psyntax-pp.scm.gen:
-       $(top_builddir_absolute)/meta/guile --no-auto-compile -s 
$(srcdir)/ice-9/compile-psyntax.scm \
+       GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0 \
+       $(top_builddir_absolute)/meta/guile -s 
$(srcdir)/ice-9/compile-psyntax.scm \
                $(srcdir)/ice-9/psyntax.scm $(srcdir)/ice-9/psyntax-pp.scm
 
 .PHONY: ice-9/psyntax-pp.scm.gen
 
 # Keep this rule in sync with that in `am/guilec'.
 ice-9/psyntax-pp.go: ice-9/psyntax.scm ice-9/psyntax-pp.scm
-       $(AM_V_GUILEC)GUILE_AUTO_COMPILE=0                              \
+       $(AM_V_GUILEC)GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0       \
        $(top_builddir)/meta/uninstalled-env                            \
        guild compile --target="$(host)" $(GUILE_WARNINGS)              \
          -L "$(abs_srcdir)" -L "$(abs_builddir)"                       \
diff --git a/module/language/tree-il/compile-glil.scm 
b/module/language/tree-il/compile-glil.scm
index a9f6df9..e4df6e1 100644
--- a/module/language/tree-il/compile-glil.scm
+++ b/module/language/tree-il/compile-glil.scm
@@ -1,6 +1,6 @@
 ;;; TREE-IL -> GLIL compiler
 
-;; Copyright (C) 2001,2008,2009,2010,2011,2012 Free Software Foundation, Inc.
+;; Copyright (C) 2001,2008,2009,2010,2011,2012,2013 Free Software Foundation, 
Inc.
 
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -527,9 +527,20 @@
          (for-each comp-push args)
          (let ((len (length args)))
            (case context
-             ((tail) (emit-code src (make-glil-call 'tail-call len)))
-             ((push) (emit-code src (make-glil-call 'call len))
+             ((tail) (if (<= len #xff)
+                         (emit-code src (make-glil-call 'tail-call len))
+                         (begin
+                           (comp-push (make-const #f len))
+                           (emit-code src (make-glil-call 'tail-call/nargs 
0)))))
+             ((push) (if (<= len #xff)
+                         (emit-code src (make-glil-call 'call len))
+                         (begin
+                           (comp-push (make-const #f len))
+                           (emit-code src (make-glil-call 'call/nargs 0))))
                      (maybe-emit-return))
+             ;; FIXME: mv-call doesn't have a /nargs variant, so it is
+             ;; limited to 255 args.  Can work around it with a
+             ;; trampoline and tail-call/nargs, but it's not so nice.
              ((vals) (emit-code src (make-glil-mv-call len MVRA))
                      (maybe-emit-return))
              ((drop) (let ((MV (make-label)) (POST (make-label)))
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm
index c4e9e2c..8ad00da 100644
--- a/module/system/repl/command.scm
+++ b/module/system/repl/command.scm
@@ -351,18 +351,20 @@ Show description/documentation."
   (newline))
 
 (define-meta-command (option repl . args)
-  "option [KEY VALUE]
+  "option [NAME] [EXP]
 List/show/set options."
   (pmatch args
     (()
      (for-each (lambda (spec)
                 (format #t "  ~A~24t~A\n" (car spec) (cadr spec)))
               (repl-options repl)))
-    ((,key)
-     (display (repl-option-ref repl key))
+    ((,name)
+     (display (repl-option-ref repl name))
      (newline))
-    ((,key ,val)
-     (repl-option-set! repl key val))))
+    ((,name ,exp)
+     ;; Would be nice to evaluate in the current language, but the REPL
+     ;; option parser doesn't permit that, currently.
+     (repl-option-set! repl name (eval exp (current-module))))))
 
 (define-meta-command (quit repl)
   "quit
diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
index 9fba7b8..e7c8c41 100644
--- a/test-suite/Makefile.am
+++ b/test-suite/Makefile.am
@@ -214,7 +214,9 @@ LALR_EXTRA +=                                       \
 
 TESTS = $(LALR_TESTS)
 TESTS_ENVIRONMENT =                            \
+  GUILE_INSTALL_LOCALE=1                       \
+  GUILE_AUTO_COMPILE=0                         \
   @LOCALCHARSET_TESTS_ENVIRONMENT@             \
-  $(top_builddir)/meta/guile --no-auto-compile
+  $(top_builddir)/meta/guile
 
 EXTRA_DIST += $(LALR_EXTRA) $(LALR_TESTS) tests/sxml-match-tests.ss
diff --git a/test-suite/standalone/Makefile.am 
b/test-suite/standalone/Makefile.am
index be5d913..4b1c822 100644
--- a/test-suite/standalone/Makefile.am
+++ b/test-suite/standalone/Makefile.am
@@ -35,9 +35,9 @@ TESTS_ENVIRONMENT =                                           
\
   srcdir="$(srcdir)"                                           \
   builddir="$(builddir)"                                       \
   @LOCALCHARSET_TESTS_ENVIRONMENT@                             \
-  GUILE_AUTO_COMPILE=0 "${top_builddir}/meta/uninstalled-env"
+  GUILE_INSTALL_LOCALE=1 GUILE_AUTO_COMPILE=0 
"${top_builddir}/meta/uninstalled-env"
 
-## Check for headers in $(srcdir) and bulid dir before $(CPPFLAGS), which
+## Check for headers in $(srcdir) and build dir before $(CPPFLAGS), which
 ## may point us to an old, installed version of guile.
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) \
              -I$(top_srcdir)/lib -I$(top_builddir)/lib
diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test
index 2217ffc..ddc3e76 100644
--- a/test-suite/tests/tree-il.test
+++ b/test-suite/tests/tree-il.test
@@ -1,7 +1,7 @@
 ;;;; tree-il.test --- test suite for compiling tree-il   -*- scheme -*-
 ;;;; Andy Wingo <address@hidden> --- May 2009
 ;;;;
-;;;;   Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+;;;;   Copyright (C) 2009, 2010, 2011, 2012, 2013 Free Software Foundation, 
Inc.
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -702,6 +702,22 @@
               #:opts '(#:partial-eval? #f)))))
 
 
+(define (sum . args)
+  (apply + args))
+
+(with-test-prefix "many args"
+  (pass-if "call with > 256 args"
+    (equal? (compile `(1+ (sum ,@(iota 1000)))
+                     #:env (current-module))
+            (1+ (apply sum (iota 1000)))))
+
+  (pass-if "tail call with > 256 args"
+    (equal? (compile `(sum ,@(iota 1000))
+                     #:env (current-module))
+            (apply sum (iota 1000)))))
+
+
+
 (with-test-prefix "tree-il-fold"
 
   (pass-if "empty tree"
diff --git a/test-suite/vm/Makefile.am b/test-suite/vm/Makefile.am
index 0e6e974..2a3e38f 100644
--- a/test-suite/vm/Makefile.am
+++ b/test-suite/vm/Makefile.am
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in.
 ##
-## Copyright 2005, 2006, 2008, 2009, 2010 Software Foundation, Inc.
+## Copyright 2005, 2006, 2008, 2009, 2010, 2013 Software Foundation, Inc.
 ##
 ## This file is part of GUILE.
 ##
@@ -20,6 +20,7 @@
 ##   Fifth Floor, Boston, MA 02110-1301 USA
 
 TESTS_ENVIRONMENT = \
+       GUILE_INSTALL_LOCALE=1 \
        $(top_builddir)/meta/guile \
        -l $(srcdir)/run-vm-tests.scm -e run-vm-tests
 


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]