diff options
author | Andy Wingo <wingo@pobox.com> | 2010-01-15 22:33:49 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-01-15 22:33:49 +0100 |
commit | f826a8864a4ec7bfffac0f67d45f8ce0085e9d23 (patch) | |
tree | d80a108778758bb03c01f07dd13b8cd04f43b02c | |
parent | 5afa815c9cd4550bf93181bc0ed0134aa83dfc5d (diff) | |
download | guile-f826a8864a4ec7bfffac0f67d45f8ce0085e9d23.tar.gz |
fix (class-of #u32())
* libguile/goops.c (scm_class_of, create_standard_classes): Return
<bytevector> or <uvec> for bytevectors, as appropriate.
-rw-r--r-- | libguile/goops.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libguile/goops.c b/libguile/goops.c index 87ae99336..33293fea4 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -166,6 +166,8 @@ static SCM class_frame; static SCM class_objcode; static SCM class_vm; static SCM class_vm_cont; +static SCM class_bytevector; +static SCM class_uvec; /* Port classes. Allocate 3 times the maximum number of port types so that input ports, output ports, and in/out ports can be stored at different @@ -235,6 +237,11 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0, return class_vm; case scm_tc7_vm_cont: return class_vm_cont; + case scm_tc7_bytevector: + if (SCM_BYTEVECTOR_ELEMENT_TYPE (x) == SCM_ARRAY_ELEMENT_TYPE_VU8) + return class_bytevector; + else + return class_uvec; case scm_tc7_string: return scm_class_string; case scm_tc7_number: @@ -2422,6 +2429,10 @@ create_standard_classes (void) scm_class_class, scm_class_top, SCM_EOL); make_stdcls (&class_vm_cont, "<vm-continuation>", scm_class_class, scm_class_top, SCM_EOL); + make_stdcls (&class_bytevector, "<bytevector>", + scm_class_class, scm_class_top, SCM_EOL); + make_stdcls (&class_uvec, "<uvec>", + scm_class_class, class_bytevector, SCM_EOL); make_stdcls (&scm_class_number, "<number>", scm_class_class, scm_class_top, SCM_EOL); make_stdcls (&scm_class_complex, "<complex>", |