Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
docelic has quit ["Client Exiting"]
Yurik has joined #ocaml
<Yurik> re
<Yurik> got disconnected :(
<Yurik> so how sml vs ocaml dispute was ended?
<lament> Yurik: we all agreed that ocaml sucks ;)
<lament> (kidding)
<whee> yes
<whee> heh
<jemfinch> whee: yeah, the shootout isn't really a valid comparison.
<jemfinch> they put a lot of useless boilerplate code in the SML programs that isn't really necessary. Aside from that, the SML coders used a much more verbose (read: readable) coding style.
jemfinch has quit ["Client Exiting"]
jemfinch has joined #ocaml
<jemfinch> they put a lot of useless boilerplate code in the SML programs that isn't really necessary. Aside from that, the SML coders used a much more verbose (read: readable) coding style.
<Yurik> lament: :)))))))
<whee> I'm not finding lazy lists or some equiv in sml/nj :|
<jemfinch> in fact, if you look at the O'Caml code, it's coded specifically to be compact, to inflate its "lines of code" ranking.
<Yurik> in fact, i strongly believe that sml is more an educational language
<whee> sml and ocaml are largely the same anyway, feature wise
<whee> in which case I'll take the faster one, which is ocaml :D
<jemfinch> O'Caml definitely has the edge in features.
<Yurik> but actually they're different
<jemfinch> polymorphic variants, classes, polymorphic recursion, camlp4, etc.
<jemfinch> I just don't really want any of that, and I think it makes the code uglier.
<jemfinch> (I wouldn't mind polymorphic variants, but I'd much prefer the equivalent of Haskell's Dynamic type in SML)
<Yurik> basing on common ML, ocaml is more close to industry and provdides with good features
<Yurik> including w/ that that jemfinch have listed
<jemfinch> Yurik: I don't think you have much basis to say that, though -- for instance, when it came around to doing Y2K testing, it was SML and its Ckit that did it, not O'Caml.
<jemfinch> whee: I'll show you how to do lazy lists in SML in just a sec.
<Yurik> jemfinch: i don't have such an info
<Yurik> for the purpose of comparison I'd like to look at apps made in ocaml and sml
<Yurik> ocaml ones seems to be more practical
<jemfinch> I don't necessarily agree, I think both languages are really in the "we don't have very many libraries" period.
Yurik_ has joined #ocaml
<Yurik_> re
<Yurik_> got disconnected again :( sorry
<jemfinch> I like that SML doesn't rely on exceptions and returns option types a lot; I like that its strings are immutable.
<Yurik_> for the purpose of comparison I'd like to look at apps made in ocaml and sml
<Yurik_> ocaml ones seems to be more practical
<Yurik_> and ocaml wins ICFP ;)))
<jemfinch> yeah, I saw that :)
<whee> heh
<jemfinch> there was only one SML entry, and it was in the top ten, even though it was made by mere students :)
<jemfinch> O'Caml is definitely "cooler" than SML in the popular opinion.
<Yurik_> as i know, ocaml has practical appliance
<Yurik_> sml hasn't suhc
<Yurik_> sml hasn't such
<lament> hm, this begins to remind me of scheme/cl wars
<Yurik_> flame wars rules? ;)))
<whee> how can there be a war versus those
<jemfinch> Yurik: SML doesn't have practical application? What do you call the CKit? It's tested million-line codebases for Y2K bugs. It's an entire parser/lexer/typechecker for C.
<whee> I always see a clear distinction between those :|
<whee> jemfinch: right, but that's one application
<jemfinch> It's used for ml-nlffigen, which *automatically* generates FFI modules for C code.
<whee> I could go and point at that version of doom or quake that was written in ocaml and say the same thing
<Yurik_> actually SML and ocaml are both ML languages, but as for practice ocaml succeed
<jemfinch> whee: and where has O'Caml been used in the industry to do tasks on the level of parsing million line codebases?
<Yurik_> jemfinch: ocaml has more applications
<jemfinch> Yurik: Does it? I really don't think so.
<jemfinch> not more significant applications.
<whee> jemfinch: and where has SML been used in simulation of circuits? (not that ocaml has, but still)
<Yurik_> jemfinch: even including some apps, not libs
<whee> you can't base it on one thing
<Yurik_> jemfinch: CIL?
<Yurik_> jemfinch: ActiveDVI?
<jemfinch> whee: but what are you basing the argument that O'Caml is used industrially on?
<jemfinch> Yurik: what's CIL?
<whee> I'm not saying that it is being used, I'm saying that it's as least as capable of it as SML
<Yurik_> jemfinch: and so on. I produce as many ocaml apps now as i can
<Yurik_> jemfinch: soon ocaml community will get \muWEV
<jemfinch> whee: I'm not claiming that O'Caml is *less* capable than SML.
<Yurik_> jemfinch: soon ocaml community will get \muWEB
<jemfinch> whee: only that SML is just as capable.
<Yurik_> jemfinch: C parser, structure lib
<jemfinch> and certainly not "academic"
<jemfinch> Yurik: it'll only be 3-4 years after SML's had it :)
<Yurik_> SML *is* an academic language
<whee> right, but its range of application is a a bit more restricted than ocaml
<jemfinch> Yurik: you have absolutely *NO* basis for saying that.
<whee> ocaml easily expresses imperative things, where SML may have problems
<whee> and we all know the industry is imperative at the moment
<Yurik_> jemfinch: haha
<jemfinch> O'Caml is *far* more an academic language than SML. SML is focused on staying stable for industrial users; O'Caml adds a new theoretical feature every other minor release!
<Yurik_> jemfinch: in term of the year or so you'll hear about big industrial application of an ocaml
<jemfinch> whee: how could SML have any trouble expressing imperative things?
<whee> I don't know
<jemfinch> Yurik: I've already heard of big industrial applications in SML.
<whee> heh
<Yurik_> jemfinch: which one?
<lament> actually
<lament> ocaml is less academic
<lament> i have proof
<lament> my father has heard of it :)
<whee> haha
<Yurik_> lament: :))))))
<jemfinch> whee: there *are* places where SML is more capable than O'Caml -- for instance, it offers first-class continuations, and thus a fully preemptive threading system.
<whee> but how important is that in the industry?
<jemfinch> Yurik: several applications based on CKit. FoxNet, an entire operating system and webserver written in SML.
<whee> first class continuations are an academic feature atm
<lament> jemfinch: hm, tell that to dash
<whee> they aren't exactly something everyone's familar with
<jemfinch> whee: first-class continuations? Well, the fact that SML has threading that's the same anywhere is a nice little benefit.
<Yurik_> jemfinch: and where it is used. i haven't heard of it
<Yurik_> jemfinch: ?
<jemfinch> lament: dash is a CLer. He'll automatically hate continuations. Continuations don't mix well with macros that CLers have grown used to.
<whee> http://caml.inria.fr/users_programs-eng.html some old list of things written in ocaml heh
<Yurik_> and look at humps ;)))
<jemfinch> Yurik: what were you doing in 1999 when all the banks and software companies were worrying about Y2K and trying to fix their software?
<whee> you can take any language and find an application done in industry for which it was used, jemfinch
<lament> jemfinch: he does point out some practical issues concerning them
<lament> they complicate things tremendously
<jemfinch> You guys don't have to convince me that software has been written in O'Caml. I used O'Caml *before* I learned SML. I *know* what's available for it. I keep up with it. I just don't like it as much as SML.
<Yurik_> jemfinch: i was doing my job ;)) but actually. even in this godforsaken Ukraine even bank specialists looks at caml
<jemfinch> lament: as far as I've seen, the practical issues have to do with continuations escaping from macros like with-open-file and such.
<jemfinch> lament: that doesn't apply to SML, obviously.
<Yurik_> and afaik some bank systems in france uses ocaml
<lament> jemfinch: continuations also complicate tail recursion
<jemfinch> SML seems to have gotten around that.
<lament> I don't remember the exact reasoning, dash would have a link
<jemfinch> lament: I've read a bit about it.
<lament> and of course complications in the implementation == slowdown
<jemfinch> lament: there are several papers explaining why heap-based continuations don't necessitate slowdown, I'm sure you can find some on citeseer.
<asqui> Yurik: Hi there (scuse the delay :)
<Yurik_> asqui: hi!
<asqui> Hows it going?
<Yurik_> asqui: not very good, but goes
<Yurik_> anyway
<Yurik_> in term of year, I'll repeat, you'll see ocaml app that isn't sml :))) so it will be a proof
<Yurik_> it will be a quite serious app
<Yurik_> btw. does sml has something close to Ensemble
<Yurik_> ?
<lament> there's a serious app written in elisp
<lament> but that doesn't mean elisp is a good language :)
<Yurik_> lament: cos
<Yurik_> lament: but anyway our app will show what caml can do for the business, believe me
<whee> is it a time machine?
<whee> please let it be a time machine :)
<Yurik_> unfortunately it is not a time machine :))
<Yurik_> but it is a new generation business automation platform
<Yurik_> unfortunately, most of you can't come to the seminar at Moscow. it will be about our platform and in particular usage of caml
jemfinch has quit [Read error: 104 (Connection reset by peer)]
Yurik__ has joined #ocaml
<whee> heh
Yurik has quit [Read error: 110 (Connection timed out)]
Yurik__ has quit [Client Quit]
Yurik__ has joined #ocaml
jao has joined #ocaml
<Yurik__> re
<Yurik__> got disconnected again :))
<Yurik__> jao: hi
<jao> hi
ChoJin has joined #ocaml
<ChoJin> hi
<ChoJin> anyone here ?
<Yurik__> ChoJin: hi
<ChoJin> I am profiling a prog
<Yurik__> ChoJin: yes
<ChoJin> Each sample counts as 0.01 seconds.
<ChoJin> % cumulative self self total
<ChoJin> time seconds seconds calls s/call s/call name
<ChoJin> 42.26 4.72 4.72 30824432 0.00 0.00 modify
<ChoJin> what is "modify" ?
<Yurik__> i don't know, sorry
Yurik_ has quit [Read error: 104 (Connection reset by peer)]
mattam has quit ["zzzzZZZZZZzzzzzz"]
<whee> I think modify is some sort of C call for doing the obvious and modifying values
<whee> CAMLextern void modify (value *, value);
<ChoJin> k; thx
jao is now known as jao_away
docelic has joined #ocaml
Yurik__ has quit [Read error: 110 (Connection timed out)]
<asqui> shit a brick
<asqui> this thing keels over
<asqui> and dies....
<whee> dying is good
<asqui> anyone want to have a look at some code for me :)
<docelic> heh, I thought you were typing in your one time password ;-)
ElCritter has quit ["Client Exiting"]
<asqui> okay, a function takes a list of int, it ten works out the number of routes to get from the currect position vector, to the zero verctor, in esscence.
<asqui> (Making only unit moves in one dimension at a time)
<asqui> heres the code *cough*
<asqui> let rec routesNd1 l = let l = filter (fun 0 -> false | _ -> true) l in
<asqui> if length (l) = 1 then 1 else
<asqui> it_list (fun a b -> a + b) 0(* Sum the results *)
<asqui> (
<asqui> map routesNd1(* Apply recursive call on each tweaked input *)
<asqui> (
<asqui> map (* Making a list of all these tweaked inputs *)
<asqui> (apply (fun x -> x-1) (l)) (* Decrement the 1st, 2nd... element of input *)
<asqui> (range(1,length(l)))(* Generate a list of counting numbers *)
<asqui> )(* ^ READ THE COMMMENTS UPWARD FROM HERE ^ *)
<asqui> );;
<asqui> the filter will kill any zeroes in the input list (destination has been reached in that dimension)
<whee> so what's the problem
<asqui> if the length of the list is 1 we are down to 1 dimension, hence only one route.
<asqui> the problem is that i call it with a 3 dimensional vector and it tells me Out of Memory 5 seconds later ):
<whee> heh
<asqui> #routesNd1 [1;2];;
<asqui> Uncaught exception: Out_of_memory
<asqui> and its a bitch casue i cant trace though!
<whee> erm
<asqui> its possible, for eample, that the stripping of zeroes isnt working therefore causing an infinite loop
<asqui> son of a bitch... thats exactly it
<whee> haha
<whee> try using (<>) 0 instead of that fun thing
<asqui> lol good point
<whee> or maybe it's the negation of that
<whee> err
<whee> yes that appears to work :D
<asqui> let filter f = fun [] -> [] |
<asqui> (h::t) -> if f h then h::t else t;;
<asqui> why is this only filtering the first occurence!!!
<whee> hrm?
<whee> you aren't doing any recursion in there
<whee> so it eats the first and stops
<asqui> hhahaahahhahaha
<asqui> okay, if i give you my address will you come over with a bat?
<whee> wood or aluminium?
<whee> :)
<asqui> So what would eb the correct way to implement the filter funtion?
<asqui> have 2 lists, in and out, where you call it with in = [...] out = []
<whee> it should already be included with caml light
<asqui> its not
<asqui> or if it is its not vry well documented and not called "filter"
<asqui> >filter;;
<asqui> >^^^^^^
<asqui> The value identifier filter is unbound.
<whee> hmm well how about using something like subtract
<whee> subtract l1 l2 returns the list l1 where all elements structurally equal to one of the elements of l2 have been removed.
<asqui> so anyway, 2 lists and we pop off the top one and call ourself with the tail as 'in' and either 'out' passed directly down, or out @ [the_head] ..... bring the bat, quickly.
<whee> it really should have something like filter, gah
<whee> heh
<whee> I would just use subtract here if you don't want to write filter
<asqui> yeah, im implementing it now.
<whee> or check the ocaml source to see how they do it (stdlib/list.ml)
<whee> likely a tail recursive solution there
<asqui> its easy.
<asqui> let filter f l = filter_aux f l;;
<asqui> let filter_aux out = [] -> out | (h::t) -> if f(h) then filter_aux (out @ [h]) t else filter_aux h t;;
<asqui> Is that on the right track?
<whee> I have no idea :)
<asqui> oh cmon man!
<asqui> filter_aux takes 2 lists, in and out, initially out is empty, we add stuff to out if it complies, else we discard it.
<asqui> that wat one by one the elements get flicked from 'in' to 'out' (or into the trash) and in the end 'in' is empty and we return 'out' boselector mmkay thanks
<asqui> I can believe that i used that implementation of filter and then wondered why it ran out of memory
<asqui> that was the only function i didnt actually test
<asqui> "why doesnt this work" "lets see, YOU LEFT OUT THE RECURSION, little omission there mate!!!"
<SoreEel> I just finished writing a non-tail recursive version of filter... interesting language.
<asqui> In caml?
<SoreEel> Yes.
<asqui> Was it anything like what I had?
<SoreEel> let rec filter f = function [] -> [] | h::t -> if f h then h::filter f t else filter f t;;
<asqui> Why was it non-tail recursive?
<SoreEel> Simply because instead of using multiple lists, it utilizes the stack.
<asqui> rofl, thats exactly what i said!
<SoreEel> Did yours work?
<asqui> didnt test it, im using "subtract" now :)
<whee> heh
<asqui> oh right, yeah thats not tail recursive.
<SoreEel> I said it wasn't :P
<asqui> yeah
<whee> hey did you know it's not tail recursive
<whee> :)
<asqui> mine was because i wrappered it and passed around lists :p
<SoreEel> Functional languages are fascinating in the fact that complex data structures are implicitly defined by the relations of functions and recursion ( via the stack ).
<asqui> and my first-attempt implementation was *completely* non-recursive, lol
<SoreEel> Probably why they're good at logical stuffs.
<whee> SoreEel: you should learn haskell at some point too
<whee> I've been doing that lately
<asqui> SoreEel: Do you mean to say that "wow, given :: and recursion I can do everything with lists, shit thats cool" ?
<whee> a lot of haskell is over my head but I'm starting to get the hang of it
<SoreEel> asqui: Well, that's a shallow approximation.
<SoreEel> What I meant was far more profound.
<SoreEel> Ahem.
<asqui> whee: Ill make a node to avoid haskell :)
<whee> heh
ChoJin has quit ["bye !!!"]
<SoreEel> It's almost as if chains of functions operate on some formless ethereal structure of information.
<whee> being able to pass functions around and create anonymous functions helps a lot in terms of reusability
<SoreEel> Does O'Caml support first-class continuations?
<whee> I don't believe so
<SoreEel> Shame, really.
j_bravo has joined #ocaml
<j_bravo> hello anyone still up?
<j_bravo> anyone by chance???
<j_bravo> plz
<asqui> NEGATIONIVE
<asqui> we are all down
<asqui> ALL OF US
j_bravo has left #ocaml []
<SoreEel> The snow here in Canada obscures any view of the Sun, thus we do not operate on any celestial based time system. I have no reason not to be up..
<SoreEel> Hey, he/she missed my clever comment.
graydon has joined #ocaml
j_bravo has joined #ocaml
<j_bravo> too bad...
<j_bravo> no really..
<j_bravo> all i have is one little q about pattern_matching...
<SoreEel> If you go ahead and ask the question, perhaps at some undetermined point in the future one may reflect on your situation and provide an answer..
<j_bravo> let me send u my script so it will be easier to understand for u ...
Ymrryr has quit ["Leaving"]
<asqui> Regardless of wether you do pose your question at any point be informed that I will be sitting in the corner hitting my head on hard objects. Please dont let it disturb you.
<j_bravo> LOL
* asqui sees hope for a lost cause more lost then himself
<j_bravo> when u start the script u will read the problem...
<SoreEel> j_bravo, I would be happy to help answer any _specific_ questions you have.
<j_bravo> i tried to start another function within pattern matching---
<j_bravo> why wont this work
<asqui> Hang on, i having trouble sticking this up my nose, do I have to print it first or soemthing
<j_bravo> no its an .ml file
<j_bravo> open it with ocaml
<SoreEel> If the situation is extremely abstract, metaphors may be required for an explanation.
<j_bravo> mmmm....
* j_bravo *kind of desperated @ 3:43 in the morning
<asqui> 'desperated'?
<SoreEel> I think all questions should be in the form of a Haiku.
<j_bravo> *desperate*
<j_bravo> Haiku?
<j_bravo> well i get an Ubound Value f2
<asqui> All nice and succinct,The grandfather of our time, Haiku pwns your face.
<j_bravo> the intension of my script is the LZW Algorithm
<j_bravo> as functional as possible...
<j_bravo> ...trying not to use any refs and while...do
<asqui> j_bravo: This exression has type sentence but is used with type Haiku.
<j_bravo> i see...so what is the solution...i cant start any other functions within pattern matching?
<asqui> j_bravo: This exression has type sentence -> sentence but is used with type Haiku.
<j_bravo> "The primary purpose of reading and writing haiku is sharing moments of our lives that have moved us, pieces of experience and perception that we offer or receive as gifts. At the deepest level, this is the one great purpose of all art, and especially of literature."
<j_bravo> oh well
<asqui> Is Caml doesn't inspire and sexually arouse you, we will not help you.
<asqui> So like... whats the actually problem dude?
<j_bravo> before OCAML can inspire and sexually arouse me I need to get to know it's syntax...
<whee> hooray back
<j_bravo> have u looked at the script @asqui?
<asqui> Who the hell is @asqui? Yes ive looked at the code you sent me.
<asqui> Whats ocaml?
<j_bravo> some type of cigarettes to smoke?
<asqui> Look man, i really want to help you, but in order for me to help you you need to want to help yourself to help me to help you.
<SoreEel> j_bravo: All we ask is a coherent question.
<SoreEel> If such things exists.
<SoreEel> ( exist )
<j_bravo> do u think id get up at 3:30 in the morning if I wouldnt wanted to be helped?
<whee> I still don't know what the problem is
<SoreEel> Perhaps you were awoken by the crickets in your mind.
<j_bravo> i already gave my coherent question...why cant I start another function within patter matching???
<whee> you can
<j_bravo> perhaps..
gl has quit [Read error: 60 (Operation timed out)]
* asqui farts
<j_bravo> maybe i was never really asleep
<j_bravo> ...
<SoreEel> You can paste any offending lines of code, if you like.
<whee> you're probably trying to call a function outside of its scope or incorrectly named or something
<asqui> Sleep? Whats that? I have to be up in like 5 hours
<j_bravo> i dont think so...
<whee> need code to tell you what's wrong in any case.heh
<j_bravo> i have to be up in like 3 hours....
<SoreEel> We sit together,
<SoreEel> the mountain and I;
<SoreEel> Until only the mountain remains.
<SoreEel> -- Li Po
<j_bravo> and i guess ill just stay up until then...
<asqui> SoreEel: What a fucking homeboy
<SoreEel> Perhaps a formal Haiku in Japanese, but beautiful anyways.
gl has joined #ocaml
<SoreEel> Chinese?
<asqui> hes got some 5-5-9 style action going on there.
<SoreEel> Some people and their work just transcend rigid definitions.
<asqui> People and work.
<asqui> Trancend rigidity.
<asqui> Like mountains.
* SoreEel applauds
<asqui> the man named asqui,
<asqui> he is thankful.
<asqui> sexy breasts.
<SoreEel> Your first was .. 4-6-3
<asqui> This Li Po guy was trying to say something man! It doesnt mater how many syllables you have as long as you wank off whilst saying it
<asqui> Okay im seriously going to bed now
<asqui> j_bravo good night.
<SoreEel> Good, you're suffering from anti-sleep intoxication.
<asqui> your problem may have good luck.
<asqui> Sleep tight little one.
<asqui> No im suffering from "wow i got this bitch to work but i cant be bothered to write it up so ill just dance like im selling nails on irc"
<SoreEel> And a severe personality disorder.
<SoreEel> :)
j_bravo has quit ["Trillian (http://www.ceruleanstudios.com)"]
Begbie has joined #ocaml
docelic has quit ["Client Exiting"]
jemfinch has joined #ocaml
lament has quit ["mental mantle"]
jemfinch has quit [Read error: 104 (Connection reset by peer)]
Begbie has quit ["Lost terminal"]
jemfinch has joined #ocaml
graydon has quit ["xchat exiting.."]
mattam has joined #ocaml
karryall has joined #ocaml
mrvn_ has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
jemfinch has quit [Read error: 104 (Connection reset by peer)]
jemfinch has joined #ocaml
jemfinch has quit [Read error: 110 (Connection timed out)]
aps has quit [forward.freenode.net irc.freenode.net]
mrvn_ has quit [forward.freenode.net irc.freenode.net]
skylan has quit [forward.freenode.net irc.freenode.net]
Torquemada has quit [forward.freenode.net irc.freenode.net]
karryall has quit [forward.freenode.net irc.freenode.net]
mattam has quit [forward.freenode.net irc.freenode.net]
gl has quit [forward.freenode.net irc.freenode.net]
asqui has quit [forward.freenode.net irc.freenode.net]
nkoza has quit [forward.freenode.net irc.freenode.net]
whee has quit [forward.freenode.net irc.freenode.net]
xtrm has quit [forward.freenode.net irc.freenode.net]
mmc has quit [forward.freenode.net irc.freenode.net]
mellum has quit [forward.freenode.net irc.freenode.net]
smkl has quit [forward.freenode.net irc.freenode.net]
lam_ has quit [forward.freenode.net irc.freenode.net]
Segora has quit [forward.freenode.net irc.freenode.net]
jao_away has quit [forward.freenode.net irc.freenode.net]
SoreEel has quit [forward.freenode.net irc.freenode.net]
kev has quit [forward.freenode.net irc.freenode.net]
jankr has quit [forward.freenode.net irc.freenode.net]
emu has quit [forward.freenode.net irc.freenode.net]
mrvn_ has joined #ocaml
karryall has joined #ocaml
mattam has joined #ocaml
gl has joined #ocaml
jao_away has joined #ocaml
asqui has joined #ocaml
nkoza has joined #ocaml
mellum has joined #ocaml
mmc has joined #ocaml
smkl has joined #ocaml
SoreEel has joined #ocaml
skylan has joined #ocaml
Torquemada has joined #ocaml
kev has joined #ocaml
jankr has joined #ocaml
lam_ has joined #ocaml
Segora has joined #ocaml
whee has joined #ocaml
xtrm has joined #ocaml
aps has joined #ocaml
emu has joined #ocaml
karryall has quit []
<emu> sorry, this is SML, but I think it similar in OCAML: how do I do `fun foo x = #1 x'
* emu suddenly goes duh
<emu> matching
<whee> or you can use the 'fst' function
<whee> there's fst and snd functions to get the first and second elements of a tuple, respectively
<emu> doesnt exist in sml =(
<whee> for any more you'll need to use matching
<whee> oh
* emu wonders what the deal is with #1 and #2
<whee> you should be able to do #1 x where x is a tuple
<emu> yeah, but its something "special" since it couldn't be used like an ordinary function
<whee> I guess you could do 'fun foo (x, _) = x' to simulate #1
<emu> sure thats what I ended up doing
<emu> but what about arbitrary length tuples?
<emu> (this isnt that important to me, just curious)
<whee> no clue
<whee> I would say to use lists
Torquemada has quit [Read error: 54 (Connection reset by peer)]
Torquemada has joined #ocaml
Yurik has joined #ocaml
<Yurik> re
Miwong has joined #ocaml
Yurik has quit [Read error: 104 (Connection reset by peer)]
<Miwong> hello
Dalroth has joined #ocaml
lament has joined #ocaml
lament has quit ["mental mantle"]
docelic has joined #ocaml
mmc has quit [Read error: 60 (Operation timed out)]
mmc has joined #ocaml
<asqui> Okay, apparently this "function(x-1,y,z) + function(x,y-1,z + function(x,y,z-1)" thing *can* be turned into a tail recursion
graydon has joined #ocaml
taw has joined #ocaml
<SoreEel> asqui: Can't everything?
<asqui> Apparently.
<asqui> How do I convert that then?
<asqui> Im sort of getting there but actually I have no clue.
<asqui> Im thinking I somehow need to pass three tuples and have an accumulator
<asqui> but thats about as far as my train of thought goes.
gl has quit [Remote closed the connection]
gl has joined #ocaml
SYStems has joined #ocaml
mattam_ has joined #ocaml
taw has quit ["Client Exiting"]
SYStems has quit ["Client Exiting"]
mattam has quit [Read error: 110 (Connection timed out)]
j_bravo has joined #ocaml
MegaWatS has joined #ocaml
Miwong has left #ocaml []
gl has quit [Read error: 54 (Connection reset by peer)]
gl has joined #ocaml
lament has joined #ocaml
ael has joined #ocaml
ael has left #ocaml []
docelic has quit ["Client Exiting"]
gl has quit [Read error: 54 (Connection reset by peer)]
gl has joined #ocaml
docelic has joined #ocaml
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
taw has joined #ocaml
<taw> how to get pid of current process ?
<MegaWatS> is that supposed to be a question?
<taw> yes
<MegaWatS> anyway, http://caml.inria.fr/ocaml/htmlman/libref/Unix.html ( Unix.getpid () ) is what you are looking for i guess
<taw> Unix.getpid ();;
<taw> Reference to undefined global `Unix'
<MegaWatS> you have to link the unix library
<taw> what im i doing wrong ?
<taw> oh
<taw> how ?
<MegaWatS> wait a sec
malc has joined #ocaml
<taw> ok
<taw> i found docs
<MegaWatS> ocamlc unix.cma blah
<taw> #load "unix.cma";;
<taw> it seems
<MegaWatS> where blah = rest of command line
<MegaWatS> oh well or that yes :)
<MegaWatS> if interactive mode is sufficient for you
<taw> well, not really
<taw> but the rest is documented there too
skylan has quit [Read error: 54 (Connection reset by peer)]
skylan has joined #ocaml
clam has joined #ocaml
malc has quit [Read error: 110 (Connection timed out)]
clam has quit [Read error: 110 (Connection timed out)]
mattam_ has quit [Read error: 60 (Operation timed out)]
mellum_ has joined #ocaml
mellum has quit [Read error: 110 (Connection timed out)]
mellum_ is now known as mellum
Dalroth has quit []