mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
CosmicRay_ has joined #ocaml
CosmicRay has quit [Read error: 104 (Connection reset by peer)]
esdee has quit ["Leaving"]
Mr_Awesome has joined #ocaml
david_koontz has quit ["This computer has gone to sleep"]
slipstream-- has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
love-pingoo has quit ["Connection reset by pear"]
zarvok has quit ["BitchX-1.1-final -- just do it."]
yminsky has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
seafoodX has joined #ocaml
CosmicRay_ has quit ["Client exiting"]
seafoodX has quit []
seafoodX has joined #ocaml
slipstream-- has quit [Read error: 110 (Connection timed out)]
slipstream has joined #ocaml
Smerdyakov has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
david_koontz has joined #ocaml
Smerdyakov has quit [Remote closed the connection]
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
cmeme has quit []
cmeme has joined #ocaml
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
qwwqe has joined #ocaml
yminsky_ has joined #ocaml
yminsky has quit [Read error: 104 (Connection reset by peer)]
qwwqe has quit [Read error: 110 (Connection timed out)]
ramkrsna_ is now known as ramkrsna
shawn has joined #ocaml
<gaja> Is there any reason why the line "let x = 1 in x + 2" should work in the interpreter but not when compiling? http://ocaml.pastebin.com/m2bb45392 I get a syntax error on line 13 here. (Yes I am just playing around)
seafoodX has quit []
Mr_Awesome has quit ["time to impregnate a moth"]
kelaouchi has quit [Read error: 110 (Connection timed out)]
seafoodX has joined #ocaml
beterraba has quit ["Saindo"]
seafoodX has quit [Remote closed the connection]
seafoodX has joined #ocaml
<flux> infact, I don't think it works even in the interpreter - if you omit the ;;'s (except the last one)
<gaja> flux: Let me try it again.
<flux> I think it goes like this (but I haven't been able to confirm this idea by reading the documentation -pointers apprecited!) - each translation unit consists of either an expression or a list of top-level-statements
<flux> translation units (maybe quite a bad term) must be separated with ;;
<flux> so the three first things in your code are top-level-statements
<flux> and then follows an expression, which is a no-no
<flux> you can replace it with: let _ = let x = ...
<flux> and the last line of code won't work
<flux> you probably want to say: let _ = let fivers = .. in List.map ..(or List.iter, rather)
<flux> or you can replace the ; with a ;;
<flux> I personally prefer to write my programs without such tokens, as a list of top-level statements
<gaja> Hmm.. Yeah you were right, syntax error.
<gaja> The _ thing worked as expected. And ahh List.iter it is.
<gaja> Thanks for the help flux.
screwt8 has quit [Read error: 104 (Connection reset by peer)]
thesoko has quit [Remote closed the connection]
ygrek has joined #ocaml
thesoko has joined #ocaml
xavierbot has joined #ocaml
love-pingoo has joined #ocaml
kelaouchi has joined #ocaml
ygrek has quit [Remote closed the connection]
seafoodX has quit []
ygrek has joined #ocaml
USACE1 has joined #ocaml
USACE has quit [Read error: 110 (Connection timed out)]
seafoodX has joined #ocaml
shawn has quit [Remote closed the connection]
mellum has joined #ocaml
<mellum> Hi. Is there a way to get a time stamp without using Unix.*?
<rwmjones> mellum, what's wrong with using Unix?
lde has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
pango has joined #ocaml
USACE1 has quit [Read error: 104 (Connection reset by peer)]
USACE has joined #ocaml
<mellum> rwmjones: It's not available on non-Unix
<mellum> or is it?
<rwmjones> mellum, on windows parts of the Unix module are emulated
<mellum> Oh. Well, then I guess I could just use it...
<mellum> Hmm, except that Unix.times is not implemented... sigh.
bluestorm has joined #ocaml
love-pingoo has quit [Read error: 113 (No route to host)]
yminsky has joined #ocaml
yminsky_ has quit [Read error: 104 (Connection reset by peer)]
bluestorm has quit ["Konversation terminated!"]
piggybox has quit [Read error: 110 (Connection timed out)]
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
love-pingoo has joined #ocaml
USACE has quit [Read error: 104 (Connection reset by peer)]
USACE has joined #ocaml
slipstream has joined #ocaml
seafoodX has quit []
USACE1 has joined #ocaml
seafoodX has joined #ocaml
piggybox has joined #ocaml
Smerdyakov has joined #ocaml
USACE_ has joined #ocaml
USACE has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
pango has joined #ocaml
seafoodX has quit []
USACE1 has quit [Success]
pantsd has quit ["Leaving."]
yminsky has quit [Read error: 110 (Connection timed out)]
robyonrails has joined #ocaml
dash has left #ocaml []
pango has quit [Remote closed the connection]
pango has joined #ocaml
asmanur has joined #ocaml
<asmanur> Hi
<asmanur> I have a little problem :s
<asmanur> I have two modules : X and Y, X uses functions from Y, and Y uses functions from X.
<asmanur> How can I link these modules ? :(
<rwmjones> asmanur, you can't ... so
<rwmjones> put all the shared symbols into a module (eg. Z) and link X -> Z and Y -> Z
<asmanur> hum
<rwmjones> well, another way is to use recursive modules, but they are marked as an experimental compiler feature
<asmanur> okay i'll try this way
<rwmjones> & in any case you can't split recursive modules across files
<asmanur> what do you mean by recursive modules ?
CosmicRay has joined #ocaml
<rwmjones> xavierbot, hello
<rwmjones> xavierbot, help
<xavierbot> hello rwmjones, I am xavierbot 0.7, an OCaml toplevel
<xavierbot> expr ;; evaluate expr in toplevel and print result
<xavierbot> help help message
<xavierbot> restart restart the toplevel
<xavierbot> sleep go to sleep
<xavierbot> wake wake me up from sleep
<rwmjones> module type ASig = sig type a val a:a val print:a -> unit end;;
<xavierbot> module type ASig = sig type a val a : a val print : a -> unit end
<rwmjones> module type BSig = sig type b val b:b val print:b -> unit end;;
<xavierbot> module type BSig = sig type b val b : b val print : b -> unit end
<rwmjones> module A = struct type a = int let a = 0 let print = print_int end;;
<xavierbot> module A : sig type a = int val a : int val print : int -> unit end
<rwmjones> module B = struct type b = float let b = 0.0 let print = print_float end;;
<xavierbot> module B : sig type b = float val b : float val print : float -> unit end
<rwmjones> module MakeA (Empty:sig end) : ASig = A;;
<xavierbot> module MakeA : functor (Empty : sig end) -> ASig
<rwmjones> module MakeB (Empty:sig end) : BSig = B;;
<xavierbot> module MakeB : functor (Empty : sig end) -> BSig
<rwmjones> module rec NewA : ASig = MakeA (struct end) and NewB : BSig with type b = NewA.a = MakeB (struct end) ;;
<xavierbot> module rec NewA : ASig
<xavierbot> and NewB : sig type b = NewA.a val b : b val print : b -> unit end
<rwmjones> let _ = NewA.print NewB.b; NewB.print NewA.a ;;
<xavierbot> Objective Caml version 3.10.0
<xavierbot> Camlp4 Parsing version 3.10.0
<rwmjones> ouch
<asmanur> hum
<asmanur> making a Z module works fine, thanks :)
<mellum> does the bot eval evetyhing somebody says that ends with ;;
<xavierbot> Characters 0-4:
<xavierbot> does the bot eval evetyhing somebody says that ends with ;;
<xavierbot> ^^^^
<xavierbot> Unbound value does
<xavierbot> Characters 52-56:
<xavierbot> Parse error: illegal begin of top_phrase
<rwmjones> xavierbot, help mellum
<xavierbot> hello rwmjones, I am xavierbot 0.7, an OCaml toplevel
<xavierbot> expr ;; evaluate expr in toplevel and print result
<xavierbot> help help message
<xavierbot> restart restart the toplevel
<xavierbot> sleep go to sleep
<xavierbot> wake wake me up from sleep
<rwmjones> asmanur, the reason for the restriction on recursive modules is to do with the way ocaml initialises data
<asmanur> that is ?
<rwmjones> asmanur, there was a posting about this on caml-list, but I can't find it right now .....
slipstream has quit [Remote closed the connection]
<rwmjones> basically let's say you have X depending on Z
<rwmjones> Z contains some values which need to be initialised, and X also has some values which depend on the initial values of Z
<rwmjones> so Z has to be initialised first
<rwmjones> suppose that X & Z were mutually recursive however
<rwmjones> if you initialise (say) Z first, then Z looks at X for some values but would find uninitialised data
<rwmjones> (and vice versa)
<asmanur> yes I see
<asmanur> hum but it's restrictive isn't it ? I mean, I often use this kind of modules :p
<asmanur> however, maybe my design sucks
<rwmjones> TBH it's not a problem I have very much, but maybe I'm defensively coding to avoid this?
<asmanur> :p
<rwmjones> anyway, you can't get rid of the restriction without changing how initialisation works, and risking some sort of runtime error
<rwmjones> which defeats the point of the safety of ocaml / static languages
<asmanur> but if X and Y doesn't have data that depends on each other ?
slipstream has joined #ocaml
<rwmjones> well I guess so, _if_ you could determine that
<rwmjones> property
<asmanur> yes but, we could inform the compiler that X doesn't depend on Y for initialization :p
love-pingoo has quit ["Connection reset by pear"]
<rwmjones> asmanur, ocaml devs would prefer not to add ways to weaken safety like that, so it would have to be enforcible somehow
<rwmjones> yay my Fedora ocaml packages have been created /me off to do some work
<asmanur> :p
shawn has joined #ocaml
<rwmjones> damn, ACLs not updated so I can't import them yet
shawn has quit ["Leaving"]
qwwqe has joined #ocaml
shawn has joined #ocaml
hcarty has joined #ocaml
Submarine has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
david_koontz has quit ["This computer has gone to sleep"]
qwwqe has quit [Read error: 110 (Connection timed out)]
hcarty has quit [Read error: 110 (Connection timed out)]
hcarty has joined #ocaml
hcarty has quit ["leaving"]
david_koontz has joined #ocaml
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
smimou has quit ["bli"]
slipstream has joined #ocaml
CosmicRay has quit [Read error: 110 (Connection timed out)]
ulfdoz has joined #ocaml
psnively has joined #ocaml
_JusSx_ has joined #ocaml
david_koontz has quit ["Leaving"]
<ulfdoz> Scheinbar, hinterher ist eh wieder Rohrbruch.
<ulfdoz> ECHAN, sorry
pantsd has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
psnively has quit []
pantsd has quit [Read error: 110 (Connection timed out)]
authentic has quit [Read error: 113 (No route to host)]
robyonrails has quit ["me ne vo'"]
gl has joined #ocaml
<gl> party time
<gl> grmbl
<gl> looks like nickserv is against communism
gl has left #ocaml []
<mbishop> What the hell was that
ygrek has quit ["Leaving"]
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
asmanur has quit [Remote closed the connection]
_JusSx_ has quit ["leaving"]
shawn has quit ["This computer has gone to sleep"]
pion has joined #ocaml
Mr_Awesome has joined #ocaml
psnively has joined #ocaml
psnively_ has joined #ocaml
<ulfdoz> Someone should change the chanserv passphrase I think.
CosmicRay has joined #ocaml
psnively has quit [Read error: 110 (Connection timed out)]
slipstream-- is now known as slipstream
piggybox has quit [Read error: 110 (Connection timed out)]
xavierbot has quit [Remote closed the connection]
xavierbot has joined #ocaml
msandin has joined #ocaml
pantsd has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
CosmicRay has quit [Connection timed out]
msandin has quit ["so if I quit and nobody is around to see the message, am I still online?"]
Hadaka has quit [anthony.freenode.net irc.freenode.net]
Hadaka has joined #ocaml
Hadaka has quit [anthony.freenode.net irc.freenode.net]
Hadaka has joined #ocaml
Hadaka has quit [anthony.freenode.net irc.freenode.net]
flux has quit [anthony.freenode.net irc.freenode.net]
slipstream has quit [anthony.freenode.net irc.freenode.net]
G has quit [anthony.freenode.net irc.freenode.net]
scode has quit [anthony.freenode.net irc.freenode.net]
scode has joined #ocaml
G has joined #ocaml
flux has joined #ocaml
slipstream has joined #ocaml
Hadaka has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
kelaouchi has quit [Client Quit]
psnively_ has quit []
Smerdyakov has quit ["BRB"]
Smerdyakov has joined #ocaml
seafoodX has joined #ocaml
Smerdyakov has quit ["Leaving"]
seafoodX has quit []
_blackdog has joined #ocaml
_blackdog has left #ocaml []
psnively has joined #ocaml
psnively_ has joined #ocaml
thesoko has quit [Remote closed the connection]
thesoko has joined #ocaml
CosmicRay has joined #ocaml
Smerdyakov has joined #ocaml