chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Re: (use foo) versus (declare (uses foo)), csi versu


From: Ozzi
Subject: Re: [Chicken-users] Re: (use foo) versus (declare (uses foo)), csi versus csc
Date: Sat, 20 Oct 2007 21:38:21 -0500
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

Yes, I think this is what I was looking for. I would be interested in a discussion about the differences between (use foo) and (include "foo"), and which one is appropriate when.

I'm guessing use for shared libraries, where include is for bringing in pieces of program code that have been broken out into separate files. Is this correct?

Tobia Conforto wrote:
Ozzi wrote:
Is there an easy way to write something that can be either compiled
or interpreted

I'm not sure this is exactly what you're asking, but I find include
most useful:

$ cat > bar.scm
(define (fac n)
  (if (zero? n)
      1
    (* n (fac (- n 1)))))

$ cat > foo.scm
(include "bar")
(write (fac 10)) (newline)

$ csi -s foo.scm
3628800

$ csc foo.scm -o foo

$ ./foo
3628800


Tobia


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users




reply via email to

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