Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ref
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: altavillasalvatore@libero.it <altavillasalvatore@l...>
Subject: [Caml-list] ref
Hi all,
my problem is this:


let r = 
let a= ("b" , "c") in 
let f = ref "" in
let g = ref "" in
f:= fst a;
g:= snd a;
!f,!g;;


 val r : string * string = "b", "c"

I would want to call "a" one single time but....


let r = 
let a= ("b" , "c") in 
let f = ref "" in
let g = ref "" in
f,g := a;
!f, !g ;;

 Characters 68-71:
This expression has type string ref * string ref but is here used with type
  (string * string) ref

Regards.



-------------------
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