jlouis has quit [Read error: 104 (Connection reset by peer)]
Axioplase has quit ["/quat"]
Palace_Chan has joined #ocaml
Palace_Chan has quit [Client Quit]
<doy>
mfp: awesome, thanks, that works
bla has quit [Read error: 60 (Operation timed out)]
bla has joined #ocaml
alexyk has joined #ocaml
kg4qxk is now known as bohanlon
bzzbzz has joined #ocaml
* palomer
totally gives up on recycling widgets
<palomer>
im gonna have to resort something uglier
<palomer>
which still has a memory leak
<palomer>
because I'm a maverick!
johnnowak has joined #ocaml
jeddhaberstro has quit []
Associ8or has quit [Read error: 104 (Connection reset by peer)]
thelema has quit ["rebooting"]
alexyk has quit []
thelema has joined #ocaml
thelema has quit [Read error: 104 (Connection reset by peer)]
davidm123 has joined #ocaml
alexyk has joined #ocaml
pierre- has joined #ocaml
Palace_Chan has joined #ocaml
<Palace_Chan>
i have an x of type: 'a const......id like to return it with the 'a modified but when i do: {x with thefield = (some, other, parametrization) x.thefield} it interprets it as function application!
<Palace_Chan>
is it possible to do somethin glike this?
alexyk has quit []
alexyk has joined #ocaml
alexyk has quit [Read error: 104 (Connection reset by peer)]
pierre_m has joined #ocaml
<flux>
hmm
<flux>
are you attempting to asssign a type?
<flux>
to construct values you use, well, contructors, and x.thefield doesn't look like any kind of constructor
johnnowak has quit []
pierre- has quit [Read error: 110 (Connection timed out)]
<palomer>
hrmph
<palomer>
it seems the gtk list is oblivious to my memory leak problem
<flux>
palomer, can you reproduce the problem in plain gtk?
<palomer>
yeah
<flux>
so it isn't a bug in the bindings. always nice ot hear :)
<palomer>
err
<palomer>
I mistook plain gtk
<palomer>
I don't know how to write plain gtk
<flux>
oh
<palomer>
do you?
<flux>
by gtk list you refer to the real gtk+-for-c mailing list?
<palomer>
the ocaml program is 36 lines
<palomer>
I mean the lablgtk list
<flux>
ok :)
<flux>
I don't know gtk really, but it shouldn't be very complicated. however in this light I would still expect the leak to be in the bindings..
<flux>
looks like the problem is encoding variants then, not tuples
sporkmonger has quit [Connection timed out]
<doy>
yeah, but other stuff i'm doing with encoding variants seems to work, not sure what the deal is
<doy>
maybe the problem is with variant constructors that take a list, rather than with lists of tuples
<flux>
pair = caml_alloc(2, 0); -> shouldn't it be (2, 1) ?
<flux>
hmm
<flux>
ah, never mind
<flux>
(well, that might be, but I again misinterpreted the structure)
<flux>
so you want to return a tree
<doy>
yeah, i figured the list should have tag 1, and that the tag for the pairs wouldn't matter
<doy>
and... sort of
<flux>
how come you put two integers into a pair?
<flux>
shouldn't it bee two values of type t?
<doy>
hmmm
<doy>
i don't *think* that's the problem, because in my actual code i'm doing that part properly
<doy>
i think anyway
<flux>
and I think 42 and A 42 are differently represented in the memory; the latter is boxed
<doy>
yeah
<doy>
hmmm
<flux>
weren't you supposed to return a list?
<doy>
am i not?
<flux>
unit -> t
<doy>
oh, hmmm, maybe that's the issue
<doy>
aha, yup
<doy>
just had to wrap the list in a value of type t
<doy>
(:
<Yoric[DT]>
And we now officially have a on-line help in the Batteries Included toplevel.
<doy>
thanks
<flux>
doy, well, don't mind that, interacting with C is unfortunately very error prone
<flux>
there is actually a verifier for that
<orbitz>
zbrown: stop following me kthx
<zbrown>
orbitz: gtfo noob
<flux>
that is: automatic checking of c-bindings against ocaml code
<flux>
but 1) I don't know how well it works 2) I've forgotten its name :)
* zbrown
will eat orbitz's legs
<doy>
yeah, but i'm really liking the ocaml bindings though
<doy>
they're really nice to work with, overall
* orbitz
causes bowel iritation!
* zbrown
needs more time in the day
<flux>
doy, I have bindings to libev that die due to memory management issues under high load, and I have not been able to find the issue. and I have tried.
<doy>
i'm writing bindings for lua at the moment
<doy>
and other than these few issues, it's coming along quite well
bla has quit [Read error: 60 (Operation timed out)]
bla has joined #ocaml
ygrek has joined #ocaml
Amorphous has quit [Read error: 104 (Connection reset by peer)]
munga has quit [Read error: 110 (Connection timed out)]
munga has joined #ocaml
sporkmonger has joined #ocaml
sporkmonger has quit [Client Quit]
Amorphous has joined #ocaml
sporkmonger has joined #ocaml
mishok13 has quit [Read error: 110 (Connection timed out)]
sporkmonger_ has quit [Read error: 110 (Connection timed out)]
ygrek has quit [Remote closed the connection]
jihelhere has quit ["Leaving."]
munga has quit ["Leaving"]
GustNG1 has joined #ocaml
alexyk has joined #ocaml
pierre_m has joined #ocaml
rpg has quit [Connection timed out]
pango has quit [Remote closed the connection]
GustNG has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
yziquel has joined #ocaml
<yziquel>
Hello. Can anyone tell me what is wrong with this Str regular expression?
<yziquel>
let rho = regexp "<data\\[^>\\]*>\\(\n\\|\t\\| \\)*\\(\\[^ ^\t^\n\\]*\\)\\(\n\\|\t\\| \\)*</data\\[^>\\]*>";;
<Camarade_Tux>
yziquel, you're using \n and \t at some places, don't you rather want \\\n and \\\t ?
<Camarade_Tux>
and I think it's [^ \\\t\\\n], not [^ ^\\\t^\\\n]
<Camarade_Tux>
for the rest, well, can't really help you
<yziquel>
Camarade_Tux: perhaps. However even "<data\\[^>\\]" seems not to work...
<yziquel>
Camarade_Tux: I'll give it a shot.
GustNG has joined #ocaml
<Camarade_Tux>
"<data..." should work, but you shouldn't use '^' before each character you want to get rid of
<Camarade_Tux>
(well, not exactly characters but the idea remains)
<yziquel>
Camarade_Tux: even worse "<data\\[ \\]" does not work out properly...
<yziquel>
These Str regular expressions are really awkward...
<Camarade_Tux>
yziquel, they need more escaping than the PCRE ones
<Camarade_Tux>
especially since you give them in an ocaml-string
<yziquel>
Camarade_Tux: I haven't found any solid documentation on them on the web...
<yziquel>
Camarade_Tux: I mean documentation that explains precisely how to escape them...
<yziquel>
Camarade_Tux: because it's at least half of the pain.
<Camarade_Tux>
yziquel, well, beside the Str documentation you just have to remember to escape all the backslashes
rpg has joined #ocaml
<Camarade_Tux>
there's no magic, just the ocaml string format
<Camarade_Tux>
but I agree it's quite annoying
<yziquel>
Camarade_Tux: well, it seems I've been escaping too much:: let rho = regexp "<data[^>]*" in string_match rho "<datafromhere" 0;; yields true!
<Camarade_Tux>
yziquel, well, yeah
<Camarade_Tux>
your re was definitely too complicated too ;)
GustNG1 has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux>
and remember you have \b (well, "\\b"), which makes me realize I was probably wrong telling you to use "\\\n", it should probably be "\\n"
<Camarade_Tux>
as you see, escaping is really fun :)
filp has quit ["Bye"]
<yziquel>
Eurêka. I finally got it... Thanks
Linktim has joined #ocaml
Linktim has quit [Read error: 104 (Connection reset by peer)]
Linktim has joined #ocaml
<jonafan>
wooOOOooOOOo two downloads for my btrees
Linktim_ has joined #ocaml
tomh has joined #ocaml
<jonafan>
is there some secret to using svn with the forge?
<doy>
has anyone had issues with receiving duplicate events under lablgtk?
tomh has quit [Client Quit]
<Camarade_Tux>
jonafan, three ;)
<Camarade_Tux>
as for the svn, dunno
longh has joined #ocaml
vixey has joined #ocaml
Linktim has quit [Read error: 113 (No route to host)]
alexyk has quit []
<flux>
yziquel, you know, there are extensions to reduce the clutter of escaping regular expressions
<flux>
anyway, I believe \n is what one wants inside re's
<flux>
yziquel, also, \\[\\] would mean matching literally "[]"
<flux>
argh
alexyk has joined #ocaml
<flux>
I'm just getting to the end of the screen and apparently yziquel found these on his own :)
thelema has quit [Read error: 104 (Connection reset by peer)]
ygrek has joined #ocaml
itewsh has joined #ocaml
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
<Camarade_Tux>
someone on ##mingw just had a completely stupid idea : running msys/mingw under wine
<Camarade_Tux>
but that could maybe help compiling for windows =)
<Camarade_Tux>
... if that ever works ;p
middayc has joined #ocaml
<Yoric[DT]>
I've tried, actually :)
<Yoric[DT]>
Ah non, that was cygwin, but still the same idea.
<Yoric[DT]>
And that was for testing the cygwin version of OCaml for my students.
Submarine has joined #ocaml
<alexyk>
the only good OCaml book now seems... Expert F# -- but some stuff there if F# only
<alexyk>
they show type {...} with member f1 ... member f2 and dot notation
<vixey>
alexyk: yuck
<alexyk>
can OCaml do that or is it something F#-ish?
<alexyk>
type vector {x:int; y:int} with member length = sqrt(x*x+y*y)
<alexyk>
v.length
<alexyk>
OCaml has records for sure, I wonder why/how is the difference came about
<rwmjones>
alexyk, use: { vector with x = 2 }
<Camarade_Tux>
Yoric[DT], was that at least a tiny whiny bit conclusive ?
<rwmjones>
alexyk, also here's an ocaml book which is going to be published later this year: http://mojave.caltech.edu/jyh/
<alexyk>
rwmjones: thanks! what about member function declarations for record types -- not in OCaml? no dot notation, module and # only?
<alexyk>
I mean class object and # only?
<flux>
no methods in records, correct
<flux>
methods only in objects, correct
<alexyk>
well that's a nice F# feature, wonder if stuff like that will flow back
<vixey>
alexyk: yuck yuck yuck
<flux>
I would say it's highly unlikely, unless you find a way to implement it with the preprocessor
<alexyk>
well why not? languages change, even python adds new syntax
<vixey>
alexyk: yuck..
<flux>
there is the problem of adding new syntax in a way that still compiles old code
<flux>
unless you make a clean break
<flux>
you've got the source, you can patch the feature in if you like ;)
<alexyk>
flux: correct... so would dot notation on methods break something? now we'll have things like obj.method param1 param2 which looks like resolvable
<flux>
alexyk, hmm, you would want the dot-notation because you're more familiar with it?
<flux>
ocaml has no overloading. if you have a . b, a could then be either a record or an object
<flux>
so that doesn't work
<flux>
you would need to find a way to make it work
<flux>
and preferably without the program writer needing to add more type annotations
<alexyk>
I just like the record with members, I'd settle for that even with #
<flux>
perhaps if records and objects were laid out in the same way in the memory, that could be made to work
<flux>
however changing the way they are currently laid out would break c-bindings
<alexyk>
I used to take x.y for granted, but after R and x$y and . in names like mean.x I don't care
<flux>
also I cannot see how that would not reduce performance
<flux>
perhaps a clever way could be deviced
<mfp>
alexyk: is there any inheritance mechanism for record records in F#?
<mfp>
alexyk: also, is it possible to have type vector {x:int; y:int} with member length = sqrt(x*x+y*y) type 'a dummy = { x : 'a list } with member length = List.length x and then x.length # ad-hoc polymorphism?
<alexyk>
mfp: dunno, am enjoying the Expert F# book and it's in fact the only thing which made me curious in Micro$oft ever... will read if you can inherit records
<palomer>
flux, can you post on the lablgtk list saying that you can reproduce my memory leak?
<alexyk>
mfp: am going to try it in F# when I run my VMWare Fusion with VS in it ... after I clear up some RAM :)
* palomer
always thought that F# was ocaml without structural subtyping
* palomer
is off
<mfp>
if you cannot have two member functions with the same name (the same way you cannot access two fields from diff record types with the same name at once), then you could have a trivial syntax extension to do x$foo => foo x, approaching the F# thing (no "instance variables" though)
philed has joined #ocaml
<Yoric[DT]>
Camarade_Tux: well, it worked.
_JusSx_ has joined #ocaml
<Yoric[DT]>
And it allowed me to notice that the official Windows release of Tcl/Tk was incompatible with OCaml.
<Camarade_Tux>
Yoric[DT], ok, thanks a lot, it could be nice to have that
<Yoric[DT]>
To have what?
<Camarade_Tux>
ocaml producing windows executable on linux
<Yoric[DT]>
Ah, ok.
<Camarade_Tux>
a cross-compiler for the poor ;)
<Yoric[DT]>
:)
<Yoric[DT]>
gottago
<Yoric[DT]>
Talk to you later.
<Camarade_Tux>
if it works well, I'll try to put it on my livecd (coming soon (c) ), would be good to test
<Yoric[DT]>
Yep.
<Camarade_Tux>
ok, see you
<Camarade_Tux>
(and have to go too ;) )
<yziquel>
flux: thanks for your comments on my regular expression problem.
<alexyk>
mfp: your example works!let a = {x = 1.0; y = 2.0};; val a : vector
<alexyk>
> a.length;;
<alexyk>
val it : float = 2.236067977
<alexyk>
let b = {x = [1;2;3]};;
<alexyk>
val b : int dummy
<alexyk>
> b.length;;
<alexyk>
val it : int = 3
<alexyk>
So F# has ad-hoc polymorphism on record types
<alexyk>
generally it's a lovely thing -- if ever I have to develop for Wiindows, F# is a fun way to do it, with all .net libraries and attributes too
<alexyk>
alas on Mac mono is slower than native things, and my Mac-Linux setups are faster for ocaml anyways
GustNG has quit [Read error: 104 (Connection reset by peer)]
itewsh has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
<philed>
I would have liked to see row-polymorphism in F#. That's one of the coolest thing's I've seen in a while.
<philed>
But it doesn't even have record subtyping.
itewsh has joined #ocaml
olegfink has quit ["WeeChat 0.2.6"]
itewsh has quit ["KTHXBYE"]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
thelema has joined #ocaml
Snark_ has quit ["Ex-Chat"]
pierre- has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has quit ["Leaving"]
Axle has joined #ocaml
tomh has joined #ocaml
Axle has quit [Client Quit]
Axle has joined #ocaml
<Axle>
hello, I have a question regarding linking files
<Axle>
to compile, I use: ocamlfind ocamlc -package cairo -o main testcairo.cmo
<Axle>
when doing so, I get: Error while linking testcairo.cmo: The external function `ml_cairo_image_surface_create' is not available
<Axle>
some system information: Ubuntu linux, libcairo installed via package manager. "ocamlfind query cairo" finds cairo.
<Axle>
the weird thing is, doing "#use "topfind";; #require "cairo";; #use "testcairo.ml";;" in the toplevel, produces the desired picture
pierre_m has quit [Remote closed the connection]
<Axle>
if this isn't the right place to ask this, someone direct me to the right place.
alexyk has joined #ocaml
middayc has quit [Read error: 60 (Operation timed out)]
ygrek has quit [Remote closed the connection]
middayc has joined #ocaml
<Axle>
anyone?
<mfp>
Axle: have you tried -linkpkg ?
<mfp>
ocamlfind ocamlc -package cairo -o main testcairo.cmo -linkpkg
<Axle>
will do
<Axle>
sweet
<Axle>
I don't want to say "why do I need that?" because obviously it means to link packages
<Axle>
but, why can't it do that automatically?
<Axle>
I guess I don't really understand what I'm telling the compiler
<hcarty>
Axle: I think that may be in one of the ocamlfind/findlib FAQs. I'm not sure though.
<doy>
Axle: you're telling ocamlfind to add the packages to link to the ocamlc command line
<doy>
the packages specified by -package, anyway
<Axle>
right
<Axle>
why isn't it assumed that I would then want to link said packages that I just specified?
<doy>
because you might just be compiling
<doy>
and doing linking later
<doy>
only the link step needs to see those libraries
<doy>
the compile step just needs to include the libraries, not link with them
<Axle>
ah
<Axle>
ok
<Axle>
I'm new to this, if you couldn't tell
<hcarty>
doy: Regarding your earlier question, I think I may be getting doubled events in lablgtk on occasion, but I'm not sure if it's my fault or something else
<hcarty>
doy: Or, rather, I was. I think it was for entry and exit events.
<doy>
hcarty: the situation i'm having is that on my computer, i don't see any issues at all, but other people are getting duplicate button_press events
<doy>
and when i run it under windows in vmware, i get duplicate configure events when windows are created
<doy>
it's annoying because i can't debug it
<doy>
since it doesn't happen for me
<doy>
but it makes the app unusable for other people
<hcarty>
I just started with lablgtk and GUI programming in general, so I'm still getting the hang of it
<doy>
i've done gtk stuff before, but this is my first lablgtk project
GustNG has joined #ocaml
Linktim has joined #ocaml
Axle has left #ocaml []
Linktim_ has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
Linktim has quit [Read error: 110 (Connection timed out)]
Asmadeus has quit ["cya !"]
Linktim has joined #ocaml
Asmadeus has joined #ocaml
alexyk has joined #ocaml
philed has quit ["Leaving"]
sporkmonger has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
_JusSx_ has quit ["leaving"]
alexyk has quit []
alexyk has joined #ocaml
ofaurax has joined #ocaml
itewsh has quit ["KTHXBYE"]
jeddhaberstro has joined #ocaml
GustNG has quit ["Leaving."]
Submarine has quit [Remote closed the connection]
seafood has quit [Read error: 60 (Operation timed out)]
alexyk has quit []
alexyk has joined #ocaml
<vixey>
when you say "fails if the list is empty" or anything like that in ocaml does that mean throws an exception?
seafood has joined #ocaml
alexyk has quit [Read error: 104 (Connection reset by peer)]
alexyk has joined #ocaml
hkBst has quit [Read error: 54 (Connection reset by peer)]
<Yoric[DT]>
vixey: yes
<Yoric[DT]>
And with these words, good night.
Yoric[DT] has quit ["Ex-Chat"]
alexyk has quit [kornbluth.freenode.net irc.freenode.net]
slash_ has quit [kornbluth.freenode.net irc.freenode.net]
palomer has quit [kornbluth.freenode.net irc.freenode.net]
fremo has quit [kornbluth.freenode.net irc.freenode.net]