Zum Inhalt
Hilbertbus
Aus ProgrammingWiki
<
BuK
<
IIm14
<
Studenten
<
s3damues
Archivierte Version vom 2015-04-20T06:49:55+00:00.
Aktuelle Version
function empty() { // An empty list is a stream that does not call the continuation return function (continuation) { }; } function cons(head, tail) { return function (continuation) { // To construct a new list, we return a stream continuation(head); // That first continues with the head tail(continuation); // and continues the tail }; } function print(stream) { stream(function (v) { // For each value of the stream console.log(v); // Print it }); } function natStreamMaker(start) { cons(start, natStreamMaker(start + 1)); }
print(natStreamMaker(0))
ausführen
Seite
Quelltext
Versionen/Autoren
Konto registrieren
Anmelden
Navigation
Startseite
Letzte Änderungen
Alle Seiten
Einführungskurs
Hilfe
Dateien
Suche
Suchen
Werkzeuge
Links auf diese Seite
Spezialseiten