gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
ymasory has quit [Quit: Leaving]
_habnabit has quit [Ping timeout: 276 seconds]
chicco has quit [Read error: Operation timed out]
BiDOrD_ has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
Edward has quit []
companion_cube has quit [Ping timeout: 255 seconds]
chicco has joined #ocaml
_habnabit has joined #ocaml
companion_cube has joined #ocaml
arubin has joined #ocaml
<thelema> is it a bug that numeric_compare "abc5123" > "abc500122"?
joewilliams is now known as joewilliams_away
<mrvn> it probably doesn't pare that as "abc" 5123 same as pretty much all compares.
<mrvn> s/pare/parse/
<mrvn> What you want is version_compare, as in how dpkg compares versions.
<thelema> mrvn: actually, the (original) point of that code was to deal with filenames numbered without leading zeros
<thelema> and it looks like quicktest has found another bug in that code. (the previous bug was fixed at the same time the quickcheck tests were added
<thelema> )
tauntaun has quit [Quit: Ex-Chat]
elehack has joined #ocaml
<mrvn> thelema: normal numeric compares only work on the leading numbers. 5123abc and 500122abc would sort.
<mrvn> That has annoyed me a lot of times in the past.
lopex has quit []
<thelema> I'm talking about BatString.numeric_compare, yes?
<mrvn> well, happy fixing.
<thelema> thanks.
<thelema> I'll see if I can come up with the proper implementation of this, which I don't think is version_compare
<thelema> although I've not checked
<thelema> nope, although maybe I'm stuck on the change_flip from earlier, as I can imagine using it to solve this problem
<mrvn> you need to split the string into numeric and non numeric parts and then compare them in turn. type numstr = Str of string | Num of int and then compare numstr lists.
<mrvn> if you want to support numbers larger than int then it becomes more complex.
sepp2k has joined #ocaml
<thelema> I guess I can catch int_of_string failures and... bigint? :) probably easier to just emulate a numeric compare by comparing length first (after stripping leading zeros)
<mrvn> thelema: store numbers as char list in reverse order :)
<mrvn> "ab123cd" -> [Str "ab"; Num ['3';
<mrvn> '2'; '1'; ]; Str "cd"]
<mrvn> nah, forget that. stupid idea,
<thelema> but that doesn't get me a numeric compare...
<mrvn> you need something to make the numbers the same length or emulate that for the compare.
<thelema> well, the easiest fix is to have my current algorithm back up to find the start of the number before converting to int
<mrvn> add leading 0 to make the length the same and then just compare alphabetically.
<thelema> currently I scan forward to find the first different character, if it's a number, convert to int and compare that instead
<thelema> all I have to do is back up to the start of the number so I don't drop leading nonzero digits
<mrvn> thelema: abc123 abc1234? Do you comapre 4 to ""?
<thelema> I convert "4" and "" to integer - I guess "" converts to 0
<thelema> or not. if I run out of characters, I decide right there, same as for normal compare
<thelema> same as "abc" vs. "abcd"
Modius has joined #ocaml
<thelema> except maybe I return the wrong one...
<mrvn> you indeed need to backtrack there
<mrvn> or track forward to the next non digit and then compare back.
<thelema> I already have code to track forward to the next non-digit, I just need to back up digits first
npouillard has quit [Ping timeout: 272 seconds]
npouillard has joined #ocaml
<thelema> wow I'm a bad coder - if the difference between the strings is not a number in one of the strings, I compare the whole strings again
<thelema> as opposed to comparing just the two characters
<thelema> and I cheat poorly for strings of equal length
<thelema> "abc10" < "abc1a"
<mrvn> nope
npouillard has quit [Ping timeout: 260 seconds]
npouillard has joined #ocaml
<elehack> the test extractor requires a trailing space after (**T - is that intentional or a bug?
<thelema> elehack: intentional, mostly. You should label the test on that same line
<thelema> it also cuts down on falsely identifying tests from comments like (**This is a comment **)
<elehack> Ahh, gotcha.
<thelema> (**T test_name
<thelema> there's a number of improvements to be made in test generation, not least of which is embedding the source location in the output file so compile errors don't go to the _t.ml file
<thelema> also test_name must be a valid ocaml identifier - currently , is allowed and causes a nasty compile error
Amorphous has quit [Ping timeout: 272 seconds]
<elehack> I noticed that - I had spaces, and the resulting file was not correct.
<thelema> probably should s/ /_/g those for convenience
<elehack> That could be useful.
<elehack> I was just working on #114 - dealing with the stdlib's additions to Map.
<elehack> turns out we can't be compatible with them, due to incompatible definitions of filter :(
<thelema> :( what's the difference, just argument order?
<elehack> the filtering function takes both key and value in stdlib, only value in BatMap.
<elehack> probably something to fix for 2.0 - client code can always ignore the key, and the key can be useful.
<thelema> for now, a filter_stdlib function that's compatible seems reasonable (or another name)
<elehack> ok.
<elehack> I'm also introducing a BatMap.BASIC signature.
Amorphous has joined #ocaml
<thelema> BASIC? like GWBASIC?
* mrvn repsonds with BatMap.COMPLEX
rossberg has quit [Ping timeout: 272 seconds]
<elehack> this signature is compatible with the 3.11 stdlib Map.S, and BatMap.S now includes it.
<elehack> so APIs can have easy access to a signature that is satisfied by the stdlib's Map (or by ptmap.ml)
<elehack> found this to be an issue when I tried rebuilding my main school codebase on 3.12 today.
rossberg has joined #ocaml
<elehack> looks like we already have an stdlib-compatible filter function - filteri.
<elehack> lol
* elehack is open to alternative names
<thelema> use your best judgement, I/we'll adjust anything needing it, and we'll have a discussion if there's conflict between what people believe correct
<elehack> sounds good
khia0 has joined #ocaml
khia0 has left #ocaml []
myu2_ has quit [Remote host closed the connection]
elehack has quit [Quit: Farewell, programs.]
myu2 has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
ModusPwnens has joined #ocaml
myu2 has quit [Remote host closed the connection]
arubin has quit [Quit: arubin]
eye-scuzzy has quit [Ping timeout: 245 seconds]
eye-scuzzy has joined #ocaml
<ModusPwnens> so i have to write an interpreter for class, but I'm confused about a few concepts.
<ModusPwnens> Anyone willing to tackle this?
ulfdoz has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
tnguyen has joined #ocaml
ulfdoz has joined #ocaml
Snark has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
myu2 has joined #ocaml
Yoric has joined #ocaml
cyanure has joined #ocaml
seafood has joined #ocaml
cyanure has quit [Quit: Quitte]
sepp2k has quit [Quit: Leaving.]
myu2 has quit [Remote host closed the connection]
seafood has quit [Quit: seafood]
ygrek has joined #ocaml
Yoric has quit [Quit: Yoric]
tnguyen has quit [Remote host closed the connection]
eb4890 has joined #ocaml
myu2 has joined #ocaml
ikaros has joined #ocaml
Associat0r has joined #ocaml
boscop has joined #ocaml
oriba has joined #ocaml
flux has quit [Read error: Operation timed out]
flux has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
edwin has joined #ocaml
oriba has quit [Quit: Verlassend]
mnabil has joined #ocaml
Yoric has joined #ocaml
eb4890 has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
ModusPwnens has quit []
ttamttam has joined #ocaml
lopex has joined #ocaml
ikaros_ has joined #ocaml
tauntaun has joined #ocaml
ikaros has quit [Ping timeout: 260 seconds]
seafood has joined #ocaml
CoryDambach has quit [Read error: Connection reset by peer]
CoryDambach has joined #ocaml
seafood has quit [Quit: seafood]
boscop has quit [Ping timeout: 240 seconds]
boscop has joined #ocaml
kaustuv has joined #ocaml
tauntaun has quit [Ping timeout: 240 seconds]
<thelema> kaustuv: what are mink and maxk for?
myu2 has quit [Remote host closed the connection]
<thelema> also, watch out on your assert_equal_enums - you've consumed the head of the enums already by comparing them, I think
onigiri__ has joined #ocaml
onigiri__ has left #ocaml []
tauntaun has joined #ocaml
hto has quit [Ping timeout: 240 seconds]
pdhborges has joined #ocaml
<pdhborges> hi, is anyone familiar with oasis
<pdhborges> ?
ankit9 has joined #ocaml
<gildor> pdhborges: I am
<pdhborges> hi, I'm trying to build a library with csources
<pdhborges> the problem is when I declare a path as a csource
<pdhborges> that path isn't recognized
<gildor> CSources need to be .h or .c files
<pdhborges> for example
<gildor> you need to add ,
kiyoto has joined #ocaml
<pdhborges> dam didn't realise that
<pdhborges> thanks!
kiyoto has left #ocaml []
<gildor> the error message is maybe not clear, you can submit a bug about that to the BTS of oasis
<gildor> (with the error message and your oasis file)
<pdhborges> okay
ygrek has quit [Ping timeout: 240 seconds]
<kaustuv> thelema: I have transcribed test_pmap.ml without looking at the underlying logic
<kaustuv> I dunnot what mink is (should probably be removed), but maxk is the bound given to BatRandom.State.enum_int
<kaustuv> PS, the BatRandom[.State].enum_foo functions are *undocumented*
<kaustuv> thelema: as far as I can tell, there is no logic error in assert_equal_enums. The enum_1 and enum_2 are *thunks*, not enums themselves.
<kaustuv> thelema: perhaps https://github.com/chaudhuri/batteries-included/commit/9fe9d3ed776820db23a2c7586090749a227ebe01 is better because the testing code is textually identical to test_pmap
Associat0r has quit [Quit: Associat0r]
<pdhborges> well since we have some batteries experts here would someone explain me how to use the print functions for the data structures?
yezariaely has joined #ocaml
<kaustuv> pdhborges: The functions in BatPrintf should be able to use them
<pdhborges> so they aren't meant to be used alone
Modius has quit [Quit: "Object-oriented design" is an oxymoron]
<kaustuv> Well, you can if you want. They have fairly simple signatures.
<kaustuv> But you can also do things like:
<kaustuv> # BatPrintf.sprintf2 "enum is [%a]" (BatEnum.print BatInt.print) (BatList.enum [1; 2; 3]) ;;
<kaustuv> - : string = "enum is [1 2 3]"
<pdhborges> I don't find them all that simple
<pdhborges> ?first:string -> ?last:string -> ?sep:string -> ('a BatIO.output -> 'b -> unit) -> 'a BatIO.output -> 'b t -> unit
<pdhborges> first last sep are easy
<pdhborges> but the
<pdhborges> it takes another function as argument
<pdhborges> the I assume thee is the channel
<pdhborges> which I assume is assed to that faction
<pdhborges> then each element of the collection is passed to the function and printed in turn
<pdhborges> correct?
ymasory has joined #ocaml
yezariaely has quit [Ping timeout: 255 seconds]
yezariaely has joined #ocaml
joewilliams_away is now known as joewilliams
npouillard has quit [Ping timeout: 260 seconds]
myu2 has joined #ocaml
<thelema> kaustuv: oops, my quick review missed that. You're right - no problem on the assert_equal
ccasin has joined #ocaml
npouillard has joined #ocaml
ymasory has quit [Quit: Leaving]
<thelema> kaustuv: merged. testing and then I'll push
<thelema> kaustuv: I'm happy you keep submitting such good code.
<thelema> s/submitting/contributing/
<thelema> is there to be a batSplay.Set functor?
<thelema> maybe not important at the moment.
<thelema> I just noticed it's BatSplay.Map instead of .Make, which threw me for a bit
tauntaun has quit [Ping timeout: 240 seconds]
tauntaun has joined #ocaml
oriba has joined #ocaml
CoryDambach has quit [Ping timeout: 240 seconds]
<kaustuv> thelema: yes, there will be a BatSplay.Set. I just haven't had the time to write it.
<thelema> I just pushed the natural-looking test for BatSplay.Map in your test_mapfunctors code
<thelema> btw, you might find Enum.arg_min/arg_max useful - I know I do
kiyoto has joined #ocaml
kiyoto has left #ocaml []
hto has joined #ocaml
ttamttam has quit [Remote host closed the connection]
<pdhborges> anyone interested in testing bindings for zero mq?
philtor has joined #ocaml
lopex has quit []
lopex has joined #ocaml
pdhborges has quit [Quit: Page closed]
kaustuv_ has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
avsm has joined #ocaml
habnabit has joined #ocaml
kaustuv_` has joined #ocaml
Tobu_ has joined #ocaml
myu2 has quit [Remote host closed the connection]
npouilla1d has joined #ocaml
jonafan_ has joined #ocaml
hcarty_ has joined #ocaml
kaustuv_ has quit [*.net *.split]
npouillard has quit [*.net *.split]
Tobu has quit [*.net *.split]
shachaf has quit [*.net *.split]
hcarty has quit [*.net *.split]
mlh has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
mrvn has quit [*.net *.split]
pheredhel has quit [*.net *.split]
f[x] has quit [*.net *.split]
Julien_T has quit [*.net *.split]
kerneis has quit [*.net *.split]
xl0 has quit [*.net *.split]
ccasin has quit [*.net *.split]
ankit9 has quit [*.net *.split]
rien has quit [*.net *.split]
ski has quit [*.net *.split]
lamawithonel has quit [*.net *.split]
vk0_ has quit [*.net *.split]
trigen has quit [*.net *.split]
fholm has quit [*.net *.split]
avsm2 has quit [*.net *.split]
pantsd has quit [*.net *.split]
_habnabit has quit [*.net *.split]
diml has quit [*.net *.split]
yezariaely has quit [*.net *.split]
edwin has quit [*.net *.split]
chicco has quit [*.net *.split]
hto has quit [*.net *.split]
boscop has quit [*.net *.split]
metasyntax` has quit [*.net *.split]
habnabit has quit [Quit: Reconnecting]
jonafan has quit [Ping timeout: 240 seconds]
_habnabit has joined #ocaml
jonafan_ is now known as jonafan
lamawithonel has joined #ocaml
fholm has joined #ocaml
vk0_ has joined #ocaml
trigen has joined #ocaml
avsm2 has joined #ocaml
pantsd has joined #ocaml
mlh has joined #ocaml
hto has joined #ocaml
boscop has joined #ocaml
metasyntax` has joined #ocaml
Yoric has quit [Quit: Yoric]
hyperboreean has joined #ocaml
mrvn has joined #ocaml
pheredhel has joined #ocaml
f[x] has joined #ocaml
Julien_T has joined #ocaml
kerneis has joined #ocaml
xl0 has joined #ocaml
shachaf has joined #ocaml
ccasin has joined #ocaml
yezariaely has joined #ocaml
ankit9 has joined #ocaml
edwin has joined #ocaml
chicco has joined #ocaml
rien has joined #ocaml
ski has joined #ocaml
shachaf has quit [*.net *.split]
yezariaely has quit [*.net *.split]
edwin has quit [*.net *.split]
chicco has quit [*.net *.split]
kaustuv_` is now known as kaustuv_
<kaustuv_> did the internet just burp?
<thelema> maybe some problems at freenode
myu2 has joined #ocaml
<kaustuv_> > NickServ: No such nick/channel
<kaustuv_> This does not bode well...
shachaf has joined #ocaml
<thelema> "hub issues" according to martinp23
<kaustuv_> yeah, just saw that in the window I never pay any attention to
cyanure has joined #ocaml
mlh has quit [*.net *.split]
mlh has joined #ocaml
mnabil has quit [Ping timeout: 240 seconds]
yezariaely has joined #ocaml
edwin has joined #ocaml
chicco has joined #ocaml
_habnabit has quit [Changing host]
_habnabit has joined #ocaml
ygrek has joined #ocaml
hcarty_ is now known as hcarty
smerz has joined #ocaml
myu2 has quit [Remote host closed the connection]
yezariaely has quit [*.net *.split]
edwin has quit [*.net *.split]
chicco has quit [*.net *.split]
yezariaely has joined #ocaml
edwin has joined #ocaml
chicco has joined #ocaml
mlh has quit [*.net *.split]
arubin has joined #ocaml
mlh has joined #ocaml
ulfdoz has joined #ocaml
myu2 has joined #ocaml
Yoric has joined #ocaml
mlh has quit [*.net *.split]
mlh has joined #ocaml
elehack has joined #ocaml
avsm has quit [Quit: Leaving.]
elehack has quit [Read error: Connection reset by peer]
ymasory has joined #ocaml
ftrvxmtrx has joined #ocaml
Tobu_ has quit [Changing host]
Tobu_ has joined #ocaml
Tobu_ is now known as Tobu
diml has joined #ocaml
enthymeme has joined #ocaml
Snark has quit [Quit: Ex-Chat]
avsm has joined #ocaml
mnabil has joined #ocaml
AdmWiggin has joined #ocaml
rossberg_ has joined #ocaml
Tobu_ has joined #ocaml
kaustuv_` has joined #ocaml
sgnb` has joined #ocaml
krktz_ has joined #ocaml
metasyntax` has quit [Quit: Be seeing you.]
npouillard has joined #ocaml
Tobu has quit [Disconnected by services]
Tobu_ is now known as Tobu
npouilla1d has quit [*.net *.split]
kaustuv_ has quit [*.net *.split]
lopex has quit [*.net *.split]
rossberg has quit [*.net *.split]
krktz has quit [*.net *.split]
Tianon has quit [*.net *.split]
sgnb has quit [*.net *.split]
philtor has quit [Ping timeout: 240 seconds]
lopex has joined #ocaml
kaustuv_` has quit [Remote host closed the connection]
kaustuv_` has joined #ocaml
mlh has quit [*.net *.split]
mlh has joined #ocaml
<Tobu> What tools do you use for making C library bindings?
yezariaely1 has joined #ocaml
<adrien> hands, camlidl, some automations with gcc-xml that I've never tested, parsing of C file with "cowboy" (for which I am the author)
<adrien> but there's no perfect solution
<Tobu> Anything with an IDL sounds nice
ygrek has quit [Ping timeout: 240 seconds]
<Tobu> Cloned cowboy, I see it comes with examples
<adrien> there are things to improve however
<adrien> what do you want to bind?
<Tobu> libgit2
<Tobu> C99
<Tobu> A subset of it would be enough
<adrien> how many functions does it have? around 10? 100? 1000?
ygrek has joined #ocaml
<adrien> doxygen, that's very good
<Tobu> 300?
<Tobu> yep
<Tobu> It involves gcc-xml as well?
<adrien> cowboy doesn't use gcc-xml
<adrien> also, note that if you need only a few functions (10-20, up to 40?), it's probably easier to do it by hand
<Tobu> Yeah, I'll probably just bind the blob access. But cowboy might be worth learning anyway.
<adrien> it's probably centered around glib2-based libraries currently so if anything is missing, tell me
<Tobu> sure
<Tobu> I'm off installing mikmatch
<avsm> i have a wrapper of the git command line here https://github.com/avsm/ocaml-git
<avsm> but of course, libgit is direct...
<Tobu> Seen it
<_habnabit> http://paste.pound-python.org/show/kEcdwwL5SoL30tKHVyYp/ <- I'm getting an odd error and I can't figure out why.
<_habnabit> If I do `let pf = Printf.printf` then I don't get the error.
<thelema> _habnabit: you can't partially apply printf like that
<thelema> there's magic in the ocaml type system to make printf work
<_habnabit> Ah. :(
<thelema> actually, I take that back, it's not printf, it's just that pf can't be assigned a single type
<adrien> hmm, and btw, %B prints booleans I think
yezariaely1 has quit [Quit: Leaving.]
<thelema> hmm... or not.. hmm, that error is suspicious
<thelema> n/m, it is printf magic. Maybe you can use Pervasives.format_of_string to insist that your string literals are formats
<thelema> printf formats
<thelema> nope, it insists that the strings are just strings
<thelema> in general, don't separate the *printf from its format string
<_habnabit> Sure, but there's no way to partially apply this?
<thelema> not that I know of. Maybe there's some additional restriction on printf typing that I don't know about
<_habnabit> Dang.
<thelema> just write it out and get the job done.
<thelema> or don't write it out this way and use Batteries' printers
<_habnabit> Already batch found/replaced.
<thelema> rare exception.
boscop_ has joined #ocaml
<thelema> Maybe if you're using 3.12, you can annotate pf and have the types work out...
<thelema> but someone with 3.12 will have to verify that
hto_ has joined #ocaml
ulfdoz_ has joined #ocaml
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
BiDOrD has quit [Client Quit]
BiDOrD has joined #ocaml
diml has quit [*.net *.split]
myu2 has quit [*.net *.split]
ulfdoz has quit [*.net *.split]
edwin has quit [*.net *.split]
hto has quit [*.net *.split]
boscop has quit [*.net *.split]
ulfdoz_ is now known as ulfdoz
myu2 has joined #ocaml
kaustuv has quit [Remote host closed the connection]
BiDOrD has quit [Ping timeout: 240 seconds]
BiDOrD has joined #ocaml
diml has joined #ocaml
mnabil has quit [Remote host closed the connection]
mal`` has quit [Quit: Coyote finally caught me]
edwin has joined #ocaml
mal`` has joined #ocaml
seafood has joined #ocaml
edwin has left #ocaml []
tauntaun has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 240 seconds]
svenl_ has quit [Ping timeout: 272 seconds]
Amorphous has quit [Ping timeout: 272 seconds]
Amorphous has joined #ocaml
Amorphous has quit [Changing host]
Amorphous has joined #ocaml
ygrek has joined #ocaml
ymasory has quit [Quit: Leaving]
rien has quit [Disconnected by services]
boscop_ is now known as boscop
seafood has quit [Quit: seafood]
cyanure has quit [Ping timeout: 264 seconds]
kaustuv_` has quit [Remote host closed the connection]
kaustuv_` has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
tauntaun has joined #ocaml
Yoric has quit [Quit: Yoric]
ccasin has quit [Quit: Leaving]
flux has quit [Remote host closed the connection]
flux has joined #ocaml
kaustuv_ has joined #ocaml
kaustuv_` has quit [Remote host closed the connection]
enthymeme has quit [Quit: errands]
Amorphous has quit [Ping timeout: 272 seconds]
ygrek has quit [Ping timeout: 240 seconds]
ikaros_ has quit [Quit: Leave the magic to Houdini]
jeddhaberstro has joined #ocaml
arubin has quit []
jeddhaberstro has quit [Read error: Connection reset by peer]
jeddhaberstro_ has joined #ocaml
eb4890 has joined #ocaml
bitbckt is now known as stderr
stderr is now known as bitbckt
philtor has joined #ocaml