Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongough committed Sep 2, 2010
2 parents 6af837f + 96d5aaa commit 5c91603
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
0.0.3
0.0.4
13 changes: 13 additions & 0 deletions examples/blast_off.koi
@@ -0,0 +1,13 @@
countdown = function( count )
print( to_string( count ))
print( ", " )
if( count == 0 )
return()
end
count = count - 1
call( countdown, count )
end

call( countdown, 10 )

print( "Blast Off!" )
10 changes: 10 additions & 0 deletions examples/high_order_functions.koi
@@ -0,0 +1,10 @@
new_function = function(arg)
func = function(arg)
print("Dynamically created function")
end
return( func )
end

func = call( new_function, nil )

call( func, nil )
25 changes: 25 additions & 0 deletions examples/iterator.koi
@@ -0,0 +1,25 @@
test = { 0 => "element 1", 1 => "element 1", 2 => "element 3", 3 => "element 4" }

iterator = function(hash)
index = hash["counter"]

if( index == nil )
hash["counter"] = 0
index = 0
end

content = hash[index]

if( type_of(content) == "string")
print( content )
end

if( content == nil )
return()
end

hash[counter] = index + 1
call( iterator, hash )
end

call( iterator, test )

0 comments on commit 5c91603

Please sign in to comment.