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 +1 -1
- data/examples/blast_off.koi +13 -0
- data/examples/high_order_functions.koi +10 -0
- data/examples/iterator.koi +25 -0
- metadata +5 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
@@ -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
|
-
-
|
9
|
-
version: 0.0.
|
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: []
|