guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, lua, updated. release_1-9-10-209-g337a


From: No Itisnt
Subject: [Guile-commits] GNU Guile branch, lua, updated. release_1-9-10-209-g337a56f
Date: Thu, 27 May 2010 19:10:29 +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=337a56fd306ee628196d8a20d2091a49fc10633d

The branch, lua has been updated
       via  337a56fd306ee628196d8a20d2091a49fc10633d (commit)
       via  fdc5773ce1243fffcb7df81277c1f178672c34a9 (commit)
       via  cad5d935358d5ccabe6106eff997a24a90f9b274 (commit)
       via  aa592f96b02b203ced91c7153c0411dc432107a5 (commit)
       via  f1046e6b78f3044db6d9fd64cf272864366a1182 (commit)
       via  01fded8c776feba9cb721996414dd98cd687e917 (commit)
      from  304680b5b6bfd085cc15491d22cc29cc4b8e3c1b (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 337a56fd306ee628196d8a20d2091a49fc10633d
Author: No Itisnt <address@hidden>
Date:   Thu May 27 14:05:11 2010 -0500

    Lexer now skips comments and spaces.
    
    * module/language/lua/lexer.scm: skip comments and spaces

commit fdc5773ce1243fffcb7df81277c1f178672c34a9
Merge: 304680b5b6bfd085cc15491d22cc29cc4b8e3c1b 
cad5d935358d5ccabe6106eff997a24a90f9b274
Author: No Itisnt <address@hidden>
Date:   Thu May 27 02:57:20 2010 -0500

    Merge branch 'master' into lua

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

Summary of changes:
 Makefile.am                                        |    2 +-
 configure.ac                                       |    2 +-
 libguile/vm-engine.c                               |    4 +
 libguile/vm.c                                      |    9 ++-
 module/language/lua/lexer.scm                      |   23 +++---
 module/sxml/match.scm                              |    5 +-
 module/sxml/sxml-match.ss                          |    5 +-
 test-suite/Makefile.am                             |    2 +-
 test-suite/lib.scm                                 |    3 +
 test-suite/tests/eval.test                         |   13 +++
 test-suite/tests/sxml-match-tests.ss               |    9 ++
 {module/srfi => test-suite/vm}/Makefile.am         |   60 ++++++-------
 {testsuite => test-suite/vm}/run-vm-tests.scm      |    0
 {testsuite => test-suite/vm}/t-basic-contructs.scm |    0
 {testsuite => test-suite/vm}/t-call-cc.scm         |    0
 {testsuite => test-suite/vm}/t-catch.scm           |    0
 {testsuite => test-suite/vm}/t-closure.scm         |    0
 {testsuite => test-suite/vm}/t-closure2.scm        |    0
 {testsuite => test-suite/vm}/t-closure3.scm        |    0
 {testsuite => test-suite/vm}/t-closure4.scm        |    0
 {testsuite => test-suite/vm}/t-do-loop.scm         |    0
 {testsuite => test-suite/vm}/t-global-bindings.scm |    0
 .../vm}/t-literal-integers.scm                     |    0
 {testsuite => test-suite/vm}/t-macros.scm          |    0
 {testsuite => test-suite/vm}/t-macros2.scm         |    0
 {testsuite => test-suite/vm}/t-map.scm             |    0
 {testsuite => test-suite/vm}/t-match.scm           |    0
 .../vm}/t-mutual-toplevel-defines.scm              |    0
 {testsuite => test-suite/vm}/t-or.scm              |    0
 .../vm}/t-proc-with-setter.scm                     |    0
 {testsuite => test-suite/vm}/t-quasiquote.scm      |    0
 {testsuite => test-suite/vm}/t-records.scm         |    0
 {testsuite => test-suite/vm}/t-values.scm          |    0
 testsuite/Makefile.am                              |   27 ------
 testsuite/the-bug.txt                              |   95 --------------------
 35 files changed, 86 insertions(+), 173 deletions(-)
 copy {module/srfi => test-suite/vm}/Makefile.am (51%)
 rename {testsuite => test-suite/vm}/run-vm-tests.scm (100%)
 rename {testsuite => test-suite/vm}/t-basic-contructs.scm (100%)
 rename {testsuite => test-suite/vm}/t-call-cc.scm (100%)
 rename {testsuite => test-suite/vm}/t-catch.scm (100%)
 rename {testsuite => test-suite/vm}/t-closure.scm (100%)
 rename {testsuite => test-suite/vm}/t-closure2.scm (100%)
 rename {testsuite => test-suite/vm}/t-closure3.scm (100%)
 rename {testsuite => test-suite/vm}/t-closure4.scm (100%)
 rename {testsuite => test-suite/vm}/t-do-loop.scm (100%)
 rename {testsuite => test-suite/vm}/t-global-bindings.scm (100%)
 rename {testsuite => test-suite/vm}/t-literal-integers.scm (100%)
 rename {testsuite => test-suite/vm}/t-macros.scm (100%)
 rename {testsuite => test-suite/vm}/t-macros2.scm (100%)
 rename {testsuite => test-suite/vm}/t-map.scm (100%)
 rename {testsuite => test-suite/vm}/t-match.scm (100%)
 rename {testsuite => test-suite/vm}/t-mutual-toplevel-defines.scm (100%)
 rename {testsuite => test-suite/vm}/t-or.scm (100%)
 rename {testsuite => test-suite/vm}/t-proc-with-setter.scm (100%)
 rename {testsuite => test-suite/vm}/t-quasiquote.scm (100%)
 rename {testsuite => test-suite/vm}/t-records.scm (100%)
 rename {testsuite => test-suite/vm}/t-values.scm (100%)
 delete mode 100644 testsuite/Makefile.am
 delete mode 100644 testsuite/the-bug.txt

diff --git a/Makefile.am b/Makefile.am
index 3705762..9ece841 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,7 +26,7 @@ AUTOMAKE_OPTIONS = 1.10
 
 SUBDIRS = lib meta libguile guile-readline emacs \
          srfi examples test-suite benchmark-suite am \
-         module doc testsuite
+         module doc
 
 libguileincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)
 libguileinclude_HEADERS = libguile.h
diff --git a/configure.ac b/configure.ac
index 73a4bd2..3877411 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1632,9 +1632,9 @@ AC_CONFIG_FILES([
   guile-readline/Makefile
   test-suite/Makefile
   test-suite/standalone/Makefile
+  test-suite/vm/Makefile
   meta/Makefile
   module/Makefile
-  testsuite/Makefile
 ])
 
 AC_CONFIG_FILES([meta/guile-2.0.pc])
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 1976f71..11981ba 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -188,6 +188,10 @@ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
   vm_error_stack_overflow:
     err_msg  = scm_from_locale_string ("VM: Stack overflow");
     finish_args = SCM_EOL;
+    if (stack_limit < vp->stack_base + vp->stack_size)
+      /* There are VM_STACK_RESERVE_SIZE bytes left.  Make them available so
+        that `throw' below can run on this VM.  */
+      vp->stack_limit = vp->stack_base + vp->stack_size;
     goto vm_error;
 
   vm_error_stack_underflow:
diff --git a/libguile/vm.c b/libguile/vm.c
index 1f3e1f8..e036b63 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -65,6 +65,10 @@
    for a discussion.  */
 #define VM_ENABLE_PRECISE_STACK_GC_SCAN
 
+/* Size in SCM objects of the stack reserve.  The reserve is used to run
+   exception handling code in case of a VM stack overflow.  */
+#define VM_STACK_RESERVE_SIZE  512
+
 
 
 /*
@@ -505,7 +509,7 @@ make_vm (void)
 #ifdef VM_ENABLE_STACK_NULLING
   memset (vp->stack_base, 0, vp->stack_size * sizeof (SCM));
 #endif
-  vp->stack_limit = vp->stack_base + vp->stack_size;
+  vp->stack_limit = vp->stack_base + vp->stack_size - VM_STACK_RESERVE_SIZE;
   vp->ip         = NULL;
   vp->sp         = vp->stack_base - 1;
   vp->fp         = NULL;
@@ -534,8 +538,7 @@ vm_stack_mark (GC_word *addr, struct GC_ms_entry 
*mark_stack_ptr,
   vm = * ((struct scm_vm **) addr);
 
   if (vm == NULL
-      || (SCM *) addr != vm->stack_base - 1
-      || vm->stack_limit - vm->stack_base != vm->stack_size)
+      || (SCM *) addr != vm->stack_base - 1)
     /* ADDR must be a pointer to a free-list element, which we must ignore
        (see warning in <gc/gc_mark.h>).  */
     return mark_stack_ptr;
diff --git a/module/language/lua/lexer.scm b/module/language/lua/lexer.scm
index 75171d7..8f4d4c0 100644
--- a/module/language/lua/lexer.scm
+++ b/module/language/lua/lexer.scm
@@ -83,14 +83,15 @@
 
 ;; Main loop
 (define (lex port)
-  (define c (peek-char port))
-  (cond ((eof-object? c) c)
-        ((char-identifier-first? c) (identifier port))
-        ((eq? c #\-)
-         (read-char port)
-         (if (eq? (peek-char port) #\-)
-             (comment port)
-             (error)))
-        ((eq? c #\") (string port #\" #f))
-        ((eq? c #\') (string port #\' #f))
-        (else (error))))
+  (let loop ((c (peek-char port)))
+    (cond ((eof-object? c) c)
+          ((char-whitespace? c) (eat-char port) (loop (peek-char port)))
+          ((char-identifier-first? c) (identifier port))
+          ((eq? c #\-)
+           (read-char port)
+           (if (eq? (peek-char port) #\-)
+               (begin (comment port) (loop (peek-char port)))
+               (error)))
+          ((eq? c #\") (string port #\" #f))
+          ((eq? c #\') (string port #\' #f))
+          (else (error)))))
diff --git a/module/sxml/match.scm b/module/sxml/match.scm
index 5b21dee..d9d0285 100644
--- a/module/sxml/match.scm
+++ b/module/sxml/match.scm
@@ -81,11 +81,14 @@
 ;;; Include upstream source file.
 ;;;
 
-;; This file was taken unmodified from
+;; This file was taken from
 ;; <http://planet.plt-scheme.org/package-source/jim/sxml-match.plt/1/1/> on
 ;; 2010-05-24.  It was written by Jim Bender <address@hidden> and released
 ;; under the MIT/X11 license
 ;; <http://www.gnu.org/licenses/license-list.html#X11License>.
+;;
+;; Modified the `sxml-match1' macro to allow multiple-value returns (upstream
+;; was notified.)
 
 (include-from-path "sxml/sxml-match.ss")
 
diff --git a/module/sxml/sxml-match.ss b/module/sxml/sxml-match.ss
index b139718..40d1179 100644
--- a/module/sxml/sxml-match.ss
+++ b/module/sxml/sxml-match.ss
@@ -1124,7 +1124,10 @@
       [(sxml-match1 exp cata-fun clause0 clause ...)
        (let/ec escape
          (compile-clause clause0 exp cata-fun
-                         (lambda () (escape (sxml-match1 exp cata-fun clause 
...)))))]))
+                         (lambda () (call-with-values
+                                        (lambda () (sxml-match1 exp cata-fun
+                                                                clause ...))
+                                      escape))))]))
   
   (define-syntax sxml-match
     (syntax-rules ()
diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
index 2c1f229..7d65645 100644
--- a/test-suite/Makefile.am
+++ b/test-suite/Makefile.am
@@ -19,7 +19,7 @@
 ##   write to the Free Software Foundation, Inc., 51 Franklin Street,
 ##   Fifth Floor, Boston, MA 02110-1301 USA
 
-SUBDIRS = standalone
+SUBDIRS = standalone vm
 
 SCM_TESTS = tests/00-initial-env.test          \
             tests/alist.test                   \
diff --git a/test-suite/lib.scm b/test-suite/lib.scm
index f32c7c3..235a101 100644
--- a/test-suite/lib.scm
+++ b/test-suite/lib.scm
@@ -37,6 +37,7 @@
  exception:string-contains-nul
  exception:read-error
  exception:null-pointer-error
+ exception:vm-error
 
  ;; Reporting passes and failures.
  run-test
@@ -281,6 +282,8 @@
   (cons 'read-error "^.*$"))
 (define exception:null-pointer-error
   (cons 'null-pointer-error "^.*$"))
+(define exception:vm-error
+  (cons 'vm-error "^.*$"))
 
 ;; as per throw in scm_to_locale_stringn()
 (define exception:string-contains-nul
diff --git a/test-suite/tests/eval.test b/test-suite/tests/eval.test
index 8c06522..83820f7 100644
--- a/test-suite/tests/eval.test
+++ b/test-suite/tests/eval.test
@@ -18,6 +18,7 @@
 (define-module (test-suite test-eval)
   :use-module (test-suite lib)
   :use-module ((srfi srfi-1) :select (unfold count))
+  :use-module ((system vm vm) :select (make-vm vm-apply))
   :use-module (ice-9 documentation))
 
 
@@ -439,4 +440,16 @@
   (pass-if "equal?"
     (equal? (values 1 2 3 4) (values 1 2 3 4))))
 
+;;;
+;;; stack overflow handling
+;;;
+
+(with-test-prefix "stack overflow"
+
+  (pass-if-exception "exception raised"
+    exception:vm-error
+    (let ((vm    (make-vm))
+          (thunk (let loop () (cons 's (loop)))))
+      (vm-apply vm thunk))))
+
 ;;; eval.test ends here
diff --git a/test-suite/tests/sxml-match-tests.ss 
b/test-suite/tests/sxml-match-tests.ss
index 39772b4..824d017 100644
--- a/test-suite/tests/sxml-match-tests.ss
+++ b/test-suite/tests/sxml-match-tests.ss
@@ -299,3 +299,12 @@
                       [(a (@ . ,qqq) ,t ...)
                        (list qqq t ...)])
           '(((z 1) (y 2) (x 3)) 4 5 6))
+
+(run-test "test multiple value returns"
+           (call-with-values
+               (lambda ()
+                 (sxml-match '(foo)
+                   ((foo) (values 'x 'y))))
+             (lambda (x y)
+               (cons x y)))
+           '(x . y))
diff --git a/module/srfi/Makefile.am b/test-suite/vm/Makefile.am
similarity index 51%
copy from module/srfi/Makefile.am
copy to test-suite/vm/Makefile.am
index 7cbac66..0e6e974 100644
--- a/module/srfi/Makefile.am
+++ b/test-suite/vm/Makefile.am
@@ -1,9 +1,9 @@
 ## Process this file with automake to produce Makefile.in.
 ##
-##     Copyright (C) 2000, 2004, 2006, 2008 Free Software Foundation, Inc.
+## Copyright 2005, 2006, 2008, 2009, 2010 Software Foundation, Inc.
+##
+## This file is part of GUILE.
 ##
-##   This file is part of GUILE.
-##   
 ##   GUILE 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, or
@@ -19,34 +19,30 @@
 ##   write to the Free Software Foundation, Inc., 51 Franklin Street,
 ##   Fifth Floor, Boston, MA 02110-1301 USA
 
-AUTOMAKE_OPTIONS = gnu
-
-modpath = srfi
-SOURCES = \
-            srfi-1.scm \
-            srfi-2.scm \
-           srfi-4.scm \
-            srfi-6.scm \
-            srfi-8.scm \
-            srfi-9.scm \
-            srfi-10.scm \
-            srfi-11.scm \
-            srfi-13.scm \
-            srfi-14.scm \
-           srfi-16.scm \
-            srfi-17.scm \
-            srfi-19.scm \
-            srfi-26.scm \
-            srfi-31.scm \
-            srfi-34.scm \
-           srfi-35.scm \
-            srfi-37.scm \
-            srfi-39.scm \
-            srfi-60.scm \
-           srfi-69.scm \
-           srfi-88.scm
+TESTS_ENVIRONMENT = \
+       $(top_builddir)/meta/guile \
+       -l $(srcdir)/run-vm-tests.scm -e run-vm-tests
 
-# Will poke this later.
-NOCOMP_SOURCES = srfi-18.scm
+TESTS =                                                \
+      t-basic-contructs.scm                    \
+      t-global-bindings.scm                    \
+      t-catch.scm                              \
+      t-call-cc.scm                            \
+      t-closure.scm                            \
+      t-closure2.scm                           \
+      t-closure3.scm                           \
+      t-closure4.scm                           \
+      t-do-loop.scm                            \
+      t-literal-integers.scm                   \
+      t-macros.scm                             \
+      t-macros2.scm                            \
+      t-map.scm                                        \
+      t-or.scm                                 \
+      t-proc-with-setter.scm                   \
+      t-quasiquote.scm                         \
+      t-values.scm                             \
+      t-records.scm                            \
+      t-match.scm                              \
+      t-mutual-toplevel-defines.scm
 
-include $(top_srcdir)/am/guilec
+EXTRA_DIST = run-vm-tests.scm $(TESTS)
diff --git a/testsuite/run-vm-tests.scm b/test-suite/vm/run-vm-tests.scm
similarity index 100%
rename from testsuite/run-vm-tests.scm
rename to test-suite/vm/run-vm-tests.scm
diff --git a/testsuite/t-basic-contructs.scm 
b/test-suite/vm/t-basic-contructs.scm
similarity index 100%
rename from testsuite/t-basic-contructs.scm
rename to test-suite/vm/t-basic-contructs.scm
diff --git a/testsuite/t-call-cc.scm b/test-suite/vm/t-call-cc.scm
similarity index 100%
rename from testsuite/t-call-cc.scm
rename to test-suite/vm/t-call-cc.scm
diff --git a/testsuite/t-catch.scm b/test-suite/vm/t-catch.scm
similarity index 100%
rename from testsuite/t-catch.scm
rename to test-suite/vm/t-catch.scm
diff --git a/testsuite/t-closure.scm b/test-suite/vm/t-closure.scm
similarity index 100%
rename from testsuite/t-closure.scm
rename to test-suite/vm/t-closure.scm
diff --git a/testsuite/t-closure2.scm b/test-suite/vm/t-closure2.scm
similarity index 100%
rename from testsuite/t-closure2.scm
rename to test-suite/vm/t-closure2.scm
diff --git a/testsuite/t-closure3.scm b/test-suite/vm/t-closure3.scm
similarity index 100%
rename from testsuite/t-closure3.scm
rename to test-suite/vm/t-closure3.scm
diff --git a/testsuite/t-closure4.scm b/test-suite/vm/t-closure4.scm
similarity index 100%
rename from testsuite/t-closure4.scm
rename to test-suite/vm/t-closure4.scm
diff --git a/testsuite/t-do-loop.scm b/test-suite/vm/t-do-loop.scm
similarity index 100%
rename from testsuite/t-do-loop.scm
rename to test-suite/vm/t-do-loop.scm
diff --git a/testsuite/t-global-bindings.scm 
b/test-suite/vm/t-global-bindings.scm
similarity index 100%
rename from testsuite/t-global-bindings.scm
rename to test-suite/vm/t-global-bindings.scm
diff --git a/testsuite/t-literal-integers.scm 
b/test-suite/vm/t-literal-integers.scm
similarity index 100%
rename from testsuite/t-literal-integers.scm
rename to test-suite/vm/t-literal-integers.scm
diff --git a/testsuite/t-macros.scm b/test-suite/vm/t-macros.scm
similarity index 100%
rename from testsuite/t-macros.scm
rename to test-suite/vm/t-macros.scm
diff --git a/testsuite/t-macros2.scm b/test-suite/vm/t-macros2.scm
similarity index 100%
rename from testsuite/t-macros2.scm
rename to test-suite/vm/t-macros2.scm
diff --git a/testsuite/t-map.scm b/test-suite/vm/t-map.scm
similarity index 100%
rename from testsuite/t-map.scm
rename to test-suite/vm/t-map.scm
diff --git a/testsuite/t-match.scm b/test-suite/vm/t-match.scm
similarity index 100%
rename from testsuite/t-match.scm
rename to test-suite/vm/t-match.scm
diff --git a/testsuite/t-mutual-toplevel-defines.scm 
b/test-suite/vm/t-mutual-toplevel-defines.scm
similarity index 100%
rename from testsuite/t-mutual-toplevel-defines.scm
rename to test-suite/vm/t-mutual-toplevel-defines.scm
diff --git a/testsuite/t-or.scm b/test-suite/vm/t-or.scm
similarity index 100%
rename from testsuite/t-or.scm
rename to test-suite/vm/t-or.scm
diff --git a/testsuite/t-proc-with-setter.scm 
b/test-suite/vm/t-proc-with-setter.scm
similarity index 100%
rename from testsuite/t-proc-with-setter.scm
rename to test-suite/vm/t-proc-with-setter.scm
diff --git a/testsuite/t-quasiquote.scm b/test-suite/vm/t-quasiquote.scm
similarity index 100%
rename from testsuite/t-quasiquote.scm
rename to test-suite/vm/t-quasiquote.scm
diff --git a/testsuite/t-records.scm b/test-suite/vm/t-records.scm
similarity index 100%
rename from testsuite/t-records.scm
rename to test-suite/vm/t-records.scm
diff --git a/testsuite/t-values.scm b/test-suite/vm/t-values.scm
similarity index 100%
rename from testsuite/t-values.scm
rename to test-suite/vm/t-values.scm
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
deleted file mode 100644
index 2bc7814..0000000
--- a/testsuite/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-TESTS_ENVIRONMENT = \
-       $(top_builddir)/meta/guile \
-       -l $(srcdir)/run-vm-tests.scm -e run-vm-tests
-
-TESTS =                                                \
-      t-basic-contructs.scm                    \
-      t-global-bindings.scm                    \
-      t-catch.scm                              \
-      t-call-cc.scm                            \
-      t-closure.scm                            \
-      t-closure2.scm                           \
-      t-closure3.scm                           \
-      t-closure4.scm                           \
-      t-do-loop.scm                            \
-      t-literal-integers.scm                   \
-      t-macros.scm                             \
-      t-macros2.scm                            \
-      t-map.scm                                        \
-      t-or.scm                                 \
-      t-proc-with-setter.scm                   \
-      t-quasiquote.scm                         \
-      t-values.scm                             \
-      t-records.scm                            \
-      t-match.scm                              \
-      t-mutual-toplevel-defines.scm
-
-EXTRA_DIST = run-vm-tests.scm $(TESTS)
diff --git a/testsuite/the-bug.txt b/testsuite/the-bug.txt
deleted file mode 100644
index 95683f4..0000000
--- a/testsuite/the-bug.txt
+++ /dev/null
@@ -1,95 +0,0 @@
--*- Outline -*-
-
-Once (system vm assemble) is compiled, things start to fail in
-unpredictable ways.
-
-* `compile-file' of non-closure-using programs works
-
-$ guile-disasm t-records.go > t-records.ref.asm
-...
-$ diff -uBb t-macros.*.asm
-$ diff -uBb t-records.*.asm
-$ diff -uBb t-global-bindings.*.asm
-
-* `compile-file' of closure-using programs fails
-
-ERROR: During compiling t-closure.scm:
-ERROR: VM: Wrong type to apply: #(<venv> ((parent . #(<venv> ((parent . #f) 
(nexts . 1) (closure? . #f)))) (nexts . 0) (closure? . #f))) [IP offset: 28]
-
-guile> (vm-debugger (the-vm))
-debug> bt
-#1 #<variable 30b12468 value: (#(<glil-asm> #(<glil-vars> ((nargs . 0) (nrest 
. 0) (nlocs . 0) (nexts . 1))) (#(<glil-const> 2) #(<glil-bind> ((x external 
0))) #(<glil-external> set 0 0) #(<glil-asm> #(<glil-vars> ((nargs . 0) (nrest 
. 0) (nlocs . 1) (nexts . 0))) (#(<glil-module> ref #f +) #(<glil-const> 1) 
#(<glil-external> ref 1 0) #(<glil-call> call 2) #(<glil-source> (2 . 15)) 
#(<glil-bind> ((x++ local 0))) #(<glil-local> set 0) #(<glil-local> ref 0) 
#(<glil-external> set 1 0) #(<glil-local> ref 0) #(<glil-call> return 0) 
#(<glil-unbind>))) #(<glil-call> return 0) #(<glil-unbind>))) #<directory 
(guile-user) 100742d0> ())>
-#2 (#<program 30ae74b8> #(<glil-vars> ...) (#(<glil-const> ...) #(<glil-bind> 
...) ...))   
-#3 (#<program 30af7090>)
-#4 (#<program 30af94c0> #(<glil-vars> ...) (#(<glil-module> ...) 
#(<glil-const> ...) ...)) 
-#5 (#<program 30b00108>)
-#6 (#<program 30b02590> ref ...)
-#7 (_l 1 #(<venv> ...))
-guile> (vm-debugger (the-vm))
-debug> stack
-(#t closure? #(<venv> ((parent . #(<venv> ((parent . #f) (nexts . 1) (closure? 
. #f)))) (nexts . 0) (closure? . #f))) #<procedure #f (struct name val)> 
#<primitive-generic map> #<primitive-generic map> #<program 30998470>)
-
-* Compiling anything "by hand" fails
-
-** Example 1:  the read/compile/run loop
-
-guile> (set! %load-path (cons "/home/ludo/src/guile-vm/module" %load-path))
-guile> (use-modules (system vm assemble)(system vm core)(system repl repl))
-guile> (start-repl 'scheme)
-Guile Scheme interpreter 0.5 on Guile 1.7.2
-Copyright (C) 2001 Free Software Foundation, Inc.
-
-Enter `,help' for help.
address@hidden> (use-modules (ice-9 match)
-            (system base syntax)
-            (system vm assemble))
-
-(define (%preprocess x e)
-  (match x
-    (($ <glil-asm> vars body)
-     (let* ((venv (<venv> :parent e :nexts (slot vars 'nexts) :closure? #f))
-           (body (map (lambda (x) (preprocess x venv)) body)))
-       (<vm-asm> :venv venv :glil x :body body)))
-    (($ <glil-external> op depth index)
-     (do ((d depth (1- d))
-         (e e (slot e 'parent)))
-        ((= d 0))
-       (set! (slot e 'closure?) #t))
-     x)
-    (else x)))
-
address@hidden> preprocess
-#<procedure preprocess (x e)>
address@hidden> (getpid)
-470
address@hidden> (set! preprocess %preprocess)
address@hidden> preprocess
-ERROR: VM: Unbound variable: #<variable 30a0d5e0 value: #<undefined>>
address@hidden> getpid
-ERROR: VM: Unbound variable: #<variable 30a0d5e0 value: #<undefined>>
address@hidden>
-
-
-** Example 2:  the test suite (which also reads/compiles/runs)
-
-All the closure-using tests fail.
-
address@hidden:~/src/guile-vm/testsuite $ make check
-../src/guile-vm -L ../module            \
-            -l run-vm-tests.scm -e run-vm-tests \
-            t-global-bindings.scm t-closure.scm t-closure2.scm t-closure3.scm 
t-do-loop.scm t-macros.scm t-proc-with-setter.scm t-values.scm t-records.scm 
t-match.scm
-
-running `t-global-bindings.scm'...  reading...  compiling...  running...  ok
-running `t-closure.scm'...  reading...  compiling...  [vm-error/(vm-run VM: 
Wrong type to apply: ~S [IP offset: ~a] (#(<venv> ((parent . #(<venv> ((parent 
. #f) (nexts . 1) (closure? . #f)))) (nexts . 0) (closure? . #f))) 28))] FAILED
-running `t-closure2.scm'...  reading...  compiling...  [vm-error/(vm-run VM: 
Wrong type to apply: ~S [IP offset: ~a] (#(<venv> ((parent . #(<venv> ((parent 
. #(<venv> ((parent . #f) (nexts . 0) (closure? . #f)))) (nexts . 1) (closure? 
. #f)))) (nexts . 0) (closure? . #f))) 28))] FAILED
-running `t-closure3.scm'...  reading...  compiling...  [vm-error/(vm-run VM: 
Wrong ype to apply: ~S [IP offset: ~a] (#(<venv> ((parent . #(<venv> ((parent . 
#(<venv> ((parent . #f) (nexts . 0) (closure? . #f)))) (nexts . 1) (closure? . 
#f)))) (nexts . 0) (closure? . #f))) 28))] FAILED
-running `t-do-loop.scm'...  reading...  compiling...  [vm-error/(vm-run VM: 
Wrong type to apply: ~S [IP offset: ~a] (#(<venv> ((parent . #(<venv> ((parent 
. #f) (nexts . 1) (closure? . #f)))) (nexts . 0) (closure? . #f))) 28))] FAILED
-running `t-macros.scm'...  reading...  compiling...  running...  ok
-running `t-proc-with-setter.scm'...  reading...  compiling...  running...  ok
-running `t-values.scm'...  reading...  compiling...  running...  ok
-running `t-records.scm'...  reading...  compiling...  running...  ok
-running `t-match.scm'...  reading...  compiling...  running...  ok
-
-4 tests failed out of 10
-make: *** [check] Error 4
-


hooks/post-receive
-- 
GNU Guile



reply via email to

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