+ 55 9
+
+###### test: func_ret_type
+
+ func double(n:number):number
+ use n+n
+
+ func answer
+ prefix:string
+ suffix:string
+ return string
+ do
+ use prefix ++ suffix
+
+ func noarg_returns
+ return Boolean
+ do
+ use 22/7 == 3.14159
+
+ func main()
+ for j:=10; then j = j - 3; while j > -5:
+ print answer("dou","ble"), j, "is", double(j)
+
+###### output: func_ret_type
+ double 10 is 20
+ double 7 is 14
+ double 4 is 8
+ double 1 is 2
+ double -2 is -4
+
+## References
+
+A simple linked list example
+
+###### test list
+ oceani_tests += "linked_list,one,two,three,four"
+
+###### test: linked_list
+
+ struct node
+ next: @node
+ this: string
+
+ func insert(list:@node; new:string):@node
+ p:=list
+ prev := @nil
+ while ?p and then p@.this < new:
+ prev = p
+ p = p@.next
+ if ?prev:
+ prev@.next = @new()
+ prev@.next@.next = p
+ prev@.next@.this = new
+ else
+ list = @new()
+ list@.next = p
+ list@.this = new
+ use list
+
+ func printlist(list:@node)
+ while ?list:
+ print list@.this
+ list = list@.next
+
+ func freelist(list:@node)
+ if list != @nil:
+ freelist(list@.next)
+ @free = list
+
+ func main(argv:[ac::]string)
+ list := insert(@nil, "@start")
+ list = insert(list, "~end")
+ for i:=1; then i=i+1; while i < ac:
+ list = insert(list, argv[i])
+ list = insert(list, "Hello!")
+ printlist(list)
+ freelist(list)
+
+###### output: linked_list,one,two,three,four
+ @start
+ Hello!
+ four
+ one
+ three
+ two
+ ~end