Created
February 17, 2018 01:57
-
-
Save fare/7e5720bd3c156452bfe790c83a810e79 to your computer and use it in GitHub Desktop.
case-lambda works in the interpreter, only accepts the base case in the compiler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; works with Gerbil v0.12-DEV-1315-g5902327 on Gambit v4.8.8-434-g490f0a7d on nixpkgs 867d3f9 (gcc 7.2.0) | |
;; fails with Gerbil v0.12-DEV-1404-g0a266db on Gambit v4.8.8-435-gd1991ba7 on nixpkgs dafdaa9 (gcc 7.3.0) | |
package: bug | |
(export #t) | |
(import :clan/utils/assert) | |
(def foo (case-lambda (() 0) ((x) 1) ((x y) 2) ((x y z . t) (+ 3 (length t))))) | |
(def (test-foo) | |
(assert-equal! (foo) 0) | |
(assert-equal! (foo 0) 1) | |
(assert-equal! (foo 0 1) 2) | |
(assert-equal! (foo 0 1 2) 3) | |
(assert-equal! (foo 0 1 2 3) 4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution to the issue: two different versions of gcc 6.4.0 were used, because my
$NIX_PATH
and my$nixpkgs
didn't agree with each other, sogerbil-nix-env.sh
was getting the wrong path.