chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Code Organization


From: David N Murray
Subject: [Chicken-users] Code Organization
Date: Mon, 07 Sep 2009 22:19:13 -0400 (EDT)

Hi all,

I'm coming from an SBCL/Slime environment and would like some advice on
code organization.  I'm working on a medium-sized project and have
multiple source code files for the various sections of the program.  I
have a similar environment setup in Emacs to replace slime and be able to
run Chicken in an Emacs buffer.

I'd like to be able to both build up a program in Emacs and then compile
the program to produce an executable.  My initial experiments in this led
me to the following, and I'd like confirmation that I'm on the right
track.

In each source code file
(declare (unit _name_))
except for the main.

In each file that requires the functions of another,
(declare (uses _name_))
These are per the instructions on the wiki
(http://chicken.wiki.br/man/4/Using%20the%20compiler#an-example-with-multiple-files).
I'm separately compiling the source code files and linking them (and
re-learning how to write a Makefile).

I have a separate file with common macros.  These appear to need to be
(include)'d in the source files that depend on them.

I ignore the warnings csi generates about using declare.

I'm not really at the point to consider modules.  I'm learning alot about
them by exploring the source of the eggs, but I think my development is
too fluid at this point to use them.

I'm seeing an order of magnitude increase in performance by building the
executable :-)

TIA for any feedback,
Dave




reply via email to

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