chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] compiling an interpeter script, but remaining interp


From: Kon Lovett
Subject: Re: [Chicken-users] compiling an interpeter script, but remaining interpretable
Date: Thu, 18 May 2006 10:45:10 -0700

On May 18, 2006, at 10:37 AM, Graham Fawcett wrote:

Hi folks,

I just wanted to check my thinking before I began a fool's errand that
would be hard to back out of. I have a small application which runs as
a interpreter script. The script, script.scm, depends on script- lib.scm,
which in turn depends on misc.scm.

I'd like to compile the script, but for debugging purposes I'd still
like to be able to run it in an interpreter. To that end, I've
considered adding declarations like this to my source files:

;; script.scm
(eval-when (eval) (use script-lib))
(eval-when (load) (declare (uses script-lib)))

;; script-lib.scm
(eval-when (eval) (use misc))
(eval-when (load) (declare (unit script-lib) (uses misc)))

;; misc.scm
(eval-when (load) (declare (unit misc)))

It's feasible, I think, but it seems rather cumbersome. Is there a
simpler idiom for keeping the script interpretable, but still
preparing it for compilation? I feel like I'm missing something obvious...

You can just '(use ...)' for everything. The compiler will recognize it and compile in the load-time require.

Is "misc" a library? Because if it is an extension then it probably shouldn't be a 'unit'.


Thanks,

Graham


_______________________________________________
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]