systems changed the topic of #ocaml to: Archive of Caml Weekly News http://pauillac.inria.fr/~aschmitt/cwn/ | ICFP Programming Contest 2003 http://www.dtek.chalmers.se/groups/icfpcontest/ | A tutorial http://merjis.com/richj/computers/ocaml/tutorial/ | Good free book http://cristal.inria.fr/~remy/cours/appsem/ | Mailing list (best mailing list ever for any computer language) http://caml.inria.fr/bin/wilma/caml-list
<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
<bk_> there's an example with a set of cards
<drWorm> there's an o'reilly book on ocaml?
<bk_> yes
<drWorm> oh, cool
<drWorm> no hints regarding the mystery of the rule-less Makefile, though?
<bk_> i've build ocaml 3.07 beta2 according to the INSTALL.TXT and it worked for me, i have no idea why it wouldn't build on OSX tho
<drWorm> Linux, not OSX
<bk_> oh ok
<bk_> did you do ./configure
<drWorm> yes
<drWorm> and then 'make world' as it says in INSTALL, but it has no 'world' rule
<bk_> hm
<Maddas> why doesn't this work though:
<Maddas> type operator = Plus | Minus | Multiply | Divide | Modulo;;
<Maddas> type keyseq = Number of int | Digit of int | operator | Action;;
<Maddas> where I just wanted to use operator as a shortcut :)
<bk_> type keyseq = Number of int | Digit of int | Foo of operator | Action;;
<Maddas> heh
<Maddas> ok then :)
<bk_> at least i think that should be correct
<bk_> i'm sorry i don't know drWorm, something required for the build process seems to be missing, i can't tell you what tho
<bk_> i havent had that problem
<drWorm> oh well
<Maddas> hm
<Maddas> can't a match return more than one type?
<Maddas> or rather, one of multiple types :)
<Maddas> type operator = Plus | Minus | Multiply | Divide | Modulo;; type action = Store | Recall;;
<Maddas> let translate c = match c with '+' -> Plus | '-' -> Minus [...] | 'S' -> Store | 'R' -> Recall
Hipo has joined #ocaml
bk_ has quit ["I'll be back"]
<Maddas> hm
shapr has joined #ocaml
<shapr> whee!
Xcalibor has quit [Read error: 60 (Operation timed out)]
drWorm has quit ["Client Exiting"]
Xcalibor has joined #ocaml
<Maddas> hm
<Maddas> anybody mind helping me debug a bit? :)
<Xcalibor> which bug?
shapr has quit [Read error: 60 (Operation timed out)]
lophty__ has joined #ocaml
lophty__ has quit [Client Quit]
<Maddas> oh
<Maddas> didn't see you :)
<Maddas> all that's important
<Maddas> the error is:
<Xcalibor> hi :)
<Maddas> This expression has type int -> int -> int but is here used with type
<Maddas> int -> (unit -> int) -> unit -> int
<Maddas> that's the line in which I call "apply ( + )"
<Xcalibor> okay.... let's see...
<Maddas> apply takes a function as a parameter and applies the function with calc.lcd and pop() as argument
<Maddas> s
<Maddas> both are integers
<Maddas> :)
<Xcalibor> i get "Unbound constructor Plus"
<Maddas> let me see
<Maddas> oh
<Maddas> bugger. I'll just paste the whole script
<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 :-)
<whee> http://smaerty.ath.cx/bf/ <- may or may not be useful
<whee> it's a brainfck interpreter that I think works :)
<whee> the thing is the entire evaluation is just an iteration over the input, and in your case your entire thing would be the same
<whee> except you'd have a stack to return, so a fold would be more useful
<Maddas> ok
<Maddas> I'll check it out, thanks
<Maddas> getting O'Caml source to learn from isn't too easy :-)
<Maddas> well, getting 'easy' source
<whee> I just think it'd be easier if you think of it from an interactive session perspective, with input coming from a stream
<whee> then you just run through the stream, passing the current stack and all along as state
<Maddas> I see
mrvn_ is now known as mrvn
matthieu_ has joined #ocaml
whee has quit [Read error: 110 (Connection timed out)]
<teratorn> hello, can anyone recommend an rfc822 (mail message) parser? (ocamlnet seems sorely unmaintained)
Riastrad1 has joined #ocaml
buggs|afk has joined #ocaml
Riastradh has quit [Read error: 113 (No route to host)]
buggs has quit [Read error: 60 (Operation timed out)]
buggs|afk is now known as buggs
whee has joined #ocaml
matthieu_ has quit [Remote closed the connection]
zack has joined #ocaml
brwill_zzz is now known as brwill
<async> /join #scheme
<Maddas> @_@
systems has joined #ocaml
mrvn_ has joined #ocaml
zack has left #ocaml []
mrvn has quit [Read error: 110 (Connection timed out)]
systems has quit [Read error: 110 (Connection timed out)]
srv has quit [Read error: 104 (Connection reset by peer)]
brwill is now known as brwill_busy
gl is now known as vect
systems has joined #ocaml
systems has quit [Read error: 60 (Operation timed out)]
vect has quit [Read error: 110 (Connection timed out)]