gildor changed the topic of #ocaml to: "Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0+rc1 http://permalink.gmane.org/gmane.comp.lang.caml.inria/49387
philtor has quit [Ping timeout: 276 seconds]
jakedouglas has joined #ocaml
jakedouglas has quit [Quit: Leaving.]
orbitz has quit [Read error: Connection reset by peer]
orbitz has joined #ocaml
jakedouglas has joined #ocaml
jakedouglas has quit [Ping timeout: 240 seconds]
jakedouglas has joined #ocaml
joewilliams_away is now known as joewilliams
seafood has joined #ocaml
joewilliams is now known as joewilliams_away
afreq has quit [Remote host closed the connection]
despa has joined #ocaml
mihamina has quit [Quit: Leaving.]
dskippy has quit [Ping timeout: 240 seconds]
dskippy has joined #ocaml
ulfdoz has joined #ocaml
jakedouglas1 has joined #ocaml
jakedouglas has quit [Ping timeout: 240 seconds]
|marius| has joined #ocaml
philtor has joined #ocaml
philtor has quit [Ping timeout: 248 seconds]
rwmjones has quit [Ping timeout: 245 seconds]
rwmjones has joined #ocaml
|marius| has quit [Remote host closed the connection]
<Associat0r> can someone tell me the rationale of why lablgtk uses a layered system of polymorphic variants and classes ?
<thelema> manageability - if every type was distinct...
<thelema> it'd be a *lot* of types
<thelema> similarly for classes. sometimes it's annoying trying to figure out what methods a particular object has because of the long inheritance chains
orbitz has quit [Ping timeout: 276 seconds]
valross has quit [Quit: Ex-Chat]
<Associat0r> I read this http://www.ocaml-tutorial.org/introduction_to_gtk and this http://www.ocaml-tutorial.org/calling_c_libraries but they didn't really explain the rationale
<thelema> lablgtk is practically the reason ocaml has objects and polymorphic variants (I dunno how historically true this is)
coucou747 has joined #ocaml
<Associat0r> a lot of people think objects are a mistake, do you agree with it?
<thelema> they have their uses. Often they're used incorrectly
<thelema> this said, I rarely use them
<dskippy> thelema: I am definitely with you on that.
<Associat0r> but the way they are used in lablgtk is that valid usage?
<dskippy> thelema: It's amazing how many good, professional software engineers favor using class-based objects but don't really do OO and probably don't realize that.
<Associat0r> also what if lablgtk didn't rely on gtk, would they still use OO?
<thelema> yes, the object oriented bindings to gtk are definitely valid usage (despite the complexity of both)
<Associat0r> btw they do use Ocaml's object inheritance in labgtk right?
<thelema> dskippy: there's not just one meaning of OO
<thelema> Associat0r: yes, lots
<thelema> dskippy: but I get your point and agree with it in principle
<dskippy> thelema: I suppose that's true.
<Associat0r> it's still a little vague to me why they used both polyvars and objects is there a site where they fully explain the rationale?
<thelema> everyone using java uses class based objects. They don't all use object oriented design.
<thelema> Associat0r: not to my knowledge. Email Jacques Garrigue - he's very friendly about explaining lablgtk, which is his baby (as is polymorphic variants)
<thelema> (and labeled functions)
<Associat0r> thanks for the advice
<Associat0r> btw what would you do if you had to design a GUI lib totally from scratch not relying on anything external?
ulfdoz has quit [Ping timeout: 248 seconds]
<Associat0r> what would the design look like?
<thelema> I'd spend a couple years becoming proficient at GUI lib use and go from there
<dskippy> Associat0r: I would definitely go OO on a GUI toolkit. GUI toolkits are some of the best examples of times when OO really shines.
<thelema> sorry, I don't know the right way to design a gui toolkit
<Associat0r> dskippy: and would you use any polyvars even when there was no interop?
<dskippy> Associat0r: I'm afraid I'm familiar with the term polyvars.
<Associat0r> polymorphic variants
<thelema> polymorphic variants : variants :: objects : records
<thelema> (in as much as they're structurally typed as opposed to nominally typed)
<dskippy> Associat0r: Reading about them now. Can't say I could really give an educated opinion on it tonight though.
<dskippy> I am trying to install libsndfile bindings. I got a tar.gz with not META file. I installed it with ocamlfind. Seemed like it worked. It can find the library now. Problem is when I tried to compile something I get "gcc: sndfile_stub.o: No such file or directory" That file is in the directory with all the other installed files. Where is gcc wanting it to be?
<thelema> dskippy: you'll need a proper meta file
<dskippy> thelema: I made one.
<dskippy> thelema: It wouldn't install without one.
<dskippy> thelema: Not really even sure how I'm supposed to use a library without ocamlfind since I'm very new to OCaml. But it seemed like the wise thing to do to try to install the shared library.
<thelema> hmm, did you install the sndfile stubs?
<thelema> ocamlfind install takes a list of files - did you forget the stubs?
jakedouglas1 has quit [Quit: Leaving.]
<dskippy> thelema: I installed them.
<thelema> are they .o or .a?
<dskippy> To be specific I have a /usr/local/lib/ocaml/3.11.1/sndfile/sndfile_stub.o file.
<thelema> what else is in that dir?
<dskippy> I'll pastebin it.
<thelema> is there a ...stub.a file created by make?
<dskippy> Nope. I'll pastebin the src directory.
<thelema> got me, then
<dskippy> Bummer. :(
<dskippy> Do you know how to link this stuff if it's not installed?
ftrvxmtrx has quit [Quit: Leaving]
<dskippy> ocaml's man page says to list the object files then the script file.
<dskippy> Well I get different errors for the various object files I try.
<thelema> yup, you just list all files to be linked
<thelema> you're including the correct -I, right?
<dskippy> Everything ranging from "Invalid character" (which probably means its not the right file to be linking) to "external function not "...
<dskippy> the correct -l?
<thelema> if you're pointing at files elsewhere, -I helps the compiler locate them
<thelema> -I /usr/local.../sndfile
<dskippy> Oh I see.
<dskippy> Which object file from that dir should I be using? I get the most reasonable sounding error when I use sndfile.cmo
<thelema> depends on how you're compiling - native or bytecode?
<dskippy> Native.
<thelema> native - cmx/cmxa, bytecode - cmo/cma
<thelema> use the cmxa
Amorphous has quit [Ping timeout: 265 seconds]
<dskippy> With "ocamlc -I ~/src/libsndfile-ocaml/sndfile.cmxa mix.ml" I get "Unbound value Sndfile.openfile"
<thelema> -I the directory only, not the .cmxa
<thelema> also, ocamlc is bytecode compilation
<thelema> ocamlopt is native
<dskippy> Oh right. I get usage message if I do it the otherway.
<dskippy> Oh really? Oye. :)
<dskippy> Hm
<dskippy> I get that original gcc message about there being no sndfil_stub.o
<thelema> apparently this is a known flaw of those bindings...
<dskippy> Huh
<thelema> heh, one workaround is to symlink the stub to the current dir
<dskippy> Trying to understand all this quickly.
<dskippy> Possibly compile in the current dir?
<dskippy> I mean compile in the directory it's in.
<thelema> that should work too
bacam has quit [Read error: Operation timed out]
bacam has joined #ocaml
<dskippy> thelema: That does work. Annoying. But it works.
<dskippy> Thank you for the help.
Amorphous has joined #ocaml
<thelema> no problem
f[x] has joined #ocaml
Vassia has joined #ocaml
coucou747 has quit [Remote host closed the connection]
Vassia has quit [Ping timeout: 260 seconds]
ftrvxmtrx has joined #ocaml
Tianon has quit [Ping timeout: 252 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
cchee has quit [Ping timeout: 245 seconds]
Vassia has joined #ocaml
Vassia has quit [Ping timeout: 248 seconds]
seafood has quit [Quit: seafood]
barismetin has joined #ocaml
Snark has joined #ocaml
Tianon has quit [Ping timeout: 276 seconds]
ViciousPlant has quit [Read error: Connection reset by peer]
ViciousPlant has joined #ocaml
Vassia has joined #ocaml
Vassia has quit [Ping timeout: 240 seconds]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
Anarchos has joined #ocaml
xmarteo has joined #ocaml
seafood has joined #ocaml
seafood has quit [Ping timeout: 240 seconds]
ViciousPlant has quit [Read error: Connection reset by peer]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
_andre has joined #ocaml
ztfw` has joined #ocaml
ztfw has quit [Read error: Connection reset by peer]
sdschulz` has joined #ocaml
SEcki has joined #ocaml
sdschulze has quit [Ping timeout: 240 seconds]
Vassia has joined #ocaml
Vassia has quit [Read error: Operation timed out]
avsm has joined #ocaml
<krankkatze> Warning X: this statement never returns (or has an unsound type.)
<krankkatze> what does this mean?
<krankkatze> http://pastebin.com/6Jgx9NKC here is the source code
ikaros has joined #ocaml
ikaros has quit [Client Quit]
<mfp> krankkatze: you usually get that when you write a loop function without a base case; I don't know why you're getting that in your code
<avsm> that would never terminate
<avsm> the cht (succ id) is always called...
<krankkatze> oh
<krankkatze> isn't it in the else statement?
<avsm> it parses as (if blah then () else blah); cht (succ id)
<avsm> you want to put a begin/else around the else
<krankkatze> yeah
<krankkatze> thanks
<krankkatze> it works now
ccasin has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
schme has joined #ocaml
schme is now known as schmrkc
metasyntax has quit [Quit: Be seeing you.]
th5 has joined #ocaml
mihamina has joined #ocaml
<mihamina> hi all
<mihamina> I want to replace single quotes with "\'" using: Str.global_replace Str.regexp "'" "\'", but the single quote is not replaced
<mihamina> If I use Str.global_replace Str.regexp "'" "\\'", the backslash is escaped and I get "\\'"
<mihamina> how to replace a single quote using Str?
bzzbzz has joined #ocaml
Vassia has joined #ocaml
Vassia has quit [Ping timeout: 260 seconds]
<flux> mihamina, have you tried printing out the result?
<flux> mihamina, maybe you're being misled by the quoting toplevel performs to its values
<mihamina> flux: Yes, I was
<mihamina> after testing, the double escape is the solution
<mihamina> \\'
<mihamina> no
<mihamina> grrr
<mihamina> \'
sdschulz` has left #ocaml []
avsm has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
ztfw` has left #ocaml []
ztfw has joined #ocaml
joewilliams_away is now known as joewilliams
|marius| has joined #ocaml
|marius| has quit [Remote host closed the connection]
rwmjones has quit [Ping timeout: 240 seconds]
jakedouglas has joined #ocaml
rwmjones has joined #ocaml
mihamina has left #ocaml []
Vassia has joined #ocaml
Vassia has quit [Ping timeout: 276 seconds]
ftrvxmtrx has quit [Quit: Leaving]
jakedouglas has quit [Ping timeout: 240 seconds]
jakedouglas has joined #ocaml
barismetin has quit [Remote host closed the connection]
barismetin has joined #ocaml
barismetin has quit [Remote host closed the connection]
travisbrady has joined #ocaml
ftrvxmtrx has joined #ocaml
jonafan_ is now known as jonafan
sepp2k has joined #ocaml
travisbrady has quit [Quit: travisbrady]
philtor has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
dark has quit [Ping timeout: 245 seconds]
th5 has quit [Quit: th5]
th5 has joined #ocaml
th5 has quit [Client Quit]
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
ccasin has quit [Quit: Leaving]
|marius| has joined #ocaml
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
SEcki_ has joined #ocaml
ftrvxmtrx has joined #ocaml
SEcki has quit [Ping timeout: 265 seconds]
coucou747 has joined #ocaml
Anarchos has joined #ocaml
<flux> wish the qt bindings came a reality
<flux> while it's possible to have a front-end program written in C++ and have it communicate with the backend in ocaml and work that way, it works only if the backend program does something very isolated
_andre has quit [Quit: Lost terminal]
_mpu has left #ocaml []
Snark has quit [Quit: Ex-Chat]
sepp2k has quit [Quit: Leaving.]
avsm has joined #ocaml
coucou747 has quit [Read error: Connection reset by peer]
philtor has joined #ocaml
valross has joined #ocaml
xmarteo has quit [Quit: Debian GNU/Hurd is Good.]
avsm has quit [Quit: Leaving.]
SEcki_ has quit [Quit: cu]
seafood has joined #ocaml
philtor has quit [Ping timeout: 258 seconds]
ulfdoz has quit [Read error: Operation timed out]