flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.01.0 http://bit.ly/1851A3R | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
tobiasBora has quit [Quit: Konversation terminated!]
mhi^ has quit [Quit: Lost terminal]
watermind has quit [Quit: Konversation terminated!]
watermind has joined #ocaml
watermind has quit [Remote host closed the connection]
boogie has quit [Remote host closed the connection]
nikki93 has joined #ocaml
kyrylo has joined #ocaml
dant3 has joined #ocaml
pango has quit [Quit: Client exiting]
dant3 has quit [Ping timeout: 246 seconds]
pango has joined #ocaml
istima has quit [Ping timeout: 272 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
csakatoku has joined #ocaml
dant3 has joined #ocaml
dant3 has quit [Ping timeout: 260 seconds]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
sgt_baker has joined #ocaml
cesar_ has joined #ocaml
boogie has joined #ocaml
cesar_ is now known as Guest72654
lostcuaz has quit [Quit: Textual IRC Client: www.textualapp.com]
dant3 has joined #ocaml
csakatoku has quit [Ping timeout: 272 seconds]
dant3 has quit [Ping timeout: 260 seconds]
lostcuaz has joined #ocaml
zxqdms has quit [Quit: leaving]
Guest72654 has quit [Remote host closed the connection]
ollehar1 has joined #ocaml
kyrylo has quit [Ping timeout: 272 seconds]
yacks has joined #ocaml
sgt_baker has quit [Read error: Operation timed out]
dant3 has joined #ocaml
csakatoku has joined #ocaml
milosn has quit [Read error: No route to host]
milosn_ has joined #ocaml
dant3 has quit [Ping timeout: 252 seconds]
divyansr has joined #ocaml
jao has quit [Ping timeout: 272 seconds]
divyansr has quit [Remote host closed the connection]
sgt_baker has joined #ocaml
thomasga has joined #ocaml
divyansr has joined #ocaml
thomasga has quit [Quit: Leaving.]
ollehar1 has quit [Ping timeout: 272 seconds]
csakatoku has quit [Remote host closed the connection]
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
f[x] has joined #ocaml
dant3 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
dant3 has quit [Read error: Operation timed out]
sgt_baker has quit [Quit: Leaving]
csakatoku has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
_5kg has quit [Ping timeout: 272 seconds]
axiles has joined #ocaml
Kakadu has joined #ocaml
csakatoku has quit [Remote host closed the connection]
dant3 has joined #ocaml
csakatoku has joined #ocaml
csakatoku has quit [Remote host closed the connection]
dant3 has quit [Ping timeout: 246 seconds]
rwmjones has quit [Ping timeout: 252 seconds]
rwmjones has joined #ocaml
zRecursive has joined #ocaml
nikki93 has quit []
robink has quit [Quit: No Ping reply in 180 seconds.]
WraithM has joined #ocaml
boogie has quit [Remote host closed the connection]
dant3 has joined #ocaml
dant3 has quit [Ping timeout: 248 seconds]
divyansr has quit [Read error: Connection reset by peer]
divyansr has joined #ocaml
rwmjones has quit [Read error: Operation timed out]
_5kg has joined #ocaml
dant3 has joined #ocaml
WraithM has quit [Ping timeout: 260 seconds]
dant3 has quit [Ping timeout: 272 seconds]
Simn has joined #ocaml
dant3 has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dant3 has quit [Ping timeout: 260 seconds]
boogie has joined #ocaml
mort___ has joined #ocaml
boogie has quit [Ping timeout: 265 seconds]
Eyyub has joined #ocaml
boogie has joined #ocaml
boogie has quit [Read error: Connection reset by peer]
zRecursive has quit [Remote host closed the connection]
boogie has joined #ocaml
boogie has quit [Ping timeout: 252 seconds]
mhi^ has joined #ocaml
dant3 has joined #ocaml
rand000 has joined #ocaml
dant3 has quit [Ping timeout: 252 seconds]
pminten has joined #ocaml
sgnb has quit [Remote host closed the connection]
n0v has quit [Ping timeout: 272 seconds]
kizzx2 has quit [Read error: Connection reset by peer]
kizzx2 has joined #ocaml
kizzx2 has quit [Max SendQ exceeded]
kizzx2 has joined #ocaml
kizzx2 has quit [Max SendQ exceeded]
kizzx2 has joined #ocaml
kizzx2 has quit [Max SendQ exceeded]
NaCl has quit [Ping timeout: 272 seconds]
kizzx2 has joined #ocaml
kizzx2 has quit [Max SendQ exceeded]
hnrgrgr has quit [Remote host closed the connection]
kizzx2 has joined #ocaml
NaCl has joined #ocaml
tristan_1 has quit [Remote host closed the connection]
kizzx2 has quit [Max SendQ exceeded]
hnrgrgr has joined #ocaml
tristan__ has joined #ocaml
kizzx2 has joined #ocaml
tianon has quit [Remote host closed the connection]
hyperboreean has quit [Remote host closed the connection]
tianon has joined #ocaml
hyperboreean has joined #ocaml
tianon has quit [Changing host]
tianon has joined #ocaml
hyperboreean has quit [Changing host]
hyperboreean has joined #ocaml
n0v has joined #ocaml
Anarchos has joined #ocaml
mort___ has quit [Quit: Leaving.]
sgnb has joined #ocaml
rand000 has quit [Ping timeout: 272 seconds]
ulfdoz has joined #ocaml
boogie has joined #ocaml
olliefr has joined #ocaml
FreeArtMan has joined #ocaml
boogie has quit [Ping timeout: 264 seconds]
FreeArtMon has joined #ocaml
FreeArtMan has quit [Ping timeout: 272 seconds]
dant3 has joined #ocaml
csakatoku has joined #ocaml
FreeArtMan has joined #ocaml
dant3 has quit [Read error: Operation timed out]
FreeArtMon has quit [Ping timeout: 252 seconds]
olliefr has quit [Read error: Connection reset by peer]
Kakadu has quit []
Kakadu has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
divyansr has quit [Remote host closed the connection]
olliefr has joined #ocaml
FreeArtMan has quit [Read error: Operation timed out]
dant3 has joined #ocaml
csakatoku has quit [Remote host closed the connection]
FreeArtMan has joined #ocaml
Kakadu has quit [Read error: No route to host]
Kakadu has joined #ocaml
divyansr has joined #ocaml
boogie has joined #ocaml
boogie has quit [Read error: Connection reset by peer]
Kakadu has quit [Client Quit]
boogie has joined #ocaml
f[x] has quit [Ping timeout: 252 seconds]
Kakadu has joined #ocaml
divyansr has quit [Remote host closed the connection]
boogie has quit [Ping timeout: 260 seconds]
divyansr has joined #ocaml
mort___ has joined #ocaml
Simn is now known as Simn|gone
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
Kakadu has quit [Read error: No route to host]
Kakadu_ has joined #ocaml
FreeArtMon has joined #ocaml
oriba has joined #ocaml
FreeArtMan has quit [Ping timeout: 272 seconds]
Eyyub has quit [Ping timeout: 252 seconds]
olliefr has quit [Read error: Connection reset by peer]
olliefr has joined #ocaml
kyrylo has joined #ocaml
Eyyub has joined #ocaml
FreeArtMon has quit [Ping timeout: 260 seconds]
boogie has joined #ocaml
rwmjones has joined #ocaml
thomasga has joined #ocaml
boogie has quit [Ping timeout: 260 seconds]
ocp has joined #ocaml
pminten_ has joined #ocaml
pminten has quit [Ping timeout: 272 seconds]
pminten_ is now known as pminten
kyrylo has quit [Quit: Hi, Rob!]
_5kg has quit [Ping timeout: 272 seconds]
oriba has quit [Remote host closed the connection]
_5kg has joined #ocaml
ocp has quit [Quit: Leaving.]
Simn|gone has quit [Ping timeout: 252 seconds]
ontologiae has joined #ocaml
Eyyub has quit [Ping timeout: 246 seconds]
olliefr has quit [Read error: Connection reset by peer]
boogie has joined #ocaml
boogie has quit [Ping timeout: 248 seconds]
avsm has joined #ocaml
pango has quit [Ping timeout: 272 seconds]
cynddl_ has joined #ocaml
darkf has quit [Quit: Leaving]
pango has joined #ocaml
cynddl_ has quit [Quit: leaving]
thizanne has joined #ocaml
zpe has joined #ocaml
thomasga has quit [Quit: Leaving.]
zpe has quit [Ping timeout: 248 seconds]
FreeArtMan has joined #ocaml
boogie has joined #ocaml
thomasga has joined #ocaml
FreeArtMon has joined #ocaml
olliefr has joined #ocaml
olliefr has quit [Read error: Connection reset by peer]
divyansr has quit [Read error: Connection reset by peer]
boogie has quit [Ping timeout: 252 seconds]
FreeArtMan has quit [Ping timeout: 252 seconds]
divyansr has joined #ocaml
FreeArtMon has quit [Client Quit]
olliefr has joined #ocaml
pminten has quit [Quit: Leaving]
<companion_cube> it's quiet here
<adrien> go outside! :P
<companion_cube> hey
<companion_cube> later :p
<companion_cube> is there a page that compares syntactic differences between ocaml and caml light?
<adrien> yup
<adrien> porting guide iirc
<adrien> which I can't find anymore \o/
<companion_cube> neither can I :/
skchrko has quit [Quit: Leaving]
<adrien> bottom
<companion_cube> Should I switch from Caml Light to Objective Caml? <-- wow :D
<companion_cube> ah, so it looks like the core language is a subset of ocaml
<companion_cube> neat
cesar_ has joined #ocaml
cesar_ is now known as Guest56390
rand000 has joined #ocaml
Guest56390 has quit [Remote host closed the connection]
<gasche> companion_cube: not so
<gasche> Caml Light has "where" and mutable sum parameters and constructors-as-functions, etc.
<gasche> also in Caml Light, "fun" may pattern-match on several function arguments at the same time, which is quite nice
<gasche> let rec nth = fun (hd::_) 0 -> hd | (_::tl) n -> nth tl (n - 1) | _ _ -> failwith "nth"
<companion_cube> oh
<companion_cube> why were those removed from ocaml ? :)
<companion_cube> gasche: it would be nice to have a deriving instance for a random generator (qtest/qcheck...)
<gasche> ///away
<companion_cube> ^^
<adrien> :D
<companion_cube> and travis permissions for some repository you know about :p
<gasche> the ball for this is in your camp
zpe has joined #ocaml
<gasche> you have the necessary rights batteries-wise, you can make all the decisions about how to enable Travis; I don't want think about this
thomasga has quit [Quit: Leaving.]
lostcuaz has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
<companion_cube> hmm :/
<jpdeplaix> :DDDD
f[x] has joined #ocaml
boogie has joined #ocaml
dant3 has quit [Remote host closed the connection]
dant3 has joined #ocaml
Thooms has joined #ocaml
orion has joined #ocaml
<orion> Hi. What's the difference between a function and an expression?
<companion_cube> orion: well, a function can be seen as an expression that depends on one or more input values
<companion_cube> let f x = x + 1
milosn_ has quit [Ping timeout: 260 seconds]
<companion_cube> here, the expression "x+1" depends on which value you give for x
<AirWolfTheme> orion, for starters, an expression is a lexical property and a function is a data value.
<AirWolfTheme> A lot of programming languages contrast expressions and statements.
<AirWolfTheme> Which are lexical part of the code, an expression has a value when executed basically, a statement doesn't.
<AirWolfTheme> I suppose a further thing can be called a 'declaration' which is "executed" at compile time and can't depend on runtime information
milosn has joined #ocaml
<orion> Ok
<orion> So, "let f x = x + 1" in its entirety is a function, but "x + 1" by itself is an expression.
<AirWolfTheme> No, let f x = x + 1 is a declaration
<AirWolfTheme> x + 1 is an expression though.
<AirWolfTheme> You're talking about lexical properties of code right now, a function is not a lexical thing, it's a value.
<orion> I come from an imperative paradigm, and I am trying to get in to functional programming.
<AirWolfTheme> Note that "let f x = x + 1" is the same as "let f = fun x -> x + 1"
<AirWolfTheme> Where "fun x -> x + 1" is lexically a function literal
<AirWolfTheme> A way to write down a function I guess.
<orion> hmm
<companion_cube> AirWolfTheme is right, I should have compared 3+1 and (fun x -> x+1)
<orion> Ok, so... "let f x = x + 1" is a declaration which declares a function "f".
<AirWolfTheme> Yeah
<AirWolfTheme> It's exactly the same as "let f = fun x -> x + 1"
<AirWolfTheme> The former is just syntactic sugar for the latter.
<AirWolfTheme> See iths in C like 'const int x = 3'
<AirWolfTheme> We can also type this if we want: "let f : int -> int = fun x -> x +1"
<AirWolfTheme> But it's not needed in OCaml.
<orion> Now, what about "let f x = x * 2 in f 2;;" -- there seems to be a declaration of 'f' here, but how does the 'in' change things?
divyansr has quit [Remote host closed the connection]
<companion_cube> it's a local declaration
<AirWolfTheme> Local scope.
<orion> ok
<AirWolfTheme> It's in C like ehh {int f(int x) { return x * 2;}; return f (2);}
<AirWolfTheme> Except C can't do that
<AirWolfTheme> Block scopes in OCaml return thier last computed expression as value.
<AirWolfTheme> And can have not only local value definitions but also local function definitions because in OCaml functions are values like any other.
ivan\_ has joined #ocaml
<AirWolfTheme> Also, I object to OCaml's syntax for lexical blocks.
<AirWolfTheme> Making it the same syntax as top level declarations makes catching errors really hard.
<orion> I object to ocaml's support for objects (pun intended).
<AirWolfTheme> No one uses it anyway.
<orion> In C/C++, {}s usually describe scope. When does a scope change happen in OCaml?
boogie has quit [Quit: Leaving...]
<companion_cube> every "let" introduces a scope
<companion_cube> well, functions create a new scope and "let...in" binds in this scope
<AirWolfTheme> companion_cube, well, yeah, obviously, it's just that this syntax makes error reporting harder.
<AirWolfTheme> The revised syntax drops it for that reason.
<AirWolfTheme> Honestly, I think block scope as in (let <id> = <exp>; <exp>) would be fine.
<AirWolfTheme> Just us ( ... ) to denote block scope and seperate definitions with semicolons just like expressions
<AirWolfTheme> orion, that's the thing.
<AirWolfTheme> Why it isn't that clear, every scope is exactly one expression
<AirWolfTheme> (a ; b ; c) is one expression
<AirWolfTheme> In fact the parethenses there are optional, the relevant part is ;
<orion> ok
<gasche> there is no notion of "block" in OCaml
<AirWolfTheme> a ; b is one expression, you can see ";" as a special operator which first evaluates a, then b, and then returns the value of b.
<gasche> only expressions
rwmjones has quit [*.net *.split]
talzeus has quit [*.net *.split]
mfp has quit [*.net *.split]
rainbyte has quit [*.net *.split]
smondet has quit [*.net *.split]
fayden has quit [*.net *.split]
noplamodo has quit [*.net *.split]
ivan\ has quit [*.net *.split]
rz has quit [*.net *.split]
<orion> AirWolfTheme: So "a ; b ; c" is really like this: "((a ; b) ; c)" ?
ivan\_ is now known as ivan\
<AirWolfTheme> orion, yeah, does the exact same thingf.
<AirWolfTheme> : is not a true operator though, it's a special operator like && and || with its own special evaluation order.
<orion> So is "a ; b ; c" one expression or two?
<AirWolfTheme> Of true operators like + and *, the evaluation order is undefined, but in practice from right to left.
<AirWolfTheme> One expression
<AirWolfTheme> It's not that much different from a && b && c
<orion> ok
<AirWolfTheme> && is also a "special operator", except you can (&&) to reify it as a function
<orion> So ';' is an operator which partially evaluates an expression?
<AirWolfTheme> You can't (;) stuff even though you probably should be able to.
<AirWolfTheme> No, entirely.
<orion> So... you're saying that ';'
<AirWolfTheme> "a ; b" just first evaluates a, then evlauates b, and returns the result of b.
rwmjones has joined #ocaml
talzeus has joined #ocaml
mfp has joined #ocaml
rainbyte has joined #ocaml
smondet has joined #ocaml
fayden has joined #ocaml
noplamodo has joined #ocaml
rz has joined #ocaml
<orion> So... you're saying that ';' entirely evaluates an expression. However, "a ; b ; c" is one expression. Does that mean it gets evaluated twice?
<AirWolfTheme> (print_endline "Hello" ; 2 + 3) * 2
rainbyte has quit [Max SendQ exceeded]
<AirWolfTheme> prints "Hello\n" and results into 10
<AirWolfTheme> An expression can be composed of multiple sub expressions
rainbyte has joined #ocaml
<orion> heh
<AirWolfTheme> 2 * 6 + 4 is one expression, but 2 * 6 is as well
<AirWolfTheme> Since expressions have values, that they are composed of multiple expressions makes them useful.
<orion> Is '2' a value or an expression?
<AirWolfTheme> both
<orion> !!!
<AirWolfTheme> 2 is an atomic expression
<AirWolfTheme> its value is simply itself.
<AirWolfTheme> Otherwise known as a data constructor.
<AirWolfTheme> Nullary data constructor that is.
<orion> ok
<gasche> there is a different between "operator" and "expression constructor"
<gasche> let .. = .. in ... construct expressions from bits (first bit is a variable, other are expressions)
<gasche> .. ; .. is also an expression constructor
<AirWolfTheme> let is fundamentally different though because it introduces scope.
rwmjones has quit [*.net *.split]
talzeus has quit [*.net *.split]
mfp has quit [*.net *.split]
smondet has quit [*.net *.split]
fayden has quit [*.net *.split]
noplamodo has quit [*.net *.split]
rz has quit [*.net *.split]
<gasche> now .. .. is an expression constructor where both holes must be expressions (function application), and .. .. .. is an expression constructor where the middle thing is an infix operator
<gasche> but .. ; .. is not a special case of the "infix operator" construction, it is a different syntactic rule (and semantics) entirely
<AirWolfTheme> It is a special one as much as && and || are.
<AirWolfTheme> They're all three operators with custom evaluation rules.
<gasche> ";" is not a syntactically valid infix operator
<gasche> "&&" and "||" are, although they're also reserved keywords so it's best not to actually use them
<AirWolfTheme> I suppose that's true, you can define let (&&) = whatever
rwmjones has joined #ocaml
talzeus has joined #ocaml
mfp has joined #ocaml
smondet has joined #ocaml
fayden has joined #ocaml
noplamodo has joined #ocaml
rz has joined #ocaml
<gasche> a && b is ambiguous, the parser+typer sometimes recognize the expression constructor &&, and sometimes (when there is a "&&" operator in scope) uses the infix-operator construction
<gasche> those are honest hackish special cases
<AirWolfTheme> Actually, doesn't that make OCaml non context free
<AirWolfTheme> now to think of it.
<gasche> the parser does not see the different
<gasche> *difference
<gasche> so there is no *syntactic* ambiguity, only a semantic one
<AirWolfTheme> Yeah, that s true I guess.
<gasche> semantics are rarely-context free, as the meaning of "x" depends of the scoping environment
<gasche> *on
<AirWolfTheme> Well, you can say the same for the int x * y; problem with C
<AirWolfTheme> that makes it non context free supposedly.
<gasche> that said, I'm only nitpicking to vent air, your explanation to orion was clear and reasonable
<orion> What kinds of problems are OCaml particularly good for solving? What problems is it *not* good for solving?
<AirWolfTheme> I suppose you could theoretically keep the parser ignoring it.
<AirWolfTheme> orion, ehh
<AirWolfTheme> Ocaml is good for what static langauges are good at in general, bad for what dynamic languages are good at I guess
<AirWolfTheme> for some things, static typing is just a huge hastle.
<gasche> orion: functional languages of the ML tradition (SML, OCaml, Haskell, F#) are good at symbolic manipulation
<gasche> everything with rules, abstract syntax, and reasoning
<orion> If you were making a web server, would it be madness to do it in OCaml?
<gasche> compilers, proof assistants, rules matchers, prolog implementations, whatever
<gasche> orion: on par with Java I'd guess
<AirWolfTheme> gasche, I wouldn't say I agree, they can implement any application really.
<AirWolfTheme> Web server is one of those things where dynamic typing is bette rI feel.
<AirWolfTheme> Correctness isn't nearly as important as just getting stuff done quickly.
<gasche> they are *really good* at symbolic manipulation, in the sense that they're the best we have by a clear margin
<AirWolfTheme> Also, extensive string manipulation with static typing can be a hasstle.
<AirWolfTheme> True
FreeArtMan has joined #ocaml
<gasche> OCaml is reasonable for systemish programming like a web server, it's only not much better than other choices
<orion> I see.
<gasche> I'm not sure what static typing implies for string manipulations
<gasche> well it's much better than C because you don't die with security attacks over a poorly-allocated string
<gasche> but that's not the right standard to compare to anymore
<AirWolfTheme> Well yeah, there's that, C is pretty awful for string manipulation obviously.
<f[x]> statically typed language shines at string manipulation
<f[x]> precisely
<AirWolfTheme> OCaml has that format hack though
<gasche> also orion OCaml being compiled in a reasonable way is faster than dynamic languages (but sometimes slower than highly-optimized compilers on some problem domains, eg. heavy floating-point numerics in C or Fortran)
<AirWolfTheme> A lot of static languges don't have printf like functionality and at the very least not with runtime strings.
FreeArtMan has quit [Client Quit]
<AirWolfTheme> Well, here's the other point, speed does not really matter with web servers at all.
<gasche> well
<AirWolfTheme> THe bottleneck is always going to be the internet connexion, you can spam a page together quite quickly
<gasche> insist on neither speed nor correctness, recommend Ruby, and you'll have a web server framework that is indeed convenient but has to be restarted every ten minutes because of memory leaks and unknown problems
ggole has joined #ocaml
<AirWolfTheme> Ahaha
<AirWolfTheme> Is Ruby really that bad?
<orion> Consider a bit torrent client, which has a strong concept of state. Would this be next to impossible to write in a functional language?
<gasche> no, perfectly easy
<AirWolfTheme> PHP is honestly kind of good at what it does, the language itself is bloody horrible but iut does have all the libraries you will ever need for this
<AirWolfTheme> it specializes on one thing and is concordantly completely filled with stuff to make that one thing as easy on you as possible.
<gasche> AirWolfTheme: I'm frankly not so sure about the libraries point
<AirWolfTheme> Why?
<gasche> back in the days were I used PHP, I wanted something reasonably obvious
<AirWolfTheme> It gives you everything, DOM, XML treatment, RSS parsing, mysql interfacing.
<gasche> which is to show the diff of two modifications to an user of a content-production system
<orion> What aspects of functional programming make writing something stateful like a bit torrent client easy?
<gasche> functional programming encourage you to represent state explicitly
<AirWolfTheme> Why is a bit torrent client that stateful?
<AirWolfTheme> The problem is I guess that many people new to FP try to simulate state in FP while the correct approach is to minimize it unless you absolutely need it.
<gasche> besides, OCaml has mutable state if you want it, so if you really think global mutable variables are the best choice, you can go for it
<AirWolfTheme> You often see people write tail recursive loops similar to while loops while something like a fold would suffice.
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<gasche> interestingly, one of the most exciting bitorrent clients I know about has been written in CPC, which is precisely a dialect of C enriched with old ideas of functional programming
<AirWolfTheme> continuation passing C?
<AirWolfTheme> Holy wow, it actually stands for tha,t ahaha
<gasche> (back to work; have fun!)
<gasche> companion_cube: let me know when the opam PR is accepted
<def-lkb> (well, it's a seeder not a client -- there is much more concurrency in a seeder)
<gasche> yeah, sorry
<def-lkb> np
<orion> This whole concept is FP is titillating.
<AirWolfTheme> I wish I was smart enough to know that word but it looks to me like stimulating someone's nipples.
<adrien> s/nipples/brain/ and you have it
<adrien> rather than brain: curiosity
<adrien> (implied)
FreeArtMan has joined #ocaml
<orion> "adjective; arousing mild sexual excitement or interest"
<AirWolfTheme> Ahh, I was close.
<orion> I am an ENTJ, so mental stimulation feels just as good as sexual stimulation.
<AirWolfTheme> orion, anyway, I like to see FP as the next evolution like structured programming, it's a restriction more than anything you place to make code more readable and maintainable, much like not using gotos.
<adrien> well, "titiller" exists as a verb in french and it's actually "titiller $something", i.e. it can be used for anything you ant
<orion> AirWolfTheme: It certainly seems that way.
<orion> I could certainly get behind OCaml if it had a rich set of libraries.
olliefr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<AirWolfTheme> Well, you have the Core and batteries project.
<gasche> functional programming is the *natural* result of designing a language in which code needs not be duplicated, and factorization is easy
<gasche> hm
<orion> Specifically, I need AES, SHA256, DSA, ElGaml, networking, and sqlite.
<gasche> I think we've got you covered
<AirWolfTheme> gasche, stateful OO also does much of that though.
<adrien> networking is well-covered too; it's also a large field
<orion> Does OCaml have a FFI?
<gasche> orion: of course
<adrien> gasche: 10 minutes :D
mort___ has quit [Quit: Leaving.]
<gasche> re. FFI, I think ( https://github.com/ocamllabs/ocaml-ctypes ) may be the way to go now
<orion> I've already got 12,000 lines of C++ written, so I think I am going to write a C89 interface for it, compile it has a library, and then finish it off in OCaml with the FFI.
<adrien> hmmmmm
* adrien has some doubts about that approach
<gasche> Thomas Leonard (zeroinstall's author) is currently writing very interesting things about porting systemish code from Python to OCaml
<gasche> and Richard Jones at Red Hat has experience with using OCaml for some systemish tools interacting with the rest of the system (say libvirt stuff)
<gasche> (adrien is a grumpy expert on using decaying GUI frameworks from OCaml)
<orion> Is it difficult for functional languages to bind to something written in an imperative language?
<adrien> (you forgot the win32 aspect)
<adrien> gasche: actually I'm mostly using what works and has a nice ocaml API
<adrien> next stuff I do is quite likely to be done using EFLs
<f[x]> bittorrent client is a nice example
<f[x]> because there is already one in ocaml
<f[x]> and has some unmatched features
FreeArtMon has joined #ocaml
<orion> adrien: I admit that it might be stupid to write a library in C and use it in OCaml. Why could it be a bad idea though?
<adrien> the existing code hasn't been written with that in mind
<adrien> you'll have to learn the ocaml ffi probably and that means learning the ocaml internals too (well, internals of the runtime)
<adrien> and you'll be learning a new langage mid-project
<orion> Let's say that hypothetically the project -- from the very beginning -- was meant to be a library with a C89 interface.
FreeArtMan has quit [Ping timeout: 272 seconds]
<adrien> then definitely doable
<orion> interesting
<adrien> main question being whether writing bindings is more or less time than rewriting as ocaml
zarul has quit [Read error: Connection reset by peer]
<orion> 12,000 lines?
<orion> It's interesting me that you guys are so confident in what a functional language can do.
<adrien> but in one of my project I've written bindings to two functions of 200 lines of C each rather than binding the low-level blocks that would have allowed me to write the logic in ocaml
zarul has joined #ocaml
<adrien> (there was no point in doing so)
<adrien> ocaml is general purpose and everything (up to the community) is pragmatic
<AirWolfTheme> orion, well, they are turing complete.
<AirWolfTheme> Except agda.
<orion> AirWolfTheme: What strikes me is that you have an entirely different way of thinking.
<AirWolfTheme> you plural or you singular?
<AirWolfTheme> ye or thou?
<orion> hah
<orion> true
<orion> It's like visiting Manhattan for the first time and seeing cars double parked on the sidewalk.
<AirWolfTheme> orion, whatś so different?
<orion> If you live in Manhattan, it makes total sense (you'll get ticketed if you park on the street on certain days).
<orion> But if you're from the country, it's completely mind blowing.
<AirWolfTheme> orion, but what's so weird?
<orion> The way you approach problems.
<orion> As soon as someone tells me what they want to accomplish, I start thinking about classes, inheritance, and templates.
<adrien> it mostly boils down to taking more time to think about the problem
<orion> And I built a mental map.
<orion> But from what I've seen so far with functional languages, it's a completely new way of thinking about the problem.
<adrien> then device a few types and write the code that flows from the types
<AirWolfTheme> templates are a poor man's parametric type.
<def-lkb> orion: I used to think more or less that way, I discovered FP ~4 years ago and got really hooked; I'll never come back to OOP ;)
<orion> heh
<AirWolfTheme> I never learnt to program empirically.
<orion> def-lkb: I have a feeling that I will be the same way. It makes me feel like my 12,000+ line C++ library has been a waste of time.
<AirWolfTheme> First language I learnt was scheme, even in python and php I program functionally.
<Anarchos> def-lkb OOP is nothing more than a struct with fields, and some fields are pointer to function....
<AirWolfTheme> Alan Kay kills a bunny every time you say that.
<adrien> ^ ^
Eyyub has joined #ocaml
<def-lkb> FWIW, it took me two attempts to stop thinking in an OOP-ish way (trying to reencode OOP-patterns in FP brought me worst of both worlds)
<AirWolfTheme> You can OO without mutation though.
<AirWolfTheme> Being able to do "string"#ref 1 or something wouldn't hurt.
<orion> What is the biggest mistake people make when learning OCaml, *assuming that they've never programmed in their life*?
<AirWolfTheme> Learning OCAml as their first language.
<orion> yes
<AirWolfTheme> Always start with Scheme
<AirWolfTheme> Always
<orion> Essentially, someone whose mind isn't polluted with OO.
Eyyub has quit [Read error: Operation timed out]
<AirWolfTheme> Nothing wrong with OO
<adrien> I wouldn't say that
<adrien> I've never done scheme
<AirWolfTheme> It attempts to do muchj the same things that FP does, decomposition of code into smaller more maintainable elements, easier to read stuff and what not.
<AirWolfTheme> THat is exactly why you wouldn't say that.
<adrien> the most common mistake is trying to start with ocaml objects
<adrien> they are *not* a beginner topic
FreeArtMon has quit [Read error: Operation timed out]
<adrien> they are not needed for most ocaml code
<AirWolfTheme> Also, no one uses them ever.
<adrien> that's wrong
<AirWolfTheme> No it's not.
<adrien> ocamlnet, lablgtk?
<AirWolfTheme> They don't count.
<adrien> ah
<Thooms> :D
<adrien> (I have commit rights in lablgtk, and even use them when I have time to)
tobiasBora has joined #ocaml
<AirWolfTheme> I have no idea what lablgtk is.
lostcuaz has quit [Ping timeout: 272 seconds]
<AirWolfTheme> But if someone who doesn't know scheme has commit rights on it it can't be good.
<AirWolfTheme> Probably some kind of sleasy porn search engine
<orion> What the hell is a "unit"?
lostcuaz has joined #ocaml
<adrien> orion: "nothing" :)
<adrien> AirWolfTheme: you can look it up
<def-lkb> a type that has only one value… similar to "void" in C-ish languages
<orion> # "a"; "beautiful"; "day";;
<orion> Warning 10: this expression should have type unit.
<AirWolfTheme> orion, basically needed because every expression has to have a type.
<AirWolfTheme> orion, , oh yeah
<AirWolfTheme> that's the part about sequencing I flat out forgot
<def-lkb> (bool has two values, either true or false, void is just void… that's why it's "unit", and its value is noted () )
<AirWolfTheme> Functions like print in Ocaml are typed string -> unit
kyrylo has joined #ocaml
<AirWolfTheme> As in, their return value is the singleton value that exists in unit, as in "this value isn't interesting"
<adrien> orion: that warning means that if you're to not use an expression, then that expression should be of type "unit", otherwise you're computing something uselessly since you're throwing it away
<AirWolfTheme> You can only of course sequence uninteresting values because "a" ; "day" would be a waste for "a"
<orion> So the warning is that I am essentially wasting my time with "a" ; "beautiful"
<gasche> use (ignore "a"; "beautiful") or (let _ = "a" in "beautiful") to avoid the warning
<adrien> orion: but you can build a list with [ "a"; "beautiful"; "day" ]
<adrien> ;-)
<orion> Is there a way I can query the type of a value on the CLI?
<gasche> just type it
<gasche> ah
<orion> hmm
<adrien> orion: do you have an example of what you'd like the type of?
<orion> "let my_data = [ "a"; "beautiful"; "day" ]
<orion> The whole thing.
<orion> That's a declaration.
<orion> # my_data;;
<orion> - : string list = ["a"; "beautiful"; "day"]
<adrien> and why not inside the toplevel?
<orion> I don't know what that means.
<adrien> the ocaml process
<adrien> it accepts input, evals it, return the result
jao has quit [Ping timeout: 252 seconds]
<AirWolfTheme> adrien, you mean get it as runtime value?
<def-lkb> CLI refers to executing and sequencing programs, passing them arguments; toplevel is the REPL/ocaml shell/prompt you get when executing specifically the "ocaml" command
<AirWolfTheme> utop is better anyway
<AirWolfTheme> One of the finer interactive repls I used
Eyyub has joined #ocaml
<Drup> AirWolfTheme: since you don't seems to now anything about object in ocaml (which makes *you* probably not relevante, hum.), you should read that : http://stackoverflow.com/questions/10779283/when-should-objects-be-used-in-ocaml/10780681#10780681
<Drup> also, stop the scheme fanboy thingy, scheme is nowhere near as interesting as people believe it is.
<orion> Why does line 2 work but line 5 fails?
FreeArtMon has joined #ocaml
<def-lkb> orion: it's parsed as "open Printf printf …"
<def-lkb> write "open Printf;;" to separate sentences
<AirWolfTheme> Drup, that link pretty much agrees with my thesis though.
<Drup> no it does not =)
<AirWolfTheme> And scheme is a cool teaching language because it enables you to build almost anything from language primitives.
<orion> ok
<AirWolfTheme> Thereby explaining how those things work
<orion> So, you can elide ;; when there's a let or open.
<adrien> I'm fairly sure objects are going to remain more used than GADTs, yet noone would think about removing GADTs from OCaml nor would call them useless
<adrien> orion: ";;" means "end of sentence"
<adrien> orion: a "sentence" is a set of chars that can be parsed properly
<orion> Is "let f a b c = 2;;" a declaration, sentence, or both?
<AirWolfTheme> Ocaml has GADT's?
<AirWolfTheme> Well there you go, clearly my ignorance has been proven.
<AirWolfTheme> I'm also not saying that ocaml objects should be removed, I'm just saying it's humourous how the language names itself after adding them and they are basically almost never used.
<adrien> orion: a sentence is simply used to denote something that can be parsed and handled on its own; I don't think the concept is kept later down in the compilation process
<orion> ok
<orion> I am still not entirely clear on scope.
<orion> When is a new scope created?
<adrien> very often? :P
<adrien> but you can:
<adrien> let a = 42 in let a = 0 in a
<AirWolfTheme> A local scope is basically the exprsesion following the 'in' in 'let ... in ...'
<AirWolfTheme> Where 'let ... in ...' is itself an expression
<adrien> the second definition of "a" shadows the first one, yet the two variables are different
<AirWolfTheme> hence you can do the above.
<adrien> (thought that might be what you find weird at the moment)
<AirWolfTheme> C also has lexical block scope that can go to infinite depth no/
<orion> Is the usage of "in" the only way scope is created?
<Thooms> orion: no, you create also a scope when defining a function
<AirWolfTheme> Well, if you don't use in at the top level if effectively does something similar.
<adrien> parens, begin/end, if/then/else, object...end, struct...end, and also functions and probably a few others
<Thooms> let f x = (* scope containing x *)
<AirWolfTheme> fun creates the scope though, you don't need to 'define' it to create it.
<orion> well wait
<AirWolfTheme> fun x -> x * 1 also has a scope as an anonymous function, as in the 'let' does not create the scope there, the fun does.
<orion> What is the difference between nesting a function within another function and using 'in'?
<AirWolfTheme> In fact, let <identifier> = <exp> in <exp2> is the same as "(fun <identifier> -> <exp>) <exp2>"
<AirWolfTheme> A local scope is basically just a function applied immediately.
<Drup> AirWolfTheme: you need to switch exp and exp2
<AirWolfTheme> Ehh yeah that's true
<orion> Are operators types?
<AirWolfTheme> They have types.
<AirWolfTheme> Assuming you mean infix operators
<AirWolfTheme> which are basically functions
<AirWolfTheme> It's just an alternative syntax for function calls.
<orion> Can I get the type of an operator from toplevel?
<AirWolfTheme> # (+)
<orion> ;;
<AirWolfTheme> To reify it as a normal function just put ( ... ) around it, but with * you have to be careful because (* ... *) is a comment so do ( * ) for * and *.
<AirWolfTheme> And yeah, ;; needs to come after it
FreeArtMon has quit [Ping timeout: 272 seconds]
<orion> hmm
<orion> How come > has type 'a -> 'a -> bool = <fun> but + has type int -> int -> int = <fun> ?
<AirWolfTheme> Well, because > works on anything
<orion> In other words, why do you need two operators for addition of floats and ints, but only one for comparison?
<AirWolfTheme> I don't think it actually does by the way, I think there's something with hash tables that it rejects
<AirWolfTheme> Well, because > works on anything, it also works on strings.
<orion> Why can't you have one + operator that works for floats and ints?
struktured has joined #ocaml
<AirWolfTheme> Because then + would have to work on anything
<AirWolfTheme> A function works on one type or all types.
<AirWolfTheme> Haskell has a system of typeclasses to be able to let a function work on say 5 types if you want to, in Ocaml paramatrized modules sort of solve the same problem for you
<AirWolfTheme> Basically, they could make (=) and (>) work sensibly on all things but they couldn't do it for +. If you ask me making (>) work on everything is a quaint decision
<adrien> they compares bits
<adrien> well
<AirWolfTheme> Yeah, I know, which is what the weird semantics of it is.
mort___ has joined #ocaml
<adrien> they check the kind of the value of runtime and if it's not integer/float/..., they compare bits
<AirWolfTheme> It gets pretty deeply into the internals
<AirWolfTheme> orion, also, another thing is that if + was polymorphic it would have to be 'a -> 'a -> 'a, as in, return the same type of the things compared.
<AirWolfTheme> Which would mean that hash table + hash table = hash table, what hash table exactly?
<AirWolfTheme> (=) and (>) are going to bool so that helps here.
<orion> ok
<orion> When you do let ... ;; are you defining a function or a value? Or is a function merely a kind of value?
f[x] has quit [Ping timeout: 260 seconds]
mort___ has left #ocaml []
thomasga has joined #ocaml
<Kakadu_> functions are values
<orion> ok
<adrien> almost everything is a value
<orion> heh, is there a venn diagram with all the vocabulary used here?
<AirWolfTheme> orion, except when people say that 'let ... = ... ;;' creates a scope
<AirWolfTheme> that's only when itś a function and it's not the let that creates the scope but the function
<mrvn> How do I sleep 0.x seconds? Any alternative to Unix.select?
<adrien> mrvn: are you using additional libs?
<mrvn> adrien: only zmq so far
kyrylo has quit [Quit: Hi, Rob!]
mhi^ has quit [Quit: Lost terminal]
zpe has joined #ocaml
Simn has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
zpe has quit [Ping timeout: 252 seconds]
mfp has quit [Read error: Connection reset by peer]
<orion> What's the difference between a tuple and a list?
<orion> "Unlike lists, tuples can contain elements of different types" -- nevermind
<Kakadu_> Are you familiar with std::pair?
<orion> yes
ulfdoz has quit [Ping timeout: 264 seconds]
<Kakadu_> So, pir contains two elements, tuple contains many and its number is encoded in type
<Kakadu_> pair*
<Kakadu_> List contains many elements too, but they all should have same type
<AirWolfTheme> a pair is a tuple of 2, a tuple of 1 is just the thing itself, shoyuld bve noted
<AirWolfTheme> orion, in fact, the singular value in unit is commonly seen as a tuple of zero things.
<AirWolfTheme> As in 'contains nothing, just here to be a value'
<mrvn> A ref is a one tuple which isn not the thing itself.
struktured has quit [Ping timeout: 246 seconds]
ontologiae has quit [Ping timeout: 272 seconds]
mfp has joined #ocaml
<AirWolfTheme> A ref is basically a mutable record with one thing though.
<AirWolfTheme> tuples can't have mutable contents as far as I know but maybe I'm wrong here.
<AirWolfTheme> A tuple of one would be useless, the major use of a record of 1 is that you can ehh, make it mutable I guess
<mrvn> yes. In memory records and tuples are the same.
<AirWolfTheme> Also, records have names which can make code clearer, tuples don't.
<mrvn> labels
<AirWolfTheme> True, but then again, so are integers and characters
mcclurmc has joined #ocaml
teethed_bird has joined #ocaml
<orion> Is it possible to make an application segault?
<Kakadu_> possible
<adrien> if you're using only the ocaml language, no
<adrien> FFI is an efficient way to segfault however
<adrien> black magic too
<adrien> dark*
<orion> If I didn't load Pervasives, what types would be available?
<Kakadu_> Is Obj.magic a dark one?
<adrien> definitely
<mrvn> totaly
dant3 has quit [Remote host closed the connection]
<Kakadu_> orion: Pervasives are loaded automatically
<adrien> orion: you'd have to use -nostdlib to do that
<adrien> and in that case
FreeArtMan has joined #ocaml
<mrvn> You can only segfault with Obj, *_unsafe or broken C bindings
<adrien> not many things
dant3 has joined #ocaml
<orion> Would you have integers?
<adrien> yes
<adrien> arrays, lists, floats
<adrien> chars, strings, ...
<adrien> check the doc of Pervasives and look for type definitions
<adrien> orion: but it's usually not a good idea to try to avoid Pervasives :P
<adrien> need to go
<orion> It's interesting to me that Pervasives includes "type int" when it's already provided by the language.
<adrien> I don't see it
<mrvn> some things are simply hardcoded in the compiler
mcclurmc has quit [Remote host closed the connection]
thomasga has quit [Quit: Leaving.]
mcclurmc has joined #ocaml
teethed_bird has quit [Quit: Page closed]
struktured has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
thomasga has joined #ocaml
<orion> Why did the author do "let _ = ..." at the bottom of test.ml?
<adrien> noticed how there is no "main" function in ocaml?
<AirWolfTheme> orion, let () = ... is a more common idiom, that said, the OCaml entry point is anonymous, you can effectively see your entire file as a 'main function'
<AirWolfTheme> it just executes the expressions in order in the file, the let _ = is actually not needed
<AirWolfTheme> But both let _ = print_endline "Hello, World";; and print_endline "Hello, World" do the same
<AirWolfTheme> You basically assign the return value of that expression to nothing, which is the empty tuple, only member of unit
<orion> AirWolfTheme: If you remove "let _ = ..." from the file, the application does not do anything.
<AirWolfTheme> ehh, maybe I should actually look instead of asuming then
<AirWolfTheme> Oh, it's actually a scope
avsm has quit [Quit: Leaving.]
shinnya has quit [Ping timeout: 248 seconds]
<AirWolfTheme> orion: you mean this:
<AirWolfTheme> let _ = Thread.create conn_main s in
<AirWolfTheme> accept_loop sock
<adrien> orion: all top-level constructs are evaluated upon module loading
<adrien> this means the right side of "=" will be evaluated
<AirWolfTheme> That's basically the same as (Thread.create conn_main s ; accept_loop sock)
<orion> Oh, the reason the application does nothing is because I needed to add ';;' after accept_loop sock.
<adrien> hmmmmm
<adrien> looks wrong
<adrien> orion: the code just got merged with the code two lines above
<adrien> or something like that
<adrien> but it's quite surprising the code parsed and type-checked
<adrien> but I bet you've changed its meaning
<AirWolfTheme> That is why I think both 'let' for local scope and top level bindings is a quaint decision.
ulfdoz has joined #ocaml
<AirWolfTheme> An error should throw an error as often as possible, not also be valid code for something which you may not have intended.
<adrien> err, no
<adrien> I meant that for _removing_ the "let _ ="
<adrien> so quite the opposite
avsm has joined #ocaml
<orion> Thanks for all your help guys.
orion has left #ocaml []
<AirWolfTheme> And gone she went, into the night, without giving a chance to say "you're welcome"...
<Kakadu_> AirWolfTheme: Google doesn't know this lyrics..
<AirWolfTheme> I just made it up on the fly.
kyrylo has joined #ocaml
avsm has quit [Quit: Leaving.]
mocrunsthecity has joined #ocaml
kyrylo has quit [Quit: Hi, Rob!]
thomasga has quit [Quit: Leaving.]
xian has left #ocaml []
avsm has joined #ocaml
ggole has quit []
thomasga has joined #ocaml
thomasga has quit [Client Quit]
mathieui has left #ocaml []
AirWolfTheme is now known as KnightRiderTheme
dant3_ has joined #ocaml
dant3 has quit [Ping timeout: 252 seconds]
<mrvn> ARGS, I just realized why 'if str == "QUIT" then raise QUIT' wouldn't quit
milosn_ has joined #ocaml
yacks has quit [Quit: Leaving]
milosn has quit [Read error: No route to host]
ulfdoz has quit [Ping timeout: 252 seconds]
Kakadu_ has quit []
jao has quit [*.net *.split]
tobiasBora has quit [*.net *.split]
pango has quit [*.net *.split]
manizzle has quit [*.net *.split]
samebchase has quit [*.net *.split]
xaimus has quit [*.net *.split]
seliopou has quit [*.net *.split]
mal`` has quit [*.net *.split]
cdidd has quit [*.net *.split]
Drup has quit [*.net *.split]
NoNNaN has quit [*.net *.split]
Arach has quit [*.net *.split]
<KnightRiderTheme> mrvn, because == is memory location compare?
jao has joined #ocaml
tobiasBora has joined #ocaml
pango has joined #ocaml
NoNNaN has joined #ocaml
manizzle has joined #ocaml
samebchase has joined #ocaml
xaimus has joined #ocaml
Arach has joined #ocaml
seliopou has joined #ocaml
mal`` has joined #ocaml
cdidd has joined #ocaml
Drup has joined #ocaml
<mrvn> KnightRiderTheme: yes
<KnightRiderTheme> I don;'t really get these polymorphic >, =, == etc but hey.
<KnightRiderTheme> I get a polymorphic physical identity compare.
<KnightRiderTheme> Can you do physical location ordering on strings in some way anyway?
<KnightRiderTheme> (>) : string -> string -> bool gives you sequential codepoint compare if I'm not mistaken
<companion_cube> they are magical :/
<KnightRiderTheme> Well yeah, but I'm just wondering, is it at all possible in some way to do a physical identity ordering on a string?
mort___ has joined #ocaml
dant3_ has quit [Remote host closed the connection]
dant3 has joined #ocaml
<KnightRiderTheme> companion_cube, answer me
<KnightRiderTheme> you seem like someone who knows stuff.
<KnightRiderTheme> companion_cube, why would you keep me bereft of knowledge, I would never incinerate you. =(
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
axiles has quit [Remote host closed the connection]
kyrylo has joined #ocaml
mort___ has quit [Ping timeout: 260 seconds]
<gasche> KnightRiderTheme: when the GC can move stuff, pointer equality makes sense, but order doesn't
<gasche> except (==), polymorphic comparison therefore traverse values and compare by content
<gasche> which is why they're often called "structural" by opposition to "physical"
FreeArtMan has quit [Ping timeout: 272 seconds]
<KnightRiderTheme> Yeah, but > isn't structurual on everything
<gasche> ?
<KnightRiderTheme> It is on strings and stuff, but not on arbitrary records or hash tables or what not
<KnightRiderTheme> gasche '>' does memory location compare on other stuff than numbersa dn strings right?
<KnightRiderTheme> Might have forgotten one.
<KnightRiderTheme> The point is, > works on a list of hashtables.
<gasche> but it works by traversing the runtime representation of the hasthable
<gasche> (which is not necessarily what you want as a hashtable and its same-elements-but-resized will be different)
<KnightRiderTheme> Is it?
<gasche> it does something or fail with an error, but when it works it is structural
<KnightRiderTheme> I thought that > on hash tables or on anything which is not some primitive type does memory location compare.
<KnightRiderTheme> Really.
<gasche> as I said above, you can't because of the GC
<KnightRiderTheme> I am pretty sure that is not true.
<KnightRiderTheme> At least, that is not how I read it everywhere, as far as I know (>) is structural on a select few primitive types and works with memory location for anything else
<gasche> on objects it compare by integer identifiers
<gasche> and on "custom" values it calls the registered custom comparison operation when available
<KnightRiderTheme> Hmm
<KnightRiderTheme> So what would happen if you have a list of objects
<KnightRiderTheme> and do > on it?
<KnightRiderTheme> It cmopares it sequentially?
<gasche> two lists of objects ?
<KnightRiderTheme> Yeah
<gasche> it will compare the heads of the list
<gasche> if they're different, return different
<gasche> else look at the rest of both lists
<KnightRiderTheme> So it does a sequential one one on lists?
<gasche> (objects would be compared by numeric identifier)
<gasche> it's a structural comparison, yes
milosn_ has quit [Ping timeout: 246 seconds]
mocrunsthecity has quit [Remote host closed the connection]
milosn has joined #ocaml
tobiasBora has quit [Quit: Konversation terminated!]
milosn_ has joined #ocaml
avsm has quit [Quit: Leaving.]
kyrylo has quit [Quit: Hi, Rob!]
avsm has joined #ocaml
kyrylo has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
darkf has joined #ocaml
mk270 has joined #ocaml
Simn has quit [Quit: Leaving]
avsm has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20131020]: i've been blurred!]
avsm has quit [Ping timeout: 260 seconds]
madroach has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
dant3 has quit [Remote host closed the connection]
skchrko has joined #ocaml
skchrko has quit [Remote host closed the connection]