sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amnn has joined #ocaml
amnn has quit [Client Quit]
xaimus has quit [Remote host closed the connection]
pierpa has quit [Ping timeout: 264 seconds]
xaimus has joined #ocaml
sdothum has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
tmtwd has joined #ocaml
FreeBirdLjj has joined #ocaml
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
yunxing has quit [Ping timeout: 240 seconds]
anoisz has quit [Ping timeout: 260 seconds]
keteim has quit [Ping timeout: 264 seconds]
keteim has joined #ocaml
walter|r has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
Reshi has joined #ocaml
scarygelatin has quit [Quit: Leaving]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
darkf has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
johnelse has quit [Ping timeout: 276 seconds]
johnelse has joined #ocaml
rossberg has quit [Ping timeout: 264 seconds]
Bahman has joined #ocaml
rossberg has joined #ocaml
Reshi has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
MercurialAlchemi has joined #ocaml
Reshi has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
tmtwd has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
MercurialAlchemi has quit [Ping timeout: 250 seconds]
oxcsh has quit [Remote host closed the connection]
oxcsh has joined #ocaml
jonasen has joined #ocaml
oxcsh has quit [Remote host closed the connection]
tmtwd has joined #ocaml
mistermetaphor has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
zRecursive has joined #ocaml
MercurialAlchemi has joined #ocaml
dsheets has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
dsheets has quit [Ping timeout: 260 seconds]
jonasen_ has joined #ocaml
jonasen has quit [Ping timeout: 272 seconds]
sz0 has joined #ocaml
tmtwd has quit [Ping timeout: 258 seconds]
unbalancedparen has quit [Quit: WeeChat 1.5]
oxcsh has joined #ocaml
oxcsh has quit [Ping timeout: 250 seconds]
A1977494 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<zRecursive>
Funning bug ? `c:/msys32/mingw32 $ ocaml` => OCaml version 4.02.3\n Exception: \nFailure\n "Config file not found - neither D:\\develop\\msys64\\mingw32\\etc\\findlib.conf nor the directory D:\\develop\\msys64\\mingw32\\etc\\findlib.conf.d". why is there a fixed "D:\\develop" :)
<zRecursive>
the error is caused by `#load findlib_top.cma`.
<adrien>
zRecursive: ask your distribution provider
<zRecursive>
adrien: I see what you mean! I install findlib by `pacman -S ` under msys2/mingw32. I wish i would get clue here because #msys2 is so quiet.
<adrien>
complain to msys2 people
<adrien>
it's early?
<zRecursive>
It seems "d:\\develp" in fixed in "lib/ocaml/findlib/findlib_top.cma" which seems a binary file ?
<zRecursive>
adrien: i will
dsheets has joined #ocaml
redpoppies has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
mcc has quit [Quit: Connection closed for inactivity]
<companion_cube>
ac
<companion_cube>
hi everyone
<reynir>
hi companion_cube
<companion_cube>
o/ reynir
orbifx has joined #ocaml
orbifx-m has quit [Ping timeout: 244 seconds]
ygrek has joined #ocaml
Reshi has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 264 seconds]
jonasen has joined #ocaml
jonasen_ has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
dakk has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
AltGr has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
oxcsh has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
wagle has quit [Quit: No Ping reply in 180 seconds.]
mistermetaphor has quit [Remote host closed the connection]
oxcsh has quit [Ping timeout: 250 seconds]
wagle has joined #ocaml
larhat has joined #ocaml
adrien has quit [Quit: leaving]
adrien has joined #ocaml
truncate has quit [Ping timeout: 260 seconds]
l1x has quit [Ping timeout: 264 seconds]
l1x has joined #ocaml
Reshi has joined #ocaml
TheLemonMan has joined #ocaml
Reshi has quit [Ping timeout: 246 seconds]
ygrek has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 258 seconds]
FreeBirdLjj has joined #ocaml
Reshi has joined #ocaml
truncate has joined #ocaml
Bahman_ has joined #ocaml
Bahman has quit [Ping timeout: 260 seconds]
zRecursive has quit [Remote host closed the connection]
A1977494 has quit [Read error: Connection reset by peer]
A1977494 has joined #ocaml
amnn has joined #ocaml
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oxcsh has joined #ocaml
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
oxcsh has quit [Ping timeout: 272 seconds]
dakk has quit [Remote host closed the connection]
Reshi has quit [Quit: WeeChat 1.4]
Kakadu has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
bba has joined #ocaml
oxcsh has joined #ocaml
amnn has joined #ocaml
dhil has joined #ocaml
Bahman_ has quit [Quit: ave atque vale]
dakk has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Algebr has joined #ocaml
AltGr has left #ocaml [#ocaml]
sdothum has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
A1977494 has quit [Quit: Leaving.]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
oxcsh has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
oxcsh has joined #ocaml
oxcsh has quit []
redpoppies has quit [Ping timeout: 240 seconds]
AltGr has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
toolslive has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<toolslive>
what's the simplest way to translate a return code ( : int) to the corresponding Unix.error ?
dhil has quit [Ping timeout: 260 seconds]
<mrvn>
C stubs?
d0nn1e has quit [Ping timeout: 250 seconds]
<mrvn>
are you asking for a C stub?
d0nn1e has joined #ocaml
<toolslive>
no, pure OCaml
pierpa has joined #ocaml
<mrvn>
fix the function to return an unix error
<toolslive>
well, the corresponding C function returns something negative upon error. something like -22 to denote EINVAL
<toolslive>
it's not my function
dhil has joined #ocaml
<mrvn>
so you are asking for a C stub.
<toolslive>
no, I'm asking for an ocaml function with signature val convert : int -> Unix.error
<mrvn>
but to fix a C stub
<mrvn>
/usr/include/caml/unixsupport.h:extern value unix_error_of_code (int errcode);
<mrvn>
You can use ctypes to call that or make your own switch.
<toolslive>
I know ctypes solves it, but not with the return codes I get....
<mrvn>
No flag for -errno as return value?
amnn has joined #ocaml
<toolslive>
the library isn't setting errno. and it yields a negative value as a return code. I need to flip the sign. ctypes only has check_errno:bool
<mrvn>
toolslive: That's what I ment with retunring -errno. That's quite common so I would be surprised if ctypes doesn't already have something for that.
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ygrek has joined #ocaml
Denommus has quit [Read error: Connection reset by peer]
walter|r has joined #ocaml
A1977494 has joined #ocaml
walter|r_ has joined #ocaml
walter|r has quit [Read error: Connection reset by peer]
TheLemonMan has quit [Remote host closed the connection]
TheLemonMan has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 272 seconds]
<cr4ven>
Hi all. I'm working through some basic coding challenges to get familiar with OCaml and I'm hitting a compilation error I'm not sure what to do with. The code is at http://pastebin.com/t32Egptd and the error is on line 6. The purpose of the code is to return an integer value which is the sum of the number of '(' characters minus the sum of the number of ')' characters in a line read from a file.
<cr4ven>
The compiler seems to be telling me that the inner match is returning a function which takes a list of strings and returns an int, which I guess I can see the reasoning behind. I can't think of any way to phrase the inner match so that it evaluates 1 + find_floor tl and gives back an int value though.
<companion_cube>
in your code, find_floor is a function of two arguments
<cr4ven>
(I can change the structure of the find_floor function completely and use if/then etc, but if I do that I still won't understand what is wrong with the above code ... and I probably should
<cr4ven>
aghhhh
<companion_cube>
and you don't use `d`
<cr4ven>
ya
<companion_cube>
(also, is there only one "(" or ")" per line?)
<cr4ven>
no, there's only a single line in the file
<cr4ven>
I am presuming the file reading code is also gimped, but I hadn't got to the stage of being told that yet by the compiler =)
<companion_cube>
ok :D
<cr4ven>
lines look like '(()()()))((())(()()(((((('
<companion_cube>
oh yeah, I see, hence the data.(0)
<companion_cube>
you might want to use String.explode, for obtaining a list of chars, too (since you use extlib)
<cr4ven>
Awesome, will do. Thanks!
<cr4ven>
On the topic of that data.(0), it seems that Std.input lines actually returns a string Enum.t anyway
Nahra has quit [Ping timeout: 244 seconds]
sh0t has joined #ocaml
<companion_cube>
there must be a "next" function or something in Enum
MercurialAlchemi has quit [Ping timeout: 272 seconds]
<cr4ven>
My primary delay in figuring that out was I say 'Enum' and started googling for 'OCaml enums' ... not realising they mean 'enumeration' in a different sense =/
<companion_cube>
it's in Extlib
<companion_cube>
look in the .mli files
<cr4ven>
yup, I found it after going down the above, entirely unrelated, rabbit hole
<jstolarek>
ok, so it looks that pkg-config is unaware of ncurses
loky has quit [Read error: Connection reset by peer]
vpm has quit [Quit: co'o]
<companion_cube>
there is a cache for pkg-config
vpm has joined #ocaml
<companion_cube>
maybe your distro didn't refresh it
MercurialAlchemi has joined #ocaml
slash^ has joined #ocaml
<jstolarek>
it looks that the older version of ncurses on my system (5.7) did not have support for generating *.pc files for pkg-config
<jstolarek>
I'm trying to generate those files for newer version of ncurses and see whether I can backport them to 5.7
<jstolarek>
maybe this will work
<companion_cube>
that being said, I still don't know why ocamlfind depends on ncurses
loky has joined #ocaml
dakk has joined #ocaml
larhat has quit [Quit: Leaving.]
<jstolarek>
success!
<jstolarek>
I built pc files for ncurses 6.0, edited them to match ncurses 5.7 and copies to /usr/share/pkgconfig
<jstolarek>
s/copies/copied/
<jstolarek>
installation of ocamlfind went through fine
ygrek has quit [Ping timeout: 260 seconds]
<jstolarek>
hm... why doesn't opam install latest version of ocaml?
<jstolarek>
I just realized it installed 4.02.1, while the latest version is 4.03
<jstolarek>
in fact, 4.02.1 seems prettyu ancient (nearly 2 years old)
redpoppies has joined #ocaml
<companion_cube>
you probably use the `system` switch
<companion_cube>
if you want the recent version, `opam switch 4.03.0`
<jstolarek>
that seems to work :-)
<jstolarek>
thanks
mistermetaphor has quit [Remote host closed the connection]
ygrek has joined #ocaml
orbifx has joined #ocaml
orbifx-m has joined #ocaml
mistermetaphor has joined #ocaml
orbifx has quit [Read error: Connection reset by peer]
orbifx2 has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
orbifx-m has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 240 seconds]
walter|r_ has quit [Remote host closed the connection]
walter|r has joined #ocaml
walter|r has quit [Ping timeout: 244 seconds]
amnn has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mistermetaphor has joined #ocaml
<pierpa>
I think computers hadn't even be invented two years ago!
yunxing has joined #ocaml
mistermetaphor has quit [Ping timeout: 240 seconds]
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
ril has joined #ocaml
yunxing has quit [Ping timeout: 258 seconds]
mistermetaphor has joined #ocaml
sepp2k has quit [Quit: Leaving.]
unbalancedparen has quit [Quit: WeeChat 1.5]
sepp2k has joined #ocaml
sepp2k has quit [Client Quit]
loky has quit [Quit: loky]
Nahra has joined #ocaml
Guest24092 has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
walter|r has joined #ocaml
sh0t has quit [Ping timeout: 258 seconds]
ril is now known as ril[away]
pyon has quit [Ping timeout: 250 seconds]
Kakadu has quit [Quit: Page closed]
loky has joined #ocaml
sh0t has joined #ocaml
octachron has joined #ocaml
loky has quit [Quit: loky]
wolfcore has quit [Read error: Connection reset by peer]
pyon has joined #ocaml
wolfcore has joined #ocaml
gustav is now known as gustav___
octachron_ has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
pyon has quit [Ping timeout: 250 seconds]
octachron has quit [Ping timeout: 244 seconds]
pyon has joined #ocaml
octachron_ has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
octachron_ has joined #ocaml
loky has joined #ocaml
ril[away] is now known as ril
AltGr has left #ocaml [#ocaml]
orbifx has joined #ocaml
<pierpa>
/names
<pierpa>
MercurialAlchemi has quit [Ping timeout: 276 seconds]
redpoppies has quit [Quit: redpoppies]
<reynir>
:v
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
Anarchos has joined #ocaml
data_hope has joined #ocaml
<orbifx>
seliopou: here?
dhil has quit [Ping timeout: 244 seconds]
loky has quit [Quit: loky]
Orion3k has quit [Ping timeout: 260 seconds]
scarygelatin has quit [Ping timeout: 276 seconds]
octachron_ has quit [Quit: Leaving]
<orbifx>
Is there a way to find if I've neglected any exceptions along some large chucks of code?
<orbifx>
I have a lot of expressions returning unit, and I would like somehow to make sure if any of them can potentially throw exceptions, that my code can deal with them.
Orion3k has joined #ocaml
scarygelatin has joined #ocaml
unbalancedparen has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amnn has joined #ocaml
cnu- has quit [Ping timeout: 272 seconds]
data_hope has quit [Quit: Lost terminal]
tane has quit [Quit: Verlassend]
bba has joined #ocaml
sh0t has quit [Ping timeout: 264 seconds]
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
A1977494 has quit [Remote host closed the connection]
<Guest24092>
I think that's called checked exceptions and I don't think OCaml can do that
Guest24092 is now known as Algebr
wolfcore has quit [Read error: Connection reset by peer]
Algebr has quit [Read error: Connection reset by peer]
Algebr has joined #ocaml
wolfcore has joined #ocaml
darkf has joined #ocaml
mcc has quit [Quit: Connection closed for inactivity]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]