[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/03: (system base types) knows about variables
From: |
Andy Wingo |
Subject: |
[Guile-commits] 01/03: (system base types) knows about variables |
Date: |
Tue, 17 Feb 2015 10:07:18 +0000 |
wingo pushed a commit to branch master
in repository guile.
commit 577eab817cda22844a0120e7212029ebdcca6c20
Author: Andy Wingo <address@hidden>
Date: Tue Feb 17 10:58:29 2015 +0100
(system base types) knows about variables
* module/system/base/types.scm (%tc7-variable): New tc7.
(cell->object): Handle tc7-variable.
* test-suite/tests/types.test ("opaque objects"): Add a test.
---
module/system/base/types.scm | 3 +++
test-suite/tests/types.test | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/module/system/base/types.scm b/module/system/base/types.scm
index c051b31..26760d1 100644
--- a/module/system/base/types.scm
+++ b/module/system/base/types.scm
@@ -241,6 +241,7 @@ the matching bits, possibly with bitwise operations to
extract it from BITS."
;; Cell types.
(define %tc3-struct 1)
(define %tc7-symbol 5)
+(define %tc7-variable 7)
(define %tc7-vector 13)
(define %tc7-wvect 15)
(define %tc7-string 21)
@@ -424,6 +425,8 @@ using BACKEND."
(match (cell->object buf backend)
(($ <stringbuf> string)
(string->symbol string))))
+ (((_ & #x7f = %tc7-variable) obj)
+ (inferior-object 'variable address))
(((_ & #x7f = %tc7-string) buf start len)
(match (cell->object buf backend)
(($ <stringbuf> string)
diff --git a/test-suite/tests/types.test b/test-suite/tests/types.test
index c68262b..15dc3f8 100644
--- a/test-suite/tests/types.test
+++ b/test-suite/tests/types.test
@@ -101,6 +101,7 @@
((%make-void-port "w") port (? integer?))
((open-input-string "hello") port (? integer?))
((lambda () #t) program _)
+ ((make-variable 'foo) variable _)
((make-weak-vector 3 #t) weak-vector _)
((make-weak-key-hash-table) weak-table _)
((make-weak-value-hash-table) weak-table _)