cymonts has joined #ocaml
<exarkun> hmm
<exarkun> recursive anonymous functions?
skylan has joined #ocaml
cymonts has quit [Operation timed out]
gl has quit [Read error: 110 (Connection timed out)]
gl has joined #ocaml
skylan has quit ["on vacation in AZ, USA for four weeks. ^_^"]
gl has quit [Read error: 113 (No route to host)]
gl has joined #ocaml
<smkl> exarkun: you need to use "let rec y f x = f (y f) x" for those
* exarkun tries to wrap his head around that.
<smkl> there is no point in making recursive anon. functions, though
<exarkun> convenience
<exarkun> or laziness
<exarkun> whichever you prefer :)
<smkl> big anon. functions are often confusing. i always use local function definitions instead
<exarkun> That's what I ended up doing, but I was just looking for a quick way to do something like "function x -> if x == 0 then [] else <this function>(x - 1) @ [x]"
<smkl> y (fun this x -> if x = 0 then [] else this (x-1) @ [x])
mr_bubbs has quit [vinge.openprojects.net irc.openprojects.net]
exarkun has quit [vinge.openprojects.net irc.openprojects.net]
scipient has quit [vinge.openprojects.net irc.openprojects.net]
Belgarion has quit [vinge.openprojects.net irc.openprojects.net]
tmcm has quit [vinge.openprojects.net irc.openprojects.net]
exarkun has joined #ocaml
tmcm has joined #ocaml
Belgarion has joined #ocaml
mr_bubbs has joined #ocaml
scipient has joined #ocaml
gl has quit ["La foule est une somme d'erreur qu'il faut corriger."]
<mr_bubbs> taureg sure is borking up the indents here
<mr_bubbs> and it doesn't seem to be an awfully complex indent either
<mr_bubbs> smkl: how long have you been doing caml?
exarkun is now known as basicpascalccppj
basicpascalccppj is now known as exarkun
<smkl> mr_bubbs: about 4 years, since version 1.06 or something
ott has joined #ocaml
ott has left #ocaml []
<mr_bubbs> smkl: ahh, cool
<mr_bubbs> you primarily (only?) use ocaml?
<exarkun> val knownDialects = [ "none" ] defines a list member variable, right?
<timmy> for a class it should
<exarkun> When I try to pass it as the second parameter to List.map, I get an error indicating that it is an array
<exarkun> "This expression has type 'a list but is here used with type 'b array
<exarkun> "
<exarkun> List.find rather, not List.map
gl has joined #ocaml
gl has quit [Client Quit]
<timmy> can you show the whole statement?
<exarkun> bleag, my display just thrashed itself, hang on
<exarkun> ignore (List.find ((==) items.(0)) knownDialects);
<exarkun> items being a list parameter to the method
<timmy> are you just doing string comparison with ==?
<exarkun> Yea
<timmy> # "aa"=="aa";;
<timmy> - : bool = false
<exarkun> doh.. I want = instead?
<timmy> i think so
<exarkun> eventually i'll get used to that
<timmy> how are you declaring items?
<timmy> # List.find ((=) items.(0)) knownDialects;;
<timmy> Exception: Not_found.
<timmy> val items : string array = [|"abc"|]
<timmy> val knownDialects : string list = ["none"]
<exarkun> oh... oops. I'm declaring items as a list, not an array..
<exarkun> so I guess I want List.head items instead of items.(0)?
<timmy> i think you accessed it like an array so, yeah thats it
<exarkun> woo, that worked
<exarkun> thanks :)
<timmy> np
gl has joined #ocaml
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
gl is now known as gl`