Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
gene9 has joined #ocaml
gene9 has quit [Client Quit]
systems has joined #ocaml
<systems> hi
<whee> hello~
<systems> whee :)
jemfinch has quit [Read error: 104 (Connection reset by peer)]
systems has quit ["Client Exiting"]
<whee> I need to stop coming up with programming projects that require thinking
<kjs3> Thinking...gawd forbid...:-)
<whee> yes, it's bad :(
<whee> I'm aiming to write a program that, given a list of courses and their offered times, will product all possible schedule configurations
<whee> product/produce :|
<whee> it'd also have some sort of scoring system to eliminate the horrible schedules that noone in their right mind would want
<whee> it'd be pretty cool if this works out, I know of quite a few people here who hate doing scheduling (including me :P)
docelic has quit ["Client Exiting"]
docelic has joined #ocaml
jao is now known as jao_away
lameAFK has quit ["mental mantle"]
lament has joined #ocaml
skylan has quit ["Reconnecting"]
skylan has joined #ocaml
docelic has quit ["brb"]
<whee> my parser worked first try. something is wrong :(
<whee> also, anyone here? heh
<whee> mmm nevermind :)
docelic has joined #ocaml
docelic has quit [Client Quit]
docelic has joined #ocaml
<whee> I wish ocaml had more list functions :\
<lament> use lisp!
<whee> :P
<whee> lisp have a function for list intersections?
<whee> since that's what I need right now
<lament> hm
<lament> that's real easy to do in python or haskell with list comprehensions
<whee> it's a one-liner to write, but it should be included in the standard libraries :|
<lament> does ocaml have comprehensions?
<whee> not at the moment
<lament> oh.
<whee> I've seen them added through camlp4, though
<lament> in python it's [x for x in foo if x in bar]
<whee> yep, haskell does have an intersect function for lists. bah. heh
<lament> heh
<whee> I'd use haskell except I really don't feel like I can do anything with it
<whee> maybe my next project will be something bigger
<whee> like creating a set of libraries that add things from other languages; like most of haskell's prelude
<whee> plus list comprehensions via camlp4, things like that
<mellum> I want to make a small parser for assembler code, is ocamllex/ocamlyacc the way to go?
<whee> one of the easier ways, yes
<mellum> easy is important :)
<whee> I use ocamllex/ocamlyacc for parsing anything with a bit of structure to it
<whee> it works pretty well
<mellum> I vaguely remember there's some other method with a "parser" keyword...?
<whee> those are streams
<mellum> What's the difference?
<whee> streams are a little harder to work with imo
<mellum> BTW, perhaps you have a small working example for ocamllex/ocamlyacc?
<whee> sure, hold on
<whee> I'll just package up my current project :)
<mellum> whee: what's your project?
<whee> writing something that'll create schedules given some courses and times they're offered
<whee> so I don't have to waste time sorting things out next time I need to get a schedule going :)
<whee> untar, run make, run it as ./haq :)
<whee> it should be easy to understand how it works, all it does is parse at the moment
<whee> of course I also don't handle parsing errors gracefully yet
<mellum> whee: thanks, I'll check it out
<whee> currently racking my brain as to how to actually create all the combinations, heh
<whee> gah, I should know this
<whee> given a list of lists of integers there's a nice simple way to print out all the combinations but I'm an idiot :(
<whee> once again it's a one liner in haskell. heh
<whee> damn the man for list comprehensions
<whee> I'd kill for list comprehensions in ocaml right about now :(
lament is now known as lameAFK
<asqui> okay
<asqui> someone explain this to me
<asqui> let rec qint_sort = fun
<asqui> | (h::[]) -> [h]
<asqui> | (h::t) ->
<asqui> match (qint_split h t) with
<asqui> | (a, b) -> (qint_sort a) @ [h] @ (qint_sort b);;
<asqui> Warning: this matching is not exhaustive.
<asqui> (qint_split : 'a -> 'a list -> 'a list * 'a list = <fun>)
<asqui> ie. qint_split takes a foo and list of foo, returns a product of lists of foo.
<asqui> I match the result with (a, b) and apparently this isnt exhaustive
<asqui> WHAT
<asqui> GIVES
<asqui> or is it referring to the other matching?
<whee> that's because it's not
<whee> qint_sort doesn't match []
<asqui> Great
<asqui> Why is it ever getting called with the empty list?
<whee> it could
<asqui> yes good point
<whee> unspecified behavior = bad
<asqui> question, how do i terminate the match ... with ... statement
<whee> you could enclose it in parenthesis
<asqui> right
<whee> that's one of the reasons I use revised syntax :)
<asqui> sounds like a gameplan
<asqui> | [] -> failwith "You are a gay homo"
<asqui> #qint_sort [7;3;6;2;8;5;4;6;2;6;];;
<asqui> Uncaught exception: Failure "You are a gay homo"
<whee> match a with [ [] -> match b with [ (x, y) -> doop ] | [x::xs] -> bloop ]
<whee> no need for figuring out where match starts/ends with revised
<asqui> Shouldnt those be () as opposed to []?
<whee> hmm?
<asqui> arent square braces a list constructor?
<whee> a is being matched with a list, b matched with a tuple
<asqui> okay, explain....
<whee> explain what :P
<asqui> match a with [ [] -> match b with [ (x, y) -> doop ] | [x::xs] -> bloop ]
<whee> heh
<asqui> im using caml light btw...
<whee> you'd have to use parens then
vom_Fenster has joined #ocaml
lameAFK is now known as lament
<asqui> ah ok
<asqui> great. only took me hours to get my head around this basic recusrion
docelic has quit ["kernel upgrade"]
aleksi has quit [Read error: 110 (Connection timed out)]
docelic has joined #ocaml
vom_Fenster has quit [Read error: 104 (Connection reset by peer)]
docelic has quit ["Client Exiting"]
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
mellum has quit [Read error: 110 (Connection timed out)]
systems has joined #ocaml
mellum has joined #ocaml
systems has quit [Connection timed out]
jao_away is now known as jao
* jao is back (gone for 10:12.21)
SoreEel has quit [Read error: 104 (Connection reset by peer)]
vom_Fenster has joined #ocaml
lament has quit ["mental mantle"]
mattam_ has joined #ocaml
systems has joined #ocaml
systems has quit ["Client Exiting"]
interoz has joined #ocaml
<interoz> hi all
<interoz> let rec reverse' = function
<interoz> [] -> []
<interoz> | x::xs -> (reverse' xs) @ x;;
<interoz> how come the type is val reverse' : 'a list list -> 'a list = <fun> ?
<interoz> i thought 'a list
<mattam_> ... @ [x] ?
<interoz> ? i dont get it
<mattam_> if you write [x] instead of x
<mattam_> @ concatenate two lists, so x is a list for caml
<interoz> ah!
<interoz> and if i write [x] i get what i wanted?
<mattam_> i think so
<interoz> thanks alot :)
<interoz> i am a rookie
<mattam_> :)
<interoz> btw, what can i do with ocaml? is there any graphic possibility or something like that'
<interoz> ?
vom_Fenster has quit [Read error: 110 (Connection timed out)]
interoz has quit ["bye all, thanks and take care"]
smklsmkl has quit [Remote closed the connection]
xmkl has joined #ocaml
<whee> nuts
<whee> people always leave before I can answer questions :)
<whee> oh well, back to writing assembly :|
mellum has quit ["ircII EPIC4-1.1.7 -- Are we there yet?"]
<whee> I feel like I should get a 68000 cross compiler and do my work in C :)
mattam_ has quit ["[BX] Captain Kangaroo uses BitchX. Shouldn't you?"]
docelic has joined #ocaml
vom_Fenster has joined #ocaml
matkor has joined #ocaml
<whee> haha my schedule program works
<whee> all I need to do is add some sort of ratings system so I don't have to sift through so much
<whee> http://smaerty.ath.cx/scheduler/full_output.txt <- my work is done. dinner time. ehhehe
matkor has quit [Remote closed the connection]
docelic has quit ["later"]