The following program is supposed to calculate the tetration of 4 with 4, but instead results in (core dumped). It works correctly for several other inputs including the edge cases.
#!/usr/bin/env janet
(defn pow [a b] (* ;(map (fn [x] a) (range 0 b))))
(defn fold [xs init f] (var acc init) (each x xs (set acc (f x acc))) acc)
(defn tet [a b] (fold (map (fn [x] a) (range 0 b)) 1 pow))
(tet 4 4)
The full error message is
janet internal error at line 458 in file src/core/corelib.c: bad range code
zsh: IOT instruction (core dumped) janet bug.janet
janet --version prints 1.37.1-local.
Please let me know if there's any more you need me to provide.