Comments (2)
import cps
type C = ref object of RootObj
fn*: proc(c: C): C {.nimcall.}
proc prim(s: string): C {.cpsMagic.} =
echo s
return c
proc f(): C {.cps.} =
cps prim("one")
block:
cps prim("two")
cps prim("three")
var c = f()
while c != nil and c.fn != nil:
c = c.fn(c)
from cps.
expect "one two three" as output, only shows "one two"
from cps.
Related Issues (20)
- CPS confused by indexing cps call result foo()[0]
- Error: cps doesn't know how to rewrite this into assignment: HOT 1
- The code in the doc doesn't work HOT 3
- support CPS transformations on nnkLambda and non-top-level procs HOT 1
- "... has no type" compilation error on `return`
- Compile time is growing HOT 3
- Handle inner procs HOT 3
- whelp can't process `borrow-ed` symbols HOT 1
- Calling a magic of a different base type is a runtime error instead of compile time
- Unable to overload voodoo/magic by continuation types HOT 3
- Performance benchmarks of tight loops etc. HOT 3
- cpsMagic overloading is broken on master HOT 2
- Cannot create a type referencing a local constant
- move cc syntax hack into continuation legs HOT 1
- lifted variables are not initialized when entering scope
- compiler crash when defining nested proc in continuation proc HOT 1
- CPS leaks under arc on cps-cps calls HOT 1
- CPS leaks when dropping the continuation in a cps-cps call HOT 1
- Support js target HOT 3
- CallNodes = nnkCallKinds HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cps.