<timmy>
if i have a lot of connections that share and modify data like some server might, what would be the best way to separate those connections? using processes or threads or what?
malc has quit ["no reason"]
Rakko has joined #ocaml
<Rakko>
Hi. I would like some help building an OCaml program. I have no OCaml coding experience whatsoever, so I don't know if the error is something I can fix or not.
<Rakko>
The error message is:
<Rakko>
Expecting function has type 'a list -> 'b list
<Rakko>
This argument cannot be applied with label ~f
<Rakko>
the line it occurs on is: let gaplist = List.map ~f:(findrelation ob dx dy dz) oblist in
<Rakko>
the specific problem area seems to be findrelation ob dx dy dz.
<Rakko>
Anyone got any advice?
TimFreeman has joined #ocaml
<Rakko>
hi
<Rakko>
perhaps you could help me?
TimFreeman has left #ocaml []
<timmy>
hi
<Rakko>
Do you know much about ocaml?
<timmy>
started learning it like 5 days ago or so
<timmy>
i would probably need more context to be able to fix that code
<timmy>
i'm not sure how/where dx, dy, and dz are defined
<Rakko>
ok
<timmy>
a big guess would be (by looking at the names):
<timmy>
let gaplist = List.map (fun ob -> findrelation ob dx dy dz) oblist in
<Rakko>
what's fun ob? ~f?
<timmy>
~f seems like they are trying to use a label
<Rakko>
I did notice something odd
<timmy>
i was thinking that oblist would have all the ob(jects?) that this findrelation function would be called on
<timmy>
but i can't read minds yet, so i would need more context about what is going on
<Rakko>
from what I understand of the code, findrelation should take five parameters: ob1 dx dy dz ob2. but it only takes ob dx dy dz... unless I'm misunderstanding the syntax
<timmy>
ok
<Rakko>
did you get the dcc request?
<timmy>
try this then
<timmy>
i can't dcc
<timmy>
let gaplist = List.map (findrelation ob dx dy dz) oblist in
<timmy>
the first argument to a List.fold_left should be a function
<Rakko>
ok. the error was This expression has type 'a list but is here used with type 'b -> 'c -> 'b
<Rakko>
ugh
<timmy>
so it looks like something is missing
<timmy>
i guess we could insert a function that does nothing
<Rakko>
well... I'm not sure what the intended action here is
<timmy>
i can't figure that out either
<timmy>
because fold_left doesn't return a list
<timmy>
and the lev.dmcubes looks like it is supposed to be a list
<timmy>
maybe you could comment it and replace it with () and hope for the best
<Rakko>
hehe
<Rakko>
replace what with ()?
<Rakko>
I think the best course would be to see if I can track the author down
<timmy>
yeah
<Rakko>
I dunno if I will be able to, since this was a school project written in 2000 and he's probably got other stuff to worry about now
<Rakko>
looks like a cool language though
<Rakko>
I've been waiting for an excuse to go into it
<timmy>
yeah it is one of the best i have got into
<timmy>
maybe the best because i can compile it natively unlike most other languages
<Rakko>
why, what's "native" for you?
<timmy>
elf format for linux
<Rakko>
lots of languages compile to Linux ELF :)
<timmy>
well, nothing i have liked a lot
<Rakko>
ah
<Rakko>
I'm impressed though that it can be interactive OR bytecode OR compiled
<timmy>
c and c++ would be the best supported which is about their only plus
<timmy>
yeah i used some interpreted languages and i got sick of having to put it through an interpreter all the time
<timmy>
i need to figure out if i should use processes or threads
<Rakko>
eek
<timmy>
i'm writing a program to learn ocaml
<Rakko>
best way to do it :)
<timmy>
basically this server will bind to the specified port given in a config file and i will create a new ____ for each connection so i can block read
<timmy>
but i have to share data
<timmy>
which seems to make everything a mess
<timmy>
but i think i will use locking for that
<timmy>
which will be the best way
<timmy>
but i don't know whether to use threads or processes because i'm not sure how each work and it is too late tonight for me to do any thinking so i want someone to do it for me
<Rakko>
hehe
* gl
&
<Rakko>
oh?
* Rakko
is away: stuf
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
* Rakko
is back (gone 00:48:34)
<Rakko>
re gl
gluck has joined #ocaml
Rakko has quit ["bye"]
malc has joined #ocaml
owll has joined #ocaml
owll has quit [Client Quit]
* puffin
is back
Yurik has joined #ocaml
malc has quit ["no reason"]
kruskal has joined #ocaml
kruskal is now known as krusyaourt
Yurik has quit ["Client Exiting"]
krusyaourt is now known as krusvaisselle
krusvaisselle is now known as krusdouche
krusdouche is now known as krusguignols
krusguignols is now known as krusfrance2
krusfrance2 is now known as krusf2maths
krusf2maths is now known as krusmaths
steele has joined #ocaml
steele has quit [Client Quit]
steele has joined #ocaml
tmcm has quit [Read error: 110 (Connection timed out)]
krusmaths has left #ocaml []
malc has joined #ocaml
fseee has joined #ocaml
fseee has left #ocaml []
fseee has joined #ocaml
fseee has left #ocaml []
gl has quit [No route to host]
fseee has joined #ocaml
fseee has left #ocaml []
fseee has joined #ocaml
fseee has left #ocaml []
skylan has quit [Read error: 104 (Connection reset by peer)]