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/ !!
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
vezenchio has joined #ocaml
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
kinners has joined #ocaml
smimou has quit ["?"]
yauz_ has joined #ocaml
yauz has quit [Read error: 110 (Connection timed out)]
kinners has quit [Read error: 54 (Connection reset by peer)]
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
<debona|r> heh
<debona|r> look at that, I'm next to myself
<Axioplase> ++
Axioplase has quit [Read error: 104 (Connection reset by peer)]
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
Herrchen_ has joined #ocaml
gl has quit [Read error: 110 (Connection timed out)]
Herrchen has quit [Read error: 110 (Connection timed out)]
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
ne1 has quit ["To understand recursion, you must first understand recursion."]
Snark has joined #ocaml
gl has joined #ocaml
debona|r has left #ocaml []
Herrchen_ is now known as Herrchen
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
vezenchio has quit ["Join the fight against drunken calculus: Don't drink and derive!"]
Riastradh has quit [Read error: 110 (Connection timed out)]
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
smimou has joined #ocaml
dan|el has quit [Read error: 110 (Connection timed out)]
gim has quit [Read error: 104 (Connection reset by peer)]
gim has joined #ocaml
kinners has joined #ocaml
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
karryall_ has joined #ocaml
kinners has quit [Read error: 60 (Operation timed out)]
cods has quit [Read error: 110 (Connection timed out)]
Riastradh has joined #ocaml
Axioplase has joined #ocaml
<Axioplase> Chat Lu!
nmajer has joined #ocaml
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
dan|el has joined #ocaml
bk_ has joined #ocaml
<dan|el> silence again
mrsolo_ has quit [Read error: 60 (Operation timed out)]
<vincenz> Aloha
karryall_ has quit ["tcho"]
<dan|el> hullo
<dan|el> how do I run ocaml files as a script?
<dan|el> ocaml script.ml works fine...
<dan|el> but using #!/usr/bin/ocaml in the script itself doesn't work
<dan|el> the shell seems to think it's a shellscript
<dan|el> !/usr/bin/ocaml
<dan|el> print_string "blah blah";;
<vincenz> You forgot the #?
<dan|el> oops
<dan|el> yes, I did, when pasting
<dan|el> #!/usr/bin/ocaml
<dan|el> print_string "blah blah";;
<dan|el> but not in the code itself
<dan|el> have you gotten it working?
<vincenz> isn't it #!/usr/bin/setenv /usr/bin/ocaml
<vincenz> ?
<dan|el> nope
<dan|el> #!/usr/bin/env ocaml if you want to do it that way
<dan|el> hm, that actually works
<dan|el> but that's usually for portability issues
<dan|el> when ocaml can actually reside in /usr/bin or /usr/local/bin
<vincenz> ah
<dan|el> however, it worked, so I will use that for now
<dan|el> but I'm still puzzled why the direct path didn't work
<dan|el> *boggle*
<dan|el> thanks
<vincenz> np
<dan|el> ok, how about command arguments ?
<dan|el> any argv argc things?
<det> dan|el: you dont wish to compile it?
<det> dan|el: you would be better off using ocamlopt to compile it first
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
<dan|el> det: scripts are good for prototyping
Lemmih has quit ["Leaving"]
<det> dan|el: the ocaml compiler is fast
<dan|el> there's still an extra step
<det> dan|el: (edit), make test, (edit), make test
<dan|el> regardless, do you know how to access argv and argc?
<det> Sys.argv
<dan|el> det: it's actually not so much a question of test... I'm learning the language, so I need to explore a lot of things... so it's more like.... (edit),make,run,(edit),make,run vs (edit),run :)
<dan|el> do you have a good function reference page you can share?
<det> argc is unnessecary
<dan|el> step 1 of learning a new language: Find tutorials and references pages!
<det> use Array.length
<det> dan|el: I just googled for "ocaml argv" :)
<det> dan|el: the official reference should do
<dan|el> ah :P
<dan|el> what is the official reference? I checked the main website
<dan|el> the users manual?
<dan|el> right
<dan|el> ok, thanks
<det> n/p
<dan|el> how do I step through a list?
<dan|el> I thogut maybe like
<dan|el> for i in Sys.argv.length do
<dan|el> print_string Sys.argv(i)
<dan|el> done;;
<dan|el> oh, nm]
<dan|el> got it
<dan|el> I think
<dan|el> for i=Sys.argv.length downto 1 do
<dan|el> print_string Sys.argv(i)
<dan|el> done;;
<dan|el> probably closer though
<Banana> it would be Array.length (Sys.argv)
<Banana> or simpler is : Array.iter (print_string) Sys.argv
<dan|el> oh
<Banana> (you can remove the extra parentheis too).
<dan|el> thanks
<Banana> (maybe you should use print_endline instead of print_string...)
<dan|el> print_endline can print both strings and integers?
<Banana> no.
<Banana> but if you are reading Sys.argv there are only string in there...
<dan|el> print_endline is string -> unit then ?
<Banana> yes.
<dan|el> ok, thanks
<dan|el> I need to look up Array.iter as well :)
<dan|el> where do I find stuff like that? Array.iter information? the manual isn't a very good thing to use a s a reference
<Banana> did you have a look at www.ocaml.org ?
<Banana> there is a documentation section with books and tutorials on ocaml.
<dan|el> yupp
<dan|el> but I want a reference
<dan|el> I don't want ot have to read a tutorial everytime I need to remember what Array's can do
<Banana> then use the reference manual.
<dan|el> link?
<Banana> read the standard library section.
<dan|el> ah, tha'ts what I was looking for
<Banana> what you got one hour ago.
ncm_ has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
nmajer has quit [Read error: 110 (Connection timed out)]
<dan|el> well, Id dnt look in the standard library section
<dan|el> apologies, but the manual was big, and I didn't sift through it all
<Banana> no problem.
CosmicRay has joined #ocaml
<dan|el> isn't a list and an array the same thing?
<Banana> not at all.
<Banana> with array you have fixed size.
<Banana> and array are mutables.
<Banana> (you modify them in place).
<Banana> and you have acces to an element in O(1),
<Banana> list are not mutable with access to element i in O(i).
<Banana> but adding an element is O(1).
<dan|el> ok, thanks
<dan|el> what do you mean fixed size btw? both seem to have an append function
<Banana> to an array ?
<dan|el> theres Array.append() and List.append()
<dan|el> so when you say arrays have fixed size, what do you mean?
<Banana> yes but i was talking about atomic operations.
<dan|el> oh ok
<Banana> appending is not an atomic operation.
<Banana> you need to copy both arrays in an freshly allocated one (naive algorithm...)
<Banana> well time to eat.
<Banana> bbl.
<dan|el> thanks. ;) I'll try to hold my questions until I've read the tuts anyway :P
bk_ has joined #ocaml
vezenchio has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
karryall has quit ["we"]
Snark has quit ["Parti"]
maihem has joined #ocaml
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
CosmicRay has quit ["Client exiting"]
buggs^z is now known as buggs
<Herrchen> moin
<Herrchen> re
Lemmih has joined #ocaml
<dan|el> hey
KrispyKringle has joined #ocaml
buggs^z has joined #ocaml
ncm_ has quit [Remote closed the connection]
buggs has quit [Read error: 110 (Connection timed out)]
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
AsylumGov has joined #ocaml
<AsylumGov> hello everybody
<AsylumGov> I have a little newbie question
<AsylumGov> I have a file ident.mli in which I declare "type t" and "val make: string -> t"
<AsylumGov> then in ident.ml I define "type t = string" and "let make name = name"
<AsylumGov> now I compile both files, launch the ocaml interpreter and type "open Identx"
<Smerdyakov> What is Identx?
<AsylumGov> oops
<AsylumGov> I mean Ident
<AsylumGov> "open Ident"
<AsylumGov> now when I type something like "type x = t", everything's fine, I get the answer "type x = Ident.t"
<AsylumGov> however, when I try 'make "x"', I get "Reference to undefined global `Ident'"
<Smerdyakov> I'm not sure what that message means, but certainly you aren't allowed to use that fact that t = string.
<AsylumGov> why not?
<Smerdyakov> Just putting "type t" in the signature makes t an abstract type.
<Smerdyakov> Oh.
<Smerdyakov> I misread something.
<AsylumGov> I define t in ident.ml
<Smerdyakov> You _aren't_ allowed to use t = string in the toplevel, but that shouldn't cause the problem.
<AsylumGov> I need to use the function make, how can I do that?
<Smerdyakov> It should work. Try it like open Ident;; make "x";;
<AsylumGov> yes, that works
<AsylumGov> but when I type make "x" on a seperate line, I get the error
<AsylumGov> why is that?
<Riastradh> Are you using Ident.make or just make?
<AsylumGov> I use just make
<AsylumGov> but I get the same error when I use Ident.make
<Riastradh> That's quite strange.
<AsylumGov> the problem is, I need to debug a file which uses functions from the Ident module
<AsylumGov> so I'd like to load parts of it into the interpreter
<AsylumGov> but at the first occurence of "make" the interpreter stops with that error message
<AsylumGov> I think I found the solution
<AsylumGov> #load "ident.cmo";;
<AsylumGov> anyway thanks for your cooperation
KrispyKringle has quit ["Leaving"]