Skip to content

Internal error . . . : bad range code when evalutaing a simple tetration program #1546

@mobotsar

Description

@mobotsar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis is not expected behavior, and needs fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions