gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
opla2 has quit [Ping timeout: 240 seconds]
willb has quit [Ping timeout: 240 seconds]
willb has joined #ocaml
jeddhaberstro has quit [Quit: jeddhaberstro]
opla2 has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
melwtech35 has quit [Read error: Connection reset by peer]
zzz_ has quit [Remote host closed the connection]
zzz_ has joined #ocaml
opla2 has quit [Ping timeout: 264 seconds]
willb has quit [Ping timeout: 260 seconds]
willb has joined #ocaml
Amorphous has quit [Ping timeout: 272 seconds]
opla2 has joined #ocaml
joewilliams is now known as joewilliams_away
Amorphous has joined #ocaml
opla2 has quit [Ping timeout: 240 seconds]
smerz has quit [Quit: Ex-Chat]
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
ulfdoz has joined #ocaml
tmaeda has quit [Ping timeout: 276 seconds]
tmaeda has joined #ocaml
ulfdoz has quit [Ping timeout: 272 seconds]
seafood has joined #ocaml
<flux> cool, someone has written sfml bindings for ocaml
<flux> I wonder if they work :)
hto has joined #ocaml
seafood has quit [Ping timeout: 255 seconds]
jcaose has joined #ocaml
munga has joined #ocaml
_andre has joined #ocaml
avsm has joined #ocaml
Snark has joined #ocaml
ttamttam has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
<adrien> I remember someone mentionning them in the past, I think he/she had some troubles with them, so report back =P
mlh has quit [Ping timeout: 248 seconds]
mlh has joined #ocaml
ftrvxmtrx has joined #ocaml
avsm has quit [Read error: Operation timed out]
hto has quit [Quit: Lost terminal]
avsm has joined #ocaml
<alpounet> flux, will you write a game ? :]
<flux> not now, I think :)
<flux> but I bought a pan-tilt-webcam and I wrote an interface to it
<flux> also it tracks how the camera is turned (from the image, because the panning interface is lousy: start now, stop now)
<alpounet> haha you can do some fun stuffs with that camera and sfml
<flux> I've been thinking I could project the data into a sphere and render that sphere (and rotate it as I rotate my camera)
<flux> that way I'd have a 'whole image' always available, but other regions would be more up-to-date than others
<flux> but probably first I'll just snap automaticalyl some pictures and feed them to hugin..
<alpounet> you could try to make a ball bounce on your head
<alpounet> *that* would be neat :p
<flux> ..
<alpounet> more seriously, there's a whole bunch of interesting transformations to do but well, it really depends on what your goal is
zzz_ has quit [Quit: Bye]
zzz_ has joined #ocaml
mnabil_ has joined #ocaml
ikaros has joined #ocaml
edwin has joined #ocaml
<edwin> hi
<edwin> the register_exns is not called when I open this module: http://llvm.org/svn/llvm-project/llvm/trunk/bindings/ocaml/bitreader/llvm_bitreader.ml
<edwin> I see in unix.ml that it does something similar, a let _ binding, and registering the exception
<edwin> what is the order these let _ bindings are executed?
fraggle_ has quit [Remote host closed the connection]
ztfw has joined #ocaml
fraggle_ has joined #ocaml
willb has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
sgnb has quit [Ping timeout: 260 seconds]
sgnb has joined #ocaml
<edwin> f[x]: thanks, I'll try to see if using val works
zhengli has joined #ocaml
zzz_ has quit [Quit: Bye]
zzz_ has joined #ocaml
<edwin> f[x]: yep val works
zzz_ has quit [Quit: Bye]
zzz_ has joined #ocaml
mnabil_ has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
rwmjones has quit [Ping timeout: 240 seconds]
joewilliams_away is now known as joewilliams
rwmjones has joined #ocaml
thelema_ has joined #ocaml
ttamttam has left #ocaml []
thelema has quit [Ping timeout: 265 seconds]
rwmjones has quit [Read error: Operation timed out]
metasyntax has joined #ocaml
opla2 has joined #ocaml
joewilliams is now known as joewilliams_away
rwmjones has joined #ocaml
smerz has joined #ocaml
tmaeda has quit [Ping timeout: 240 seconds]
tmaeda has joined #ocaml
zhengli has quit [Quit: Leaving.]
WonTu has joined #ocaml
WonTu has left #ocaml []
avsm has quit [Quit: Leaving.]
zhengli has joined #ocaml
otswim has joined #ocaml
<otswim> hello, i'm having a Fatal exception: out of memory in my code, and it seems that the execution is ending in this function: http://pastebin.com/hMESPK1n but it's not a standalone program, it's just a function in a bigger program; the last output of the code is "entering codomain"; is there an explanation to that?
<adrien> well, not enough free memory?
<otswim> is there a way to narrow down what's taking so much memory? my program should not take that much memory
<rixed> otswim: I would say the faulty function is not this one, which looks good to me
<rixed> otswim: the fact that the last thing you see from your program is "entering codomain" does not imply that the instruction pointer was in this function when the exception was raised.
<rixed> otswim: if you debug with printf, make sure to flush each printf call (ending your string with %!)
<otswim> oh right i forgot those
<otswim> still there :(
<otswim> i can also print something right before the match when entering the loop, and it get printed, but nothing after
<adrien> export OCAMLRUNPARAM="b"
<adrien> and how much mem free on the computer? how long has it been running for?
<otswim> 2GB free it has been running for less than a day; and the program instantly crashes
<gildor> otswim: what is arrow ?
<gildor> (can it contain cycles ?)
<otswim> the raise happens at the first clause after the match; i'm seeing that 'ar = arrow' is wrong i shouldn't compare this with equal
<otswim> it should just be an atom, representing a variable in some programming language
<gildor> do you have a type definition for it ?
<otswim> gildor, yes i just saw (not defined by me) that it's actually a record with a field 'copy: atom' so that's why the equality check fails
<otswim> thanks for your help
jm_ocaml has joined #ocaml
ikaros_ has joined #ocaml
ikaros has quit [Ping timeout: 250 seconds]
zhengli has quit [Quit: Leaving.]
NaCl is now known as SpanishInquisitr
SpanishInquisitr is now known as NaCl
notk0 has joined #ocaml
<notk0> hello, how can I get the value of a reference ?
<adrien> !x
<adrien> with !
<jm_ocaml> with a bang as in r := 1; !r
<notk0> thank you, I just found out anyway, but thanks
opla2 has quit [Ping timeout: 240 seconds]
Tobu has quit [Ping timeout: 260 seconds]
zhengli has joined #ocaml
munga has quit [Ping timeout: 276 seconds]
ulfdoz has joined #ocaml
<notk0> hello, I am having trouble modifying a list or a ref to a list inside a function, let's say I have let rl=ref []; and I want something like let add n=rl:=n::!rl;; and it doesn't seem to work
<notk0> nevermind I am an idiot
<notk0> I just have to pass the reference as an argument as well
_andre has quit [Quit: leaving]
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
rixed_ has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 264 seconds]
ulfdoz_ is now known as ulfdoz
ftrvxmtrx has quit [Quit: Leaving]
joewilliams_away is now known as joewilliams
boscop_ has joined #ocaml
jcaose has quit [Quit: Leaving]
boscop has quit [Ping timeout: 245 seconds]
notk0 is now known as everyone
everyone is now known as notk0
ikaros_ has quit [Quit: Leave the magic to Houdini]
boscop_ is now known as boscop
Modius has joined #ocaml
ftrvxmtrx has joined #ocaml
tmaeda has quit [Ping timeout: 260 seconds]
tmaeda has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
jm_ocaml has quit [Remote host closed the connection]
ztfw has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
otswim has quit []
<notk0> are there online docs regarding interfaces in ocaml?
<adrien> interfaces? graphical interfaces?
<notk0> adrien, I mean mli files,
<notk0> they are like C equivalent of .h ?
<adrien> I've been doing too much gtk lately I guess =P
<notk0> adrien, hehe :P
<adrien> notk0: they allow you to define the interface of modules: you can restrict which functions / values are exported to the user but they're not used to define the types (you still get type inferences) but types in your .ml and .mli files have to match of course
ikaros has joined #ocaml
<notk0> adrien, so It's just the signature of a function?
<flux> of a bunch of functions, types, etc
<hcarty> notk0: And it can be used to restrict types somewhat (ex. 'a -> 'a to int -> int)
<notk0> flux, but I have to declare it as let's say let f s=s+1;; would be declared as val f: int -> int ?
<adrien> and if you are compiling foo.ml and foo.mli exists, you have to compile foo.mli into foo.cmi first
<flux> notk0, yes
<notk0> and in ocaml multiple arguments are still represented as let's say int ->int -> int means takes 2 ints returns one?
<flux> yes
<adrien> you can get a generated .mli with "ocamlc -i foo.ml"
<adrien> it's of little use as-is (because if you use that directly, it's equivalent to have no .mli) but it can be a good start
<notk0> adrien, yes, but I want to do the interface first as a design so I know what to code later
ztfw has joined #ocaml
<adrien> ok, I see
<notk0> anyway thanks guys
<flux> notk0, tip: you can implement functions like: let f _ = failwith "not implemented yet"
<notk0> flux, oh hehe :P indeed
<notk0> flux, that is a protip BTW :P
<hcarty> notk0: I found the OCaml standard library's .mli files to be a good reference
<notk0> hcarty, I may take a look sometimes
<hcarty> When learning how to properly craft a .mli file
<notk0> hcarty, I would have to get the source for that right?
<flux> notk0, typically distributions deliver the mli-files too, as they are excellent reference
<flux> (well, ubuntu does)
<notk0> flux, I see, where would they reside?
<flux> notk0, ocamlc -where
<notk0> found them in /usr/lib/ocaml
<notk0> flux, thanks :P
<orbitz> tuareg 2 is quite a change of 1.45
<notk0> quick question, how do you cope a line in emacs without killing it like ctrl+k, I always forget and the guys in #exams tell me about the tutorial everytime...
<orbitz> C-w
<orbitz> if you have a region
<orbitz> I usually just C-k C-y if i want a line real quick
<flux> hm, M-w copies region
<flux> C-w cuts it
<notk0> flux, for me alt+k removes it as well
<flux> I don't think there's a command to copy a line
<flux> M-k does something different
<notk0> alright guess I'll have to just cut it and paste it immediately
<flux> never fear, emacs can be endlessly customized :)
<flux> but evne I don't have a shortcut for that. I do have a shortcut for marking from current point to eol, though..
<orbitz> heh
<notk0> well I am still getting used to emacs, I prefer more traditional editors
<orbitz> Isn't emacs the traditional editor ? :)
<orbitz> if tradition is defiend by age
<notk0> orbitz, hehe, considering it was created by Richard way back you could say that, :P
<notk0> orbitz, I meant traditional as in gedit or eclipse's built in one
<orbitz> Hard to say traditional here either, You certainlyc an't port yoru eclipse keyboard knowledge very far,e specially if you have it in emacs mode
<notk0> even though gedit sucks as a programmers editor, I used to use scintilla
<notk0> I think your keyboard got mad orbitz
<orbitz> my figners are mad because they are freezing irgh tnow
<notk0> orbitz, turn the heater on!
<orbitz> I'll just type faster
Snark has quit [Quit: Ex-Chat]
<notk0> orbitz, but that won't help
willb has joined #ocaml
<hcarty> notk0: Geany has passable syntax highlighting support for OCaml, but nothing can compete with the overall support in emacs and vim currently.
<notk0> hcarty, so which is better emacs or vim?
<hcarty> notk0: I prefer vim, but emacs + tuareg is probably more complete in its support
* orbitz is tryign to udpate tuareg for lwt too
<hcarty> With the right configuration, both provide good syntax highlighting and indentation support.
<notk0> hcarty, I see
<hcarty> I'm not too concerned about the rest
rixed_ has quit [Read error: Operation timed out]
<hcarty> But my understanding is that emacs is better for "the rest"
<hcarty> notk0: There are one or two Eclipse plugins for working with OCaml, but they may not be maintained any more
<notk0> hcarty, I forgot to mention, I already use emacs and tuareg, hence my emacs question from before
<hcarty> notk0: Ah, sorry - I'll quiet down :-)
<notk0> hcarty, but I find ocaml a rather strange language compared to imperative ones
<hcarty> notk0: It definitely is. Until you learn to think in a more OCaml-y way.
<hcarty> Then all languages start to look a little more functional
<notk0> hcarty, you know what I don't like about ocaml tho?
<notk0> if I want just 2 variable inside a function, why can't I just declare them at once instead of a let a=4 in let b=5 in a+b for example
willb1 has joined #ocaml
willb1 has quit [Read error: Connection reset by peer]
willb1 has joined #ocaml
<flux> notk0, hm?
willb has quit [Ping timeout: 260 seconds]
<hcarty> notk0: You could do "let a, b = 4, 5 in a + b"
<hcarty> notk0: But in most code that's not an issue.
willb1 is now known as willb
<notk0> hcarty, oh my, I didn't know that
<flux> maybe the expression for defining values in an expresion is a bit verbose
<flux> although personally I haven't minded
<notk0> guess my mind is still not adapted to a functional language
<notk0> hello, can someone tell me how this line is wrong : |Match type s -> try fun(List.assoc s list) with Not_found -> 0
willb has quit [Read error: Connection reset by peer]
willb has joined #ocaml
willb has quit [Client Quit]
willb has joined #ocaml
<adrien> you probably need to surround the "try with" with parentheses or begin...end
<adrien> it's the same issue as nested match ... with
<notk0> adrien, I think I will try to do that
<notk0> adrien, it did the trick (at least the indentation part )
<adrien> indentation? :P
<notk0> adrien, I did spellcheck, the thing you do with tabs and spaces
<notk0> ok I have a module that depends on another module, and to test it without compiling I have to do ocaml modul1.cma module2.cma? as well as open ?
<adrien> probably speaks to an emacser's ear =)
<adrien> without compiling?
<notk0> adrien, yes
<adrien> you rather call "ocaml foo1.ml foo2.ml"
<notk0> adrien, oh I see
<adrien> but why not compile?
<notk0> adrien, cause I don't want to compile everytime, the code will change a lot,
<notk0> I mean while writing it
<adrien> why not compile?
<hcarty> notk0: Take a look at ocamlscript
<adrien> something like "ocamlbuild foo.native" won't be different in effect imho
<hcarty> notk0: It allows you to write #! "script"s in OCaml and it will compile silently in the background
<hcarty> adrien: Or that too :-)
<adrien> many ways to skin a cat ;-)
<notk0> ok if I precede the name of the type by it's module of origin, T.n it works in the interpreter but if I do Open T itdoesn;t
<adrien> I really don't know how the interpreters handles having two input files
<adrien> I was actually wondering about the module/namespace issue
<notk0> adrien, it has just one in y case under emacs
<adrien> (I might have done that at some point too but gave up I think)
<notk0> adrien, is it a good idea to precede types with their origin? ex Module.t1 etc?
<adrien> when?
<adrien> if you use open, you shouldn't have to do so
<notk0> adrien, it seems to not work when testing
* julm dislikes open
<adrien> well, does it work when compiling and linking separately
<notk0> adrien, nevermind I forgot that under emacs with tuareg you have to interpret the lines ou use
<adrien> I'll take your word on that one ;p
<notk0> adrien, I just had to execute the open module_name;; line
<orbitz> notk0: general rule of thumb is to open as few modules as possible
<orbitz> i generlaly open only modules that are provising operators like >>=, |>, $, yadda
<notk0> orbitz, but if there are no conflicting names there should be no problems opening them all?
<orbitz> rename them locally if you need to, like let module F = Long.Module.Name.With.F in ...
<orbitz> notk0: not as far as the compiler is concerend
<notk0> orbitz, oh he resolves them anyway, that just helps for readability right?
<orbitz> notk0: as someone reading our code it's really annoying to not know where the heck you're pulling names from though
<adrien> the issue is that you may lose the origin of the symbol: is "print" from Module1 or ModuleZ ?
willb has quit [Read error: Connection reset by peer]
<orbitz> notk0: watch http://ocaml.janestreet.com/?q=node/82
willb has joined #ocaml
<hcarty> notk0: Also, if you are using OCaml 3.12.0 or later, you can take advantage of the local module open support - http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#toc77
<notk0> hm ocaml --version does not work
<hcarty> notk0: -version
willb has quit [Read error: Connection reset by peer]
ulfdoz has quit [Ping timeout: 240 seconds]
<notk0> I don't think that ocaml is too complicated for the average programmer, I think that much practical stuff that need to be program does not need to be designed to be "recursive"
rwmjones is now known as rwmjones|sleep
willb has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
<hcarty> notk0: It doesn't need to be - but it's nice to have a language with strong support for recursion.
<hcarty> notk0: And some code is easier to reason about in recursive form when you come back to it 18 months later :-)
<notk0> hcarty, some code yes, but I think that most doesn't
<adrien> bah, iterative and imperative with no comments is more fun =P
<notk0> let's take an IRC client, it has some threads that listen on a socket, that depending on the data received "shows" it on screen
<notk0> and it also listens to input
<notk0> I don't see much recursion in such a program
<adrien> React =P
<notk0> ?
<adrien> React is an implementation of FRP (function reactive programming) which is meant for such things
<flux> hmm, I wonder for FRP would work for an IRC client..
<flux> (and tcp connections)
<notk0> what I meant to say is that an irc client does "simple" things, it does not need to call many things recursively
<notk0> If I would program an irc client in Ocaml, I don't think I would have many if any recursive functions
<flux> notk0, well, it might for example be in many states, and such functions could be expressed as functions
<adrien> flux: add lwt to the mix =P
fraggle_ has quit [Ping timeout: 276 seconds]
<flux> ops, I mean states
<notk0> flux, but that is not recursive?
<flux> adrien, well yes, but perhaps we can disregard the underlying plumbing
<notk0> like I once did a irc bot in python, and it had a dictionary of strings to functions so I would just call the appropriate function
<flux> notk0, it can be, if you transmit from state a to state b and back to state a, possibly infinitely, never "going back". but yes, it's not perhaps recursive in the way you mean.
<adrien> I was mostly joking ;-)
<notk0> ex dic[!say] (rest of arguments)
<adrien> (even though react (or any frp lib) is great for such things)
willb has quit [Read error: Connection reset by peer]
willb has joined #ocaml
<adrien> I actually have a bug in yypkg's GUI that I wouldn't have if I were using react
<flux> well, I've written an irc bot in ocaml for logging urls (and some other functionality) and it doesn't have many recursive functions
<flux> of course, loops in general are expressed in recursion in ocaml, so naturally it does have something
<flux> and there are some search algorithms that are built that way
edwin has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
<flux> but, I'll be going off to sleep
<flux> merry christmas ;)
<notk0> flux, it's christmas already?
<flux> it's christmas eve here (00:57)
<notk0> isn't christmas on 25?
<flux> correct
<notk0> I am not a religious person bTW :P
<flux> neither am I. I severely doubt most noise around this xmas-thing is really religion-originated ;)
<notk0> well isn't it about jesuses death? XD
<adrien> merry christmas eve =P (yeah, day just changed ;-) )
<notk0> merry christmas for the people where the day just changed :P
<notk0> wait, it's midnight here as well
<notk0> rofl
<flux> notk0, perhaps officially. but, what about santa claus them? he's not the christ, is he?-)
<notk0> flux, hehe XD
<flux> and coca cola gave him his red jacket..
notk0 has quit [Quit: Leaving]
<adrien> the spam on the caml-list is starting to worry me: it doesn't sound impossible that the caml-list soon gets marked as a spammer itself
<julm> :D
mnabil_ has joined #ocaml
opla2 has joined #ocaml