gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml Meeting 2011 http://bit.ly/eaZi1C | OCaml 3.12.0 http://bit.ly/aNZBUp
ymasory has joined #ocaml
arubin has joined #ocaml
<hangs> hi: is method overloading permitted in ocaml (same scope, same method name, different parameter/return types)
<hangs> ?
<thelema> hangs: method overloading? you mean function overloading? no.
<hangs> hi, yes that's what i meant. thanks thelema
orbitz has quit [Ping timeout: 276 seconds]
<hangs> also, i'm now to ocaml, but am writing a program that I hope to deploy later on a JVM. are there particular language features/libraries that I should watch out for, that may not be well supported on a jvm implementation?
<hangs> *new
<thelema> since the types are inferred, each name has to have a unique type
Associat0r has joined #ocaml
<thelema> as far as ocaml on JVM, read up on http://cafesterol.x9c.fr/
<thelema> I don't know what its limitations are
noj has quit [Read error: Operation timed out]
noj has joined #ocaml
sysop_fb has quit []
ymasory has quit [Remote host closed the connection]
orbitz has joined #ocaml
lopex has quit []
marchdown_ has joined #ocaml
marchdown has quit [Ping timeout: 260 seconds]
marchdown_ is now known as marchdown
hangs has quit [Ping timeout: 252 seconds]
myu2 has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
arubin has quit [Quit: arubin]
dnolen has joined #ocaml
myu2 has joined #ocaml
rrenaud has joined #ocaml
<rrenaud> is there some nice way to do unittesting with ocaml?
<rrenaud> i have been using a bunch of top level asserts which works okay
<rrenaud> except failures are annoying, because i don't get to see the expected vs actual
<orbitz> Batteries uess oem unit testing framework
<orbitz> there is also Quickcheck for Ocaml
ulfdoz has joined #ocaml
<ulfdoz> &aw
<ulfdoz> moin
yezariaely has joined #ocaml
yezariaely has left #ocaml []
dnolen has quit [Quit: dnolen]
Snark has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
thomasga has joined #ocaml
EM03 has joined #ocaml
<EM03> Good Day!
fraggle_ has quit [Ping timeout: 276 seconds]
emmanuelux has quit [Ping timeout: 260 seconds]
ftrvxmtrx has quit [Quit: Leaving]
fraggle_ has joined #ocaml
ttamttam has joined #ocaml
Cyanure has joined #ocaml
philtor has quit [Ping timeout: 258 seconds]
thomasga has quit [Quit: Leaving.]
ftrvxmtrx has joined #ocaml
edwin has joined #ocaml
larhat has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
ikaros has joined #ocaml
mrvn has quit [Ping timeout: 276 seconds]
mrvn has joined #ocaml
chambart has joined #ocaml
sepp2k has joined #ocaml
ikaros has quit [Remote host closed the connection]
Znudzon has joined #ocaml
ftrvxmtrx has quit [Read error: Operation timed out]
ftrvxmtrx has joined #ocaml
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ocaml
ttamttam has quit [Remote host closed the connection]
_andre has joined #ocaml
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
Modius has joined #ocaml
lopex has joined #ocaml
myu2 has quit [Remote host closed the connection]
Znudzon has quit [Quit: Light travels faster then sound, which is why some people appear bright, until you hear them speak]
joelr has joined #ocaml
<joelr> good day
<joelr> gildor_: ping
<gildor_> joelr: pong
fenard has joined #ocaml
<fenard> hi everyone
<joelr> gildor_: sylvain is it possible to have several src directories under a single project with oasis? right now we have src/ and all the ocaml files are there
<joelr> we would like to have src1 src2 src3, etc.
<gildor_> yes
<joelr> my concern is that ocamlbuild will now not find the ml files
<joelr> e.g. if src1 is referring to some files from src2
<gildor_> it will, because I added a rule to do it
<joelr> gildor_: what rule?
<gildor_> the use case (tested) is src/main.ml src/lib/lib.ml
<gildor_> an ocamlbuild rule that told where the include directory are
<gildor_> at least for libraries
<rproust> fenard: hi
<gildor_> never tested it for exec
<joelr> ok, thanks
<fenard> hi raphael
<fenard> joelr, gildor_ should work with the right define_context instruction
<gildor_> fenard: not sure about what you are talking about ?
<joelr> gildor_: did you release another oasis by chance? or are you saying that it's in the repo?
<gildor_> joelr: it should work for libraries with oasis 0.2.0
<fenard> in myocamlbuild, in the After_rules, you can add a Pathname.define_context "src/server" [ "src/misc" ] for instance
<gildor_> don't know about this
<joelr> gildor_: so where did you add the rule then? "the use case (tested) is src/main.ml src/lib/lib.ml
<joelr> existing oasis
<gildor_> no rule to add, this is by default
dnolen has joined #ocaml
<gildor_> for libraries, you use Path: src Module: Main, lib/Lib
joelr has quit [Quit: joelr]
fenard has quit [Quit: fenard]
ikaros has joined #ocaml
myu2 has joined #ocaml
<thelema> rrenaud: oUnit will show you the expected vs. actual, but you have to give it a printer for those values.
<thelema> rrenaud: batteries' uses a quickcheck library that generates random test cases, and the generators have print functions built in
<thelema> There's kaputt, which has both options and maybe more. But the lack of a polymorphic print in ocaml hinders this kind of thing.
Snark has quit [Quit: Ex-Chat]
ikaros has quit [Quit: Leave the magic to Houdini]
Snark has joined #ocaml
<rproust> thelema: rrenaud: "deriving (Show)" makes polymorphic printers
<thelema> rproust: well, it makes a printer for each type you apply it to
<thelema> a polymorphic printer would be able to print any type ('a -> out_channel -> unit)
dnolen has quit [Quit: dnolen]
<rproust> thelema: right. It simply makes it easier to obtain printer
BiDOrD has quit [Read error: Operation timed out]
BiDOrD has joined #ocaml
Snark has quit [Remote host closed the connection]
<thelema> yup. It'd be nice if the compiler would allow compile-time inspection of types, so one could do [type v = A | B let v_to_string (x:v) = Variant.get_name x]
rien has joined #ocaml
<thelema> although that's still runtime, as the compiler would have to generate code for get_name...
<thelema> hmm...
<thelema> I thought I had a use case for Variant.get_name, but maybe that's just wanting to access the Name -> tag mapping
<thelema> asking the compiler to make this accessible to user code... But I guess that's basically what deriving does, on the syntax level
<rien> ocaml has syntax extension kits for scheme and lisp. is there one for haskell?
<thelema> rien: not that I know of, but you're welcome to build one. Most of the good bits of haskell can be written as functions without needing syntax extension.
<thelema> IIRC, someone implemented the with syntax, what else are you looking for?
<rien> well, probably things like `infixFunction`, function . composition, currying like this: (2 >) 1, anonymous functions like this: \x -> x + 1, having the $ operator back (that can be passed around, so first class), and the very useful "where" clause instead of being limited to "let ... in"
smerz has joined #ocaml
<hcarty> rien: I think almost all of those are available in some form
<hcarty> Function composition is spelled differently
<thelema> sorry, meant where instead of with. I think no on the infix stuff, the anonymous function stuff was discussed, but didn't really reach any conclusion, as it's just a tiny savings in screen space
<hcarty> Your anonymous function shorthand has an implementation by bluestorm
<thelema> hcarty: did he implement that in the end?
<hcarty> thelema: The syntax is a little different
<hcarty> But it was a fairly complete implementation along the lines of (\ \3 + 4) IIRC
<hcarty> rien: "where" was in the original Batteries bag of syntax extensions as well, so I'm sure it's floating around somewhere.
<thelema> oh, okay...
<hcarty> At the end of the day, though, I think most if not all of those syntax additions hurt readability more than they help.
<hcarty> They are all nifty, but don't seem to provide a big gain in language usability.
<hcarty> Whereas I think xstrp4 and pa_string from Batteries are examples of syntax extensions which do add readability quite often.
<rien> yeah, fun vs \x is really not all too important
* rien is still reading the backlog
<rien> hcarty: I disagree somewhat, I think things like (> 2) are very necessary. replacing them for fun x -> x > 2 hurts reaadability
<rien> also, 1 : [2, 3] is less noisy than 1 :: [2; 3]
<rien> basically, I was looking for Haskell syntax but not its fascism :P
mnabil has joined #ocaml
<thelema> rien: just use the ocaml syntax for lists
<rien> how does it go?
<thelema> [2,3] in ocaml is a list with one element, that element being the pair (2,3)
<larhat> rien: ((>) 2 )
<thelema> [1;2;3]
<thelema> careful though, ((>) 2) means (fun x -> 2 > x)
<rien> how do we make it mean (fun x -> x > 2) ?
<thelema> ((<=) 2)
<thelema> there's no easy syntax to partially apply on anything but the first argument
<larhat> let flip f x y = f y x in flip (>) 2
<fx_> (> 2) is less readable than (fun x -> x < 2)
<rien> agreed, especially when I expect it to mean -> x > 2 :)
<thelema> fx_: arguably - (> 2) pretty succinctly expresses the idea of testing whether a value is larger than 2
<thelema> it just doesn't happen to work nice in ocaml syntax
<rien> what is it in omcal's syntax that is a hindrance to having (> 2) work with it?
<rien> ocaml's*
<thelema> the order of (>)'s arguments
<thelema> and the requirement that infix functions have both arguments
<thelema> I guess ocaml's grammar could be extended to support (2 >)
Rickasaurus has quit [Ping timeout: 246 seconds]
<rien> can you point me to a tutorial on how to extend ocaml's grammar with a simple feature? I'd like to see how hard it is
<rien> I'm used to CL macros :)
Snark has joined #ocaml
<rien> larhat: wow that's exactly what I wanted, even the title says so :) thanks!
enthymeme has quit [Ping timeout: 276 seconds]
adlsaks has joined #ocaml
ymasory has joined #ocaml
philtor has joined #ocaml
<rien> that looks straightforward, it's just a matter of knowing what to write for the LEVELs and the patterns
* rien is finding camlp4 fascinating
rrenaud has left #ocaml []
adlsaks has quit [Ping timeout: 246 seconds]
ftrvxmtrx has quit [Quit: Leaving]
joelr has joined #ocaml
ikaros has joined #ocaml
BiDOrD has quit [Read error: Operation timed out]
Obfuscate has quit [Quit: A poorly written script will replace me shortly.]
BiDOrD has joined #ocaml
Obfuscate has joined #ocaml
lopex has quit []
Associat0r has quit [Quit: Associat0r]
emmanuelux has joined #ocaml
joelr has quit [Quit: joelr]
mnabil has quit [Ping timeout: 248 seconds]
marchdown has quit [Quit: marchdown]
mnabil has joined #ocaml
ftrvxmtrx has joined #ocaml
jamii has joined #ocaml
larhat has quit [Quit: Leaving.]
enthymeme has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 276 seconds]
ftrvxmtrx has joined #ocaml
proq has joined #ocaml
proq has quit [Changing host]
proq has joined #ocaml
proq has quit [Changing host]
proq has joined #ocaml
Snark has quit [Quit: Ex-Chat]
ulfdoz has joined #ocaml
Smerdyakov has joined #ocaml
vivanov has quit [Quit: Lost terminal]
BiDOrD has quit [Read error: Operation timed out]
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
BiDOrD has joined #ocaml
sepp2k has quit [Quit: Leaving.]
Smerdyakov has quit [Quit: Leaving]
enthymeme has joined #ocaml
BiDOrD has quit [Read error: Operation timed out]
BiDOrD has joined #ocaml
_andre has quit [Quit: *puff*]
ymasory has quit [Quit: Leaving]
proq has quit [Changing host]
proq has joined #ocaml
smerz has quit [Quit: Ex-Chat]
<hcarty> mrvn: I found and uploaded the mp4 of the Mirage talk if you're interested
<mrvn> 0ok oook 000oook ook (translation: thx)
Associat0r has joined #ocaml
<hcarty> mrvn: You're welcome :-)
<hcarty> I was reading lots of Discworld at the time
<mrvn> seemed like that was the theme
ikaros has quit [Quit: Leave the magic to Houdini]
edwin has quit [Remote host closed the connection]
dnolen has joined #ocaml
Rickasaurus has joined #ocaml
lamawithonel has quit [Ping timeout: 246 seconds]
Cyanure has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
Alkemist has joined #ocaml
<Alkemist> hello / hi
Alkemist is now known as Nollo
Amorphous has quit [Ping timeout: 240 seconds]
<Nollo> ( sorry, it's in french ), I have a problem with a pattern in match with => http://www.developpez.net/forums/d1063822/autres-langages/langages-fonctionnels/caml/erreur-filtrage-match/
mfp has quit [Ping timeout: 276 seconds]
<adrien> just a note: the channel is not very active at this time of the day
<adrien> good night ;-)
<Nollo> I wanted to give a try ;)
<Nollo> have a good night ;)
lopex has joined #ocaml
mfp has joined #ocaml
Amorphous has joined #ocaml
<gildor_> Nollo: you get too much begin end in your output ?
<Nollo> gildor_: yes, for each element of the list
<Nollo> gildor_: "x := (x + 1)debut while (x >= 0) do if (x = 0) then x := (x + 1) else x := (x - 2) endif donedebut fin fin"
<gildor_> Nollo: that's because you recreate a Block (l)
<Nollo> I have program in input, so I must change it to Block ?
<gildor_> Nollo: List.map the list of element in the bloc
<gildor_> and String.concat "; " the result
<Nollo> and without using any module, is it possible ? :P
<gildor_> what module ?
<Nollo> List and String
<gildor_> List.map is a standard module, why do you want to avoid it
<Nollo> Because it's a work pratice, and I'm not sure it's authorized to use module
<Nollo> I wanted to know if it was possible and if I could do it "simply" like I tried
<gildor_> do they tell you to use OCaml ?
<Nollo> yes it's in ocaml XD
<gildor_> don't worry too much, use List.map and String.concat
<Nollo> well... ok
<gildor_> (you can write your own map function, but this is pretty useless)
<gildor_> while you are at it, take a look at Printf
<Nollo> I already did it in another working pratice
<Nollo> printf is better than print_int/string...
<Nollo> ?
<gildor_> e.g. Printf.sprintf "if %a then %a else %a" prg2str c prg2str b1 prg2str b2 is more clear than ^ i
<gildor_> it
<gildor_> not better more clear
<Nollo> okay :)
<gildor_> and if you want extra points, have a look at format
<gildor_> Format.fprintf "if @[%a@] then @[%a@] else @[%a@]"
<Nollo> I'll give a look
<Nollo> I go to sleep, thanks for you help^;)
Nollo has quit [Remote host closed the connection]