dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
jacobolus has quit []
danly has quit [Read error: 104 (Connection reset by peer)]
danly has joined #ocaml
danly has quit [Read error: 131 (Connection reset by peer)]
jacobolus has joined #ocaml
danly has joined #ocaml
danly has quit [Read error: 131 (Connection reset by peer)]
danly has joined #ocaml
danly has quit [Read error: 131 (Connection reset by peer)]
hikozaemon has joined #ocaml
danly has joined #ocaml
chessguy has joined #ocaml
CosmicRay has joined #ocaml
dbueno has joined #ocaml
<dbueno> What's the easiest way to get applicative hash-tables (like Map) with a custom key compare function (such as a case-insensitive compare)?
<dylan> the Hasktbl module contains a functor.
<dbueno> dylan: Hashtbl isn't applicative, though... right?
<dbueno> It has in-place modification.
<dylan> Well, then use Map.
<dbueno> How can I override the comparison function?
<dylan> # module NocaseString = struct include String let compare a b = Pervasives.compare (lowercase a) (lowercase b) end ;;
<dylan> module NoCaseStrMap = Map.Make(NocaseString)
<dbueno> Ahh. Interesting.
<dbueno> dylan: Thanks. Hadn't thought of that.
<dylan> and with that, good night.
pango__ has joined #ocaml
pango_ has quit [Remote closed the connection]
dbueno has quit ["Leaving"]
CosmicRay has left #ocaml []
<AI_coder> Just starting to understand the core of ml/ocaml, it's really cool.
<AI_coder> The new syntax is really a new way of thinking about programming.
<AI_coder> Why doesn't (*);; work as int -> int -> int = <fun> ?
<dylan> it is parsed as a comment
<dylan> try ( * )
<AI_coder> Ah, thanks.
sponge45 has joined #ocaml
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- IRC for those that like to be different"]
Hadaka has quit [brown.freenode.net irc.freenode.net]
dylan has quit [brown.freenode.net irc.freenode.net]
aref has quit [brown.freenode.net irc.freenode.net]
Lob-Sogular has quit [brown.freenode.net irc.freenode.net]
TaXules has quit [brown.freenode.net irc.freenode.net]
creichen has quit [brown.freenode.net irc.freenode.net]
oracle1 has quit [brown.freenode.net irc.freenode.net]
flux__ has quit [brown.freenode.net irc.freenode.net]
hikozaemon has quit [brown.freenode.net irc.freenode.net]
shawn has quit [brown.freenode.net irc.freenode.net]
slipstream has quit [brown.freenode.net irc.freenode.net]
pattern has quit [brown.freenode.net irc.freenode.net]
Demitar has quit [brown.freenode.net irc.freenode.net]
danly has quit [brown.freenode.net irc.freenode.net]
buggs has quit [brown.freenode.net irc.freenode.net]
mellum has quit [brown.freenode.net irc.freenode.net]
descender has quit [brown.freenode.net irc.freenode.net]
zmdkrbou has quit [brown.freenode.net irc.freenode.net]
ulfdoz has quit [brown.freenode.net irc.freenode.net]
danly has joined #ocaml
hikozaemon has joined #ocaml
shawn has joined #ocaml
slipstream has joined #ocaml
dylan has joined #ocaml
ulfdoz has joined #ocaml
Hadaka has joined #ocaml
aref has joined #ocaml
Lob-Sogular has joined #ocaml
TaXules has joined #ocaml
creichen has joined #ocaml
oracle1 has joined #ocaml
flux__ has joined #ocaml
pattern has joined #ocaml
Demitar has joined #ocaml
descender has joined #ocaml
buggs has joined #ocaml
zmdkrbou has joined #ocaml
mellum has joined #ocaml
tristram has joined #ocaml
danly has quit [Read error: 110 (Connection timed out)]
love-pingoo has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
pango__ has quit [Remote closed the connection]
danly has joined #ocaml
Snark has joined #ocaml
sponge45 has left #ocaml []
smimou has joined #ocaml
Revision17 has joined #ocaml
TaXules has quit [Read error: 110 (Connection timed out)]
love-pingoo has joined #ocaml
revision17_ has quit [Read error: 110 (Connection timed out)]
descender has quit ["Why has elegance found so little following? Elegance has the disadvantage that hard work is needed to achieve it and a good e]
TaXules has joined #ocaml
descender has joined #ocaml
hikozaemon has quit ["Leaving..."]
kuribas has joined #ocaml
mnemonic has joined #ocaml
mnemonic_ has joined #ocaml
mnemonic_ has quit [Client Quit]
<mnemonic> yo
pango has joined #ocaml
descender has quit ["Why has elegance found so little following? Elegance has the disadvantage that hard work is needed to achieve it and a good e]
mnemonic has quit ["leaving"]
kuribas has quit ["ERC Version 5.0.2 $Revision: 1.726.2.10 $ (IRC client for Emacs)"]
kuribas has joined #ocaml
flux__ has quit [Read error: 104 (Connection reset by peer)]
love-pingoo has quit ["Leaving"]
chessguy has joined #ocaml
Snark has quit ["Leaving"]
chessguy has quit [" Try HydraIRC -> http://www.hydrairc.com <-"]
exa has joined #ocaml
<exa> hi there, i got a problem with swig. I use a C interface (to a C++ object) extern int compressed_size_bitstring(char *bitstring, int length); <--- but I can't call it with args (C_string "something") (C_int somethingelse)
<exa> the generated interface goes like this, and it makes no sense to me: val _compressed_size_bitstring : c_obj -> c_obj
<exa> how am I going to pass my parameters? I'm not using ocamlp4
<exa> might the problem be because the code i am trying to interface is c++? uh
Oatmeat|umn has joined #ocaml
<exa> I am going to paste 4 lines, I'm trying to make an ocaml interface to the famous example module with the factorial function. There is a one arg fact(.) function and a two arg my_mod(.,.) function in example.c
<exa> # _fact (C_int 5);;
<exa> - : Example.c_obj = C_int 120
<exa> # _my_mod (C_int 6) (C_int 3);;
<exa> This function is applied to too many arguments, maybe you forgot a `;'
jacobolus has quit []
love-pingoo has joined #ocaml
<smimou> exa: I don't know swig very well, but it gave me very ugly bindings when I used it
<smimou> you'd better try camlidl, or better, do the bindings by hand
finelemon has joined #ocaml
finelemo1 has joined #ocaml
finelemo2 has quit [Read error: 110 (Connection timed out)]
jacobolus has joined #ocaml
finelemon has quit [Read error: 110 (Connection timed out)]
love-pingoo has quit ["Connection reset by pear"]
_fab has joined #ocaml
fly_80 has joined #ocaml
<fly_80> hello all
<fly_80> where can I find information on the "types inference algorithm " used by ML ? ( possibly a free resource )
<zmdkrbou> google and you'll find papers
<_fab> fly_80: look on wikipedia for the milner type inference algorithm
<_fab> the article is quite good
<_fab> fly_80: yes
<fly_80> _fab: is that the algorithm W ?
chessguy has joined #ocaml
Itkovian has joined #ocaml
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- Go on, try it!"]
chessguy has joined #ocaml
Itkovian has quit []
Itkovian has joined #ocaml
asbeta has joined #ocaml
<exa> smimou: suppose i don't want to do anything by hand, what's the point?
<exa> how does one pass multiple arguments to a swig wrapped C function?
<exa> int my_mod(int x, int y); this is wrapped as Example._my_mod how do I call it from my swig'd toplevel?
<exa> what a foolish documentation in SWIG, doesn't show any actual use, fools
<exa> no SWIG experts here?
Itkovian has quit []
fly_80 has quit ["Non importa il traguardo ma il viaggio...a che serve il risultato se non ti godi il tragitto? Magari poi arriva qualcosa....p]
_fab has quit [Read error: 145 (Connection timed out)]
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- The future of IRC"]
<exa> guys, how do I use this stupid SWIG thing to pass *multiple* parameters to a damn C function?
Itkovian has joined #ocaml
<exa> no swig experts? come on :)
<exa> that doesn't help!
<exa> what a bad doc :(
<exa> stupid emphasis on camlp4 and C++ objects while I need proper doc on interfacing with plain C first.
<exa> how do I pass multiple parameters to the C function? One parameter works. Two parameters doesn't.
<exa> _fact (C_int 5);; works _my_mod (C_int 6) (C_int 3);; the latter is a function that takes two parameters. how do I get it to work? I don't care about C++. I am just trying to understand how the C wrapper works.
<exa> the latter doesn't work
<dylan> wow
<exa> :'( somebody help me please
<dylan> whatever you are using is a lot more difficult than using ocaml's native foreign function interface
<exa> so there is no point to using SWIG?
<dylan> I'd say no, not for ocaml.
Itkovian has quit []
<exa> well, here I am wrapping just one thing, but in near future I might wanna wrap the entire C++ module.
<exa> nobody knows how this thing works?
<exa> except the author perhaps :/
<dylan> that will be hard in ocaml FFI, but not impossible.
<dylan> you'll have to wrap the C++ thing in C.
<exa> well i don't want to do that actually
<asbeta> hmm... swig authors says there's a point :)
<exa> but more to the point, while there is such a facility i wanna learn how to use it and the docs absolutely suck
<asbeta> is there a good manual about ocaml ffi?
<dylan> the ocaml manual covers it quite nicely.
<exa> yea i know how cool FFI is, but didn't any of you use SWIG? i mean, i really got to solve this problem or I won't be able to finish my paper please somebody help me :(
<dylan> I've used SWIG for perl. For a while.
<exa> and I promise that I will post the resulting proggie on ocaml list
<exa> it's pretty interesting i think
<exa> I could easily use SWIG to wrap the same module for python
<dylan> Swig for ocaml scares the bejesus out of me, though
<exa> but I can't make any sense out of the ocaml wrapping!
<dylan> ocaml is radically different than python.
<exa> I actually understand that :)
<exa> but this funky pattern matching in the generated .ml file, what the hell is this?
<asbeta> dylan, camlp4 preprocessing doesn't help?
<exa> didn't these guys understand that they actually have to use the type system of ocaml in the proper way
<dylan> asbeta: how would it help?
<asbeta> with cleaner syntax
<exa> did anybody use SWIG OCAML support?
<dylan> ^^ alternative to using the ocaml FFI directly.
<dylan> "Under Unix and Windows, as a simple interface between Caml classes and C++ classes."
* exa is about to break down and cry
<exa> a single example on how to pass multiple arguments to a SWIG wrapped silly C function?
<asbeta> exa, you have swig installed?
<exa> of course
<asbeta> there's probably some doc folder with examples
<exa> I am using it
<exa> I just can't pass TWO arguments. I can pass ONE argument.
<asbeta> wait...
<asbeta> i think arguments there are passed as list
<ulfdoz> I'd guess, multiple arguments are passed as an array, which is the natural way to call C from OCaml.
<exa> I am seeing the examples but they don't make sense any more
<exa> oh
<asbeta> or, an array..
<exa> like with C_list?
<asbeta> yea
<ulfdoz> s/call/pass parameters/
<exa> pass parameters yes
<dylan> :se noai
<dylan> a:se ai
* dylan slaps screen
<exa> in one example they use the camlp4 idiom i think, _factor '((x to int),(y to int))
<exa> what the hell is that?
<ulfdoz> dylan: "This had not happened with emacs". :)
<exa> _draw_shape_coverage '(triangle, 60, 20) <--- what is this quoting?
<asbeta> exa, camlp4 will rewrite it to C_list
<exa> okay then
<asbeta> you may use that, just have to call camlp4 before compilation
<exa> I can't compile swig's camlp4 thing so I'll have to leave that out
<exa> I bet I am their only use
<exa> user
_fab has joined #ocaml
<asbeta> hmmm... ocaml's ffi is nice
<exa> cool I just got a segfault
<exa> stupid stupid stupid
<exa> ok at least the segfault is my fault :)
tristram has quit [Read error: 145 (Connection timed out)]
_fab has quit [Read error: 131 (Connection reset by peer)]
ita has joined #ocaml
exa has quit [Read error: 104 (Connection reset by peer)]
chessguy has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 145 (Connection timed out)]
chessguy2 has joined #ocaml
Pebblestone has quit [Read error: 104 (Connection reset by peer)]
kuribas has quit ["ERC Version 5.0.2 $Revision: 1.726.2.10 $ (IRC client for Emacs)"]
ita has quit ["Konversation terminated!"]
chessguy has quit [Connection timed out]