MrSpook has quit ["ircII EPIC4-1.0.1 (RPM) -- Are we there yet?"]
jao has quit ["leaving"]
skylan_ has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan_ is now known as skylan
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
malc has quit ["no reason"]
Cryptor has joined #ocaml
puffin has quit [carter.openprojects.net irc.openprojects.net]
puffin has joined #ocaml
Cryptor has quit [Success]
gl has quit [Read error: 113 (No route to host)]
gl has joined #ocaml
Dieb has joined #ocaml
<Dieb>
lo all
<Dieb>
let d=[|"A";"B";"C"|];; let main() = d.(2) <- "F";; will produce - : string vect = [|"A"; "B"; "F"|] => good! However, type en = {name:string; lst: string list; val: int};; let c= [|{name="A"; lst = ["B"; "C"]; val = 2};{name="B"; lst =["F"];val=3}|];; let main() = c.(0).val <- 0;; will produce : "L'étiquette val n'est pas mutable. " Why?
Demitar has joined #ocaml
gl has quit ["[BX] This BitchX's for you"]
<Dieb>
anybody could tell me how to store a new value in a type? for exemple " a : lst = {name = "E"; lst = ["f"; "l"]; val = 5}" to store 4 in the val field of a ?
tav`` has quit [Read error: 110 (Connection timed out)]
<Demitar>
Is the val field mutable_
* Demitar
looks again...
<Demitar>
If so then simply do: a.val <- 3;;
<Dieb>
well, no it isn't. And i don't know how to declare a field mutable
<Demitar>
Do it in the type definition, change 'val : int' to 'mutable val : int', or do the entire operation in a functional way, ie copy the whole object.