flux__ changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
hikozaemon has joined #ocaml
piggybox has joined #ocaml
stockholm has quit ["Leaving"]
mikeX has quit ["zz"]
khaladan has quit [Read error: 104 (Connection reset by peer)]
gim_ has quit []
ski has joined #ocaml
piggybox has left #ocaml []
shawn has quit [Read error: 110 (Connection timed out)]
ski has quit [Read error: 110 (Connection timed out)]
ski has joined #ocaml
<metaperl_> gday ocaml
shawn has joined #ocaml
<metaperl_> for i=1 to 10 do print_int i; print_string " " done; print_newline() ;; (* why not an overloaded print function *)
dvorak_ has quit ["Reconnecting"]
dvorak has joined #ocaml
<ketty> metaperl_: it cause problems with type inference...
<metaperl_> ketty: how could it? i is obviously an integer and " " is obviously a string
<ketty> yes in this case :)
<ketty> i don't think the problems are not solvable...
<ketty> but...
<ketty> it kind of don't fit with how ML works.. or something =)
<ketty> as an example:
<ketty> SML overloads the arithmetic operators
<ketty> + - etc...
<ketty> for both ints and floats
<ketty> but if you define a function: let f a b = a + b;;
<ketty> (ocaml syntax)
<ketty> what would the type be of this function?
<ketty> SML solves it by allways assuming int when it can't know the correct type..
<ketty> so f would be: int -> int -> int
<ketty> i think gcaml does overloading in an almost pritty way.. :)
* ketty takes back almost
<ketty> it accually looked more pretty when i read it a second time :)
shawn_ has joined #ocaml
shawn has quit [Read error: 110 (Connection timed out)]
bzzbzz has quit ["Lost terminal"]
shawn_ has quit ["This computer has gone to sleep"]
love-pingoo has joined #ocaml
shawn_ has joined #ocaml
Smerdyakov has quit ["Leaving"]
<metaperl_> hmm.thanks for the feedback
ski has quit [Read error: 110 (Connection timed out)]
ski has joined #ocaml
love-pingoo has quit ["Connection reset by by pear"]
__DL__ has joined #ocaml
__DL__ has quit [Client Quit]
khaladan has joined #ocaml
CLxyz has joined #ocaml
slipstream-- has joined #ocaml
CLxyz has quit [Client Quit]
slipstream has quit [Read error: 110 (Connection timed out)]
pango is now known as pangoafk
pangoafk is now known as pango
girodt has joined #ocaml
<girodt> hi there.
<ketty> hello
<girodt> i've got questions, as usual :)
<ketty> :)
<girodt> i've got a type containing an int ref
<ketty> yes?
<girodt> i can't find the syntax to access to it : not "tom.epoch", "!tom.epoch" , "tom.(!epoch)" ...
<ketty> can you give me the type?
<girodt> ok; one moment
<ketty> it is a record?
<ketty> then it should probably be !tom.epoch
<girodt> by the way, i'm not sure to precisely understand the difference between mutable and ref.
<ketty> type 'a ref = { mutable content : 'a }
<girodt> ok
<ski> if you have a mutable field in a record, then you can't make a 'ref' that "point inside" this record
<ski> so, if you have a record with two mutable fields, then those belong to that record
<girodt> ...
<girodt> i'm not sure to understand ...
<girodt> when i do !tom.epoch, it says : This expression has type tom but is here used with type 'a ref
<ketty> !(tom.epoch)
<ketty> ?
<girodt> damnit ! you won again !
<girodt> congratulations :)
revision17_ has joined #ocaml
<ketty> hehe :)
<ski> # type foo = { mutable a : int ; mutable b : int };;
<ski> type foo = { mutable a : int; mutable b : int; }
<ski> a record of type 'foo' contains two mutable fields
<ski> # type bar = { a : int ref ; b : int ref };;
<ski> type bar = { a : int ref; b : int ref; }
<ski> this instead contains references to two mutable cells
<girodt> hmmm ...
<ski> you can have two records of type 'bar' that share one (or both) of the references to the mutable cells
<ski> you can't do this with records of the type 'foo'
<girodt> so, as in my case "epoch" is a counter, i should rather use "mutable epoch : int" right ?
<ski> the mutable parts of a 'foo' records lies directly inside that record, and can't be referenced from outside
<girodt> oh okay !
<ketty> but really, you should neither use mutable nor ref :)
<ski> depends on what you want ?
<ski> s/ ?/
<girodt> i see now. so if i have two or more "instances" of foo, changing a in one will change the value in the second ...
<girodt> which is not what i want.
<ketty> no, that is not the case...
<girodt> damn ... :)
<ketty> i can't really make myself say this..
<ketty> but..
<ski> if you have several 'bar's, then it can be the case that changing through some of them changes the value in some of the others
<ski> with 'foo's, this can't happen
<girodt> okay
* ketty gives up trying to say what she was intending to, it involved too many dirty imperative features..
<girodt> :)
<girodt> side effects are evil, i've heard ...
<ketty> they are..
<girodt> but i'm not good enough to program effective recursive functions - and I do need fast calculations here.
<ski> .. hm, maybe i shouldn't paste some 30 lines here in the chan ..
* ski waits for paste-service to load
Revision17 has quit [Read error: 110 (Connection timed out)]
hikozaemon has quit ["Leaving..."]
* pango suggests www.pastebin.be
* ski looks
<girodt> sorry i was away. i'm looking now
<girodt> if pastebin agree
<ski> seems slow today
<girodt> yeah.
<girodt> great example. much clearer in my mind now.
<girodt> thanks
<ski> yw
mikeX has joined #ocaml
vincenz has quit [Read error: 110 (Connection timed out)]
<metaperl_> For all the benefits of pastebin, the continued slowness has led me to drop use of it for a good while... I will miss the nice features, but for now I just paste from my own website
vincenz has joined #ocaml
pg_ has joined #ocaml
mikeX has quit [Read error: 110 (Connection timed out)]
<pg_> hello. I'm looking for help with a camlp4 issue.
<pg_> anyone could give me a hint?
<vincenz> o.O
<vincenz> I think that most people will be able to answer only when you actually pose a question
<pg_> right
<pg_> I have defined an ocaml syntax extension with camlp4.
<pg_> it works fine, but now I must be able to enclose my new syntax into quotations
<pg_> something like <:expr< NEWKEYWORD[...] >>
<pg_> I must extend the quotation expander of camlp4
<pg_> how this should be done?
Sir_Diddymus has joined #ocaml
zmdkrbou has quit [Read error: 113 (No route to host)]
<pango> yay, managed to improve my remote backup procedure, so that dm crypt device is mounted just during backup... I wrote the small mount daemon and its chrooted connector program in ocaml of course ;)
finelemon has joined #ocaml
finelemo2 has joined #ocaml
Schmurtz has quit [Read error: 113 (No route to host)]
finelemo1 has quit [Read error: 110 (Connection timed out)]
finelemon has quit [Read error: 110 (Connection timed out)]
zmdkrbou has joined #ocaml
khaladan has quit [Read error: 104 (Connection reset by peer)]
mikeX has joined #ocaml
<girodt> bye everyone
girodt has quit ["leaving"]
vincenz has quit ["leaving"]
vincenz has joined #ocaml
Smerdyakov has joined #ocaml
Snark has joined #ocaml
Sir_Diddymus has quit [Read error: 110 (Connection timed out)]
chessguy2 has joined #ocaml
chessguy2 has quit [Client Quit]
smimou has joined #ocaml
chessguy has quit [Connection timed out]
pg_ has quit ["Leaving"]
pango is now known as pangoafk
pangoafk is now known as pango
shawn has joined #ocaml
shawn_ has quit [Connection reset by peer]
mikeX has quit ["leaving"]
cmeme has quit [Remote closed the connection]
tux4114 has joined #ocaml
dvorak has left #ocaml []
cmeme has joined #ocaml
chessguy has joined #ocaml
<dylan> Observations of a 3 year old upon seeing my text editor (which he associates with "programming") loaded with ocaml source:
<dylan> "Is that a fun program?"
khaladan has joined #ocaml
Schmurtz has joined #ocaml
tux4114 has quit ["leaving"]
Schmurtz has quit [Read error: 113 (No route to host)]
jcreigh has joined #ocaml
Schmurtz has joined #ocaml
cyyoung has joined #ocaml
jcreigh has quit ["Do androids dream of electric sheep?"]
Snark has quit ["Leaving"]
pingui has joined #ocaml
pingui has left #ocaml []
julbouln has quit [Remote closed the connection]
pango is now known as pangobath
pangobath is now known as pango
chessguy2 has joined #ocaml
julbouln has joined #ocaml
chessguy2 has quit [Client Quit]
chessguy has quit [Connection timed out]
WhatTheDeuce has joined #ocaml
dark_light has joined #ocaml
shawn has quit [Connection timed out]
shawn has joined #ocaml