[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/02: (system base types) knows about variables
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] 01/02: (system base types) knows about variables |
Date: |
Wed, 25 Feb 2015 20:56:22 +0000 |
civodul pushed a commit to branch stable-2.0
in repository guile.
commit 6cd1c6c79c591927e078e11f64c29ccbfcfdf842
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 | 3 ++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/module/system/base/types.scm b/module/system/base/types.scm
index de86bfc..39c2f58 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)
@@ -423,6 +424,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 191662d..c3917d7 100644
--- a/test-suite/tests/types.test
+++ b/test-suite/tests/types.test
@@ -1,6 +1,6 @@
;;;; types.test --- Type tag decoding. -*- mode: scheme; coding: utf-8;
-*-
;;;;
-;;;; Copyright (C) 2014 Free Software Foundation, Inc.
+;;;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
;;;;
;;;; This file is part of GNU Guile.
;;;;
@@ -103,6 +103,7 @@
((open-input-string "hello") port (? integer?))
((lambda () #t) program _)
((the-vm) vm _)
+ ((make-variable 'foo) variable _)
((make-weak-vector 3 #t) weak-vector _)
((make-hash-table) hash-table _)
((make-weak-key-hash-table) hash-table _)