gene9 changed the topic of #ocaml to: www.ocaml.org | http://caml.inria.fr/oreilly-book/ | http://www.bagley.org/~doug/shootout/ | http://icfp2002.cs.brown.edu/ | Ocaml kicks ass (c) Dybbuk | please, write Makefile.[am|in]
mrvn has quit [Ping timeout: 14400 seconds]
giedi has joined #ocaml
cymonts has quit [Read error: 113 (No route to host)]
bobov has joined #ocaml
giedi has quit ["unused process"]
gl has joined #ocaml
gene9 has joined #ocaml
gene9 has quit [Client Quit]
bobov has quit [Read error: 104 (Connection reset by peer)]
mrvn has joined #ocaml
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
mrvn has left #ocaml []
cymonts has joined #ocaml
yangsx has joined #ocaml
yangsx has quit ["Client Exiting"]
cymonts has quit [Read error: 60 (Operation timed out)]
Dalroth has joined #ocaml
JX has joined #ocaml
Dalroth has quit [Remote closed the connection]
<JX> hello all...
Dalroth has joined #ocaml
<mr_bubbs> hello
<JX> I'm quite confused... I'm starting writting some small programs with ocaml... I would like to have qome quick help (if possible)
<JX> I would like to "construct a variable" in function of a variable... for exemple I want to create a string which contains "hello" if x arg is greater than 10 and "hi" if less...
<mr_bubbs> a few ways to do that, indeed
<mr_bubbs> just a sec.. gotta check the oven :)
<JX> :)
<mr_bubbs> let f a =
<mr_bubbs> if a > 10 then
<mr_bubbs> "yep"
<mr_bubbs> else "nop" ;;
<mr_bubbs> print_endline (f 11) ;;
<mr_bubbs> prints yep and a newline
exarkun has joined #ocaml
<JX> mr_bubbs: ok thanks! So if I want it to be "embedded into a function"?
<mr_bubbs> JX: 'tis the idea of functional programming
<JX> ok
<exarkun> /4/1
<mr_bubbs> you could assign it to a variable if you wanted
<JX> yes thats what I would like to do
<JX> mr_bubbs: ok thanks I will try with this :)
<mr_bubbs> here's one crude function using ref
<mr_bubbs> let f a =
<mr_bubbs> let str = ref "" in
<mr_bubbs> if a > 10 then
<mr_bubbs> str := "greater"
<mr_bubbs> else
<mr_bubbs> begin
<mr_bubbs> str := "lesser"
<mr_bubbs> end;
<mr_bubbs> print_endline ("result: " ^ !str) ;;
<mr_bubbs> f 11 ;;
<mr_bubbs> prints ``result: greater''
<mr_bubbs> you can use String too
<JX> if you want the size of str? (sorry I'm completely newbie)
<smkl> String.length
<mr_bubbs> go there
<mr_bubbs> click on Index of modules
<mr_bubbs> click on String
<mr_bubbs> it will show you the functions for module String that you can do to a string type
<JX> ok thanks :) (will try not to bother with stupid question now :))
* JX bye !
<smkl> bye
<mr_bubbs> didn't update the news on the page yet
<mr_bubbs> but I got the mail in the caml-list
<smkl> do you mean the www.ocaml.org page?
<mr_bubbs> ya
<mr_bubbs> usually where I go
<mr_bubbs> to check news
<smkl> the news at www.ocaml.org are just copied from caml.inria.fr
<mr_bubbs> looks like the latest at ocaml.org is talking about the O'Reilly book
malc has joined #ocaml
gl has quit [Read error: 113 (No route to host)]
gl has joined #ocaml
belman is now known as Belgarion
Dalroth has quit []
Yurik has joined #ocaml
<Yurik> re
<Yurik> guys, did anyone tried to build findlib using 3.05?
<Yurik> (actually, make_wizard.ml fails compiling)
* gl is away: I'm busy
Yurik has quit [Read error: 104 (Connection reset by peer)]
malc has quit ["no reason"]