flux changed the topic of #ocaml to: 3.11.0+rc1 is out! | Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0beta1 available from http://caml.inria.fr/pub/distrib/ocaml-3.11/ | Or grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html
<Optikal__> Why do I get ^[[c in ocaml when I press arrow keys?
<christo_m> haha yeh i get that too
<christo_m> i hate retyping crap
<olegfink> Optikal__: because it doesn't interpret arrow keys specially?
<olegfink> use ledit or any other wrapper
<Optikal__> emacs =)
<olegfink> or just get a sensible terminal
<olegfink> emacs will do
<Optikal__> with Tuareg goodness
<christo_m> i use vim :(
<olegfink> i'm fine with acme
<Optikal__> let plus_maker i (n: int) (a: int) = i succ n a;
<Optikal__> that still returns -> though
pango has quit [Remote closed the connection]
<Optikal__> err -> 'a
<christo_m> yeah i figured u had to specify the types
Kerris7 has quit ["Who is Candlejack? Is he going to c"]
<Optikal__> ah let plus_maker i (n: int) (a: int) : int = i succ n a;
<olegfink> the good thing is you don't need that nonse for times_ and exp_makers
<christo_m> its still int ref ->
<christo_m> hmm
<christo_m> whats wrong with that third tail recursive function
<Optikal__> what is?
<christo_m> must fixx
<Optikal__> oh that
<christo_m> ((int ref -> unit) -> int -> int -> int) -> int -> int -> int = <fun>
fschwidom has quit [Remote closed the connection]
<Optikal__> what is that a sigunature for?
pango has joined #ocaml
<Optikal__> oh your suc function
<Optikal__> use succ
<Optikal__> not your custom function
<christo_m> succ actually exists?
<Optikal__> yes
<olegfink> the manual actually exists.
<christo_m> (sigh)
<christo_m> can you just try not to be such an elitist
<christo_m> given the time constraints i dont have time to search the manual for arbitrary functions
<olegfink> then you can at least type succ;; at an ocaml prompt.
<olegfink> okay, gonna sleep
vixey has quit [Read error: 101 (Network is unreachable)]
<olegfink> if you want, I can publish my implementation, but it isn't much interesting and you better figure the stuff on your own anyway.
<christo_m> i tried it, i see it works
<Optikal__> did you figure out the 3rd one yet?
<christo_m> no
<christo_m> i took a break
<Optikal__> it's easy
<Optikal__> else if n = 0 then a
<Optikal__> hint: it's not a
<christo_m> (f x)?
<christo_m> or x
<christo_m> rather
<Optikal__> close... there we go
<christo_m> hmm
dejj has quit ["Leaving..."]
<christo_m> Optikal_, http://rafb.net/p/fZRKrT40.html
<christo_m> there's everytihng thus far
<Optikal__> k
authentic has quit [Read error: 110 (Connection timed out)]
<christo_m> Optikal_, yea..
<christo_m> Optikal_, not sure how to even make calls in the interpreter to test my stuff
<Optikal__> iterator_for succ 10 0;;
<christo_m> okay yeh i just did that
<christo_m> it works
<Optikal__> what don't you know how to run?
<christo_m> nothing
<christo_m> i jus tdont know how to incoporate plus_maker
<christo_m> and all that other nonsense
<christo_m> plus_for
<christo_m> etc, and the times_maker that builds upon this
<christo_m> theres just so much to do im gonna go insane
<Optikal__> is this your first ocaml assignment?
pumpkin_ has joined #ocaml
<christo_m> no
<christo_m> i gotta go home
<Optikal__> see ya
<christo_m> at the library right now
<christo_m> ill have to do this later or something
<christo_m> peace
christo_m has quit ["home"]
<Optikal__> this assignment is crappily written
<Optikal__> this is a top canadian university too
blue_prawn has joined #ocaml
<blue_prawn> hello
<blue_prawn> I'm trying to find the command line to compile with the module Big_int
<blue_prawn> someone knows ?
seafood has quit []
<Smerdyakov> Read the manual section on that library.
<blue_prawn> there's just the interface
<Smerdyakov> The library, not the module
<blue_prawn> I do not understand
<Smerdyakov> How did you get to the page about [Big_int]?
<blue_prawn> the interface
<Smerdyakov> I'm asking which process of following links in your web browser you used.
<Smerdyakov> You just woke up one day knowing that was the URL to visit?
<blue_prawn> I do not understand
* Smerdyakov gives up.
<Smerdyakov> [Big_int] belongs to the [num] library.
<Smerdyakov> Read the manual page on the [num] library.
<blue_prawn> ha OK
<Smerdyakov> I would still like to know how you ended up at http://caml.inria.fr/pub/docs/manual-ocaml/libref/Big_int.html, if not from the link on the [num] library manual page.
<blue_prawn> from there:
<Smerdyakov> I see. It is kind of weird that those pages don't tell you which libraries modules are in.
<blue_prawn> as you can see it is the first link besides the letter 'B'
<Smerdyakov> I see now. I didn't realize there was such an index lying around.
<blue_prawn> I always use this index
<blue_prawn> Smerdyakov: Thanks for your help
<Smerdyakov> So, in the future you can visit each page about a library, from the main manual TOC, to see which library a module belongs to.
<blue_prawn> where is this TOC ?
<blue_prawn> I see this page as a TOC for the manual "manual001.html" but it does not handle what you say
ulfdoz has quit ["deprecated"]
<blue_prawn> this page does not tell the Big_int is part of nums.cma
netx has joined #ocaml
<Smerdyakov> Like I said, you must follow every link labeled with a library name.
<blue_prawn> again there is no label for Big_int
<Smerdyakov> Saying it that way, it sounds ridiculous, but I never have any problem; I don't find modules by using that global index, but rather by thinking what general category of functionality I'm looking for and following the link to the corresponding library.
<Smerdyakov> blue_prawn, when I say "every," I mean "every."
<Smerdyakov> blue_prawn, no matter which module you are looking for, you must be prepared to follow every link to a library. The link will not include the module's name.
<blue_prawn> reading exhaustivelly the manual
<blue_prawn> I know I should
<Smerdyakov> No, just the second-level pages of Part IV.
<Smerdyakov> There are only 11.
<Smerdyakov> And, again, you can save yourself this trouble by pretending that that global module index doesn't exist.
<Smerdyakov> Think first about what library you want, and only then look for modules within in.
<Smerdyakov> s/within in/within it
<Optikal__> Can't they just make a pretty tree?
<blue_prawn> Optikal_: yes for example:
<blue_prawn> Array2 [Bigarray]
<blue_prawn> tells that Array2 is in Bigarray
<alexyk> how do you launch a background job, can I just say Unix.system "job &", or will it block?
<Smerdyakov> Libraries aren't first class in OCaml, especially when you don't use the [-pack] option.
<blue_prawn> so I would expect : Big_int [Nums]
<blue_prawn> alexyk: Unix.fork
<alexyk> blue_prawn: thx!
<Smerdyakov> blue_prawn, you are confusing modules and libraries there. That annotation indicates that module [Bigarray] has a submodule called [Array2].
<blue_prawn> Smerdyakov: yes I'm confusing something that is confusing :p
<Smerdyakov> The module [Bigarray] happens to be in the [bigarray] library, but that name implies no necessary formal connection.
<blue_prawn> I know
<Smerdyakov> I totally agree. It seems obvious that all libraries should inhabit a global namespace, structured with the module system.
<alexyk> blue_prawn: hmm, and how do I specify the command to launch in background?
<blue_prawn> alexyk: there are several ones
<Smerdyakov> alexyk, see [Unix.create_process] and the functions documented immediately after it.
<blue_prawn> alexyk: if you whish I have started the english traduction for this page:
<alexyk> basically I have a process which is a TCP server, so I just want to launch is and be done with it
<alexyk> it'll sit there forever
<Smerdyakov> alexyk, please don't go into more detail. Everyone already knows what you're asking, and I already gave you the answer.
<alexyk> Smerdyakov: thanks
<alexyk> blue_prawn: translate.google.com should grok it
<blue_prawn> Smerdyakov: the ocamldoc is not enough to really learn howto use those functions
<Smerdyakov> blue_prawn, I disagree.
<Smerdyakov> blue_prawn, what is missing?
<alexyk> blue_prawn: http://translate.google.com/translate?u=http%3A%2F%2Fcristal.inria.fr%2F~remy%2Fpoly%2Fsystem%2Fcamlunix%2Fproc.html&hl=en&ie=UTF-8&sl=fr&tl=en
<blue_prawn> Smerdyakov: do not tell me that you never have read more documentations about unix programming
<Optikal__> wow that is a suprisingly good translation
<Smerdyakov> blue_prawn, I'm going to keep claiming that no such extra documentation is needed.
<Smerdyakov> A function like [Unix.open_process_in] is very simple.
<blue_prawn> you find it simple, but you already know
<blue_prawn> it would had been interesting to se you when you was an early beginner beginning with this
<Optikal__> No, he's just a freak.
<blue_prawn> alexyk: indeed the automatic traduction is better than before
<alexyk> blue_prawn: Franz Och works hard at it
<Smerdyakov> Oh, now I see.
<blue_prawn> Optikal_: ha indeed I was meaning for ordinary mortals :)
<Smerdyakov> blue_prawn didn't pay attention to what I was suggesting to alexyk.
<Smerdyakov> I suggested a much simpler set of functions that isn't mentioned _at_all_ in that document.
<blue_prawn> Smerdyakov: you mean that pages
<Smerdyakov> alexyk, I suggest ignoring the link blue_prawn suggested.
<blue_prawn> s/pages/page/
<Smerdyakov> blue_prawn, are you saying that a "page" is not also a "document"?
<blue_prawn> indeed, you should prefer the index:
<Smerdyakov> alexyk, read the [Unix] manual page about [Unix.open_process_in] and similar. It's so obvious that no further documentation is needed, if you understand OCaml in general.
<blue_prawn> the equivalent in a book shop costs 45 euros and is with the C language
<Smerdyakov> blue_prawn, ...and is entirely irrelevant to alexyk's question,
<alexyk> Smerdyakov: thanks, will do! the mystery of fork always fascinated me though, so I might just try it for fun
<blue_prawn> alexyk: and the doc I pointed explains why you should do a "double-fork" instead of just a single fork
<Smerdyakov> blue_prawn, please stop mentioning fork(). It's a horrible choice for this problem.
<blue_prawn> Smerdyakov: you are true but,
<blue_prawn> you see that he is interseted by this area of knowledge
<det> specifically, "Index of modules"
<det> In that page you can easily find the Big_Int module.
<blue_prawn> yes this was from there I found it
<Smerdyakov> det, did you just read one line earlier and ignore subsequent conversation?
<det> yes
<det> I do that often
<Smerdyakov> det, good work.
* Optikal__ is disappointed that interseted is not a word
<blue_prawn> s:interseted:interested:
<Optikal__> I must be thinking of interseted
<Optikal__> err
<det> I saw you suggest that he look through every section looking for the module he wanted, which struck me as a bad idea. So I suggested the module index.
<Optikal__> interceded
<Smerdyakov> det, you missed some other context. Your suggestion doesn't tell you which library the module belongs to.
<blue_prawn> ha yes, I see it's close but different http://en.wiktionary.org/wiki/intercede
<Smerdyakov> det, and the original question was reducible to which library [Big_int] belongs to.
Axioplase has joined #ocaml
<det> Ok, if the question was which cmxa file to link, then I guess I wasn't very helpful.
<blue_prawn> yes and ocamlbrowser doesn't tell this information too
<det> alexyk, Why do you want to launch a background process? There are many methods, the appropriate way depends on use.
<Optikal__> He wants it to be independent of the parent thread
<Optikal__> I think
<alexyk> det: yes, it's a TCP server
<Optikal__> s/parent/spawning
<det> then fork is the correct way
<alexyk> it's a Unix binary which talks to a port, I use OCaml to launch hordes of those
<alexyk> det: Smerdyakov pointed out Unix.current_process, which look like fun
<alexyk> Unix.create_process
<det> open_in doesnt make much sense unless you are reading or writing to the process stdin/stdout
<det> open_process_in, I mean
<alexyk> det: no pipes, we launch and move on; is Unix.create_process non-blocking?
<det> If you want the program to not exit when the main program exits, then you want fork + exec
<Optikal__> something is weird on ubuntu, my font's o looks like 0 in firefox
<alexyk> det: exactly, that's what I want; so will create_process be killed when parent quits?
<det> yes
<det> oh
<det> create_proccess, i dont know
<det> sec
<alexyk> det: well I'll launch one from toplevel, quit toplevel and see
<det> I think it probably well
<det> will*
mtrimpe has quit []
<det> Even if it doesnt, there is no reason to set up pipes for reading/writing that you will never use
<blue_prawn> see you next time
blue_prawn has quit ["Client exiting"]
<alexyk> det look at this monstrosity which works: Unix.create_process "executable" (Array.of_list (Str.split (Str.regexp " ") "executable again with the full command line") (Unix.descr_of_in_channel stdin) (Unix.descr_of_out_channel stdout) (Unix.descr_of_out_channel stdout);; -- is there a shorter way to split on space and clone std*?
<alexyk> now let's see what happens when I quit toplevel
<alexyk> btw probably need to open /dev/null to write to
<alexyk> heh, it's going like the Energizer bunny! Viva Smerdyakov
<alexyk> funny, I quit toplevel and in its shell the process keeps printing, so it inherits the dead's std* channels
<det> use exec + fork
<alexyk> det: why it works as it is
<det> fork and exec is simpler
<alexyk> Smerdyakov told me not to :)
<det> off the top of my head
<det> let spawn command args = if Unix.fork () = 0 then Unix.execv command args
<det> you might need to prepend commad to args in the execv
<det> I dont remember
<det> maybe you just want fork + system
<det> let spawn command_line = if Unix.fork () = 0 then ignore (Unix.system command_line);;
<det> -;;
authentic has joined #ocaml
<det> What are the arguments against using fork ?
<Smerdyakov> Takes more code, with no apparent benefit.
<det> less code
<det> you have to worry about file descriptors with open_process_in
<Smerdyakov> The fork/exec model is quite baroque. I think the [create_process] interface is cleaner.
<Smerdyakov> But there is negligible difference in this situation, so it's hardly worth arguing over.
seafood has joined #ocaml
seafood has quit [Client Quit]
<alexyk> I also will supply open_out "/dev/null", so create_process lets me supply those; with fork it's not clear
snhmib has quit ["Good riddance!"]
pumpkin_ is now known as pumpkin
seafood has joined #ocaml
electricfeel has joined #ocaml
jdev has quit ["Scheduled Maintenance"]
threeve has joined #ocaml
electricfeel has quit []
apples` has quit ["Leaving"]
jknick has quit ["leaving"]
sporkmonger has quit []
jdev has joined #ocaml
netx has quit ["This computer has gone to sleep"]
alexyk has quit []
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
threeve has quit []
glondu` has joined #ocaml
glondu has quit [Read error: 104 (Connection reset by peer)]
pumpkin_ has joined #ocaml
pumpkin_ has left #ocaml []
pumpkin has quit [Read error: 110 (Connection timed out)]
netx has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
seafood has joined #ocaml
alexyk has joined #ocaml
Asmadeus has quit ["cya !"]
asabil has quit ["Ex-Chat"]
asmadeus has joined #ocaml
glondu` has quit [Read error: 104 (Connection reset by peer)]
glondu`` has joined #ocaml
asmadeus has quit [Remote closed the connection]
Asmadeus has joined #ocaml
ygrek_ has joined #ocaml
Asmadeus has quit [Client Quit]
Asmadeus has joined #ocaml
ulfdoz has joined #ocaml
jknick has joined #ocaml
jknick has quit ["leaving"]
Yoric[DT] has joined #ocaml
netx has quit ["This computer has gone to sleep"]
seafood_ has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
ygrek_ has quit [Remote closed the connection]
seafood has quit [Read error: 110 (Connection timed out)]
asabil has joined #ocaml
fschwidom has joined #ocaml
seafood_ has quit [Read error: 110 (Connection timed out)]
<flux> det, well, your code won't work as expected if you just replace execv with system
<flux> one benefit of Unix.execv is that you don't need to quote arguments (if you're not using shell)
<flux> plus fork+system will actually fork two times
rwmjones has joined #ocaml
ygrek_ has joined #ocaml
seafood has joined #ocaml
rwmjones_ has joined #ocaml
rwmjones has quit [Read error: 110 (Connection timed out)]
Kerris7 has joined #ocaml
rwmjones_ has quit ["Leaving"]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
robocop has joined #ocaml
s4tan has joined #ocaml
<s4tan> hi all
jeremiah has joined #ocaml
Kerris7 has quit []
<robocop> hi
<robocop> do you know how i can catch BigInt token with the module Genlex ?
<robocop> Exemple : "45+5" => [< 'Bingint 45; 'Kwd "+"; 'BigInt 5 >]
<robocop> i think is impossible, isn'it ?
_zack has joined #ocaml
middayc has joined #ocaml
seafood has quit []
Snark has joined #ocaml
snhmib has joined #ocaml
Kerris7 has joined #ocaml
<thelema> robocop: of course it's possible.
<thelema> I'm sure there's a bigint_of_string function somewhere
<thelema> that can handle the numeric parts, and the other parts of your parser will handle operations
<robocop> thelema: yes, but string in the lexer is not neccessery a number.
<thelema> \d+
<thelema> a sequence of digits
<olegfink> oh, I didn't know about Genlex. Maybe there are parsers in the standard library too?
<olegfink> (at least afaik there are no parser combinators)
<robocop> thelema: I make "\d+" in the keyword ?
<robocop> let keywords = ["("; ")"; "+"; "-"; "*"; "/"; "^"; "\d"] in
<thelema> no.
<robocop> hum, ok :d
<thelema> I'm sorry, I thought genlex had a little more flexibility.
<thelema> it will always parse numbers as Int or Float, never BigInt
<thelema> you'll have to write your own lexer.
Kerris7_ has joined #ocaml
<olegfink> probably I'm asking something silly, but what is the [parser] an example in http://caml.inria.fr/pub/docs/manual-ocaml/libref/Genlex.html is referring to?
<robocop> hum, ok, thanks.
Kerris7 has quit [Read error: 54 (Connection reset by peer)]
Kerris7_ has quit [Remote closed the connection]
Kerris7 has joined #ocaml
deadc0de has joined #ocaml
<thelema> olegfink: I guess it's a yacc parser - ocamlyacc
<thelema> I dunno if ocamlyacc allows "parser" instead of "parse"
<olegfink> hmm
<thelema> no, it's not... hmmmm
<olegfink> robocop, how do you parse genlex's output?
<robocop> whith the streams.
<robocop> exemple :
<olegfink> aha, parser keyword
<olegfink> mneh, it is a camlp4 extension, right?
<robocop> yes.
jeremiah has quit [Read error: 104 (Connection reset by peer)]
s4tan has quit [Read error: 110 (Connection timed out)]
deadc0de is now known as s4tan
jeremiah has joined #ocaml
Kerris7 has quit [Read error: 54 (Connection reset by peer)]
Kerris7 has joined #ocaml
ygrek_ has quit [Remote closed the connection]
alexyk has quit [Read error: 60 (Operation timed out)]
alexyk has joined #ocaml
purple__ has joined #ocaml
purple_ has quit [Read error: 110 (Connection timed out)]
vixey has joined #ocaml
Kerris7 has quit [Read error: 54 (Connection reset by peer)]
Kerris7 has joined #ocaml
hkBst has joined #ocaml
ygrek_ has joined #ocaml
_zack has quit ["Leaving."]
petchema_ has joined #ocaml
petchema has quit [Read error: 113 (No route to host)]
Stefan_vK1 has joined #ocaml
sporkmonger has joined #ocaml
gdmfsob has quit ["Stopping IRC chat... [OK]"]
Kerris7 has quit [Read error: 54 (Connection reset by peer)]
Kerris7 has joined #ocaml
Associat0r has joined #ocaml
Stefan_vK has quit [Read error: 104 (Connection reset by peer)]
Associat0r has quit [Client Quit]
middayc_ has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
willb has quit [Read error: 110 (Connection timed out)]
Kerris7 has quit []
svenl has quit [kornbluth.freenode.net irc.freenode.net]
svenl has joined #ocaml
pango has quit [Remote closed the connection]
robocop has left #ocaml []
pango has joined #ocaml
asabil has quit ["Ex-Chat"]
itewsh has joined #ocaml
vixey has quit [Remote closed the connection]
alexyk has quit []
alexyk has joined #ocaml
alexyk has quit [Client Quit]
alexyk has joined #ocaml
s4tan has quit []
<alexyk> is there a standard function Some x -> x?
willb has joined #ocaml
slash_ has joined #ocaml
vixey has joined #ocaml
<flux> no
<alexyk> flux: and even not possible, right? because what to do with None, even if we know we have Some... failwith "shouldn't happen"?
<flux> let unsome = function Some a -> a | None -> assert fales
<flux> let default v = function Some a -> a | None -> v
<alexyk> flux: fales?
<flux> false
<alexyk> nice, thx
<flux> and let's not forget: let map_opt f v = match v with None -> None | Some v -> Some (f v)
<flux> of course, one would prefer to write code that doesn't need to do those things
<flux> but at times it's too inconvenient
<alexyk> yep
Stefan_vK1 has quit [Read error: 104 (Connection reset by peer)]
<alexyk> a pair issome and unsome would work well
<flux> is match that much longeR?
<flux> in any case, let issome v = v <> None
<flux> (so v <> None itself is quite short already)
<olegfink> haskell's fromMaybe is 'a -> 'a option -> 'a, i.e. it takes a default argument
<olegfink> though there's fromJust 'a option -> 'a which throws an error...
<olegfink> (and I should read what has been said before)
_zack has joined #ocaml
<olegfink> sorry.
<flux> well, the names were a valuable contribution :)
<flux> that would make ocaml names of_option, of_some, map_some? or map_option?
middayc_ has quit []
_zack has quit [Client Quit]
<olegfink> map_option, as it accepts None
<alexyk> flux: v <> None is good
ygrek_ has quit [Remote closed the connection]
netx has joined #ocaml
<rpg_> +
_zack has joined #ocaml
fschwidom has quit [Read error: 104 (Connection reset by peer)]
<alexyk> I *love* ' in ocaml names; I call string images of things value's, and do things like let value = int_of_string value's ... but not many ' in code examples everywhere
fy__ has quit ["ChatZilla 0.9.84 [Firefox 3.0.1/2008070208]"]
Camarade_Tux has joined #ocaml
<olegfink> alexyk, ' is usually used in the meaning of 'prime', e.g. let bred x = let rec bred' a b ... in ...
<olegfink> so they're usually not visible from outside
<alexyk> olegfink: I know, but it lets me use my old Ada ways where it's used as an attribute
<alexyk> and I usually handle those "inside"
<alexyk> olegfink: does Haskell have ' in names?
<olegfink> sure, it's even stated to be a good style to use it for primes.
<flux> I sometimes use it with stuff that could be records
<flux> like box'x1, box'x2, box'y1, box'y2
<flux> ' is easier to type than _ ;)
<flux> also, it is more spacey
<olegfink> ocaml's usual naming conventions are sometimes strange
<olegfink> sometimes == when submitting a SPOJ problem that is judged by source size
<olegfink> then you really want fold_left to be foldl
<alexyk> olegfink: Haskell stole everything! I wanted F#'s #light syntax, and found that in OCaml it's called Haskell :)
Kerris7 has joined #ocaml
<alexyk> olegfunk: actually, Haskell stripped let's too, so it;s even lighter
<olegfink> and it has no function
<olegfink> that is, [function]
<alexyk> is there a writeup somewhere discussing why "let ... in\nlet ... in ..." is good for you?
<olegfink> by the way, I'm an ocaml man myself, so I'm definitely not olegfunk
<alexyk> olegfink: sorry for typos :) not enough coffee
<flux> alexyk, what do you mean?
<olegfink> alexyk: np, but it's haskell that puts FUNK in funktional as they say; ocaml puts FUN in functional.
<rpg_> let plus_maker i n a = i succ n a ;; gives me ((int -> int) -> 'a -> 'b -> 'c) -> 'a -> 'b -> 'c how do i make all of them int
<alexyk> flux: Haskell replaces trailing in and leading let with whitespace, like F# light syntax gets rid of in; there should be people arguing for let ... in and no white space, just like pro-Python and anti-Python camps
<alexyk> so I wanted to see some reasoning "pro" ocaml way vs haskell's
<Camarade_Tux> not sure you really want too see that...
<olegfink> alexyk: well, haskell is a 2d programming language, ocaml is one-dimensional
<alexyk> Camarade_Tux: if it's intelligent and courteous :)
<olegfink> for some reason, it's easier for me to think in the terms of the latter
<alexyk> and has no f(unk) words
<Camarade_Tux> alexyk, with 'if's, you would put Paris in a bottle ;)
<Camarade_Tux> anyway, dinner \o/
<olegfink> alexyk, well, ocaml disregards all whitespace, while haskell pay attention to newlines and even indentation
<olegfink> it's two fundamentally different approaches I guess
<alexyk> so ocaml is python and haskell is ruby
<alexyk> argh the other way round
<olegfink> uhm?
<rpg_> isnt python the sequel to pascal or something like that
<alexyk> ocaml is ruby and haskell is python w.r.t. whitespace
<alexyk> pascal is algol so no whitespace
<alexyk> whitespace is a modern European invention
<olegfink> well, I'd say haskell's idea of indentation is more appealing
<alexyk> no good old American would even think of that
<olegfink> or it's just becayse I have no clue about python
<alexyk> the problem with python, you have leading spaces in toplevel, it barks at you; can't cut and paste from the middle of an editor, etc
* alexyk gonna get me some of that newfangled whitespace some day
<olegfink> I don't like the idea about always dancing around that tabs/spaces thing when passing my code around
<alexyk> olegfink: always convert to space in emacs by hook upon save, that's all
* alexyk has to find how to do that in TextMate
<olegfink> see? :-)
<olegfink> my "IDE" has no idea about the code it's editing
netx has quit ["This computer has gone to sleep"]
<olegfink> (that's why I can, in the emegency event, edit my code in notepad.exe or anything)
<alexyk> olegfink: I use vi then, you can't use notepad.exe over telnet :)
<alexyk> and vi is smart about everything
marmotine has joined #ocaml
<olegfink> grrr, I have a major bug, I'm incompatible with anything smart.
<olegfink> I just can't use tools that are more complicated than me.
<alexyk> olegfink: then Windoze should keep you happy :)
harlos has joined #ocaml
netx has joined #ocaml
<alexyk> olegfink: actually, complicated doesn't mean smart, in case of Windoze, so I take it back
* alexyk knows that Mac + TextMate + iTerm == paradise
* olegfink prefers simpler editors and oses
<rpg_> man im a little confused over here
mwhitney has joined #ocaml
<rpg_> i have let f1 i n a = i succ n a;;
<rpg_> let f2 i n a = i f1 i n a;;
<rpg_> gives me a type error
<rpg_> oh
<rpg_> i get it
<rpg_> nvm
Stefan_vK has joined #ocaml
* alexyk got an email from the New York Times about coffee and went to get some
<Optikal_> Lemming!
<rpg_> ok
<rpg_> given the above
<rpg_> would let f2 i n a = i (f1 i) n a;; be correct ?
<Optikal_> correct for what?
<rpg_> let f1 i n a = i succ n a;;
<alexyk> Optikal: worse! :)
<rpg_> i has 3 parameters
<Optikal_> I think you mean pg_> given the above
<Optikal_> 13:32 < rperr
<Optikal_> blah
<rpg_> lol
<Optikal_> crappy ass cut and paste
<rpg_> thats bad
<Optikal_> let f2 i n a = i (f1 i n) a;;
netx has quit ["This computer has gone to sleep"]
<Optikal_> err no
<rpg_> i has 3 parameters though
<Optikal_> let f2 i n a = i (f1 i n) n a;;
jlouis has joined #ocaml
<rpg_> oh
<rpg_> yeah
<rpg_> ure right
<rpg_> lol
<rpg_> works
<rpg_> thank you
slash_ has quit [Client Quit]
alexyk has quit []
_zack has quit ["Leaving."]
netx has joined #ocaml
asabil has joined #ocaml
seafood has joined #ocaml
netx has quit ["This computer has gone to sleep"]
netx has joined #ocaml
itewsh has quit ["KTHXBYE"]
apples` has joined #ocaml
<Optikal_> Anybody used OCaml for scientists?
<twobitsprite> yeah, my scientists love it when I use ocaml for them
<Optikal_> s/used/read
<Kerris7> I ordered it a month ago but it still hasn't turned up :(
<Kerris7> emailed them twice but still no reply
<vixey> maybe dons killed harrop
<Camarade_Tux> nah, he's still slightly alive
<Camarade_Tux> about two messages per month on the mailing-list :p
<Optikal_> each one with a plug for the book no doubt
<Kerris7> well I guess I know where my £85 went :\
<Optikal_> L85 is a lot for a computer book
<Optikal_> F# for scientists is 1/2 price
<Optikal_> whats up with that I wonder
<Camarade_Tux> that's really unusual, he used to be much more active until recently
<Camarade_Tux> Optikal_, less public afaik
<Kerris7> Optikal_: no other book "contains over 800 color syntax-highlighted source code examples and dozens of diagrams that elucidate the power of functional programming to explain how lightning-fast and yet remarkably-simple programs can be constructed in this state-of-the-art programming language"
<Kerris7> apologies for the wall of text
<Optikal_> I see =)
<Kerris7> that was copied and pasted from Harrop's website ;-)
<Optikal_> Don't take american express
Yoric[DT] has joined #ocaml
<Optikal_> Ah, Cornell placed a bulk order for OCaml for Scientists
<Optikal_> maybe that's why yours is taking so long
<Yoric[DT]> hi
<Optikal_> Hallo
<Camarade_Tux> hi Yoric[DT]
_zack has joined #ocaml
olgen has joined #ocaml
<rpg_> let abcd e f = print_string "hello" ; x := 2 ; print_string "goodbye";;
<rpg_> is x valid or do i have to initialize first
<rpg_> or should i do
<rpg_> x = ref 2;
<rpg_> in which case id have to use let ?
<rpg_> in this*
<vixey> rpg_, dunno
<flux> rpg_, = is comparison, unless it's part of a let expression
<flux> (or other syntactic statements)
<vixey> rpg_, what happens if you try it in ocaml?
<rpg_> dunno le me try
<rpg_> lol
<vixey> what else might be useful is seeing how := and ref are defined in ocaml
<vixey> that's in the manual
<rpg_> unbound value
<vixey> (and will explain why you get out of scope)
<rpg_> so id have to initialize then
<Camarade_Tux> basically you have to declare it
TaXules has quit [Read error: 104 (Connection reset by peer)]
TaXules has joined #ocaml
<Camarade_Tux> initializing it won't really make a difference since you *have* to initialize variables anyway ;)
<Optikal_> How do you scroll back using irssi I wonder
sebast has joined #ocaml
<sebast> hello room
jeddhaberstro has joined #ocaml
<sebast> any one can help me in pvt please?
<Optikal_> sure
<Camarade_Tux> everybody's getting a repl available on browsers it seems : http://github.com/aemoncannon/las3r/wikis :p
Palace_Chan has joined #ocaml
Snark has quit ["Ex-Chat"]
sebast has quit []
netx has quit ["This computer has gone to sleep"]
seafood has quit []
netx has joined #ocaml
netx has quit ["This computer has gone to sleep"]
marmotine has quit ["mv marmotine Laurie"]
hkBst has quit [Read error: 104 (Connection reset by peer)]
fschwidom has joined #ocaml
Kerris7_ has joined #ocaml
Kerris7 has quit [Read error: 54 (Connection reset by peer)]
Kerris7_ has quit [Client Quit]
_zack has quit ["Leaving."]
netx has joined #ocaml
alexyk has joined #ocaml
netx has quit ["This computer has gone to sleep"]
<alexyk> what's the difference between fun and function here:
<alexyk> # let pairs = List.combine [1;3;4] ['a';'b';'c'];;
<alexyk> val pairs : (int * char) list = [(1, 'a'); (3, 'b'); (4, 'c')]
<alexyk> # let left = List.map (fun (x,_) -> x) pairs;;
<alexyk> val left : int list = [1; 3; 4]
<alexyk> # let left = List.map (function (x,_) -> x) pairs;;
<alexyk> val left : int list = [1; 3; 4]
<Optikal_> Go to the function definition section of that page
asabil has quit ["Ex-Chat"]
<alexyk> but the above there's no difference, correct?
Yoric[DT] has quit ["Ex-Chat"]
snhmib has quit ["Good riddance!"]
vixey has quit ["There exists an infinite set!"]
<alexyk> why does this complain: let rec last l = function
<alexyk> | x'::x::xs -> last (x::xs)
<alexyk> | x::[] -> Some x
<alexyk> | _ -> None
<alexyk> oops, nvm
ulfdoz has quit [Read error: 104 (Connection reset by peer)]
ulfdoz has joined #ocaml