gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Inscription for OCaml Meeting 2010 is opened http://wiki.cocan.org/events/europe/ocamlmeetingparis2010
lokydor has quit [Read error: 110 (Connection timed out)]
johnnowak has joined #ocaml
avsm has quit ["Leaving."]
tmaeda is now known as tmaedaZ
snowbeard has joined #ocaml
Oxyd has quit ["leaving"]
joewilliams has quit ["Leaving..."]
joewilliams has joined #ocaml
joewilliams has quit [lindbohm.freenode.net irc.freenode.net]
Mr_Awesome has quit [lindbohm.freenode.net irc.freenode.net]
Alpounet has quit [lindbohm.freenode.net irc.freenode.net]
infoe- has quit [lindbohm.freenode.net irc.freenode.net]
fabjan has quit [lindbohm.freenode.net irc.freenode.net]
CcSsNET has joined #ocaml
peper has joined #ocaml
<peper> hello
<peper> anyone know how to capture ctrl + click in lablgtk? :)
<CcSsNET> omg thats a rediculas hotkey :D
<peper> why? :)
* CcSsNET finds a use for it
<peper> CcSsNET: anyway, any idea how? :)
<CcSsNET> nope :-/
joewilliams has joined #ocaml
Mr_Awesome has joined #ocaml
Alpounet has joined #ocaml
infoe- has joined #ocaml
fabjan has joined #ocaml
_unK has quit [Remote closed the connection]
maskd has quit ["fh"]
ski_ has joined #ocaml
Modius_ has joined #ocaml
Modius has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
alexyk has joined #ocaml
alexyk has quit []
johnnowak has quit []
ulfdoz has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
yakischloba has joined #ocaml
<Tianon> is the 1.0 code in thelema's github repo considered working / stable?
<Tianon> (for batteries-included)
yakischloba has quit ["Leaving."]
caligula__ has joined #ocaml
joewilliams has quit [Remote closed the connection]
CcSsNET has quit [Read error: 110 (Connection timed out)]
ulfdoz has quit [Read error: 110 (Connection timed out)]
djanderson_ has joined #ocaml
caligula_ has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
demitar has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
Modius_ has quit [Read error: 54 (Connection reset by peer)]
yakischloba has joined #ocaml
demitar has quit ["Ex-Chat"]
fx___ has joined #ocaml
avsm has joined #ocaml
ttamttam has joined #ocaml
avsm has quit ["Leaving."]
djanderson_ has quit []
quelqun_dautre has quit [Read error: 60 (Operation timed out)]
rwmjones_lptp has joined #ocaml
rwmjones_lptp is now known as rwmjones
yakischloba has quit ["Leaving."]
ttamttam has quit ["Leaving."]
_zack has joined #ocaml
ttamttam has joined #ocaml
caligula__ has quit [Excess Flood]
caligula__ has joined #ocaml
tmaedaZ is now known as tmaeda
rwmjones has quit ["This computer has gone to sleep"]
rwmjones has joined #ocaml
munga has joined #ocaml
avsm has joined #ocaml
Yoric has joined #ocaml
_andre has joined #ocaml
maskd has joined #ocaml
sgnb has quit [Read error: 60 (Operation timed out)]
Guest55111 has quit [Read error: 104 (Connection reset by peer)]
munga has quit [Read error: 110 (Connection timed out)]
mal`` has quit [Client Quit]
mal`` has joined #ocaml
pimmhogeling has joined #ocaml
<mrvn> Tianon: That is what 1.0 is suposed to mean
_unK has joined #ocaml
th5 has joined #ocaml
alexyk has joined #ocaml
ski_ has quit ["Lost terminal"]
ksson has joined #ocaml
pimmhogeling has quit [Read error: 104 (Connection reset by peer)]
valross has quit ["Ex-Chat"]
pimmhogeling has joined #ocaml
alexyk has quit []
tmaeda is now known as tmaedaZ
<emias> Is there a recommended book for digging into OCaml? From searching around, Jason Hickey's introduction and the online translation of "Développement d'applications avec Objective Caml" seem to be popular. Is either of these (or some other writing) usually preferred?
<julm> that book is great
<emias> Which one? :-) Jason Hickey's "Introduction to Objective Caml" or the tranlation of "Développement ..."?
ikaros has joined #ocaml
<gildor> emias: the translation of "Développement ..." is probably a better choice
<julm> second
<emias> I see. Thank you.
<gildor> I started with it and it gives me a pretty good taste of OCaml
<gildor> emias: (note: some examples might be outdated)
<emias> Yup, I figured it's old-ish ...
shr3kst3r has joined #ocaml
alexyk has joined #ocaml
johnnowak has joined #ocaml
johnnowak has quit [Read error: 104 (Connection reset by peer)]
yziquel has quit [Ping timeout: 180 seconds]
Spiwack has joined #ocaml
_unK has quit [Remote closed the connection]
tmaedaZ is now known as tmaeda
<Alpounet> nice talk.
tmaeda is now known as tmaedaZ
<th5> that's the one where he builds a simple MAKE right? i really liked those slides
th5 has quit [Client Quit]
ikaros has quit ["Leave the magic to Houdini"]
ikaros has joined #ocaml
alexyk has quit []
boscop has joined #ocaml
<boscop> hi. how would you handle mutable game state in functional programming?
<mrvn> boscop: practicably? With mutable. Theoretically? By passing a global ENV binding around all the time and altering that.
<boscop> ENV = environment?
<thelema> yes
<boscop> is it possible (and scalable, fun, ...) to do everything functional and not object-oriented?
<mrvn> other languages do it
<boscop> in what way is the functional way superior to the OO way except for concurrency?
<mrvn> in everything and nothing.
<boscop> I've tried to find a site where several programming problems are solved with OO and functional approach and then compared how elegant the solution is, but I couldn't find one
<thelema> boscop: for one, they both discourage global state, but do so in very different ways
<mrvn> thelema: I don't see OO that way. That just puts global states in namespaces.
<thelema> you could compare ruby (or python) vs. ocaml on the PLshootout
<thelema> mrvn: yes, OO hides global state within objects
<boscop> but if you have to have a global environment binding for mutable (game) state, isn't that against the goal?
<thelema> making it a local state.
<mrvn> But a singleton is just as global.
<mrvn> boscop: No. For me the goal is to combine what works best.
<thelema> mrvn: true, but singletons are pretty non-OO
<mrvn> If the state is global then OO has either a singleton or a global object.
<mrvn> Never seen anyone passing an state object around in OO.
<mrvn> boscop: If you go purely functional you can't have O(1) random access arrays.
<thelema> mrvn: really?
<thelema> you can't have O(1) lookup arrays?
<mrvn> read-only, true.
<mrvn> But then write acces is O(n)
<thelema> yup. Mutating the array = forbidden.
<thelema> slicing the array can still be cheap, but yes, writes become expensive with large, immutable, monolithic structures
<mrvn> And if you speed up writes then reads become slower.
<thelema> via trees, yes
<mrvn> I really prefer to have the choice to use a mutable array when that is more usefull. Or objects. Or functional structures. Ocaml allows all.
<mrvn> That makes it such "fun"
shr3kst3r has quit [Read error: 60 (Operation timed out)]
<thelema> I like choices too. Although I find Objects rarely the right choice
shr3kst3r has joined #ocaml
tmaedaZ is now known as tmaeda
<boscop> is there a good ocaml web framework?
<julm> ocamlnet ?
<Spiwack> ocsigen
shr3kst3r has quit [Remote closed the connection]
<Yoric> OPA :)
<Spiwack> OPA isn't ocaml, is it?
<Yoric> Nope.
<Yoric> Just a shameless plug :)
<Spiwack> Should I sue you for dishonest advertising, then?
<Spiwack> (is it available to start with? So that I can check on it some day)
<thelema> despite what OPA isn't, it is the only ocaml-ish web framework I'd use.
<Spiwack> Oh ?
<Camarade_Tux> why not ocsigen?
<Spiwack> So I guess that'd require some comments.
<Spiwack> I'd be interested indeed, as Camarade_Tux put: "why not ocsigen?"
shr3kst3r has joined #ocaml
derdon has joined #ocaml
<Yoric> Spiwack: sure, it's available. I can give you the URL but I might be sued for complete spamming :)
<boscop> where to look for ocaml libraries? is there something like CPAN?
* Yoric wishes to thank thelema for the support.
<Yoric> boscop: google for "caml hump".
joewilliams has joined #ocaml
<Spiwack> The support is incomplete. We want hints and arguments of why.
<Spiwack> (support to the OPA cause, I mean)
<Yoric> More concise, more powerful.
<Yoric> That's just the hints, no time for arguments atm.
* Yoric is currently working on improving a lot the OPA stdlib.
<Spiwack> These looks more like a slogan than a hint. Though I'm quite able to take the "more concise" for granted.
<Spiwack> Well, anyway, time is of the essence.
<Spiwack> But then again, this'd be an interesting debate to have someday.
<Spiwack> To try and understand what both approach have to offer.
fx___ has quit [Read error: 60 (Operation timed out)]
<thelema> oscigen seems liks it's too structured - generating html programmatically isn't my thing.
<mfp> thelema: you're not forced to use the XHTML module though; you can use any templating system you want
<thelema> The structure of the HTML drives the structure of your code - this seems wrong
<Spiwack> I am not sure what the alternative is. Then again, I don't quite know OPA.
<thelema> fair enough, maybe I'm just really unhappy with the xhtml module.
<Spiwack> Well, you can build a higher abstraction.
<Spiwack> I have only prototype websites in Ocsigen, but really, It doesn't quite feel like writing html (appart when writing chunks of text, when it cannot really be helped)
<thelema> true. I guess it fails my test of "simple things easily, complex things possible"
<Spiwack> It seems to me that what you mean is that there lacks tool in Ocsigen.
<Spiwack> tools*
<Spiwack> (which is a fair criticism)
fx_ has joined #ocaml
demitar has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Client Quit]
_unK has joined #ocaml
yakischloba has joined #ocaml
Drk-Sd has joined #ocaml
Drk-Sd is now known as Drk-Sd`
Drk-Sd` is now known as Drk-Sd
Drk-Sd is now known as Drk-Sd`
ulfdoz has joined #ocaml
boscop has quit [Client Quit]
_zack has quit ["Leaving."]
djanderson has joined #ocaml
jeddhaberstro has joined #ocaml
alexyk has joined #ocaml
ksson has quit ["leaving"]
demitar has quit [Read error: 110 (Connection timed out)]
demitar has joined #ocaml
demitar has quit [Connection reset by peer]
ikaros has quit ["Leave the magic to Houdini"]
ttamttam has quit ["Leaving."]
joewilliams has quit [Remote closed the connection]
tmaeda is now known as tmaedaZ
joewilliams has joined #ocaml
avsm has quit ["Leaving."]
Submarine has joined #ocaml
Spiwack has quit [Remote closed the connection]
_zack has joined #ocaml
mbac has joined #ocaml
<mbac> Header.find headers ~f:(function Content_length length -> length)
<mbac> does that interface strike you as beautiful or horrible?
<mbac> implemented by: let find ~f = List.find_map ~f:(Option.wrap_exn f) |! Option.value_exn
djanderson has quit []
brendan has joined #ocaml
<mfp> mbac: looks better without the ~f: label, if you ask me
djanderson has joined #ocaml
<mbac> what, no comment on relying on match to throw unmatched pattern? :)
<thelema> mbac: your |! = Batteries.(|>) ?
<thelema> maybe |-
<thelema> function composition?
<mbac> let ( |! ) a b = b a
<mfp> the pattern is not exhaustive? ugh
<thelema> umm, does that work? You're missing an argument to find_map then
<thelema> mbac: ok, your |! = Batteries' |> (which looks better, imnsho)
<mbac> it's relying on partial application also
alexyk has quit []
<thelema> unless your Option.value_exn takes a function as argument, I don't see how it works.
<mbac> oh right the |! makes that impossible
itewsh has joined #ocaml
<thelema> which is where batteries' (|-) comes in - let ( |- ) f g x = g (f x)
<mbac> oh, that's handy
<mbac> i will appropriate that :)
<thelema> please appropriate as much of batteries as you want.
<mbac> anyway what i'm trying to do is make a tagged union for http headers but also allow easy access without writing two dozen accessor functions
<mbac> so something like find headers ~f:(function Content_length x -> x) seems like the easiest way to grab it (and throw an exception if doesn't exist)
<thelema> there's not that many http headers that are important - write accessors for those and do whatever for the rest
<mbac> they're all important to someone
<thelema> and why not expose the whole thing as a map of some kind (string,string) Hashtbl.t
<mbac> i demand easy access to TE, damnit
<Tianon> thelema: speaking of Batteries, every time I build and install (on Gentoo here), it builds fine, and appears to run the tests just fine (although having an example of "good" omake test output would be a nice addition to the repo), but whenever I try to do anything with it from the interactive shell (open Batteries, open BatArray, etc.), I get a fatal error about index out of bounds (can pastebin full log if it would be helpful)
<thelema> Tianon: please
<mbac> because each header field value isn't always a string
<mbac> or, rather, best represented by a string
<thelema> mbac: at some level it is, and http allows arbitrary header fields.
<mbac> it does, but arbitrary header fields can get their own tag
<mbac> Extension of string * string :)
<thelema> why do you want to pre-parse the header fields instead of providing all the different parsing functions that could be needed?
<thelema> s/header fields/header field values/
<thelema> and almost all are strings, the few that aren't are the exception and can be handled by either a list parser or int_of_string
<mbac> i'm preparsing them because i believe it'll be easier to write content fudging proxies this way
<flux> mbac, there's a camlp4 module that gives irrefutable pattern matching without disabling the warning globally, where you need
<flux> mbac, don't remember where it is, though :). pretty sure it's bluestorm's writing..
<flux> pa_irrefutable.ml maybe
<Tianon> thelema: just let me know if you want me to dig around and pastebin more stuff :)
<thelema> Tianon: can you edit your batteries.ml file in the root of the source dir to set ext_syntax = false?
<Tianon> certainly :)
ikaros has joined #ocaml
<thelema> then reinstall (omake uninstall install) to put that file in the right place
<thelema> alternately, you could change your .ocamlinit to load the copy of batteries.ml that you edited.
<Tianon> hmm, there isn't 'ext_syntax' in batteries.ml, or anywhere in src directory, for that matter
<mbac> e.g. let quiet_headers = List.map headers ~f:(function Host (host, 80) -> Host (host, 22080) (* use ssh tunnel *) | User_agent _ -> User_agent "noyb" | Pragma stuff -> Pragma "no-cache" :: stuff | h -> h), etc.
<thelema> Tianon: not in the src directory, right above that.
<Tianon> oh, heh, my bad :)
<Tianon> there it is :)
<thelema> sorry, not the src/ dir, the source dir.
_andre has quit ["*puff*"]
<Tianon> hey, no nasty Symtable error anymore, and no more fatal error when I load the modules
<thelema> but we've not really solved the problem, we just disabled the camlp4 extensions
<Tianon> right :)
<thelema> next, put it back to true, and find the line "Topfind.load_deeply ..."
<thelema> should be L73 in batteries.ml
<thelema> try removing each of batteries.pa_string.syntax and batteries.pa_comprehension.syntax and see if it works with one of them.
<thelema> or if it works with neither of them.
<thelema> Another thing to do to get more debug info is to change L41 to [Sys.interactive := true;;]
<Tianon> ok, tried with one, then the other of the pa_, then with neither, and none of those worked (same behavior as before), on to getting more debug info :)
<thelema> so it doesn't work just loading camlp4?
<Tianon> nope :/
<Tianon> and setting Sys.interactive to true didn't add anything
<Tianon> also, I've got two computers both running Gentoo here, and they've both got this same issue
<thelema> ok, try making the interactive change on your ~/.ocamlinit
<thelema> it should have a similar Sys.interactive line
<Tianon> well, that gave more output
<thelema> pastebin please.
<Tianon> I'll pastebin and let you decide if it's helpful output :P
<thelema> disable your ~/.ocamlinit
<thelema> start the toplevel and put in:
<thelema> #use "topfind";;
<thelema> #camlp4o;;
<thelema> yup, your camlp4 is borked...
<thelema> what was the cause of the missing dynlink... Some compilation problem, iirc
<thelema> something changed in how camlp4 has to get compiled
<thelema> maybe
<thelema> try [#load "dynlink.cma";;] before #camlp4o;;
<Tianon> adding #load "dynlink.cma";; before #camlp4o;; seems to have worked
<thelema> ok, patch your camlp4-META file like this:
<thelema> should be /usr/lib/ocaml/METAS/META.camlp4
<thelema> well, could be that.
babalu has joined #ocaml
<thelema> This bug should have been fixed in findlib 1.2.5
<Tianon> yeah, I noticed I was running 1.2.3, so I'm updating
<Tianon> heh, update to 1.2.5 fixed it (#use "topfind";; #camlp4o;;)
ikaros has quit ["Leave the magic to Houdini"]
<thelema> that should fix the whole thing with no changes to batteries
<Tianon> cool, thanks, will give it a shot :) it may seem silly, but it might not be a bad idea to mention that findlib needs to be > 1.2.3 in the readme, now :)
ikaros has joined #ocaml
<thelema> will od.
<thelema> *do
<thelema> pushed
alexyk has joined #ocaml
<Tianon> many thanks :)
<thelema> you're welcome. Keep reporting bugs.
<Tianon> I'll do my best! Maybe now I'll actually be able to find meatier ones than simple "AAA still mentioned" :)
<thelema> Vote on the issues that'll help you in the tracker
<Tianon> That I can surely do :)
joewilliam has joined #ocaml
ygrek has joined #ocaml
<Tianon> by the way, after upgrading to findlib 1.2.5, everything is working :) thanks again! :)
<thelema> you're welcome.
joewilliams has quit [Read error: 113 (No route to host)]
rwmjones has left #ocaml []
fx_ has quit [Read error: 110 (Connection timed out)]
fx_ has joined #ocaml
ttamttam has joined #ocaml
djanderson has quit []
<babalu> hello, if i have a file a.ml which defines some type t = Const of int | Const2 of int blabla ... how can i make a matching on constructors on a file b.ml (i.e. match v with Const i | Const2 i) etc.; for now, if i try to compile, i get Unbound constructor Const
<mrvn> A.Const i
<babalu> mrvn: even if do open A in b.ml?
<babalu> even if i write*
<mrvn> Nope, then the A. is implicit
<thelema> if you do [open A], then it should work without the A
<thelema> "A."
<mrvn> same if you include A
sgnb has joined #ocaml
<thelema> but you probably shouldn't include A, and you probably should keep the functions that manipulate the internals of A's types within A
<mrvn> and opening A pollutes your namespace. So A.Const usualy is best
<mrvn> Sometimes you also see module A = Another_module_with_a_too_long_name_to_type_every_time
<thelema> yup
<babalu> if i do open A; and match with Const i got the error, and i still got the error even if i match with Const.A
<thelema> babalu: do you have an a.mli file?
<babalu> thelema: oh, this works if i remove the .mli file, should i define my type in the .mli file also?
<thelema> babalu: yes, the mli file is like a filter of what's available from the .ml file.
<babalu> thanks it's better now :)
<mrvn> babalu: you only need the mli file if you want to hide something from the ml file. Otherwise remove it.
<babalu> mrvn: it's for a class project so i thought that would be the right place to tell which function does what
<mrvn> I would do that in the ml file
<babalu> ok thanks
fx___ has joined #ocaml
fx_ has quit [Read error: 104 (Connection reset by peer)]
ygrek has quit [Remote closed the connection]
joewilliam has quit [Remote closed the connection]
jeddhaberstro has quit [Client Quit]
Yoric has quit [Excess Flood]
<olegfink> is there a tiny toy compiler written in ocaml? there are nice interpreters on plzoo, but I'd like an equivalently toy-ish compiler.
avsm has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
avsm has quit ["Leaving."]
_zack has quit ["Leaving."]
djanderson has joined #ocaml
antoinexp has joined #ocaml
djanderson has quit []
ttamttam has quit ["Leaving."]
itewsh has quit [Client Quit]
antoinexp has quit ["ChatZilla 0.9.86 [Firefox 3.5.6/20091215231400]"]
ikaros has quit ["Leave the magic to Houdini"]
quelqun_dautre has joined #ocaml
CcSsNET has joined #ocaml
sgnb has quit [lindbohm.freenode.net irc.freenode.net]
sgnb` has joined #ocaml
jeddhaberstro has joined #ocaml
joewilliams has joined #ocaml
BigJ has quit ["Leaving"]
derdon has quit []
BigJ has joined #ocaml
avsm has joined #ocaml
Guest43967 has quit [Remote closed the connection]
joewilliams has quit ["Leaving..."]
joewilliams has joined #ocaml
patronus has joined #ocaml
Submarine has quit ["Leaving"]
avsm has quit ["Leaving."]
tmaedaZ is now known as tmaeda
babalu has quit [Remote closed the connection]