[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Circular dependencies between libraries - what to do?
From: |
Thorsten Jolitz |
Subject: |
Re: Circular dependencies between libraries - what to do? |
Date: |
Sun, 21 Sep 2014 02:04:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I'm probably asking for trouble, but B actually does not work without A,
>> and A calls B functions, so they do require each other.
>
> You can try to restructure the files, so as to get rid of
> the circularity.
>
> Or you can load the files differently. E.g. instead of top-level
> `require', you can use autoloads, so that loading A doesn't load B, but
> when A calls functions from B, then B gets loaded. Or instead of
> autoloads, you can place a (require 'B) *inside* the functions of A that
> call functions from B.
ok, seems I found a way to 'distribute' the requires without introducing
circularity. Thanks for the tips.
--
cheers,
Thorsten