chicken-users
[Top][All Lists]
Advanced

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

Re: Personal library


From: Mario Domenech Goulart
Subject: Re: Personal library
Date: Mon, 21 Nov 2022 23:28:16 +0100

Hi Bob,

On Sun, 20 Nov 2022 17:53:12 +0000 Bob Heffernan <bob.heffernan@gmail.com> 
wrote:

> felix.winkelmann@bevuta.com writes:
>> csc -s lib1.scm -J
>> csc -s lib1.import.scm # assuming lib1.scm defines a module named "lib1"
>> OLD=$(csi -p '(begin (import (chicken platform)) (car (repository-path)))')
>> export CHICKEN_REPOSITORY_PATH=<your-lib-dir>:$OLD
>
> This seems pretty close to the way I already do things, thank you.
>
> Chris' personal egg approach might be the way to go when I get a little
> more comfortable with chicken, so thank you too Chris!

Another very straightforward way would be using `include'.

You can set CHICKEN_INCLUDE_PATH to the directory where you keep your
code and just use `(include "some-file.scm")' from the user-code.  You
can also use `include-relative' for the code under CHICKEN_INCLUDE_PATH.

Please note that if some-file.scm defines a module (or multiple ones),
you'll also need `(import some-module)'.

This might not be the best approach for large amounts of code, though,
specially if you are compiling.  And it also can quickly get messy if
you start having lots of dependencies based on `include'.

All the best.
Mario
-- 
http://parenteses.org/mario



reply via email to

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