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
thelema_ has joined #ocaml
<Yoric[DT]> 'night
Yoric[DT] has quit ["Ex-Chat"]
seafood_ has joined #ocaml
karasuman has joined #ocaml
<karasuman> Kaustuv, are you around?
seafood has quit [Success]
<karasuman> I thought I got HOL Light going--it loaded in the ocaml top level without any errors--but I get this error whenever I type anything in backquotes: Parse error: [ident] expected after '`' (in [expr])
<karasuman> does anyone know what that means?
Cybera has joined #ocaml
Cybera has left #ocaml []
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
ched_ has joined #ocaml
seafood_ has quit [Read error: 110 (Connection timed out)]
Ched has quit [Read error: 110 (Connection timed out)]
pierre_m has joined #ocaml
karasuman is now known as kara-zzz
kara-zzz is now known as karasuman
jeddhaberstro has quit []
karasuman has left #ocaml []
AxleLonghorn has joined #ocaml
jonafan_ has joined #ocaml
AxleLonghorn has left #ocaml []
AxleLonghorn has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
manju__ has joined #ocaml
manju_ has quit [Remote closed the connection]
^authentic has joined #ocaml
authentic has quit [Read error: 145 (Connection timed out)]
^authentic is now known as authentic
seafood has quit []
<AxleLonghorn> I get that OSpec [1] is a little new, but has anyone used it yet? Is it any good?
AxleLonghorn has left #ocaml []
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
seafood has joined #ocaml
seafood_ has joined #ocaml
seafood has quit [Read error: 54 (Connection reset by peer)]
seafood_ has quit []
slash_ has quit [Client Quit]
kaustuv_ has quit ["ERC Version 5.3 (IRC client for Emacs)"]
mbishop_ is now known as mbishop
mikeX has joined #ocaml
mikeX__ has joined #ocaml
mikeX has quit [Read error: 60 (Operation timed out)]
mikeX_ has quit [Read error: 110 (Connection timed out)]
s4tan has joined #ocaml
animist has quit [Read error: 110 (Connection timed out)]
animist has joined #ocaml
^authentic has joined #ocaml
authentic has quit [Read error: 145 (Connection timed out)]
^authentic is now known as authentic
Alpounet has joined #ocaml
<Alpounet> Hi
verte has joined #ocaml
seafood has joined #ocaml
_zack has joined #ocaml
_zack has quit [Remote closed the connection]
_zack has joined #ocaml
Palace_Chan has joined #ocaml
Palace_Chan has left #ocaml []
jeanbon has joined #ocaml
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
<Alpounet> hi Yoric[DT]
pierre_m has quit ["Leaving."]
hkBst has joined #ocaml
Alpounet has quit [K-lined]
Alpounet has joined #ocaml
jeanbon has quit ["J'y trouve un goût d'pomme."]
<Alpounet> Hi all
<Alpounet> I've a grammar defined with camlp4 and then try to parse a string wrt my grammar. I catch the Loc.Exc_located exception. But I get "(_,_)" instead of where the problem is in my string. I print the exception with :
<Alpounet> printf "Parse error: %s\n%!" (Printexc.to_string exn)
<Alpounet> Any way of getting more details, unlike : Parse error: Loc.Exc_located(_, _)
<Alpounet> ?
ttamttam has joined #ocaml
Alpounet has quit ["Ex-Chat"]
seafood has quit []
Alpounet has joined #ocaml
Alpounet has quit ["Ex-Chat"]
petchema_ has joined #ocaml
Snark_ has joined #ocaml
Snark_ is now known as Snark
petchema has quit [Read error: 110 (Connection timed out)]
oliv48 has joined #ocaml
pierre_m has joined #ocaml
ttamttam has left #ocaml []
mikeX has joined #ocaml
mikeX__ has quit [Read error: 110 (Connection timed out)]
th5 has joined #ocaml
Snark has quit ["Ex-Chat"]
mikeX has quit [Read error: 60 (Operation timed out)]
mikeX has joined #ocaml
pants2 has quit ["Leaving."]
verte has quit ["http://coyotos.org/"]
oliv48 has quit ["http://www.mibbit.com ajax IRC Client"]
alp_ has joined #ocaml
<alp_> re
barismetin has joined #ocaml
alp_ is now known as Alpounet
Associat0r has joined #ocaml
Associat0r has quit [Read error: 104 (Connection reset by peer)]
bzzbzz has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Read error: 104 (Connection reset by peer)]
<kaustuv> Is there an ocamldoc of the camlp4 api on the web somewhere?
<kaustuv> Does anyone know of a syntax extension that does transformations like this: http://ocaml.pastebin.com/m16762a79 ?
<flux> kaustuv, pa_hole.ml
<kaustuv> Thanks.
_andre has joined #ocaml
jeanbon has joined #ocaml
willb has joined #ocaml
Alpounet has quit [Remote closed the connection]
Komar__ has joined #ocaml
slash_ has joined #ocaml
komar_ has quit [Read error: 113 (No route to host)]
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
s4tan has quit []
Komar__ is now known as komar_
_zack has quit ["Leaving."]
ttamttam has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
ttamttam has left #ocaml []
barismetin has quit [Remote closed the connection]
th5 has quit []
komar_ has quit [Read error: 113 (No route to host)]
Alpounet has joined #ocaml
Camarade_Tux_ has quit [Read error: 110 (Connection timed out)]
<Alpounet> hi
Camarade_Tux_ has joined #ocaml
Komar_ has joined #ocaml
pierre_m has left #ocaml []
ygrek has joined #ocaml
robocop has joined #ocaml
<flux> alpounet, hi. I usually special case those. but I _think_ it should show it also if you run it from the toplevel and have the releavant .cmi-files in your search path
<robocop> haha : let rec x = true::x;;
<robocop> it's cute.
<Alpounet> flux, about what ?
Komar_ has quit [Remote closed the connection]
Komar_ has joined #ocaml
<flux> alpounet, Fri135803 < Alpounet> Any way of getting more details, unlike : Parse error: Loc.Exc_located(_, _)
<Alpounet> oh
<Alpounet> ok
<Alpounet> thanks !
kmkaplan has quit [Read error: 113 (No route to host)]
Camarade_Tux_ has quit [Read error: 104 (Connection reset by peer)]
Camarade_Tux has joined #ocaml
_zack has joined #ocaml
<mrvn> class foo = object (self) val x = 0
<mrvn> method double_incr = self <- {< x=x+1 >}; {< x=x+1 >} end;;
<mrvn> Can I somehow write that so it compiles?
<mrvn> Something other than: class foo = object (self) val x = 0 method double_incr = {< x=x+1 >}#incr_more method incr_more = {< x=x+1 >} end;;
<mfp> are you looking for val mutable?
<mfp> class foo = object val mutable x = 0 method incr = x <- x + 1; {< x = x + 1 >} end ?
<mrvn> no, it is ment to be a functional class.
<flux> mrvn, so what does the assignment in your example mean?
<mrvn> I want to replace self for the rest of the method with the new object.
<mfp> what's the problem with method double_incr = self#incr_more#incr_more ?
<flux> hmm..
<mrvn> mfp: that you need to split the method into the first part and second part.
<mfp> hmm if it's functional, there's no reason you cannot create the object at the very end
<mfp> what's the point of replacing self then? you can use an explicit receiver for methods, and the copy w/ the new fields comes as the last expr
<mrvn> class num = object val x = 0 method incr = {< x = x+1 >} end
<mrvn> class even = object inherit num as super method incr = super#incr#incr_more method incr_more = {< x = x+1 >} end
<mrvn> mfp: how would you create the object at the end if you don't know what the num class will internally do?
<mfp> ic
<mfp> is method private_incr_more that problematic? (I suppose in practice the situation wouldn't call for self#incr#incr as happens here)
<mfp> * method private incr_more even
<mrvn> what if you call 20 other methods? foo_more1, foo_more2, foo_more3, foo_more4, ...
<mrvn> Somehow functional classes seem to become really ugly with inheritance and method calls like that.
<mfp> let's see
<mfp> either you know what foo_moreN do (because they're from the same class), and you can combine into a single {< ... >}
<mfp> or you don't, and you need to refer to them by name
<mrvn> But you can't as the class might be extended and the method overloaded.
<mfp> or you need to create combinations of them, in which case you also need them to have names
<mfp> that means that you really need self#foo_more1#foo_more2#foo_more3
<mfp> in order to allow method redef
<mrvn> yep. *shiver*
<mfp> so I don't see why you wanted to replace the implicit self used in the copy
<mfp> which is the opposite case
<mfp> where you know the instance variable manipulation that is going on
<mrvn> mfp: if one could replace the self then one wouldn't need the foo_moreX helper methods.
<mfp> you said you wanted to allow to override them
<mfp> if they're inlined in a single method, how would that happen?
<mrvn> mfp: Not the foo_moreX, the methods that foo_moreX calls.
<mfp> self <- {< x=x+1 >}; {< x=x+1 >} <- how do I replace the first x = x + 1 ?
<mfp> OK then, combine all the foo_moreN into a single expression
<mfp> ah
<mrvn> mfp: method foo = self#something#foo_more1 method foo_more1 = self#someother#foo_more2 ...
<mfp> each meth can depend on the rest of the state?
jeanb-- has joined #ocaml
robocop has left #ocaml []
<mfp> so the pb is that you'd want the OO equiv of {(bar { (foo { self with x = 1 }) with y = 2 }) with z = 3}
<mfp> where funcs are replaced by meths, and you have {< >} instead of { ... with ... }
<mfp> I don't see any way around the helper methods
<mrvn> except that with records there is no self object.
<mrvn> maybe something like this: let t = {< x=x+1 >} in t#{< x = t#x+1 >}
<mrvn> i.e clone t but with x set to t#x+1
<mrvn> The syntax would only be valid with t : #'self.
jeanbon has quit [Read error: 110 (Connection timed out)]
ched_ has quit ["Ex-Chat"]
<kaustuv> Anyone have any ideas on how to improve this: http://www.msr-inria.inria.fr/~kaustuv/misc/pa_concurry.ml ?
marmottine has joined #ocaml
jeanb-- is now known as jeanbon
Alpounet has quit ["Quitte"]
prime2 has joined #ocaml
slash_ has quit [Read error: 110 (Connection timed out)]
wsmith84 has joined #ocaml
Ched has joined #ocaml
marmottine has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
<mrvn> Is the order in which values in a class are initialized specified by ocaml?
<palomer> I'm writing a library with modules A and B. I want everything in module A to be visible in module B, but I want some of module A to be private to users of my library
<palomer> is it possible to do this?
<mrvn> include A in B?
<Camarade_Tux> mrvn, I'd rather not bet on that
<Camarade_Tux> actually in a (); b ();, b () could be ran before a ()
ttamttam has joined #ocaml
<palomer> mrvn, but that would make a really big module
ttamttam has left #ocaml []
<palomer> like, REALLY big
<mrvn> let n = ref 0
<mrvn> let next () = incr n; !n
<mrvn> class foo = object val x = next () val y = next () val z = next () method print = Printf.printf "%d %d %d\n" x y z end;;
<mrvn> Camarade_Tux: Instead of next () I parse data from a stream. And that better be in order x y z.
<mrvn> .oO( Otherwise I'm screwed )
<mrvn> back in a while
<Camarade_Tux> mrvn, I and a friend of mine have personnaly witnessed that and the solution has been to use let _ = a () in b (), nothing less, nothing more and the bugs we had were solved
<Camarade_Tux> since that I don't rely on evaluation order in ocaml when ; is involved as a separator
<mattam> There's no way to ascribe without ascribing in modules right (like the <: construct in Coq). It just checks a signature is satisfied by the module instead of sealing it.
vuln has joined #ocaml
sgnb has quit [Read error: 54 (Connection reset by peer)]
sgnb has joined #ocaml
Alpounet has joined #ocaml
marmottine has joined #ocaml
<mrvn> re
marmottine has quit [Read error: 60 (Operation timed out)]
jeddhaberstro has joined #ocaml
<mrvn> Camarade_Tux: Problem is I can't use class foo stream = let x = ... in let y = ... in object inherit super stream ... end. I need the super class to parse its stuff from the stream first.
<mrvn> Camarade_Tux: Otherwise I have to first parse the super stuff into a temp value, then parse the rest and then inherit super temp later. That becomes quite ugly.
<Camarade_Tux> mrvn, unfortunately I have very little experience with ocaml's object system
<mrvn> I is somewhat limited.
<mrvn> It
<palomer> whoa
<palomer> I forgot that you could call == on an object
<palomer> == is referential equality, right?
<mrvn> palomer: for object = and == are the same
<palomer> and = is structural
<palomer> oh, so objects don't have structural equality?
<mrvn> # class foo = object end;;
<mrvn> class foo : object end
<mrvn> # new foo = new foo;;
<mrvn> - : bool = false
<Alpounet> brb
<palomer> well...this solves many issues
<palomer> and you can put objects in a hash table, right?
<palomer> as the key
<mrvn> they are a value like any other. :)
<palomer> and it'll use == semantics, right?
<mrvn> you want this for your tree plotting thing?
<palomer> yeah
<mrvn> I don't think this will help you. you can just as well use an int as type instead of an object.
<mrvn> as key I mean
<palomer> im going to index my node objects
<palomer> how can this not help me?
<mrvn> Are they objects already?
<palomer> yeah
<palomer> im big on OO
<mrvn> then it works. I thought you wanted to create an object for every node in your tree as yougo along.
* palomer wonders if there are functionally inspired GUIs
<palomer> gui toolkits, that is
<mrvn> somehow GUIs are inherently screaming for OO and imperative.
<hcarty> There is FrGui, which (somewhat) masks the OO pieces of lablgtk
<hcarty> It is somewhat incomplete and (apparently) unmaintained though
<palomer> ok
* palomer sticks with OO
<Camarade_Tux> iirc another functional reactive gui project has been started a few months ago fwiw
<Alpounet> where ?
oof has joined #ocaml
<oof> hello
<oof> how is Random.set_state supposed to be invoked?
<oof> - : Random.State.t -> unit = <fun> right? what is Random.State.t?
* Camarade_Tux goes to bed
<hcarty> oof: Look at the Random.State docs: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Random.State.html
<hcarty> oof: It looks like you could either take snapshots of the default state using Random.get_state, or make new ones with Random.State.make or .make_self_init
<Alpounet> gn Camarade_Tux, thanks
<oof> what is int array?
<Alpounet> an array of integers ... ? :)
ygrek has quit [Remote closed the connection]
<oof> [1;2;3]?
<oof> ah nevermind, [|1;2;3|]
<Alpounet> [ (* something *) ] => list
<Alpounet> [| (* something *) |] => array
<oof> ok i see
<oof> so the int array that is used to seed the state? like how does each item contribute?
marmottine has joined #ocaml
jeanbon has quit ["J'y trouve un goût d'pomme."]
jeanbon has joined #ocaml
jamii__ has joined #ocaml
jamii_ has quit [Remote closed the connection]
Alpounet has quit ["Quitte"]
_andre has quit ["leaving"]
davidw has joined #ocaml
<mrvn> I'm trying to define a const/mutable string type. What is wrong with this? http://paste.debian.net/32340/
Alpounet has joined #ocaml
davidw has left #ocaml []
chahibi has joined #ocaml
jeanbon has quit ["J'y trouve un goût d'pomme."]
kaustuv_ has joined #ocaml
jeddhaberstro has quit []
<hcarty> mrvn: I don't think that will work without a separate signature definition
seafood has joined #ocaml
<mrvn> Yes, Putting it into a module suddenly made it fail correctly.
<hcarty> Batteries has r|w|rw strings
<mrvn> Not sure if it is the signature or that the type now is abstract.
<mrvn> write only strings? What is that good for?
<hcarty> mrvn: I don't know, but they are there :-)
<Alpounet> hmm
<Alpounet> building a string and then putting it in a file ?
<Alpounet> :-p
<hcarty> mrvn: Sorry, that's not a direct link... the module is String.Cap
davidw has joined #ocaml
prime2 has quit ["leaving"]
<Alpounet> gn all
Alpounet has quit ["Quitte"]
_zack has quit ["Leaving."]
davidw has left #ocaml []
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
slash_ has joined #ocaml
<palomer> does ocaml have any kind of second degree polymorphism?
<palomer> second order
marmottine has quit ["mv marmotine Laurie"]
<mrvn> functors?
<palomer> errr
<palomer> actually, {gah: 'a. 'a -> 'a} also works
<palomer> second order polymorphism is really cool!
seafood has quit []
jamii__ has quit [Read error: 60 (Operation timed out)]
mttobks has joined #ocaml
vuln has quit [Read error: 60 (Operation timed out)]
mttobks has quit [K-lined]
Narrenschiff has joined #ocaml
willb has quit [Read error: 110 (Connection timed out)]
hkBst has quit [Read error: 104 (Connection reset by peer)]
oriba has joined #ocaml
seafood has joined #ocaml
oriba has left #ocaml []
wsmith84 has quit [Read error: 113 (No route to host)]
seafood has quit []