Discussion:
[Chicken-users] csi works, but not csc
Mark Carter
2018-08-10 21:06:12 UTC
Permalink
I'm new to Scheme. I wrote a little program: cacc.scm.

When I type

    csi cacc.scm

the program runs successfully. However, when I try to compile it:

    csc cacc.scm

it prints out the following errors:

Error: during expansion of (dbind322 ...) - unbound variable:
macro-helpers#list-destruc

    Call history:

    library.scm:3448: print-exit54375438
    library.scm:2290: body3981
    library.scm:2292: assign
    library.scm:3448: current-print-length54395440
    library.scm:2290: body3981
    library.scm:2292: assign
    library.scm:3926: ##sys#print
    library.scm:3188: case-sensitive
    library.scm:3189: keyword-style
    library.scm:3190: ##sys#print-length-limit
    library.scm:3297: outchr
    library.scm:3188: g5148
    library.scm:3927: print-call-chain
    library.scm:3882: ##sys#get-call-chain
    library.scm:3834: ##sys#make-vector
    library.scm:1371: ##sys#allocate-vector          <--

Error: shell command terminated with non-zero exit status 17920:
'/usr/bin/chicken' 'cacc.scm' -output-file 'cacc.c'

What's the problem?
Chris
2018-08-10 21:09:53 UTC
Permalink
Did you use any libraries from chicken that you didn't 'require'? IIRC csi imports a number of helper modules that csc doesn't. I'd check the documentation for csi or csc for exact behavior.
Post by Mark Carter
I'm new to Scheme. I wrote a little program: cacc.scm.
When I type
    csi cacc.scm
    csc cacc.scm
macro-helpers#list-destruc
    library.scm:3448: print-exit54375438
    library.scm:2290: body3981
    library.scm:2292: assign
    library.scm:3448: current-print-length54395440
    library.scm:2290: body3981
    library.scm:2292: assign
    library.scm:3926: ##sys#print
    library.scm:3188: case-sensitive
    library.scm:3189: keyword-style
    library.scm:3190: ##sys#print-length-limit
    library.scm:3297: outchr
    library.scm:3188: g5148
    library.scm:3927: print-call-chain
    library.scm:3882: ##sys#get-call-chain
    library.scm:3834: ##sys#make-vector
    library.scm:1371: ##sys#allocate-vector          <--
'/usr/bin/chicken' 'cacc.scm' -output-file 'cacc.c'
What's the problem?
_______________________________________________
Chicken-users mailing list
https://lists.nongnu.org/mailman/listinfo/chicken-users
--
Chris
Mark Carter
2018-08-10 22:21:28 UTC
Permalink
Can you show us the code you wrote?
I'm thinking the problem has something to do with low-level-macros.

I was really just looking for 'define-syntax-rule'. I managed to write
my own version:
(define-syntax define-syntax-rule
  (syntax-rules ()
    [(define-syntax-rule (id arg ...) body)
     (define-syntax id
       (syntax-rules ()
     [(id arg ...) body]))]))
which, to my surprise, actually works. Bear in mind that I'm a n00b to
Scheme.

So, by jettisoning the module low-level-macros and writing my own
define-syntax-rule, my program manages to compile and run as expected.

So, problem solved. Hmmm. It's a pity chicken wan't a tad more helpful
with its error messages.

Loading...