On Thu, Jan 20, 2011 at 08:46:16AM -0700, Alan Post wrote:
> On Thu, Jan 20, 2011 at 06:58:27AM -0700, Alan Post wrote:
> > I've been refactoring the interface between 3 of the subsystems in
> > my egg, genturfa'i.  I've made a ton of changes to the code, and
> > am at the point where I'm ready to compile everything and figure
> > out what is broken.  I run chicken-install -s, and as it tries
> > to compile my library, gives me the following error:
> > 
> >   Error: (caddr) bad argument type: *
> > 
> >           Call history:
> > 
> >           <syntax>          (##core#begin (define genturfahi-version-major 
> > 0) (define genturfahi-version-minor 0) (define gentur......
> >           <syntax>          (define genturfahi-version-major 0)
> >           <syntax>          (##core#set! genturfahi-version-major 0)
> >           <syntax>          (define genturfahi-version-minor 0)
> >           <syntax>          (##core#set! genturfahi-version-minor 0)
> >           <syntax>          (define genturfahi-version-patch 1)
> >           <syntax>          (##core#set! genturfahi-version-patch 1)
> >           <syntax>          (define genturfahi-version "trunk")
> >           <syntax>          (##core#set! genturfahi-version "trunk")
> >           <syntax>          (##core#undefined)    <--
> > 
> >   Error: shell command terminated with non-zero exit status 17920:
> >   /opt/chicken-master/bin/chicken chicken-ext.scm -output-file
> >   genturfahi.c -dynamic -feature chicken-compile-shared -feature
> >   compiling-extension -setup-mode -debug-level 2 -emit-import-library
> >   genturfahi
> > 
> > I don't have an explicit call to caddr anywhere in my code, and I
> > believe the following line:
> > 
> >           <syntax>          (##core#set! genturfahi-version "trunk")
> > 
> > Refers to the last line in the last file of my library.
> > 
> > I've been looking over diffs trying to see if I've introduced a
> > subtle scope or syntax error somewhere, but I'm not having much
> > luck.
> > 
> > What do I do with an error message like the one above?  It isn't
> > obvious to me where I need to look to fix the problem.
> 
> I've narrowed this down to any of the four uses of |match| I now
> have in my code.  I don't understand yet why it is giving me this
> error message, but debugging one pattern in four functions feels
> less burdensome that looking for a misplaced token somewhere in the
> library.
> 

I've attached a testing egg that demonstrates what is going on.  I
can't quite tell what I'm doing wrong: the code works in csi, but
when I run chicken-install I get an error message.

Am I using match incorrectly?

-Alan
-- 
.i ko djuno fi le do sevzi
((author "\".alyn.post.\" <alyn.p...@lodockikumazvati.org>")
 (category parsing)
 (doc-from-wiki)
 (license "ISC")
 (depends matchable)
 (synopsis "testing egg"))
(module testegg
  (make-foo
   make-bar)

(import scheme)
(import matchable)

(define (make-foo cmene valsi)
  `(,cmene ,valsi))

(define (make-bar cmene nastura porjahe)
  (write `(,nastura ,porjahe))
  (newline)
  (match `(,nastura ,porjahe)
    ((#t #t) (lambda (ignore-valsi)
               (lambda () `(,(make-foo cmene #f)))))
    ((#t #f) (lambda (ignore-valsi)
               (lambda () (make-foo cmene #f))))
    ((#f #t) (lambda (valsi)
               (lambda () `(,(make-foo cmene valsi)))))
    ((#f #f) (lambda (valsi)
               (lambda () (make-foo cmene valsi))))))

(write (((make-bar "aisa" #f #f) "baz")))
(newline))
(define testegg-version "trunk")

(define (dynld-name fn)         
  (make-pathname #f fn ##sys#load-dynamic-extension))   

(define testegg-cscflags `(-d2))

(make (((dynld-name "testegg") ("testegg.scm"
                                "testegg.meta"
                                "testegg.setup")
       (begin (compile -s
                       ,@testegg-cscflags
                       -j testegg
                       -o ,(dynld-name "testegg")
                       testegg.scm)
              (compile -s
                       ,@testegg-cscflags
                       -o ,(dynld-name "testegg.import")
                       testegg.import.scm))))

      `(,(dynld-name "testegg")))

(install-extension
  ; lo cmene vi pagbu
  'testegg

  ; lo datnyvei vi pagbu
  `(,(dynld-name "testegg")
    ,(dynld-name "testegg.import"))

  ; lo se ckaji vi pagbu
  `((version ,testegg-version)))
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to