ayrnieu changed the topic of #ocaml to: OCaml 3.08.4 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/
alark has quit ["Chatzilla 0.9.68a [Firefox 1.0.4/20050511]"]
Gueben has quit [Read error: 104 (Connection reset by peer)]
mlh_ has joined #ocaml
zigong has quit [Remote closed the connection]
threeve_ has quit []
<Revision17> the eclipse O'Caml plugin is kinda neat; a bit unfinished and buggy though
<Revision17> hmm cool it appears to use ocamldep and automatically sets up dependencies
<Revision17> certainly seems like a step up from using SciTE+make
UziMonkey has quit ["Leaving"]
UziMonkey has joined #ocaml
Smerdyakov has quit []
__DL__ has joined #ocaml
ramkrsna has joined #ocaml
UziMonkey has quit [Read error: 110 (Connection timed out)]
exa is now known as gigi
Gueben has joined #ocaml
Gueben has quit [Remote closed the connection]
pango__ has joined #ocaml
pango_ has quit [Read error: 110 (Connection timed out)]
mlh_ has quit [Client Quit]
petter_ has joined #ocaml
petter_ has quit [Client Quit]
UziMonkey has joined #ocaml
ramkrsna has quit [Remote closed the connection]
mornfall has joined #ocaml
vezenchio has joined #ocaml
Whyp has joined #ocaml
Whyp has quit [Client Quit]
m3ga_ has joined #ocaml
m3ga_ is now known as m3ga
Gueben has joined #ocaml
Schmurtz has quit [Remote closed the connection]
Schmurtz has joined #ocaml
UziMonkey has quit [Remote closed the connection]
UziMonkey has joined #ocaml
pango__ is now known as pangobath
threeve has joined #ocaml
mikeX has joined #ocaml
pangobath is now known as pango
batdog|gone is now known as batdog
mikeX has quit ["Leaving"]
joeytwiddle has joined #ocaml
gigi has quit [Read error: 104 (Connection reset by peer)]
gigi has joined #ocaml
Smerdyakov has joined #ocaml
Smerdyakov has quit ["CONCUR 2005"]
<twobitsprit1> the ocaml-tutorial.org is talking about a "standard graphics" library called Graphics. They're run on a Linux machine and I'm in Windows, and also don't have this "standard" library for graphics...
<twobitsprit1> where would I find this? the tutorial implies that it just "ships with" OCaml and doesn't provide a referrence for attaining it...
<Snark> twobitsprit1: did you "open Graphics;;" first?
<twobitsprit1> Snark: indeed I did
<twobitsprit1> under the "Modules and [open]" section...
<twobitsprit1> I copied verbatim the first example program, and get errors from ocamlc
<twobitsprit1> "Error while linking test.cmo: Reference to undefined global `Graphics'"
<avlondono> twobitsprit1: look at the manual
<avlondono> keep the manual at hand, a tutorial is just that
<twobitsprit1> I see, thanks
<Snark> twobitsprit1: could you give me the url to the program you type?
<Snark> try to add "graphics.cma" to your compile-line
gigi is now known as exa
<twobitsprit1> I see a lot of functions being defined i.e. "let f x y () = ..." why the "()"?
<twobitsprit1> Snark: ahh, yeah I got it to work, I was just being blind :P
<Schmurtz> perhaps to allow delayed execution
<Schmurtz> if you have a function accepting a argument of type unit -> unit
<Schmurtz> (f 1 2) is of this type
<Schmurtz> the real execution of f is done only when you apply ()
<twobitsprit1> I see
<twobitsprit1> so you can emulate lazy evaluation, sort of...
<Schmurtz> yes
badonawy has joined #ocaml
<twobitsprit1> just from looking at code examples, I get the impression that "let ... in" works like (let ...) in lisp/scheme insofar as it creates a new scope in which these names are bound. This makes me think that there must be a way to end that scope... can I say "let ... in ... end"?
<twobitsprit1> maybe I can find this in the manual...
<Schmurtz> there's no end
<Schmurtz> however you may write : (let .... in .....) with parenthesis
<twobitsprit1> I see
<twobitsprit1> but it does introduce a new scope?
<Schmurtz> for the parenthesis, yes
<twobitsprit1> I see
<Schmurtz> for let ... in, I don't know exactly
<twobitsprit1> a ha...: " The let binding is not an assignment, it introduces a new identifier with a new scope."
<Schmurtz> ok
zigong has joined #ocaml
<twobitsprit1> so... can't one use the "let ... in" construct at the top level? if so, why use the ";;" instead of in?
UziMonkey has quit [Remote closed the connection]
UziMonkey has joined #ocaml
<Schmurtz> twobitsprit1, a question of habit...
<Schmurtz> in fact, using ;; is more practical : the top level execute code when you send a ";;"
<Schmurtz> so if you want ti see what appends for each line of code, ";;" is better
MySTiK333 has joined #ocaml
mikeX has joined #ocaml
Yorick has joined #ocaml
mikeX has quit ["Leaving"]
<twobitsprit1> hmm... if I define "type 'a list_pair = { first : 'a list ; second : 'a list };;" and then say "{ first = [1;2] ; second = [3;4] };;" shouldn't this be of type "int list_pair"?
<Yorick> isn't it?
<zvrba> twobitsprit1: hm, why don't you use tuples: type 'a list_pair = 'a list * 'a list ;;
badonawy has quit [Client Quit]
<twobitsprit1> Yorick: doh... it is, I has just used a previous definition in the REPL which was defined as strinctly int... my bad...
<Yorick> had me worried there
<twobitsprit1> zvrba: I'm just playing around with things... I had thought tuples would be better, I just wanted to try the other way...
<zvrba> ok, just asking :)
<twobitsprit1> Yorick: sorry... :P
<Yorick> needing unique names for struct fields is a pain
whyp has joined #ocaml
<twobitsprit1> Yorick: yeah, I was actually thinking that myself... I wish it was more like "list_pair {first:...;second:...}" or something so that I could have, i.e., "string_pair {first:...;second:...;}"
<twobitsprit1> but I guess that could be factored out into "type pair = ..."
<twobitsprit1> er, "type 'a pair = ..."
<Yorick> Sometimes I wish the designers would settle on what should be in the language so they could re
<Yorick> rewrite the syntax from scratch in a clean way :)
<twobitsprit1> yeah... I was noticing a few area's where the syntax seems to break patterns...
<twobitsprit1> does, i.e., MLton have as many idiosyncracies(sp?) as OCaml?
<twobitsprit1> sorry... I don't mean to bring up "Ocaml vs. SML" issues, I'm just still compairing the languages to see which I feel more comfortable in...
__DL__ has quit [Remote closed the connection]
* exa feels defunctorization is killer feature in sml
<twobitsprit1> eh?
Boojum has joined #ocaml
Snark has quit [Nick collision from services.]
Boojum is now known as Snark
whyp has quit ["Leaving"]
Snark has quit ["Leaving"]
<exa> w00t
<exa> (^_^)
<exa> pango: I'm looking at the link now
<exa> pango: If my slow-ass connection works, that is.
zigong has quit [Remote closed the connection]
_shawn has joined #ocaml
<exa> looks serious
<exa> :)
<exa> nice
<exa> congrats to Julien :)
MySTiK333 has quit ["Well, I'm gettin' something really special too. And by special I don't mean special like that Kleinaman boy down the street. M"]
Gueben has quit ["Amen"]
m3ga has quit ["disappearing into the sunset"]
Yorick has quit ["Leaving"]
<twobitsprit1> I'm having a hard time finding documentation on the usage of arrays
twobitsprit1 has quit ["Download Gaim: http://gaim.sourceforge.net/"]
monochrom has joined #ocaml
Gueben has joined #ocaml
exa has quit [Remote closed the connection]
Gueben has quit [Remote closed the connection]
threeve has quit []
vincenz has joined #ocaml
exa has joined #ocaml
threeve has joined #ocaml
Gueben has joined #ocaml
zigong has joined #ocaml
ulfdoz_ has joined #ocaml
vezenchio has quit ["\o/ in mochintin namocniuh \o/"]
zigong has quit [Connection timed out]
twobitsprite has joined #ocaml
<twobitsprite> is i worth naming a type like "type foo = int list list;;" will I ever need something like that, or is it just easier to rely upon type inference to know that a function is looking for an "int list list"?
ulfdoz has quit [Read error: 110 (Connection timed out)]
<pango> twobitsprite: in a few places types are required (like .mli, ...)
<twobitsprite> so otherwise there's really no need to specify a name for something like that?
<pango> # [[1]];;
<pango> - : int list list = [[1]]
<pango> I didn't really need to declare the type...
mikeX has joined #ocaml
<twobitsprite> I see
<twobitsprite> I'm trying to write an AI program that plays the game Go... and I'm trying to figure out the best way to represent the board... would a list list work? or should I use arrays? or is there some other type/module/etc that would work better?
<pango> arrays are probably better than lists for the job
<pango> lists don't efficiently support random access
<twobitsprite> alright... I still can't find anything that goes in depth on how to use arrays... they're mentioned in a few of the tutorials I've read, and I can't find anything about them in the manual... what am I missing?
<twobitsprite> I see... now, if I said "let board = Array.create 19 (Array.create 19 0)" would the outter array simply have 19 referrences to the same inner array?
<mikeX> twobitsprite, create is deprecated in favor of make
<twobitsprite> ok... it uses create in the link you sent me...
<mikeX> twobitsprite, you can also take a look at "http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora057.html" to see why arrays are a better choice
<twobitsprite> ...er the link pango sent me...
<mikeX> they have constant access times and are well suited for random access
<mikeX> yes the book is a bit old, you should also be looking at the ocaml reference
<mikeX> it has a detailed documentation of all the modules and their functions
<twobitsprite> I couldn't find arrays in the manual
<twobitsprite> maybe its under vectors?
<pango> twobitsprite: try let board = Array.init 19 (fun i -> Array.make 19 0)
<mikeX> twobitsprite, the o'reilly book also has an AI game example (connect 4), maybe that could be of help
<mikeX> I suggest you mirror those 2 sites and study them thoroughly (at least that's how I'm learning ocaml :P)
monochrom has quit ["good morning, sweet dream"]