Banana changed the topic of #ocaml to: OCaml 3.08.1 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | 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/
m3ga has joined #ocaml
smimou has quit ["?"]
m3ga has left #ocaml []
Smerdyakov has quit ["Client exiting"]
kinners has joined #ocaml
blugleblogle has quit ["surchauffe cérébral ... surchauffe cérébral... interruption connection: homme-machine"]
dxlvi is now known as q
q is now known as `\
`\ is now known as dxlvi
mrvn_ is now known as mrv
mrv is now known as mrvn
gim_ has quit [Remote closed the connection]
GreyLensman has quit ["smlers rank higher"]
srv has quit [Remote closed the connection]
srv has joined #ocaml
mayhem has joined #ocaml
<mayhem> hi people
<mayhem> can someone explain me in short and precise terms what is a linear continuation ?
<mayhem> i grabbed some papers about it but all fails to explain it in 1 sentance
<mrvn> Whats unclear? linear or continuation?
<mayhem> linear
<mayhem> I dont understand how to transform conditional calls in linear continuations, and thats what I need to do
<mayhem> ;)
<mrvn> I think that means that you end up with a linear progression of continuations and never return from a function.
<mayhem> sure, but the formal semantic of it is non obvious to me, particulary that --o operator that I dont understand
<mrvn> beats me.
<mayhem> I'm off for now, if anyone can give a hint .. :) msg me because I wont be able to see the answer in the logfile after a seven hour break. :)
<mayhem> ltr
mlh has joined #ocaml
kinners has quit ["leaving"]
ne1 has quit [Read error: 110 (Connection timed out)]
budjet has joined #ocaml
budjet has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
dxlvi has quit ["O:*:securepa55w0rd:dxlvi:p:n:p"]
TheDracle has quit [Read error: 104 (Connection reset by peer)]
Submarine has joined #ocaml
mlh has quit [Client Quit]
vezenchio has joined #ocaml
budjet has joined #ocaml
mlh has joined #ocaml
budjet has quit [Remote closed the connection]
srv_ has joined #ocaml
srv has quit [Read error: 104 (Connection reset by peer)]
blugleblogle has joined #ocaml
blugleblogle has quit [Remote closed the connection]
smimou has joined #ocaml
blugleblogle has joined #ocaml
gim has joined #ocaml
gim_ has joined #ocaml
gim_ has quit [Read error: 104 (Connection reset by peer)]
mrsolo has quit [Read error: 113 (No route to host)]
mlh has quit [Client Quit]
_fab has joined #ocaml
mrvn_ has joined #ocaml
mrvn has quit [Read error: 60 (Operation timed out)]
senko_ has joined #ocaml
senko_ has quit [Client Quit]
mayhem has left #ocaml []
_fab has quit []
_fab has joined #ocaml
blugleblogle has quit [Read error: 54 (Connection reset by peer)]
_fab has quit [Remote closed the connection]
_fab has joined #ocaml
blugleblogle has joined #ocaml
ne1 has joined #ocaml
solarwin1 has joined #ocaml
solarwind has quit [Remote closed the connection]
lus|wazz has joined #ocaml
wreel has joined #ocaml
blugleblogle has quit ["surchauffe cérébral ... surchauffe cérébral... interruption connection: homme-machine"]
vezenchio has quit [Read error: 110 (Connection timed out)]
pango has quit [Nick collision from services.]
pango_ has joined #ocaml
Riastradh has joined #ocaml
clog has joined #ocaml
patatof has joined #ocaml
<patatof> hi
<patatof> can anybody tell me how good is Ocaml RTTI versus CPP RTTI? And something about type inference?
salo has joined #ocaml
<mellum> patatof: what is CPP?
<Submarine> there's little RTTI in Ocaml
<patatof> C++
<Submarine> there's only enough to run the GC and serialization
<mellum> I don't see any need for more, though.
<salo> is it possible to define a type with restricted range of values, such as the natural numbers?
<mellum> salo: you mean a restricted range *of* the natural numbers?
<salo> i mean to define the naturals as a restriction of the integers, for example
<mellum> No, it's not.
<mellum> Why would that be useful anyway_
<salo> well, if my variable is intended to be a natural number ...
<Submarine> there are indeed no subrange types
<Submarine> mellum, one could possibly desire types obtained by filtering a type by a decidable predicate
<mellum> And what should happen if you write a-b? The ressult would be a different type? Or would you get an exception at run time? Both suck.
<Submarine> with a runtime exception with bad assignments
<Submarine> salo, you use assertions for that kind of stuff
<salo> a-b<0 might yield NaN, perhaps.
<mellum> salo: that would induce a large overhead, which is opposed to the goals of Ocaml
<salo> fair enough.
<vincenz> I think if ocaml had typeclasses like haskell it would be possible
<Submarine> mellum, it incurs a large overhead unless you do static analysis to make it go away
<Submarine> but interprocedural static analysis in a functional language...
<Submarine> sounds hot stuff
<mellum> Submarine: I don't think analysis would help a lot there. Eventually, there are variables that come from the environment and about which you know nothing
<Smerdyakov> MLton does major interprocedural static analysis.
<Submarine> mellum, you can usually draw significant information to eliminate such runtime checks
<Submarine> for instance, if you have a variable that you specify in [0,n-1]
<Submarine> and all assignments clearly verify this invariant
<Submarine> then you can remove those runtime checks
<Submarine> remember that this is *not* verification, you can still leave 15% of the checks and be considered "good"
xerox has joined #ocaml
<Nutssh> Hi Submarine... I've been trying to catch you.
<Smerdyakov> Try peanut butter under a cardboard box, with a stick set up to bring the box down over him when he reaches for the peanut butter.
<Submarine> ?
budjet has joined #ocaml
CosmicRay has joined #ocaml
patatof has quit []
budjet has quit [Remote closed the connection]
smimou has quit ["?"]
lodewijk has joined #ocaml
taras has joined #ocaml
<taras> hi, i'm having some issues with ocaml multidimensional arrays
<taras> and using references for indexes
<vincenz> that's great, it'd be even greater if you mentioned what issuses
<taras> hmm, gimme a second
<taras> sorry
<vincenz> ?
<taras> ok
<taras> # let maxits=10;;
<taras> val maxits : int = 10
<taras> # let r = Array.create maxits (Array.create maxits (0.));;
<taras> this seems to be a bad way to create a multidimensional array
<taras> isn't it?
<Smerdyakov> Do you understand what it does?
<taras> it creates an array where all elements point to the same array :(
<Smerdyakov> Yup. That's bad if it's not what you want.
<vincenz> taras: basically you're creating an array with 10 entries that all point to the same row(column, depending on how you look at it)
<taras> what's the proper way to do this?
<Smerdyakov> taras, have you looked at the documentation on Array?
<taras> i should..i looked at the tutorial
<taras> thanks
<taras> i see, so i should use array.init
<taras> cool
<taras> or make matrix
<Smerdyakov> That would work, but I suggest reading further for a quicker way.
* vincenz thinks that make_matrix is very limited
<Smerdyakov> Right.
<vincenz> it assumes that people only have 2-D matrices and not higher-dimensional ones
<taras> yeah, i dislike these things that deal with sideeffects
<Smerdyakov> vincenz, no. It quite clearly only deals with 2D matrices.
<taras> they feel so odd after dealing with lists
<vincenz> Smerdyakov: I know
<Smerdyakov> vincenz, so it's not a problem for it to assume that!
<vincenz> Smerdyakov: It assumes that people only want to create 2D matrices, not other dimensions, they could've made it more general by allowing teh user to pass a list of dimenstiions
<vincenz> aka, the library is shortsighed
<Smerdyakov> No, it _doesn't_ assume that.
<Smerdyakov> It is only a function to be used in particular cases. It does not restrict what you can do with other methods.
<vincenz> I know
<vincenz> but why create something specific for2D instead of making a more general function for any d
<Smerdyakov> And try thinking about your last suggestion.
<Smerdyakov> What type would you give to such a function?
<vincenz> hmm
<vincenz> touche
<taras> doesnt Array.init do the general thing anyway?
<Smerdyakov> taras, it doesn't do "the general thing" of making multi-dimensional matrices with constant-sized code.
<taras> ah
<taras> btw, i keep running into the same take
<taras> task
<taras> what's the proper way of generating arbitrary sequences?
<taras> say sometimes i need 1,2,3,4
<taras> other times i need 1,3,5
<Smerdyakov> How can there be a general way of generating "arbitrary" sequences?
<taras> is there some sort of a higher order routine that should be used?
<vincenz> depends on the complexity of the sequence
<taras> simple ones
<Nutssh> Submarine, I found that changing the heap grow increment from 28kb to 512kb was worth ~15%.
<vincenz> if the sequence is linear a simple function of int->int will do
<taras> hmm?
<taras> maybe i wasn't clear enough...i noticed that i often need to create simple finite sequences, for example [1;1;1;1] or [1;2;3], etc
<taras> how would an int->int help here?
<Smerdyakov> See the List.tabulate function of the SML Basis.
<Nutssh> What do you mean 'create'?
<taras> man
<taras> i missed the tabulate function
<taras> i looked for it 3 or 4 different times in the list module
<taras> i'm blind
<taras> err
<Smerdyakov> taras, it's in SML, not OCaml.
<taras> sml basis
<taras> yeah i used that in sml
<Smerdyakov> taras, it should be easy for you to write your own version.
<taras> i do write my own version
<vincenz> well then generalize it
<Smerdyakov> taras, what has motivated your choice of OCaml over SML?
<vincenz> pass it a closure that keeps state
<taras> Smerdyakov: it's a bit more liberal
<taras> it provides more imperative stuff
<taras> which is good when i cut &paste pseudocode
<Smerdyakov> taras, not much more....
<taras> Smerdyakov: hmm?
<Smerdyakov> taras, OCaml does not provide much more "imperative stuff" than SML does.