Hi all,

Right now, circular dependencies are officially not allowed, but 
unofficially they sort of work.

This idiom is used in a few places, eg, extra/calendar:

=== calendar.factor:

IN: calendar
...
HOOK: gmt-offset calendar-backend

USE-IF: unix? calendar.unix
USE-IF: windows? calendar.windows

=== unix.factor

IN: calendar.unix
USE: calendar --- circular dependency here!!!

M: unix-calendar-backend gmt-offset ... ;

In the case of calendar, this is easy to fix.

We just create a new calendar.backend vocab with the HOOK:, then 
calendar depends on calendar.unix, and calendar.unix depends on 
calendar.backend. No circularity.

But in io.launcher, this would lead to ugly code. We'd have a 
run-process word which does nothing but call a run-process* hook in 
io.launcher.backend, and io.launcher.unix would depend on 
io.launcher.backend.

The reason I'd like to ban circular dependencies completely is that they 
mess with refresh-all in some subtle corner cases; I think the issue 
Daniel reported is related to this. Supporting circular dependencies 
also unnecessarily complicates some of the code in vocab.loader.

What do you guys think? Is it worth breaking a handful of libs in extra/ 
(and making them a tad more complex when fixed) to get 100% correct 
refresh-all behavior, and simplify some code?

Slava

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to