mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Merge remote-tracking branch 'origin/immut2-dev' into immut2-dev
This commit is contained in:
commit
75c88c1e06
1 changed files with 18 additions and 1 deletions
|
@ -9,8 +9,25 @@
|
||||||
;
|
;
|
||||||
;what role do atomics play? how does that affect GC?
|
;what role do atomics play? how does that affect GC?
|
||||||
(import
|
(import
|
||||||
|
(scheme base)
|
||||||
)
|
)
|
||||||
(export
|
(export
|
||||||
|
immutable?
|
||||||
|
)
|
||||||
|
(begin
|
||||||
|
(define (dummy) #f)
|
||||||
|
(define-c immutable?
|
||||||
|
"(void *data, int argc, closure _, object k, object obj)"
|
||||||
|
"object result = boolean_f;
|
||||||
|
if (is_object_type(obj) &&
|
||||||
|
(type_of(obj) == pair_tag ||
|
||||||
|
type_of(obj) == vector_tag ||
|
||||||
|
type_of(obj) == bytevector_tag ||
|
||||||
|
type_of(obj) == string_tag
|
||||||
|
) &&
|
||||||
|
immutable(obj) ) {
|
||||||
|
result = boolean_t;
|
||||||
|
}
|
||||||
|
return_closcall1(data, k, result); ")
|
||||||
)
|
)
|
||||||
(begin)
|
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue