smimou changed the topic of #ocaml to: OCaml 3.08.3 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
cmeme has quit [Connection reset by peer]
cmeme has joined #ocaml
mlh has quit [Client Quit]
mrpingoo has quit []
smimou has quit ["?"]
mlh has joined #ocaml
mlh has quit [Client Quit]
mlh has joined #ocaml
[TSP]Aradorn is now known as Aradorn
cjohnson has joined #ocaml
Sonarman has joined #ocaml
<araujo> mmm...
<Aradorn> hmmm
<Aradorn> this chan is really quiet
<araujo> Indeed.
<araujo> Aradorn: got time to answer a question? :-)
<Aradorn> heh if i knew anything about ocaml mayb e=p
<Aradorn> i actually just started learning it a few days ago =p
<araujo> hah, ok
<araujo> well, for anyone here, how do i use streams in the repl?
<Aradorn> whats repl? =p
<Aradorn> im going to atleast learn something from your question heheh
<araujo> read-eval-print-lop
<araujo> read-eval-print-loop
<Aradorn> ahhh
<araujo> hah :-)
<Aradorn> stupid acronyms =p
<araujo> haha.. really, you guys don't know it?
* araujo is used to it from Lisp
<Aradorn> this is my first functional language so its taking me a bit to get used to. which is why i feel like such a newb lol
<araujo> That's good.
<araujo> im also sort of new to ocaml
<araujo> though not to functional languages.
<Aradorn> heh thats my problem
<Aradorn> functional programming is sooooo different to me
<Aradorn> its taking me a bit to wrap my brain around the concepts
<araujo> what languages do you program at?
<Aradorn> Java mostly
<araujo> oh i see
<Aradorn> i know a little C and C++
<araujo> well yes, it might be quite a different :-)
<Aradorn> =)
<Aradorn> im developing a search engine atm and one of my partners showed me ocaml and persuaded me to learn it
<araujo> Though Ocaml also implement imperative programming, i suppose that eases the learning process
<Aradorn> so we are now in the processes of rewriting our system from java to ocaml because of how much better functional languages are than imperative ones. and since ocaml can be compiled to native code its ALOT faster (natrually) than the java VM
<Aradorn> yeah
<araujo> Yeah, indeed
<araujo> Good to hear.
<araujo> Good to hear that, one less java application in this world :-)
<Aradorn> made our networking architechture MUCH easier but i still cant make heads or tails of it
<Aradorn> haha
<Aradorn> java is nice for what it is
<araujo> Really never found my way around it
<Aradorn> but im wishing my university offered 1 class in a functional language to show how powerful they are
<Aradorn> java's advantage is the API
<araujo> yeah, that'd be nice
<Aradorn> makes it very easy to learn and use all the tools you have
<araujo> really?
<Aradorn> yeah
<araujo> it always seemed pretty nasty to me :-/
<Aradorn> i mean if you wanted to know ANYTHING about the Integer class you can just goto the API and see all the methods, their parameters, their return types and what they do by the descriptions
<araujo> mm... well that isn't something that new
<araujo> i could do the same with smalltalk for example
<Aradorn> right but alot of langauges dont take advantage of it
<Aradorn> one thing i dont understand about ocaml is why modules like String arnt opened automatically like the pervasives module is
<araujo> Don't look at me , im also newb :-)
<Aradorn> Syntax that is added just for the sake of convenience, and not for any technical reasons, is called syntactic sugar. In OCaml, operators can be "de-sugared" by enclosing them in parentheses,
<Aradorn> rofl
<Smerdyakov> Aradorn, why would you want those modules opened automatically? The module name is part of the unique identifier for each of its contents.
<Smerdyakov> Aradorn, it's not like in C where you have libraryName_subLibraryName_function as an identifier within a .a file.
<Aradorn> i guess its just my imperative experience
<Smerdyakov> This is a completely orthogonal issue.
<Smerdyakov> It's your _C_ experience.
<Aradorn> java =P
<Smerdyakov> Java has the same thing.
<Smerdyakov> The methods in the String class aren't accessed just as the methods in the current class.
<Aradorn> in java i dont have to import the String class in order to use substring
<Smerdyakov> And, in OCaml, you don't have to "import" anything to use the String module.
<Aradorn> i can just call String j; j.substring(4);
<Aradorn> right but I still eithe rhave to say open String or call String.set or String.whatever
<Aradorn> instead of the string itself on those function
<Aradorn> its just a different style
<Smerdyakov> And you had to type String in your Java example above, also....
<Aradorn> to declare a strin gyes
<Smerdyakov> You never need that sort of declaration in OCaml.
<Smerdyakov> It evens out to a better mix, I'd say.
<Aradorn> right because its functional there is no assignment
<Smerdyakov> No; because ML has type inference.
<Aradorn> ok i dont understand something
<Aradorn> if i do let rec length = function
<Aradorn> [] -> 0
<Aradorn> | (x::xs) -> 1 + length xs;;
<Aradorn> why do i cons x with a list?
<Aradorn> x::xs what does this do? (i thought i added the element x to the list xs)
<Smerdyakov> Are you reading through a tutorial or just looking at random code?
shammah has quit ["Leaving"]
<Aradorn> reading a tut
<Aradorn> dosnt actually explain why it took out the match case and put in function instead
<Aradorn> just says you cant
<Aradorn> er can
<Aradorn> and the list question is a byproduct =p
<Smerdyakov> Look for discussion on "pattern matching."
<Aradorn> thats what im reading
<Smerdyakov> Then it should explain exactly what this all means.
<Aradorn> nope.. gah oh well
<Aradorn> ill ask my friend tomorrow
<Aradorn> do parameteres have a specific depth they can go before they need to be given again?
<Aradorn> like if i declare a function p (x:int) = let j = 0 in let b = 2*j*x in let c x = j*x*x in (b,c)
<Aradorn> in the function c do i need to declare that x param or is it understood from the global scope of the top function p
<mrvn> You are declaring a new x distinct from the top level one.
<Aradorn> ah so its scope changes
<mrvn> let p x = let j = 0 in let b = 2*j*x in let c y = j*y*y in (b,c)
<mrvn> That's what you wrote.
<mrvn> You are shadowing a previous parameter.
<Aradorn> function p (x:int) = let j = 0 in let b = 2*j*x in let c x = j*x*x in (b,c x) is what im looking at (forgot the param of c in the end)
<mrvn> Still shadowing.
<Aradorn> k
<Aradorn> so its two different values used for x... right?
<mrvn> It's two different x used with the same value.-
<Aradorn> hrm ok...
<mrvn> The (b, c x) assigns x to x.
<Aradorn> gets kinda confusing =
<Aradorn> because it evaluates the last function in the scope first?
<mrvn> Don't shadow variables then.
<Aradorn> im not im learning, this example does it was trying to understand it
<mrvn> The first thing it evaluates is j, then b, then c and then the pair I believe.
<Aradorn> k
<Aradorn> there an easy way to do debug print lines on the top loop
_shawn has quit [Read error: 110 (Connection timed out)]
cjohnson has quit [Remote closed the connection]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 145 (Connection timed out)]
Aradorn has quit ["( www.nnscript.de :: NoNameScript 3.81 :: www.XLhost.de )"]
<araujo> how can i use streams?
Sonarman has quit [Read error: 110 (Connection timed out)]
<mflux> echo 'let s = [< '1, '2 >]' > foo.ml; ocamlc -pp camlp4o foo.ml
__DL__ has joined #ocaml
<araujo> Hello mflux
<araujo> mflux: i want to use it from the interactive loop
<mflux> I'm not sure if that's possible..
<mflux> hmm
<mflux> mkcamlp4 maybe
<araujo> mm...
<mflux> or not
<mflux> anyway, the web might know ;)
<mflux> #load "camlp4o.cma";;
<araujo> # load "calmp4o.cma";;
<araujo> Unbound value load
<mflux> in toplevel?
<mflux> # #load "camlp4o.cma";;
<mflux> Camlp4 Parsing version 3.08.2
<mflux> oh, you didn't realize # is required
<araujo> ooh :-P
<araujo> # #load "calmp4o.cma";;
<araujo> Cannot find file calmp4o.cma.
<mflux> sigh..
<mflux> caMLp4o.cma
<mflux> except in lowercase
<mflux> try copy'n paste from irc ;)
<araujo> # #load "caMLp4o.cma";;
<araujo> Cannot find file caMLp4o.cma.
<mflux> my point was that you wrote calmp4o.cma when you should've written camlp4o.cma
<mflux> it shouldn't be this tough to get the point through..
<mflux> so I made a failed attempt at highlighting the change in my version
<araujo> # #load "camlp4o.cma";;
<araujo> Camlp4 Parsing version 3.08.3
<araujo> haha
<araujo> Thanks mflux
<mflux> happy experimenting
<mflux> streams are cool ;)
<mflux> too bad there isn't a wide standard library using them
<araujo> haha, yeah, just playing around with the concept :-)
<araujo> im reading they are good to implement infinite data structures.
<mflux> like List.combine with streams & lists could be useful, as could be range low high
<mflux> fortunately they can all be easily written by oneself, but standard solution is nice ;)
<araujo> :-)
<araujo> they aren't part of the core language are they?
<mflux> streams sort of are detached from the core by using the preprocessor facilities
<mflux> there is the Stream-module though
<mflux> but it has only iter
<araujo> ok
<mflux> (well and number of other specific-to-streams-stuff)
pango__ has quit [Remote closed the connection]
shawn_ has joined #ocaml
Herrchen has joined #ocaml
mlh has quit [Client Quit]
<ulfdoz_> re
mlh has joined #ocaml
mlh has quit [Client Quit]
mrvn_ has joined #ocaml
mrvn has quit [Read error: 60 (Operation timed out)]
Submarine has joined #ocaml
Snark has joined #ocaml
<Snark> slt
bzzbzz has quit ["leaving"]
mlh has joined #ocaml
Submarine has quit ["Leaving"]
Submarine has joined #ocaml
b00t has joined #ocaml
vezenchio has joined #ocaml
smimou has joined #ocaml
Submarine has quit ["Leaving"]
b00t has quit [Remote closed the connection]
inka has joined #ocaml
inka has left #ocaml []
vezenchio has quit [Read error: 110 (Connection timed out)]
Tachyon76 has joined #ocaml
vezenchio has joined #ocaml
mlh has quit [Client Quit]
_fab has joined #ocaml
Bonedigger has joined #ocaml
Bonedigger has quit [Read error: 104 (Connection reset by peer)]
_fab has quit []
[TSP]Aradorn has joined #ocaml
Snark has quit [Read error: 113 (No route to host)]
[TSP]Aradorn has quit ["( www.nnscript.de :: NoNameScript 3.81 :: www.XLhost.de )"]
Herrchen has quit ["bye"]
[TSP]Aradorn has joined #ocaml
[TSP]Aradorn is now known as Aradorn
Aradorn- has joined #ocaml
Aradorn- has quit [Remote closed the connection]
Snark has joined #ocaml
<Snark> slt
cjohnson has joined #ocaml
Tachyon76 has quit [Remote closed the connection]
<bk_> lt
<araujo> hl
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
_JusSx_ has joined #ocaml
Submarine has joined #ocaml
cjohnson has quit [Read error: 110 (Connection timed out)]
cjohnson has joined #ocaml
Aradorn has quit ["( www.nnscript.de :: NoNameScript 3.81 :: www.XLhost.de )"]
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
vodka-goo has joined #ocaml
* Snark would need ocaml-gettext and an ocaml-gconf :)
<mflux> ocaml-gettext on google finds something
<mflux> ocaml-gconf doesn't ;)
<Snark> mflux: there is an ocaml-gettext, though not packaged for debian (yet)
<Snark> and I fear there's no gconf binding
<mflux> how complicates is interfacing with gconf anyway, is the library mandatory?
<mflux> s/tes/ted/
<Snark> I don't need a full binding, so perhaps I can get away with a little .c
<mflux> say, anyone hasn't happened to bump into gnutls ocaml bindings?
<Snark> no idea
<Snark> good night
Snark has left #ocaml []
<mflux> good night
<mflux> what was that bindings generator thingy's name?
<mflux> ah, swig
pango has joined #ocaml
j_n_ is now known as visitor_q
<dan2> mflux: it creates horrible bindings for ocaml
<dan2> _HORRIBLE_
<mflux> oh, well
<mflux> judging from the documentation swig must've required great effort
<mflux> I didn't think one would directly use those bindings, but again write another set of bindings for those in ocaml ;)
<mflux> I've done some manual bindings, and that work gets boring real fast
<mflux> hm, the qt example seems neat enough
<mflux> let hello = new_QPushButton '("hi",0);; hello -> resize (100,30);; hello -> show () ;;
<mflux> heck, even swig's documentation has required quite some effort ;)
<mflux> I must admit I haven't heard anyone saying anything particularly good about swig
<mflux> but I do imagine it is the only one of its kind?
vezenchio has quit ["Ayn Rand encapsulates the rage that every teenager feels on finding that his first paycheque has had taxes taken out of it"]
vezenchio has joined #ocaml
_fab has joined #ocaml
angagon has quit ["Download Gaim: http://gaim.sourceforge.net/"]
angagon has joined #ocaml
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
<araujo> Hello
<smimou> mflux: I have an openssl binding (but no gnutls)
Aradorn- has joined #ocaml
Gueben has joined #ocaml
TeXitoi has joined #ocaml
Gueben has quit [Client Quit]
Aradorn- has quit ["( www.nnscript.de :: NoNameScript 3.81 :: www.XLhost.de )"]
__DL__ has quit [Remote closed the connection]
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
Bonedigger has joined #ocaml
Bonedigger has quit ["Leaving"]
vezenchio has quit ["Ayn Rand encapsulates the rage that every teenager feels on finding that his first paycheque has had taxes taken out of it"]
_JusSx_ has quit ["leaving"]
vodka-goo has quit ["dodo"]
angagon has quit [Read error: 110 (Connection timed out)]
bk_ has joined #ocaml
cjohnson has quit [""We live like penguins in the desert...""]
Aradorn has joined #ocaml
mlh has joined #ocaml