Version franēaise
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Function forward declaration?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Marcin 'Qrczak' Kowalczyk <qrczak@k...>
Subject: Re: [Caml-list] Function forward declaration?
W liście z śro, 07-04-2004, godz. 19:26 +0200, Basile Starynkevitch
napisał:

> Regarding this thread, a useful trick (somehow a hack, but used in the
> compiler itself) is to declare a reference to a function initialised
> to a function throwing an exception:

It's a pity that using such a reference requires explicit "!"·

IMHO it would be nice if OCaml had mutable bindings, using the syntax
analogous to mutable record fields.

   let mutable r = 0 in
   ... r <- r + 1 ...

would be equivalent to

   let r = ref 0 in
   ... r := !r + 1 ...

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners