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?