chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Error 70, what does it mean?


From: Felix Winkelmann
Subject: Re: [Chicken-users] Error 70, what does it mean?
Date: Wed, 29 Sep 2004 07:56:43 +0200
User-agent: Mozilla Thunderbird 0.5 (X11/20040208)

Michael Erdmann wrote:
Felix Winkelmann wrote:

Michael Erdmann wrote:

Hallo, i am trying to compile slib, and i get the following strange
error:

chicken -syntax fluidlet.scm
compiling `fluidlet.scm' ...
Error: #(syntax-object fluid-let ((#f top) shift #(ribcage (#(import-token *top*)) () ())))

make: *** [fluidlet.c] Error 70
address@hidden:~/scheme/slib>


Error 70, what doe it mean?


70 is just the standard error return code (EX_SOFTWARE in
sysexits.h).

Thw actual problem appears to be that you are compiling
SLIBs version of the fluid-let macro in "high-level macro"
mode (with syntax-rules/syntax-case macros enabled).
You don't really need that, since Chicken already supports
fluid-let, though.
I can't tell you exactly what happens here, probably the
definition of the macro does something fishy.
Could you show me the actual source-code?

Well i have managed to come around this problem, but actually
i am not sure what i have done. First of all i did run chicken


address@hidden:~/scheme/slib> csc -c  fluidlet.scm
Error: syntax error in line 22 - malformed expression `(clauses . body)'
*** Shell command terminated with exit status 1: /usr/local/bin/chicken fluidlet.scm -output-file fluidlet.c -quiet

which was leading me to the dot in the argument list, which
i found strange as well. I have deleted this '.' and the component
compiles :-)  Bit i am not sure if this is correct!



(defmacro fluid-let (clauses . body)
  (let ((ids (map car clauses))
    (new-tmps (map (lambda (x) (gentemp)) clauses))
    (old-tmps (map (lambda (x) (gentemp)) clauses)))
    `(let (,@(map list new-tmps (map cadr clauses))
       ,@(map list old-tmps (map (lambda (x) #f) clauses)))
       (dynamic-wind
       (lambda ()
         ,@(map (lambda (ot id) `(set! ,ot ,id))
            old-tmps ids)
         ,@(map (lambda (id nt) `(set! ,id ,nt))
            ids new-tmps))
       (lambda () ,@body)
       (lambda ()
         ,@(map (lambda (nt id) `(set! ,nt ,id))
            new-tmps ids)
         ,@(map (lambda (id ot) `(set! ,id ,ot))
            ids old-tmps))))))


`defmacro' is not supported by Chicken, but you can implement it
with

(define-macro (defmacro name llist . body)
  `(define-macro (,name ,@llist) ,@body) )

The 'require' of dynamic wind is not necessary, and will probably
break chicken. The compiled form of fluidlet.scm will also
not work with other files, since macros only exist at compile-time,
not at run-time (usually).
Last but not least, you don't have to do this, since Chicken already
*has* fluid-let. :-)

Are you trying to compile SLIB? I recommend not to use the infrastructure
and just grab those files you are interested in and massage them into
a form that can be used with Chicken. SLIB has several nasty suprises
for Scheme implementations that use separate compilation. If you need
specific packages of SLIB, just tell me and I will try to port them
to Chicken, if possible.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]