cjeris changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
Mr_Awesome has joined #ocaml
_blackdog has quit [Remote closed the connection]
screwt8 has joined #ocaml
_blackdog has joined #ocaml
mikeX_ has quit ["leaving"]
david_koontz has quit ["This computer has gone to sleep"]
nuncanada has quit ["Leaving"]
pango has quit [Remote closed the connection]
pango has joined #ocaml
_blackdog has quit [Remote closed the connection]
Nutssh has quit ["Client exiting"]
Madonna has quit []
Nutssh has joined #ocaml
skal has joined #ocaml
mshlimov has joined #ocaml
mshlimov has quit [Client Quit]
mshlimov has joined #ocaml
<mshlimov> i am new to ocaml. may i ask a question?
<mshlimov> what does this compiler message mean exactly? what is option?
<mshlimov> This expression has type Cil.lval option but is here used with type
<mshlimov> Cil.lval = Cil.lhost * Cil.offset
<Smerdyakov> I recommend reading the tutoral in the OCaml manual. Then you should be able to understand the definition of option in http://caml.inria.fr/pub/docs/manual-ocaml/manual033.html
<mrvn> An option is a type 'a option = None | Some 'a. It is used for optional arguments.
Smerdyakov has quit ["Leaving"]
Mr_Awesome has quit ["...and the Awesome level drops"]
slipstream has joined #ocaml
<mshlimov> thanks guys,
<mshlimov> does someone have a link to this "official" tutorial that Smerdyakov mentioned ?
<mrvn> google
<mrvn> He gave you the urls anyway. just follow the up link
ygrek has joined #ocaml
<mshlimov> i think he gave me a link to the part of the manual that describes formally the optional type
<mshlimov> when i search that page for "tutorial" there are no occurances
<mrvn> You can search for ocaml an find the url.
<mrvn> mshlimov: That page is (part of) the tutorial.
<mrvn> Follow the up arrow till you get to the index.
bluestorm_ has joined #ocaml
<mshlimov> mrvn: that was a link to the manual. the tutorial is seperate.
ygrek_ has joined #ocaml
<mshlimov> interesting approach to null values...
ygrek has quit [Remote closed the connection]
ygrek_ has quit [Remote closed the connection]
<mrvn> There are no NULL values.
<mshlimov> :)
<mrvn> You can't make ocaml segfault without C code or Obj.magic.
<mshlimov> what programming tasks is python better suited than ocaml as the programming language of choice?
<mrvn> scripting
ygrek has joined #ocaml
<mrvn> thinks below a page or two in code.
<mshlimov> because it can be executed dynamically and isn't strongly typed? any other reasons?
<mrvn> because it is a scripting language basically
<mrvn> Although in that range shell (bash) is a good alternative
<mshlimov> by dynamically i meant without compilation
<bluestorm_> ocaml can be executed without compilation too
<mshlimov> i remember seeing that now that you mention it
<mshlimov> ml vs mli
<bluestorm_> i think you could actually use python as a front-end in some case
<bluestorm_> for example you want a Qt front-end : as ocaml doesn't have one for now, you may use a python front-end for the GUI stuff
<bluestorm_> (altought ocaml is perfectly able to do GUI stuff with GTK for example, and the code looks even nicer than with python)
dLeCamarae has joined #ocaml
<dLeCamarae> How are as statements done in Ocaml?
<dLeCamarae> Hello, World!
<dLeCamarae> How are as statements done in Ocaml?
<dLeCamarae> The equivalent of the following Haskell:
<mrvn> foo; bar; baz
<dLeCamarae> fun true a@(x, y) = (x, y) == (a)
<dLeCamarae> As in, to match a pattern yet get it back, via an as form.
<mrvn> let true a x y = (x, y) == a
* dLeCamarae has forgotten all the ML!
<mrvn> match foo with (x, y) as a ->
<dLeCamarae> Hmm ... that doesn't work, either. Anyway, I think I'll land on it, somewhere ahead.
<dLeCamarae> Must tell you I am doing Ocaml because of F#.
<dLeCamarae> So I can write code in a functional language - Ocaml, to be precise - and go running on .NET.
<dLeCamarae> Okay. See you, all.
dLeCamarae has quit [""!""]
<bluestorm_> hmm
<bluestorm_> [10:39:07] <mrvn> let true a x y = (x, y) == a
<bluestorm_> actually
<bluestorm_> a@(x,y) mean (x, y) as a
<bluestorm_> hmm
<mrvn> bluestorm_: I haven't programmes haskell in, oh, 8 years.
<bluestorm_> :p
<mshlimov> any emperical evidence related to productivity and the use of functional languages ?
jlouis_ has quit [Remote closed the connection]
<mshlimov> or not so emperical :)
<bluestorm_> hm
<bluestorm_> there is the yaron minksy talk
<bluestorm_> you could read some old talks like "Why functional programming matters" ( http://www.math.chalmers.se/~rjmh/Papers/whyfp.pdf )
<bluestorm_> or even the Backus one
<bluestorm_> but they're more about the beauty or fun or superiority of functional languages, than about productivity
<mrvn> I'm always amazed at how well my code works once I get all the compiler errors fixed.
<bluestorm_> i'm always amazed at how non-functional people code screw up once they run it :p
<bluestorm_> (i was a few days ago in a programming contest (Ocaml, C, C++, Pascal, Java), and there OCaml was a big advantage)
<mshlimov> thanks.
<mshlimov> F# seems cool
<mshlimov> OCAML on .NET
<bluestorm_> beuw
<mshlimov> with access to all the libraries
<ita> ocaml on .net ?
<bluestorm_> mshlimov: F# has dropped some interesting OCaml features
<bluestorm_> (the objet model for example)
<bluestorm_> (but F# has some new features too)
<bluestorm_> it's less efficient too
<mshlimov> interesting
<mshlimov> you must admit that the wide range of libraries is compelling though
<ita> bah, ocaml cannot even load code dynamically in native code :P
<bluestorm_> i love ocaml because it's a fun langage to use
<bluestorm_> i doesn't really care about the libraries
<mrvn> It can, just not ocaml code.
<bluestorm_> ita: F# doesn't have native code
<ita> bluestorm_: right
<bluestorm_> mshlimov: actually, do you know one major library that F# have and OCaml doesn't ?
<bluestorm_> i'd say Qt but see no other
<mshlimov> hmm i dunno
<bluestorm_> and i'm sure it's possible to spend some time adding Qt support in Ocaml
<bluestorm_> for example using a PyQt -> pyOcaml -> ocaml bridge
<mshlimov> i don't have anything in particular in mind
<ita> ugly
<bluestorm_> hum
<bluestorm_> you could do a whole Qt binding
<mshlimov> i just knew that .NET would have a ton of existing libraries created for it
<bluestorm_> hum
<bluestorm_> i'm not interested in DirectX support, it's not portable
<ita> i am using ocaml with c++ directly http://www.kde-apps.org/content/show.php?content=55242
<bluestorm_> hmmm ita
<bluestorm_> is Semantik the new Kdissert ?
<ita> the qt code is better written as c++ anyway
<ita> bluestorm_: it is a rewrite
<bluestorm_> great :)
<ita> python + ocaml + c++
<bluestorm_> (i love kdissert)
<bluestorm_> hm
<bluestorm_> btw
<ita> excellent :-)
<bluestorm_> there was a lot of noise about some python code in the KDE svn recently
<bluestorm_> but there was ocaml code for a long time
<ita> thethe noise is because the kde libraries are requiring python
<ita> this is new
<ita> nothing like an app requiring python or other tools
<mrvn> xen requires python
<mrvn> I was playing with the idea of rewriting dpkg/apt in ocaml.
<ita> mrvn: why not invent something new instead ? :-)
<bluestorm_> Xavier Leroy worked on package management recently
<bluestorm_> but it was server-side management
<ita> while talking about that, does anybody know a library or a piece of code for graph coloring, that is finding minimum amount of colors necessary for a graph ?
<mrvn> Uh, wasn't that 5 or 7 or something?
<ita> for a random graph ?
<bluestorm_> hm
<mrvn> It is 4 for a planar graph or not?
<bluestorm_> you use ocaml-twt ?
<bluestorm_> for a map it's 4
<mrvn> bluestorm_: a map is a planar graph.
<bluestorm_> ita: is there a way to translate .kdi into .sem ?
<bluestorm_> hm
<ita> bluestorm_: .kdi files are opened without trouble ..in theory
<bluestorm_> semantik support .kdi too, great ^^
<ita> this is a preview, it is not safe to move your documents yet (i mean, documents containing pictures)
<ita> i am afraid picture handling is buggy - i did not test it
<ita> on the other hand it is possible to make nicer maps (try the force-based map reorganization)
<ita> [planarity constraints and optimizations will come later]
<ita> bluestorm_: and do not look at the code either :-)
<mrvn> I tried that once in combination with corral growth to generate better freeciv maps.
<ita> mrvn: ¿did it work?
<bluestorm_> hm
<bluestorm_> Traceback (most recent call last):
<bluestorm_> File "<string>", line 126, in ?
<bluestorm_> UnicodeDecodeError: 'utf8' codec can't decode bytes in position 3223-3225: invalid data
<bluestorm_> Segmentation fault
<bluestorm_> (while typing something in the search bar of the linear view, but i can't reproduce it anymore)
<mrvn> Quite well.
joshcryer has quit [Read error: 104 (Connection reset by peer)]
<ita> bluestorm_: which qt version ?
<bluestorm_> 4.2.2
<ita> thanks for the feedback, i will add a more restrictive filter for string data
<bluestorm_> force-fixed reorganization is cool
<bluestorm_> hm
<bluestorm_> one little problem is the fact that disconnected graph may end really far one from another
<ita> known problem
<bluestorm_> (this gives a lot of new features ideas ^^)
<ita> yes
<ita> there are many other unimplemented things
<ita> and as usual, undo+redo come last :-/
<ita> the mouse interaction has been changed, now it is possible to do almost everything from the select mode
<ita> (wheel to zoom, middle-button to scroll, double-click on a link to disconnect, click on items to link)
dark_light has quit [Remote closed the connection]
<ita> an interesting feature i have found when doing the caml bindings is that without CAMLparam0 and CAMLreturn the garbage collector can make crashes very difficult to track
<ita> as soon as a value is used
<ita> with only integers (as in the fibo example) everything is fine
<bluestorm_> metaphore.setData(holomorphe);
<mrvn> As soon as you store the address of a value accross gcc calls you are screwed.
<mrvn> s/gcc/gc/
<ita> bluestorm_: so whqt ? :-)
<ita> "code is poetry"
<bluestorm_> hm
<bluestorm_> this is obfuscation :p
<ita> bluestorm_: no, this is waiting kdelibs 4 (not safe for hacking right now)
<ita> the code is really ugly yes
<ita> lots of "stuff", "x" and others
mshlimov has quit [Read error: 110 (Connection timed out)]
chowmeined has joined #ocaml
chowmeined has left #ocaml []
ygrek has quit [Remote closed the connection]
pango has quit [Broken pipe]
screwt8 has quit [Success]
pango has joined #ocaml
_blackdog has joined #ocaml
screwt8 has joined #ocaml
ikaros has joined #ocaml
ygrek has joined #ocaml
ikaros has quit ["segfault"]
Zzompp has quit [Remote closed the connection]
kig has quit ["bing"]
cjeris has joined #ocaml
cjeris has quit [Read error: 104 (Connection reset by peer)]
LeCamarade has joined #ocaml
<LeCamarade> Forgotten how it is that I load a lib. Is it by #load Unix;; ? Don't work ...
<LeCamarade> On the REPL, that is.
pango has quit [Remote closed the connection]
pango has joined #ocaml
<bluestorm_> LeCamarade:
<bluestorm_> you mean, in the interactive toplevel ?
<LeCamarade> bluestorm_: Yes.
<bluestorm_> #load "unix.cma";;
<LeCamarade> bluestorm_: And what are you doing here? Spying? Aren'
<bluestorm_> ?
<LeCamarade> t you supposed to ne in #haskell?
<bluestorm_> yes
<bluestorm_> my wonderful irc client support multiple channels
<bluestorm_> :)
<LeCamarade> bluestorm_: Doesn't work, it seems.
<LeCamarade> Doesn't.
<bluestorm_> hm
<LeCamarade> Syntax error on the dot.
<LeCamarade> Oh!
<LeCamarade> Hold.
<LeCamarade> Worked!
<LeCamarade> My bad.
<LeCamarade> Thanks.
<LeCamarade> :oD
<LeCamarade> We have the whole channel to ourselves! :oD
Hadaka has quit [zelazny.freenode.net irc.freenode.net]
<bluestorm_> :p
<bluestorm_> LeCamarade:
<bluestorm_> you can add the Unix support at launch
<bluestorm_> ocaml unix.cma
<bluestorm_> (and when you're gonna compile, ocamlc unix.cma ...)
<LeCamarade> Yeah, but I think it
<LeCamarade> 'was good to remember how to do it with #load.
<LeCamarade> Okay, now I keep getting the error, that reference to undefined global variable Unix.
<LeCamarade> And yet I did ocamlc -o sock sock.ml unix.cma
<LeCamarade> Oh, figured it. Order of args. :oD
pedro_soc has joined #ocaml
smimou has joined #ocaml
pattern has quit [zelazny.freenode.net irc.freenode.net]
pattern has joined #ocaml
ita is now known as ita|away
<ygrek> there is no ocamlmklib on windows - right?
Smerdyakov has joined #ocaml
<ygrek> how can I compile ocamlgsl on windows with mingw?
<ygrek> or with msvc?
jlouis has joined #ocaml
<ygrek> huh. looks it works. not a piece of cake..
<ygrek> but only bytecode. though it is enough right now.
mikeX has joined #ocaml
fremo has joined #ocaml
ygrek has quit []
<LeCamarade> Okay, A call to Unix.read keeps terminating at the next new line. Isn't there another function I can use?
<ulfdoz> LeCamarade: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html <- The chapter about "General input functions"
<LeCamarade> ulfdoz: Reading ...
<LeCamarade> ulfdoz: Still, I don't see one that could read beyond the \n. Maybe I see wrong?
<LeCamarade> Let me try input.
<LeCamarade> Doesn't work, because I am reading from a file descriptor.
<LeCamarade> :o(
<pango> how much Unix.read will read is implementation dependant
<LeCamarade> I have set it up in a loop to read as much ... wait. Maybe 'tis my bug.
<pango> that's roughly what really_input does for in_channels
<LeCamarade> Oh, so lemme try using really_input and see ...
<LeCamarade> Because it may be my hack that lacks. Pun/rhyme accidental.
benny has joined #ocaml
Amorphous has quit ["shutdown"]
Amorphous has joined #ocaml
benny_ has quit [Read error: 110 (Connection timed out)]
LeCamarade has left #ocaml []
malc_ has joined #ocaml
pango has quit [Excess Flood]
pango has joined #ocaml
mshlimov has joined #ocaml
cjeris has joined #ocaml
vincenz has joined #ocaml
Naked has joined #ocaml
Naked is now known as Hadaka
<vincenz> Hello
<pedro_soc> hi, what book do you recommend for learn Ocaml ?
<vincenz> the free o'reilly one
<pedro_soc> i had been working with Practical ocaml.
<pedro_soc> hi vincenz : thanks.
joshcryer has joined #ocaml
Mr_Awesome has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
Submarine has joined #ocaml
screwt8 has quit [Read error: 104 (Connection reset by peer)]
screwt8 has joined #ocaml
malc_ has quit ["leaving"]
Morphous has joined #ocaml
Amorphous has quit [Nick collision from services.]
Morphous is now known as Amorphous
cjeris has quit [Read error: 54 (Connection reset by peer)]
ita|away is now known as ita
skal_ has joined #ocaml
skal_ has quit [Remote closed the connection]
skal has quit [Read error: 110 (Connection timed out)]
ita is now known as ita|afk
postalchris has joined #ocaml
smimou has quit ["bli"]
postalchris has quit ["Leaving."]
screwt8 has quit [Read error: 104 (Connection reset by peer)]
screwt8 has joined #ocaml
Submarine has quit ["Leaving"]
pedro_soc has quit [Read error: 60 (Operation timed out)]
vincenz has quit ["leaving"]