1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 01:37:19 +00:00

Replicate segmentation fault

This commit is contained in:
Gavlooth 2018-03-23 05:39:11 +02:00
parent da15dac16b
commit 68bf4d460b

View File

@ -141,5 +141,11 @@ body once, and then memoizes the result."
(defn filter2 [pred coll] (defn filter2 [pred coll]
(tail (iter2lazy (filter pred coll)))) (tail (iter2lazy (filter pred coll))))
(def arr [0 -1 -2 33 -3 0 302 -3 2 8 54 3 -2 0])
(def filtered (filter2 pos? arr))
(defn run-me [] (realize filtered))
#be carfull with the filter function. First element in (filter pos? arr) is nil
#last element is false