cturner has quit [Read error: 113 (No route to host)]
docelic has joined #ocaml
CybeRDukE has joined #ocaml
bk_ has joined #ocaml
docelic has quit ["later"]
szymon has joined #ocaml
szymon has left #ocaml []
jt` has quit [orwell.freenode.net irc.freenode.net]
rox has quit [orwell.freenode.net irc.freenode.net]
jt` has joined #ocaml
rox has joined #ocaml
docelic has joined #ocaml
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
Xcalibor has joined #ocaml
<Xcalibor>
greetings
<Xcalibor>
so the winner of the ICFP Contest is not yet known?
Xcalibor has quit [Remote closed the connection]
Xcalibor has joined #ocaml
<Xcalibor>
re's
systems has joined #ocaml
CybeRDukE has quit ["Sleep: A completely inadequate substitute for caffeine."]
Begbie has joined #ocaml
<Xcalibor>
hi there
<systems>
hi
<systems>
sup
<Xcalibor>
well, weekend at last :)(
<Xcalibor>
:) i mean
<systems>
:)
<Xcalibor>
reading some ocaml tutorial and the entries to the icfp 2003 contest
<Xcalibor>
i'm falling in love with ocaml... today i managed to write a function that makes arbitrarily big powers on int numbers n and m :-)
<Xcalibor>
i am starting to get the feeling for the modules and so, which is definitely good as it makes things more fun :)
<systems>
:)
<systems>
good luck
<systems>
it's so bad many ppl dont know enough about ocaml
<Xcalibor>
been reading the big language shootout
<systems>
problem with ocaml, is that the first impression special for anyone who comes for a lang like perl or python, could be bad
<systems>
ocaml biggest thing is type checking
<systems>
it's done brilliantly
<Xcalibor>
where many benchmarks are done for many languages and implementations, and Ocaml always gets pretty good marks in terms of speed, memory management and code conciseness...
<systems>
ocaml static type checking, is the best
<systems>
better then dynamic typing
<Xcalibor>
well, i come from perl and I think it's pretty brilliant (also come from c++, to be fair)
<Xcalibor>
well... I am not sure I love the difference between (+) and (+.) but I can get used to it
<Xcalibor>
besides, 'a is pretty good, better than templates in c++
<systems>
well, ocaml cheats with the > < >= etc..operators
<bk_>
erm, do i have to create my own local module to be able to use the "Set" module ?
<Xcalibor>
amazingly Ocaml interpreter is faster than Java :-)
<Xcalibor>
if you also put a 1 on the LOC or Memory boxes, Ocaml gets the 1st and 2nd positions, very amazing...
<bk_>
yes
<Xcalibor>
bk_: let me try
<whee>
I think anything is faster than java :)
<Xcalibor>
whee: well, no... but java vm has a lot of things made wrong, just comparing with similar modern vm's...
<Xcalibor>
their GC really sucks
<jt`>
yeah, I don't dig + and +. either
<Xcalibor>
and that accounts for a great lot of problems in j2ee programming, I am told
<jt`>
I have to wonder what similar modern vms you are looking at. Java ain't so bad.
<bk_>
hm i have to write my own compare function for a Set
<Xcalibor>
jt`: ocaml's for example
<Xcalibor>
or clisp's
<Xcalibor>
or mzscheme's, bigloo's or mit scheme's
<whee>
bigloo compiles to native code
<whee>
well I think ti goes to C and then hands that off to a C compiler, but heh
<Xcalibor>
bigloo can be run interactively, I think
<Xcalibor>
anyway...
Begbie has quit [Read error: 104 (Connection reset by peer)]
<Xcalibor>
I can do: open Set;; in ocaml without any complaints, but the documentation about Set is very weird... how do I create one?
<whee>
Xcalibor: you use the Set.Make functor to create your module that uses sets
<whee>
it might be easier to find an example of that, or learn functors :)
<Xcalibor>
whee: bk_ there's your reply :-)
<Xcalibor>
whee: i'll eventually get there... :)
<Xcalibor>
thanks for the info, though
<bk_>
heh thanks
<whee>
you can probably figure out how to use Set without understanding functors, though
<whee>
trying to find a clean example :|
<bk_>
i'm looking at functors now, there's no way around it :p
<bk_>
nm i'm learing anyway
<whee>
bk: what you do is use Set.Make to create the module for your sets; that's why you provide the compare function (ordered sets need a comparison function)
<bk_>
right
<whee>
if you're using basic types you can usually get away with giving it Pervasives.compare
<bk_>
nono i need a custom compare function, that is inevitable
<Xcalibor>
you are the one who knows how apples or complex numbers or lottery drums compare one item to another...
<bk_>
right
jt` has quit ["Client exiting"]
<bk_>
i'm blatantly stealing code fragments from other ppls sources
<Xcalibor>
:)
<bk_>
or at least i'm look at how they did it heh
<Xcalibor>
is it open source?
<bk_>
looking
<bk_>
yes
<Xcalibor>
best way of learning after doing it yourself
<bk_>
usually i 1st read about something i'd like to use, then i try it myself
<bk_>
if i con't quite figure it out, i need examples
<Xcalibor>
yes, we all do
<Xcalibor>
the else in the if expression is always needed?
<whee>
Xcalibor: it's optional I believe
<whee>
in the revised syntax it's required, but for standard it's optional
<bk_>
ono
<bk_>
there's no predefined Time/Date type, is there ?!
<whee>
not that I know of
<bk_>
:|
<Xcalibor>
whee: ah, ok... i ask because I am getting this: # if false then 3 ;;
<Xcalibor>
This expression has type int but is here used with type unit
<whee>
Xcalibor: in that situation you need an else
<Xcalibor>
unit is the return type of the else clause that's not there, I guess
<whee>
both branches of the if statement should evaluate to the same thing
<whee>
same type, even
<whee>
unless you're just ignoring the result of it
<whee>
bk: there's some basic time functions in the Unix module
<whee>
by basic I mean a record with seconds, minutes, hours, day of month, day of year, year, weekday, heh
<Xcalibor>
ok, but if true then 3 ;; doesn't need an else branch, doesn't the if expression shortcircuit?
<bk_>
ah okay, thanks for the hint
<whee>
Xcalibor: it would, but it's still a type error
<Xcalibor>
mmm... yes, definitely
<bk_>
val time : unit -> float
<bk_>
Return the current time since 00:00:00 GMT, Jan. 1, 1970, in seconds.
<bk_>
nice
<whee>
er, heh
<whee>
Xcalibor: you need the else clause if the then statement doesn't evaluate to unit
<whee>
better way of stating that :|
<Xcalibor>
whee: mmm...
<whee>
both paths have to evaluate to the same type
<Xcalibor>
ok, understood
<Xcalibor>
# let int_of_unit () = 0 ;; (* for int if's :-) *)
docelic has quit ["cya"]
cturner has joined #ocaml
<Xcalibor>
greetings cturner
<cturner>
hello! And can I add - wow - I've been lurking here for a couple of weeks on and off and this is the first time I've seen anyone talk ;)
<whee>
heh
<Smerdyakov>
You've picked the wrong times, I guess!
<cturner>
maybe :) I live in .au so probably get the quiet times
<cturner>
I'm here because I saw the programming language competition results and thought I must be missing out on something.
<Smerdyakov>
Oh, you are.
<Smerdyakov>
Naughty, naughty cturner.
<cturner>
heh
<cturner>
I'm going book shopping today: is there a generic book to pick up to learn ocaml?
<Smerdyakov>
You should be able to find everything you need online.
<cturner>
(know java, have written scheme and lisp for uni, currently trying to write an adventure game in python)
<cturner>
ok
<cturner>
I learn better from sitting down reading a paper book - if I were to print something out for this purpose would the standard ocaml manual be the place to start?
<Smerdyakov>
I'm not very knowledgeable about this subject. I learned SML first.
<cturner>
'k
<whee>
and I learned by sitting in front of an lcd reading the manual and the oreilly book :)
<Xcalibor>
there's a book about Ocaml at O'Reilly
<cturner>
Xcalibor: ta
<Xcalibor>
in english and french and tanslation is being done by volunteers to japanese
<Xcalibor>
so, pick your choice ;-)
<bk_>
"the functional approach to programming", its about caml-light but seems to be pretty good
<cturner>
And is the oreilly book decent? I've found with python that it was out of date and I was better off with the web docs.