mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 01:07:34 +02:00
Tweaks
- Allow deref of shared queues - Added (realized? obj) as a stub
This commit is contained in:
parent
6e8c0b6088
commit
7c6be060af
1 changed files with 11 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
(export
|
||||
;; Generic Concurrency
|
||||
deref
|
||||
realized?
|
||||
;; Atoms
|
||||
make-atom
|
||||
atom
|
||||
|
@ -61,8 +62,18 @@
|
|||
(cond
|
||||
((atom? obj) (atom-deref obj))
|
||||
((future? obj) (future-deref obj))
|
||||
((shared-queue? obj) (shared-queue-remove! obj))
|
||||
(else obj)))
|
||||
|
||||
;; TODO: (realized? obj) - see clojure docs
|
||||
;; Returns true if a value has been produced for a promise, delay, future or lazy sequence.
|
||||
(define (realized? obj)
|
||||
(cond
|
||||
;; TODO: ((future? obj)
|
||||
;; TODO: ((shared-delay? obj)
|
||||
;; TODO: ((shared-promise? obj)
|
||||
(else #f)))
|
||||
|
||||
(define-c atom?
|
||||
"(void *data, int argc, closure _, object k, object obj)"
|
||||
" object result = Cyc_is_atomic(obj);
|
||||
|
|
Loading…
Add table
Reference in a new issue