adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
BitPuffin|osx has joined #ocaml
walter|r_ has joined #ocaml
manud has quit [Quit: manud]
walter|r has quit [Ping timeout: 255 seconds]
malc_ has joined #ocaml
soultadu has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
sepp2k has quit [Quit: Leaving.]
jwatzman|work has quit [Quit: jwatzman|work]
tmtwd has quit [Ping timeout: 255 seconds]
AltGr has joined #ocaml
hay207 has joined #ocaml
robogeoff has quit [Ping timeout: 246 seconds]
keen__________15 has joined #ocaml
keen__________14 has quit [Ping timeout: 246 seconds]
MrScout has quit [Ping timeout: 248 seconds]
rwmjones has quit [Ping timeout: 246 seconds]
rwmjones has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
walter|r_ has quit [Remote host closed the connection]
walter|r has joined #ocaml
drz3 has joined #ocaml
<drz3> anyone there?
walter|r has quit [Ping timeout: 250 seconds]
manud has joined #ocaml
<jyc> no
walter|r has joined #ocaml
walter|r has quit [Remote host closed the connection]
walter|r has joined #ocaml
jao has quit [Ping timeout: 248 seconds]
ygrek has quit [Ping timeout: 255 seconds]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
tobiasBo1 has quit [Ping timeout: 264 seconds]
tmtwd has joined #ocaml
swgillespie has joined #ocaml
tobiasBo1 has joined #ocaml
hay207 has quit [Ping timeout: 276 seconds]
<dmbaturin> drz3: We even have a library for this answer! https://github.com/Drup/No.
walter|r has quit [Remote host closed the connection]
waneck has joined #ocaml
<Drup> I should finish this thing x)
srcerer has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.5/20150525141253]]
srcerer has joined #ocaml
cdidd_ has quit [Ping timeout: 246 seconds]
<dmbaturin> Drup: Why didn't you use gettext or another i18n library, by the way?
mcclurmc has joined #ocaml
waneck has quit [Remote host closed the connection]
mcclurmc has quit [Ping timeout: 264 seconds]
cdidd_ has joined #ocaml
drz3 has quit []
drz3 has joined #ocaml
drz3 has quit [Excess Flood]
darkf has joined #ocaml
empyrean has quit [Ping timeout: 256 seconds]
struktured has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
mcclurmc has joined #ocaml
milosn has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
manud has quit [Quit: manud]
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
manud has joined #ocaml
MercurialAlchemi has joined #ocaml
<rgrinberg> dsheets: halp :)
manud has quit [Quit: manud]
manud has joined #ocaml
manud has quit [Quit: manud]
manud has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Bhavya has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 248 seconds]
manud has quit [Quit: manud]
malc_ has quit [Quit: leaving]
tmtwd has quit [Remote host closed the connection]
matason has joined #ocaml
milosn has quit [Quit: leaving]
ygrek has joined #ocaml
obadz has quit [Ping timeout: 265 seconds]
obadz has joined #ocaml
ygrek has quit [Ping timeout: 255 seconds]
matason has quit [Ping timeout: 256 seconds]
Haudegen has quit [Ping timeout: 252 seconds]
Haudegen has joined #ocaml
rgrinberg has quit [Ping timeout: 248 seconds]
Xebia has joined #ocaml
Simn has joined #ocaml
jonludlam has joined #ocaml
contempt has quit [Ping timeout: 252 seconds]
contempt has joined #ocaml
jonludlam has quit [Ping timeout: 248 seconds]
matason has joined #ocaml
jonludlam has joined #ocaml
jonludlam has quit [Remote host closed the connection]
sh0t has joined #ocaml
matason has quit [Ping timeout: 256 seconds]
matason has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 246 seconds]
kushal has joined #ocaml
mengu__ has joined #ocaml
oscar_toro has joined #ocaml
mort___ has joined #ocaml
thomasga has joined #ocaml
zpe has joined #ocaml
jonludlam has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
MasseR has quit [Ping timeout: 256 seconds]
sivoais has quit [Ping timeout: 250 seconds]
low-profile has quit [Ping timeout: 250 seconds]
dinosaure has quit [Ping timeout: 250 seconds]
dinosaure has joined #ocaml
frawgie_ has joined #ocaml
sivoais has joined #ocaml
frawgie has quit [Ping timeout: 250 seconds]
MasseR has joined #ocaml
low-profile has joined #ocaml
dsheets has quit [Ping timeout: 256 seconds]
Xebia has quit [Quit: Connection closed for inactivity]
kandu has quit [Remote host closed the connection]
ollehar has joined #ocaml
kandu has joined #ocaml
mengu__ has quit [Remote host closed the connection]
kandu is now known as Guest96855
Guest96855 is now known as kandu
breadmonster has joined #ocaml
<breadmonster> Hey guys.
<breadmonster> Is there a recommended book post-Okasaki?
dsheets has joined #ocaml
yomimono has joined #ocaml
ollehar has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
samrat has joined #ocaml
thomasga has quit [Quit: Leaving.]
magical-imouto has quit [Ping timeout: 252 seconds]
thomasga has joined #ocaml
magical-imouto has joined #ocaml
mort___ has quit [Quit: Leaving.]
Kakadu has joined #ocaml
thomasga has quit [Quit: Leaving.]
jao has joined #ocaml
thomasga has joined #ocaml
xkb_ has joined #ocaml
jao has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
mengu has joined #ocaml
breadmonster has quit [Quit: Leaving]
tane has joined #ocaml
hay207 has joined #ocaml
nullcat has joined #ocaml
hay207 has quit [Ping timeout: 264 seconds]
Submarine has joined #ocaml
Submarine has joined #ocaml
nullca___ has joined #ocaml
yomimono has quit [Ping timeout: 256 seconds]
_andre has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
nullcat has quit [Ping timeout: 276 seconds]
obadz has quit [Ping timeout: 256 seconds]
hay207 has joined #ocaml
obadz has joined #ocaml
Haudegen has joined #ocaml
yomimono has joined #ocaml
obadz has quit [Quit: leaving]
obadz has joined #ocaml
<chris2> there is a stackoverflow post
kushal has quit [Ping timeout: 244 seconds]
nicoo has joined #ocaml
thomasga has quit [Quit: Leaving.]
\o_ has joined #ocaml
ggole has joined #ocaml
struktured has quit [Ping timeout: 250 seconds]
kushal has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
rand000 has joined #ocaml
Haudegen has quit [Ping timeout: 276 seconds]
Haudegen has joined #ocaml
hay207 has quit [Quit: Leaving]
hay207 has joined #ocaml
pikachuyann has joined #ocaml
ben1 has joined #ocaml
orbitz has quit [Quit: moving]
hay207 has quit [Quit: Leaving]
thomasga has joined #ocaml
hay207 has joined #ocaml
Kakadu has quit [Quit: Page closed]
psy_ has quit [Ping timeout: 264 seconds]
ericsmithvt has joined #ocaml
haythammed_ has joined #ocaml
badkins has joined #ocaml
hay207 has quit [Ping timeout: 246 seconds]
xkb_ has quit [Quit: Connection closed for inactivity]
orbitz has joined #ocaml
haythammed_ has quit [Quit: Leaving]
haythammed_ has joined #ocaml
reynir has quit [Quit: WeeChat 1.1.1]
reynir has joined #ocaml
hay207 has joined #ocaml
thomasga has quit [Quit: Leaving.]
haythammed_ has quit [Ping timeout: 246 seconds]
Submarine has quit [Ping timeout: 256 seconds]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
Submarine has joined #ocaml
ericsmithvt has quit [Quit: Textual IRC Client: www.textualapp.com]
Haudegen has joined #ocaml
tmtwd has joined #ocaml
rgrinberg has joined #ocaml
ceryo has joined #ocaml
ceryo has quit [Client Quit]
ceryo has joined #ocaml
\o_ has quit [Quit: Ce n’est pas une blague, ça, c’est une corde.]
Maelan has joined #ocaml
Maelan has quit [Quit: Ce n’est pas une blague, ça, c’est une corde.]
Maelan has joined #ocaml
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Bhavya has quit [Quit: Quit the channel]
<_obad_> morning/afternoon. is there a way to get opam to rebuild a package? I need the doc for an already installed package, but opam install pkgname -d doesn't do anything. of course the obvious is to remove and reinstall but that triggers a lot of rebuilds.
<Drup> _obad_: opam reinstall
<Drup> oh, you don't want to rebuild dependencies ...
<Drup> eh. that's unsafe, so no.
thomasga has joined #ocaml
Muzer has quit [Excess Flood]
Muzer has joined #ocaml
<_obad_> hmpf :/
thomasga has quit [Client Quit]
<_obad_> I guess I'll just open ~/.opam/xxx/libs/blah/blah.mli
thomasga has joined #ocaml
<Maelan> Are there many packages that tell OPAM how to build their doc? I have almost no doc, except the ones I compiled manually (including Batteries) because I saw no other solution.
AltGr has left #ocaml [#ocaml]
jc2 has joined #ocaml
nullca___ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
<Drup> not enough, unfortunatly
jc2 has quit [Quit: Leaving.]
struk|work has joined #ocaml
ollehar has quit [Quit: ollehar]
BitPuffin has joined #ocaml
sepp2k has joined #ocaml
sh0t has joined #ocaml
mengu has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
ollehar has quit [Remote host closed the connection]
sh0t has quit [Ping timeout: 264 seconds]
swgillespie has joined #ocaml
slash^ has joined #ocaml
Submarine has quit [Quit: Leaving]
ben1 has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
ceryo has joined #ocaml
nullcat has joined #ocaml
rand000 has quit [Quit: leaving]
Hannibal_Smith has joined #ocaml
shinnya has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgrinberg has quit [Ping timeout: 246 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
ygrek has joined #ocaml
sh0t has joined #ocaml
thomasga has quit [Quit: Leaving.]
dongcarl has joined #ocaml
<dongcarl> Hi all! Just installed ocaml on my mac... invoking 'ocaml' gives me
<dongcarl> Cannot find file topfind.
<dongcarl> Unknown directive `thread'.
<dongcarl> OCAML_TOPLEVEL_PATH is
<dongcarl> `/Users/dongcarl/.opam/system/lib/toplevel`
dsheets has quit [Ping timeout: 256 seconds]
<dongcarl> help?
<ggole> Did you evaluate eval `opam config env`?
<dongcarl> yup
<dongcarl> it's in my config.fish (like .profile for the fish shell)
jwatzman|work has joined #ocaml
yomimono has quit [Ping timeout: 276 seconds]
<dongcarl> anyone?
<struk|work> dongcarl: what does your path look like now
<dongcarl> `/Users/dongcarl/.opam/system/bin /Users/dongcarl/bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin`
<dongcarl> I installed using homebrew
thegameg has quit [Ping timeout: 276 seconds]
<dongcarl> struk|work: any idea?
<struk|work> dongcarl: not really, but you seem to be misisng any version of ocaml. maybe do opam switch 4.02.1 ?
<struk|work> is in my path, for instance
<struk|work> ^ "/home/cpiccion/.opam/4.02.1/bin"
<dongcarl> peculiar
<dongcarl> my .popam folder looks like this
<dongcarl> drwxr-xr-x 13 dongcarl 442 Jul 8 00:08 ./
<dongcarl> drwxr-xr-x+ 32 dongcarl 1088 Jul 8 21:01 ../
<dongcarl> -rw-r--r-- 1 dongcarl 14 Jul 8 00:05 aliases
<dongcarl> drwxr-xr-x 63 dongcarl 2142 Jul 8 18:42 archives/
<dongcarl> drwxr-xr-x 12 dongcarl 408 Jul 8 00:05 compilers/
<dongcarl> -rw-r--r-- 1 dongcarl 86 Jul 8 00:05 config
<dongcarl> -rw-r--r-- 1 dongcarl 0 Jul 8 00:07 lock
<dongcarl> drwxr-xr-x 10 dongcarl 340 Jul 9 21:28 log/
<dongcarl> drwxr-xr-x 12 dongcarl 408 Jul 8 00:06 opam-init/
<dongcarl> drwxr-xr-x 73 dongcarl 2482 Jul 8 18:42 packages/
<dongcarl> drwxr-xr-x 5 dongcarl 170 Jul 8 00:05 repo/
<dongcarl> -rw-r--r-- 1 dongcarl 1679826 Jul 8 00:05 state.cache
<dongcarl> drwxr-xr-x 16 dongcarl 544 Jul 9 21:28 system/
<struk|work> try opam switch 4.02.1, or opam swithc 4.02.2
<struk|work> or, I'm looking for mac testers for this: https://github.com/struktured/ocaml-bootstrap
thegameg has joined #ocaml
<dongcarl> running the switch command... a little slow...
<dongcarl> I'll checkout the bootstrap when I've got things working :-)
<dongcarl> switch done
<dongcarl> it still doesn't work
iZsh has quit [Quit: ZNC - http://znc.in]
iZsh has joined #ocaml
MercurialAlchemi has joined #ocaml
psy_ has joined #ocaml
jonludlam has quit [Ping timeout: 248 seconds]
<struk|work> dongcarl: after switch, do the eval command agian
<dongcarl> yeah i did so... still doesn't work :-(
<struk|work> dongcarl: humor me..try opam install utop
<dongcarl> installing...
<dongcarl> oh wow
<dongcarl> it worked!
<dongcarl> three errors tho
<dongcarl> Cannot find file /Users/dongcarl/.opam/4.02.1/lib/ocaml/camlp4/camlp4o.cma.
<dongcarl> No such package: core.top
<dongcarl> No such package: core.syntax
<struk|work> hm, well your closer. maybe just opam install core
ygrek has quit [Ping timeout: 256 seconds]
darkf has quit [Quit: Leaving]
Submarine has joined #ocaml
Submarine has joined #ocaml
creichert has joined #ocaml
MrScout has joined #ocaml
zpe has joined #ocaml
<dongcarl> struk|work: thanks for being the most helpful guy tonight. I'll definitely try out your bootstrap once I know more
<struk|work> dongcarl: no problem. good luck ! I will respond pretty fast re: ocaml-bootstrap if you post the issueon github
ggole has quit []
Submarine has quit [Remote host closed the connection]
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
empyrean has joined #ocaml
monod has joined #ocaml
sh0t has quit [Ping timeout: 244 seconds]
ygrek has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
oscar_toro has quit [Ping timeout: 246 seconds]
oscar_toro has joined #ocaml
kushal has quit [Quit: Leaving]
thomasga has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
thomasga has quit [Client Quit]
Haudegen has quit [Ping timeout: 255 seconds]
rgrinberg has joined #ocaml
Haudegen has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Client Quit]
matason has quit [Ping timeout: 240 seconds]
swgillespie has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
monod has quit [Ping timeout: 265 seconds]
Kakadu has joined #ocaml
walter|r has joined #ocaml
billof has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
dsheets has joined #ocaml
jonludlam has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
Anarchos has joined #ocaml
jonludlam has quit [Ping timeout: 265 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sh0t has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
oscar_toro has quit [Ping timeout: 250 seconds]
oscar_toro has joined #ocaml
<dongcarl> hi guys
<dongcarl> working thru try ocaml here
<dongcarl> how do I fix this
<dongcarl> let one =
<dongcarl> let accum = ref -54 in
<dongcarl> for i = 1 to ten do accum := !accum + i done ;
<dongcarl> !accum
<dongcarl> apparantly I'm supposed to add parens
<Maelan> Yes, write (-54) or ~-54.
nullcat has joined #ocaml
<Maelan> This is because - is a binary operator in OCaml (substraction), whereas ~- is the unary negation.
<Reventlov> (subtraction)
<Maelan> Indeed
<Maelan> .
<dongcarl> I see...
<dongcarl> thanks for the help guys!
<dongcarl> woulda never guessed
<Maelan> In “ref -54”, the parser recognizes - as the binary operator and separates it from 54, although in “(-54)”, it can not be binary, thus the parser regards it as the integer literal -54.
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<dongcarl> Maelan: silly question from a Schemer... what was the justification of OCaml not using more parens? They would have served as great visual aids here
MrScout has quit [Ping timeout: 248 seconds]
MrScout has joined #ocaml
Anarchos has joined #ocaml
<Maelan> I don’t know dongcarl, I am not involved in the development of OCaml.
<dongcarl> Maelan: thanks nonetheless
<Maelan> But sure there some of the developers here.
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<maurer> The ocaml manual says there's threads now(http://caml.inria.fr/pub/docs/manual-ocaml/libthreads.html), and says 4.02 as the revision
<maurer> 4.02.1 doesn't seem to have the -thread option though. I'm building 4.02, but is that going to work?
<maurer> *4.02.2
rgrinberg has joined #ocaml
<struk|work> dongcarl: what do you mean "more parens"? It uses them only as a scoping/grouping indicator for expressions, no more, no less..is that not what you'd expect? (to be 100% accurate, it also uses parens for unit type ())
<Maelan> dongarl, I am not familiar with Scheme but when comparing S-exprs with OCaml, the main difference I see is infix operator notations and implicit priorities, and “a + b + c” is arguably easier to read than “(+ (+ a b) c)”, isn’t it?
<struk|work> one reason to * not * use them is it can easy partial function application and sometimes code maintainence is less harry
<struk|work> *hairy
<struk|work> *ease
<flux> actually scheme would use (+ a b c). but that wouldn't work in (oca)ml, as it would need a variadic function to work.
<struk|work> but as Maelan is hinting at, it's a style choice of infix vs prefix notations, to some extent
<flux> at times ocaml could do well with parens. in particular when using nested matches. of course, you can use them (or begin/end) if you want, but then it becomes a stylistic issue
<flux> I guess an official ocaml style guide would be a boon :)
<ollehar> well, if anyone would like to give a word on php and type-inference, that would be nice:
<ollehar> (specially before mods close the question >< )
<maurer> Evvvidently 4.03 is required
<dongcarl> Maelan: maurer: struk|work: flux: thanks for the discussion, understanding much more now
<dongcarl> flux: yes, an official style guide would be amazin
<flux> sadly construction of such would result in huge bikeshedding. so someone line Jane Street should just publish theirs, if they have one (and if not, make one, they probably do have a consistent style)
<struk|work> dongcarl: np..I like the parentice-less approach for function chaning (monadic) infix operations..eg.. "fun x -> blah x >>= fun y -> foo y >>| fun z -> bar z"
<struk|work> *chaining
<flux> ocaml definitely has mostly the lack of )))))))) going for it by its lack of using parens everywhere ;-)
sh0t has quit [Ping timeout: 246 seconds]
<struk|work> dongcarl: heres a personal example of mine, with some chaining: https://github.com/struktured/ocaml-prob-cache/blob/prob-calculus/src/riak_examples/riak_coin_flip.ml#L18-L28
<Maelan> flux, still, when dealing with stuff like syntax trees, since constructors are no more in a currified syntax…
<Maelan> What’s “>>|”, struk|work?
<ollehar> maurer: ocaml have had threads a long time, you're thinking of parallellism maybe?
<flux> maelan, well, syntax-wise I don't really oppose the scheme way of (non-)syntax, a statically typed scheme could be alright perhaps
swgillespie has joined #ocaml
<flux> I guess the OCaml camlp4-based scheme syntax is going to die along with camlp4 - not that I would have ever used it
<flux> and while scheme lack of syntax is ok, I still kinda prefer the one with syntax :)
<struk|work> Maelan: map operator. upon success, it will transform the succesfull result to some another type, upon failure, it just returns the failed result.
<Maelan> Oh, I did not know about the camlp4 syntax.
<flux> maelan, it should be added that >>| is nothing built into OCaml, the library struk|work used just provides such a function
<Maelan> I guessed so. :-)
hay207 has quit [Quit: Leaving]
<flux> camlp4 is 'the old' (not very old) way of providing syntax extensions; from slight extensions to completely rewriting the language
<flux> it's documented, but perhaps not very well, and it has some other issues, the most important being that the campl4 parser needs to be kept in sync with the language to allow all programs to be compiled - and sometimes when it lags a bit behind, it can prevent new programs from being compiled with camlp4 extensions
ollehar has quit [Ping timeout: 256 seconds]
<flux> so it's going to be replaced with ppx, and while ppx does allow such radical syntax changes (ie. write in a completely different language), I understand campl4 makes such operations easier
<flux> ppx is going to be the future, regardless :)
lobo has joined #ocaml
zoetus has joined #ocaml
jonludlam has joined #ocaml
<zoetus> does anyone know where i can find documentation on jane street's pa_test?
<zoetus> there isn't even a readme in the github repo?
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zoetus> the first time i ever actually saw it documented at all was in yesterday's blog post about how they are replacing it with a ppx extension
<zoetus> and the example given doesn't even compile :(
<struk|work> zoetus: got a link to that blog post?
<struk|work> zoetus: tx
<zoetus> if i try that first test expression, the compiler complains: This expression has type unit but an expression was expected of type bool
Reventlov has quit [Quit: leaving]
<zoetus> how would one fix that? anybody's guess
<flux> well, it sounds like it's expecting a predicate, ie. an expression that returns 'true' if it succeeds and 'false' otherwise...
<flux> much like assert
<flux> so how is your f defined?
<zoetus> an f wasn't given in the example, so i just tried this:
<zoetus> TEST = <:test_result< int >> ~expect:42 (41 + 1)
<zoetus> the usage of that form seems to suggest that you provide an expected value and then an actual one
<flux> I guess it seems reasonable that it should work.
<flux> look at pa_test's source?
<zoetus> yeah i guess so
<flux> alternative: produce a pretty-printed version
<flux> (I don't recall how)
MrScout has quit [Remote host closed the connection]
<zoetus> it's kind of lame that we have to do that, especially if we don't know anything about writing camlp4 extensions
<zoetus> it just seems weird to me that they spend so much time producing libraries for communal use (as well as their own) and don't even bother with a simple readme
<flux> well, they produce them for internal use
<flux> and they probably have toonnns of examples
<flux> so it's not really a problem there.
<Drup> zoetus: correction, it's *mostly* for their own
<zoetus> true
<zoetus> but they certainly seem to be interested in making it publicly available for general use
<Drup> the fact that they release it is nice and ocasionally enjoyable, but it's not the primary use, so you shouldn't expect support outside of what they need and documentation outside of what they expect
<flux> well, I think everyone would agree that it's preferable to release than not, regardless of documentation
<zoetus> many of their libraries have readmes and at least some form of documentation
<zoetus> how widely used are these libraries in the ocaml community?
<zoetus> i mean core in general
<Drup> hard to tell
<flux> btw, pa_ounit comes with example/example.ml{i,}, doesn't it explain it enough?
<zoetus> pa_ounit and pa_test are different things i think
<flux> oh
<flux> is pa_test in opam?
<flux> ah, it is
<zoetus> yeah
<flux> well, it comes with test/pa_test_test.ml
<flux> so it's maybe a bug in the example
<zoetus> you're right
<flux> it wasn't probably pulled out of any real code
<zoetus> maybe i should be using TEST_UNIT, not TEST
<flux> TEST_UNIT = <:test_eq< int >> 1 1
<zoetus> that
<flux> isn't the key using test_eq, not test_result?
ygrek has quit [Ping timeout: 246 seconds]
<zoetus> yeah maybe, i'll try that -- this test passes: TEST_UNIT "it pushes a line" = <:test_result< int >> ~expect:42 41
<zoetus> it seems like there's a handy test library hidden in here
dongcarl has quit [Quit: Linkinus - http://linkinus.com]
BitPuffin has quit [Ping timeout: 264 seconds]
<Maelan> By the way, why “assert” is not a function in OCaml?
<Drup> it could be, I think it's mostly because the typecheck treats "assert false" specially
magical-imouto has quit [Ping timeout: 240 seconds]
<Drup> typechecker*
<flux> ..so it couldn't be
<flux> I suppose you could have a distinct assert_false; though :)
<flux> but probably: I theorize ocaml didn't 'originally' have backtrace
<Drup> flux: sure it could be, it's already syntactic anyway
hay207 has joined #ocaml
<flux> so 'assert' was a nice way to produce a diagnostics that produces current module and line number
<Drup> just need to recognize "assert false" specially ...
<flux> no function can make that
<flux> personlly I've never found the need to pass 'assert' as a function to another function :)
manud has joined #ocaml
swgillespie has joined #ocaml
<Maelan> Nope, but why introduce a keyword if it is not necessary?
<flux> perhaps it was practical?
pyon has joined #ocaml
<flux> let's say you didn't have a backtrace in ocaml.
ollehar has joined #ocaml
<flux> how would you implement a useful 'assert'?
<Maelan> I also thought than since assert is a keyword, it might have fancy syntax rules that would allow us to write “assert a = b” with no parentheses.
<flux> and how about (assert a) = b?
<flux> well, it doesn't actually make a lot of sense in that case :)
<flux> but it does make sense in the assert false case
<Maelan> flux, something like « let assert b = if not b then raise Assert_failure », given that you can retrieve the location of the failure with the backtrace?
<flux> maelan, so my theory was that many moons ago, in ocaml 1.0, there was no backtrace, but there was a need for assert
<flux> and thus assert was born
<Drup> flux: in caml light*
<flux> these days, one could have an almost assert with plain functions, by making use of back traces
<flux> (except back traces can be disabled due to performance reasons)
<Maelan> I understood that.
<flux> maelan, so it doesn't really make a lot of sense to change the functionality of 'assert' in later versions for no benefit I can see
<Maelan> Yeah, sure.
<flux> the back trace mechanism is by default in fact disabled, as you may have noticed :)
Reventlov has joined #ocaml
<flux> maelan, I guess you did notice that your function wouldn't work similarly as 'assert false' does now?
<Maelan> Yeah, it always fails even with debug mode off, isn’t it?
<flux> nope. the key is the return type.
<flux> assert false has the same return type as failwith "aiee", that is, 'a.
<flux> this allows this kind of code to compile: let divide a b = if b <> 0 then a / b else assert false
<Maelan> What would we do that instead of « let divide a b = assert (b <> 0); a / b » ?
MrScout has joined #ocaml
<flux> well, for example: let unimplemented argument = assert false
<ollehar> any comment about this?
<ollehar> "I would not want to use a linting system where the parameter types are inferred by how they are called, seems backwards to me"
<ollehar> inferring function signatures from usage should be ok, no?
<ollehar> unambigiuos
<flux> or: match Case1 when x > 0 -> .. | Case2 when x < 0 -> .. | Case1 | Case2 -> assert false
<Drup> depends how much subtyping/polymorphism you have in your system
<Drup> but it's quite regular to do it
<flux> in fact that's probably a relatively common use: handling impossible match cases the compiler cannot see are impossible
ceryo has quit [Quit: Textual IRC Client: www.textualapp.com]
MercurialAlchemi has quit [Ping timeout: 265 seconds]
zoetus has quit [Ping timeout: 246 seconds]
accidus has joined #ocaml
accidus_benartiu has joined #ocaml
Reventlov has quit [Quit: leaving]
tmtwd_ has joined #ocaml
tmtwd has quit [Read error: Connection reset by peer]
<ollehar> Drup: was that for me?
<Drup> yes
<ollehar> ah, thanks! :)
<ollehar> I'm talking about php still
<ollehar> sounds like it's worth a try
<Drup> I mean, every ml system in the world is doing it
<Drup> (fun f -> f 3)
<ollehar> really? ok then.
<ollehar> right
<Drup> you just infered the type of f according to how it's called ...
<Drup> the thing is, this is completely incompatible with overloading
tane has quit [Quit: Verlassend]
<Drup> and a lot of imperative languages have method/operator overloading
<ollehar> ok, but there is no overloading in php anyway
<Drup> but you have subtyping and variadic, don't you ?
<ollehar> in the class system?
<Drup> doesn't matter
<ollehar> yeah, variadics might have to go. I want a subset anyway.
<ollehar> subtyping with inheritance should be able to infer, but with scalars?
<ollehar> *a subset of php
ygrek has joined #ocaml
Reventlov has joined #ocaml
<ollehar> well, thanks for your input, always useful.
MrScout has quit [Ping timeout: 248 seconds]
MrScout has joined #ocaml
Simn has quit [Quit: Leaving]
nullca___ has joined #ocaml
nullcat has quit [Ping timeout: 255 seconds]
ollehar has quit [Quit: ollehar]
tmtwd_ has quit [Ping timeout: 256 seconds]
mengu has joined #ocaml
lobo has quit [Quit: leaving]
badkins_ has joined #ocaml
MrScout has quit [Remote host closed the connection]
badkins has quit [Ping timeout: 265 seconds]
<_obad_> anyone familiar with lacaml?
jao has joined #ocaml
MrScout has joined #ocaml
pyon has quit [Quit: I have irrefutable proof that D < 0. It follows trivially from 2D > 3D, which is obviously true.]
tmtwd_ has joined #ocaml
pyon has joined #ocaml
Kakadu has quit [Remote host closed the connection]
thomasga has joined #ocaml
badkins_ has quit []
MrScout has quit [Remote host closed the connection]
systmkor has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
<ygrek> _obad_, don't ask to ask - ask
mengu has quit [Remote host closed the connection]
jao has quit [Ping timeout: 244 seconds]
walter|r has quit [Remote host closed the connection]
walter|r has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
walter|r has quit [Ping timeout: 240 seconds]
madroach has joined #ocaml
hay207 has quit [Quit: Leaving]
billof has quit [Ping timeout: 252 seconds]
thomasga has quit [Quit: Leaving.]
<_obad_> alright, I don't see a way of adding a constant to a vector other than creating a constant vector of the same size. I tried using a vector of size 1 and setting the increment 0 but that got rejected.
mengu has joined #ocaml
tmtwd_ has quit [Ping timeout: 250 seconds]