__DL__ changed the topic of #ocaml to: OCaml 3.09.0 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/
<dylan> one sec
<dylan> yes it is possible.
<dylan> type 'a t = 'a list * 'a list is like an alias.
<dylan> so, say you have:
<dylan> val print_thing : 'a list * 'a list -> unit
<dylan> that is then equivalent to val print_thing : 'a t -> unit
<ski_> "t" is an abstract type, that in the implementation (inside the structure) is known to be synonymous with that pair type
<ski_> right, that is equivalent *inside* the structure
<ski_> (outside it's unknown what the type really is .. it's abstract)
<dmn> well i got complaints of type mismatches and by now i switched to using a named constructor..
<dmn> i mean mismatches between the sig and the struct
<dmn> oops, i read the error messages wrong, the problem was elsewhere i think...
<dmn> right. it works.
<ski_> fine
<dylan> ski_: it's an assumption (and a good one) that the implementation of the datatype is hidden in the signature.
<dylan> from wha dmn said, I couldn't know. :)
<qknight> can i do casts somehow?
<ski_> um
<ski_> what do you mean ?
moea has joined #ocaml
<qknight> typecasts
<qknight> we have a type of int list and we want to cast it to be just an int list
<ski_> there are particular *conversions* you can do, like from int to real, or from int to string
<ski_> hm, sorry ?
<ski_> you want to "cast" 'int list' to 'int list' ?
<qknight> let print_clashes ls =
<qknight> List.iter (fun a -> match a with
<qknight> Clash_formals i -> ...
<qknight> | Clash_fields i -> ... ;;
<qknight> and Clash_formals is of type int list
<ski_> do you use same definition of type 'clash' as before
<ski_> ?
<qknight> and now ocamls say it wants a Clash_formals type for this function
<qknight> type clash =
<qknight> Clash_formals of formal list
<qknight> | Clash_fields of field list
<ski_> (ok .. rather 'Clash_formals' takes an 'int list' argument and gives a 'clash')
<ski_> ok
<ski_> so, first 'i' above has type 'formal list', and second 'i' has type 'field list'
<ski_> is 'formal' and 'field' type-synonyms for 'int' ?
<qknight> no, i just said int for simplification :)
<qknight> hey
<qknight> i think it's to hard to explain
<qknight> again as before ..
<qknight> *argh*
<qknight> ski_: thanks anyway
<ski_> ok
<ski_> anyway
<ski_> since those are lists
<ski_> and you want to print them
<ski_> you could use List.iter to do that
<ski_> val List.iter : ('a -> unit) -> 'a list -> unit
<ski_> so, you need to pass a function that can print a 'formal' to first 'List'iter' call
<ski_> and, mutatis mutandis, for the other
<ski_> ok ?
<moea> it would be really cool if ocaml printed out stack traces when exceptions are raised
<qknight> ski_: hehe
<pango> moea: it does for unhandled exceptions, when compiled to bytecode and OCAMLRUNPARAM="b"
<pango> moea: there's a patch floating around to do the same in native mode
<moea> pango: thanks a lot
<moea> it is always interesting using ocaml after a day of programming in python
dmn has left #ocaml []
<pango> moea: ocamlc needs -g flag (debugging infos) too
quamaretto has joined #ocaml
<moea> if i have an expression of the form "if condition then something else something1; something2", how do i go about telling ocaml that the "something2" is part of the else condition?
<moea> i.e i want something1 and something2 to be done in the case the condition is not true, not in both cases
<moea> i mean, not something2 to be done in both cases
<pango> begin/end, or parenthesis
<moea> i.e. if(condition) { something() } else { something1(); something2() }
<moea> thanks
<moea> yay
qknight has quit ["Lost terminal"]
pango_ has joined #ocaml
pango has quit [Read error: 145 (Connection timed out)]
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
vezenchio has quit ["\\o sora wa hate shinai, kokoro no kagami dakara ne \o/ mainichi iro wo kaeteku utsushidasu you ni o//"]
sudoer has joined #ocaml
sudoer has left #ocaml []
Smerdy is now known as Smerdyakov
mauke_ has joined #ocaml
mauke has quit [Read error: 104 (Connection reset by peer)]
mauke_ is now known as mauke
Skal has joined #ocaml
MisterC has joined #ocaml
Skal has quit [Read error: 110 (Connection timed out)]
vodka-goo has joined #ocaml
ski has joined #ocaml
m3ga has joined #ocaml
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
Schmurtz has quit [Read error: 113 (No route to host)]
TaXules has quit [Remote closed the connection]
TaXules has joined #ocaml
pnou has quit [Remote closed the connection]
pnou has joined #ocaml
ski has quit ["later"]
ppsmimou has joined #ocaml
revision17_ has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
descender has joined #ocaml
_fab has joined #ocaml
pnou has quit [Remote closed the connection]
TaXules has quit [Remote closed the connection]
pnou has joined #ocaml
TaXules has joined #ocaml
vodka-goo has quit [brown.freenode.net irc.freenode.net]
juri has quit [brown.freenode.net irc.freenode.net]
vodka-goo has joined #ocaml
juri has joined #ocaml
pnou has quit [Remote closed the connection]
vezenchio has joined #ocaml
pnou has joined #ocaml
moea has quit [Read error: 104 (Connection reset by peer)]
moea has joined #ocaml
yozora has joined #ocaml
_JusSx_ has joined #ocaml
yozora has left #ocaml []
_JusSx_ has quit [Read error: 113 (No route to host)]
_JusSx_ has joined #ocaml
kryptt has joined #ocaml
mattam has quit [Connection timed out]
Banana has quit [Connection timed out]
Banana has joined #ocaml
_JusSx__ has joined #ocaml
_JusSx_ has quit [Read error: 110 (Connection timed out)]
mattam has joined #ocaml
Banana_ has joined #ocaml
Banana has quit ["youp"]
_JusSx_ has joined #ocaml
_JusSx__ has quit [Read error: 110 (Connection timed out)]
joshcryer has quit [Connection timed out]
kryptt has quit [Read error: 110 (Connection timed out)]
__DL__ has joined #ocaml
batdog is now known as batdog|gone
bluestorm has joined #ocaml
mauke has quit ["CLOWNS"]
Raziel has quit ["Yo soy goma. Tú eres cola."]
shirogane has joined #ocaml
moea has left #ocaml []
bluestorm has quit [Remote closed the connection]
shirogane has quit [Remote closed the connection]
pango has quit ["Leaving"]
Bigb[a]ng is now known as Bigbang
pango has joined #ocaml
Schmurtz has joined #ocaml
ppsmimou has quit ["Leaving"]
quamaretto_ has joined #ocaml
quamaretto has quit [Nick collision from services.]
quamaretto_ is now known as quamaretto
quamaretwo has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
smimou has joined #ocaml
Bigbang is now known as Bigb[a]ng
quamaretto has quit ["Chatzilla 0.9.68.5 [Firefox 1.0.7/20050915]"]
_JusSx_ has quit ["leaving"]
Schmurtz has quit [Remote closed the connection]
Schmurtz has joined #ocaml
flux__ has quit [Remote closed the connection]
MisterC has quit ["Client exiting"]
__DL__ has quit [Remote closed the connection]
demitar_ has quit [Remote closed the connection]
Raziel has joined #ocaml
vodka-goo has quit ["Connection reset by by pear"]
mig has joined #ocaml
<mig> bonsoir
<pnou> 'soir mig
<mig> Y a-t-il un 'kevin' parmi l'assistance ?
smimou has quit ["bli"]
exa has joined #ocaml