gl changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list | http://icfpcontest.org/ !!
eigenspace has joined #ocaml
eigenspace has quit [Client Quit]
bzzbzz has left #ocaml []
monotonom has quit ["Don't talk to those who talk to themselves."]
kinners has joined #ocaml
tautologico has joined #ocaml
ktulu_ has joined #ocaml
tautologico has quit [Read error: 110 (Connection timed out)]
_fab has quit [calvino.freenode.net irc.freenode.net]
_fab has joined #ocaml
ktulu_ has quit [Read error: 60 (Operation timed out)]
ktulu_ has joined #ocaml
ktulu_ has quit [Client Quit]
monotonom has joined #ocaml
vezenchio has quit ["According to [a processor for game design], you statistically have a better chance of becoming a rock star than you do of suc]
wolf|z has quit ["nein"]
Nutssh has joined #ocaml
kinners has quit ["leaving"]
mrsolo has quit ["Leaving"]
duality has joined #ocaml
monotonom has quit [Read error: 54 (Connection reset by peer)]
mrsolo has joined #ocaml
duality has quit [Client Quit]
Walnutssh has joined #ocaml
Walnutssh has quit [Remote closed the connection]
mrsolo has quit [No route to host]
kinners has joined #ocaml
kosmikus|away is now known as kosmikus
jao has quit ["ERC Version 4.0 $Revision: 1.600 $ (IRC client for Emacs)"]
kinners has quit [Read error: 104 (Connection reset by peer)]
gim has joined #ocaml
bk_ has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
buggs^z has joined #ocaml
vincenz has quit [Read error: 110 (Connection timed out)]
vincenz has joined #ocaml
buggs has quit [Read error: 60 (Operation timed out)]
bk_ has joined #ocaml
bk_ has quit [Remote closed the connection]
Nutssh has quit ["Client exiting"]
karryall has joined #ocaml
_fab has quit [calvino.freenode.net irc.freenode.net]
bk_ has joined #ocaml
_fab has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
bk_ has joined #ocaml
_fab has quit [calvino.freenode.net irc.freenode.net]
_fab has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
bk_ has joined #ocaml
vezenchio has joined #ocaml
scaudi has joined #ocaml
scaudi has left #ocaml []
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
bk_ has joined #ocaml
smimou has joined #ocaml
maihem has joined #ocaml
maihem has quit ["Read error: 54 (Connection reset by chocolate)"]
Axioplase has joined #ocaml
<Axioplase> Chat Lu!
karryall has quit ["au revoir"]
christi has joined #ocaml
vezenchio has quit ["According to [a processor for game design], you statistically have a better chance of becoming a rock star than you do of suc]
vezenchio has joined #ocaml
<christi> can i run caml light code with ocaml?
<Smerdyakov> There is a probably a FAQ covering this on the OCaml site.
<christi> thanks
kosmikus is now known as kosmikus|away
kinners has joined #ocaml
<christi> Smerdyakov: from the faq i understand that i can run caml programs using an ocaml interpretor
<kinners> christi: yes
<christi> but i've tried once and it didn't work
<christi> but it worked with some program called caml74
<christi> or something like this
<kinners> camlp4?
<christi> the binary archive was called caml74.tar.gz
<kinners> you can load source code (#use "foo.ml") or bytecode objects (#load "foo.cma") into the interpreter
<christi> it was on someone else's computer
<christi> and at home i've tried with ocaml and it didn't work
<kinners> you mean run Caml light programs in ocaml?
<christi> yes
<christi> using the ocaml rpm
mattam_ has joined #ocaml
<christi> kinners: can i run caml light programs using it?
<kinners> christi: I don't know
mattam has quit [Operation timed out]
christi has quit ["Leaving"]
Lor has quit ["Terminated with extreme prejudice - dircproxy 1.1.0"]
Lor has joined #ocaml
Phreaze has joined #ocaml
Axioplase has quit [Nick collision from services.]
Phreaze is now known as Axioplase
wolfman8k has joined #ocaml
Submarine has joined #ocaml
gim has quit ["++"]
monotonom has joined #ocaml
kinners has quit ["leaving"]
Verbed has joined #ocaml
Lor has quit ["Off"]
cDlm has joined #ocaml
<cDlm> what does "module type OrderedType = sig end" mean ?
<cDlm> shouldnt this module declare t and compare ?
<monotonom> You are right. Don't worry about what you see.
<cDlm> i worry about the docs
<Submarine> ?
<monotonom> "module type OrderedType = sig end" appears at the top. It does declare t and compare, and both are displayed in the lower half.
<monotonom> It is just the way ocamldoc decides to arrange things.
<cDlm> isnt sig end something like a public interface declaration ?
<cDlm> ocamldoc is bugged then
<monotonom> No, it is deliberate.
<cDlm> duh
<Submarine> module type FOOBAR = sig ... end
<Submarine> declare a module type called FOOBAR defined as containing the things in ...
<Submarine> the functor Map.Make takes a module of type FOOBAR as argument
<Riastradh> The [[module type OrderedType = sig end]] is a quick overview of what will be described; in this case, it's the signature OrderedType. The rest of the document describes the interface.
<cDlm> imho omitting the sig *nothng* end would be clearer
<cDlm> nevermind.
<monotonom> cDlm is talking about the cosmetics of e.g. http://caml.inria.fr/ocaml/htmlman/libref/Set.OrderedType.html
<cDlm> I'm trying to use modules and the manual confuses me instead of helping
<Submarine> just do module FooMap = Map.Make (struct type t = foo let compare = compare_foo end)
<cDlm> I'd like 'a t
<cDlm> so I guess I have to define a functor, to get rid of the 'a before calling Map.Make ?
<Submarine> you want a map of anything in the source?
<Submarine> or in the destination?
<cDlm> I want to map states to transitions, states being labeled by something I intend to be int, but could be something else
Submarine has left #ocaml []
Banana has joined #ocaml
<cDlm> ok.
<monotonom> Suppose you do module STMap = Map.Make (struct type t = int;; let compare = compare)
<monotonom> Then STMap.key will be a synonym of int. You can use STMap.key if you don't want to hardcode "int".
<monotonom> And the type of the map is 'a STMap.t.
<Axioplase> ++
Axioplase has quit [Remote closed the connection]
<monotonom> You can then instantiate 'a to your transition type.
<cDlm> yup
<monotonom> Let me assume your transition type is called tt.
<monotonom> Then tt STMap.t is the type of the state-to-transition map you want.
<cDlm> but I'd have preferred to write 'a 'b map
<monotonom> There are problems with 'a 'b map.
<monotonom> Imagine I want to build two different kinds of maps, both using strings for keys, but in one case I want to sort according to the C locale, and in the other, the ISO-8859-15 locale.
<monotonom> Then "string 'b map" would be ambiguous.
<cDlm> maybe
<monotonom> Alright, that is not true, because I will really have "string 'b CLocaleMap.t" and "string 'b LatinLocaleMap.t".
mattam_ is now known as mattam
<monotonom> The problem now is to have a type constructor, CLocalMap.t say, that takes two parameters, but one of them must be string, e.g., the compiler has to allow "string 'b CLocaleMap.t" and not "int 'b CLocaleMap.t".
<monotonom> While it is possible to modify the ocaml language for that, I don't think the effort is worth the tiny convenience it provides.
buggs^z is now known as buggs
<cDlm> in ruby there is na such metaphysical questions :)
<cDlm> no
<cDlm> ha.
<cDlm> I wrote a functor for my state machines
<cDlm> but how do I put that in a file ?
<mattam> where is it ?
<mattam> (if not already in a file)
<cDlm> file statemachine.ml contains "functor blah blah..."
<cDlm> syntax error on functor
<mattam> give some context
<cDlm> the manual says a file contains what would be between struct and end
<cDlm> so where can I declare a functor ?
<mattam> module a(X : sig type t val f : t -> t end) =
<mattam> struct
<mattam> ...
<mattam> end
<mattam> s/a/A/
<mattam> 'functor' is mainly used in signatures
<mattam> a signature is something like: "module type AF = functor (X : sig ... end) -> sig ... end"
<buggs> am i supposed to be able to make an ocaml programm that segfaults or is that a always a bug ?
<mattam> a bug
<mattam> if you do not use Oo or C libraries, then you discovered an ocaml compiler bug, but it's very unlikely
* cDlm stops doing brain knots
<cDlm> I must be allergic to the syntax
<mattam> you'll get used to it, just be patient (especially for the modules and functors syntax)
<cDlm> i'm more interested by
<cDlm> ... ruby-like languages
<monotonom> heh
<mattam> what, all those @ ?
<mattam> decorating variable names is so ... perlish
<cDlm> NO TYPES =)
<Smerdyakov> cDlm, why are you more interested by those?
<cDlm> because you dont have to work around the language features to do what you want
<Smerdyakov> Instead, you have to work around runtime bugs to do what you want.
<cDlm> well, thats compared to java
<buggs> what if i created a loop in a linked list made of objects?
<cDlm> you get a looping list :)
<mattam> the GC should have no problems with that
<buggs> but should it be expected to segfault ?
<Smerdyakov> cDlm, this idea of "working around" something is silly, since it is parameterized on your development strategy, which you can change.
<mattam> buggs: no
<cDlm> Smerdyakov: i mean working around javas crappy type system by putting casts everywhere
<Smerdyakov> cDlm, ah. I thought you were talking about OCaml.
<cDlm> or writing 15 lines of caml functor stuff instead of MAP[STATE,TRANS] is eiffel
<Smerdyakov> 15 lines? I'm highly skeptical of much more savings than, say, 1 line.
<mattam> cDlm: you mean, type map = (State, Trans) Hashtbl.t ?
<buggs> last time i triggered an assertion now this, i live my name
<cDlm> mattam: duh
<cDlm> mattam: why didnt you say that earlier ?
<Smerdyakov> cDlm, what are these 15 lines that you claim don't have Eiffel analogues?
<mattam> i didn't know you were looking for that :)
smimou has quit ["?"]
<cDlm> Smerdyakov: one module for state, one for trans, defining the 2 maps etc
<gl> hi dudes
<Smerdyakov> cDlm, you mean you don't have a module, class, whatever for each of state and trans in Eiffel?
<cDlm> yes maybe
<Smerdyakov> cDlm, I think you have zero savings in Eiffel vs. OCaml.
<cDlm> possible
<Smerdyakov> That's very different from saying there are 14 unnecessary lines!
<cDlm> but I wouldnt have lost 1h of rtfming with eiffel :p
<Smerdyakov> That's because you already rtfm'd at an earlier time for Eiffel.
Verbed has quit ["Leaving"]
<cDlm> yes, and i rtfmd ocaml earlier too
<Smerdyakov> Clearly not well enough.
<cDlm> bah
<Smerdyakov> I can assure you that most people here do _not_ need to consult the OCaml manual to use a new functor in a library.
<mattam> cDlm: now you know that defining a module is not necessary to use Hashtables, usually it is the other way
<monotonom> I had had experience with sml and haskell, so I wouldn't need an hour of rtfm for ocaml. But I have also found that every time I wrote a simple Perl script I had to rtfm for an hour.
<cDlm> perl is crap
<cDlm> we agree on that point
<monotonom> With Java I have to re-read the docs for java.util.* or javax.swing.* every time.
<cDlm> thats not what bthers me most
<cDlm> writing for(int i = blah...) three lines of Enumeration blah blah does
<wolfman8k> c# is pretty nice *ducks*
<cDlm> instead of ruby's each{} or map fold etc
<cDlm> wolfman8k: c# has nice features, compared to java
<mattam> nice is nice
<mattam> (nice is a better java)
<wolfman8k> c# could be a lot better though, especially the syntax :(
<wolfman8k> and multiple inheritance would be nice :\
<cDlm> </troll><manga>
* wolfman8k goes back to his lair
<mattam> you get a stack overflow exception under linux ?
<buggs> mattam, you don't ?
<mattam> that's a question
<mattam> i just wanted to be sure that's what you got
<buggs> yes i get a Stack_overflow
<Smerdyakov> Why wouldn't you get a stack overflow?
<Smerdyakov> How is it a bug?
<buggs> Smerdyakov, i get a segfault on BSD
<mattam> maybe your BSD has some bizarre stack options
<Smerdyakov> Oh, I see.
<Smerdyakov> buggs, you should have capitalized the 'o' in "on Linux." It looks like you are continuing the last sentence the way it ix.
<Smerdyakov> is
<mattam> also some gcc options are forbidden like -fstack-protector
<buggs> probably would have liked a "," there
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
<Smerdyakov> buggs, a comma would not have been grammatically correct. A period at the end of the first line and capitalization for the second would be.
<buggs> Smerdyakov, my english knowledge does not include the correct usage of commata but in german (my native tongue) you can always read them as "and"
<buggs> is that different in english ?
<buggs> i think the subject gives a hint to what i intended to say
<Smerdyakov> buggs, it is not true in English. You need an explicit "and" to connect two independent clauses.
<buggs> i see
<buggs> thinking about it -- i probably made that one a lot, thx
<Smerdyakov> Americans make that mistake a lot, too.
<Smerdyakov> Since it's one that can't be detected in speech
<Smerdyakov> (A comma and a sentence boundary aren't vocalized :)