smimou changed the topic of #ocaml to: OCaml 3.08.3 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
beschmi has quit ["Leaving"]
znutar has quit [Read error: 110 (Connection timed out)]
mattam has quit [Read error: 148 (No route to host)]
ooo has quit [Read error: 60 (Operation timed out)]
jinterest has left #ocaml []
mr_pengy has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 145 (Connection timed out)]
mr_pengy has quit [Remote closed the connection]
mlh has quit [Client Quit]
bzzbzz has quit ["leaving"]
vezenchio has joined #ocaml
__DL__ has joined #ocaml
mlh has joined #ocaml
cjohnson has quit ["Leaving"]
Submarine has joined #ocaml
ghibli has joined #ocaml
razorclaw has joined #ocaml
Msandin has joined #ocaml
pango_ has quit [Remote closed the connection]
mlh has quit [Client Quit]
rossberg has joined #ocaml
ejt has joined #ocaml
mflux has quit [sterling.freenode.net irc.freenode.net]
mflux has joined #ocaml
Submarine_ has joined #ocaml
Submarine has quit [Remote closed the connection]
Submarine_ is now known as Submarine
pango has joined #ocaml
vdrab has joined #ocaml
shawn has joined #ocaml
Smerdyakov has quit [sterling.freenode.net irc.freenode.net]
shawn_ has quit [sterling.freenode.net irc.freenode.net]
Herrchen has joined #ocaml
joey_ has quit [Read error: 54 (Connection reset by peer)]
Smerdyakov has joined #ocaml
shawn_ has joined #ocaml
<mflux> and good morning
shawn_ has quit [No route to host]
<mflux> hmm, is it ok to store values of type 'value' into my own data structures in C, or do they need to be of type value*?
<mflux> the documentation suggests that gc may change what is at the other end of the pointer
<mflux> but on the other hand, if you call a c-function from ocaml, a concrete value is all you get
<mflux> blah, and this message http://caml.inria.fr/pub/ml-archives/caml-list/2004/12/0d1eb5a8f71adebfd18cce4bd18c8c8c.en.html says too that one must dereference the value each time it is used, but the sample code doesn't actually seem to do that, unless by dereferencing it means first casting value into something dereferencable and then doing it..
Msandin has quit [Read error: 113 (No route to host)]
<mellum> mflux: you should be able to store it in a struct directly and use register_global_root
ghibli has quit [Read error: 60 (Operation timed out)]
<mflux> I'm doing that, but I do wonder how in the end it is possible to test that the program is nicely co-operating with the gc ;)
<mellum> mflux: Set GC limits really low, and run it for a few hours ;)
<mellum> mflux: Actually, the best advice IMHO is to avoid C at all cost. It's extremely error prone.
<mflux> I'm playing with building ocaml-support for irssi, so that's not something that can be avoided ;)
<mflux> a tool that would allow 'inline c' to be written into ocaml could make this task quite somewhat easier
<mellum> It's supposed to be hard, so that you give up before wasting too much time ;)
vezenchio has quit [Read error: 145 (Connection timed out)]
kinners has joined #ocaml
vdrab has quit ["bye"]
vezenchio has joined #ocaml
shawn_ has joined #ocaml
razorclaw has quit ["Hmm wonder what does this black cord do ..."]
shawn has quit [Read error: 145 (Connection timed out)]
ghibli has joined #ocaml
kisu has joined #ocaml
kisu has left #ocaml []
smimou has joined #ocaml
kinners has quit ["leaving"]
bzzbzz has joined #ocaml
<mflux> I wonder how easy it is to see from a .cmo-file, which interfaces it requires to work
Msandin has joined #ocaml
<vincenz> Is there a bail-out early fold version?
<vincenz> (as in...if I'm folding with && as soon as I hit a false I can bail out)
<mflux> afaik no
TeXitoi has joined #ocaml
<TeXitoi> hi
<TeXitoi> someone here to help me?
Msandin has quit [Read error: 110 (Connection timed out)]
Snark has joined #ocaml
<vincenz> don't ask to ask, just ask
cjohnson has joined #ocaml
inka has joined #ocaml
<TeXitoi> I'm trying to do a context module (ie a list of words before, a word, a list of word after)
<TeXitoi> I have the type:
<TeXitoi> type 'a t = { k: int; before: 'a Queue.t; after: 'a Queue.t; mutable cur: 'a };;
<TeXitoi> I'm trying to do a create fonction:
<TeXitoi> let create k = { k = k; before = Queue.create (); after = Queue.create (); cur = None };;
<TeXitoi> But I have a "strange" type:
<TeXitoi> val create : int -> 'a option t = <fun>
<vincenz> obvious
<TeXitoi> I don't find how to do that the good way
det has joined #ocaml
<vincenz> very obvious
<vincenz> mutable cur: 'a
<vincenz> and you put a None in it
<vincenz> so 'a must be of type 'b option
<vincenz> None | Some of 'b
<TeXitoi> I've tryed Obj.magic 'a (find in the source code of Queue), but it segfault...
<vincenz> why?
<TeXitoi> vincenz: You see what I'm trying to do?
<vincenz> It's obvious what's hapenning
<vincenz> I told you what the problem is
<TeXitoi> mm
<vincenz> type 'a t = {.... mutable cur : 'a }
<vincenz> and then you create one with cur = None
<vincenz> where None comes from 'a option = None | Some of 'a
<vincenz> so it becomes an 'a option t
<TeXitoi> but is there a polymorphic value that I can use here?
<vincenz> ?
<TeXitoi> None is bad, I know
<vincenz> then pass the correct value
<vincenz> or a default value
<TeXitoi> a defaut polymorphic value? but which one?
<vincenz> well then it's obvious you have a design problem
<vincenz> have your create take the initial value
<vincenz> or make it an option
<TeXitoi> no
<vincenz> the problem you have is a design problem
<vincenz> how can you initialize something if you have no value?
<TeXitoi> create just have the size of the context
<TeXitoi> with a "add" fonction
<vincenz> Code wise either you get the right value or work with an option
<vincenz> I'm not going to discuss how you design your code without more info
<vincenz> let create k w =
<vincenz> let create k w = {k =k; before = Queue.create(); after = Queue.create(); cur = w}
<vincenz> or change the type spec and get
<vincenz> mutable cur : 'a option
<TeXitoi> yes, that is a solution
<TeXitoi> I see what I can do with it, but... ;-)
<vincenz> it's a design choice you have to make
<TeXitoi> difficult to explain exactly what I want to do ;-)
ghibli has quit []
ghibli has joined #ocaml
* Snark thinks if it's difficult to explain to a human being, then it probably won't work at all with a computer...
* vincenz grins
<ulfdoz_> re
<TeXitoi> arf ;-)
<TeXitoi> what I need is in fact 'a option ;-)
<TeXitoi> vincenz: the trouble was that I had not understand the option use ;-)
<vincenz> yip
<TeXitoi> now it's fine, thanks
<vincenz> welcome ;)
ejt has quit ["leaving"]
ghibli has quit []
xkb has joined #ocaml
inka has quit []
Gueben has joined #ocaml
ejt has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
Submarine has quit ["Leaving"]
Submarine has joined #ocaml
bubba123 has joined #ocaml
<bubba123> Hey. I'm getting link errors trying to compile ocalffi. undefined reference to __errno being the most prominent.
CosmicRay has joined #ocaml
<mflux> hmm, how come there isn't lexing.cmo or .cma in my installation, but .cmx does exist? it's built-in somewhere?
<mflux> oh, standard library, never mind that ;)
vezenchio has quit [""Under democracy one party always devotes its chief energies to trying to prove that the other party is unfit to rule—and bot]
<bubba123> CosmicRay do you know how to deal with "undefined reference to __errno " problems?
<CosmicRay> sorry, no
smimou has quit [Read error: 60 (Operation timed out)]
smimou has joined #ocaml
Herrchen has quit ["good night"]
__DL__ has quit [Read error: 104 (Connection reset by peer)]
bubba123 has quit [Read error: 60 (Operation timed out)]
Snark has quit ["Leaving"]
aelfgar has joined #ocaml
<mflux> let's say I have a c-program that has ocaml-code (links with byterun), and it also incorporates the toplevellib.cma. is it easy to share symbols between the toplevel?
<mflux> I have function Foo.bar, which I have successfully called from the initialization functions, but the eval expressions I give to the toplevel don't seem to be aware of the Foo-module at all
aelfgar has left #ocaml []
xkb has quit []
ejt has quit [Read error: 110 (Connection timed out)]
joey_ has joined #ocaml
TeXitoi has quit ["leaving"]
TeXitoi has joined #ocaml
_fab has quit [Remote closed the connection]
<vincenz> Anyone ever worked on pattern recognition in a series of data?
Submarine has quit ["Leaving"]
mlh has joined #ocaml
CosmicRay has quit ["Client exiting"]
Gueben has quit ["Leaving"]
cjohnson has quit [Remote closed the connection]
bzzbzz has quit ["leaving"]
smimou has quit ["?"]
merc_ has joined #ocaml