wip: call/cc primitives
This commit is contained in:
1 parent
679cc076ad
commit
49292d5d01
4 files changed
+20
-15
No files matched your search
@@ -84,6 +84,7 @@ data Prim e
|
||||
| PrimEnvRef e Int
|
||||
| PrimEnvCode e
|
||||
| PrimCallCC e
|
||||
| PrimCaptureCC
|
||||
| PrimValues (List e)
|
||||
| PrimCallWithValues e e
|
||||
deriving stock (Show, Generic, Functor, Foldable, Traversable, Data, Eq)
|
||||
@@ -164,17 +165,18 @@ primDatumIso namefn a = S.match
|
||||
$ S.With (. ht1 "integer?")
|
||||
$ S.With (. ht1 "write")
|
||||
$ S.With (. ht1 "zero?")
|
||||
$ S.With (. nullop "newline")
|
||||
$ S.With (. ht0 "newline")
|
||||
$ S.With (. ht1' "make-closure")
|
||||
$ S.With (. S.headTagged2 (namefn "env-ref") a S.int)
|
||||
$ S.With (. ht1 "env-code")
|
||||
$ S.With (. ht1 "call/cc")
|
||||
$ S.With (. ht0 "capture/cc")
|
||||
$ S.With (. ht0' "values")
|
||||
$ S.With (. ht2 "call-with-values")
|
||||
$ S.End
|
||||
where
|
||||
idn = S.el . S.sym . namefn
|
||||
nullop s = S.list $ idn s
|
||||
ht0 s = S.list $ idn s
|
||||
ht1 s = S.headTagged1 (namefn s) a
|
||||
ht2 s = S.headTagged2 (namefn s) a a
|
||||
ht1' s = S.headTagged1' (namefn s) a a
|
||||
|
||||
Reference in new issue
Block a user