h3r3tic has quit [Read error: 54 (Connection reset by peer)]
h3 has joined #ocaml
seanmcl has joined #ocaml
seanmcl has quit [Client Quit]
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
caligula__ has joined #ocaml
kaustuv_` has joined #ocaml
caligula_ has quit [Read error: 110 (Connection timed out)]
kaustuv_ has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has quit [Client Quit]
mellum_ has quit [robinson.freenode.net irc.freenode.net]
lanaer has quit [robinson.freenode.net irc.freenode.net]
lanaer has joined #ocaml
mellum_ has joined #ocaml
seanmcl has joined #ocaml
seanmcl has quit []
clog has joined #ocaml
ski_ has joined #ocaml
f[x] has joined #ocaml
f[x] has quit [Read error: 145 (Connection timed out)]
ulfdoz has joined #ocaml
hjpark has joined #ocaml
f[x] has joined #ocaml
<flux>
good morning!
aij has left #ocaml []
munga has joined #ocaml
_zack has joined #ocaml
<Camarade_Tux>
morning flux :)
<Camarade_Tux>
kaustuv_`: reddit users? you mean haskellers and pythonistas? ;)
flux has quit [calvino.freenode.net irc.freenode.net]
flux has joined #ocaml
pierre_m has joined #ocaml
<pierre_m>
hi there
<pierre_m>
I have a (i guess) basic problem with functors
<pierre_m>
I wonder what is the best way to keep the choice of parameter module at runtime (said as an argument from the command line) without having to duplicate too much code
ikaros has joined #ocaml
<flux>
patching the compiler with the higher order modules -patch perhaps :). otherwise I don't see a way that doesn't invoolve writing a module that has a layer of indirectness in it
tmaeda0 has joined #ocaml
tmaeda has quit [Read error: 110 (Connection timed out)]
Narrenschiff has joined #ocaml
<Camarade_Tux>
flux: in ocaml-gir, the better I support lablgtk2, the less I can support anything else =/
_zack has quit ["Leaving."]
tmaeda0 is now known as tmaedaZ
tmaedaZ is now known as tmaeda0
tmaeda0 is now known as tmaedaZ
munga has quit [Read error: 60 (Operation timed out)]
<Camarade_Tux>
it'll probably work until I try to actually link anything with that module, I haven't renamed the C functions so I'm not providing any of the native code nor bytecode version
nimred has quit [Client Quit]
nimred has joined #ocaml
Narrenschiff has quit []
ikaros_ has joined #ocaml
seanmcl has joined #ocaml
ikaros has quit [Read error: 145 (Connection timed out)]
kaustuv_ has joined #ocaml
seanmcl has quit []
seanmcl has joined #ocaml
kaustuv_` has quit [Read error: 110 (Connection timed out)]
ukl has joined #ocaml
BiDOrD has joined #ocaml
<thelema_>
Okay, apparently there's something in ocaml's build system I don't know about.
<thelema_>
I've got a findlib package for aaa with an archive called batteries.cma
<thelema_>
and the META seems set up right
<thelema_>
but when I compile, I just get [Unbound value] errors
<thelema_>
the batteries.cma is made by ocamlbuild using a .mllib file
<thelema_>
and it doesn't matter whether I use ocamlfind to compile or manually -I the .cma file in
thelema_ is now known as thelema
<thelema>
hmm... do I need all the .cmi files too?
<flux>
is there packing involved?
<thelema>
no. no packing.
<flux>
then you need the original .cmi-files
<thelema>
if I pack, I'm stuck with huge batteries.
<thelema>
ok.
<thelema>
thanks.
<flux>
if you use packing, then you must not have original .cmi-files, but one for the resulting .cmo-file
* thelema
tries to include the .mllib into the Makefile's install target
<flux>
actually 'must not' is slightly heavy statement, but it's annoying as hell and removes the advantage of packing in the first place :)
* thelema
is conflicted on packing
<thelema>
and wants to try the simplest thing that could possibly wor
<thelema>
*work
<flux>
so aaa is going to remove the packing?
<thelema>
that's where I'm going now.
<thelema>
It's not really a design goal
<flux>
what happens to names?
<thelema>
Although removing the sub-packing is a design goal
<thelema>
I'll probably end up with all modules' names prefixed with 'Bat'
<thelema>
although I'm thinking about IO and Enum as exceptions
<flux>
~\o/~
<flux>
how about just B?-)
<flux>
(too short?)
* thelema
has no problems with B
<Camarade_Tux>
B++
<flux>
:-)
<thelema>
I'm still trying to figure out the best way to present this to the user.
<flux>
I know, I know! with a good manual!
<flux>
;-)
<Camarade_Tux>
hmmm, force him to read the documentation? D
<thelema>
I like how "open Batteries" replaces everything automatically
<flux>
camarade_tux, the first task is to provide such documentation :)
<thelema>
and I don't want to insist on [module Array = BArray module List = BList module Queue = BQueue ...]
<flux>
do it the ExtLib way?
<flux>
open BArray etc?
<Camarade_Tux>
or some macros?
* Camarade_Tux
is doing too much C
<thelema>
the extlib way doesn't work for array and list because their functions will shadow each other
<thelema>
n/m, I forgot the submodules
<thelema>
I'm thinking that the extlib way isn't quite right either, from a documentation perspective.
<thelema>
I'm actually thinking of just including the source directly. Since batteries will be large, just include all the stdlib function definitions directly.
<thelema>
I agree that copy & paste is a source of bugs
<thelema>
but I hope that the community will help me in keeping things in sync
<thelema>
I wish ocaml had child packages, so you could include a parent package including all its private representations
<thelema>
batteries' Set implementation is wonky because of this.
<thelema>
hmmm... Maybe I will just let people do BArray.map if they want the batteries array.
<Camarade_Tux>
how would you generate "a[0], a[1], a[2]... a[n]" with the minimum of code?
<thelema>
Camarade_Tux: a list as output, or a tuple?
<Camarade_Tux>
a string? :P (but a list is as good : String.concat ", ")
<thelema>
Camarade_Tux: can I use batteries?
<Camarade_Tux>
hehe, no :P
<thelema>
:(
<Camarade_Tux>
that'd be too easy
<thelema>
a for loop, appending to a buffer would be reasonable, using bprintf
<thelema>
bprintf buf "], a[%d" i
<thelema>
preceed with "a[0" and don't forget the trailing "]"
<mfp>
Camarade_Tux: you don't mean String.concat ", " (Array.to_list (Array.init n (sprintf "a[%d]"))) do you?
<Camarade_Tux>
mfp: that's almost what I was going to write actually: String.concat "," (Array.to_list (Array.iteri (fun i _ -> sprintf "a[%d]" i) (Array.of_list f#parameters)))
<Camarade_Tux>
but your's better ;)
<Camarade_Tux>
(let n = List.length f#parameters)
<Camarade_Tux>
thelema: I wanted to avoid for-loops, here I prefer short code over fast one
<thelema>
Camarade_Tux: no problem.
<thelema>
I admit that I over-optimized.
<mfp>
the bottleneck is probably (b,s)printf anyway
<mfp>
since it scans the fmt at runtime
<Camarade_Tux>
a[i] (actually argv[i]) is an argument when calling a function, I hope there is no function with > 10000 parameters, but I hadn't said that ;)
<mfp>
unlike Batteries' extensible printf (?)
diml has quit [Remote closed the connection]
<mfp>
Camarade_Tux: the above one-liner would do fine no matter how long the list (up to Sys.max_array_length or Sys.max_string_length being reached)
<Camarade_Tux>
and I really need a break from this
diml has joined #ocaml
<Camarade_Tux>
at least the C seems ok now, it should create a library (with only two undefined references) pretty soon
_zack1 has joined #ocaml
_zack has quit [Read error: 60 (Operation timed out)]
_zack has joined #ocaml
_zack1 has quit [Read error: 104 (Connection reset by peer)]
<Camarade_Tux>
... nearly... done...
c0m has joined #ocaml
Alpounet has joined #ocaml
Snark has joined #ocaml
<flux>
uh oh, now I think I've made a mistake with darcs..
<flux>
I put in an exported eps-file in ascii mode
<flux>
and re-exported the png. now I have tons of patches..
u1ik has joined #ocaml
<Camarade_Tux>
hehe :P
u1ik has left #ocaml []
<flux>
well, I stopped the resulting push which had lasted an hour and fixed the issue locally :)
<flux>
oh, I first needed to kill the 250M darcs-process from the remote host..
<flux>
hngh, the patch is already partially in.. this is fun
<mfp>
I used darcs for a couple years before switching to git, not coming back
<flux>
I still use it for small projects
<flux>
and my dotfiles
<mfp>
darcs is playing catch-up in terms of speed and usability, but there's nothing to bring me back (yes, I find git more usable in many ways: how you refer to a commit, coloring + auto pager, etc.)
<flux>
cherry-picking works very nicely in darcs
<flux>
especially my dot-files can be non-synchronized among hosts for long times, but locally in version control
<mfp>
always wondered: do I have to keep rejecting patches in another repos but not in mine?
<flux>
I think there's an automated way to do that. a list of rejected patches.
<flux>
my files don't drift that much that I can just do it whenever I decide to sync
<flux>
I suppose it automatically ignored patches that depend on patches you ignore, though
<mfp>
I used to care about cherry picking, but then realized it didn't make up for all the other problems
<mfp>
e.g. I've had to send patches N times because of encoding issues
<mfp>
or corrupted repositories
<flux>
I like darcs' simplicity
<flux>
for example it doesn't have - or need - branches
<mfp>
and I bumped into the super-exponential merge bug a few times
<mfp>
well
<mfp>
it needs several working dirs
<flux>
true
<flux>
yes, that merge bug can be a bitch, apparently they've done some work on that
<mfp>
which is another thing I don't like (internal branching = faster recompiling)
<mfp>
yes, fixed most of the time in darcs 2, I hear
<mfp>
but then you have to convert the repos format and stuff
<mfp>
and darcs get still seems very slow
<flux>
hence the small projects :)
<mfp>
(had to darcs get lwt recently because the repos format changed :-|)
<flux>
in any case, when darcs doesn't have branches, it means it doesn't need to have commands for managing them either
<flux>
I think I'd need to spend some quality time with my web browser to understand how to use git branches
<flux>
(my other git-based projects so far haven't required it)
<flux>
also, setting up a web-based git-repository is slightly more work
* Camarade_Tux
made a few errors with git branches
<mfp>
flux: you mean w/ a viewcvs-like interface?
<flux>
mfp, no, plainly something I can push to and people can pull from
<flux>
mfp, the hooks, basically..
<mfp>
ah, you chmod +x 1 hook, yep
<Alpounet>
"As you know OCaml always lives in an implicit big IO monad and so its
<Alpounet>
'let' syntax is a monadic do." hmm
<flux>
I had an issue with the server having an older version of git the first time I tried that as well
<flux>
but I suppose darcs could've easily have had the same problem
<mfp>
Alpounet: but you can compose functions with foo (f x) (g y)
<mfp>
w/o a <- f x; b <- g y; foo a b
<flux>
alpounet, correct. however, ocaml can do this: copy_file (open_in "input") (open_out (expand_path "~foo/output" ^ "." ^ string_of_unit (Unix.getpid())))
<Alpounet>
flux, mfp, it's a message from the Haskell-cafe ML, written by Nicolas Pouillard.
<Camarade_Tux>
\\o o// \o/
<Camarade_Tux>
labldbus compiling without warning, lablwebkit too :)
<Camarade_Tux>
well, I'm not sure they qualify for "labl" right now since they use 0 labels but I guess that gives a good idea of what they are ;-)
<orbitz>
ugh the most offputting thing about C# is the Capital Letters everywhre
ski_ has quit ["Lost terminal"]
<shazam>
but it's camlcase!
sporkmonger has joined #ocaml
<flux>
:)
<orbitz>
shazam: teehehe :)
<Camarade_Tux>
./libgWebKit_stubs.a(ml_gtkWebKit.o): In function `ml_webkit_check_version':
<Camarade_Tux>
ml_gtkWebKit.c:(.text+0x30): undefined reference to `webkit_check_version'
<Camarade_Tux>
^^ *that* is what annoys me the most when writing ocaml bindings to C libraries
<Anarchos>
no idea where it comes from that caml_frametable is not found, (but defined in the /tmp/camlstartupXXX.s) ?
c0m has joined #ocaml
Anarchos has quit ["Vision[0.9.7-H-090423]: i've been blurred!"]
<c0m>
want to take [[1;2;3];[4;5;6]] and make it [[1;4];[2;5];[3;6]] but am having some problem with syntax ... anyone help me please? let rec transpose = function | [] -> [] | xs::ys -> List.hd xs :: List.hd ys :: transpose [List.tl xs; List.tl ys]
<c0m>
that seems to be wrong though because i get error on ending ys
<c0m>
this is f# btw but similar to ocaml
<orbitz>
c0m: dumb route might be to flatten it then unflatten it
<orbitz>
hrm taht woudln't work, i wasn't thinkign genrically
<c0m>
do you see what i'm trying to do though
<orbitz>
just a transpose
<c0m>
yeah but my syntax is off
<orbitz>
ys is a [[Int]]
<c0m>
how though?
<c0m>
ys is the second link in the list
<orbitz>
List.tl ias type ['a] -> ['a]
<orbitz>
no, ys is the rest of the list
<c0m>
oh wait
<orbitz>
match [1; 2; 3] with x :: xs -> (* x = 1, xs = [2; 3] *0
<orbitz>
*)
<c0m>
so when i'm doing xs::ys ... that is doing it only for the first link in the list?
<c0m>
so xs is 1 and ys is 2;3
<c0m>
?
<orbitz>
no
<c0m>
i thought ys would be binded to 4;5;6
<c0m>
and xs to 1;2;3
<orbitz>
xs is [1; 2; 3], ys is [[4; 5; 6]]
<c0m>
ok
<c0m>
err
<c0m>
oh
<c0m>
wtfbbq
<c0m>
so much implicit stuff
<c0m>
with strict inference
<orbitz>
# match [[1;2;3];[4;5;6]] with x::xs -> (x, xs) | _ -> ([], [])
<orbitz>
;;
<orbitz>
- : int list * int list list = ([1; 2; 3], [[4; 5; 6]])
<c0m>
so then maybe xs::ys::_
<c0m>
i could match it
<orbitz>
no
<orbitz>
might as well just match against [x; y] at tha tpoitn
<c0m>
yeah i just did that
<c0m>
but it isn't returning 'a list list, only 'a list