Alpounet changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html - Answer OCaml Meeting 2010 poll https://forge.ocamlcore.org/survey/survey.php?group_id=77&survey_id=1
tmaeda0 is now known as tmaedaZ
seanmcl has quit []
ikaros has quit ["Leave the magic to Houdini"]
seanmcl has joined #ocaml
_unK has quit [Remote closed the connection]
seanmcl has quit []
h3 has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
valross has joined #ocaml
<mattam> julm: what's the problem? (I know, don't feed the troll)
NYNix has quit ["leaving"]
<julm> mattam: I would have preferred to see my State investing more money on INRIA rather than helping INRIA to sell its soul to the devil.
<mattam> Well, the state just earns money in this case.
<mattam> And they release open source code.
<mattam> But sure, if the State was more charitable it would all be better :)
_zack has joined #ocaml
seanmcl has joined #ocaml
_zack has quit ["Leaving."]
vindimy_ has quit [K-lined]
Amorphous has quit [Read error: 110 (Connection timed out)]
travisbrady has quit []
travisbrady has joined #ocaml
Amorphous has joined #ocaml
travisbrady has quit []
travisbrady has joined #ocaml
verte has joined #ocaml
kaustuv_` has joined #ocaml
kaustuv_ has quit [Read error: 110 (Connection timed out)]
tmaedaZ is now known as tmaeda0
verte is now known as verte-work
tmaeda0 is now known as tmaeda
struktured has quit [Read error: 110 (Connection timed out)]
slash_ has quit [Client Quit]
seanmcl has quit []
thrasibule has quit [Read error: 110 (Connection timed out)]
ttamttam has joined #ocaml
ulfdoz has joined #ocaml
caligula__ has joined #ocaml
struktured has joined #ocaml
ulfdoz has quit [Read error: 60 (Operation timed out)]
valross has quit [Remote closed the connection]
caligula_ has quit [Read error: 110 (Connection timed out)]
valross has joined #ocaml
ttamttam has quit ["Leaving."]
onigiri has quit []
travisbrady has quit []
verte-work has quit ["~~~ Crash in JIT!"]
mishok13 has joined #ocaml
caligula_ has joined #ocaml
caligula__ has quit [Read error: 60 (Operation timed out)]
mpwd has quit []
meltingw1x has joined #ocaml
ttamttam has joined #ocaml
meltingwax has quit [Read error: 110 (Connection timed out)]
mpwd has joined #ocaml
verte has joined #ocaml
Yoric[DT] has joined #ocaml
julm_ has joined #ocaml
hyperboreean has joined #ocaml
julm has quit [Read error: 110 (Connection timed out)]
munga has joined #ocaml
ikaros has joined #ocaml
mpwd has quit []
flux has quit [Read error: 60 (Operation timed out)]
julm_ is now known as julm
ikaros has quit ["Leave the magic to Houdini"]
mpwd has joined #ocaml
lutter has joined #ocaml
rjones has joined #ocaml
rjones is now known as rwmjones_lptp
mpwd has quit [Read error: 110 (Connection timed out)]
Associat0r has quit []
julm_ has joined #ocaml
julm has quit [Read error: 104 (Connection reset by peer)]
julm_ is now known as julm
ygrek has joined #ocaml
mpwd has joined #ocaml
mpwd has quit []
munga has quit [Read error: 113 (No route to host)]
munga has joined #ocaml
_andre has joined #ocaml
munga has quit [Read error: 113 (No route to host)]
flux has joined #ocaml
rwmjones_lptp has left #ocaml []
ttamttam has quit ["Leaving."]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
mpwd has joined #ocaml
mpwd has quit []
mpwd has joined #ocaml
Ched has quit [Read error: 113 (No route to host)]
thrasibule has joined #ocaml
mpwd has quit []
seanmcl has joined #ocaml
olegfink has joined #ocaml
<olegfink> hi, looking at http://caml.inria.fr/pub/docs/manual-ocaml/expr.html I'm still not sure if there is a one-character prefix operator I'm free to redefine
<olegfink> things like (-) don't work (seems I'm redefining the infix case)
<flux> hm, indeed
<flux> I tried setting both ~- and - to assert false, but - (5) still works
<olegfink> hmm, it's worse than that -- it's still got too low precedence
<olegfink> in fact I need to drop the outmost parens in f (g())
<olegfink> but I still need them for g=(-)
<olegfink> is there an unary operator with high enough precedence or this is completely pointless?
<meltingw1x> is there a function for log base 2?
<flux> meltingw1x, no, but you can easily make your own: let log2 v = log v /. log 2.0
<meltingw1x> flux: got it. thanks!
<thelema> olegfink: (?)
<thelema> hmm, what is the priority of (?) ?
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
<thelema> There's only 3 one-char prefix ops: !, ~, ?
* thelema looks in the source code
<olegfink> hmm, prefix ? is syntax error, probably because of label stuff
<thelema> :(
<thelema> | ['~' '?'] symbolchar +
<thelema> { PREFIXOP(Lexing.lexeme lexbuf) }
<thelema> | PREFIXOP simple_expr { mkexp(Pexp_apply(mkoperator $1 1, ["",$2])) }
<olegfink> aha, that's why (~) and (?) can't be prefix on their own. :-(
<thelema> | "?" { QUESTION }
<thelema> | "??" { QUESTIONQUESTION }
<thelema> hmm, ?? isn't used in parser.mly despite it being defined in lexer.mll
<olegfink> that is its use is a good QUESTION
<thelema> ah, camlp4 operator
<olegfink> hmm, I think it's unfair for me to keep everyone busy without any fun in return. What I'm looking at is http://www.spoj.pl/ranks/SIZECON/lang=CAML
<mfp> olegfink: have you tried (!)?
<olegfink> mfp: unfortunately I use it for its default meaning (yeah, my solution is completely imperative :-()
<flux> olegfink, !! then?
<flux> or !-..
<olegfink> too long!
<olegfink> won't save me anything
<flux> :)
<olegfink> actually if [let] would allow for argument patterns in tuple pattern...
<olegfink> like let f x,b=1+x,42
<olegfink> let s,r=ref 0,read_int;;for i=1 to r()do s:=!s+max 0(r())done;print_int!s
<olegfink> that's what I have in case someone wants to improve on that
<olegfink> two problems: [read_int] requiring [()] while [ignore . read_int] would be fine with [0], and elaborate [for] loop I don't really need
<olegfink> er, [read_int . ignore]
<mfp> olegfink: for i=1to r()do
<mfp> and max(r())0
<mfp> 2 chars saved
<olegfink> nah, spaces aren't counted
<olegfink> http://www.spoj.pl/problems/SIZECON/ -- Score equals to size of source code of your program except symbols with ASCII code <= 32.
<mfp> oh, thought they were because of or i=1 to r()do
<olegfink> heh, yeah, I should be consistent...
ikaros has joined #ocaml
<olegfink> hmm, if only [fun] and [function] were the other way around
hcarty has quit [Remote closed the connection]
<flux> olegfink, so I take it you just write your code like: let rec(!)(!+)(-)(!=)=match(!=)with[]->(-)|(+)::(++)-> !(!+)(!+(+)(-))(++)
_unK has joined #ocaml
<olegfink> flux: only for the size contest
<flux> actually, I made a big mistake, I was thinking those were before 32, but indeed they are between space and @, argh..
<olegfink> and it has the wrong argument order wrt. List.fold_right, should be let rec(!)(!+)(!=)(-)=match(!=)with[]->(-)|(+)::(++)-> !(!+)(++)(!+(+)(-)) ;-)
<olegfink> yeah, unfortunately the compiler really wants the identifiers to be printable at any rate
verte has quit ["Lost terminal"]
verte has joined #ocaml
Ched has joined #ocaml
pmurias has joined #ocaml
<pmurias> is anybody here using glcaml?
<pmurias> i would like to now how to use it with ocamlbuild
<flux> if it comes with META-files, I think the easiet way is to find a myocamlbuild-file with findlib-support
<flux> (this is not a glcaml-specific piece of advice)
<pmurias> i'm a ocaml noob the package has a glcaml.ml glcaml_stub.c and glcaml.mli
<pmurias> ocamlbuild seems to be having a problem noticing the stub
kaustuv_ has joined #ocaml
<pmurias> how does ocamlbuild detect/handle c stubs?
<mehdid> pmurias: I guess you're looking for something like: http://brion.inria.fr/gallium/index.php/Ocamlbuild_example_with_C_stubs
<thelema> if you could use the whitespace thing for ocaml, that'd save you characters
<pmurias> thelema: was that intended for me?
julm has quit [Read error: 131 (Connection reset by peer)]
kaustuv_` has quit [Read error: 110 (Connection timed out)]
julm has joined #ocaml
<thelema> no, for olegfink
<thelema> pmurias: read mehdid's link
<thelema> pmurias: the important thing is the libcryptokit.clib and the [ocaml_lib "cryptokit";] (and the two following lines)
_zack has joined #ocaml
julm_ has joined #ocaml
julm has quit [Read error: 104 (Connection reset by peer)]
verte has quit ["Lost terminal"]
julm_ is now known as julm
verte has joined #ocaml
seanmcl has quit []
seanmcl has joined #ocaml
bzzbzz has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
h3r3tic has joined #ocaml
hcarty has joined #ocaml
verte has quit ["~~~ Crash in JIT!"]
rwmjones is now known as rwmjones-afk
thelema has quit [Remote closed the connection]
thelema has joined #ocaml
Narrenschiff has joined #ocaml
Vital303 has quit [Read error: 113 (No route to host)]
smimou has joined #ocaml
mattiase` has joined #ocaml
julm_ has joined #ocaml
travisbrady has joined #ocaml
mattiase has quit [Read error: 110 (Connection timed out)]
seanmcl has quit []
bohanlon has quit ["leaving"]
julm has quit [Read error: 110 (Connection timed out)]
bohanlon has joined #ocaml
olegfink_ has joined #ocaml
slash_ has joined #ocaml
onigiri has joined #ocaml
olegfink has quit [Read error: 110 (Connection timed out)]
julm has joined #ocaml
ztfw has joined #ocaml
julm_ has quit [Read error: 110 (Connection timed out)]
Associat0r has joined #ocaml
olegfink has joined #ocaml
<pmurias> how do i build myocamlbuild.ml
<pmurias> ?
<flux> pmurias, you don't. or do you have a particular need to?
<flux> because if so, I don't know the answer
<flux> ocamlbuild does that behind your back
olegfink_ has quit [Read error: 110 (Connection timed out)]
<pmurias> is ocamlbuild the recommended way of building ocaml programs?
<flux> well, I know almost nothing of ocamlbuild, but I use it for my new, small, self-contained projects
<flux> otherwise I've used plain make and also OCamlMakefile
<flux> (OCamlMakefile is quite nice too)
<pmurias> ocambuild is anything but nice
<flux> :)
<flux> I picked my myocamlbuild.ml from somewhere and after that, the usage has been quite simple, modifying _tags file to add package dependencies
<flux> I don't actually write myocamlbuild.ml
<flux> (what the myocamlbuild.ml does is that it gives my ocamlfind-support, so I can just say <*>: pkg_netstring and it works)
<pmurias> why can't ocamlc just find the dependenices? :(
<flux> it's unix man, tools specialize :)
<pmurias> i use linux
seanmcl has joined #ocaml
ulfdoz has joined #ocaml
<hcarty> pmurias: Right - the same philosophy applies in most Linux distributions.
<hcarty> pmurias: One tool for one job
<hcarty> ocamldep and/or ocamlbuild provide dependency resolution. Things get trickier when you start to include external libraries, C, etc.
<pmurias> in a modern language i expect that if i import an installed library the compiler will find it
<hcarty> A myocamlbuild.ml or using OCamlMakefile will help a lot with handling those trickier cases.
<pmurias> only in C i have to do it myself
<hcarty> pmurias: If you use ocamlfind, it will.
<hcarty> pmurias: But you have to say which library you want it to use. There may be multiple libraries which provide the same interface, for example.
<Camarade_Tux> well, at this very moment, in ##slackware, someone is having a problem with meld which seems to be written in python, it doesn't find the library
<hcarty> The tools available for OCaml are certainly not perfect. But what we have does work well as long as each tool is used for its intended purpose.
<hcarty> meld is a very nice tool, even if it is written in Python :-)
<orbitz> even in PYTHON you have to modify PYTHONPATH if its in a non standard palce
<Camarade_Tux> I only noticed about that because somebody tried to paste a python backtrace in the channel ;-)
<mattiase`> For bigger projects, OMake is a good alternative
<hcarty> mattiase`: Is omake still maintained? I remember an announcement for a pre-release of omake with a lot of cool new features, but I haven't heard anything about it since.
<hcarty> The pre-release promised semi-automated C binding generation, among other things.
<pmurias> orbitz: in ocaml you have to explicilty link in the standard library that is mention unix.cma
<orbitz> pmurias: fact!
* pmurias gives up on trying to use obsolete languages
pmurias has left #ocaml []
<hcarty> pmurias: Unix is not considered part of the standard library. it is included with the compiler.
<mattiase`> hcarty: I'm not sure how the new release is going, but they seem to be fairly responsive in general
ikaros has joined #ocaml
<hcarty> mattiase`: That's good to know. OMake seems like a very nice project.
<orbitz> hah obsolete!
<hcarty> orbitz: I'm sure they were talking about C.
<orbitz> quite
lutter has quit [Read error: 60 (Operation timed out)]
valross has quit [Remote closed the connection]
bluestorm has joined #ocaml
h3 has joined #ocaml
h3r3tic has quit [Connection reset by peer]
jonafan_ has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
Narrenschiff has quit []
h3r3tic has joined #ocaml
h3 has quit [Read error: 104 (Connection reset by peer)]
h3 has joined #ocaml
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
travisbrady_ has joined #ocaml
travisbrady has quit [Read error: 104 (Connection reset by peer)]
travisbrady_ is now known as travisbrady
antegallya has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
tmaeda is now known as tmaedaZ
mattiase` has left #ocaml []
h3r3tic has joined #ocaml
h3 has quit [Read error: 131 (Connection reset by peer)]
jonafan_ is now known as jonafan
nb has quit [Client Quit]
nb has joined #ocaml
_andre has quit ["*puff*"]
ikaros has quit ["Leave the magic to Houdini"]
ikaros has joined #ocaml
willy_ has joined #ocaml
<willy_> hi
Associat0r has quit []
<willy_> strong error message
<willy_> # traiter calculer_gris ;;
<willy_> Characters 8-21:
<willy_> traiter calculer_gris ;;
<willy_> ^^^^^^^^^^^^^
<willy_> This expression has type couleur -> couleur but is here used with type
<willy_> couleur -> couleur
h3 has joined #ocaml
h3r3tic has quit [Read error: 104 (Connection reset by peer)]
<flux> willy_, you have redefined type couleur after defining calculer_gris
<flux> or something like that
<flux> so you have values that refer to the old couleur type and values that refer to the new one
<flux> and that doesn't work
<flux> basic solution: restart toplevel
<flux> but that's not really required, if you just redefine everything you use
<flux> one of the better ways of going is using the #use "foo.ml" -command in the toplevel
<flux> so you don't get caught in such situations, because everything is redefined
_zack has quit ["Leaving."]
<flux> another one is you use emacs and tuareg-mode, which easily allows sending not only fragments of code but also whole buffers to the toplevel
willy_ has quit [Read error: 60 (Operation timed out)]
Associat0r has joined #ocaml
cmeme has joined #ocaml
willy_ has joined #ocaml
<willy_> re
|Jedai| is now known as Jedai
<willy_> i restart emacs with tuareg mode
<willy_> they works good now
ikaros has quit ["Leave the magic to Houdini"]
ikaros has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
antegallya has quit ["Leaving"]
cmeme has quit [Connection timed out]
ulfdoz has quit [Read error: 110 (Connection timed out)]
BigJ2_ has joined #ocaml
BigJ2 has quit [Client Quit]
BigJ2_ is now known as BigJ2
BigJ has quit ["Leaving"]
BigJ has joined #ocaml
_JusSx_ has joined #ocaml
willy_ has quit ["Leaving"]
cmeme has joined #ocaml
willb has quit [Read error: 145 (Connection timed out)]
_JusSx_ has quit ["leaving"]
mpwd has joined #ocaml
ztfw has quit [Read error: 110 (Connection timed out)]
<travisbrady> anyone know how I can write to a file with bin_prot? I see it'll write to a Bigarray for me, but how do I dump that to a file?
<hcarty> travisbrady: You can use the map_file functions in the various bigarray modules.
<travisbrady> hcarty: thank you
<hcarty> travisbrady: You're welcome
Associat0r has quit []
ygrek has quit [Remote closed the connection]
Associat0r has joined #ocaml
Modius has joined #ocaml
seanmcl has quit []
mpwd has quit []
Ched has quit [Read error: 113 (No route to host)]
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
thrasibule has quit [Read error: 110 (Connection timed out)]
Associ8or has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
Associat0r has quit [Success]
munga has joined #ocaml
eldragon has joined #ocaml
bluestorm has quit [Read error: 113 (No route to host)]