User loginNavigation |
Typed callcc in a stack-based languageI have been playing with the idea of adding a call-with-current-continuation primitive ( callcc : ('A ('A ('A -> 'B) -> 'B) -> 'B) The formal semantics would be: [$A [$B] callcc $C] == [$A [$C] $B] An example usage would be: >> define do_twice { dup [apply] dip apply } >> define test { 1 [do_twice] callcc inc } >> test stack: 3 My questions are: am I doing this right? Does the type look correct? Is it a good idea to add continuations to Cat? Thanks in advance! By cdiggins at 2007-06-04 21:24 | LtU Forum | previous forum topic | next forum topic | other blogs | 9516 reads
|
Browse archives
Active forum topics
|
Recent comments
9 weeks 5 days ago
14 weeks 6 hours ago
15 weeks 4 days ago
15 weeks 4 days ago
18 weeks 2 days ago
22 weeks 6 days ago
22 weeks 6 days ago
23 weeks 2 days ago
23 weeks 2 days ago
26 weeks 1 day ago