caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* beginner
@ 2006-07-04 15:17 Aws Albarghouthi
  2006-07-04 15:45 ` [Caml-list] beginner Till Varoquaux
  2006-07-04 15:53 ` Christophe TROESTLER
  0 siblings, 2 replies; 3+ messages in thread
From: Aws Albarghouthi @ 2006-07-04 15:17 UTC (permalink / raw)
  To: caml-list

Good day,

I am an ocaml beginner and I am trying to modify an open source  
application. I'm facing the problem that functions within a file  
can't call each other. I'm getting the error Unbound value <func name>.

Thank you,
Aws


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] beginner
  2006-07-04 15:17 beginner Aws Albarghouthi
@ 2006-07-04 15:45 ` Till Varoquaux
  2006-07-04 15:53 ` Christophe TROESTLER
  1 sibling, 0 replies; 3+ messages in thread
From: Till Varoquaux @ 2006-07-04 15:45 UTC (permalink / raw)
  To: Aws Albarghouthi; +Cc: caml-list

The list where beginner's questions are addressed is:
http://groups.yahoo.com/group/ocaml_beginners
Your problem is addressed in the ocaml manual under:
2.5  Modules and separate compilation
on the website
(http://caml.inria.fr/pub/docs/manual-ocaml/manual004.html)

Please understand that there are a lot of computer science top hats
(which I'm not) reading this mailling list and that you are wasting
their time asking for basic informations.

Regards,
Till

On 7/4/06, Aws Albarghouthi <albargah@mcmaster.ca> wrote:
> Good day,
>
> I am an ocaml beginner and I am trying to modify an open source
> application. I'm facing the problem that functions within a file
> can't call each other. I'm getting the error Unbound value <func name>.
>
> Thank you,
> Aws
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] beginner
  2006-07-04 15:17 beginner Aws Albarghouthi
  2006-07-04 15:45 ` [Caml-list] beginner Till Varoquaux
@ 2006-07-04 15:53 ` Christophe TROESTLER
  1 sibling, 0 replies; 3+ messages in thread
From: Christophe TROESTLER @ 2006-07-04 15:53 UTC (permalink / raw)
  To: albargah; +Cc: caml-list

On Tue, 4 Jul 2006, Aws Albarghouthi <albargah@mcmaster.ca> wrote:
> 
> I am an ocaml beginner and I am trying to modify an open source  
> application. I'm facing the problem that functions within a file  
> can't call each other. I'm getting the error Unbound value <func name>.

This is normal.

  let f ... = ...
  
  let g ... = ...

The function g can use f but f cannot call g because g is not known at
that point.  If f must also call g, then f and g are mutually
recursive and you should declare them as

  let rec f ... = ...
  
  and g ... = ...

You can also group your functions as methods of an object (these can
call each other) :

object(self)
  method f ... = ... self#g ...
  method g ... = ... self#f ...
end

Cheers,
ChriS


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-04 15:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-04 15:17 beginner Aws Albarghouthi
2006-07-04 15:45 ` [Caml-list] beginner Till Varoquaux
2006-07-04 15:53 ` Christophe TROESTLER

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).