sponge45 changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
smimou has quit ["bli"]
Mr_Awesome has joined #ocaml
malc_ has quit ["leaving"]
postalchris has quit [Read error: 110 (Connection timed out)]
cmeme has quit [Read error: 104 (Connection reset by peer)]
cmeme has joined #ocaml
postalchris has joined #ocaml
vorago has joined #ocaml
<vorago> Hm. Hi.
<vorago> How to create 64 bit constant on 32 bit system? ;s
<vorago> "L"; Thanks.
mbishop has joined #ocaml
postalchris has quit [Read error: 113 (No route to host)]
slipstream-- has joined #ocaml
slipstre1m-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
mbishop has quit [zelazny.freenode.net irc.freenode.net]
ramkrsna has quit [zelazny.freenode.net irc.freenode.net]
Smergo has quit [zelazny.freenode.net irc.freenode.net]
TaXules has quit [zelazny.freenode.net irc.freenode.net]
slipstream-- has quit [Read error: 110 (Connection timed out)]
Smergo has joined #ocaml
TaXules has joined #ocaml
diffbavis has quit [Read error: 54 (Connection reset by peer)]
iFreeCarve has joined #ocaml
<iFreeCarve> hello all / bonjour a tous
<iFreeCarve> i am looking for a practical guide to OCaml style
<iFreeCarve> is there a javadoc (or similar) style that you use for commenting functions?
<iFreeCarve> what rules of thumb are there for deciding whether to use let blocks or modules to hide helper functions?
<iFreeCarve> those sort of things...
<iFreeCarve> if you know of any websites or books that teach this, i'd be very grateful.
ramkrsna has joined #ocaml
mbishop has joined #ocaml
Smerdyakov has quit ["Leaving"]
johnnowak has quit []
Mr_Awesome has quit ["...and the Awesome level drops"]
diffbavis has joined #ocaml
pstickne has joined #ocaml
<flux-> ifreecarve, there's ocamldoc
<flux-> ifreecarve, it's documented in the ocaml manual
<flux-> ifreecarve, I suppose the hiding thing depends on on what scope you wish to hide things
<flux-> ifreecarve, in the end I think it's considered good style to use .mli descriptions to limit the visibility of the definitions
<flux-> but still one can use let-scopes to hide things like unique symbol generator internals, let generate = let v = ref 0 in fun () -> let r = !v in incr v; r
<iFreeCarve> flux-, concerning ocamldoc, is there special notation for saying what each argument of the function means?
<iFreeCarve> aahh .. disregard that, i see it
shawn has quit [Read error: 110 (Connection timed out)]
iFreeCarve has left #ocaml []
bluestorm_ has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
johnnowak has joined #ocaml
david_koontz has quit ["Leaving"]
johnnowak has quit []
pstickne has quit ["Leaving"]
pantsd has quit [Read error: 110 (Connection timed out)]
pantsd has joined #ocaml
dark_light has joined #ocaml
shawn has joined #ocaml
shawn has quit [Client Quit]
love-pingoo has joined #ocaml
slipstre1m-- has quit [Read error: 110 (Connection timed out)]
shawn has joined #ocaml
jlouis has quit ["Leaving"]
diffbavis has quit [Read error: 104 (Connection reset by peer)]
dark_light has quit [Remote closed the connection]
dark_light has joined #ocaml
joelr1 has joined #ocaml
<joelr1> good morning
jacobian has joined #ocaml
joelr1 has quit []
diffbavis has joined #ocaml
johnnowak has joined #ocaml
johnnowak has quit [Remote closed the connection]
joelr1 has joined #ocaml
<joelr1> good day folks
<vorago> Hi.
<flux-> hello.
<joelr1> :D
<joelr1> are there any drawbacks to matching of strings ?
<joelr1> say if i had scores of tokens in my parser that represented function names. i created a huge variant to match the function names but now wonder if i could just as well match the string names themselves.
<joelr1> wuddaya think?
<vorago> I'm ocaml lame. Currently also fighting with matching.. but ranges of integers. ;p
<joelr1> oh, ok then
<joelr1> vorago: tried posting to ocaml-beginners?
<vorago> That's channel? Oh.
<vorago> Posting group? Well I hope i will finally find a good documentation about matching.
<vorago> All i find i how cool it's with lists.
<joelr1> ok
joelr1 has quit []
<vorago> It's possible with characters, but not with an integer. How dissapointing. ;/
<flux-> vorago, you use match guars for that (when)
<flux-> obviously it'll miss the coverage checking
<vorago> I've got it.
<vorago> 0|1|2|3|4 also works, and in this case is really ok.
<vorago> But I'm still fighting --- match quits my function if something is matched. I can stop it from doing this by enclosing it with let tmp = match... in. But this approach is not beatifull.
<flux-> you can use parenthesis
<flux-> or the new syntax
<flux-> which has someting like match foo with [1 -> 42 | 2 -> 42]; foo () (I don't really recall the syntax)
<vorago> Ha. I will use parenthesis. Should do. But please tell me:
<vorago> Why does it return from the function?
<flux-> the scope of a pattern match is until the end of the definition.. I don't think that's quite clearly said, but I don't know how else to say it
<flux-> if I'm understanding your problem correctly
<flux-> you could try using emacs and its tuareg mode's indentation to find out the rules :)
<vorago> ;)
<vorago> Ok, I see it now. ;d
<vorago> Program generally works. (It was a solution for one simple SPOJ problem)
Smerdyakov has joined #ocaml
cjeris has joined #ocaml
diffbavis has quit [Read error: 104 (Connection reset by peer)]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
diffbavis has joined #ocaml
love-pingoo has quit ["Leaving"]
benny has joined #ocaml
benny_ has quit [Read error: 60 (Operation timed out)]
johnnowak has joined #ocaml
johnnowak has quit []
johnnowak has joined #ocaml
smimou has joined #ocaml
johnnowak has quit [Read error: 145 (Connection timed out)]
johnnowak has joined #ocaml
johnnowak has quit [Remote closed the connection]
postalchris has joined #ocaml
gim_ has joined #ocaml
malc_ has joined #ocaml
smimp has joined #ocaml
pantsd has quit ["Leaving."]
malc__ has joined #ocaml
malc_ has quit [Read error: 60 (Operation timed out)]
ikaros has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
johnnowak has joined #ocaml
malc__ is now known as malc_
bluestorm_ has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
SooW has joined #ocaml
<SooW> hi everyone
<SooW> i'm wondering if someone has already got caml/c interoperating system to work ?
<malc_> SooW: you mean FFI
<malc_> in general?
<SooW> i'm creating (malloc) data with C and i try to return it to ocaml
<SooW> i don't know what ffi means :s
<malc_> Foreign Function Interface
<malc_> SooW: return it to ocaml as what?
<SooW> first of all, can C and caml share dynamically allocated memory ?
<malc_> yes, via bigarrays
<SooW> a value, which in fact is a bigarray
<malc_> SooW: you have to alloc it with bigarray helper function
<SooW> return (alloc_bigarray(BIGARRAY_UINT8 | BIGARRAY_C_LAYOUT,
<SooW> 2, matrix, dims));
<SooW> (sorry for indentation)
<SooW> the function is declared as :
<SooW> external load : string -> (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array2.t
<SooW> = "load"
<malc_> have you setup the dims correctly? why don't you use CAMLreturn (...) instead of return?
<SooW> coz i didn't know it exists ^^
<SooW> what does it do ?
<malc_> plays nicely with GC
<malc_> have you read the manual at all? there's a lot of information regarding FFI there
<SooW> dims are corrects, but when i display my matrix, it appears to be random values :(
<SooW> i read the whole manual
<SooW> i don't remember anything about anything
<SooW> s/anything/that
<SooW> moreover, the example in the man is just using return
<malc_> 18.5.1
<SooW> okay, but the same manual is saying that i can use "return" (see bigarray's page)
<SooW> i don't thing the problem comes from it but i'll give a try
<SooW> ohh i'm having an idea
<mbishop> "One of those things, you know, a headache with pictures!"
<SooW> should i declare my bigarray to the GC, or "alloc_bigarray" does it ?
<malc_> you shouldn't
<SooW> ok
<SooW> i just tried to statically allocate my array, then it worked
<SooW> but that's not what i want
<SooW> (and sorry for my English ^^)
<malc_> make a small reproducible test case and put it somewhere
<SooW> ok
diffbavis has quit [Read error: 131 (Connection reset by peer)]
johnnowak has quit []
<SooW> malc_, hope you're still here
<SooW> i simplifie my code so you can read it
<SooW> +d
<malc_> i'm here, where is it?
<SooW> where do you want it ?
<SooW> can i send u a tarball ?
<malc_> yes, under condition that you will stop using smspeak
<SooW> right
<SooW> malc_, did you looked at it ?
<SooW> malc_, did you look at it ?
<SooW> sorry i'm writing an awful English
<malc_> SooW: erm.. you didn't tell me where to get this tarball from
<SooW> i thought you could read your private messages
<malc_> maybe you should register with nickserv first?
<malc_> look into your information window
diffbavis has joined #ocaml
<SooW> okay, you're right, it's telling me that i'm not registered
<pango_> yay, off-by-one, I like C language ;)
<malc_> indeed ;)
<malc_> SooW: fix your for loop first :)
<malc_> to be fair bad things would happen when using -unsafe in ocaml (though not with bigarrays)
<SooW> what's wrong with my loop ?
<malc_> you are allocating space for 2 pointers but writing 3
<SooW> in my project, i'm using a lot of flags to check errors
<malc_> i < 2 not 3
<SooW> no, i don't think so (i'm making a 2x3 matrix)
<SooW> oh yay
<SooW> okay
<SooW> sorry
<SooW> i don't know why it didn't sigsev
<malc_> SooW: fixed
<malc_> matrix = malloc(6 * sizeof (unsigned char));
<malc_>
<malc_> matrix[0] = 42;
<malc_> matrix[1] = 42;
<malc_> and so on
<SooW> ?!
<malc_> there are no pointers to pointers involved..
<SooW> ok
<SooW> that's bad, because in my C code, i'm using matrix[i][j] everywhere
<malc_> matrix is : unsigned char * focourse
JohnnyL has joined #ocaml
shawn has quit ["This computer has gone to sleep"]
<SooW> malc_, thanks a lot, i'll try to find a way to get the [][],
<malc_> SooW: no problem
love-pingoo has joined #ocaml
<JohnnyL> are there any open source projects for ocaml in need?
<SooW> mine ^^
<SooW> an OCR
<JohnnyL> well, i'd help but I know nothing of OCR.
<SooW> it's a school project, so you couldn't even if you wanted
<love-pingoo> JohnnyL: savonet/liquidsoap is not really in need, but there's room for contributions if you feel like it
<JohnnyL> love-pingoo, ok thanks.
* love-pingoo didn't expect such a simple answer
<love-pingoo> JohnnyL: are you in need of coding ?
<JohnnyL> love-pingoo. yeah. A marjorit of my background in database/client/server/network apps.
<love-pingoo> did you ever use OO in OCaml ?
<JohnnyL> never
<JohnnyL> totally new
<JohnnyL> but it seems easier than haskell.
<JohnnyL> from the tutorials i have seen
<love-pingoo> I believe it is.
<love-pingoo> we do have a simple telnet interface which will have to be enhanced at some point
<love-pingoo> never really thought about that yet
<love-pingoo> that's for the network-related idea
<JohnnyL> well, i am looking for small simple work. telnet interfacing enhancements sounds about right.
<JohnnyL> What's the scope of that project?
<love-pingoo> also we're looking for a podcast retriever
<love-pingoo> JohnnyL: it's about audio streaming, mainly targetting netradios
<love-pingoo> it's a script language for building complex audio streams, very flexible
<love-pingoo> and while the radio is running you can interact with it in various ways, via a telnet interface
<love-pingoo> currently there's a beginning of GUI interacting through this interface, but it's more like a sketch
<love-pingoo> frankly liquidsoap might be a bit large for a first try with OCaml.. depends how confident you are in general with coding ;)
<JohnnyL> there a difference between the telnet interface and liquidsoap?
<love-pingoo> liquidsoap can run with or without starting its internal server
<JohnnyL> i don't think the Ocaml is the problem but audio synthesizing is a bit complex.
<love-pingoo> so liquidsoap is the server
<love-pingoo> on the client side we've nothing official except the experimental (pyGTK) gui
<love-pingoo> but a couple of simple scripts interact with liquidsoap by sending commands via this interface
<JohnnyL> oh ok, so your looking for a commandline parser?
<love-pingoo> well, I don't really know :)
<love-pingoo> it's just that it's very basic and a bit rough sometimes
<JohnnyL> i'm not sure what you want.
<love-pingoo> me neither.. that's not a simple project, as it should start by brainstorming among liquidsoap users
<JohnnyL> oh ok
<love-pingoo> JohnnyL: what about writing a simple HTTP server serving audio streams ? the spec is clearer but it's more involved..
shawn has joined #ocaml
shawn has quit [Remote closed the connection]
<JohnnyL> love-pingo that sounds like a server crunch.
<love-pingoo> what do you mean ?
<JohnnyL> a single server wouldn't be able to carry the load of many audio streams, correct?
smimp has quit ["Lost terminal"]
<love-pingoo> well