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
<Smerdyakov> What's the proper way to let ocamlopt know about the interface of a library I want to use?
Riastrad1 has joined #ocaml
Riastradh has quit [Read error: 60 (Operation timed out)]
Riastrad1 is now known as Riastradh
polin8 has joined #ocaml
jdrake has joined #ocaml
jdrake has quit [Read error: 104 (Connection reset by peer)]
jdrake has joined #ocaml
rpr has joined #ocaml
<jdrake> could anyone explain to me how a nested function such as 'let sum i = let sum2 j = i + j in sum;;' could actually work when passed two parameters?
<whee> that one won't
<whee> I think you mean let sum = function i -> function j -> i + j or some such
<whee> or, maybe that would work
<jdrake> i am looking in that book.pdf that is 109 pages long
<whee> what you typed wouldn't work because of scoping issues, though
<jdrake> oops, problem.. change it to 'in sum2;;'
<whee> okay, that makes more sense then
<whee> you're defining a function sum that accepts one argument, and returns a function sum2, which also accepts one argument, and evalulates to an int when it's all over
<jdrake> i think i am seeing it sort of now
<whee> functions are just like anything else
<whee> you could sortof type sum as (int) -> (int -> int) if that helps you see it in this situation better
<whee> I don't know if that's valid, but whatever :)
<jdrake> no! DON'T break down my 'C' wall!
<teratorn> yes!
<jdrake> that is sort of better whee
<whee> haha, oh boy
<whee> # let rec sum i = let sum2 j = i + j in sum;;
<whee> val sum : int -> 'a as 'a = <fun>
<whee> I don't even know what this could possibly do :P
<whee> just seems to continuously return int -> 'a functions :(
<jdrake> i am trying to gradually get upto the point where I can write simple ocaml programs
<Smerdyakov> Can I get at the C tmpnam() function easily in OCaml?
<Smerdyakov> As in, is there already an OCaml version in the standard library?
<Smerdyakov> whee, that code won't compile for me. I think you have some bizarre extra-permissive settings in effect. :P
buggs is now known as buggs|afk
Xcal has joined #ocaml
Xcalibor has quit [Read error: 60 (Operation timed out)]
polin8 has quit [Read error: 110 (Connection timed out)]
mrvn__ has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
mrvn has joined #ocaml
jdrake has quit ["Oops. This machine just fell asleep"]
mrvn has quit [Read error: 60 (Operation timed out)]
mrvn__ has quit [Read error: 110 (Connection timed out)]
mrvn has joined #ocaml
rpr has quit [Remote closed the connection]
__DL__ has joined #ocaml
mattam_ has quit [zelazny.freenode.net irc.freenode.net]
teratorn has quit [zelazny.freenode.net irc.freenode.net]
Riastradh has quit [zelazny.freenode.net irc.freenode.net]
foxster has quit [zelazny.freenode.net irc.freenode.net]
Hipo has quit [zelazny.freenode.net irc.freenode.net]
Nate1975 has quit [zelazny.freenode.net irc.freenode.net]
brwill_zzz has quit [zelazny.freenode.net irc.freenode.net]
rox has quit [zelazny.freenode.net irc.freenode.net]
whee has quit [zelazny.freenode.net irc.freenode.net]
vegai has quit [zelazny.freenode.net irc.freenode.net]
vect has quit [zelazny.freenode.net irc.freenode.net]
buggs|afk has quit [zelazny.freenode.net irc.freenode.net]
Xcal has quit [zelazny.freenode.net irc.freenode.net]
__DL__ has quit [zelazny.freenode.net irc.freenode.net]
srv has quit [zelazny.freenode.net irc.freenode.net]
jdmarshall has quit [zelazny.freenode.net irc.freenode.net]
Maddas has quit [zelazny.freenode.net irc.freenode.net]
cm has quit [zelazny.freenode.net irc.freenode.net]
wax has quit [zelazny.freenode.net irc.freenode.net]
karryall has quit [zelazny.freenode.net irc.freenode.net]
__DL__ has joined #ocaml
Xcal has joined #ocaml
Riastradh has joined #ocaml
buggs|afk has joined #ocaml
foxster has joined #ocaml
whee has joined #ocaml
mattam_ has joined #ocaml
karryall has joined #ocaml
Hipo has joined #ocaml
srv has joined #ocaml
Nate1975 has joined #ocaml
jdmarshall has joined #ocaml
teratorn has joined #ocaml
rox has joined #ocaml
brwill_zzz has joined #ocaml
vect has joined #ocaml
vegai has joined #ocaml
cm has joined #ocaml
wax has joined #ocaml
Maddas has joined #ocaml
jdmarshall has quit []
Kinners has joined #ocaml
teratorn has quit [zelazny.freenode.net irc.freenode.net]
teratorn has joined #ocaml
<Xcal> hiyas
det has joined #ocaml
polin8 has joined #ocaml
det has quit ["TE) (Swing them udders"]
Kinners has left #ocaml []
atom-z has joined #ocaml
<atom-z> does ocaml have monads?
themus has joined #ocaml
<Smerdyakov> There is no monad support in the standard library or language, but you're free to code such yourself.
<atom-z> ah ok
<atom-z> thanks
<atom-z> (to be honest i dont like monads (yet))
<Smerdyakov> You don't like to know by looking at the type of a function whether it will have "side effects" when you call it?
karryall has quit [Read error: 110 (Connection timed out)]
<atom-z> Smerdyakov: probably, but when i was trying to learn haskell, monads seemed to get in the way and stop me from using things i was used to (i.e. head and tail)
* Xcal is learning about monads right now... they seem to be very powerful
Xcal is now known as Xcalibor
Xcalibor has quit [Read error: 54 (Connection reset by peer)]
Xcalibor has joined #ocaml
<Maddas> Hm. Is there any way to use ncurses with O'Caml?
<Maddas> Or any other way to create something similar?
<Xcalibor> no idea, sorry
<Maddas> Dang. There is something which stopped being compatible with O'Caml since 3.04, isn't maintained and stalled at version 0.0
<Xcalibor> Maddas: there you have a nice project for you to take ;-)
<Maddas> heh, I hardly know any C at all.
<Maddas> :-(
<Maddas> I wanted to write one or two things with ncurses though, to get a hang of it and ocaml.
<Maddas> does ocaml support Closures?
<Maddas> O'Caml, even
<Maddas> Ugh, I'm pretty sure, but I'm doing something wrong trying to replicate simple code from an other language.
<Maddas> Anybody mind giving me a helping hand?
<Riastradh> Yes, OCaml has closures.
<Riastradh> No decent functional language doesn't.
<Riastradh> No decent functional language that has lambda, that is.
<Maddas> Yes, I understand that. I'm doing something very simple very wrong though.
<Maddas> I'm trying to implement something like the javascript here: http://juerd.nl/jsclosure.html
<Maddas> It's terribly simple.
<Maddas> I think what I need is a function that returns a function which returns x + 1
<Riastradh> let make_counter n = let n' = ref n in fun () -> incr n'; !n' end
<Maddas> Heh. Thanks. I'll study that for a bit.
<Maddas> Ah, I was missing fun (). I tried to do things with just fun ->, but that obviously wouldn't work. Thanks again :-)
jdmarshall has joined #ocaml
<Maddas> Hm. Riastradh, is there an easy way of achieving that without using references?
brwill_zzz is now known as brwill
<Riastradh> No.
<Riastradh> What's wrong with references for that use?
<Maddas> Ok, thanks.
<Maddas> Nothing, I was just wondering.
<Maddas> :-)
<Maddas> I guess I might really need a good book on certain concepts of functional programming.
<Xcalibor> Maddas: I am reading Richard Bird's _Intro to FP with Haskell, 2nd Ed._ and it's being a very nice experience
<Maddas> I see.
<Maddas> I'd prefer concentrating on O'Caml though, because I'm distracted enough already :-)
<Maddas> Maybe I'll finish the SICP.
<Xcalibor> SICP?
<Maddas> Structure and Interpretation of Computer Programs. Google, it's available on the web.
<Xcalibor> ah... is the one written in Oz?
<Riastradh> The URL is hard-coded into most Schemers' brains.
<Riastradh> No, it uses Scheme.
<Maddas> :-)
<Xcalibor> ah, i see... i seem to recall about it, yes
<Riastradh> It has nothing to do with Oz; Oz has nothing to do with it.
<Maddas> I was partly through, then stopped reading, now I lost knowledge of much.
<Xcalibor> scheme is nice as well
<Maddas> Maybe I should focus on Scheme while reading, and do the examples, and only then try to learn O'Caml.
<Maddas> That might be easier and teach me just as well.
<Maddas> If not even better
<atom-z> whats scheme?
<Riastradh> It was the first language with proper TCO; it was the first Lisp with lexical scope.
<atom-z> ah its a lisp?
<Xcalibor> a dialect of lisp, or a brtanch of he lisp tree family
<Xcalibor> it has a single namespace, lexical scoping, proper tail optimization, and hygienic macros
<Xcalibor> and hundreds of implementations...
<atom-z> ic
<Xcalibor> its very nice and elegant, it has a small, simple core... very nice
<Riastradh> No, not a 'single namespace.'
<Riastradh> Functions don't have their own namespace.
__DL__ has quit [Read error: 60 (Operation timed out)]
__DL__ has joined #ocaml
clam has joined #ocaml
Xcalibor has quit ["Terminando cliente"]
__buggs has joined #ocaml
clam has quit [Read error: 110 (Connection timed out)]
buggs|afk has quit [Read error: 110 (Connection timed out)]
mellum has joined #ocaml
<mellum> hi
foxster has quit [Client Quit]
clam has joined #ocaml
bell7 has joined #ocaml
<bell7> There is out there any "code styling suggestion" for ocaml?
atom-z has quit ["Client Exiting"]
<bell7> tnx
clam has quit [Read error: 110 (Connection timed out)]
bell7 has quit ["Download Gaim: http://gaim.sourceforge.net/"]
jdrake has joined #ocaml