flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
Kerris7 has quit ["Who is Candlejack? Is he going to c"]
<alexyk> wow. ocaml swig looks quite developed, but no examples in google top except swig's docs...
alexyk has quit []
alexyk_ has joined #ocaml
ofaurax has quit ["Leaving"]
nuncanada has joined #ocaml
gaja_ has joined #ocaml
gaja has quit [Read error: 110 (Connection timed out)]
^authentic has joined #ocaml
authentic has quit [Read error: 60 (Operation timed out)]
^authentic is now known as authentic
apples` has quit [Read error: 104 (Connection reset by peer)]
apples` has joined #ocaml
palomer has joined #ocaml
struktured has quit [Connection timed out]
nuncanada has quit ["Leaving"]
jeddhaberstro has joined #ocaml
struktured has joined #ocaml
jeddhaberstro has quit []
seafood has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
seafood_ has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
johnnowak has joined #ocaml
apples` has quit ["Leaving"]
dfritz has quit ["ChatZilla 0.9.84 [Firefox 3.0.4/2008102920]"]
alexyk_ has quit [Read error: 110 (Connection timed out)]
Amorphous has quit [Read error: 104 (Connection reset by peer)]
Amorphous has joined #ocaml
johnnowak has quit []
caligula has joined #ocaml
sporkmonger has quit []
seafood_ has quit []
anders__ has joined #ocaml
<glondu> purple__: you mean, a lwt_unix with native calls to Windows API ?
<glondu> noone I can think of, inside the Ocsigen team
<glondu> but we might accept an external contribution
<purple__> hi glondu,
<glondu> (especially since Unison, which uses Lwt, is supposed to work on Windows...)
<purple__> yes i wasnt quite sure what the implications were -
<glondu> for ocsigen, anyway, I think there will be other problems
<glondu> (I mean Ocsigen on Windows)
<glondu> hi purple__
<purple__> unfortunately i am not sure i can contribute - since the code is quite low level
<purple__> i just played around with lwt a little bit on linux, and it seemed really cool - but it would be nice if it could be cross platform
<glondu> it is... it works on *bsd an hurd :)
<purple__> lol
<purple__> now i have to get you to talk to my potential customers ;-)
<glondu> unfortunately, I don't know many people expert at Windows programming
Yoric[DT] has joined #ocaml
<glondu> (maybe gildor ? alain frisch ?)
<glondu> I don't even know how hard it would be
<purple__> thanks for the suggestion
<purple__> i am just experimenting at the moment, if i continue i might try an email and see
<Yoric[DT]> hi
<glondu> hi Yoric[DT]
TaXules has quit [Remote closed the connection]
Yoric[DT] has quit ["Ex-Chat"]
rjones_afk has quit [Read error: 54 (Connection reset by peer)]
<purple__> Could anyone tell me if Unix.getsockopt_error which is reported feature in http://caml.inria.fr/mantis/bug_view_advanced_page.php?bug_id=4492 has made it into ocaml 3.11, maybe ocambrowser or man lookup ?
TaXules has joined #ocaml
<purple__> I am only running ocaml 3.10.2 and would be nice to know in case i dont need to update
<purple__> (ugghh by that i mean i can avoid updating and patch the sources to 3.10.2 myself )
<purple__> Ok nevermind its indicated in 3.11 Changelog
asabil has joined #ocaml
fschwidom has joined #ocaml
asabil has quit ["Ex-Chat"]
TaXules has quit [Remote closed the connection]
flx has joined #ocaml
flux has quit [Read error: 104 (Connection reset by peer)]
mr_uggla_ has joined #ocaml
rwmjones has joined #ocaml
mr_uggla has quit [Read error: 110 (Connection timed out)]
Kerris7 has joined #ocaml
gaja_ has quit ["Lost terminal"]
_zack has joined #ocaml
Snark has joined #ocaml
_zack has quit [Read error: 60 (Operation timed out)]
_zack has joined #ocaml
Kerris7 has quit []
_zack has quit [Read error: 60 (Operation timed out)]
svenl has quit []
_zack has joined #ocaml
svenl has joined #ocaml
rwmjones_ has joined #ocaml
rwmjones has quit [Read error: 104 (Connection reset by peer)]
^authentic has joined #ocaml
_zack has quit [Read error: 60 (Operation timed out)]
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
_zack has joined #ocaml
asabil has joined #ocaml
_zack has quit [Read error: 60 (Operation timed out)]
Snark is now known as sage-support
sage-support is now known as Snark
_zack has joined #ocaml
vixey has joined #ocaml
^authentic has joined #ocaml
^authent1c has joined #ocaml
^authentic has quit [Read error: 60 (Operation timed out)]
authentic has quit [Read error: 110 (Connection timed out)]
^authent1c is now known as authentic
Kerris7 has joined #ocaml
Kerris7 has quit [Client Quit]
willb has joined #ocaml
vixey has quit [Read error: 104 (Connection reset by peer)]
sporkmonger has joined #ocaml
threeve has joined #ocaml
threeve has left #ocaml []
vixey has joined #ocaml
mishok13 has quit [Read error: 60 (Operation timed out)]
mishok13 has joined #ocaml
<_zack> thelema: is it only me, or doc generation in current batteries' git snapshot doesn't work?
marmotine has joined #ocaml
yziquel has joined #ocaml
ikaros has joined #ocaml
gaja has joined #ocaml
<yziquel> hi. i've got a question about non-polymorphic objects and polymorphic methods. well, is it possible to have a non-polymorphic object and somehow a polymorphic method of type (for example) ('a -> 'b) -> ('a -> 'b)? when compiling it complains that 'a and 'b are not bound. can't we bind these type variables at the method level?
asabil has quit [Read error: 104 (Connection reset by peer)]
Kerris7 has joined #ocaml
petchema_ has quit [Read error: 104 (Connection reset by peer)]
<flx> yziquel, yes!
<flx> yziquel, object method foo : 'a. 'a -> 'a = fun a -> a end
<yziquel> flx: you saved my day!
love-pingoo has joined #ocaml
ikaros has quit [Read error: 110 (Connection timed out)]
<yziquel> flx: so just a dot?
<flx> yziquel, yes
ikaros has joined #ocaml
<flx> yziquel, however, these kinds of objects won't be inferred. this means let foo a b = a#foo b = b won't be compatible with that
<flx> except! I think this has changed in 3.11.0
<flx> so a object with such a polymorphic method would be compatible with object method foo a = a end
snhmib has joined #ocaml
<yziquel> flx: i'll try that out right now.
<flx> yziquel, you're on 3.11.0?
willb has quit [Read error: 60 (Operation timed out)]
snhmib has quit [Client Quit]
<yziquel> flx: nope. 3.10.2. debian package.
<flx> oh, ok
<yziquel> flx: but i'll still code it this way. Next time I'll look at the code, debian will probably be in 3.11.
mauke has left #ocaml []
<flx> yziquel, anyway, the inference problem is worked easily around by adding annotation: let foo (a : foo_class) b = ..
<yziquel> flx: so you'd have to write something like method foo : 'a. 'b. ('a -> 'b) -> ('a -> 'b) = function (phi : 'a -> 'b) -> ... ?
<yziquel> isn't there a more compact way of writing it?
<flx> method foo : 'a 'b -> ('a -> 'b) -> ('a -> 'b) = fun phi -> ..
<flx> no need to annotate the types later
snhmib has joined #ocaml
<mfp> yziquel: the syntax is 'a 'b. (not 'a. 'b.)
<yziquel> got a weird message: This method has type (bool -> 'a) -> 'a which is less general than 'b. (bool -> 'b) -> 'b. Any ideas?
<mfp> you might need polymorphic record fields too
<mfp> as in type r = { f : 'a. 'a -> unit }
<yziquel> dunno. doesn't seem to be because of a polymorphic record field...
<flx> yziquel, the first sounds like the 'a is bound somewhere else
<flx> yziquel, isn't the problem that unlocking_allowed_wrapper isn't a polymorphic method?
<flx> method unlocking_allowed_wrapper : 'a. (unit -> 'a) -> 'a = fun action -> ..
<yziquel> flx: it now seems to complain elsewhere, so i guess that was the problem. nevertheless, i find it weird that it did not complain before about unbound type variables in unlocking_allowed_wrapper.
<flx> yziquel, unlocking_allowed_wrapper in itself is ok..
<flx> I suppose it might later complain that the class has unbound type variables
<flx> or something
<flx> anyway, nice to see someone else uses classes too ;-)
<flx> yziquel, btw, what are you writing?
<flx> the mli-file is empty ;(
<yziquel> flx: i'd like to write code for mutexes to which you can send messages like: "unlock this mutex, but not until some event has been sent to you". or the reverse with locking.
<yziquel> flx: to write concurrent code more easily.
willb has joined #ocaml
<yziquel> the .mli file is empty because i've been passing the whole code to object-oriented code. cleaner when you try to reason about concurrent things from a data-centric point of view.
<yziquel> so it doesn't compile anymore...
<flx> yziquel, I've found it easy to reason when one doesn't have shared state :)
<flx> (and thus no need for mutexes either)
<yziquel> flx: ok. but what i'd like to do in the end is having rather flexible mutexes. that can be synchronised on demand, and to break the synchronisation on demand also. you could protect whole bunches of data more dynamically.
_zack has quit ["Leaving."]
mtoups has left #ocaml []
Kerris7 has quit []
anders__ has quit [Read error: 145 (Connection timed out)]
anders__ has joined #ocaml
<hcarty> alexyk: Regarding swig, in my (limited) experience, the generated interfaces tend to be very thick. There is a syntax extension which is, as I understand, meant to hide some of that. The Jane St. qtcaml OSP may have some useful tools for C++ bindings though.
<alexyk> hcarty: is the extension a separate thing somewhere?
<alexyk> the generated bindings look formidable even before compiling and figuring how to stitch them all together
<hcarty> alexyk: I haven't used the extension, I've just read about it in the swig docs
<alexyk> hcarty: aj ok
<alexyk> ah
<hcarty> I had hoped to use swig for some C libraries, but used camlidl + hand-written code instead
<hcarty> swig does have promise for huge libraries perhaps
<hcarty> But even there I'm not sure it would be worth it in most cases
<alexyk> hcarty: why not?
Koordin has joined #ocaml
<Koordin> hi could someone help me with this code please ?
<Koordin> # let s = "14285714285714285714285714285714285714285714285714285714285714
<Koordin> oups
<Koordin> the error i get is : Exception: Invalid_argument "Str.matched_group".
alexyk has quit []
love-pingoo has quit ["Connection reset by pear"]
<Koordin> ok actually there is no a third group, that's why
rwmjones has joined #ocaml
<Koordin> i have anoter problem : http://rafb.net/p/YbYjXE12.html
<vixey> Koordin, what
<Koordin> vixey: i've written the problem at the end
<vixey> This program is really weird
<Koordin> vixey: why ?
<vixey> it's just weird
<Koordin> ok :(
<vixey> Koordin, are you testing out regex before writing some other program or what?
<Koordin> yes
<vixey> what are you using regex for :P
<flx> koordin, perhaps you'll have more luck with ocaml-pcre
<Koordin> hm
<vixey> because some problems are not solved best by regex
<flx> I'm not sure how standard the backtrack-within-regexp-thingy is
<vixey> but lets not jump to conclusions
<Koordin> flx: is it a chan ?
<flx> koordin, no, it's a package for ocaml, providing perl-like regular expressions
<Koordin> Str is not good ?
<Koordin> vixey:
<Koordin> i have a string s and i want to find the biggest pattern w such as s = w^...^w^w' (where w' is a prefixe of w and where '^' is the concatenation of strings). moreover, w must not have a pattern in it (that means it must not exist a substring a such as w = a^...^a (a appears 2 times or more))
<flx> well, in my opinion its main feature is that it's standard
<vixey> Koordin, oh.. why you are using Ocaml not Prolog?
<Koordin> ocaml-pcre is standard or Str ?
<flx> I wonder if that kind of language is really regular one, which regular expressions is supposed to match..
<flx> koordin, ocaml-pcre is a separate package, it doesn't come with ocaml
<Koordin> vixey: i don't really know Prolog, why should i use Prolog ?
<vixey> Koordin, You just type exactly what you told me there (in Prolog syntax) to Prolog and it is your program.. :)
<vixey> Koordin, maybe there is a Prolog in Ocaml which works but I don't know one
<flx> koordin, if you run a linux, you'll likely be able to yum or apt-get ocaml pcre bindings
<Koordin> i'll try ocaml-pcre
<flx> I wonder if the second condition is possible to express
<Koordin> sudo apt-get install libpcre-ocaml
<flx> even in an extended regular expression
<Koordin> flx: why doesn't he minimize the size of \1 ?
Kerris7 has joined #ocaml
<flx> regular expressions are greedy, so they find the longest possible match
<flx> perl regular expressions have a non-greedy qualifier, though
<flx> manual page perlre will tell more about perl regular expressions
<Koordin> flx: look at this :
<Koordin> [19:13:08] <Koordin> ]re 14285714285714285714285714285714285714 /^(.+?)\1+(.*)$/
Gionne has joined #ocaml
<Koordin> [19:13:10] <Svadilfari> [142857,14]
<flx> koordin, and what kind of regular expression engine is that?
<flx> because I can't reproduce that with grep -E
<Koordin> i don't know i've entered this line on #regex
<Koordin> so i can't do this with Str ?
<flx> echo 14285714285714285714285714285714285714 | grep -E -o '(.+?)\1+(.*)' that is produces the whole line, not just the first 8 digits
<flx> I don't know if you can
<Koordin> ok
<Koordin> once i've downloaded libpcre-ocaml, how can i use it ?
<flx> easiest way is probably #use "topfind";; after which you can #require "pcre";;
<flx> you might want to do open Pcre;; also, as you seem to be accostumed to that
<Koordin> Unbound module Pcre
<flx> man Pcre will tell you how to use it. likely your code would be something like Printf.printf "matched: %s\n%!" (extract ~pat:"regexp here; remember quoting backslashes as you did earlier" str).(1)
<flx> did you enter #require "pcre";; ?
<Koordin> no
<flx> well..
<Koordin> Unknown directive `require'.
<flx> and did you enter #use "topfind";; before that?
<Koordin> Cannot find file topfind.
<flx> gosh, you don't have findlib
<Gionne> hello, why this doesn't work? i have to check if any of the elems of the first list is contained in the second list http://pastebin.com/m5dbabc61
<flx> sudo apt-get install ocaml-findlib
<Koordin> No such package: pcre :(
<flx> gionne, your recursive aux-function doesn't seem very useful
<Koordin> (after the require command)
<flx> koordin, strange indeed. ocamlfind list | grep -i pcre will not list pcre?
<flx> gionne, I mean, the function itself could be recursive
<Gionne> mm
<Gionne> how should i write that?
<flx> ah, never mind, I didn't quite look at your specification
<Koordin> flx: no
<flx> koordin, dpkg -L libpcre-ocaml will not list a META -file?
<flx> koordin, ah, you want the -dev -package
<Koordin> ok
<Koordin> it worked !
<Koordin> Printf.printf "matched: %s\n%!" (extract ~pat:"regexp here; remember quoting backslashes as you did earlier" str).(1)
<Koordin> could you explain me this line ?
<Koordin> what is '%!' ?
<flx> it's part of the printf syntax
<flx> man Printf will explain all those. it flushes the output.
<Koordin> ok thanks
<flx> extract returns an array of the submatches. man Pcre or reading the pcre.mli will describe the module in more detail
<Koordin> i can't find 'extract" in man Pcre
<Koordin> how can i search in the man ?
<flx> it's possibly the wrong manual page
<flx> man -a Pcre and hitting q might help
<flx> / searches
<flx> h will list the keybindings
<flx> (or man less)
<Koordin> man -a Pcre gives me the same page
<flx> and hit q?
<Koordin> q then enter ?
<flx> no, just q
<Koordin> --Man-- next: pcresample(3) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
<flx> well, it gives you three options..
mr_uggla has joined #ocaml
<flx> I don't have the corresponding manual page because I'm using a godi-based install
snhmib_ has joined #ocaml
<Koordin> ok flx i'll just read pcre.mli
snhmib has quit [Nick collision from services.]
snhmib_ is now known as snhmib
<Gionne> http://pastebin.com/me799330 i have tried another version, none of the two works. i have to check if any of the symbols in the first list are also in the second list.
<flx> gionne, have you thought of using List.find?
<Gionne> uh
<Gionne> didn't know it did exist ;)
<Gionne> thanx
mr_uggla_ has quit [Read error: 110 (Connection timed out)]
fschwidom has quit [Connection timed out]
anders__ has quit [Read error: 110 (Connection timed out)]
anders__ has joined #ocaml
<Koordin> flx:
<Koordin> flx: do you have an idea ?
<Koordin> or somebody else ?µ
caligula has quit [Read error: 104 (Connection reset by peer)]
anders__ has quit [Read error: 60 (Operation timed out)]
<Koordin> i found the mistake
Camarade_Tux has joined #ocaml
anryx has joined #ocaml
fschwidom has joined #ocaml
Yoric[DT] has joined #ocaml
asabil has joined #ocaml
<Gionne> yes flx but it doesn't work ;)
<flx> gionne, I can tell you List.find does indeed work :)
<Gionne> http://pastebin.com/m5ad248b4 that's what i wrote
<Gionne> it compiles
<Gionne> but for example already_added ["A"] ["A"] returns false
<Gionne> while i expect true
anders__ has joined #ocaml
<flx> your find -function is pointless, it returns always true
<Gionne> with highlight
<flx> why do you think it should return true?
<Gionne> mmm
<Gionne> (fun x->if x = el then true else false) this part of the code is what i am not sure about
<Gionne> but the List.find wants a 'a ->bool
<flx> yes
<flx> well, you compare the element to what you're finding, and return true if you find it
<flx> that looks fine to me
<Gionne> ok
<flx> you could shorten it to: (( = ) el)
<flx> actually first step of shortening would be: (fun x -> x = el)
<flx> all those three functions are equal to each other
<Gionne> ok
<flx> what do you think about this fragment: if (try(find hd sl) with e-> false) then true&&(already_added tl sl) else false
<flx> when you recurse into already_added, what do you think it'll return?
<Gionne> uhm
<Gionne> false
<Gionne> maybe i should write ||
<Gionne> instead of &&
<flx> maybe
<Gionne> works ;)
<Gionne> thanx again
<flx> I think you should move the try-part into the find-function you wrote
<Gionne> ok
<flx> and remove the superfluous if el = (List.find ..) - it'll always return true
<Gionne> it's the first time i use a try
asabil has quit ["Ex-Chat"]
ivan_chernetsky has joined #ocaml
<Yoric[DT]> hi
ivan_chernetsky has left #ocaml []
ivan_chernetsky has joined #ocaml
<vixey> hello
ivan_chernetsky has left #ocaml []
Kerris7 has quit []
TaXules has joined #ocaml
anders__ has quit [Read error: 110 (Connection timed out)]
ivan_chernetsky has joined #ocaml
ivan_chernetsky has left #ocaml []
alexyk has joined #ocaml
mwhitney has quit [Read error: 104 (Connection reset by peer)]
vpalle has joined #ocaml
mwhitney has joined #ocaml
Snark has quit ["Ex-Chat"]
mfp has quit [Read error: 104 (Connection reset by peer)]
ivan_chernetsky has joined #ocaml
ivan_chernetsky has left #ocaml []
Stefan_vK1 has joined #ocaml
rwmjones has quit ["Leaving"]
Snark has joined #ocaml
bouzukist has joined #ocaml
<bouzukist> salut
mfp has joined #ocaml
ivan_chernetsky has joined #ocaml
<flx> hm, do the fftw bindings from godi actually work?
<flx> my ubuntu provides fftw3.h, while they expect fftw.h
<flx> bouzukist, perhaps you want to address your questions to the channel
ivan_chernetsky has left #ocaml []
bouzukist has quit []
love-pingoo has joined #ocaml
Snark has quit ["Ex-Chat"]
Stefan_vK has quit [Read error: 113 (No route to host)]
<alexyk> how does one download qt-caml off trac?
<flx> I think that's external to trac.. downloading the source that is
<alexyk> ok
<flx> but, actually you can download something with the "Download in other formats: Zip archive" -link down the pages in browse source view
apples` has joined #ocaml
alexyk has quit []
<flx> the example looks pretty nice
hkBst has joined #ocaml
<flx> also, the name of the utility is great :) (stroustub)
alexyk has joined #ocaml
<alexyk> how is an ocaml object destroyed?
<vixey> self destruction
<love-pingoo> garbage collection
<alexyk> so by going out of scope only? what if I want to destroy them explicitly?
<love-pingoo> you can have a method for cleaning up things
<love-pingoo> then you forget about the object
<love-pingoo> and it'll be destroyed by the memory manager
<alexyk> love-pingoo: and what is it called?
<love-pingoo> like sockets for example: you Unix.close them explicitly, then they get destroyed (and closed if needed) when not used anymore
<love-pingoo> alexyk: you create your convention
<love-pingoo> I call it #sleep in some project, for example
<alexyk> love-pingoo: how does ocaml know to call it?
<love-pingoo> for shutting doing management threads, kicking socket clients and shutting it down, etc
<love-pingoo> alexyk: if you want to explicitly destroy, you explicitly call the method which you designed for that purpose
<alexyk> love-pingoo: and implicitly, how do you tell ocaml to call that method on going out of scope?
<love-pingoo> if you want it to be implicit you might also be able to set a finalizer for the gc
<love-pingoo> I you want I can elaborate on how to try that, but in any case I advise you to try a small example to see if it can really work and if it's sensible for you
<love-pingoo> sounds hackish
<alexyk> okok, thx
alexyk has quit []
<flx> using finalizers for things other than releasing memory resources is not something I'd do
<flx> so, things like file descriptors or locks - no
Mr_Awesome has quit ["aunt jemima is the devil!"]
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
Kopophex has joined #ocaml
<love-pingoo> flx: me neither, it doesn't give enough control, but I guess he'll figure out by himself (he didn't even say what he was doing precisely)
<love-pingoo> 'night
love-pingoo has quit ["Connection reset by pear"]
alexyk has joined #ocaml
vpalle has quit [Read error: 110 (Connection timed out)]
ivan_chernetsky has joined #ocaml
ivan_chernetsky has left #ocaml []
Camarade_Tux has quit ["Leaving"]
marmotine has quit ["mv marmotine Laurie"]
<yziquel> in the following method declaration with an optional argument "method try_lock ?wait_to_unlock:access_right ()", the wait_to_unlock item is either None, or Some access_right? am i right?
<yziquel> stupid question. sorry.
jeddhaberstro has joined #ocaml
anryx has quit ["Leaving"]
ikaros has quit [".quit"]
vpalle has joined #ocaml
alexyk has quit []
seafood has joined #ocaml
<Yoric[DT]> 'night everyone
Yoric[DT] has quit ["Ex-Chat"]
vpalle has quit [Connection timed out]
psnively has joined #ocaml
<psnively> Hello everyone. Any idea when GODI will include 3.11.0?
jeddhaberstro has quit [Read error: 104 (Connection reset by peer)]
jeddhaberstro has joined #ocaml
vpalle has joined #ocaml