<eikke>
is there any way to use the pretty-printer as used in the REPL in my own code somehow? (for coocoo debugging purposes only)
<f[x]>
run the code from toplevel?
<thelema>
eikke: short version: no. The REPL has access to the types of your values; when you compile, the types are erased, so there's no way to distinguish, for example, the int 0 and the empty list.
<eikke>
right, makes sense
emmanuelux has joined #ocaml
<thelema>
eikke: what I do is use batteries' composable printers to make the correct printing function. It's pretty thankless effort, but it works, and it's not that much effort.
<thelema>
let print_m pk pv oc m = (Enum.print (print_kv pk pv) ~first:"" ~sep:"\n" ~last:"\n") oc (Map.enum m)
NaCl has joined #ocaml
<eikke>
thelema: I might look into those (adding a dependency is not my call, though)
<eikke>
thelema: I'm used to "data Foo = Bar Int deriving (Show)" ;-)
<thelema>
eikke: that's another alternative
<hcarty>
eikke: There are a few camlp4 extensions which provide something similar - deriving, one for s-expressions, one or more for JSON
<hcarty>
eikke: But it Batteries is an acceptable dependency then its printing functions tend to be quite useful and simple to extend.
Kakadu has quit [Quit: Page closed]
lopex has quit [Ping timeout: 265 seconds]
Sysop_fb has joined #ocaml
ttamttam has joined #ocaml
Boscop has joined #ocaml
Cyanure has quit [Ping timeout: 244 seconds]
mundkur has quit [Ping timeout: 248 seconds]
mundkur has joined #ocaml
krktz has quit [Ping timeout: 260 seconds]
krktz has joined #ocaml
mnabil has quit [Ping timeout: 276 seconds]
mnabil has joined #ocaml
joewilliams_away is now known as joewilliams
bobry has quit [Ping timeout: 260 seconds]
dnolen has joined #ocaml
avsm has quit [Quit: Leaving.]
bobry has joined #ocaml
ulfdoz has joined #ocaml
randori has joined #ocaml
lopex has joined #ocaml
eikke has quit [Ping timeout: 276 seconds]
ttamttam has quit [Quit: Leaving.]
ankit9 has quit [Quit: Leaving]
larhat has quit [Quit: Leaving.]
avsm has joined #ocaml
oriba has quit [Quit: oriba]
sepp2k has joined #ocaml
mnabil has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
ak0s has joined #ocaml
avsm has quit [Quit: Leaving.]
ankit9 has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
Tianon has quit [Ping timeout: 240 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
dobroerlanger has joined #ocaml
<dobroerlanger>
Hello. Is there a way to get class name as a string?
<thelema>
at runtime? no
joewilliams is now known as joewilliams_away
<thelema>
the class name is not present in the runtime representation of an object
joewilliams_away is now known as joewilliams
dnolen has quit [Quit: dnolen]
<dobroerlanger>
Okay... Does ocaml have something like "final" methods?
<thelema>
not that I'm aware of.
<thelema>
why do you want final methods?
<dobroerlanger>
I want to prevent shooting myself in the foot. Possibility of changing some methods may be dangerous.
ttamttam has joined #ocaml
<thelema>
you may find less need for tall inheritance chains in ocaml, so the risk of shooting yourself in should be low without 'final'
<dobroerlanger>
Usually I don't need inheritance at all, but at the moment I am writing a binding to some C++. May be "please don't override this method" in documentation would be enough...
dnolen has joined #ocaml
joewilliams is now known as joewilliams_away
<thelema>
that'll have to suffice.
joewilliams_away is now known as joewilliams
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
dnolen has quit [Remote host closed the connection]
junsuijin has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
ak0s has quit [Quit: Leaving]
Snark has quit [Quit: Quitte]
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
_andre has quit [Quit: leaving]
sepp2k has quit [Ping timeout: 240 seconds]
dobroerlanger has quit [Ping timeout: 265 seconds]
sepp2k has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
ttamttam has quit [Quit: Leaving.]
testcocoon has joined #ocaml
ztfw has quit [Remote host closed the connection]
ankit9 is now known as ankit9|zzz
avsm has joined #ocaml
junsuijin has quit [Remote host closed the connection]
junsuijin has joined #ocaml
iris1 has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
edwin has quit [Remote host closed the connection]
randori has quit [Quit: leaving]
oriba has joined #ocaml
randori has joined #ocaml
sepp2k has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
avsm has quit [Quit: Leaving.]
Amorphous has quit [Read error: Operation timed out]
everyonemines has joined #ocaml
Boscop has quit [Ping timeout: 258 seconds]
Amorphous has joined #ocaml
arubin has joined #ocaml
oriba has quit [Quit: oriba]
avsm has joined #ocaml
randori has quit [Quit: leaving]
zorun has quit [Ping timeout: 244 seconds]
raphscallion has joined #ocaml
emmanuelux has quit [Remote host closed the connection]