flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
xevz has quit [Remote closed the connection]
xevz has joined #ocaml
johnnowak has joined #ocaml
jeddhaberstro has quit []
sporkmonger has quit []
pastasauce has joined #ocaml
jonafan_ has joined #ocaml
<jonafan_> olegfink, remember me?
<jonafan_> i figured out the solution to the problem i was having earlier today
<jonafan_> the solution is to introduce a type: type fn = Fn of (int -> fn);;
<jonafan_> then: let wrap v = let rec f a b = let newv = a + b in Printf.printf "%i\n" newv; Fn (f newv) in Fn (f v);;
sporkmonger has joined #ocaml
pastasauce has quit []
jeremiah has quit [Read error: 104 (Connection reset by peer)]
jeremiah has joined #ocaml
thelema has joined #ocaml
jonafan_ has quit ["XCHAT NEGROS"]
johnnowak has quit []
<palomer> hmm
<palomer> I want to create a custom widget
<palomer> it's like a combo box
<palomer> except the ugly arrow on the side is gone
<palomer> is there a tutorial out there on how to put widgets (in this case, labels) in a combo box?
reillyeon has joined #ocaml
reillyeon has left #ocaml []
reillyeon has joined #ocaml
mishok13 has joined #ocaml
reillyeon has quit ["Lost terminal"]
<palomer> well...
GustNG has joined #ocaml
filp has joined #ocaml
beigebox has joined #ocaml
<beigebox> can someone explain to me what's wrong in the last match case http://rafb.net/p/FtUwwb72.html ?
<GustNG> beigebox: what error?
<GustNG> Also why not do b :: soda ...
<beigebox> This expression has type 'a * 'b list but is here used with type 'b
<beigebox> GustNG: same error with b :: soda
<GustNG> In case three should be [a;b]
<beigebox> eh
<beigebox> right thanks
<beigebox> it seems like vim line numbering doesn't match ocaml's :}
<GustNG> Else it thinks it's one tuple element
<GustNG> It would give error on the fourth line but your mistake is the third
<palomer> how do I convert an int*int to an int*int Gobject?
<GustNG> What's a Gobject?
<palomer> err
<palomer> I meant Gobject.obj
<GustNG> Uh look at the module
<GustNG> It should have creation functions or something
<palomer> none
<palomer> oh my
<palomer> I have to use Gobject.Data
<GustNG> I haven't used it, check the documentation
rby has joined #ocaml
Palace_Chan has quit ["Palace goes to sleep"]
GustNG1 has joined #ocaml
kombinator has joined #ocaml
Associat0r has joined #ocaml
Snark_ has joined #ocaml
GustNG has quit [Read error: 110 (Connection timed out)]
rby has quit ["This computer has gone to sleep"]
beigebox has quit [Read error: 110 (Connection timed out)]
loscar has joined #ocaml
hkBst has joined #ocaml
GustNG has joined #ocaml
kombinator has quit [Read error: 113 (No route to host)]
hkBst has quit [Read error: 104 (Connection reset by peer)]
GustNG1 has quit [Read error: 110 (Connection timed out)]
kombinator has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
Submarine has quit ["Leaving"]
Snark_ is now known as Snark
GustNG1 has joined #ocaml
<flux> the code translation discussion on caml mailing list makes me wonder just how difficult would it be
<flux> especially considering the target language would be a dynamically typed language
<flux> there's already ocamlc for javascript, right?
<flux> which nobody mentioned. but javascript wasn't one of the target languages, though.
kombinator has quit [Read error: 104 (Connection reset by peer)]
jeremiah has joined #ocaml
GustNG has quit [Read error: 110 (Connection timed out)]
kombinator has joined #ocaml
rby has joined #ocaml
svenl has quit [Read error: 110 (Connection timed out)]
svenl has joined #ocaml
Fullma has quit [Read error: 104 (Connection reset by peer)]
kombinator has quit [Read error: 104 (Connection reset by peer)]
kombinator has joined #ocaml
svenl has quit [Remote closed the connection]
svenl has joined #ocaml
loscar has left #ocaml []
marmotine has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
kombinator has quit [Read error: 104 (Connection reset by peer)]
sporkmonger has quit []
rby has quit ["This computer has gone to sleep"]
jeremiah has joined #ocaml
ryosei has joined #ocaml
Yoric[DT] has joined #ocaml
kombinator has joined #ocaml
ryosei has left #ocaml []
sporkmonger has joined #ocaml
bzzbzz has joined #ocaml
* Yoric[DT] looks.
<Yoric[DT]> Hi, by the way.
<Yoric[DT]> thelema: no transcoding?
<thelema> not yet. if the input is UTF8, the only care needed is to not break a character.
<Yoric[DT]> ok
<Yoric[DT]> We'll need to add transcoding in Batteries 0.2.
<thelema> No problem.
<thelema> can you get the diff from github?
<thelema> grr, commit not complete
<thelema> hmmm... where's the META file...
<thelema> I thought I'd need to edit the META file to indicate the camomile dependency.
<thelema> btw, I get errors in making the docs:
<thelema> /home/thelema/Documents/ocaml.c/batteries/trunk/batteries/_build/src/additions/extlib.mli : Syntax error in text:
<thelema> line 3, character 17:
<thelema> less than 2^{30} elements.
<thelema> ^
<Yoric[DT]> Yes, that's my fault. It should have been 2{^30}.
<thelema> ok. no problem.
<Yoric[DT]> At the moment, I'm reworking the build system so I can't pull from github yet.
<thelema> no problem.
<thelema> here's the patch: http://pastebin.ca/1217939
rby has joined #ocaml
<thelema> bye
<Yoric[DT]> Thanks.
<Yoric[DT]> and bye.
Snark has quit ["Ex-Chat"]
Anarchos has joined #ocaml
<Anarchos> Can someone explain about the LOCAL_CALLBACK_CODE and THREADED_CODE flags interactions ?
sporkmonger_ has joined #ocaml
telexicon has joined #ocaml
telexicon has left #ocaml []
sporkmonger has quit [Read error: 110 (Connection timed out)]
noemie has joined #ocaml
noemie is now known as bluestorm
Yoric[DT] has quit ["Ex-Chat"]
bluestorm has quit ["Ex-Chat"]
mishok13 has quit [Read error: 110 (Connection timed out)]
GustNG has joined #ocaml
ozy` has joined #ocaml
GustNG1 has quit [Read error: 110 (Connection timed out)]
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
rby has quit ["This computer has gone to sleep"]
Yoric[DT] has joined #ocaml
bluestorm has joined #ocaml
tomh has joined #ocaml
Linktim has joined #ocaml
Linktim_ has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
struktured has joined #ocaml
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
Koordin has joined #ocaml
<Koordin> hi, how can i "try" to assign a value to a variable, and if there is an excem
<Koordin> hi, how can i "try" to assign a value to a variable, and if there is an exception, i assign another value ?
<Yoric[DT]> let my_variable = try some_expression with _ -> some_other_expression
<Koordin> i've tried : let temp = try assoc a l with Not_fond -> other
<Koordin> Not_found
<Yoric[DT]> Yes, that should work.
<Koordin> thanks i'll look again
Linktim has quit [Read error: 113 (No route to host)]
Koordin has quit ["Konversation terminated!"]
filp has quit ["Bye"]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
Linktim_ has quit [Read error: 110 (Connection timed out)]
rmns has joined #ocaml
jeremiah has joined #ocaml
jlouis has quit ["Leaving"]
ozy` has quit []
jlouis has joined #ocaml
struktured_ has joined #ocaml
itewsh has joined #ocaml
kombinator has quit [Read error: 104 (Connection reset by peer)]
struktured has quit [Read error: 110 (Connection timed out)]
itewsh has quit ["KTHXBYE"]
bluestorm has quit ["Ex-Chat"]
Submarine has joined #ocaml
snegovik has joined #ocaml
snegovik has quit [Client Quit]
rwmjones_ has joined #ocaml
snegovik has joined #ocaml
snegovik has quit [Client Quit]
snegovik has joined #ocaml
snegovik has quit [Client Quit]
snejok has joined #ocaml
<snejok> ho
snejok has quit [Client Quit]
itewsh has joined #ocaml
kombinator has joined #ocaml
Palace_Chan has joined #ocaml
lorph has left #ocaml []
Linktim has joined #ocaml
rmns has left #ocaml []
itewsh has quit ["KTHXBYE"]
itewsh has joined #ocaml
Linktim_ has joined #ocaml
<jonafan> guys
<jonafan> polymorphic variants are not helping me out
<flux> hm, can one really write applications in metacaml that deploy some "more powerful" features, other than being a more optimized end result?
Linktim_ has quit [Read error: 104 (Connection reset by peer)]
snejok has joined #ocaml
Linktim_ has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
snejok has quit [Client Quit]
GustNG has quit ["Leaving."]
<Yoric[DT]> jonafan: can we help you?
<Yoric[DT]> flux: well, for one thing, you can think of MetaOCaml as being Camlp4 with types.
<flux> yoric[dt], what can you accomplish with metacaml you cannot accomplish with plain functions?
<flux> with basically the same syntax too - and syntax customization is what camlp4 really offers
<Yoric[DT]> Note that I'm not a specialist. I've been wanting to try MetaOCaml for some time but for the moment, I've essentially been reading about it.
<Yoric[DT]> Well, the main difference with Camlp4 is that any code you generate is well-typed.
<Yoric[DT]> So you can make "safe" compilation libraries.
<flux> and with code compiled that way you can, well, execute, just as you can execute any function anyway, only that it's faster?
<flux> I suppose it might at times be ridiculously faster, enabling certain patterns of design
<Yoric[DT]> Code compiled that way is just regular code.
<Yoric[DT]> So if you compiled a function, it may be called just like any other function.
<flux> but in the end it boils down to that you have a value int -> int, and it doesn't really matter if there's a generated and compiled code behind it, or something you do every time? (other than the speed)
<flux> that is: if one has no speed needs whatsoever, what is there to gain by using metaocaml?
<mfp> Yoric[DT]: do you know if MetaOCaml does code generation itself or if it uses a hack like the experimental native toplevel (generate .s, compile & dynload)?
<flux> perhaps metaocaml+camlp4 can play nice together, so that certain kinds of extensions written in camlp4 won't bring the performance down in the way they would were they written naively
<Yoric[DT]> flux: MetaOCaml is also a nice way of implementing a compiler.
<Yoric[DT]> flux: or, more generally, a domain-specific language inside OCaml.
<Yoric[DT]> mfp: I have no idea.
<flux> yoric[dt], yes, because it's fast to run the resulting code?
<Yoric[DT]> flux: and because the resulting code is typed.
pango has joined #ocaml
<Yoric[DT]> Essentially, you have a type system for the generating code (as usual) *and* a type system for the generated code (that's new).
<Yoric[DT]> So if you can write typed "trampoline" code.
<Yoric[DT]> My knowledge essentially stops there, though :)
<mfp> hmmm so the generated code is type checked at compile compile time, so to speak?
<flux> yoric[dt], but for a dsl you don't need to generate code, you can just interpret it, which would be just as type safe? (..but slower..)
<Yoric[DT]> mfp: no, yes.
<Yoric[DT]> sorry
<Yoric[DT]> mfp: yes
<Yoric[DT]> (the "no" was from me misreading what you had written)
<mfp> so one can see it as a sort of camlp4 without the syntax rewriting part but with output that is guaranteed to be well-typed
<mfp> happening at run time
<Yoric[DT]> flux: my knowledge of MetaOCaml is too thin to be certain of my answer, but I believe MetaOCaml's type-checking is stronger than that.
<Yoric[DT]> s/to be certain/for me to be certain/
<Yoric[DT]> i.e. you can write a lambda-calculus interpreter and generate mistyped lambda terms
<Yoric[DT]> Unless I'm mistaken, MetaOCaml's type system can prevent this.
<jonafan> the problem i am having: polymorphic variants are completely unpolymorphic and it's not clear to me when or why this happens
<Yoric[DT]> jonafan: do you have an example?
<jonafan> ummm my example would be multiple files
<flux> can you have a shorter example with possibly just many modules in one file?-)
<mfp> jonafan: here's a blind guess: do you have some type a = [ `Whatever | ... ] type b = [a | ...] and then some function b -> .., then you give it some a and get a type error?
itewsh has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> :)
sporkmonger has joined #ocaml
itewsh has joined #ocaml
sporkmonger_ has quit [Read error: 104 (Connection reset by peer)]
<mfp> you'll need extra type annotations ((x :> b) in this case since there's no implicit subsumption)
<jonafan> okay well, imagine you have a series of functions that take messages in the form of polymorphic variants
<jonafan> i'm trying to make a list of those functions
<Yoric[DT]> Unrelated question: in findlib, is there a command to ask ocamlfind to please tell me its predicates?
<flux> yoric[dt], ocamlfind query -somesome?
<jonafan> it seems like it can't figure out how to merge the polymorphic variant types so that they can go in a list together
<Yoric[DT]> Nah, ocamlfind query needs predicates to be useful.
<mfp> jonafan: then the inferred type is the intersection of the [< ...] accepted types for each func?
<jonafan> well, each one should be [> ...]
<mfp> do you have a | _ -> something clause in all?
<jonafan> actually
<jonafan> yes
<jonafan> well wait
<jonafan> the plot thickens:
<jonafan> there is only one thing in this list as of yet
<jonafan> so there's really no excuse for whatever it's complaining about
<mfp> it's not [> ...], but [= ...]? is it a recursive function?
<jonafan> yes, the function is recursive
<jonafan> let me paste this one crucial file
Linktim_ has quit [Read error: 104 (Connection reset by peer)]
Linktim has joined #ocaml
<jonafan> maybe i'll just make a messages variant
<jonafan> see, the messages [will/would] come in from other threads
<jonafan> i'm trying to make the meat of the program purely functional, but still retain sort of a pluggable module thing
<jonafan> i've been trying to avoid having to define the messages in a single place
Linktim_ has joined #ocaml
<mfp> jonafan: so you want to use polymorphic variants instead of OO for that?
<jonafan> well, the messages that come in are sent through event channels
<Yoric[DT]> jonafan: just to help us, what's the type of ChatModule.handleMessage and ChatModule.empty?
rby has joined #ocaml
<jonafan> ChatModule.handleMessage is ChatModule.state -> (polymorphic variant message) -> Int64.t -> ChatModule.state * Int64.t
<jonafan> ChatModule.empty is a ChatModule.state
<Yoric[DT]> erf.
l_a_m_ has joined #ocaml
<Yoric[DT]> Starts to be a bit complex for me.
<jonafan> heh, yeah .......
<jonafan> This is all sort of experimental.
<jonafan> i'm sort of trying to use actor model concurrency
<Yoric[DT]> Sorry, I'm concentrated on debugging my own program, I'm not sure I have enough brainpower to help with yours.
<Yoric[DT]> Can you determine the type of [f]?
<jonafan> f: ChatModule.state -> (polymorphic variant type) -> Int64.t -> (polymorphic variant type) fn * Int64.t
<Yoric[DT]> Yeah, but what's that polymorphic variant type?
<Yoric[DT]> Do you know about recursive modules, btw?
<Yoric[DT]> It could be a useful tool for debugging types here.
<jonafan> the polymorphic variant type is all the various messages that the handlers handle
<Yoric[DT]> Yeah, but it's obviously not what you want.
<jonafan> like `Connected or `Packet of packet or `SendSomething of what * the * server * needs
<Yoric[DT]> Sure, but the main problem is whether it's [> ...] or [= ...] or [< ...].
Amorphous has quit [Read error: 110 (Connection timed out)]
<jonafan> they will all be open, [> ...]
Linktim has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> Are they open or should they be open?
<jonafan> they are
<jonafan> i've only finished one, though
<jonafan> but yes, it is open
<Yoric[DT]> ok
Amorphous has joined #ocaml
<jonafan> i think i need to get rid of the polymorphic variant
<jonafan> i realize this is perhaps a crazy way to write a program, but it's not something i truly intend to finish, and doing this sort of thing gives you a lot of insight in general
<Yoric[DT]> sure
mjambon has joined #ocaml
<olegfink> does ocamljava compiled .class file have any runtime dependencies?
<olegfink> s/does/do/;s/file/&s/
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
rwmjones_ has quit [Read error: 104 (Connection reset by peer)]
itewsh has quit ["KTHXBYE"]
Linktim_ has quit [Read error: 110 (Connection timed out)]
rhar has joined #ocaml
rwmjones_ has joined #ocaml
itewsh has joined #ocaml
<Yoric[DT]> Mmmhhh....
<Yoric[DT]> Okay, I keep having problems with my library deployment.
<Yoric[DT]> Essentially, I have a module which may be compiled either with threads or without threads and I wish to deploy both versions.
<Yoric[DT]> Now, I'd like to put both versions of the module in the same directory.
<Yoric[DT]> Renaming the .cma is not a problem.
<Yoric[DT]> Renaming the .cmi, of course, cause problems.
sporkmonger has quit [Read error: 110 (Connection timed out)]
Submarine has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> The ideal would be to put the .cmi into the .cma .
<Yoric[DT]> It's still not possible, is it?
<jonafan> i stripped out the polymorphic variant and defined a regular variant and my problems are gone
<Yoric[DT]> good
* Yoric[DT] wonders if it's feasible to extract a self-contained .cmi from a .mllib .
l_a_m_ has quit [Remote closed the connection]
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
tomh has joined #ocaml
itewsh has quit [Remote closed the connection]
eyu100 has joined #ocaml
<Yoric[DT]> Okay, issue solved by toying with findlib.
<Yoric[DT]> Time to call it a night.
<Yoric[DT]> 'night everyone
Yoric[DT] has quit ["Ex-Chat"]
Camarade_Tux has joined #ocaml
rby has quit ["This computer has gone to sleep"]
Associat0r has quit []
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
kombinator has quit [Read error: 113 (No route to host)]
mjambon has quit ["Leaving."]
Camarade_Tux has quit []
marmotine has quit ["mv marmotine Laurie"]
jeddhaberstro has joined #ocaml