MLDonkey Forum Index
Homepage •  Bugs •  Tasks •  Patches •  SF.net Project Page •  ChangeLog •  German forum •  Links •  Wiki •  Downloads
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
OCaml question regarding circular dependencies

 
Post new topic   Reply to topic    MLDonkey Forum Index -> Smalltalk and Off-topic
View previous topic :: View next topic  
Author Message
Knocker
professional


Joined: 05 Nov 2002
Posts: 612
Location: Germany

PostPosted: Tue Jan 04, 2005 9:27 am    Post subject: OCaml question regarding circular dependencies Reply with quote

Hi,
does anybody know if it's true that I cannot refer from one module to another and vice versa?

I played with the code of 2.5.16 especially files donkeyServers.ml and donkeyUdp.ml. There are function calls from inside donkeyServers.ml to donkeyUdp.ml. Now I wanted to call a function which lies in donkeyServers.ml from donkeyUdp.ml, but I always get "unbound value" error.

I read somewhere that Ocaml doesn't support forward-declarations. If that's true, do I have to move the code with the function call from donkeyUdp.ml to donkeyServers.ml?
Back to top
View user's profile Send private message
pango
Sage


Joined: 31 Oct 2002
Posts: 2436

PostPosted: Tue Jan 04, 2005 10:53 am    Post subject: Reply with quote

See http://caml.inria.fr/ocaml/htmlman/manual022.html,
starting from "Reference to undefined global mod"

There's no single "best answer" to that question. I recommend thinking at the "program architecture and layering" level, cross-references often (but not always) mean you're breaking some layering.
Or that the layering is badly defined to start with Confused
Back to top
View user's profile Send private message
Knocker
professional


Joined: 05 Nov 2002
Posts: 612
Location: Germany

PostPosted: Tue Jan 04, 2005 11:55 am    Post subject: Reply with quote

Thanks Smile

> Or that the layering is badly defined to start with

donkeyServers.ml needs DonkeyUdp.search_handler to search files, but I want to use server_waiting_queries (defined in donkeyServers.ml) from donkeyUdp.ml where source-searching per UDP is defined.

I moved the search-code to donkeyServers.ml but wanted to know if I could've done something better.
Back to top
View user's profile Send private message
pango
Sage


Joined: 31 Oct 2002
Posts: 2436

PostPosted: Tue Jan 04, 2005 4:44 pm    Post subject: Reply with quote

Isn't server_waiting_queries defined in donkeyTypes.ml ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MLDonkey Forum Index -> Smalltalk and Off-topic All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Sourceforge.net Logo