vect changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn, ICFP'03 http://www.icfpcontest.org/, 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
TylerE has joined #ocaml
<TylerE> Hi - newb question
<TylerE> I'm trying to use Printf.printf
<TylerE> for i = 1 to Array.length Sys.argv do
<TylerE> Printf.printf "%s\n" Sys.argv[i]
<TylerE> done;;
<TylerE> that's the code I'm using
<TylerE> when I try to compile t
<TylerE> I get: for i = 1 to Array.length Sys.argv do
<TylerE> Printf.printf "%s\n" Sys.argv[i]
<TylerE> done;;
<TylerE> Ack
<TylerE> This expression has type (string -> 'a -> 'b, out_channel, 'a -> 'b) format
<TylerE> but is here used with type (string -> 'a -> 'b, out_channel, unit) format
<TylerE> Anybody?
<Riastradh> TylerE, it means look at the 'a -> 'b versus unit bit.
<TylerE> I don't see where I'm specifying a unit though
<TylerE> the doc on printf just says formatstring Arg1 ... ArgN
<TylerE> Which looks to me as exactly what I'm calling it with...
<TylerE> (But then what do I know ;))
<ayrnieu> How do you call it?
<TylerE> Printf.printf "%s\n" Sys.argv[i]
<TylerE> in side a loop
<TylerE> basically I want it to print the command line arguments
<ayrnieu> Try this: Printf.printf "%s\n" Sys.argv.(0);;
<TylerE> Whoah, that works....
<TylerE> should I replace the 0 with my loop variable for it to work in a loop?
<ayrnieu> Exercise for the reader.
<TylerE> yep ;)
<TylerE> Ahh, so I had the list element syntax wrong ;)
<ayrnieu> Sys.argv[0] forms a function call. Sys.argv.(0) forms an array-fetch.
<TylerE> ahh
<TylerE> that makes sense....sorta
* TylerE is too used to C ;)
<ayrnieu> Sys.argv ([0]), then =)
<TylerE> *g*
TylerE has quit ["Client Exiting"]
clausjohnson has joined #ocaml
clausjohnson has quit [Client Quit]
Kinners has joined #ocaml
ayrnieu has quit ["to screen"]
ayrnieu has joined #ocaml
Kinners has left #ocaml []
ayrnieu is now known as julian
julian is now known as ayrnieu
clausjohnson has joined #ocaml
clausjohnson has quit ["Got to be good lookin' 'cause he's so hard to see."]
lms has joined #ocaml
lms has quit [Read error: 104 (Connection reset by peer)]
Herrchen has quit [Read error: 110 (Connection timed out)]
det has quit ["changing servers"]
det has joined #ocaml
Herrchen has joined #ocaml
lms has joined #ocaml
shawn has quit [Nick collision from services.]
_shawn has joined #ocaml
_shawn is now known as shawn
lms has quit []
Riastrad1 has joined #ocaml
Riastradh has quit [Read error: 110 (Connection timed out)]
Kinners has joined #ocaml
Riastrad1 has quit [Read error: 110 (Connection timed out)]
Riastradh has joined #ocaml
det has quit [Excess Flood]
wazze has joined #ocaml
Riastrad1 has joined #ocaml
Riastradh has quit [Connection timed out]
Yurik has quit [Read error: 104 (Connection reset by peer)]
Yurik has joined #ocaml
Kinners has left #ocaml []
codeburnt has joined #ocaml
Maddas has quit ["Terminated with extreme prejudice - dircproxy 1.1.0"]
Maddas has joined #ocaml
Yurik_ has joined #ocaml
Yurik has quit [Connection reset by peer]
Yurik_ has quit ["Leaving"]
clausjohnson has joined #ocaml
_JusSx_ has joined #ocaml
<_JusSx_> HI
wazze is now known as afkzze
<clausjohnson> Howdy
<clausjohnson> Jussx, I did what you said
<clausjohnson> About downloading tuareg-mode.tar.bz2 from the tuareg site putting it in /usr/portage/distfiles
<clausjohnson> And got it to install
<clausjohnson> but I *still* get the caml-types error
<_JusSx_> that's really odd
<clausjohnson> I know... and I can't stand to try to write caml code w/out tuareg
<clausjohnson> the 'default' caml-mode sucks
<_JusSx_> i'm using gentoo and tuareg-mode but i have no prob
_JusSx_ has quit ["[BX] Did somebody say BitchX?"]
Riastrad1 is now known as Riastradh
maihem has joined #ocaml
_JusSx_ has joined #ocaml
<_JusSx_> MERRY XMAS
<Riastradh> You're two days too early. (Or one, if you're eleven hours ahead of me.)
mattam_ has joined #ocaml
Defcon7 has quit [Read error: 104 (Connection reset by peer)]
Defcon7 has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
malc has joined #ocaml
maihem has quit ["Client exiting"]
mattam_ has quit [zelazny.freenode.net irc.freenode.net]
_JusSx_ has quit [zelazny.freenode.net irc.freenode.net]
clausjohnson has quit [zelazny.freenode.net irc.freenode.net]
simon- has quit [zelazny.freenode.net irc.freenode.net]
maihem has joined #ocaml
mattam_ has joined #ocaml
_JusSx_ has joined #ocaml
clausjohnson has joined #ocaml
simon- has joined #ocaml
mattam_ has quit [Connection reset by peer]
mattam has joined #ocaml
senko has joined #ocaml
<senko> how do i sleep for less than a second?
<malc> usleep
<malc> or on ocaml terms select
<senko> ahh
<senko> thx
<senko> !
<Riastradh> It takes a really complicated alarm clock.
<senko> mmmm... :)
_JusSx_ has quit ["BitchX: EPIC on steroids."]
systems has joined #ocaml
systems has quit [Client Quit]
malc has quit ["no reason"]
codeburnt has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml