<munga_>
for some reason I get a loop after I input the first command on the pipe
<munga_>
like echo "aaa" > /tmp/test-pipe
hkBst has joined #ocaml
<flux>
why wouldn't you get a loop?
<munga_>
flux, I expect the select to wait till there is something new in the pipe ...
<flux>
at that point the pipe is closed
<flux>
you need to reopen it
caligula__ has quit [Read error: 104 (Connection reset by peer)]
<flux>
but, if this is a command channel for your program.. don't do it
<flux>
rather, use unix domain sockets
<munga_>
du !
<flux>
although they are slightly more complicated
<flux>
you can use socat to interface with the created socket
<munga_>
ok... I've to re-read a bit of basic unix programming stuff...
<flux>
do you know how tcp sockets work?
<flux>
(or rather, how to use them)
<flux>
in any case, the basic idea is: create a new socket with Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0, bind it to a socket with Unix.bind sock (Unix.ADDR_UNIX "/tmp/test-socket"), start listening on it with Unix.listen sock 0. when the socket is readable, do let (connected_fd, _) = Unix.accept sock and converse through the fd. close it once you're done. you may keep accepting new connections all the time.
<munga_>
yes, yes ...
<munga_>
thanks :)
komar_ has joined #ocaml
BiDOrD has quit []
naufraghi has joined #ocaml
komar_ has quit ["WeeChat 0.2.6.3-ohshi"]
naufraghi has quit []
Asmadeus_ has joined #ocaml
Associat0r has joined #ocaml
Asmadeus has quit [Read error: 104 (Connection reset by peer)]
Asmadeus has joined #ocaml
Ori_B has quit [Read error: 60 (Operation timed out)]
Ori_B has joined #ocaml
Asmadeus_ has quit [Read error: 110 (Connection timed out)]
_andre has joined #ocaml
Associat0r has quit []
Smerdyakov has joined #ocaml
bombshelter13_ has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
<wysek>
this command creates ar_framework.cmo not .cma
<wysek>
any idea why? :)
<thelema>
.cmo is output of ocamlc
<Smerdyakov>
Sure. Different file extensions for bytecode.
<Smerdyakov>
It's doing exactly what it should.
<bacam>
.cma is a bytecode archive (a collection of .cmo files, essentially)
<wysek>
oh, I it compiled the rest of .ml's into .cma
<wysek>
thx
<wysek>
however
<Smerdyakov>
Oops, wrong explanation from me. Sorry. :)
<wysek>
I did use -o option
<wysek>
ok, thainks :)
<wysek>
works now
BiDOrD has joined #ocaml
Smerdyakov has quit ["Leaving"]
Narrenschiff has joined #ocaml
bombshelter13_ has quit [Read error: 104 (Connection reset by peer)]
bombshelter13_ has joined #ocaml
eevar2 has quit ["Leaving"]
LeCamarade is now known as LeCamarade|Away
jonafan has joined #ocaml
bombshelter13_ has quit []
bombshelter13_ has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
hkBst has joined #ocaml
BiDOrD has quit []
BiDOrD has joined #ocaml
BiDOrD has quit [Remote closed the connection]
deech has joined #ocaml
Submarine has quit [Read error: 60 (Operation timed out)]
sbok has quit [Read error: 104 (Connection reset by peer)]
sbok has joined #ocaml
Narrenschiff has quit []
ulfdoz has joined #ocaml
purestrain has joined #ocaml
<purestrain>
hi
slash_ has joined #ocaml
Beelsebob has joined #ocaml
<Beelsebob>
hey ho, can anyone recommend the best OCaml tutorial for a pre-existing Haskeller?
hkBst has quit [Read error: 104 (Connection reset by peer)]
<Beelsebob>
Why does square x = x *. x get type float -> float not 'a -> 'a? Is *. specifically float multiplication?
<bernardofpc>
yes
<bernardofpc>
operators in Caml (the predef'd ones) are explicitly typed
<bernardofpc>
as well as (*) has type int -> int -> int
<bernardofpc>
the exception which confirms the rules is the cons (:) operator which has type 'a -> 'a list -> a' list
<Beelsebob>
okay
<Beelsebob>
so this is necessary because of the lack of classes in ocaml?
<bernardofpc>
hum, I don't see the point
<bernardofpc>
but I'm new to OCaml, and as far as I know, OCaml has something like classes
<bernardofpc>
and a different way of doing that also, which are modules
<bernardofpc>
a more functorial way of describing the problem
<bernardofpc>
well, time to go for me
ramenboy has quit [Connection timed out]
<Beelsebob>
okies
<Beelsebob>
I look forward to learning about that then :)
verte has quit ["~~~ Crash in JIT!"]
BiDOrD has joined #ocaml
yziquel has joined #ocaml
<yziquel>
http://paste.lisp.org/display/85274 hi. i've been trying to compile ocaml-r. Got this -fPIC error. Should r_data.c be compiled with -fPIC? If yes, where do you put it in the first line?
fschwidom has joined #ocaml
eevar2 has joined #ocaml
<hcarty>
Beelsebob: OCaml has classes, but no built-in type classes.
<hcarty>
yziquel: You probably need to add something like "-ccopt -fPIC"
<Anarchos>
how to debug a buggy ocamlyacc grammar ? parse_error seems not to be very useful
<hcarty>
yziquel: Not sure. I've run in to this before, and sprinkling "-fPIC" all over seemed to help fix it.
<Anarchos>
hcarty to fix what if i can ask ?
purestrain has quit ["Ex-Chat"]
<yziquel>
Anarchos: the fact the ocamlmklib complains about lack of position independent code in .o files.
<yziquel>
Anarchos: doesn't seem to be required on i386, but seems required on amd64.
<Anarchos>
oh ok well -fPIC seems to be the good option , right :)
_andre has quit ["leaving"]
BiDOrD has quit []
fschwidom has quit [Remote closed the connection]
ulfdoz has quit [Read error: 110 (Connection timed out)]
junis has joined #ocaml
Beelsebob has joined #ocaml
<junis>
how does one use Berkeley DB XML from ocaml?...
<Beelsebob>
when one uses a type name like a function, does it act like a cast – does it work for all types, or is this restricted to some special cases?
Beelsebob has quit ["Leaving."]
Arthur_Rainbow1 has joined #ocaml
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
Arthur_Rainbow1 has left #ocaml []
<junis>
greetings... I have been looking for OCaml bindings for the Berkeley XML database...
<junis>
can anybody help
Beelsebob has joined #ocaml
eevar2 has quit [Remote closed the connection]
bombshelter13_ has quit []
eevar2 has joined #ocaml
eevar2 has quit ["Leaving"]
<hcarty>
Beelsebob: If you use a type name like a function, it should be a function. Otherwise you'll get an error.
<Beelsebob>
okay, so float and int are built in functions that happen to cast between each other, yeh?
<hcarty>
Beelsebob: For example "string_of_int" is the int -> string conversion function in the standard library.
<hcarty>
Beelsebob: Do they?
<Beelsebob>
well, reading the tutorials, float and int appear to work as casts to the apropriate types
<hcarty>
You have float_of_int and int_of_float.
<hcarty>
Then yes, they are just functions with those names.