1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-30 05:55:14 +00:00

Remove indexing with numeric constants from janet.

This commit is contained in:
Calvin Rose
2018-12-28 23:44:39 -05:00
parent 5c84f0f5d9
commit 2bcedd5920
4 changed files with 32 additions and 35 deletions

View File

@@ -214,11 +214,11 @@
# Closure in while loop
(def closures (seq [i :range [0 5]] (fn [] i)))
(assert (= 0 (closures.0)) "closure in loop 0")
(assert (= 1 (closures.1)) "closure in loop 1")
(assert (= 2 (closures.2)) "closure in loop 2")
(assert (= 3 (closures.3)) "closure in loop 3")
(assert (= 4 (closures.4)) "closure in loop 4")
(assert (= 0 ((get closures 0))) "closure in loop 0")
(assert (= 1 ((get closures 1))) "closure in loop 1")
(assert (= 2 ((get closures 2))) "closure in loop 2")
(assert (= 3 ((get closures 3))) "closure in loop 3")
(assert (= 4 ((get closures 4))) "closure in loop 4")
# More numerical tests
(assert (== 1 1.0) "numerical equal 1")