<mrvn_>
The reason for functor is so that you can have seperate things with a common interface. Its like a base class in OO.
<mrvn_>
(where the base class is the argument to the functor to provide the interface)
systems has joined #ocaml
Xcal has joined #ocaml
Xcalibor has quit [Read error: 113 (No route to host)]
Xcal is now known as Xcalibor
systems has quit [Connection timed out]
polin8 has quit [Read error: 60 (Operation timed out)]
brwill_zzz is now known as brwill
bk_ has quit ["I'll be back"]
<teratorn>
can anyone recommend a module for parsing MIME mail messages?
smkl has quit [Remote closed the connection]
smkl has joined #ocaml
brwill is now known as brwill_zzz
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
Vincenz has quit []
buggs|afk is now known as buggs
srv has joined #ocaml
bk_ has joined #ocaml
polin8 has joined #ocaml
<Maddas>
hm
<Maddas>
type Operator = Plus | Minus | Multiply | Divide | Modulo;;
<Maddas>
why would I get "syntax error" at characters 5-13
drWorm has joined #ocaml
<drWorm>
hello, i'm trying to install ocaml from source, but after i run the configure script, a Makefile with no rules is generated, so that 'make world' says "*** No rule to make target `world'. Stop." -- am I doing something wrong? this is a linux box, red hat 9.
drWorm has quit [Client Quit]
<Maddas>
why do you do' make world'?
<Maddas>
duh
drWorm has joined #ocaml
<Maddas>
why do you do' make world'?
<drWorm>
oops, sorry
<drWorm>
because it says so in INSTALL :)
<Maddas>
oh :)
<drWorm>
not that i haven't tried just 'make' too
<Maddas>
:/
<drWorm>
and the makefiles for osx and nt have plenty of rules
<drWorm>
(i'd use an rpm, but i have no root privileges and need to install under $HOME)
<bk_>
only type constructors start with capital letters, Maddas
<bk_>
type operator = Plus | Minus | Multiply | Divide | Modulo;;
<Maddas>
heh, ok
<Maddas>
I had an other error, and thought maybe it had to be uppercase. Works now, thanks :)
<Maddas>
bk_: but I refer to it as 'Operator' later, don't I?
<bk_>
nope
<bk_>
take a look at the 'Constant constructors' in the o'reilly book
<Maddas>
it's not all, but it compiles until the error I mentioned ;-)
<whee>
doopI'm back
<whee>
what's up with this
<whee>
what is the type of apply?
<Maddas>
hm
<whee>
it just seems odd
<whee>
does apply have side effects? :\
<Maddas>
yes
<whee>
I'd probably have those functions take the stack and get rid of this whole state thing
<Maddas>
I would think it (the type) is (int -> int) -> int
<Maddas>
the stack is in state! :)
<whee>
yeah but it makes you write tons of functions with side effects, and those are harder to interweave
<whee>
interleave, heh
<Maddas>
hm
<Maddas>
I'm not sure what you mean then
<whee>
instead of calling apply_op and expecting it to grab this single stack off the state and do things with it, have apply_op take the stack as an argument as well
<Maddas>
I only have one global stack, no plans whatsoever to add any more
<whee>
then the entire instantiation of the calculator is one huge fold_left or fold_right (?$@!) that evaluates user input
<Maddas>
ah, I see
<whee>
of course the user input is lazily gotten but :)
<Maddas>
well
<whee>
probably could use a stream for that one
<Maddas>
I'm trying to get something done, I know it's no good style
<Maddas>
but I don't know french and didn't read too much documentation :)
<whee>
hold on
<Maddas>
oh, apply only applies the function with two arguments
<Maddas>
it does not fold the entire stack
<Maddas>
only shortens it by one element, so to speak :-)