Skip to content
/ inclub Public

brute force include for multifile chicken scheme projects

Notifications You must be signed in to change notification settings

retroj/inclub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inclub
======

The syntax form `inclub` is a convenience substitute for `include` for use
in multi-file projects.  When the program may be run either interpreted or
compiled, and may be executed from outside its directory, possibly through
a symlink, inclub handles the details of making sure the "inclubbed" files
get loaded as intended.

In compiled code, inclub simply expands to include, meaning the inclubbed
file will be compiled into the binary.

In interpreted code, inclub resolves any symlinks back to the directory
the program resides in, and calls `load` on the inclubbed file in that
directory.

To use inclub to load a file called "myfile.scm":

    (use inclub)
    (inclub "myfile")

If myfile.scm contains a module called `myfile`, add this:

    (import myfile)

If the project has multiple modules that need to import a module provided
by an inclubbed file, the file should be inclubbed only in the main file;
the other files can then import the module.

Etc
---

Thanks to Zbigniew for working out the basic mechanism, and also for
proposing the name "inclub".  inclub: the brute force include.

About

brute force include for multifile chicken scheme projects

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages