gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
ikaros has quit [Quit: Ex-Chat]
lopex has joined #ocaml
philtor has quit [Ping timeout: 248 seconds]
ztfw has quit [Remote host closed the connection]
mjonsson has joined #ocaml
wtetzner has joined #ocaml
lopex has quit []
mjonsson has quit [Remote host closed the connection]
everyonemines has joined #ocaml
joewilliams_away is now known as joewilliams
Transformer has joined #ocaml
Transformer has quit [Excess Flood]
Modius has quit [Quit: "Object-oriented design" is an oxymoron]
arubin has joined #ocaml
joewilliams is now known as joewilliams_away
jimmyrcom has quit [Ping timeout: 248 seconds]
ulfdoz has joined #ocaml
ulfdoz has quit [Ping timeout: 256 seconds]
joewilliams_away is now known as joewilliams
everyonemines has quit [Quit: Leaving.]
arubin has quit [Quit: arubin]
joewilliams is now known as joewilliams_away
ygrek has joined #ocaml
hto has joined #ocaml
ttamttam has joined #ocaml
albacker has joined #ocaml
<albacker> is there a socket library for ocaml and documentation?
<albacker> i have a project and i need to code a server in ocaml (using threads aswell).
<albacker> thanks
<flux> albacker, ocamlnet
edwin has joined #ocaml
iris1 has quit [Read error: Connection reset by peer]
<albacker> not sure if it would be easier ti use C or ocaml for this project
<_habnabit> python!
<albacker> i can't code python :/
<albacker> and it should have threads
<albacker> the language
<albacker> or an easy implementation of threads
<_habnabit> 1) python the language has threads. 2) threads are not how you do async IO.
<albacker> not for the IO part.
<_habnabit> well, I can't say that python the /language/ has threads. the major implementations of python all have thread support, though.
iris1 has joined #ocaml
bobry has joined #ocaml
albacker has quit [Quit: Leaving]
albacker has joined #ocaml
bobry has quit [Remote host closed the connection]
junsuijin has quit [Remote host closed the connection]
Cyanure has joined #ocaml
bobry has joined #ocaml
ztfw has joined #ocaml
taupin has quit [Ping timeout: 260 seconds]
<ztfw> Is there any a hedera symbol in LaTeX?
<ztfw> -a
_sol has joined #ocaml
<_habnabit> ztfw, I think you're in the wrong channel
<ztfw> oops
<ztfw> sorry
<ztfw> I doubt it, adrien, but thanks
Associat0r has quit [Quit: Associat0r]
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
Associat0r has quit [Client Quit]
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
Associat0r has quit [Quit: Associat0r]
frasse has joined #ocaml
turingtest has joined #ocaml
frasse has quit [Read error: Operation timed out]
ViciousPlant has joined #ocaml
sepp2k has joined #ocaml
<albacker> can i find a simple server written in ocaml somewhere?
<adrien> server for what?
Cyanure has quit [Remote host closed the connection]
<albacker> socket server
fschwidom has quit [Remote host closed the connection]
<adrien> are you looking for some functionality in particular?
<albacker> the server that i will code (hopefully) should be able to get data, test their first byte, if it's a good value, than test the second data, which will tell information about the rest of the packet. etc.
<albacker> second byte*
<adrien> I was asking because lwt (light/green threads) would probably be useful here and the doc is good
<albacker> thanks :)
<adrien> but then there is also ohttp, ocamlnet, and several others
<albacker> it's a school project, they have already precised the protocol of the server
<albacker> server/client.
<adrien> iirc ohttp is quite light and could be a good example
<adrien> except for the fact the name is probably not "ohttp"
<albacker> Error: Unbound value domain_of
<albacker> > the function establish_server is made up of high-level functions from the Unix library
<albacker> > ocamlc -i -custom -o serv_up unix.cma kot.ml -cclib -lunix
sepp2k has quit [Remote host closed the connection]
turingtest has quit [Quit: turingtest]
ikaros has joined #ocaml
<albacker> File "kot.ml", line 4, characters 23-29:
<albacker> Error: This expression has type Unix.sockaddr -> Unix.socket_domain
<albacker> but an expression was expected of type Unix.socket_domain
<adrien> let domain = domain_of_sockaddr in
<adrien> you're missing the argument
lopex has joined #ocaml
<albacker> ok im guessing it's sockaddr, and flush stdout aparently should be flush oc..
<albacker> what does -i mean?
<adrien> output the guessed interface of the .ml
<adrien> can be used to create a .mli
<albacker> the code seems not to work in fact
<albacker> eni@jufitsu:~$ ./serv_up
<albacker> eni@jufitsu:~$
<albacker> even if i do serv_up 1234
<adrien> that's because you only define functions but never call them
<albacker> you are right.
<albacker> i have forgoten ocaml :(
<albacker> it's been ~1year that i don't code
<albacker> ive been doing c/java only lately
<adrien> you need a block of code that is going to be called when the program starts: something like "let () = some_fun some_args"
<albacker> let _ = go_uppercase_service () ;;
<albacker> the server seems running, but when i try to telnet to the given port ( i tried as in the example ), it says connection refused.
<albacker> telnet localhost 1400
<albacker> adrien, if you have time can you please test this and tell me if it's working with you?
<adrien> upload your most recent source
<albacker> that's the most recent
<albacker> normally it should compile without any errors if you use the compile line on the top of the file
<adrien> it's missing the "let () = ..." at least
<albacker> this ^
<adrien> why are you using: -cclib -lunix
<adrien> ?
<albacker> adrien, it was pointed in the book
<adrien> not needed (if not harmful?)
<adrien> and working for me, tested with nc
<albacker> nc?
<adrien> and with telnet
<adrien> nc is netcat
<adrien> "nc - TCP/IP swiss army knife"
<albacker> i tried with telnet and i get connection refused
<albacker> than it's not a caml problem.
zorun is now known as zakeh
zakeh is now known as Zakeh
Zakeh is now known as hekaZ
i__ has joined #ocaml
emmanuelux has joined #ocaml
<albacker> do i have int8, int16, uint8, uint16 types in ocaml?
<adrien> you can get something in Bigarray, and you might want to see http://code.google.com/p/bitstring/
jimmyrcom has joined #ocaml
<albacker> thanks
yezariaely has joined #ocaml
Anarchos has joined #ocaml
flapjackery has joined #ocaml
emmanuelux has quit [Ping timeout: 244 seconds]
sepp2k has joined #ocaml
i__ has left #ocaml []
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
yezariaely has left #ocaml []
<adrien> ah, in godi, 2.5x faster display for the list of packages ("2" after starting godi_console), with clean patches (compile with ocamlopt instead of ocamlc)
emmanuelux has joined #ocaml
Cyanure has joined #ocaml
emmanuelux has quit [Ping timeout: 240 seconds]
hekaZ is now known as zorun
turingtest has joined #ocaml
mnabil has joined #ocaml
mx has joined #ocaml
<Boscop> does polymorphic variant just mean that 'A' is a subtype of 'A | B' ?
<thelema> Boscop: [`A] is a subtype of [`A|`B], yes
<Boscop> ok
<thelema> that's not the only difference between polymorphic and regular variants, but it's an important one
<Boscop> what are other differences?
albacker has quit [Ping timeout: 240 seconds]
<thelema> they don't need to be declared ahead of time, and their representation isn't as optimized as normal variants
sepp2k has quit [Remote host closed the connection]
turingtest has quit [Quit: turingtest]
wtetzner has quit [Remote host closed the connection]
turingtest has joined #ocaml
mnabil has quit [Remote host closed the connection]
<Boscop> thelema, and what exactly does it mean to lift something?
<Boscop> make it higher order?
<turingtest> In Haskell it usually lift is used to talk about bringing a value or operation into a monad.
<turingtest> This also works to lift an operation on a value to a container of values.
<Boscop> ah
flapjackery has quit [Quit: Leaving]
xarch has joined #ocaml
arubin has joined #ocaml
fraggle_ has joined #ocaml
albacker has joined #ocaml
turingtest has quit [Quit: turingtest]
ttamttam has quit [Quit: Leaving.]
edwin has quit [Ping timeout: 248 seconds]
ikaros_ has joined #ocaml
wtetzner has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
edwin has joined #ocaml
oriba has joined #ocaml
jonafan has quit [Ping timeout: 248 seconds]
jonafan has joined #ocaml
ulfdoz has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
emmanuelux has joined #ocaml
everyonemines has joined #ocaml
junsuijin has joined #ocaml
struktured has quit [Ping timeout: 260 seconds]
albacker has quit [Quit: Leaving]
edwin has quit [Remote host closed the connection]
everyonemines has quit [Quit: Leaving.]
struktured has joined #ocaml
rostayob has joined #ocaml
arubin has quit [Quit: arubin]
<rostayob> Using OCaml mode in emacs disables comments highlighting in other modes
<zorun> that's an assertion; what are we supposed to do with that? :)
<zorun> you should use the tuareg-mode
<zorun> I think the ocaml mode bundled with OCaml is not longer maintained
<rostayob> zorun: you see, it worked! :)
<zorun> eh eh ;)
<rostayob> anyway thanks, I'll try it out
<rostayob> aha, it's from Jane Street! I've got an interview with them in 2 days
<rostayob> the world is a small place
<rostayob> or maybe the ocaml community is a small place
<zorun> the functional world, you mean ;)
<zorun> yeah
<rostayob> well even in the functional world there are some languages with more traction
<rostayob> (clojure, scala, etc)
<Associat0r> F#
<rostayob> isn't F# a flavour of OCaml?
<rostayob> (more or less)
<_habnabit> no, they're both ML languages
<rostayob> yeah but it's pretty close to OCaml right?
<_habnabit> in that they're both ML languages, yes
<Associat0r> Caml with a .NET object model
<rostayob> ah. I thought that it borrowed specific caml features
<rostayob> *caml-specific features
<rostayob> anyway, back to ocaml ehe
yroeht has quit [Ping timeout: 260 seconds]
yroeht has joined #ocaml
ygrek has quit [Remote host closed the connection]
ztfw has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
arubin has joined #ocaml
ikaros_ has quit [Quit: Ex-Chat]
ygrek has quit [Ping timeout: 248 seconds]
ikaros has quit [Quit: Ex-Chat]
yroeht has quit [Ping timeout: 248 seconds]
Amorphous has quit [Ping timeout: 240 seconds]
yroeht has joined #ocaml
Kaedenn has joined #ocaml
<Kaedenn> _habnabit: Okay fine here I am.
<_habnabit> yo
<Kaedenn> l1 and l2 are int lists. I just need to figure out the signature for f, base and args.
<_habnabit> homework :(
<Kaedenn> Now you see why I was unwilling to ask in here.
<Kaedenn> But it isn't my homework! I'm the tutor!
<Kaedenn> ;-;
<_habnabit> haha
<_habnabit> I don't actually know what it's asking. [1; 2] [3; 9] -> [5; 1] ?
<Kaedenn> yes!
<Kaedenn> basically (map (+) (zip l1 l2)) but with modulus somewhere
<_habnabit> I mean, I could tell you how to do it, but.
<_habnabit> what part are you stuck on?
<Kaedenn> what f should look like
<Kaedenn> ...aaaaaaaand my student tells me she figured it out, and then just signed out
<Kaedenn> le sigh.
<_habnabit> haha
<_habnabit> anyway here's what I had: List.fold_left (fun (carry, accum) (a, b) -> let v = a + b + carry in v / 10, v mod 10 :: accum) (0, []) (List.combine (List.rev l1) (List.rev l2))
Amorphous has joined #ocaml
<Kaedenn> that... doesn't compile with the code I have, when I try to piece it apart
<Kaedenn> let f a x = (fun (carry...
<_habnabit> let f a x = let carry, accum = a and a, b = x in let v = a + b + carry in ...
<_habnabit> well, or `let f a x = let (carry, accum), (a, b) = a, x in ...`
<Kaedenn> and how do I print a list xD
<_habnabit> without batteries, not easily
<_habnabit> I just did in the toplevel though
<Kaedenn> meaning?
<_habnabit> in this case List.iter (Printf.printf "%d, ") should be sufficient
<Kaedenn> ah, I just did List.map XD
<Kaedenn> there, that works
turingtest has joined #ocaml
dnolen has joined #ocaml
joewilliams_away is now known as joewilliams
rostayob has quit [Quit: WeeChat 0.3.5]
joewilliams is now known as joewilliams_away