<Drup>
well, I had to, everyone was doing it wrong behind my back and I had to come fix it after xD
BitPuffin has quit [Ping timeout: 244 seconds]
<rgrinberg>
imo that jwz quote about regular expressions applies to functors as well
<Drup>
?
<rgrinberg>
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
<Drup>
:D
joe____ has quit [Client Quit]
<Drup>
rgrinberg: you can apply that pretty much to every advanced OCaml feature, in fact
<Drup>
Functors, GADTs, polymorphic variants and phantom types
q66 has quit [Quit: Leaving]
<rgrinberg>
yeah, i recall there was a paper that studied open source ocaml code in the wild and lamented the fact that software such as mldonkey doesn't really use advanced features of OCaml such as functors
<rgrinberg>
and concluded that the authors of such software must not know ocaml very well b/c they only used the simplest features
<Drup>
ahah
<Drup>
fabrice lefessant is very happy to say, everytime he can, that he uses only caml light.
shinnya has quit [Ping timeout: 250 seconds]
<rgrinberg>
ugh, my eyes are being tortured by the backslashitis in all of your netstring-pcre usage
samrat has quit [Quit: Computer has gone to sleep.]
siddharthv_away is now known as siddharthv
struktured has quit [Ping timeout: 258 seconds]
siddharthv is now known as siddharthv_away
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 258 seconds]
manud__ has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
darkf_ is now known as darkf
AlexRussia has quit [Quit: WeeChat 1.1-dev]
samrat has joined #ocaml
manud__ has quit [Quit: Be back later ...]
manud__ has joined #ocaml
manud__ has quit [Ping timeout: 250 seconds]
psy has quit [Remote host closed the connection]
<laheadle>
so what is the state of the art in debugging js_of_ocaml programs? I use print statements...
psy has joined #ocaml
psy has quit [Max SendQ exceeded]
psy has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
MercurialAlchemi has joined #ocaml
<AltGr>
I'm longing for the day I can drop <4.02 compatibility and use 'match with exception'
<ggole>
It sure is nicer.
<AltGr>
Quite elegant, yes
manud__ has joined #ocaml
<AltGr>
but that's not gonna happen soon, at the moment OPAM is still supporting 3.12.1
siddharthv_away is now known as siddharthv
manud__ has quit [Ping timeout: 240 seconds]
boogie has joined #ocaml
ia0 has quit [Quit: leaving]
ia0 has joined #ocaml
ygrek has joined #ocaml
<adrien>
same, it's really the extension I want most
<adrien>
I might have two wait for something like two years however :P
pierpa has quit [Ping timeout: 244 seconds]
jgjl has joined #ocaml
<nicoo>
to wait*
<nicoo>
adrien: You need more coffee
<adrien>
well, the ocaml in debian and others for the next two years is going to be 4.01, not 4.02
<adrien>
no way around it
<flux>
rgrinberg, well, I and someone else here tried to detach some feature from mldonkey to a separate library (I tried extracing its torrent parser) and found the task formidable
<flux>
rgrinberg, it was so tightly bound inside, even though in practice it could have been completely separate
<flux>
maybe nowadays the task would be easier, with the power of merlin!
<flux>
but I don't really have need for a torrent parser at the moment :)
<adrien>
argh, right, "to", not "two"
<adrien>
more tea*
<flux>
yes :)
<flux>
thought there was at least one actual typo as well..
zwer_b has quit [Remote host closed the connection]
zwer_b has joined #ocaml
pgomes has joined #ocaml
hanso_ has quit [Quit: Page closed]
manud__ has quit [Quit: Be back later ...]
ygrek has quit [Ping timeout: 256 seconds]
chambart has joined #ocaml
<whitequark>
pp usually means pre-processor
samuel02 has joined #ocaml
<Drup>
whitequark: about the WTFPL, people previously invoked the "blabla offensive language in a corporate environment blabla" argument at me, which is completely the wrong argument. =')
<whitequark>
nah, it's simpler
<whitequark>
the language just isn't right, and you run into problems trying to redistribute
<whitequark>
also, no disclaimer of implicit warranty
<Drup>
yes, I know
<whitequark>
implied*
samuel02 has quit [Remote host closed the connection]
demonimin has quit [Ping timeout: 272 seconds]
demonimin has joined #ocaml
badon has quit [Ping timeout: 250 seconds]
<Leonidas>
yeah, it is basically a "license? fuck you, whatever"-license
mort___ has joined #ocaml
<whitequark>
pretty much equivalent to no license at all.
lordkryss has joined #ocaml
thomasga has quit [Quit: Leaving.]
<Leonidas>
at least it doesn't say that the code can only be used for good and not evil.
badon has joined #ocaml
Thooms has joined #ocaml
<Leonidas>
hopefully contributing patches to llvm is not too hard, we are starting to accumulate them
<Drup>
Leonidas: Somebody told me recently than in france, a "no warranty" is not valid, so you are supposed to put something "Is not authorized to be used in application that can endanger human life"
<Leonidas>
Drup: I wouldn't be surprised if this wasn't the same in Germany.
<Leonidas>
*was
<Leonidas>
but I think it was a differenciation whether the author of the code got paid, since afair you are not required to give a warranty for something you give away freely.
<Leonidas>
s/freely/for free/.
<pdewacht>
buy something from ibm, and you get permission to use jslint for evil as a bonus
<ggole>
Specifically, "The CAMLprim macro expands to the required compiler directives to ensure that the function is exported and accessible from OCaml."
thomasga has quit [Quit: Leaving.]
Haudegen has quit [Remote host closed the connection]
<Leonidas>
I had the impression that it was a legacy macro, but seems I was wrong
<ggole>
It may never contain anything, but there's some risk of breakage and little cost for adding it.
<Leonidas>
yup, I'd agree
<Leonidas>
will probably add it back to my code soon
thomasga has joined #ocaml
dalai has joined #ocaml
<adrien>
Drup, Leonidas : look at VLC's handling of licenses in doubt
<adrien>
also
<adrien>
stuff that might endanger real-life is going to require some certs
<adrien>
it's the absence of counter-arguments that is needed
dalai has left #ocaml [#ocaml]
Guest54806 has joined #ocaml
Guest54806 has quit [Client Quit]
<thomasga>
any idea how to add comments in an _oasis file?
darkf_ is now known as darkf
OnkV has joined #ocaml
<Drup>
thomasga: start with #
<companion_cube>
# foobar I think
<Drup>
iirc
<thomasga>
ha yes, # works
<thomasga>
thanks! (this is not in the docs …)
OnkV is now known as Haudegen
nojb has joined #ocaml
pparkkin has quit [Ping timeout: 240 seconds]
chambart has quit [Ping timeout: 256 seconds]
psy has quit [Remote host closed the connection]
jabesed has quit [Remote host closed the connection]
Hannibal_Smith has quit [Quit: Sto andando via]
psy has joined #ocaml
samuel02 has joined #ocaml
bezirg has quit [Remote host closed the connection]
samuel02 has quit [Read error: Connection reset by peer]
jabesed has joined #ocaml
samuel02 has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
shinnya has joined #ocaml
jabesed has quit [Remote host closed the connection]
jabesed has joined #ocaml
Thooms has joined #ocaml
jabesed has quit [Remote host closed the connection]
yarl_ has joined #ocaml
thomasga has quit [Quit: Leaving.]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
samrat has joined #ocaml
tane has joined #ocaml
slash^ has joined #ocaml
struktured has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
pparkkin has joined #ocaml
hyperboreean has joined #ocaml
pparkkin has quit [Ping timeout: 240 seconds]
slash^ has joined #ocaml
t4nk639 has joined #ocaml
<t4nk639>
Hello
chambart has joined #ocaml
<t4nk639>
What would be the best way for syntax checking a simple OCaml expression given as a string?
<t4nk639>
e.g. "(x*(3+3))"
<t4nk639>
Would give false, as x hasnt been defined
<t4nk639>
But "let x = 1 in (x*(3+3))" would be true
<nojb>
you can use the compiler-libs library to access the ocaml typechecker
mcclurmc has joined #ocaml
<t4nk639>
Can I have an example? :)
<nojb>
no :)
<t4nk639>
:(
<nojb>
is not completely trivial - you can look at the implementation of utop for inspiration
<nojb>
you first have to parse your input and then call the typechecker
<t4nk639>
Would that be the best way of doing this?
<t4nk639>
We are also given the string as a type
<nojb>
the *only* way to do it, as far as I know
<t4nk639>
Ok, thats for a string though
<t4nk639>
We are also given, like a type
<t4nk639>
( Let ("x", Val 1, Prod (Var "x", Sum (Val 3, Val 3)))) = "(let x=1 in (x*(3+3)))"
<t4nk639>
does that make sense? :)
<nojb>
you mean you are given an ast of the expression ?
<t4nk639>
we are given
<t4nk639>
type exp = | Val of int | Var of string | Sum of exp * exp | Prod of exp * exp | Let of string * exp * exp ;;
<t4nk639>
Which defines a new type which holds an expression
<t4nk639>
Does this make it easier to syntax check?
<nojb>
yes - it is pretty easy
<t4nk639>
ah :)
<nojb>
it is an exercise
<t4nk639>
We could use the string or the type, I thought string would be easier
<t4nk639>
Yeah, came here looking for tips :P
<t4nk639>
or hints
<t4nk639>
Starting learning ocaml this year, Im getting the hang of it but this question has me stumped
<t4nk639>
xD
<nojb>
there are (too) many places online that will show you how to do this
<t4nk639>
Whats what i am trying to do called?
mcclurmc has quit [Ping timeout: 264 seconds]
<t4nk639>
So I can research it
<nojb>
look for tutorial for writing interpreters of lambda calculus, mini haskell, mini ml, etc. …
<t4nk639>
Ah ok :D
<t4nk639>
So I should be trying to maniplulate the inputted data type, not the string
<whitequark>
nojb: I would not recommend looking at utop for this
<nojb>
whitequark: for this it would definitely be overkill, yes.
<whitequark>
the relevant source has a fair amount of incidental complexity that is irrelevant for this case
<whitequark>
and it is not easy to read
mcclurmc has joined #ocaml
jgjl has joined #ocaml
<t4nk639>
I should try to check if something has been defined before using it?
mcclurmc_ has joined #ocaml
<t4nk639>
Its just the complexity of the data type that is confusing me. So far we have used used basic types like type day = Mon | Tue | Wed ...
mcclurmc has quit [Ping timeout: 250 seconds]
octachron has joined #ocaml
larhat has quit [Quit: Leaving.]
t4nk639 has quit [Ping timeout: 246 seconds]
t4nk432 has joined #ocaml
mcclurmc_ has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ocaml
milosn has quit [Remote host closed the connection]
kapil__ has quit [Quit: Connection closed for inactivity]
thomasga has joined #ocaml
darkf has quit [Quit: Leaving]
octachron has quit [Quit: Leaving]
expo873 has quit [Quit: Connection closed for inactivity]
struktured has quit [Ping timeout: 258 seconds]
mcclurmc_ has joined #ocaml
rand000 has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
samuel02 has quit [Remote host closed the connection]
<struktured>
companion_cube: I noticed there's no CCFloat, Double, or Decimal. Is that intentional?
t4nk432 has quit [Ping timeout: 246 seconds]
<companion_cube>
it's just I never took the time to write them (I don't use floats much)
EClaesson has quit [Read error: Connection reset by peer]
EClaesson has joined #ocaml
<struktured>
companion_cube: so would u take a pr for one at least?
<companion_cube>
sure
<struktured>
companion_cube: cool may do that. thanks
<whitequark>
Double?
<whitequark>
float is double-precision
<mrvn>
ocaml float
rgrinberg has joined #ocaml
ysz has joined #ocaml
ysz has quit [Client Quit]
<struktured>
whitequark: sure just saying theres no CCX for X equal to some realish numerical value
mcclurmc_ has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
matason has quit [Quit: Leaving...]
milosn has joined #ocaml
matason has joined #ocaml
ysz has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
samrat has quit [Quit: Computer has gone to sleep.]
matason has quit [Quit: Leaving...]
pparkkin has joined #ocaml
ysz has quit [Quit: This computer has gone to sleep]
matason has joined #ocaml
pparkkin has quit [Ping timeout: 265 seconds]
tharugrim has quit [Ping timeout: 256 seconds]
tharugrim has joined #ocaml
matason has quit [Quit: Leaving...]
pyon has joined #ocaml
manizzle has joined #ocaml
Hannibal_Smith has joined #ocaml
chambart has quit [Ping timeout: 255 seconds]
kakadu has quit [Quit: Page closed]
chaptastic has joined #ocaml
samrat has joined #ocaml
badkins has joined #ocaml
ysz has joined #ocaml
ysz has quit [Client Quit]
<struktured>
is there a typical way in ocaml to generate an integer hash code for float?
<Drup>
Hashtbl.hash ?
<struktured>
Drup: works for me. thanks.
<Drup>
I like this kind of questions, it's easy to answer :]
<reynir>
huh, Hashtbl.hash works on functions
<ggole>
You can also get the bits of a float if you need to
mcclurmc has joined #ocaml
<struktured>
ggole: I had that originally but won't it truncate half the bits ultimtaely?
<Drup>
reynir: it works on pretty much anything, I think
<ggole>
Well, you get them by sticking them in an Int64.t
<ggole>
If you end up needing to truncate them, then ok
<Drup>
ggole: and then hashing it ? :D
<ggole>
But the hash can make use of the bits
<struktured>
ggole: yeah but then I need to go to plain old , which I assume is 32. is that wrong?
<ggole>
Not as long as you do the hashing first
<struktured>
ggole: plain old int, that is
<struktured>
ggole:ok, might as wel llet Hashtbl.hash do the work for me it seems
<ggole>
But you should probably just use Hashtbl.hash unless perf is a big deal (and maybe even then)
<reynir>
I didn't think it would work on functions since you can't compare them for equality
<ggole>
Hashtbl.hash might also be smart about floats, eg, -0.0 and 0.0 give the same hash
<Drup>
nicoo: how do function get hashed ?
<ggole>
But different bits
<ggole>
Same with NaN payloads, etc
yarl_ has quit [Quit: Quitte]
tane has quit [Quit: Verlassend]
mcclurmc has quit [Ping timeout: 255 seconds]
q66 has joined #ocaml
badkins has quit []
kakadu has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
nojb has quit [Quit: nojb]
rgrinberg has joined #ocaml
ddosia has joined #ocaml
mcclurmc has joined #ocaml
pparkkin has joined #ocaml
<ddosia>
Hello. Is this code optimized somehow: (x mod 4 = 0) && (not (x mod 100 = 0) || (x mod 400 = 0)) so if first clause is false other will not be computed?
contempt has quit [Ping timeout: 245 seconds]
mcclurmc has quit [Ping timeout: 240 seconds]
<Drup>
yes
pparkkin has quit [Ping timeout: 264 seconds]
martintrojer has quit [Remote host closed the connection]
<flux>
ddosia, it's not really an optimization but rather the semantics of the && and || operators, which is called shortcutting
<ddosia>
if there was function call with side effects?
<ddosia>
instead of simple arithmetic?
<mrvn>
then you have to do: let x = ... in let y = ... in x && y
rgrinberg has quit [Quit: Leaving.]
<ggole>
ddosia: the side effects would be short-circuited
martintrojer has joined #ocaml
<ggole>
(Unless you did what mrvn suggested and lift them out.)
rgrinberg has joined #ocaml
<ddosia>
understood. this is only works with boolean expression, or compiler could optimize other things, so some functions with side effects may not be called?
<Drup>
only with && and ||
<ggole>
Well, things inside functions (or lazy) won't execute until you call or force them
<ggole>
That's... not really best thought of as "optimisation" though
dsheets_ has quit [Ping timeout: 244 seconds]
samuel02 has joined #ocaml
samuel02 has quit [Ping timeout: 250 seconds]
contempt has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
<reynir>
are there eager boolean operators?
<Drup>
let b' = .. in b && b'
<Drup>
:D
<mrvn>
ket (&&) x y = x && y
<mrvn>
let
<mrvn>
or does that get wrongly optimized to lazy after inline?
Hannibal_Smith has quit [Quit: Sto andando via]
<Drup>
stop playing with side effects evaluation order.
bytbox has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 265 seconds]
contempt has joined #ocaml
contempt has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
struktured has joined #ocaml
kakadu_ has joined #ocaml
davine has joined #ocaml
kakadu has quit [Ping timeout: 258 seconds]
davine has quit [Client Quit]
samrat has quit [Quit: Computer has gone to sleep.]
ggole has quit []
rgrinberg has joined #ocaml
contempt has joined #ocaml
larhat has joined #ocaml
larhat1 has joined #ocaml
dsheets_ has joined #ocaml
dsheets_ has quit [Read error: Connection reset by peer]
larhat has quit [Ping timeout: 265 seconds]
pparkkin has joined #ocaml
contempt has quit [Ping timeout: 258 seconds]
pparkkin has quit [Ping timeout: 256 seconds]
ddosia has quit [Quit: Leaving.]
chambart has joined #ocaml
contempt has joined #ocaml
igstan has joined #ocaml
igstan has quit [Client Quit]
nojb has joined #ocaml
<MercurialAlchemi>
how do you insert a double quote in an ocamldoc comment?
thomasga has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
<Unhammer>
TIL that Dom_html.element inherits from Dom.element which inherits from Dom.node … that makes things a lot clearer. I should learn this OOCaml stuff some day =P
<MercurialAlchemi>
isn't this chain of inheritance always the case for DOM data, regardless of the language?
<Drup>
Unhammer: oh, you didn't notice ?
<Drup>
that explains the amount of confusing :D
<Unhammer>
sounds likely
<Drup>
confusion*
<Unhammer>
both
rgrinberg has joined #ocaml
contempt has quit [Ping timeout: 272 seconds]
milosn has quit [Quit: Lost terminal]
contempt has joined #ocaml
manud__ has joined #ocaml
badkins has joined #ocaml
manud__ has quit [Quit: Be back later ...]
t4nk606 has joined #ocaml
<t4nk606>
hey
<t4nk606>
im new to ocaml can anyone suggest me a way to add a list of binaries
tharugrim has quit [Remote host closed the connection]
pparkkin has joined #ocaml
<mrvn>
That question makes no sense
pparkkin has quit [Ping timeout: 255 seconds]
contempt has quit [Ping timeout: 264 seconds]
<flux>
I must agree with that..
rgrinberg has quit [Ping timeout: 272 seconds]
slash^ has quit [Read error: Connection reset by peer]
contempt has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
badkins has quit [Read error: Connection reset by peer]
kakadu_ has quit [Remote host closed the connection]
contempt has quit [Ping timeout: 240 seconds]
rand000 has quit [Quit: leaving]
bytbox has joined #ocaml
contempt has joined #ocaml
rgrinberg has joined #ocaml
johnf has quit [Read error: Connection reset by peer]
contempt has quit [Ping timeout: 265 seconds]
chambart has quit [Read error: Connection reset by peer]
chambart has joined #ocaml
contempt has joined #ocaml
<t4nk606>
i want to go from bool list list to bool list
chambart has quit [Ping timeout: 264 seconds]
contempt has quit [Ping timeout: 264 seconds]
badkins has joined #ocaml
<whitequark>
List.concat
contempt has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
stephen_ has joined #ocaml
contempt has quit [Ping timeout: 255 seconds]
badkins has quit []
pparkkin has joined #ocaml
expo873 has joined #ocaml
igstan has joined #ocaml
pparkkin has quit [Client Quit]
<stephen_>
Hey guys, I'm compiling the why3 package on debian. Configure runs fine, but the makefile is reporting that there are a bunch of .a files missing. It compiles fine but, then fails after compliation with "Error: Unbound module Big_int_Z". Here's my pastebin. http://pastebin.com/5P2qQa4G
samuel02 has joined #ocaml
<stephen_>
Ideas?
rgrinberg1 has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
<flux>
plenty. about what, in particular?-)
<stephen_>
flux: well how to fix the build would be a great start
<stephen_>
So it looks like it fails while linking lib/ocaml/why3__BigInt_compat.cmx
Arsenik has quit [Remote host closed the connection]
samuel02 has quit [Remote host closed the connection]
<Drup>
stephen_: one way or the other, you seem to lack the num library (which is supposed to be distributed with ocaml)
<Drup>
or why3's makefile is buggy and they forgot to link it, but I doubt it