<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
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