<adrien>
(you only need to specify the module once)
<wmeyer>
adrien: I think you should proceed with more for review to asses how invasive it will be, so far in general despite my comments it does not look to bad.
<troydm>
without type name
<troydm>
thx
<adrien>
wmeyer: I hope I can add some a bit later today: libcamlrun.a has 4 undefined references so it's probably not too much work
<wmeyer>
adrien: sounds good, no rush. I also today have terrible amounts of stuff to do
<wmeyer>
adrien: you have to run testsuite also
<adrien>
true; I'm going to try to get bytecode building and running and then I'll probably have to spend quite a lot of time playing with the testsuite =)
<wmeyer>
yes, the problem is that testsuite uses shell and makefile scripts
<wmeyer>
adrien: but good luck!
<adrien>
thanks =)
eni has joined #ocaml
waksman has quit []
Yoric has quit [Ping timeout: 252 seconds]
waksman has joined #ocaml
tane has joined #ocaml
waksman has quit []
waksman has joined #ocaml
<troydm>
is for statement a functional programming related ?
<troydm>
because if i use for that means i'm still using an imperative style programming
waksman has quit []
<adrien>
for is imperative
<adrien>
but there's no reason not to use it
waksman has joined #ocaml
waksman has quit [Client Quit]
milosn has quit [Ping timeout: 245 seconds]
milosn has joined #ocaml
iratsu has quit [Ping timeout: 265 seconds]
<troydm>
can i have multiple something like cond in lisp?
<troydm>
like i have a string
<troydm>
and i want to check multiple conditions
<troydm>
something like
<troydm>
| (String.compare f ".png") == 0 -> ...
<troydm>
| (String.compare f ".jpg") == 0 -> ...
<adrien>
match your_strng with
<adrien>
| "foo" -> ...
<adrien>
| "bar" -> ...
<troydm>
does match support string ?
eni has quit [Ping timeout: 250 seconds]
<troydm>
like if i do "hello" == "hello" i get false
<adrien>
do *NOT* use (==)
<adrien>
(=) is the equality test
<adrien>
(==) is something else
<adrien>
see the official documentation for the detail
<troydm>
ic thx
jamii has joined #ocaml
hcarty has quit [Ping timeout: 260 seconds]
hcarty has joined #ocaml
ontologiae has joined #ocaml
jewel has quit [Ping timeout: 250 seconds]
ulfdoz_ has joined #ocaml
wormphlegm has quit [Read error: Connection reset by peer]
wormphlegm has joined #ocaml
fantasti` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
weie_ has joined #ocaml
eni has joined #ocaml
weie has quit [Ping timeout: 264 seconds]
BiDOrD_ has joined #ocaml
iratsu has joined #ocaml
BiDOrD has quit [Ping timeout: 255 seconds]
suyu has quit [Quit: suyu]
eni has quit [Ping timeout: 255 seconds]
ikaros has quit [Quit: Ex-Chat]
ikaros has joined #ocaml
jamii has quit [Ping timeout: 250 seconds]
weie_ has quit [Quit: Leaving...]
hcarty has quit [Ping timeout: 260 seconds]
hcarty has joined #ocaml
<wmeyer>
hi hcarty
shp has joined #ocaml
<shp>
hi
<shp>
do you think that all camllight codes can be compiled with ocaml ?
<Qrntz>
not all of them, but source-compatibility is rather high
<Qrntz>
for example, Caml Light had a «when» clause that no more exists in OCaml
<adrien>
there's a tool to translate
<shp>
adrien: really ?
<adrien>
I don't remember well from what to what however :P
<adrien>
but what is your use case?
<shp>
a school project
Yoric1 has joined #ocaml
<adrien>
school requires you to code in caml light? how much code is involved?
hcarty has quit [Ping timeout: 245 seconds]
hcarty has joined #ocaml
Hanman has joined #ocaml
Hanman has left #ocaml []
ttamttam has joined #ocaml
milosn has quit [Ping timeout: 255 seconds]
<shp>
is there a loop like "do ... while()" in caml ? it exists in many languages
ttamttam has quit [Quit: Leaving.]
<wmeyer>
shp: no, you can use recursion. Why would need such loop in OCaml?
<flux>
while true do .. done
<wmeyer>
there is while loop however.
<flux>
ocaml doesn't have do..while-construct, however
<flux>
in practice you will find while-loops are not much used in ocaml anyway
<flux>
if at all by many practitioners :)
<shp>
i had a algorithm in mind design for a do - while loop, but anyway i will adapt it
<flux>
let rec do_while body condition = body (); if condition () then do_while body condition;;
<wmeyer>
shp: what flux is saying that the functional style is used much more often, and because loops rely on variable updates there is no such need
<wmeyer>
flux: yes, that's what also can be done.
<shp>
ty for answers btw
milosn has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
jewel has joined #ocaml
Yoric1 is now known as Yoric
<shp>
another question: i've got a couple of int*int (let a = 1,2;; ) -> how to access the first element or the second one ?
<adrien>
the generic approach is:
<adrien>
let foo = 1, 2
<adrien>
let bar1, bar2 = foo
<shp>
do i have to affect bar 2 ?
<gour>
fst, snd?
<shp>
isn't there something like "let bar1, _ = foo" ?
<Qrntz>
that way will work too
<Qrntz>
but if you only use it in one place, it may be more feasible to use «fst foo»
<adrien>
fst and snd work too (let bar1 = fst foo) but they're only provided for 2-uplets
<adrien>
hah, I expected another definition of fst:
<adrien>
external fst : 'a * 'b -> 'a = "%field0"
ttamttam has joined #ocaml
mye has quit [Quit: mye]
<shp>
adrien, Qrntz : and how do the same with ref already defined please ?
ontologiae has quit [Ping timeout: 255 seconds]
* adrien
hasn't parsed that question successfully
* Qrntz
neither
* wmeyer
: read_again (); goto wmeyer;
<shp>
instead of "let bar1, bar2 = foo", bar1 and bar2 are already defined as "let bar1 = ref 0 and bar2 = ref 0"
<Qrntz>
you can access reference contents with unary «!»
<Qrntz>
e. g. «!bar1»
<shp>
...
<shp>
"bar1, bar2 := foo; " don't work
<shp>
i can't do "let bar1, bar2 = foo" since bar1 and bar2 are references
iratsu has quit [*.net *.split]
nimred has quit [*.net *.split]
rwmjones has quit [*.net *.split]
wagle has quit [*.net *.split]
TDJACR has quit [*.net *.split]
willb has quit [*.net *.split]
<Qrntz>
right
<adrien>
I don't think you can update both at once
TDJACR has joined #ocaml
<Qrntz>
you can only do «bar1 := value; bar2 := value2»
wagle has joined #ocaml
<Qrntz>
or store a tuple in the reference
willb has joined #ocaml
<Qrntz>
and assign a tuple, respectively
<shp>
but i wan't to affect bar1 the first component of the couple foo, and to bar2 the second component of foo"
<adrien>
"let a, b = c" creates new variables "a" and "b" which will shadow previous declarations (if any)
iratsu has joined #ocaml
<adrien>
shp: bar1 := fst foo; bar2 := snd foo;
<shp>
(i precise i use camllight so not sure there is tuple, in fact i do'nt know never heard of it)
<shp>
thank you adrien
eni has joined #ocaml
nimred has joined #ocaml
<shp>
last question and i promise i stop, what about an int*int*int instead of a int*int ^^ ?
rwmjones has joined #ocaml
<adrien>
no built-in accessor function
<adrien>
so define them yourself :-)
<adrien>
(they're one-liners)
faheem has joined #ocaml
<wmeyer>
small digression, GADTs can define fst and snd for any tuple
<wmeyer>
is not really a tuple, but hlist
<shp>
weird, when i use match in a while loop, i don't manage to add an instruction after the match that is read whatever the case of the match, it looks like all the instructions after the match in the while loop are only called during the last case of the match
<shp>
and when i put "begin match list with [....] end otherInstructions;" the compiler tells me "This expression is not a function, it cannot be applied."
Anarchos has joined #ocaml
<Qrntz>
shp, you'll need a semicolon after the «end»
<shp>
omg it's only that, shame on me, thank you Qrntz
<Qrntz>
you're welcome
gour has quit [Quit: WeeChat 0.3.8]
shp has quit [Quit: kit]
mye has joined #ocaml
jewel has quit [Ping timeout: 260 seconds]
SanderM has joined #ocaml
<SanderM>
hello
<SanderM>
I have problem with GODI, I hope that someone else can solve it
<Anarchos>
hello SanderM
<Anarchos>
i can't help with GODI sorry
<SanderM>
GODI complains that it cannot find gzip, because it is looking at a wrong absolute PATH.
<SanderM>
My PATH environment variables contains no spaces
<SanderM>
s/absolute PATH/absolute path/
<SanderM>
variables -s
<SanderM>
errors like "/bin/sh: /bin/zcat: No such file or directory"
<wmeyer>
SanderM: on widnows that is?
<wmeyer>
and you are using Cygwin?
<SanderM>
No, on Arch Linux. But I solved it by downloading a new version of the bootstrap and reinstalling GODI ... But now I must repeat my package selections ... :/ Oh well
<wmeyer>
SanderM: you can try OPAM too, is a very good package manager too.
<SanderM>
Yeah well I am trying to install utop because I read it is a good enhanced toplevel, but I already found out it isn't in GODI ... So I will have to look around. Is utop in OPAM?
<wmeyer>
yes, it's
<wmeyer>
utop is great
mcclurmc has joined #ocaml
ttamttam has quit [Ping timeout: 255 seconds]
eni has quit [Ping timeout: 244 seconds]
The_third_man has quit [Ping timeout: 246 seconds]
The_third_man has joined #ocaml
SanderM has quit [Remote host closed the connection]
hcarty has quit [Ping timeout: 244 seconds]
hcarty has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
tani has joined #ocaml
tane has quit [Ping timeout: 260 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<mk270>
should i expect to be able to find Xlib via Opam?
<adrien>
Xlib? why do you want that library?
<mk270>
so that i can port a window manager to ocaml?
<mk270>
(whose original code is written to Xlib)
<mk270>
am i making some conceptual error?
<adrien>
nowadays you should use xcb instead
<adrien>
but I see bindings to Xlib but not to xcb
<mk270>
what is xcb?
<mk270>
oh i see (googled)
<mk270>
that's only appropriate for fresh projects, rather than existing projects, afaict
<mk270>
but thanks for the pointer!
<mk270>
the path of least resistance might be xcb via xlib
<adrien>
if you're porting between languages, that's close to a fresh project
<wmeyer>
mk270: I'd stick with xcb, at least make it to work with Xlib and then gradually port to Xcb
<mk270>
wmeyer: exactly, that's what i'm doing
<wmeyer>
can you uncover a little bit, i admit being curious :-)
<mk270>
wmeyer: i use olvwm
<wmeyer>
maybe we can make something that is ocamlbuild + oasis + opam vs cabal the same as your wm vs xmonad.
<mk270>
it hasn't been maintained since the 1990s, which is a feature, as it means that the gnome/ubuntu/apple/microsoft people have not tried to impose any new paradigms on me since the clinton administration
<mk270>
however, the underlying widget toolkit is also unmaintained
<mk270>
and creaks on 64bit
<mk270>
the ubuntu maintainers break my wm every two or three years
<mk270>
which is unacceptable
<wmeyer>
interesting; think maybe have heard of it. the right approach is make a minimalistic one in form of library and make plugins. Small kernel that is.
<mk270>
so i am going to port it to ocaml
<mk270>
but first i am porting tinywm to ocaml, to make sure i know i can do it
<wmeyer>
if you provide a WM lib to OCaml that would be really nice.
<wmeyer>
myself I use StumpWM and Xmonad on the netbook
<mk270>
wmeyer: that sounds terribly recent
<wmeyer>
mk270: it is but none of this is OCaml!
<mk270>
basically, i am trying to keep my desktop as it was in 1995
<mk270>
this "xcb" sounds like a bloody good thing
<mk270>
but that will have to come a bit later
suyu has joined #ocaml
<mk270>
wmeyer: i am more concerned with ocaml's tools/community documentation
<wmeyer>
sounds cool, did you use olwvm back in 1995?
<wmeyer>
we working hard on it you know.
<mk270>
wmeyer: i used olwm, which is basically identical
<mk270>
switch to olvwm a year or two later; same config file
<wmeyer>
nice
<wmeyer>
in 95 i was a windows/dos baby
<wmeyer>
actually in 94 i was amiga fan
<mk270>
the thing is incredibly ugly visually and has no features, but it also has no bugs, no changes, and is ergonomically very convenient (for me, since i am accustomed to it)
<mk270>
ah
<mk270>
so, i have never really used windows or macos
<wmeyer>
sounds just great.
<mk270>
i went from dos to unix
<mk270>
it is NOT great
<wmeyer>
i used windows for too long
<mk270>
windows and macos have a whole bunch of good UI ideas
<mk270>
but for me it is MUCh more important not to have to learn new UI interactions
<wmeyer>
but UI is not the most important thing
<mk270>
no, indeed
<mk270>
but i dont want to have to waste any time learning new keystrokes/mouse gestures / widgets
<wmeyer>
especially for developers like we (informally caml hackers)
<wmeyer>
then just don't use these systems
<mk270>
i don't use them
<mk270>
and i find them harder to use than people who've used them a lot over the last twenty years, entirely understandably, and entirely my fault
<wmeyer>
I think we all say, we need WM
<wmeyer>
in pure OCaml :-)
suyu has quit [Client Quit]
<mk270>
it's easy to underestimate how hard it is to use windows or macos if you're unfamiliar with them
<mk270>
anyway
<wmeyer>
yes
<wmeyer>
it is
<mk270>
that is just my oddball technological conservatism/laziness
<wmeyer>
i am being excited about your WM project.
<mk270>
or "path dependence"
<mk270>
fine
<mk270>
well let's see how easy it is to port tinywm to ocaml
<mk270>
it is 59 lines of C
<wmeyer>
xcb bindings would be great too to start with
<wmeyer>
should be easy
<mk270>
yes yes, but it is written in sodding Xlib, so we do that first
<mk270>
porting from xlib to xcb has got to be a piece of piss compared with porting from c to ocaml, right?
<wmeyer>
then rewire tinywm first in C:-)
<mk270>
anyway, community docs!
<wmeyer>
:S
<wmeyer>
doing that in fact
<mk270>
i have this gist which i want to turn into "recommended way of getting your shit onto github if you're making an exe or library"
<mk270>
it turns out that the ocaml.org dudes are pretty hardline about accepting less-than-perfect pull requests
<mk270>
so i need that gist to be right, and to have a lot more substance in it
<mk270>
wmeyer: is there any sort of way of getting some people together to share out the donkey work of "a little edit here, a little fix there, a new rough doc yonder" for ocaml.org?
<adrien>
find a publicly-accessible etherpad lite
<mk270>
adrien: good point
<mk270>
i know one, but we're not exactly allowed to use it :)
<mk270>
keeping it on github also makes it (somewhat) easier for strangers to find it
<adrien>
well, you can use anything else that's public and has a low entry threshold :-)
<mk270>
is there an overview of how opam oasis ocamlbuild etc all fit together?
<mk270>
(if not, that would be a good thing to have)
<wmeyer>
actually, I in a process of writing this up :-)
<mk270>
ok cool
<mk270>
i cannot stress how much i would prefer pull requests on github (that is to say, i am just one more person who takes the view expressed on caml-list re wikis vs github)
<wmeyer>
will keep you up dated
<mk270>
but realistically, we need a wiki too
Oejet has joined #ocaml
<wmeyer>
mk270: both have some advantages and disadvantages i keep saying it ...
<wmeyer>
in ideal world pushing a markup to ocaml.org should be very easy, small edits should be preffered
<wmeyer>
github style webpage - centralised
<wmeyer>
wiki - decantralised
<wmeyer>
and we know how difficult is to keep good quality wiki
<mk270>
yes
<wmeyer>
but it also makes community much closer
<wmeyer>
like IRC
<mk270>
sadly, ocaml-xlib doesn't, er, support all of xlib
<wmeyer>
because people actually collaborate
<mk270>
arse
<mk270>
maybe we should have a docs hackday in london or cambridge or paris or somewhere
<wmeyer>
sure, sounds a like great idea. We will have Dys-functional programmers meet up soon. maybe talking to mcclurmc would be a good idea
<mk270>
is that ocaml-specific?
<wmeyer>
no, but majority of people that came last time where camlrs
<mk270>
fair enough
<wmeyer>
it's in Cambridge, in a pub; finding link for you
<mk270>
ok, well, i'm in morocco the previous day, speaking at the launch of their open budget initiaive
<mk270>
and if you know any ocaml-based type-heterogenous schema-heterogeneous OLAP system, i am ALL EARS
<mk270>
so i may not be able to make it to cam that evening
<wmeyer>
have had no ide what is OLAP
<wmeyer>
shame, you can join us on the next meetup
<mk270>
olap is a way of storing multidimensional numeric data (sometimes sql is ok for this, sometimes not)
<mk270>
if your government has gone and tagged all its financial transactions with members of various enumerated types which form a multidimensional cartesian space, you want to be able to project that down to lower dimensions
<mk270>
excel pivot tables is the same idea
<mk270>
however, the tools for doing this with open data are written by a bunch of python weenies who would object to static typing if they knew what it was
<wmeyer>
yes, types matters, why to not write a library for this, is HPC?
<wmeyer>
is it*
<wmeyer>
i make a lot of mistakes today
<mk270>
it's a long story
<mk270>
speaking of writing a lbrary
<mk270>
what do i do when symbol foo is absent from the ocaml bindings for my lib?
<mk270>
do not say "use xcb"
<mk270>
what is the ocaml "external" keyword and where do i find out how to use it?
<wmeyer>
so you need to wrap the bindings to C layer
<mk270>
yeah
<mk270>
someone has done that *incompletely*
<wmeyer>
you will have a link error, or compile error if the symbol is absent
<mk270>
quite reasonably only doing the subset of xlib they care about
<mk270>
wm's care about a different subset of xlib, quite reasonably
<mk270>
camlidl should be linked from ocaml.org, n'est-ce pas?
<wmeyer>
yep
<wmeyer>
should be used more
<wmeyer>
but people say it;s not good at callbacks
<wmeyer>
still, you can shift the other part to manual bindings
<mk270>
should be linked, where does it belong on ocaml.org?
<wmeyer>
mk270: I think tools or smth like this. I don't understand why we don't use it, should be packaged with OPAM, and use it in wild. It accelarates a lot of producing the first ML layer on top of C.
<wmeyer>
(ask me why I didn't use it for my library; have no idea)
ikaros has quit [Quit: Ex-Chat]
<mk270>
thanks
<mk270>
i've made a branch in my ocaml.org repo; that means it should be on the website in about ten days
<mk270>
which i guess is a datapoint about workflow when you're comparing against a wiki
leoncamel has quit [Ping timeout: 252 seconds]
<mk270>
so we have XKeycodeToKeysym but not XKeysymToKeycode, the lazy fucks
<mk270>
hmm, the C code typechecks - that often means there's a bug