diff --git a/tools/website.tmpl b/tools/website.tmpl index b16373c4f9..6f7a216a56 100644 --- a/tools/website.tmpl +++ b/tools/website.tmpl @@ -52,7 +52,7 @@
# compute average line length var sum = 0 @@ -81,17 +81,17 @@ echo("Average line length: ", p.greet() # or greet(p)
parallel: - var i = 0 + var i = 0 while i <= a.high: spawn f(a[i]) spawn f(a[i+1]) @@ -100,10 +100,40 @@ p.greet() # or greet(p) i += 1
+proc unsafeScanf(f: File; s: cstring) + {.importc: "fscanf", + header: "<stdio.h>", varargs.} + +var x: cint +unsafeScanf(stdin, "%d", addr x) +
+import jester, asyncdispatch, htmlgen + +routes: + get "/": + resp h1("Hello world") + +runForever() +
+Compile and run with:
+nim c -r example.nim
+View at: localhost:5000
+