I'm posting this to Gambit and not the Snow list because this is Gambit specific (or at least specific to the portable implementation of syntax-case that Gambit uses). I believe there is a bug which causes gsc to crash when compiling a snow package in Gambit's syntax-case environment (gsc -e '(load "~~/syntax-case")', or in Snow terms, using gambit-sc as the snow host). Any package that uses define-record* crashes. It looks like Snow implements its own form of define-record, and it must be somehow conflicting in the syntax-case environment.
If I have a simple snow package like so:
(package* sc/v1.0.0 (provide: (define-record* vec3d x y z)))
(display "Nothing here")
This code runs fine interpreted (using `snow -- sc.scm`) as well as compiling fine under Gambit without syntax-case, however when trying to compile the module with a snow host of "gambit-sc" (which is just gambit with syntax-case loaded in), I get an ugly crash:
/usr/share/snow/current/bin/snow: line 185: 25809 Bus error "${PROGRAM_gambit_comp}" -prelude '(begin (include "'${SNOW_MACROS}'") (include*-cd "'${snow_file}'"))' -e '(load "~~/syntax-case")' "${snow_file}"
If I change snow to include syntax-case.scm and not load it, I get this error:
*** ERROR IN #<procedure #2> -- Wrong number of arguments passed to procedure (sc#eval '(begin (define (_snow:macro-expand expr) expr) (cond-expand ((or guile kawa) #f) (else '(begin)))) '#(env #(top-ribcage *top* #t) ((top) #(top-ribcage *top* #t))))
I also added -:dr- so I'd have a repl when this happened, and here's the procedure attached to the current frame:
#<procedure #2> = (lambda (%%%%lst512) (datum->syntax-object %%%%k310 (apply (lambda %%%%exprs613 (if (pair? %%%%exprs613) (sc#eval (if (null? (cdr %%%%exprs613)) (car %%%%exprs613) (cons 'begin %%%%exprs613)) (sc#interaction-environment)) #f)) %%%%lst512)))
I'm somewhat new to syntax-case so I have no idea what's going on. Apologies for probably not debugging this very well, I'm just dumping everything I can find about it.
I am using Snow 1.1.1 and Gambit 4.0.1.