mfp changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.11.2 released | Inscription for OCaml Meeting 2010 is opened http://wiki.cocan.org/events/europe/ocamlmeetingparis2010
<orbitz> at any depth? can you have 'anyd epth' in ocaml?
<m3ga> orbitz: the OP has left the building
<orbitz> dam
<orbitz> Hrm
<orbitz> I want me soem Ocaml On Erlang
Associat0r has quit [Quit: Associat0r]
Mr_Awesome has joined #ocaml
mutew has joined #ocaml
m3ga has left #ocaml []
Drk-Sd has joined #ocaml
boscop has quit [Quit: Gxis revido!]
rhar has joined #ocaml
Smerdyakov has quit [Quit: Leaving]
Drk-Sd has quit [Quit: dodo]
mutew has quit [Quit: leaving]
mutew has joined #ocaml
mutew has left #ocaml []
mutew has joined #ocaml
mutew has left #ocaml []
mutew has joined #ocaml
rhar has quit [Quit: Leaving]
Modius_ has joined #ocaml
Modius has quit [Ping timeout: 248 seconds]
ski_ has joined #ocaml
caligula__ has joined #ocaml
caligula_ has quit [Ping timeout: 260 seconds]
mbana has quit [Ping timeout: 248 seconds]
Modius_ has quit [Quit: I'm big in Japan]
Modius has joined #ocaml
bzzbzz has quit [Quit: leaving]
bzzbzz has joined #ocaml
_unK has quit [Remote host closed the connection]
bzzbzz has quit [Client Quit]
CcSsNET has quit [Remote host closed the connection]
mehdid has quit [Ping timeout: 256 seconds]
npouillard has quit [Ping timeout: 252 seconds]
npouillard has joined #ocaml
mutew has quit [Quit: leaving]
<thelema> npouillard: did I see correctly some updates to ocamlbuild to support findlib by default?
Amorphous has quit [Ping timeout: 246 seconds]
mutew has joined #ocaml
Amorphous has joined #ocaml
mutew has quit [Quit: leaving]
sidewinder128 has joined #ocaml
ulfdoz has joined #ocaml
sidewinder128 has left #ocaml []
ttamttam has joined #ocaml
ttamttam has quit [Quit: Leaving.]
ulfdoz has quit [Ping timeout: 240 seconds]
Mr_Awesome has quit [Ping timeout: 256 seconds]
ttamttam has joined #ocaml
valross has quit [Quit: Ex-Chat]
Modius has quit [Read error: Connection reset by peer]
<npouillard> thelema: right!
yakischloba has quit [Quit: Leaving.]
_zack has joined #ocaml
<Camarade_Tux> \o/
slash_ has joined #ocaml
mehdid has joined #ocaml
slash_ has quit [Quit: Lost terminal]
Submarine has joined #ocaml
ikaros has joined #ocaml
slash_ has joined #ocaml
_zack1 has joined #ocaml
_zack has quit [Remote host closed the connection]
Yoric has joined #ocaml
<Gertm> what do I need to do what my compiler complains it can't find a .cxma file? All the other files are there, but that one isn't
<Gertm> can I make that file?
<flux> gertm, a .cmxa-file is composed of many .cmx-files
<flux> gertm, maybe if you have the required .cmx-files you could build some .cmxa out of them
<Gertm> I just have cma and cmi files for that library
<Camarade_Tux> you installed this library by yourself? with 'make && make install' ?
<Gertm> Ah, I forgot to install the '-devel' packages
<Camarade_Tux> :P
<Gertm> Cool stuff this OCaml
ikaros has quit [Quit: Leave the magic to Houdini]
<flux> indeed ;)
_andre has joined #ocaml
munga_ has joined #ocaml
mbana has joined #ocaml
munga_ has quit [Ping timeout: 252 seconds]
ttamttam has quit [Quit: Leaving.]
vpalle has joined #ocaml
vpalle_ has joined #ocaml
thrasibule has quit [Quit: No Ping reply in 180 seconds.]
thrasibule has joined #ocaml
vpalle has quit [Ping timeout: 245 seconds]
thrasibule has quit [Read error: Connection reset by peer]
thrasibule has joined #ocaml
_zack1 has quit [Quit: Leaving.]
ttamttam has joined #ocaml
boscop has joined #ocaml
ski_ has quit [Quit: Lost terminal]
bzzbzz has joined #ocaml
_unK has joined #ocaml
<thelema> npouillard: 1) Yay!! on findlib support. 2) what do you think of a system-wide directory for packages to install their own myocamlbuild.ml files that get used for all projects?
mutew has joined #ocaml
<thelema> hmm... According to ocamlviz, my hashtable has 32000 elements inserted into a 31999 bucket table with 30932 of the buckets empty. :(
<thelema> I'm using the built-in hash function, and I've bumped the parameters up to 30,999 and am still unhappy at this distribution
mutew has quit [Client Quit]
<flux> indeed :)
<flux> use a map?-)
<thelema> I guess I can swap that out. I don't particularly want a functional map, as this piece of code is definitely well matched for the mutable hashtables.
<thelema> according to ocamlviz, the linked list on one of the bucketa has 7709 elements. definitely not right.
<flux> are you inserting the right stuff in?
<ttamttam> Hello
<flux> I mean, how can you have such a bad luck..
<flux> do you have a very "long" datastructure so that the hash function never gets to the varying part?
<flux> iirc the hash function goes at most n "hops"
<thelema> well, the hash keys are a parsed version of regular expressions... I guess I could keep bumping up the parameters
<flux> thelema, you could always provide your own Hashtbl.HashedType to use better hashes
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
<ttamttam> thelema: did you have a look at ocamlbuild-plus?
<thelema> ttamttam: I have, briefly.
<thelema> I remember it going in a different direction than I was interested
<ttamttam> Don't you think it is a simple solution?
<Gertm> anyone know how to enable basic authentication with the http_client.convenience lib?
<thelema> There is a default behaviour for authentication. Both "basic" and "digest" methods are enabled. Two global variables, http_user and http_password set the user and password if the URL does not specify them. In the case that user and password are included in the URL, these values are always used.
<Gertm> yeah, I tried both methods, doesn't seem to work.
<Gertm> so I must be doing something wrong
<thelema> how are you setting http_user/pass?
<Gertm> http_user := "user";;
<Gertm> I'm doing this in the toplevel to test it, can that have influence?
<thelema> probably not... You've opened the convenience module?
<Gertm> yeah
<thelema> that should work. Try restarting your toplevel and starting from scratch - sometimes the toplevel gets wonky
<Gertm> ok
<Gertm> nope, still doesn't work
<Gertm> check the user/pass with curl again, they work
<Gertm> checked*
<thelema> you get an access denied error?
<Gertm> 401 unauthorized (I enabled the http_verbose)
derdon has joined #ocaml
ikaros has joined #ocaml
<flux> gertm, if everything fails, you could use the curl bindings for ocaml
<flux> they might be a little more complicated to use, however
<Gertm> but it says in the http_client.convenience documentation that basic authentication works, so I must be doing something wrong.. just can't figure out what...
<flux> gertm, have to looked at what it sends?
* Gertm breaks out the sniffer
<thelema> Gertm: what function are you using to make your request?
<flux> gertm, a simple way in unix to find out: strace -s 10000 -o log ./app
<flux> (-e write perhaps)
<flux> it's messier than a sniffer output, though..
<Gertm> thelema: http_get
<Gertm> flux: oh lemme try that first
<flux> gertm, also if you do end up using a sniffer, tcpflow -C 'port 80' is neat
<Gertm> the basic authentication isn't being sent
<thelema> is it trying to send digest auth?
<Gertm> neither
<Gertm> Can't figure it out from the documentation
<Gertm> on to the curl interface I'm afraid
<Gertm> for a 'convenience' library, this is _very_ inconvenient
<flux> :)
<flux> indeed, my simple test of the lib indicated it doesn't say user credentials!
<flux> (although my test didn't cover the case when the server would return no permission and the client would retry)
mutew has joined #ocaml
<flux> gertm, what kind of operation do you need? GET with user/pass into a string?
mutew has quit [Quit: leaving]
avsm has joined #ocaml
avsm has left #ocaml []
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
jimmyb2187 has left #ocaml []
jimmyb2187 has joined #ocaml
<Gertm> flux: yeah, it's a little twitter app I'm making, so basic authentication
tmaeda is now known as tmaedaZ
<flux> gertm, well, using the curl api is quite easy as well, imo, although it's badly documented
<flux> gertm, so first create a curl object: let c = new Curl.handle
<flux> then create a buffer to the response: let b = Buffer.create 1024
<flux> then hook the function for writing the result: let _ = c#set_writefunction(fun length str -> Buffer.add_string b str; length (* wrote legnth nytes *))
<flux> then call the other methods to set magic options
<flux> then let _ = c#perform (* tada, buffer b should now be filled in *)
<Gertm> lemme try that
<flux> and I uppose you need to call c#cleanup finally as well, although I'd hope gc would eventually catch up and handle that
<flux> you get a string out of a buffer with Buffer.contents b
<flux> hmm, actually I might have discovered a big flaw in this approach
<flux> I don't seem to find convenient user/pass functions from curl either ;)
* Gertm kicks curl out the door
<flux> :)
<Gertm> so.. how do I open a socket? :p
<flux> the Unix module has the standard sockets interface
<flux> but you would need to implement auth yourself in that case as well
<flux> so I suppose it's easier to set the proper field in curl
<Gertm> auth isn't so hard to do in html, is it? it's just a base64 encoded user:pass string
<flux> correct!
<flux> actually I might've been wrong
<flux> it's the userpwd option
<flux> and it goes like user:password
<Gertm> Error: The external function `helper_curl_version' is not available
<flux> which is what confused me, because I was expecting a tuple
<flux> gertm, how are you taking curl into use?
<Gertm> #require "curl";;
<flux> hmm
<flux> works for me :) (but I have a shiny new ubuntu karmic x86_64)
<npouillard> thelema: about the multiple plugins the difficutly is more on the semantics and (dyn)linking than choosing where to install them
<Gertm> flux: hmm now I get this: Error: Reference to undefined global `Curl'
<Gertm> argh.. it's like this doesn't want me to write this
<flux> gertm, ocamlfind ocamlc -package curl -linkpkg foo.ml
<flux> gertm, does it work?
<Gertm> yeah
<Gertm> no errors
<flux> there you go then :)
<Gertm> but the toplevel refuses...
<flux> how about the save foo.ml
<flux> (get the new one)
<flux> and ocaml foo.ml
<flux> the save -> the same that is
<Gertm> File "foo.ml", line 1, characters 0-1:
<Gertm> Error: The external function `helper_curl_version' is not available
mutew has joined #ocaml
ttamttam has quit [Read error: No route to host]
ttamttam has joined #ocaml
munga_ has joined #ocaml
<Gertm> bleh I give up
<flux> something's broken
munga_ has quit [Ping timeout: 265 seconds]
<Gertm> there's not really an easy way for me to fix this, is there?
<flux> well
<flux> I'm pretty sure it would work if yuo replaced the distribution-curl with the proper one from its home page?
<Gertm> ok lemme try that
<flux> which linux distribution do you have, btw?
<Gertm> fedora 12
<flux> oh :-o
<flux> bug rwmjones about that :)
<Gertm> you'd expect it to work, wouldn't you?
<flux> indeed!
drunK has joined #ocaml
<mfp> Gertm: are you doing #require "curl";; in the toplevel?
<Gertm> mfp: yeah, that's when I got that error message about the helper_curl_version
<mfp> have you tried building a custom toplevel?
<mfp> with ocamlmktop
<Gertm> no
<Gertm> how would I do that?
<mfp> ocamlfind ocamlmktop -o toplevel -package curl -linkpkg
_unK has quit [Ping timeout: 256 seconds]
<mfp> make that ocamlfind ocamlmktop -o toplevel -package curl -custom -linkpkg
<mfp> $ nm toplevel | grep helper_curl_version
<mfp> 000000000040ee4d T helper_curl_version
<Gertm> 000000000040ecca T helper_curl_version
<Gertm> but when I try to make a new handle: Error: Unbound class Curl.handle
drunK is now known as _unK
* Gertm watches the logic fade
<orbitz> Gertm: can you pastebin your entire shell experience from compiling and running toplevel
<Gertm> ok gimme a sec
* rwmjones missed all that
<mfp> Gertm: try #directory "+curl";; in the custom toplevel
<mfp> then module C = Curl;;
<Gertm> Error: Reference to undefined global `Curl'
ttamttam has quit [Quit: Leaving.]
<Gertm> if you guys want me to paste more, just ask
<Gertm> it works with the toplevel
<Gertm> hmm why does it work with the custom toplevel and not with the standard one?
mutew has quit [Quit: leaving]
* Camarade_Tux wishes godi packages were kept more up-to-date
<mfp> Gertm: I suppose there's some pb when loading the DLL in the std toplevel (maybe it's installed in the wrong dir or such)
Modius has joined #ocaml
<Gertm> it's next to all the others in /usr/lib64/ocaml/
ikaros has quit [Quit: Leave the magic to Houdini]
yakischloba has joined #ocaml
lokydor has joined #ocaml
_zack has joined #ocaml
Alpounet has quit [Quit: ``Do what you think you can't do.'']
Mr_Awesome has joined #ocaml
avsm has joined #ocaml
Yoric has quit [Quit: Yoric]
_zack has quit [Ping timeout: 252 seconds]
vpalle__ has joined #ocaml
vpalle_ has quit [Ping timeout: 252 seconds]
lokydor has quit [Ping timeout: 245 seconds]
djanderson has joined #ocaml
Mr_Awesome has quit [Ping timeout: 272 seconds]
<derdon> why is the ``object (self)`` after the class definition necessary?
avsm has quit [Quit: Leaving.]
<flux> derdon, you mean particularly the (self) ?
<flux> derdon, or the object-part? because you can have plain object instead of that
<flux> and infact you can have an object without a class
<derdon> flux: I mean ``object (self)``, so the word "object", followed by a whitespace, followed by the word "self" enclosed in parentheses
<derdon> I started OOP in ocaml only yesterday
<derdon> I thought the ``object (self)`` is a fixed axpression
<flux> derdon, well, this is a valid statement: let a = object end;;
<flux> derdon, so object/end is a syntax of its own which class just reuses. so that's why you need the word 'object' there
<flux> derdon, (self) is optional, and you only need it if you want to refer to the object itself
<flux> (from within the object)
<flux> derdon, it could even bee object (foo)..
<derdon> flux: then A is an object without any methods or "variables"
<flux> derdon, yes
vpalle__ has quit [Ping timeout: 245 seconds]
<derdon> ok, now I understand it! thanks a lot!
<thelema> flux: good call on using maps - my program runs about 3X faster, having switched from Hashtbl.t to ref PMap.t
<flux> thelema, well, with that kind of hashing behavior I wonder why it's not 300x faster :)
<derdon> flux: so ocaml's self is PHP's and C++'s this
<flux> derdon, yes.
<flux> derdon, in addition, you may use it for getting the type of the this-object
<thelema> derdon: you can call it 'this' if you like. The ocaml tradition is 'self', though.
vpalle__ has joined #ocaml
<flux> derdon, like: object (self : 'self) method foo : 'self -> 'self = fun o -> .. end
<derdon> thelema: then I will call it self ;)
<derdon> thelema: I am used to self because I know python a bit
BigJ has joined #ocaml
yakischloba has quit [Quit: Leaving.]
ulfdoz has joined #ocaml
mutew has joined #ocaml
seanmcl has joined #ocaml
Alpounet has joined #ocaml
_andre has quit [Quit: Lost terminal]
Asmadeus has quit [Ping timeout: 240 seconds]
Camarade_Tux has quit [Ping timeout: 240 seconds]
Asmadeus has joined #ocaml
Camarade_Tux has joined #ocaml
Submarine has quit [Quit: Leaving]
bluestorm has joined #ocaml
yakischloba has joined #ocaml
mutew has quit [Quit: leaving]
smimou has quit [Quit: bli]
Associat0r has joined #ocaml
yakischloba has quit [Quit: Leaving.]
yakischloba has joined #ocaml
itewsh has joined #ocaml
<hcarty> thelema: Is the Batteries module BatList meant to be a replacement for List?
<hcarty> thelema: Or should they both be 'include'd in a new List module?
<hcarty> If not, then BatList.iter (and possibly other list functions) are missing
<hcarty> s/are/is/
<hcarty> Judging from the documentation, I'm not sure what the intent is
Mr_Awesome has joined #ocaml
pad` has joined #ocaml
<flux> maybe only the documentation is missing those
<flux> because module L = BatList lists iter
<flux> (twice, once for .Labels as well)
<hcarty> flux: Hmm - how odd. "module L = struct include BatList end L.iter;;" doesn't work here (Batteries 1.0.1)
<flux> hmm, indeed, it _is_ odd :)
<flux> actually, I must've misread it, it was iteri, not iter
<hcarty> Odd suddenly became less odd
<flux> :-)
<flux> it even lists iter2
<flux> but not iter
<flux> so maybe it's a (big..) oversight?
<hcarty> BatArray.iter is there
<hcarty> That is my guess
<flux> I wonder what we should assume about the user base of Batteries so far. well, maybe they don't do imperative code ;-).
<hcarty> Batteries.List.iter exists, but batteries.ml uses "module List = struct include List include BatList end"
<hcarty> It's a subtle hint :-)
<hcarty> The included ocamlinit and battop.ml also seem to put the toplevel in a semi-revised syntax state
<hcarty> Input is in the normal syntax
<hcarty> But types are reported in revised.
<thelema> hcarty: the documentation lists only the functions that are provided in batteries
<hcarty> "# [1;2;3];;" --> "- : list int = [1; 2; 3]"
<hcarty> thelema: But BatList.iter does not exist
<thelema> correct. You can't call BatList.iter
<hcarty> Is there a reason BatArray.iter exists but BatList.iter does not?
Submarine has joined #ocaml
<hcarty> thelema: I don't want to report bugs without understanding the philosphy behind these decisions
djanderson has quit [Quit: back later]
<thelema> hcarty: legacy code in batArray - for some reason we have a lot of [let foo = foo] in BatArray
* thelema fixes...
<hcarty> thelema: Ok - so the BatList module structure of "open on top of stdlib List" is the Batteries Way?
<hcarty> As batteries.ml does?
<thelema> yes.
<thelema> this way our modules have interfaces that don't depend on stdlib (except for batteries.ml)
<hcarty> thelema: Ok, thanks. That makes sense.
<thelema> no problem.
<thelema> I'm almost done fixing batteries
<hcarty> Commenting out line 77 of battop.ml "fixes" the mixed syntax issue. Which is odd, since that line seems to set the syntax to standard...
<hcarty> thelema: I can send a patch if desired, though I'm not sure why that line is there.
<thelema> do the rest of the syntax extensions still work?
<thelema> Do you want credit for the fix in git? If not, I'll delete that line and commit myself.
<thelema> if so, it's easiest for me if you make a patch
<hcarty> thelema: No, they don't
<thelema> yes, there's something about loading syntax extensions that bumps the toplevel into revised responses.
<thelema> probably not a bug in batteries proper, but somewhere in p4
<hcarty> I don't need/want credit. And that's a very odd result :-)
Yoric has joined #ocaml
<hcarty> It worked with Batteries-old, but there was a lot more boilerplate there.
* thelema is happy to get rid of *lots* of boilerplate
<flux> so when using batteries, am I supposed to use BatList or Batteriest.List?
<flux> open Batteries in the top and after that I use List etc?
<thelema> flux: For easiest usage, [open Batteries]
mutew has joined #ocaml
<thelema> flux: if you want to save executable size, you'll have to access the BatFoo modules directly, so you only include the ones you need.
Drk-Sd has joined #ocaml
<thelema> hcarty: fix for Array's extra functions pushed to git.
<thelema> hcarty: thank you for helping me correct this.
<hcarty> thelema: I'm glad to help where I can
Yoric has quit [Quit: Yoric]
mutew has quit [Read error: Operation timed out]
<hcarty> I think I will just do without the Batteries extensions for now. I don't use them much at this point.
<hcarty> Though the Print.* module + syntax is really wonderful
<hcarty> Just missing proper support for field widths IIRC
pad` has left #ocaml []
maelcoluim has joined #ocaml
mbana has quit [Remote host closed the connection]
lokydor has joined #ocaml
Yoric has joined #ocaml
seanmcl has quit [Quit: seanmcl]
<orbitz> oh what i woudln't give for a better typed Python
CcSsNET has joined #ocaml
CcSsNET has quit [Remote host closed the connection]
vpalle__ has quit [Quit: Leaving]
CcSsNET has joined #ocaml
Submarine has quit [Ping timeout: 256 seconds]
<thelema> hcarty: I really like *.print because of the ease of printing complex structures
<thelema> orbitz: oddly, that's what I just read f# described as
<orbitz> thelema: i consdier ocaml python-with-a-better-typesystem. ocaml just lacks some library stuff i need
<thelema> orbitz: polymorphic print?
<orbitz> heh no
<orbitz> thelema: sadly whre I am right now they wouldn' tbe too into me switching out our Python either
itewsh has quit [Quit: There are only 10 kinds of people: those who understand binary and those who don't]
CcSsNET has quit [Read error: Connection reset by peer]
slash_ has quit [Quit: leaving]
<hcarty> thelema: Yes, the Print module and related functions are wonderful in that regard. I think the syntax extension just needs a little cleanup.
smimou has joined #ocaml
<hcarty> thelema: Is there a module naming standard for Batteries now? I remember there was a decision to use Names_like_this rather than NamesLikeThis at one point, but I have been out of the loop for a few months.
bluestorm has quit [Ping timeout: 256 seconds]
Alpounet has quit [Quit: ``Do what you think you can't do.'']
Yoric has quit [Quit: Yoric]
travisbrady has joined #ocaml
derdon has quit [Quit: derdon]
Chile has joined #ocaml
<travisbrady> thelema: pardon me for the dumb question, but how do I compile if I'd like to use BatEnum and stuff like (--), (//) etc? I'm trying "ocamlfind ocamlc -package batteries test.ml" but i'm getting "Reference to undefined global `Batteries'"
Drk-Sd has quit [Quit: .]
Drk-Sd has joined #ocaml
<hcarty> travisbrady: Try "ocamlfind ocamlc -package batteries -thread -linkpkg test.ml"
<travisbrady> hcarty: ahh, that did it, thank you. I keep forgetting the -thread bit
<hcarty> travisbrady: You're welcome. Hopefully the "-thread" part can be automated at some point.
lokydor has quit [Ping timeout: 252 seconds]
Alpounet has joined #ocaml
tmaedaZ is now known as tmaeda
mutew has joined #ocaml
mutew has quit [Client Quit]