--- /dev/null
+main() {
+ var list = [];
+
+ for (var i = 0; i < 1000000; i++) list.add(i);
+
+ var sum = 0;
+ for (i in list) sum += i;
+
+ print(sum);
+}
--- /dev/null
+int list[0];
+
+for (int i; i < 1000000; ++i)
+ list << i;
+
+int sum;
+for(auto i : list)
+ i +=> sum;
+
+<<< sum >>>;
--- /dev/null
+local list = {}
+for i = 0, 999999 do
+ list[i] = i
+end
+
+local sum = 0
+for k, i in pairs(list) do
+ sum = sum + i
+end
+io.write(sum .. "\n")
--- /dev/null
+from __future__ import print_function
+
+# Map "range" to an efficient range in both Python 2 and 3.
+try:
+ range = xrange
+except NameError:
+ pass
+
+list = []
+for i in range(0, 1000000):
+ list.append(i)
+
+sum = 0
+for i in list:
+ sum += i
+print(sum)
--- /dev/null
+list = []
+1000000.times {|i| list << i}
+
+sum = 0
+list.each {|i| sum += i}
+puts sum
--- /dev/null
+var list = []
+
+for (i in 0...1000000) list.add(i)
+
+var sum = 0
+for (i in list) sum = sum + i
+
+System.print(sum)
--- /dev/null
+int count;
+for (int i; i < 1000000; ++i) {
+ if ("abc" == "abc") ++count;
+ if ("a slightly longer string" ==
+ "a slightly longer string") ++count;
+ if ("a significantly longer string but still not overwhelmingly long string" ==
+ "a significantly longer string but still not overwhelmingly long string") ++count;
+
+ if ("" == "abc") ++count;
+ if ("abc" == "abcd") ++count;
+ if ("changed one character" == "changed !ne character") ++count;
+#! if ("123" == 123) ++count
+ if ("a slightly longer string" ==
+ "a slightly longer string!") ++count;
+ if ("a slightly longer string" ==
+ "a slightly longer strinh") ++count;
+ if ("a significantly longer string but still not overwhelmingly long string" ==
+ "another") ++count;
+}
+
+<<< count >>>;
--- /dev/null
+from __future__ import print_function
+
+import time
+start = time.clock()
+
+count = 0
+for i in range(0, 1000000):
+ if "abc" == "abc":
+ count = count + 1
+ if "a slightly longer string" == \
+ "a slightly longer string":
+ count = count + 1
+ if "a significantly longer string but still not overwhelmingly long string" == \
+ "a significantly longer string but still not overwhelmingly long string":
+ count = count + 1
+
+ if "" == "abc":
+ count = count + 1
+ if "abc" == "abcd":
+ count = count + 1
+ if "changed one character" == "changed !ne character":
+ count = count + 1
+ if "123" == 123: count = count + 1
+ if "a slightly longer string" == \
+ "a slightly longer string!":
+ count = count + 1
+ if "a slightly longer string" == \
+ "a slightly longer strinh":
+ count = count + 1
+ if "a significantly longer string but still not overwhelmingly long string" == \
+ "another":
+ count = count + 1
+
+print(count)
+print("elapsed: " + str(time.clock() - start))
--- /dev/null
+var start = System.clock
+
+var count = 0
+for (i in 1..1000000) {
+ if ("abc" == "abc") count = count + 1
+ if ("a slightly longer string" ==
+ "a slightly longer string") count = count + 1
+ if ("a significantly longer string but still not overwhelmingly long string" ==
+ "a significantly longer string but still not overwhelmingly long string") count = count + 1
+
+ if ("" == "abc") count = count + 1
+ if ("abc" == "abcd") count = count + 1
+ if ("changed one character" == "changed !ne character") count = count + 1
+ if ("123" == 123) count = count + 1
+ if ("a slightly longer string" ==
+ "a slightly longer string!") count = count + 1
+ if ("a slightly longer string" ==
+ "a slightly longer strinh") count = count + 1
+ if ("a significantly longer string but still not overwhelmingly long string" ==
+ "another") count = count + 1
+}
+
+System.print(count)
+System.print("elapsed: %(System.clock - start)")
--- /dev/null
+repeat(10)
+ <<< maybe ? : -1 >>>;
--- /dev/null
+<<< __func__ >>>;
+fun void test() {
+<<< __func__ >>>;
+}
+test();
+class C {
+ <<< __func__ >>>;
+ fun void test() {
+ <<< __func__ >>>;
+ }
+ test();
+}
+C c;