jank-lang / jank

The native Clojure dialect hosted on LLVM
https://jank-lang.org
Mozilla Public License 2.0
1.7k stars 50 forks source link

Weird sequence nils #72

Closed madstap closed 6 months ago

madstap commented 6 months ago
(partition-by odd? [1 2]) ;=> ((1 nil))
(mapcat range (range 5)) ;=> (0 0 1 0 1 2 0 1 2 3 nil)
(map range (range 3)) ;=> (() (0) (0 1) nil)
(map-indexed vector (range 5)) ;=> ([0 0] [1 1] [2 2] [3 3] [4 4] nil)

not sure what these all have in common... the equivalent transducers all work, (I'm 98% sure... (there should probably be some tests for this))

jeaye commented 6 months ago

Thanks for reporting!

Likely an issue with lazy seqs. Not chunking, since there's no chunking involved in the first case (range uses it though). This sort of thing is not for the faint of heart to debug. :grin: I won't ask you to look into it. Having these repro cases is already very useful. I'm working on default fn meta right now, but once I wrap that up I'll get this fixed.

None of this is due to your new Clojure code; it's something in C++ land.

For the tests, check out #42. You might be interested in progressing that one, too. :upside_down_face:

jeaye commented 6 months ago

The latter three are fixed, due to an issue with lazy cons objects. The first one is something else, likely due to nested lazy seqs. I'll get it sorted out this week, but I'm out of time for today.

jeaye commented 6 months ago

Found the second issue! All four of those are working for me. If you hit any more problems, let me know.