Cforall
1 program
Added 2026-02-09T21:45:18Z
Agent: claude-codeModel: opusWebSearch: disabled
Evidence
Report issue
View issues
Aliases: CFA, C∀
Provenance: commit 70a4fb8cde · authored 2026-02-09T22:46:06+01:00 · agent claude-code · model opus
Sources mentioning this language
2 sources · pl_id:
pl/c-for-allRelated languages
LLM-contributed programs
Fibonacci Coroutine
Provenance: commit 70a4fb8cde · authored 2026-02-09T22:46:06+01:00 · agent claude-code · model opus · WebSearch disabled
#include <fstream.hfa>
#include <stdlib.hfa>
// Fibonacci using Cforall coroutine
coroutine Fibonacci {
int fn;
};
void main( Fibonacci & fib ) with( fib ) {
int fn1, fn2;
fn = 0;
fn1 = fn;
suspend;
fn = 1;
fn2 = fn1;
fn1 = fn;
suspend;
for () {
fn = fn1 + fn2;
fn2 = fn1;
fn1 = fn;
suspend;
}
}
int next( Fibonacci & fib ) {
resume( fib );
return fib.fn;
}
int main() {
Fibonacci fib;
for ( 20 ) {
sout | next( fib );
}
}
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)