[Top][All Lists]

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

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-142-g8cf49

From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-142-g8cf49d8
Date: Tue, 29 Mar 2011 11:33:56 +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".

The branch, stable-2.0 has been updated
       via  8cf49d836ff41838812cba1fd61bfce3fb877144 (commit)
       via  fb6df3ea137eabad25d70219da2c84282883b433 (commit)
       via  2460274d360d36bc758b763a1bbb1dc2cb85a87b (commit)
       via  56dbc8a89958fcc401b0980ffcd0047f20470cd3 (commit)
      from  9dadfa47b07548ff5cf3604067910c8aece93c42 (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 8cf49d836ff41838812cba1fd61bfce3fb877144
Author: Andy Wingo <address@hidden>
Date:   Tue Mar 29 13:21:44 2011 +0200

    fix compilation with libgc 7.0, 7.1
    * Check for GC_pthread_exit and GC_pthread_cancel.
    * libguile/gen-scmconfig.c: Write HAVE_GC_PTHREAD_CANCEL and
      HAVE_GC_PTHREAD_EXIT into scmconfig.h.
    * libguile/pthread-threads.h (scm_i_pthread_exit, scm_i_pthread_cancel):
      Only redefine to their GC_pthread_* variants if we have those
      functions, which is not the case in libgc < 7.2.

commit fb6df3ea137eabad25d70219da2c84282883b433
Author: Andy Wingo <address@hidden>
Date:   Tue Mar 29 12:38:18 2011 +0200

    fix error message on ,disassemble "non-procedure"
    * module/language/objcode/spec.scm (decompile-value): Don't assume that
      `error' will handle format strings appropriately.
    * module/system/repl/command.scm (disassemble): A more human error when
      you disassemble a non-procedure.
    Bug reported by Andrew Horton.

commit 2460274d360d36bc758b763a1bbb1dc2cb85a87b
Author: Andy Wingo <address@hidden>
Date:   Tue Mar 29 12:18:20 2011 +0200

    document -q, repl options
    * doc/ref/scheme-scripts.texi (Invoking Guile): Document -q.
    * doc/ref/scheme-using.texi (Init File): New section, on .guile.
      (Readline): Link to Init File.
      (System Commands): Document the various REPL options, and

commit 56dbc8a89958fcc401b0980ffcd0047f20470cd3
Author: Andy Wingo <address@hidden>
Date:   Tue Mar 29 11:40:05 2011 +0200

    rewrite ensure-writable-dir to not be racy
    * module/system/base/compile.scm (ensure-writable-dir): Rewrite to not
      be racy.


Summary of changes:                     |    2 +-
 doc/ref/scheme-scripts.texi      |    5 +++
 doc/ref/scheme-using.texi        |   54 ++++++++++++++++++++++++++++++++++---
 libguile/gen-scmconfig.c         |   12 ++++++++
 libguile/pthread-threads.h       |   11 +++++++
 module/language/objcode/spec.scm |    4 +-
 module/system/base/compile.scm   |   29 ++++++++++++++------
 module/system/repl/command.scm   |    6 +++-
 8 files changed, 105 insertions(+), 18 deletions(-)

diff --git a/ b/
index a254634..e5b8379 100644
--- a/
+++ b/
@@ -1238,7 +1238,7 @@ save_LIBS="$LIBS"
-AC_CHECK_FUNCS([GC_do_blocking GC_call_with_gc_active])
+AC_CHECK_FUNCS([GC_do_blocking GC_call_with_gc_active GC_pthread_exit 
 # Though the `GC_do_blocking ()' symbol is present in GC 7.1, it is not
 # declared, and has a different type (returning void instead of
diff --git a/doc/ref/scheme-scripts.texi b/doc/ref/scheme-scripts.texi
index 5a6f494..0ad1bec 100644
--- a/doc/ref/scheme-scripts.texi
+++ b/doc/ref/scheme-scripts.texi
@@ -196,6 +196,11 @@ interactive session.  When executing a script with 
@code{-s} or
 Do not use the debugging VM engine, even when entering an interactive
address@hidden -q
+Do not the local initialization file, @code{.guile}.  This option only
+has an effect when running interactively; running scripts does not load
+the @code{.guile} file.  @xref{Init File}.
 @item address@hidden
 While this program runs, listen on a local port or a path for REPL
 clients.  If @var{p} starts with a number, it is assumed to be a local
diff --git a/doc/ref/scheme-using.texi b/doc/ref/scheme-using.texi
index a119d42..7995c8c 100644
--- a/doc/ref/scheme-using.texi
+++ b/doc/ref/scheme-using.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C) 2006, 2010
address@hidden Copyright (C) 2006, 2010, 2011
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
@@ -35,6 +35,7 @@ current language is @code{scheme}, and the current module is
 support for languages other than Scheme.
+* Init File::
 * Readline::                    
 * Value History::              
 * REPL Commands::               
@@ -43,6 +44,22 @@ support for languages other than Scheme.
 @end menu
address@hidden Init File
address@hidden The Init File, @file{~/.guile}
address@hidden .guile
+When run interactively, Guile will load a local initialization file from
address@hidden/.guile}.  This file should contain Scheme expressions for
+This facility lets the user customize their interactive Guile
+environment, pulling in extra modules or parameterizing the REPL
+To run Guile without loading the init file, use the @code{-q}
+command-line option.
 @node Readline
 @subsection Readline
@@ -58,10 +75,8 @@ scheme@@(guile-user)> (activate-readline)
 @end lisp
 It's a good idea to put these two lines (without the
address@hidden@@(guile-user)>} prompts) in your @file{.guile} file.  Guile
-reads this file when it starts up interactively, so anything in this
-file has the same effect as if you type it in by hand at the
address@hidden@@(guile-user)>} prompt.
address@hidden@@(guile-user)>} prompts) in your @file{.guile} file.
address@hidden File}, for more on @file{.guile}.
 @node Value History
@@ -410,6 +425,35 @@ List/show/set options.
 Quit this session.
 @end deffn
+Current REPL options include:
address@hidden @code
address@hidden compile-options
+The options used when compiling expressions entered at the REPL.
address@hidden, for more on compilation options.
address@hidden interp
+Whether to interpret or compile expressions given at the REPL, if such a
+choice is available.  Off by default (indicating compilation).
address@hidden prompt
+A customized REPL prompt.  @code{#f} by default, indicating the default
address@hidden value-history
+Whether value history is on or not.  @xref{Value History}.
address@hidden on-error
+What to do when an error happens.  By default, @code{debug}, meaning to
+enter the debugger.  Other values include @code{backtrace}, to show a
+backtrace without entering the debugger, or @code{report}, to simply
+show a short error printout.
address@hidden table
+Default values for REPL options may be set using
address@hidden from @code{(system repl common)}:
address@hidden {Scheme Procedure} repl-set-default-option! key value
+Set the default value of a REPL option.  This function is particularly
+useful in a user's init file.  @xref{Init File}.
address@hidden deffn
 @node Error Handling
 @subsection Error Handling
diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c
index 0263356..97066b7 100644
--- a/libguile/gen-scmconfig.c
+++ b/libguile/gen-scmconfig.c
@@ -318,6 +318,18 @@ main (int argc, char *argv[])
   pf ("#define SCM_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER %d /* 0 or 1 */\n",
+  pf ("#define SCM_HAVE_GC_PTHREAD_CANCEL 1 /* 0 or 1 */\n");
+  pf ("#define SCM_HAVE_GC_PTHREAD_CANCEL 0 /* 0 or 1 */\n");
+  pf ("#define SCM_HAVE_GC_PTHREAD_EXIT 1 /* 0 or 1 */\n");
+  pf ("#define SCM_HAVE_GC_PTHREAD_EXIT 0 /* 0 or 1 */\n");
   pf ("\n\n/*** File system access ***/\n");
   pf ("/* Define to 1 if `struct dirent64' is available.  */\n");
diff --git a/libguile/pthread-threads.h b/libguile/pthread-threads.h
index c180af2..b5fff83 100644
--- a/libguile/pthread-threads.h
+++ b/libguile/pthread-threads.h
@@ -38,8 +38,19 @@
 #define scm_i_pthread_self                  pthread_self
 #define scm_i_pthread_create                GC_pthread_create
 #define scm_i_pthread_detach                GC_pthread_detach
 #define scm_i_pthread_exit                  GC_pthread_exit
+#define scm_i_pthread_exit                  pthread_exit
 #define scm_i_pthread_cancel                GC_pthread_cancel
+#define scm_i_pthread_cancel                pthread_cancel
 #define scm_i_pthread_cleanup_push          pthread_cleanup_push
 #define scm_i_pthread_cleanup_pop           pthread_cleanup_pop
 #define scm_i_sched_yield                   sched_yield
diff --git a/module/language/objcode/spec.scm b/module/language/objcode/spec.scm
index bbd7454..7cc85b7 100644
--- a/module/language/objcode/spec.scm
+++ b/module/language/objcode/spec.scm
@@ -1,6 +1,6 @@
 ;;; Guile Lowlevel Intermediate Language
-;; Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2009, 2010, 2011 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
@@ -71,7 +71,7 @@
    ((objcode? x)
     (values x #f))
-    (error "can't decompile ~A: not a program or objcode" x))))
+    (error "Object for disassembly not a program or objcode" x))))
 (define-language objcode
   #:title      "Guile Object Code"
diff --git a/module/system/base/compile.scm b/module/system/base/compile.scm
index 7d46713..1b6e73f 100644
--- a/module/system/base/compile.scm
+++ b/module/system/base/compile.scm
@@ -68,16 +68,27 @@
       (lookup-language x)))
-;; Throws an exception if `dir' is not writable. The double-stat is OK,
-;; as this is only used during compilation.
+;; Throws an exception if `dir' is not writable.  The mkdir occurs
+;; before the check, so that we avoid races (possibly due to parallel
+;; compilation).
 (define (ensure-writable-dir dir)
-  (if (file-exists? dir)
-      (if (access? dir W_OK)
-          #t
-          (error "directory not writable" dir))
-      (begin
-        (ensure-writable-dir (dirname dir))
-        (mkdir dir))))
+  (catch 'system-error
+    (lambda ()
+      (mkdir dir))
+    (lambda (k subr fmt args rest)
+      (let ((errno (and (pair? rest) (car rest))))
+        (cond
+         ((eqv? errno EEXIST)
+          (let ((st (stat dir)))
+            (if (or (not (eq? (stat:type st) 'directory))
+                    (not (access? dir W_OK)))
+                (error "directory not writable" dir))))
+         ((eqv? errno ENOENT)
+          (ensure-writable-dir (dirname dir))
+          (ensure-writable-dir dir))
+         (else
+          (throw k subr fmt args rest)))))))
 ;;; This function is among the trickiest I've ever written. I tried many
 ;;; variants. In the end, simple is best, of course.
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm
index 87ab993..109b533 100644
--- a/module/system/repl/command.scm
+++ b/module/system/repl/command.scm
@@ -465,7 +465,11 @@ Compile a file."
 (define-meta-command (disassemble repl (form))
   "disassemble EXP
 Disassemble a compiled procedure."
-  (guile:disassemble (repl-eval repl (repl-parse repl form))))
+  (let ((obj (repl-eval repl (repl-parse repl form))))
+    (if (or (program? obj) (objcode? obj))
+        (guile:disassemble obj)
+        (format #t "Argument to ,disassemble not a procedure or objcode: ~a~%"
+                obj))))
 (define-meta-command (disassemble-file repl file)
   "disassemble-file FILE

GNU Guile

reply via email to

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