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   clear-screen 0/screen  # non-scrolling app
18   len:num <- length *result
19   print 0/real-screen, result
20   wait-for-some-interaction
21   close-console
22 ]