cjohnson has quit ["The riot be the rhyme of the unheard"]
lms has quit ["herm, brb"]
lms has joined #ocaml
lms has quit [Read error: 54 (Connection reset by peer)]
lms has joined #ocaml
ayrnieu has quit [".."]
ayrnieu has joined #ocaml
cjohnson has joined #ocaml
cjohnson has quit ["Got to be good lookin' 'cause he's so hard to see."]
lms has quit [Read error: 104 (Connection reset by peer)]
lms has joined #ocaml
Herrchen has quit [Read error: 110 (Connection timed out)]
Herrchen has joined #ocaml
ayrnieu has quit ["system"]
whee has quit ["Leaving"]
_JusSx_ has joined #ocaml
lms has quit []
Demitar has quit ["Bubbles..."]
wazze has joined #ocaml
madroach has joined #ocaml
<madroach>
Hello, what is wrong in the following piece of code ? My compiler says the double semicolons are wrong (syntax error):
<madroach>
let x = ref 50 in let rec mainloop () = while true do () done;;
<madroach>
Hello ?
<teratorn>
hmm i dunno
<madroach>
Did you read my question ?
<teratorn>
yep
<madroach>
No idea ?
<teratorn>
nope..
<madroach>
hmm
<teratorn>
i'm not an authority on ocaml syntax though
<madroach>
I'm not too, but it does not look too complicated and I don't see any mistake.
<mellum>
madroach: the "in" corresponding to the second "let" is missing
<madroach>
mellum: So how do you think should it look like ?
<mellum>
madroach: I can't tell, since I don't know what you want to do
<madroach>
I want to use some values local to an infinite loop which can be called by mainloop ().
<mellum>
let rec mainloop () = let x = ref 50 in while true do () done then, maybe
<madroach>
OK, but the values should be accessible to another function, too. So my code really looks this way:
<mellum>
so it shoule be both global and local? I think you have a problem there
<madroach>
let x = ref 50 in let mainloop () = while true do () done and main ();;
<mellum>
Maybe what you want is let x = ref 50 let rec mainloop () = while true do () done
<madroach>
Ok, now I replaces the ;; in the old example with and and it works. But why did the let x = ref 50 in let main
<madroach>
ups
<madroach>
... let main () = while true do () done;;
<mellum>
You never need "and" except in mutually recursive definitions.
<madroach>
not work?
<mellum>
madroach: because the "in" corresponding to the second "let" is missing
<madroach>
mellum: What does that mean ?
<mellum>
lets without in may only occur at top level
<mellum>
because otherwise, they make no sense.
<madroach>
So local variables may only be declared inside the let of the function ?
<madroach>
Or global lets occure only at toplevel ?
<mellum>
both.
<madroach>
So if I have to functions using the same local variables they must both occure in the same toplevel let ?
<madroach>
two not to.
<mellum>
yes.
<madroach>
mellum: That solved my problem, thanks !
<mellum>
maybe you should just try do do without "ref", makes things easier
<madroach>
mellum: Why that ?
<mellum>
because to understand a function, you then only have to look at the function, and not at the places where refs it uses are also used
two-face has joined #ocaml
<two-face>
hi
<mellum>
hi two-face
malc has joined #ocaml
<two-face>
hello mellum
<madroach>
That's right. But I don't think that's the case in my special case. But thanks anyway.
<Maddas>
heh
Maddas has left #ocaml []
malc has quit [Read error: 113 (No route to host)]
madroach has quit ["leaving"]
jrosdahl has quit [Read error: 104 (Connection reset by peer)]
Maddas has joined #ocaml
two-face has quit [Read error: 60 (Operation timed out)]
two-face has joined #ocaml
two-face has quit [Remote closed the connection]
yella has quit [Read error: 110 (Connection timed out)]
SmerdyLaptop has joined #ocaml
<Maddas>
Hi SmerdyLaptop
SmerdyLaptop is now known as Smerdyakov
<Smerdyakov>
Hello
karryall has joined #ocaml
_SmerdyLaptop has joined #ocaml
Smerdyakov has quit [Nick collision from services.]
_SmerdyLaptop is now known as Smerdyakov
ayrnieu has joined #ocaml
Smerdyakov has quit ["adventures in doing the things I do"]
z has joined #ocaml
<z>
bonsoir
<Maddas>
hi
<z>
it is possible to read memory of a program if i'm a subfunction ?
<ayrnieu>
I don't understand your question, sorry.
<z>
i must wrote a function wich will be integrated in a program
<z>
can i read & wrote "global" variable ?
<z>
and search what variable exist ?
<ayrnieu>
You can modify ref's defined within the scope of your function, yes. I don't know about 'search what variable exist' -- I think you'd do better with a structure to hold named data rather than querying the scope for variable names, even if you could do the latter in O'Caml.
mattam_ has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
mattam_ is now known as mattam
Etaoin has quit ["Client exiting"]
cjohnson has joined #ocaml
Smerdyakov has joined #ocaml
<_JusSx_>
l
<ayrnieu>
please don't do that.
<_JusSx_>
sorry :( i made a mistake
<Smerdyakov>
You did WHAT!!
Riastradh has quit [Read error: 60 (Operation timed out)]
_JusSx_ has quit [Read error: 60 (Operation timed out)]
Etaoin has joined #ocaml
Smerdyakov has quit ["eat"]
cjohnson has quit ["Got to be good lookin' 'cause he's so hard to see."]
_JusSx_ has joined #ocaml
owll has joined #ocaml
owll has quit [Remote closed the connection]
malc has joined #ocaml
_JusSx_ has quit ["BitchX: melts in your mouth, not in your hands"]
Smerdyakov has joined #ocaml
Maddas has quit [Remote closed the connection]
Maddas has joined #ocaml
ayrnieu has quit ["using sirc version 2.211+ssfe+n0thing-v2.5.pl"]
esoo has joined #ocaml
Riastradh has joined #ocaml
esoo has quit [Read error: 104 (Connection reset by peer)]