From 5a770aead4f59900c347945e4aea5f16cbe0ae85 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 16 May 2019 18:05:01 -0400 Subject: [PATCH] Added (immutable?) --- libs/cyclone/concurrency.sld | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/libs/cyclone/concurrency.sld b/libs/cyclone/concurrency.sld index 17da4680..cc149bbd 100644 --- a/libs/cyclone/concurrency.sld +++ b/libs/cyclone/concurrency.sld @@ -9,8 +9,25 @@ ; ;what role do atomics play? how does that affect GC? (import + (scheme base) ) (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) )