chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] (use foo) versus (declare (uses foo)), csi versus csc


From: Ozzi
Subject: [Chicken-users] (use foo) versus (declare (uses foo)), csi versus csc
Date: Fri, 19 Oct 2007 16:36:40 -0500
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

I think this is best described with an example:

----------------------------------------
foo.scm
----------------------------------------
(declare (uses bar))

(write (fac 10)) (newline)
----------------------------------------


----------------------------------------
bar.scm
----------------------------------------
(declare (unit bar))

(define (fac n)
  (if (zero? n)
      1
      (* n (fac (- n 1))) ) )
----------------------------------------


This can be compiled with:

% csc -c bar.scm
% csc foo.scm bar.o -o foo


However, it can NOT be run with:

% csi foo.scm


If the (declare ...) calls are replaces with (uses ...) it can be run with csi, but not compiled. What am I missing? Is there an easy way to write something that can be either compiled or interpreted, or do I need to resort to using lots of command-line options to do one or the other?

Thanks for the help,

Oz






reply via email to

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