smimou changed the topic of #ocaml to: OCaml 3.08.3 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/
vodka-goo has quit []
paganini_ has joined #ocaml
monochrom has quit ["me!"]
bk_ has joined #ocaml
paganini_ has quit [Remote closed the connection]
Sonarman has joined #ocaml
__DL__ has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 145 (Connection timed out)]
cjohnson has quit [""We live like penguins in the desert...""]
Sonarman has quit ["leaving"]
bk_ has quit [niven.freenode.net irc.freenode.net]
Submarine has joined #ocaml
bk_ has joined #ocaml
bk_ has quit [niven.freenode.net irc.freenode.net]
bk_ has joined #ocaml
Herrchen has joined #ocaml
b00t has joined #ocaml
Nutssh has joined #ocaml
Nutssh has quit [Client Quit]
pango has quit [Remote closed the connection]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
<ulfdoz_> re
smimou has joined #ocaml
mlh has quit [Client Quit]
Submarine has quit ["Leaving"]
mrvn_ is now known as mrvn
bk_ has joined #ocaml
vodka-goo has joined #ocaml
hangman4 has quit ["leaving"]
vezenchio has joined #ocaml
Submarine has joined #ocaml
_JusSx_ has joined #ocaml
Snark has joined #ocaml
<Snark> slt
Herrchen has quit ["bye"]
b00t has quit [Remote closed the connection]
<mflux> afternoon.
<araujo> Good day buddies
Snark has quit ["Leaving"]
Skal_ has joined #ocaml
Skal_ has quit [Read error: 110 (Connection timed out)]
mrvn_ has joined #ocaml
mrvn has quit [Read error: 145 (Connection timed out)]
cjohnson has joined #ocaml
shammah has quit [niven.freenode.net irc.freenode.net]
shammah has joined #ocaml
dodecahedron has joined #ocaml
<dodecahedron> Hello
dodecahedron has quit [Client Quit]
dodecahedron has joined #ocaml
<dodecahedron> Hello again
Gueben has joined #ocaml
_JusSx_ has quit ["leaving"]
_JusSx__ has joined #ocaml
Smerdyakov has quit [Client Quit]
TeXitoi has quit [Read error: 104 (Connection reset by peer)]
TeXitoi has joined #ocaml
Snark has joined #ocaml
<araujo> hello programmers
<vodka-goo> hi
<araujo> Hi vodka-goo
<araujo> how are you today-?
<araujo> could someone explain me a bit this code:
<araujo> i don't get how two functions receive the two declarations
<vodka-goo> you may understand better if I write it another way, without hiding the reference c'est
<vodka-goo> let c = ref 0
<vodka-goo> let f1 () = c := 0
<vodka-goo> let new_s () = c := !c+1 ; s^(string of int !c)
<vodka-goo> s/f1/reset_s/
<vodka-goo> it's just the same
<vodka-goo> I'm afraid it doesn't help much...
<vodka-goo> are you just surprised by the fact that functions are usual values that can be assignated ?
<araujo> No, i get that part.
<araujo> what i didn't know is that i coudl do this:
<araujo> # let (var1, var2) =
<araujo> let c = 4
<araujo> and x = 8 in (c,x);;
<araujo> as a way to declare several variables at once
<vodka-goo> patterns are not only for matching, but also in let bindings, yes
<araujo> that's cool
<vodka-goo> yes
<vodka-goo> but the "good" way of hiding values is to use modules/interfaces
<araujo> oh, well, i still don't get that far yet :-)
<vodka-goo> forget what I said, that kind of trick is useful
<araujo> yeah, it looks like that... it is sort of a way to share enviroment between several closures...
<araujo> So, what i am doing is something like:
<araujo> # let (var1, var2) = (8,9);;
<smimou> yes
<Snark> re
p has joined #ocaml
_JusSx__ has quit [Read error: 104 (Connection reset by peer)]
<araujo> mexico p ?
Submarine has quit ["Leaving"]
<TeXitoi> araujo: mx is mexico, yes
<TeXitoi> but it can be a hacked machine... ;-)
<araujo> yeah, i know, hah
* araujo just happy of not being the only south-american in here
* TeXitoi have leaved 1 year in mexico
<araujo> you lived there?
<TeXitoi> yes
<araujo> what city?
<TeXitoi> Toluca
_JusSx___ has joined #ocaml
* araujo should visit mx someday
<TeXitoi> but I've traveled a little bit ;-)
* araujo knows a few people from there
<araujo> i see :-)
Zaius has joined #ocaml
<Zaius> hi everyone;; i did the following and got no satisfying result:
<Zaius> type t = A | B
<Zaius> let f = function A -> "A" | B -> "B"
<Zaius> type s = A | B
<Zaius> let _ = print_string ( f A )
<Zaius> ...has type s but is here used with type t
<Zaius> why is it that i can't unify types t and s?
<araujo> mmm.. it's not a problem that you use same values for different types?
<ulfdoz_> Zaius: Because of identical constructor.
<Zaius> can i force coercion of A to any type of s or t?
<Zaius> now my type t is part of lablgl and is quite reasonable, but i don't want to refer to it
<mflux> zaius, well, the answer would be 'because'. maybe you want to use variants?
<mflux> just because they are structurally equivalent doesn't mean they would be otherwise..
<mflux> and even if the symbols have the same names, it doesn't mean they are the same ;)
<ulfdoz_> In the interpreter, the definition of s hides t.
<mflux> it hides it in the compiler too?
<ulfdoz_> mflux: Don't know, haven't testet.
<Zaius> but if they are structurally equivalent, then i dont find any usafety in coercing them. and if i force the coercion myself then i suppose i know that they are equivalent semantically too
<mflux> well..
<mflux> you could use Obj.magic, but that's dark magic.
<mflux> why don't you just do type s = t?
<ulfdoz_> Zaius: The reason for the typing error could be avoided by defining f after defining s. But I don't know if this is, what you want.
<mflux> zaius, if it said type s = B | A, do you still think it should 'just work'?
<mflux> zaius, or was your suggestion that explicit casting would be required?
TeXitoi has quit [Read error: 104 (Connection reset by peer)]
TeXitoi has joined #ocaml
<mflux> (which you can do now with a conversion function - writing it would be tricky if the definitions weren't in their own modules though)
<Zaius> conversion function?
<mflux> from 'A' to another 'A'
<mflux> I think structural equality in ocaml is considered only with classes
<Zaius> ah, that would require referring to the original A as well
<mflux> you could convert A to a number before and then again the number to A afterwards ;)
<mflux> or you could define the types in their own modules
<mflux> maybe I'm not seeing the real use of what you're attempting to do
<Zaius> what i try to do is: avoid using Glut.some_t in my code.
<mflux> type t = Glut.some_t ?
<Zaius> how could i do the conversion with Obj.magic? is sounds ... interesting :)
<mflux> hmh
<mflux> well, it's your code..
<mflux> (Obj.magic value :> type)
<mflux> that makes no checks whatsoever
<Zaius> hmm... it works indeed. very dangerous indeed
<Zaius> type t = A | B
<Zaius> let f = function A -> "A" | B -> "B"
<Zaius> type s = B | A
<Zaius> let _ = print_string ( f (Obj.magic A :> t) )
<Zaius> it now prints a "B"
<Zaius> thank you for your help
<Snark> a "B"?
<ulfdoz_> What about type glut_wrapper = Wrap of Glut.some_t?
<ulfdoz_> You should then be able to get the value of correct type by constructor patterns.
pango has joined #ocaml
<Snark> good night
Snark has left #ocaml []
_JusSx___ has quit ["leaving"]
__DL__ has left #ocaml []
Submarine has joined #ocaml
Bonedigger has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
vodka-goo has quit []
Bonedigger has quit [Remote closed the connection]
cjohnson has quit [Remote closed the connection]
vezenchio has quit [""Under democracy one party always devotes its chief energies to trying to prove that the other party is unfit to rule—and bot]
<ulfdoz_> cya
Gueben has quit ["plouf"]
Submarine has quit ["Leaving"]
angagon has quit [Read error: 110 (Connection timed out)]
vodka-goo has joined #ocaml
mlh has joined #ocaml