1 # example program: reading a URL over HTTP
 2 
 3 def main [
 4   local-scope
 5   google:&:source:char <- start-reading-from-network 0/real-resources, [google.com/]
 6   n:num <- copy 0
 7   buf:&:buffer:char <- new-buffer 30
 8   {
 9   ¦ c:char, done?:bool <- read google
10   ¦ break-if done?
11   ¦ n <- add n, 1
12   ¦ buf <- append buf, c
13   ¦ loop
14   }
15   result:text <- buffer-to-array buf
16   open-console
17   len:num <- length *result
18   print 0/real-screen, result
19   wait-for-some-interaction
20   close-console
21 ]