dark_light changed the topic of #ocaml to: OCaml 3.09.2 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/
joshcryer has quit [Read error: 104 (Connection reset by peer)]
EsotericMoniker has left #ocaml []
CosmicRay has joined #ocaml
CosmicRay has quit ["Client exiting"]
jcreigh has joined #ocaml
jcreigh has quit ["Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet."]
Revision17 has joined #ocaml
dleslie is now known as danly
d-bug has joined #ocaml
hikozaemon has joined #ocaml
shekmalhen has joined #ocaml
slipstream has joined #ocaml
piggybox has quit []
slipstre1m-- has quit [Connection timed out]
tristram has joined #ocaml
piggybox has joined #ocaml
khaladan_ has joined #ocaml
khaladan has quit [Connection timed out]
khaladan_ is now known as khaladan
clconway has joined #ocaml
clconway has left #ocaml []
scriptdevil has joined #ocaml
<scriptdevil> how old or how new is OAML?
scriptdevil has quit [Client Quit]
scriptdevil has joined #ocaml
scriptdevil has left #ocaml []
scriptdevil has joined #ocaml
scriptdevil has left #ocaml []
youknow365 has quit ["Konversation terminated!"]
shekmalhen has quit ["b.."]
postalchris has joined #ocaml
mnemonic has joined #ocaml
mnemonic has quit [Client Quit]
smimou has joined #ocaml
ookk has joined #ocaml
pattern has quit [Connection reset by peer]
pattern has joined #ocaml
Snark has joined #ocaml
Kai1111 has joined #ocaml
<ookk> can i use an array in a functional way?
<ookk> when i want to pass the array to another function with just one value in it changed
<postalchris> ookk, perhaps you can clarify your question with an example?
<postalchris> an array is a sort-of fundamentally non-functional structure, since it's modifiable in-place
<ookk> i would like to pass an array in a recursive function with one value changed
<ookk> and i was wondering if there was a function that returned the same array with one value at index i changed
hcarty has joined #ocaml
<ookk> thats not dog-slog
<ookk> slow*
<postalchris> Isn't that function "a.(i) <- new_value"?
d-bug has quit [Read error: 60 (Operation timed out)]
<postalchris> Or you mean, you want a copy of a?
<ookk> that is imperative
<zmdkrbou> ookk: what's the point of using an array if you pass it like a list and process it functionnally ?
<ookk> that statement doesnt return a new array with the position at index i changed to new_value
<zmdkrbou> let _ = a.(i) <- new_value in a
<ookk> zmdkrbou, because i want a fixed length
<ookk> zmdkrbou, doesnt that return unit?
<ookk> a.(i) <- value
<zmdkrbou> nope, it returns a
<ookk> okay then it should not be considerd imperative imo
<zmdkrbou> this is equivalent to "a.(i) <- new_value ; a"
<zmdkrbou> but i don't get the fixed-length thing
<zmdkrbou> if you don't add elements, a list also has a fixed length
<ookk> yeah i guess it doesnt matter
<ookk> i just want a functional way of passing a list, array whatever to a function with one value changed
hikozaemon has quit ["Leaving..."]
<ookk> i guess i could write a function that does that to a list
<ookk> but i feel it would be slower then an imperative approach
<Dylan> ookk: do you mean map?
<ookk> and i want to learn to make fast programs the functional way, that why im interested in ocaml :P
<ookk> Dylan, doesnt that have unessesary overhead?
<ookk> with it using keys
<Dylan> um
<Dylan> I mean List.map
<Dylan> List.map : ('a -> 'b) -> 'a list -> 'b list
<postalchris> Still requires "imperative" counting to find the index.
<Dylan> you want to change it based on the index?
<ookk> i was thinking:
<ookk> let modify lst i value =
<ookk> match lst with
<ookk> | head::tail -> if i == 0 then value :: tail else head :: modify tail (i-1) value
<ookk> ;;
<Dylan> You could use a fold_left, probably... But if you want to escape imperative this much, ocaml's not for you
<ookk> i dont have anything againt imperative i code c++ normally, i just want to explore the functional possibilites before i revert to the imperative way
<ookk> maybe i could use a map beacuse i use the index as a key
<Dylan> well, wanting to change an item based on an index in an array is still imperative thinking
* zmdkrbou agrees with that
<ookk> but i got the feeling that map is much slower than using an array where elements lie next to eachother in the memory
<postalchris> ookk: List.fold is your "most functional" solution given the way you've posed the problem
<Dylan> for sequential access, a list is very fast.
<ookk> Dylan, well the function i pasted is not imperative
<postalchris> ookk: do you want to program functionally, or think about memory layout ;-)
<ookk> hehe i cant not think about it :P
<ookk> you cant be to naive about what happens to you code :P
<Dylan> arrays are good for *random* access, but linked lists are good for sequential
<ookk> yes
<ookk> but this is very random
<ookk> so there is no efficient way of doing random access in a functional way?
<zmdkrbou> ookk: to program in a functional way, you *have* to forget about low-level
<postalchris> ookk: let me re-read Okasaki and get back to you...
<ookk> heh
<zmdkrbou> "being next to another element in memory" doesn't mean anything in the functional world
<ookk> zmdkrbou, well if you are concerned about speed you cant forget about low level
<zmdkrbou> nope, you have to trust the implementation :)
<ookk> hehe yeah i guess you do
<ookk> but as i am used to c++ where you ususally can guess in what happens in the low level
<ookk> to not use if-statements because of branching and all that :P
<zmdkrbou> either you take functional programming as it is, or you stick to c/c++ & co, imo
<ookk> yeah i have discovered a lot of good stuff about funcitonal programming
<zmdkrbou> (if i'd be looking for speed, i wouldn't use functional programming)
<ookk> my main dissapointment is arrays though but ocaml supports the imperative way so i guess it doesnt matter
<ookk> problably not if you want to do something with large arrays of data
<ookk> but i have heard that ocaml is pretty fast at stuff more appropriate for functional programming
pattern has quit ["Reconnecting to server - dircproxy 1.1.0"]
pattern has joined #ocaml
<ertai> ookk: you can use a map to do random access in a functional way
mwc has joined #ocaml
smimou has quit ["bli"]
kral has joined #ocaml
mwc has quit ["Leaving"]
khaladan_ has joined #ocaml
postalchris has left #ocaml []
d-bug has joined #ocaml
khaladan has quit [Connection timed out]
khaladan_ is now known as khaladan
Nanomon has joined #ocaml
Nanomon has left #ocaml []
Nanomon has joined #ocaml
kral has quit [Remote closed the connection]
_jol_ has joined #ocaml
finelemon has quit [Read error: 110 (Connection timed out)]
finelemon has joined #ocaml
EsotericMoniker has joined #ocaml
_jol_ has quit ["temci lo nu citka"]
youknow365 has joined #ocaml
<youknow365> anyone up
<zmdkrbou> yep
<youknow365> you ever work with LablGTK
<zmdkrbou> nope
<youknow365> i seeeeeeeee
<zmdkrbou> ?
<youknow365> i jus had a small problem
<youknow365> you ever do any socket work in Ocaml ?
<zmdkrbou> yep
<youknow365> yea thats what im going to have ot do next
<youknow365> to*
<youknow365> make a connection to jabber server and parse the response (XML)
<youknow365> zmdkrbou: do you know the na,e of that package manager thing for ocaml libs ?
Nanomon has quit [Nick collision from services.]
Nanomon has joined #ocaml
<zmdkrbou> ocamlfind ?
<youknow365> yea
<youknow365> you ever knwo if there was an ncurses for ocaml ?
<zmdkrbou> i think there isn't any
<youknow365> i remember seeing it somewhere
<youknow365> you ever use ncurses ?
<zmdkrbou> never programmed with it
<youknow365> found it looks pretty complete
<hcarty> youknow365: I don't know if it will be of any use, but I think wyrd uses ncurses. I don't know how it is wrapped though.
<youknow365> wryd ?
_jol_ has joined #ocaml
<youknow365> how hard should it be to create a small im client using LablGTK and XML light for the parsing .........alli need is buddy list and im
<zvrba> you're asking that same question for a week.. give it up already.
<youknow365> naaaw
<youknow365> 2 days
<youknow365> zvrba: but i been working on other stuff
<Dylan> more than 2 days...
<youknow365> well its going to be my first project in ocaml
<youknow365> i will start tonight
<Dylan> On june 13th, june 16th, june 17th, august 4th, august 9th, and today (august 11th).
<Dylan> assuming Chea_* and Wizz_Kidd* are also you. :)
<youknow365> i didnteven know about ocaml in june lol
<youknow365> negative
<Dylan> really?
<youknow365> i know who WIzz is
<youknow365> buuut
<youknow365> no chea
<youknow365> wizz is a guy who told me about ocaml he lives by and recomended me ot do it in Ocaml
<youknow365> the im client
<Dylan> He's also interested in making one, apparently
<Dylan> perhaps he could help you.
<youknow365> welll i dunno
<youknow365> havent talkded to him in a while
<Dylan> 2006/06/16/freenode/#ocaml.log:20:25 <Wizz_Kidd> you know I was making a IM client
Snark has quit [Read error: 110 (Connection timed out)]
Snark has joined #ocaml
<Dylan> 2006/06/16/freenode/#ocaml.log:20:34 <Wizz_Kidd> but i am going ot use ocaml to make my im client
<youknow365> well i do not know about that
<youknow365> i jus got the idea a little while ago
<Dylan> it's understandable that people would confuse you with WizzKid, as you seem to share the same IP.
<youknow365> we do not share the same ip
<youknow365> Dylan: lying is not good
<Dylan> Well, same subnet.
<youknow365> im sure about 10 million others that do
<Dylan> easy to confuse cpe-71-65-54-108.insight.res.rr.com and cpe-71-65-49-221.insight.res.rr.com
<youknow365> again abouyt 10 other million do also
<Dylan> Chea's IP is yours, though.
<youknow365> no it is not
<youknow365> i dont ever remember having a username by the name iof chea
<Dylan> 2006/08/09/freenode/#ocaml.log:13:25 -!- Chea_544 [n=sdfsgfdg@cpe-71-65-49-221.insight.res.rr.com] has joined #ocaml
<Dylan> 2006/08/10/freenode/#ocaml.log:12:26 -!- youknow365 [n=dffggfg@cpe-71-65-49-221.insight.res.rr.com] has joined #ocaml
<youknow365> cpu names are different
<youknow365> i use a shared connection ......
<Dylan> I figured as such
<Dylan> like a work place or something. :)
<youknow365> more like a univercity
<Dylan> well, a shared residential connection for a dorm or something, I figured.
<Dylan> Probably a uni that teaches ocaml? ;)
<youknow365> Dylan: actually yes
<Dylan> I'd feel really bad if 'dffggfg
<Dylan> ' and 'sdfsgfdg' were real usernames...
<Dylan> Bad for the administrator, anyway. XD
<youknow365> Dylan: actually random login
<Dylan> CGI:IRC?
<youknow365> Dylan: you have many god points but its still clear that chea is not me
* Dylan nods
<Dylan> still a strange coincidence, three people from the same area wanting to write an IM client
<youknow365> not at all
<youknow365> look in the c++ channel about 60 from my area
<youknow365> fopr the google summer of code the univ wanted people to make an im client and alot of ppl signed up for it
<youknow365> although im want oto do it for a different reason
<Dylan> Ah, now that makes sense.
<youknow365> and ocaml is very pushed at this place
<youknow365> i was just trying to save time
<youknow365> Dylan: i am tied between using ocaml and or lua
<Dylan> Lua is not... an application language
<youknow365> then what is it
<Dylan> a very small scripting language?
<youknow365> yes used for applications i am pretty sure
<Dylan> Not to write applications *in* though
<Dylan> as an extension language, that's passable.
<Dylan> ocaml / lua is apples / underpants.
<Dylan> they're not for the same thing.
Nanoman has joined #ocaml
_jol_ has quit ["co'o rodo"]
Snark has quit ["Leaving"]
robajs has joined #ocaml
Nanomon has quit [Read error: 110 (Connection timed out)]
<youknow365> Dylan: would i save time doing it in something like python or ruby or would it be about the same for ocaml
* Dylan shrugs
<Dylan> I have nooo idea
<youknow365> well iw ould like to get it done fast but also the best way so i dont suffer from anything later on
robajs has quit ["Make it idiot proof and someone will make a better idiot."]
<zvrba> the only thing you suffer from are serious illusions ...
<zvrba> *shrug*
<youknow365> let hentry = gethostbyname "coltrane" in
<youknow365> when you use this what do you put in the place of coltrane ?
<youknow365> obviously im trying to get my owm ip
tristram has quit [Read error: 60 (Operation timed out)]
khaladan_ has joined #ocaml
ookk has quit ["This computer has gone to sleep"]
khaladan has quit [Connection timed out]
khaladan_ is now known as khaladan
piggybox has quit []
piggybox has joined #ocaml
hcarty has quit ["Download Gaim: http://gaim.sourceforge.net/"]
<youknow365> wtf
<youknow365> let client_sock = socket PF_INET SOCK_STREAM 0 in
<youknow365> how is this a syntax error
<youknow365> and what does this mean
<youknow365> Error while linking tcp.cmo: Reference to undefined global `Unix'
bzzbzz has joined #ocaml