ayrnieu changed the topic of #ocaml to: OCaml 3.08.4 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
threeve has joined #ocaml
threeve has quit []
ski has quit ["differentiating types"]
_fab has quit [Read error: 113 (No route to host)]
Sylvain has joined #ocaml
pango_ has joined #ocaml
pango has quit [Read error: 60 (Operation timed out)]
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
vezenchio has quit ["I could see how [James Randi] comes off as a bit abrasive, as he uses terms like "gobbledigook" and "woo-woo" when referring ]
Sylvain has quit ["Vision[0.8.5-0418]: i've been blurred!"]
quamaretto has quit [Client Quit]
threeve has joined #ocaml
threeve has quit []
albertelegance has quit [Read error: 104 (Connection reset by peer)]
albertelegance has joined #ocaml
kryptt has joined #ocaml
ski has joined #ocaml
Snark has joined #ocaml
nocte__ has joined #ocaml
Submarine has joined #ocaml
Boojum has joined #ocaml
nocte__ is now known as nocte`vnr
nocte`vnr is now known as nocte__
Snark has quit [Read error: 110 (Connection timed out)]
Boojum is now known as Snark
Snark has quit ["Leaving"]
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
ppsmimou has joined #ocaml
UziMonkey has quit [Remote closed the connection]
UziMonkey has joined #ocaml
m3ga has joined #ocaml
Skal has joined #ocaml
Ben81 has quit ["Leaving"]
moea has joined #ocaml
<moea> are there networking libraries for ocaml?
<m3ga> moea: Look at the Unix module.
<moea> m3ga: thanks
<moea> thanks a lot
_fab has joined #ocaml
UziMonkey has quit [Remote closed the connection]
revision17_ has joined #ocaml
cmeme has quit [Read error: 110 (Connection timed out)]
cmeme has joined #ocaml
m3ga has quit ["Client exiting"]
Revision17 has quit [Read error: 110 (Connection timed out)]
cmeme has quit [Read error: 110 (Connection timed out)]
cmeme has joined #ocaml
cmeme has quit [Read error: 110 (Connection timed out)]
cmeme has joined #ocaml
<moea> if i type "open Unix;; connect;;" ocaml says "Reference to undefined global Unix"
<Schmurtz> when linking your application, you need to add Unix.cma
<moea> thanks
<Schmurtz> ocamlc Unix.cma ....
<moea> "cannot find file Unix.cma"
<Schmurtz> unix.cma
<moea> ah, thanks :)
<Schmurtz> ;)
ski has quit ["bbl"]
<moea> i have a function that looks like "let _send sock str = send sock str 0 (String.length str) [];;
<moea> at the top level, im doing let sock = _connect "localhost" 8080 in _send sock "hello"; close sock;;
<moea> i get an "this expression should have type unit" error in the "_send" function definition
<Schmurtz> (first : have a look at open_connection, its a high level function for network connections)
<moea> ah, thanks
<Schmurtz> it's easier to use ;)
<moea> why should _send be unit, because im ignoring it's result in the call?
<Schmurtz> your _send function is file_descr -> string -> int
<moea> yeah
<Schmurtz> and you don't use the result
<moea> ok, so anytime a function result isn't used, the function must return unit?
<Schmurtz> you may try : ignore (_send sock "hello")
<moea> thanks
<Schmurtz> yes, it is
<Schmurtz> ignore discard the result
<moea> thanks
<Schmurtz> be careful, if somebody send a signal to your program the call to send may be interrupted
<moea> thanks
kryptt has left #ocaml []
kryptt has joined #ocaml
krypt1 has joined #ocaml
krypt1 has left #ocaml []
kryptt has left #ocaml []
ski has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
mauke has quit [Client Quit]
Submarine has quit ["Leaving"]
mauke has joined #ocaml
mauke has quit [Read error: 104 (Connection reset by peer)]
mauke has joined #ocaml
mauke has quit [Read error: 104 (Connection reset by peer)]
mauke has joined #ocaml
__DL__ has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
cmeme has quit [Read error: 104 (Connection reset by peer)]
Submarine has joined #ocaml
threeve has joined #ocaml
ChipsterOne has joined #ocaml
<ChipsterOne> salut tout le mone
mauke has quit [Read error: 104 (Connection reset by peer)]
mauke has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
brx has joined #ocaml
brx has quit ["leaving"]
brx has joined #ocaml
UziMonkey has joined #ocaml
UziMonkey has quit [":q"]
UziMonkey has joined #ocaml
vezenchio has joined #ocaml
UziMonkey has quit [":q"]
Snark has joined #ocaml
mauke has quit [Read error: 104 (Connection reset by peer)]
ppsmimou has quit ["Leaving"]
Msandin has joined #ocaml
<moea> i'd like to learn how to write programs in a functional style, so i dont want to use ocamls OO features - can someone point me to a tutorial or something that might explain how to keep state in a functional environment?
<ulfdoz> ehm on execution stack?
<mellum> well, that doesn't make much sense. If you want to think about your task in terms of "state", then functional isn't the right paradigm.
<moea> mellum: it's not that i want to think about my task in these terms, it's that stateful programming is all i know. as i said, i would like to learn otherwise
<ski> by functional, do you mean how do use higher-order functions and closures, etc ? or how to program (mostly) without side-effects ? (both can of course be done at same time)
<mellum> moea: then any plain tutorial will probably do.
<moea> ski: the latter
<moea> i am used to HOF and closures, but not side-effect free programming
<ski> tail-recursion, accumulator-style, monads, more ..
<moea> i am familiar with the first two from scheme, but i realize i have never written a non-trivial program without using objects
<mellum> well, then just start.
<ski> use map and fold etc instead of imperative updating loops
<mellum> and make sure you're not choosing a task where it doesn't make sense, such as GUIs, or numeric math
<ski> defining a small interpreter for some simple language is one possible task
<moea> mellum: well, my gut feeling was to replace an object with a closure that took the equivalent of the method name as it's argument, and did the appropriate operation, but i thought that might be odd
<moea> ski: thats what im doing
<moea> for an RPN calculator
<ski> ok
* ski has to leave for a few hours ..
<ulfdoz> moea: Some definition I found, and which I think is short and good: "functional programming: programming in terms of function calls. In pure functional programming, there are no side effects such as assignment." [http://www.cs.utexas.edu/users/novak/cs307vocab.html]
mrsolo has joined #ocaml
pango has quit [Remote closed the connection]
<moea> ulfdoz: thanks
brx has quit [Remote closed the connection]
brx has joined #ocaml
moea has quit ["Leaving"]
smimou has joined #ocaml
pango has joined #ocaml
shirogane has joined #ocaml
shirogane has quit [Read error: 104 (Connection reset by peer)]
ChipsterOne has quit [Read error: 104 (Connection reset by peer)]
shirogane has joined #ocaml
ChipsterOne has joined #ocaml
brx has quit [Read error: 110 (Connection timed out)]
brx has joined #ocaml
shirogane has quit [Remote closed the connection]
Msandin has quit ["Miranda IM! Smaller, Faster, Easier. http://miranda-im.org"]
brx has quit [Read error: 104 (Connection reset by peer)]
brx has joined #ocaml
__DL__ has quit ["Bye Bye"]
ramenboy has joined #ocaml
<ulfdoz> "Und scheiß auf Reinheitsgebot, die ausländischen Biere schmecken sowieso alle viel besser."
<ulfdoz> sry
brx has quit [Read error: 110 (Connection timed out)]
brx has joined #ocaml
Snark has quit ["Leaving"]
Submarine has quit ["in Soviet Russia, Céline Dion owns you"]
<ChipsterOne> bonne nuit tout le monde
brx has quit [Read error: 110 (Connection timed out)]
vodka-goo has joined #ocaml
ChipsterOne has quit []
<ulfdoz> I get an ocamlyacc-error for the following production: elsif_construct : ELSIF test block_struct { Block If_conditional $2 $3 [] }. The error states that $3 is unbound but it should refer to block_struct. What am I missing?
exa has quit [Remote closed the connection]
exa has joined #ocaml
Skal has quit ["Client exiting"]
<ulfdoz> Someine out there?
brx has joined #ocaml
brx_ has joined #ocaml
<Schmurtz> not for ocamlyacc
<Schmurtz> :(
<ulfdoz> Oh I just found it. I left a brace open, but not near the given line.
brx__ has joined #ocaml
* ulfdoz has passed all exams of last semester. I just want to share my pride with you. :)
brx has quit [Read error: 110 (Connection timed out)]
brx_ has quit [Read error: 110 (Connection timed out)]
exa has quit [Remote closed the connection]
ramenboy has left #ocaml []
brx__ has quit [Connection timed out]
vodka-goo has quit [Remote closed the connection]
brx has joined #ocaml
arcticdd has joined #ocaml
<arcticdd> Hello...I have kind of a deadlock in my brain right now (maybe the time?) about this problem: http://rafb.net/paste/results/OsNo6396.html Can you help me?
brx has quit [Connection timed out]
<arcticdd> I even verbalized it :)
<smimou> I would start by a List.flatten
<arcticdd> That's where I am :)
<smimou> then you only need to take the first n elements of the list, it shouldn't be so hard...
<arcticdd> I'll try
<Schmurtz> you may concatenate the first two lists
<Schmurtz> and continue until you get a list with 15 elements
<Schmurtz> you may also traverse all elements in the original 'a list list and append each element ti the last list of the result if there's some space left, or create a new list in the other case
<arcticdd> Thanks
<Schmurtz> good luck ;)
Submarine has joined #ocaml
smimou has quit ["?"]
<pango> I have a 8 lines answer, using two List.fold_left...
<arcticdd> I would be very excited about it since I wondered what this folds thingies do...:)
<pango> (two versions, actually)
<pango> to be even shorter (and less readable ;) ), the last expression could also have been written as
<pango> List.rev (List.map List.rev (List.fold_left (List.fold_left add_acc) [] l ))
exa has joined #ocaml
<arcticdd> Wow...amazing. Thanks a lot. I have something new to understand now
albertelegance has quit [Read error: 110 (Connection timed out)]
mauke has joined #ocaml
arcticdd has quit [Client Quit]