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
mellum has joined #ocaml
mellum has quit ["zzZ"]
jao_away has left #ocaml []
gl has quit [Read error: 60 (Operation timed out)]
Begbie has quit [Read error: 110 (Connection timed out)]
uzdav has joined #ocaml
<uzdav> Hi, I'd like to confirm my understanding about the behavior of ocaml's generated code.
<uzdav> assuming a function like this: let x = if y > 5 then (fun x -> x + 1) else (fun x -> x - 1);;
<uzdav> the "if" is evaluated once, and then x is bound ONLY to the anonymous function resulting from the if?
<uzdav> My real problem is that I have a complex calculation that determines what the body of a function should do, and I'm wanting to approach it in a similar fashion. What is important is that this initial calcuation is only done once.
<uzdav> Is this the way to go?
<uzdav> (assuming y is already defined with value of 10, then the above code would be equivalent to "let x arg = arg + 1" ??
<whee> erm
<whee> the if is evaluated only once, yes
<whee> in your initial code x will be bound to a function that takes a single argument and does either + 1 or - 1
<uzdav> that's what I thought. Thanks for the clairification. I'm finding ocaml really fun to use and learn.
<whee> It's like crack, isn't it :)
Begbie has joined #ocaml
Begbie has quit [Remote closed the connection]
uzdav has quit ["[x]chat"]
lament has quit [Remote closed the connection]
TachYon25 has joined #ocaml
mellum has joined #ocaml
TachYon25 has quit [Remote closed the connection]
mellum has quit [forward.freenode.net irc.freenode.net]
asqui has quit [forward.freenode.net irc.freenode.net]
kev has quit [forward.freenode.net irc.freenode.net]
smklsmkl has quit [forward.freenode.net irc.freenode.net]
skylan has quit [forward.freenode.net irc.freenode.net]
merriam has quit [forward.freenode.net irc.freenode.net]
xtrm has quit [forward.freenode.net irc.freenode.net]
SoreEel has quit [forward.freenode.net irc.freenode.net]
lam has quit [forward.freenode.net irc.freenode.net]
whee has quit [forward.freenode.net irc.freenode.net]
emu has quit [forward.freenode.net irc.freenode.net]
Torquemada has quit [forward.freenode.net irc.freenode.net]
Segora has quit [forward.freenode.net irc.freenode.net]
skylan has joined #ocaml
SoreEel has joined #ocaml
xtrm has joined #ocaml
merriam has joined #ocaml
lam has joined #ocaml
emu has joined #ocaml
Torquemada has joined #ocaml
whee has joined #ocaml
Segora has joined #ocaml
mellum has joined #ocaml
asqui has joined #ocaml
smklsmkl has joined #ocaml
kev has joined #ocaml
asqui has quit [Excess Flood]
asqui has joined #ocaml
xtrm has quit [forward.freenode.net irc.freenode.net]
merriam has quit [forward.freenode.net irc.freenode.net]
whee has quit [forward.freenode.net irc.freenode.net]
lam has quit [forward.freenode.net irc.freenode.net]
SoreEel has quit [forward.freenode.net irc.freenode.net]
Torquemada has quit [forward.freenode.net irc.freenode.net]
Segora has quit [forward.freenode.net irc.freenode.net]
emu has quit [forward.freenode.net irc.freenode.net]
SoreEel has joined #ocaml
xtrm has joined #ocaml
merriam has joined #ocaml
lam has joined #ocaml
emu has joined #ocaml
Torquemada has joined #ocaml
whee has joined #ocaml
Segora has joined #ocaml
TachYon25 has joined #ocaml
<whee> interesting. I sent the camlp4 developer a bug report and he brought up the political state of camlp4 and ocaml instead of telling me if 1) he knew about it and it's fixed, or 2) he didn't
<whee> he apparently doesn't support the camlp4 that is distributed with cvs ocaml. heh
TachYon25 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
<whee> but the bug is fixed in his seperate camlp4 tree. good enough for me
<whee> I guess he syncs with ocaml's tree only on major releases of ocaml
<mellum> I want to write a parser for an assembly language. Is ocamllex/ocamlyacc the way to go? Or are there more options?
puks has joined #ocaml
puks has quit ["Client Exiting"]
<kev> anyone here know how I can make a curried function, which generates a recursive function?
<kev> actually, nm, I think I'm being silly
whee has quit [forward.freenode.net irc.freenode.net]
lam has quit [forward.freenode.net irc.freenode.net]
SoreEel has quit [forward.freenode.net irc.freenode.net]
lam has joined #ocaml
Dalroth has joined #ocaml
asqui has quit ["Now I am gone..."]
asqui has joined #ocaml
vom_Fenster has joined #ocaml
whee has joined #ocaml
vom_Fenster has quit [Read error: 54 (Connection reset by peer)]
docelic has joined #ocaml
xtrm has quit [forward.freenode.net irc.freenode.net]
merriam has quit [forward.freenode.net irc.freenode.net]
xtrm has joined #ocaml
docelic has quit ["l8r"]
<kev> any of you alive?
Dalroth has quit []
skylan has quit [Read error: 54 (Connection reset by peer)]
skylan has joined #ocaml
docelic has joined #ocaml
vom_Fenster has joined #ocaml
graydon has joined #ocaml
Xuz has joined #ocaml
<Xuz> Hello
<kev> hey
* Xuz is just exploring OCaml, been using Scheme for a while and figured he'd branch out.
<Xuz> I am curious about one thing. I was surprised that load didn't work under Linux on 3.06 (with the Debian package) is it just not supported or is there some compiler switch they didn't turn on?
RichiH has joined #ocaml
<RichiH> lo
<RichiH> when i want to concat two strings, what syntax do i use?
<whee> "somestring" ^ "another string"
<RichiH> thx
<RichiH> "" is for strings what [] is for lists, right?
<whee> yes
* RichiH feels he is slowly getting a hunch for ocaml
<whee> if you're doing a lot of concatenation, the Buffer module is something to look into as well
<RichiH> i am doing it for university only
<RichiH> and the programs are stil fairly small
<RichiH> like 2-10 lines
<RichiH> when doing pattern matching, why does the line
<RichiH> |hd ^ tl when inListe pr ^ hd list -> true
<RichiH> not work?
<whee> erm, what are you trying to do
<RichiH> it complains about the first ^ not being according to syntax
<RichiH> i want define hd as the first part of myx string and tl as the rest of it
<RichiH> like [head]::[tail]
<whee> well, you can't use ^ in a pattern
<whee> ^ is an operator like +, for example
<RichiH> what would i use instead?
<whee> I'm still not following what you're trying to do
<RichiH> :: is an operator too, nay?
<whee> yes, but it's also used to define the structure of lists
<RichiH> yep
<whee> strings are just arrays of characters
<whee> do you want to iterate through a string character by character?
<RichiH> in effect, i want to search a list for a string that is the first X characters of another string
<RichiH> where X is unknown
<whee> hmm
<whee> are you restricted to basic string operations?
* RichiH would think so
<whee> nuts :)
<RichiH> it's for learning this stuff, after all
<whee> well, you can get the nth character of a string with the x.(n) syntax, where x is the string binding name
<RichiH> heh
<RichiH> not bad
<whee> http://caml.inria.fr/ocaml/htmlman/libref/String.html <- some of these are bound to be useful
<whee> maybe String.sub could be used in some way
<whee> and if you compare strings for equality, use = in this case
<RichiH> [brain]::[knowledge]
<RichiH> ;p
<whee> I think that's a syntax error :)
<whee> first argument to :: isn't a list :)
<RichiH> ah, damn
<RichiH> [brain]@[knowledge]
<RichiH> GAH!
<RichiH> may they rot in hell
<whee> eh? heh
* RichiH had a look into the solution
<Xuz> Hmmm. x.(n) gives me a type error.
<RichiH> they define about half a page of functions that are "helpful" before even starting with the actual coding
<whee> indeed it does
<whee> hrmf, I guess you need to use String.get
<RichiH> without telling us poor students they did any such thing
<whee> RichiH: I hope there's a contains function for strings
<whee> oh, the syntax is x.[n] for getting a character of a string
<RichiH> wtf
<RichiH> let eq a b = (a=b);; <- one of their functions
<whee> haha
<RichiH> braindead trolls
<whee> that's particularly ugly, as well
<whee> you should rewrite it for them
<RichiH> it's plain stupid
<RichiH> a=b is a=b period
<whee> # let eq = (=) in eq 1 2;;
<whee> :)
* RichiH doesn't grok that one
<whee> you can refer to operators as (op) if you want to use it in another location other than infix
<whee> (+) 3 2 for example is the same as 3 + 2
<whee> so here you're just binding eq to the = operator
<RichiH> oic
<whee> well, = function
<whee> :|
<RichiH> if i wouldn't hate the guts of functional programming style i might even come to like ocmal ;)
<whee> functional style is much more elegant imo
<Xuz> Wherefore do you hate the guts of FPS?
<RichiH> nothing imperative sequential loops couldn't handle
<mellum> Nothing Assembler or Visual Basic can't handle, either.
<RichiH> i did database programming for years and it was structured and logical
<whee> loops are just as easy to do in a functional language (ocaml has syntax for for loops, even)
<Xuz> RichiH, I have a question for you.
<Xuz> Ever hear of the Turing Tarpit?
<whee> but in a language without for loops, like haskell, you can still do the same with recursion
<RichiH> so i just can't think functional
<RichiH> thus it is very tiresome to do sth in a functional way
<RichiH> thus i like the "old" way better :)
<whee> is your assignment online or something?
<RichiH> in german, yes
<whee> good enough, where :)
<RichiH> heh
<RichiH> i can give you the url if you want, but i will do it alone as much as i can
<RichiH> no use otherwise :)
<whee> I'm not doing it for you, I just want to show you how I would do things afterwards
<RichiH> i could just as well c&p the solution otherwise
<RichiH> hmm, ok
<whee> so you can get an idea of how the style may be different from what you're used to
<RichiH> i'm always in for new ideas
<RichiH> anyone from TUM around, btw? ;)
<RichiH> number 22
<whee> aaaaaaaye, LZW again
<RichiH> heh
<whee> someone had the LZW problem in here earlier
<RichiH> lol, not really?
<RichiH> you still got the hostname?
<whee> probably not
<RichiH> pity
<RichiH> what's lzw standing for, anyway?
<whee> I used to know :|
<whee> oh, Lempel Ziv Welch (riiiiiight)
<whee> heh
<RichiH> really?
<whee> yes
<RichiH> wtf
<whee> those are the last names of the designers of the algorithm
<RichiH> i thought so
<RichiH> but still
vom_Fenster has quit ["Trillian (http://www.ceruleanstudios.com)"]
Xuz has quit ["ircII EPIC4-1.1.7 -- Are we there yet?"]
RichiH has quit ["Connection reset by beer!"]