mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
Added (prim:mutates? exp)
This commit is contained in:
parent
0f7839c4ce
commit
19a8080103
1 changed files with 17 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
||||||
prim/data-arg?
|
prim/data-arg?
|
||||||
prim/c-var-assign
|
prim/c-var-assign
|
||||||
prim/cvar?
|
prim/cvar?
|
||||||
|
prim:mutates?
|
||||||
prim:cont?
|
prim:cont?
|
||||||
prim:cont/no-args?
|
prim:cont/no-args?
|
||||||
prim:arg-count?
|
prim:arg-count?
|
||||||
|
@ -25,6 +26,22 @@
|
||||||
; prim? : exp -> boolean
|
; prim? : exp -> boolean
|
||||||
(define (prim? exp)
|
(define (prim? exp)
|
||||||
(member exp *primitives*))
|
(member exp *primitives*))
|
||||||
|
|
||||||
|
;; Does primitive mutate any of its arguments?
|
||||||
|
(define (prim:mutates? exp)
|
||||||
|
(member
|
||||||
|
exp
|
||||||
|
'(
|
||||||
|
Cyc-set-cvar!
|
||||||
|
Cyc-spawn-thread!
|
||||||
|
Cyc-end-thread!
|
||||||
|
set-global!
|
||||||
|
set-cell!
|
||||||
|
set-car!
|
||||||
|
set-cdr!
|
||||||
|
string-set!
|
||||||
|
bytevector-u8-set!
|
||||||
|
vector-set!)))
|
||||||
|
|
||||||
(define *primitives* '(
|
(define *primitives* '(
|
||||||
Cyc-global-vars
|
Cyc-global-vars
|
||||||
|
|
Loading…
Add table
Reference in a new issue