<thelema>
Alpounet: remind me in about 10 hours to merge your code in batteries.
<Alpounet>
okay, will try
<Alpounet>
added a reminder on my phone </geek>
<thelema>
:) good night
ski_ has joined #ocaml
<Alpounet>
gn thelema
Modius_ has joined #ocaml
Modius has quit [Read error: 60 (Operation timed out)]
ski_ has quit ["Lost terminal"]
tmaedaZ is now known as tmaeda
ski_ has joined #ocaml
thrasibule has quit [Read error: 110 (Connection timed out)]
<eydaimon>
would be nice if there was a way to print a' things nicely
<eydaimon>
anyway, I've got a pattern match, but I want to match a variable to another variable, is this possible?
<eydaimon>
http://pastie.org/700626 I saw this code, and wanted to rewrite it using a pattern match
<eydaimon>
I get unused variable cur, etc
<flux>
eydaimon, I didn't look at the paste, but: let a = 42 in match 42 with x when x = a -> ..
Yoric has joined #ocaml
ygrek has joined #ocaml
<eydaimon>
what's the syntax if I have several matches ?
<eydaimon>
using the when thing?
ttamttam has joined #ocaml
<eydaimon>
the function basically converts a string to a list of chars
<eydaimon>
but it seems very involved. Is there no easier way?
Snark has joined #ocaml
rwmjones has joined #ocaml
ttamttam has quit ["Leaving."]
<eydaimon>
# String.get "blah" 999;;
<eydaimon>
Exception: Invalid_argument "index out of bounds".
<eydaimon>
also, I'mg etting this... in my code. but it doesn't say on which line of code I get the error
<eydaimon>
it's not so bad on commandline, but it sucks when it's in a file
<eydaimon>
hah, I did manage to make it better
<eydaimon>
just calling it is worse
<eydaimon>
slightly.. it just needs a front-end now ;)
caligula__ has joined #ocaml
<eydaimon>
are guards not implemented in ocaml?
<eydaimon>
for matching?
<eydaimon>
nm, there must be
<eydaimon>
hence the when
mishok13 has joined #ocaml
caligula_ has quit [Read error: 110 (Connection timed out)]
gdmfsob has joined #ocaml
valross has joined #ocaml
clog_ has joined #ocaml
munga_ has quit [Read error: 110 (Connection timed out)]
mishok13 has quit ["Leaving"]
ttamttam has joined #ocaml
Yoric has quit []
det has quit [Remote closed the connection]
ikaros has joined #ocaml
det has joined #ocaml
ikaros has quit [Client Quit]
<mehdid>
eydaimon: compile with -g and set the env var OCAMLRUNPARAM=b, it will help you to track exceptions, HTH
<flux>
I've read that exception backtraces for the toplevel are difficult to implement, so they're probably not coming any time soon. but they work great in compiled files.
<flux>
eydaimon, I don't see what use that kind of guards would be for such a function (btw, often it's called 'explode', as that's what's it's called in SML)
munga_ has joined #ocaml
<mehdid>
flux: right... I didn't notice that he was working in a toplevel! (BTW, I mentioned "compile with -g" :))
Modius_ has quit [Read error: 54 (Connection reset by peer)]
tarbo2 has quit [Read error: 60 (Operation timed out)]
tarbo2 has joined #ocaml
r0bby has quit [Read error: 60 (Operation timed out)]
Modius_ has joined #ocaml
willb has quit [Read error: 60 (Operation timed out)]
willb has joined #ocaml
r0bby has joined #ocaml
sysop_fb has joined #ocaml
<flux>
mehdid, sure, your advice was good :)
Yoric has joined #ocaml
_zack has joined #ocaml
clog has quit [Read error: 145 (Connection timed out)]
clog_ is now known as clog
_zack has quit ["Leaving."]
dmentre has joined #ocaml
ikaros has joined #ocaml
kaustuv has joined #ocaml
verte has joined #ocaml
_zack has joined #ocaml
munga_ has joined #ocaml
Yoric has quit []
mattiase has joined #ocaml
Snark has quit ["Ex-Chat"]
beibmozoi has left #ocaml []
clog_ has joined #ocaml
clog has quit [Read error: 110 (Connection timed out)]
clog_ is now known as clog
verte has quit ["~~~ Crash in JIT!"]
verte has joined #ocaml
verte has quit ["~~~ Crash in JIT!"]
_andre has joined #ocaml
_andre has quit ["Lost terminal"]
BigJ has quit [Read error: 131 (Connection reset by peer)]
<yziquel>
exit
yziquel has quit ["Leaving"]
BigJ has joined #ocaml
tmaeda is now known as tmaedaZ
BigJ has quit [Connection timed out]
bzzbzz has quit ["leaving"]
_andre has joined #ocaml
_andre has quit [Client Quit]
_andre has joined #ocaml
ua has joined #ocaml
_andre has quit [Client Quit]
_andre has joined #ocaml
BigJ2 has quit [Read error: 110 (Connection timed out)]
tmaedaZ is now known as tmaeda
ikaros has quit [Remote closed the connection]
BigJ2 has joined #ocaml
thrasibule has joined #ocaml
BigJ2 has quit [Client Quit]
thrasibule has quit [Read error: 145 (Connection timed out)]
clog_ has joined #ocaml
clog has quit [Read error: 110 (Connection timed out)]
clog_ is now known as clog
albacker has joined #ocaml
rwmjones has quit [Read error: 104 (Connection reset by peer)]
rwmjones has joined #ocaml
<Alpounet>
thelema, branch merging time :-p
<Camarade_Tux>
^^
<thelema>
thank you for the reminder...
<Alpounet>
(if you're fine with my code of course)
<thelema>
which branch?
kaustuv has quit ["ERC Version 5.3 (IRC client for Emacs)"]
<Alpounet>
it was building fine in my environment at that moment, it should be okay, but you're right to check, in case.
<thelema>
grrr. With my work on aaa, I've removed sexplib and dependencies from my system, and can't compile straight batteries
* thelema
looks over the code again and then pushes
<thelema>
ok, pushed
<Alpounet>
did you merge with aaa ?
* thelema
tries
<thelema>
we really need a distclean target for make
<Alpounet>
heh
<thelema>
hmm, I'm getting these wierd errors "foo.cmo is not a bytecode object file" -- any ideas?
<Alpounet>
thelema, the great thing would be to merge my version of option and enum .ml/mli with the aaa branch but it looks hard :-p
<Alpounet>
thelema, huh ? foo being which files,
<Alpounet>
?
<thelema>
cbtop.cmo
<thelema>
Alpounet: actually, git handled the merge effortlessly...
<Alpounet>
great
bzzbzz has joined #ocaml
<Alpounet>
"is not a bytecode object file" ... let's google it...
<thelema>
I got the same error with another project of mine - I think I worked around it by using ocamlopt insread of ocamlc
<Alpounet>
1 vote down
<Alpounet>
<Alpounet>
Usually this error appears when ocaml compiler attempts to use binary files (cma,cmo,etc) created by another version of ocaml. In particular, it means that you need to recompile all the libraries when upgrading ocaml (even with minor version shift like 3.11.0 -> 3.11.1).
<Alpounet>
thelema, is it merged into the main branch AND aaa ?
<thelema>
It's probably caused by my recent Ubuntu - it must have updated some libraries, even though everything should be using my local ocaml
<thelema>
recent Ubuntu *upgrade*
<thelema>
anyway, back later
<thelema>
thanks for the help. (btw, I figured out my bug in the reduce_nodes code - didn't use right accumulator in the inner loop)
<Alpounet>
thelema, my branch's been merged with both the main branch and the aaa one ?
<thelema>
yes
<Alpounet>
ok thanks
<Alpounet>
there's a weird thing
<Alpounet>
I'd like to add Batteries to my ohloh account
<Alpounet>
but the website doesn't find me in the committers
munga_ has quit [Read error: 110 (Connection timed out)]
<Alpounet>
just because I haven't commited something to the main branch directly
<Alpounet>
it's kinda silly
jcaose has joined #ocaml
<thelema>
it's possible my commits just now won't be acknowledged as yours, as the merge commits have my name on them, despite the branch it's merging being totally yours... Got me how it'll work.
<Alpounet>
yeah
<Alpounet>
I don't care
<Alpounet>
but that's far from being perfect :-p
ikaros has joined #ocaml
ski_ has quit ["Lost terminal"]
<Alpounet>
thelema, is the main branch still considered as "the main branch on which we improve batteries" ?
<Alpounet>
or should we switch to aaa ?
jcaose has quit ["Leaving"]
jonafan has joined #ocaml
_unK has joined #ocaml
c0m has quit [Read error: 110 (Connection timed out)]
Modius__ has joined #ocaml
ua has quit [Read error: 113 (No route to host)]
Modius_ has quit [Connection timed out]
<_zack>
polymorphic variants with a single arguments have the same in-memory representation of couples, haven't they?
<_zack>
in particular, I'm wondering whether it is always safe to get the value "contained" in a polymorphic variant with a cast to a pair, of which I access the second component
dmentre has quit ["Leaving."]
<mfp>
_zack: I think so (if the arity is >= 1, of course)
<_zack>
mfp: yep
<_zack>
mfp: the C<->OCaml manual seems to confirm that
<mfp>
is the function used to hash constructors documented there?
<mfp>
re: hash_variant 18.3.6
<mfp>
_zack: watch out, "Unlike constructed values, variant values taking several arguments are not flattened. That is, `VConstr(v, v') is represented by a block of size 2, whose field number 1 contains the representation of the pair (v, v'), rather than a block of size 3 containing v and v' in fields 1 and 2."
<_zack>
mfp: yep, in my case luckily I've only arity = 1
<_zack>
(or better, I've also arity > 1, but I'm handling those cases differently)
<thelema>
Alpounet: whether aaa or master is main, I'd love to let the community decide.
<Alpounet>
ok
<Alpounet>
the batteries community is quite restricted for the moment
<Alpounet>
we really should consider preparing a 1.0 release !
ikaros_ has joined #ocaml
<Alpounet>
aaa or not, but we have to do it
<thelema>
I'll have to do a bunch of cleanups on aaa to make it usable for the general public
acatout has quit [Read error: 60 (Operation timed out)]
<thelema>
for that reason (and all the hard work yoric put into master), I think we should get a 1.0 release of master
<Alpounet>
I can try to find some time to help on that if you want
<thelema>
First thing, we need a list of what needs to be done...
* thelema
checks the bug trackers
<Alpounet>
lol
<Alpounet>
don't do it
<thelema>
:)
<Alpounet>
you'll not be able to get any motivation after that
<Alpounet>
:D
ikaros_ has quit [Client Quit]
<Alpounet>
thelema, you should motivate people on the ML to do a ``Batteries sprint''
* thelema
plans a release candidate
<thelema>
or not... too many alphas, betas, etc.
* thelema
plans a release
<thelema>
grr, I don't want to release [master]
* thelema
plans a fixup of [aaa]
<Alpounet>
then establish a todo list for [aaa]
<thelema>
what does [aaa] need... 1) godi
<thelema>
2) documentation generation (have very likely broken this)
<Alpounet>
that's "all" ?
<thelema>
hmmm.. fix the toplevek
<thelema>
*toplevel
<Alpounet>
hmm
<Alpounet>
I'll clone [aaa] and see what it does look like
th5 has quit []
ikaros has quit [Read error: 110 (Connection timed out)]
* thelema
is sorry to abandon batteries proper, and hopes that merging will be possible someday
<thelema>
camlp4 is a very powerful weapon to improve ocaml
<thelema>
I just can't wield it well enough.
_zack has quit ["Leaving."]
<mfp>
the build sys and doc magic was just too complicated, nobody really understood it (probably including Yoric[DT])
<thelema>
I think yoric was able to understand it. He's got quite some brains in his head.
<thelema>
but yes, there was too much magic for me and other mortals
_unK has joined #ocaml
<thelema>
autoconf is a pain for batteries - how will this work with omake?
<mfp>
hmm the only thing really needing detection is camlzip, right?
<thelema>
yes
<thelema>
maybe camomile too
<mfp>
isn't it pretty basic, being required by the ropes and all?
<thelema>
yes - I'm very tempted to fork camomile for aaa
<mfp>
-the
<thelema>
partly because of that
<mfp>
why is a fork needed?
<thelema>
camomile's install is a bit kludgy
<thelema>
I've already merged part of the camomile tree into aaa (avlTree, iSet, iMap)
<mfp>
? it's available on Fedora, Debian and friends
<thelema>
windows?
<mfp>
forking it altogether would make it harder to package AAA
<thelema>
AAA working on win32 is important to me.
<thelema>
harder to package because of...
<mfp>
it'd conflict with mainstream camomile, wouldn't it?
<thelema>
if camomile was already installed...
<thelema>
only if no camomile present would mini-camomile be used
<thelema>
maybe.
<tvn2009>
mrvn, match ["1";"2";"3";"4";"5"] with [a;b;c]::_ -> printf "%s" a | _ -> failwith "hi";; gives warning This pattern matches values of type 'a list list but is here used to match values of type string list and doesn't give me the printf result
<thelema>
tvn2009: match ... with a::b::c::_ ->
<tvn2009>
oh right
<tvn2009>
sorry
<thelema>
maybe mini-camomile is too much work. It'll not make it into 1.0, that's for sure
<tvn2009>
thanks :]
<thelema>
anyway, that's an idea, no camomile in aaa for now
<tvn2009>
is there some function "take n l" that returns the first n elements of list l ?
<thelema>
yes, but it's in batteries (and aaa)
<thelema>
val take : int -> 'a list -> 'a list
<thelema>
take n l returns up to the n first elements from list l, if available.
<thelema>
sadly you can't use that out of context because it does black magic
<thelema>
mfp: optcomp?
* thelema
plans to drop that.
<thelema>
too much work to support old ocaml.
<mfp>
thelema: batLexing.ml* uses it
<mfp>
oh, can just remove those directives then?
<thelema>
yes, it's just to deal with the interface that's changed between 3.10 and 3.11
* thelema
will require 3.11 for aaa-batteries
<thelema>
this will simplify much...
<thelema>
actually, I think it's only used in .mli files
<mfp>
yes
<thelema>
and maybe toolchain.mli
<thelema>
which I haven't figured out yet
<mfp>
thelema: what about RMutex? should this all be build with -package threads -thread ?
<thelema>
yes, aaa requires -thread
<thelema>
it sucks, and generates stupid error messages when you build without
<thelema>
but it works well enough.
* thelema
is going for a solid 80% solution instead of a brittle 99% solution
<mfp>
OK, I just got batteries.cm[x]a built with OMake
<mfp>
forking on github & branching in a minute
ztfw has joined #ocaml
Alpounet has quit ["``Do what you think you can't do.'' -- E. Roosevelt"]
Alpounet has joined #ocaml
<thelema>
hmm, how to deal with ropes & unicode strings w/o camlp4
* thelema
leaves this as a rough edge
<mfp>
I have pushed [new branch] mfp/omake-build-sys -> refs/head/mfp/omake-build-sys
<mfp>
but the branch doesn't show up on github :-?
<tvn2009>
my implementation of take, let rec take_vn n l = if n <= 0 then [] else match l with h::t -> h::(take_vn (pred n) t) |_ ->[] , not sure if it's right
Snark has joined #ocaml
<thelema>
mfp: you're right...
<thelema>
there's links saying you've created it, but the links go to error page.
<mfp>
thelema: maybe git add mfp git://github.com/mfp/AAA-batteries.git and git fetch
<thelema>
sure
<mfp>
also pushed to omake-build-sys (thought maybe the mfp/ was the culprit), no diff
Amorphous has quit [Read error: 113 (No route to host)]
<thelema>
hmm, git fetch on that repo gets nothing
* thelema
tries cloning
<thelema>
nope, nothing there.
* thelema
goes back to toplevel fixes
<mfp>
I'll try by deleting the fork, reforking and pushing again
Amorphous has joined #ocaml
<eydaimon>
flux and mehdid : so if an "index is out of bounds" error is not backtracable at top-level, doesn't that make ocaml run as scripts pretty useless?
ttamttam has joined #ocaml
<mfp>
thelema: didn't work either, so I just pushed it to the aaa branch of my fork
<thelema>
no problem.
<thelema>
can you send a pull request?
valross has quit [Read error: 110 (Connection timed out)]
<mfp>
done
<mfp>
I only modified .gitignore and added 2 symlinks to batteries_config.ml(i), 2 OMakefiles and the top-level OMakeroot, no other changes
<mfp>
builds the .cma and .cmxa in 8s real (9.12 user + 3.55 sys) :-)
<mfp>
(omake -j 2)
Pimm has joined #ocaml
<flux>
eydaimon, well, you can debug your 'script' in compilation mode I suppose
<thelema>
nice.
<eydaimon>
flux: hmm
<Pimm>
Guys, I'm defining a class in OCaml which I'm new to
<Pimm>
And that class has a mutable val
<Pimm>
But it seems like I have to set that val directly
<Pimm>
So is there a way to set it to null
<flux>
eydaimon, in general I suppose you can use byte-code compiled binaries instead of using them as plain ml-files, although it might be convenient to have only one copy around
<mfp>
Pimm: you can use an option
<mfp>
+type
<Pimm>
Where do I put the option?
<mfp>
val mutable foo = None
<mfp>
then you initialize it to Some value later
<Pimm>
OK, great, that works!
<Pimm>
Also, what is the standard way to name methods and classes, I've seen some_class_name and some_method_name
<mattiase>
Pimm: I don't think there is a standard way, but the language enforces the capitalisation rules.
<Pimm>
What do you mean by that rule?
<mattiase>
Pimm: Also, objects, methods and classes are somewhat rare in actual ocaml code. They are occasionally useful, but not as much as in other languages.
<Pimm>
Yes, so I've seen, but I have to write some objects just to get to know to the language
<flux>
I suppose the rules can be summarized as: module names and constructors are in capital
seanmcl has joined #ocaml
<flux>
(often also polymorphic variants are in capital, although they don't need to be)
<Pimm>
OK, thanks
<mfp>
flux: IIRC lowercase polymorphic variants are sort of an "implementation accident"
alp_ has quit [Client Quit]
<flux>
mfp, well, are they going to remove it later? I don't think so..
<mfp>
improbable indeed
<thelema>
mfp: installing with omakefile?
<mfp>
let's see
<mfp>
where's the META?
<thelema>
build/
<thelema>
except it's created by autoconf
<thelema>
from build/META.in
<mfp>
I see
<thelema>
it just expands the version number
_andre has quit ["Lost terminal"]
Alpounet has joined #ocaml
ua has joined #ocaml
<mfp>
thelema: added install & uninstall targets, sent pull request
<thelema>
as far as I can tell, pull requests aren't actually useful - I don't see how to pull inside github (which I thought was possible)
<Pimm>
OK, this must be a noobe question
<mfp>
never used them, so was wondering what they'd look like UI-wise
<Pimm>
But why does this work: val mutable next = None
<Pimm>
Though this doesn't: val mutable next:node = None
<thelema>
mfp: I just get a messgae in my github inbox saying you want me to pull.
<flux>
pimm, its type is not node, it's node option
<mfp>
Pimm: None is of type _ option
<Pimm>
OK, would it be possible to do what I want to do here?
<flux>
depends what you want :)
_zack has joined #ocaml
<flux>
+on
<mfp>
give a type constraint? val mutable next : node option = None
<Pimm>
I don't want to set an initial value for that property
<thelema>
mfp: what's with the $DESTDIR stuff?
<flux>
pimm, None is the way to do it
<Pimm>
And the option - None works, I'll see what that is
<thelema>
mfp: ocamlfind install should make the dir, no?
<mfp>
thelema: not sure, I copied it from lwt's Makefile
<mfp>
it might be redundant
<thelema>
ok.
* thelema
tries modifying
<thelema>
hmm...
<thelema>
ok, no problems without DESTDIR
<thelema>
except now make all is broken, I think...
<thelema>
ok, moving .DEFAULT to end fixed...
<thelema>
back to doc generation
seanmcl has quit []
slash_ has joined #ocaml
ua has quit [Read error: 113 (No route to host)]
<mfp>
thelema: what else is needed besides ocamlfind ocamldoc -package camomile,threads -html -d doc *.mli ?
ua has joined #ocaml
<mfp>
(which takes 9s here btw.)
<thelema>
I dunno.
<thelema>
yoric had *tons* of magic in the doc generation
<thelema>
the main line was [ocamlbuild doc/api.docdir/index.html]
<thelema>
this got its config from _tags and batteries.mllib, the list of modules
<mfp>
yes, because he used a custom doc generator to classify the modules
<thelema>
ah.
* thelema
disliked the classification
<thelema>
we'll probably work in the custom stylesheet form batteries
<mfp>
I think it'd be easier to perform, if wanted, by post-processing the htmls, anyway
<thelema>
*from
<thelema>
really? ick.
Alpounet has quit ["Leaving"]
<mfp>
thelema: build/odoc_generator_batlib.ml is 936 lines long
<thelema>
ok, maybe html munging is easier...
shiram has joined #ocaml
<thelema>
ah, the fork queue is ready...
Alpounet has joined #ocaml
<thelema>
it would have been really easy to merge in github if it were ready before...
<thelema>
keep sending pull requests
<thelema>
I hope I don't have scoping issues with the config file...
<thelema>
mfp: please sync with my omake branch
<thelema>
not too quickly, though - my last commit produced omake problems...
jez has joined #ocaml
<mfp>
thelema: how? I already had to push to my aaa branch
* thelema
didn't expect early binding
<thelema>
check your fork queue
<mfp>
there's a bunch of commits, half of which are marked as "won't apply cleanly"
<mfp>
what is one supposed to do in these cases?
seanmcl has joined #ocaml
<thelema>
hmmm...
<mfp>
I think I'll be using git directly, it's less confusing
<thelema>
bah, don't worry about it - I must have diverged a bit.
jez has left #ocaml []
<mfp>
I reset my aaa & omake branch to yours
* thelema
is fixing variables
<mfp>
it seems to me that using github's fork queue will generate lots of merge commits
hjpark has quit [Remote closed the connection]
* thelema
has just cherry-picked from your remote branch
<thelema>
ok, see if you can work off what I've just pushed.
<thelema>
Thanks a bunch for your help with this
<thelema>
I think the omake branch is almost ready to take over [aaa]
* thelema
will be back in a few hours.
sfmatt has quit [Remote closed the connection]
Janko_Ml has joined #ocaml
Janko_Ml is now known as middayc
ygrek has quit [Remote closed the connection]
shiram has quit [Read error: 110 (Connection timed out)]
seanmcl has quit []
ygrek has joined #ocaml
ttamttam has quit ["Leaving."]
slash_ has quit [Client Quit]
slash_ has joined #ocaml
drunK_ has joined #ocaml
<gildor>
thelema: if you intend to move the git repository from ocamlcore.org to github, please update corresponding HOWTO on batterie homepage
Alpounet has quit ["``Do what you think you can't do.'' -- E. Roosevelt"]
<gildor>
concerning the bug tracker, I am not sure this is a good idea to duplicate it, GForge BTS is not super-sexy but it works -- and a lot of people that will report bugs on batteries are probably subscribed to forge.ocamlcore.org
jcaose has quit [Read error: 110 (Connection timed out)]
ztfw` has joined #ocaml
_unK has quit [Read error: 110 (Connection timed out)]
bzzbzz has quit ["Lost terminal"]
Snark has quit ["Ex-Chat"]
ztfw has quit [Connection timed out]
Alpounet has joined #ocaml
Alpounet has quit [Client Quit]
Alpounet has joined #ocaml
<thelema>
gildor: I'm just moving my aaa-batteries subproject to github.
<Camarade_Tux>
I have to say, I just started reading it and... gave up
<middayc>
yeah, it's long and full of useless rumbless too, but there is also a lot of interesting stuff in berween (at least for me)
aburrido has joined #ocaml
<Camarade_Tux>
"Messages 1 - 25 of 105", even more message than I thought :o
<Camarade_Tux>
and I agree with you
<eydaimon>
actually, the whole concurrency about Go (and since i"m doing a book review on Erlang) made me look at OCaml and concurrency. I found JoCaml. Has anyone looked at this?
<Camarade_Tux>
looked at but not tried =/
<middayc>
also just looked
<middayc>
concurrency seems to be the largest by far black dot for OCaml..
<middayc>
it's bad because it's at the same time one of the strongest buzzwords in "practical" computer language debates these days
<eydaimon>
it's not just a strong buzzword, it's far more. As the Go guys said, computer speeds are slowing down, but we're ending up with a lot more cores.
<middayc>
yes, definatelly not just a buzzword.. I had it written "word of focus" but changed it
ikaros has quit ["Leave the magic to Houdini"]
<mbac>
is magic parallelism a real solution?
<mbac>
by magic parallelism i mean suppose ocaml had a map that used all of your cores
Pimm has quit [Read error: 110 (Connection timed out)]