koi-lang 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -0,0 +1,13 @@
1
+ countdown = function( count )
2
+ print( to_string( count ))
3
+ print( ", " )
4
+ if( count == 0 )
5
+ return()
6
+ end
7
+ count = count - 1
8
+ call( countdown, count )
9
+ end
10
+
11
+ call( countdown, 10 )
12
+
13
+ print( "Blast Off!" )
@@ -0,0 +1,10 @@
1
+ new_function = function(arg)
2
+ func = function(arg)
3
+ print("Dynamically created function")
4
+ end
5
+ return( func )
6
+ end
7
+
8
+ func = call( new_function, nil )
9
+
10
+ call( func, nil )
@@ -0,0 +1,25 @@
1
+ test = { 0 => "element 1", 1 => "element 1", 2 => "element 3", 3 => "element 4" }
2
+
3
+ iterator = function(hash)
4
+ index = hash["counter"]
5
+
6
+ if( index == nil )
7
+ hash["counter"] = 0
8
+ index = 0
9
+ end
10
+
11
+ content = hash[index]
12
+
13
+ if( type_of(content) == "string")
14
+ print( content )
15
+ end
16
+
17
+ if( content == nil )
18
+ return()
19
+ end
20
+
21
+ hash[counter] = index + 1
22
+ call( iterator, hash )
23
+ end
24
+
25
+ call( iterator, test )
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Aaron Gough
@@ -73,6 +73,9 @@ files:
73
73
  - Rakefile
74
74
  - VERSION
75
75
  - bin/koi
76
+ - examples/blast_off.koi
77
+ - examples/high_order_functions.koi
78
+ - examples/iterator.koi
76
79
  has_rdoc: true
77
80
  homepage: http://github.com/aarongough/koi
78
81
  licenses: []