dylan changed the topic of #ocaml to: OCaml 3.09.1 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/
ramkrsna has joined #ocaml
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
tktktk has left #ocaml []
smimou has quit [Remote closed the connection]
ita is now known as ita|zzz
ita|zzz has quit ["Konversation terminated!"]
pauld has quit [Read error: 110 (Connection timed out)]
bzzbzz has quit ["Lost terminal"]
bzzbzz has joined #ocaml
demitar_ has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
easy4 has joined #ocaml
<tspier2> pango,
<tspier2> Can you look over something for me, please?
tspier2 has quit ["Leaving"]
slipstream-- has joined #ocaml
Skal has joined #ocaml
MisterC has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
Skal has quit [Read error: 110 (Connection timed out)]
pauld has joined #ocaml
Smerdyakov has quit ["Leaving"]
TylerE has joined #ocaml
<TylerE> I think I'm finally starting to get my head around ocaml ;)
<TylerE> After trying off and on (mostly off) for several years
<jer> heh; sounds like my road to lisp =]
<pauld> I'm giving my head this week grock it :)
<TylerE> my road to ocaml came through lisp ;)
<TylerE> I like lisp a lot
<TylerE> but ocaml is so much more...practical
<TylerE> there's a lot to be said for being able to compile self-contained native binaries ;0
<jer> it's been difficult for me to wrap my head around functional languages my whole life; i'm a smalltalker by heart
<TylerE> jer: I understand...my first love was python ;)
<pauld> I'm trying to create a blog tool like blosxom.
* jer is working on an issue tracker atm (well not atm, but meh; you get the idea)
dvekravy_ has joined #ocaml
<TylerE> anyone know an easy way to get a list of characters from a string?
Banana_ has joined #ocaml
mattam has quit [Read error: 104 (Connection reset by peer)]
Banana has quit [Read error: 104 (Connection reset by peer)]
Banana_ is now known as Banana
ertai has quit [Remote closed the connection]
ertai has joined #ocaml
<pauld> TylerE, ExtLib has a explode function
<pauld> in ExtString..
dvekravy has quit [Read error: 104 (Connection reset by peer)]
<TylerE> just came across that via google
Banana has quit ["leaving"]
bluestorm has joined #ocaml
<pauld> can you print a expressions type from within a script file?
<pango> you probably mean a module... you can compile with ocaml{c,opt} -i to get definitions types (infered module interface file)
<pango> or compile with -dtypes to generate a .annot file, that can be used by emacs (and others ?)
<pauld> like let a () = "a";; *something* a;; prints val a : unit -> string = <fun>
<pauld> pango, no I just need it see how ocaml infers my functions
<pango> then first solution may be enough for your needs
joshcryer has quit [Client Quit]
TylerE has quit [Read error: 110 (Connection timed out)]
<pauld> ahh, well I think i made a thoughtmisstake, i wanted to debug by printing out the type
<pauld> but since it can't infer the type for the whole program I suppose it's impossible to print the type for one function
<bluestorm> but you can force it
<pauld> how?
<bluestorm> hum
<bluestorm> let fun (a : int) = ...
pango is now known as pangoafk
<bluestorm> for example :
<bluestorm> let f (a : int) = a in
<bluestorm> let _ = f 2 in
<bluestorm> ();;
<bluestorm> if you juste write "let f a = a in"
<bluestorm> f 2.4 will work
<bluestorm> (and f "hi" too)
<bluestorm> but if you add the type information, the compilater protest
<bluestorm> hum, i think this sould be used for debugging purpose only
<bluestorm> the standard way to force the type infercence is using .mli, i think
<pauld> ok. thanks. But it didn't solve my problem... merde.
<pauld> im trying with let read_filesystem (pathl : string list) =
<pauld> and calling it with read_filesystem (pathl::filename)
<bluestorm> hum
<bluestorm> filename::pathl would be better
<bluestorm> doesn't it ?
<pauld> im using List.fold_left (^) "/" pathl in read_filesystem
<bluestorm> hum
<bluestorm> do you know the Filename module ?
<pauld> i need the path splitted to add the enclosing folder to a file type like: File(pathstr, enclosing_folder)
pangoafk is now known as pango
<pauld> ahh. nice. But I'd like to do this in a functional way.
<bluestorm> hum
<bluestorm> Filename is functional, isn't it ?
<pauld> i'm trying to writer a simple blogger tool. It should parse files is placed in a directoryhierarchy and print out html
<pauld> the enclosing directory should be the entrys category like: /blog/politics/the_horror
<bluestorm> hum, you want a tree view ?
<pauld> the entry "the_horror" should be in category "politics"
<pauld> yes
<bluestorm> hum
<bluestorm> i would use Filename and Sys.readdir to build a directory tree
<pauld> the program function looks like this now but stops on line 31 let path_delim = "/";;
<pauld> type entrysrc = {
<pauld> path : string;
<pauld> statsd : stats;
<pauld> content : string;
<pauld> }
<pauld> type filesystem = File of string * string * stats
<pauld> |Directory of string * stats * filesystem list
<pauld> let (//) a b = a ^ path_delim ^ b
<pauld> let path_to_str (pathl : string list) =
<pauld> sorry
<bluestorm> hum
<pauld> the program function looks like this now but stops on line 31: http://www.pastebin.be/533/
easy4 has quit []
<bluestorm> hum
<bluestorm> i think read_directory is too complicated
<bluestorm> i would juste use List.filter to take off ., .. and the hidden files
<pauld> hehe. I think its too complicated to :)
<bluestorm> hum
<bluestorm> pauld, http://pastebin.be/534/
bluestorm is now known as bluestorm-bbl
<bluestorm-bbl> (this wasn't tested)
_fab has joined #ocaml
Vratha has joined #ocaml
<pauld> bluestorm-bbl, thanks. trying to make it compile but it fails on line 13 saying that the function is applied too many arguments: http://pastebin.be/535/
mrsolo_ has quit [Read error: 104 (Connection reset by peer)]
det has joined #ocaml
mrsolo_ has joined #ocaml
Oatmeat|umn has quit [Read error: 110 (Connection timed out)]
<bluestorm-bbl> pauld, http://pastebin.be/541/
bluestorm-bbl is now known as bluestorm
love-goo has joined #ocaml
ppsmimou has joined #ocaml
<pauld> bluestorm, wow thats beautiful
<pauld> thanks!
<bluestorm> (just be sure that you understand every line)
<pauld> i think I do, and my head hurts less trying to understand then recursion then before.
<pauld> why do i need the "" -> false match on line 17?
<pauld> i looks like i can simplify it to (fun filename -> (filename.[0] <> '.'))
jave` has joined #ocaml
<bluestorm> pauld,
<bluestorm> hum
<bluestorm> before testing str.[0] i like to be sure that it isn't ""
jave` has quit [Client Quit]
jave has left #ocaml []
<pauld> ok yes, i see
Snark has joined #ocaml
<pauld> arghh, I'm trying to use ExtLib.Std.input_file "filename" but it complains on unbound value
<pauld> I'm using cygwin and i'm running my script through the interpreter create by: ocamlfind.exe ocamlmktop -o ocamlcyg -package findlib,extlib,unix -linkpkg
clog has joined #ocaml
alch` has joined #ocaml
chimikal_ has joined #ocaml
chimikal has quit [Read error: 113 (No route to host)]
holo has joined #ocaml
<holo> hi
<holo> i am installing cdk (caml development kit) in os x and am having an installation error:
<holo> hm
<holo> lol
<holo> i guess i found why
<holo> sometimes i need to ask questions so i think better
<holo> it works
<holo> :x
<holo> i'm installing the cdk to have the lib manpages :s was this necessary?
<bluestorm> hum
<bluestorm> the web documentation is nice
<bluestorm> and .mli in the source are nice too :p
<holo> ok i can't solve it here is the output: find /usr/local/lib/cdk-3.02+1/doc/cdk-3.02+1 -name CVS -exec rm -Rf {} \; || true
<holo> find: /usr/local/lib/cdk-3.02+1/doc/cdk-3.02+1/CVS: No such file or directory
<holo> ./tools/cdk_install -man man/*.man
<holo> Exception Sys_error("man/*.man: No such file or directory")
<holo> ok i can't solve it, here is the output: find /usr/local/lib/cdk-3.02+1/doc/cdk-3.02+1 -name CVS -exec rm -Rf {} \; || true
<holo> find: /usr/local/lib/cdk-3.02+1/doc/cdk-3.02+1/CVS: No such file or directory
<holo> ./tools/cdk_install -man man/*.man
<holo> Exception Sys_error("man/*.man: No such file or directory")
<holo> ok i can't solve it, here is the output: http://pastebin.com/599799
<holo> geez
<holo> what's the matter with my copy paste, supposely should be a link to pastebin sorry the flood
<holo> any ideas?
<holo> hmm, weird i think it didn't compile the manpages
mikeX has joined #ocaml
<holo> damm
<holo> it failed to install precisely what i wanted to
<bluestorm> hum
<bluestorm> (emacs roxx %%)
<holo> bluestorm, do you have manpages there?
<bluestorm> hum
<bluestorm> with emacs ?
<holo> bluestorm, in the system
<holo> caml manpages
<holo> of the standard library
<bluestorm> yes i have
<bluestorm> (never noticed that before, btw :p)
<holo> hehe
<bluestorm> man 3 Array
<holo> ok, i don't have
<holo> grr
<holo> cdk-3.02+1 <- this one
<holo> what version did you install?
<bluestorm> hum
<bluestorm> sorry
<bluestorm> i have _ocaml_ man pages
<bluestorm> (and i don't use mac)
<holo> bluestorm, hm doesn't matter! ocaml suposely is a superset of camllight or something
<holo> i'm installing ocaml now
<holo> i only had camllight
<holo> its for school :s
<bluestorm> i think you should use ocaml instead (if your school allow it)
<holo> bluestorm, of course it allows :D
<holo> i'm supposed to develop a class interpreter in camllight
dvekravy_ is now known as dvekravy
holo has quit ["This computer has gone to sleep"]
pango is now known as pangoafk
pangoafk is now known as pango
Smerdyakov has joined #ocaml
TylerE has joined #ocaml
* dylan dances
<dylan> I have a 64bit arch to play with ocaml on!
<bluestorm> hum
<dylan> At least, if amd64 counts as 64bit. Yay turion laptops!
<bluestorm> a normal people would say "I have a 64bit arch to play with gentoo on !"
<dylan> I'm a debian user.
<bluestorm> as i do
<dylan> wait, you just called gentoo ricers normal. ;)
<zmdkrbou> (i heard bad things about debian on 64bits)
Snark has joined #ocaml
<dylan> zmdkrbou: we'll see.
<zmdkrbou> dylan: in fact i'd be interested in your comments about this
<dylan> zmdkrbou: Once I've tried it, I'll tell ya
<zmdkrbou> thx
<dylan> Some people in my LUG's channel just mentioned not being able to use open-office and flash, and I fail to see this as a bad thing...
<zmdkrbou> :)
TylerE has quit [Read error: 110 (Connection timed out)]
<bluestorm> dylan, because you use Koffice ?
<bluestorm> ( :-° )
<dylan> bluestorm: I use no office products. I use LaTeX for (undergraduate! ;)) homework. And I do not have a need for a spreadsheet program.
<dylan> It was fun when my freshmen English teacher accused me of plagarism, because my paper was typeset...
<twobitsprite> I found my arbitrary-base calculator.... erlang! :)
<dylan> twobitsprite: Real Men(TM) use abacuses.
<twobitsprite> dylan: heh
<twobitsprite> dylan: speaking of eschuing office products in favor of type-setting systems... how do/would you handle potential employers demanding resume's in Word format?
<bluestorm> "I won't pay a proprietary format"
<bluestorm> :p
<twobitsprite> you'd turn down a job offer because they want a Word formatted resume?
<bluestorm> (anyway, dylan doesn't have any potential employers. A if he had one, he would not ask him such terrible things.)
<dylan> twobitsprite: I find hiring people are impressed with a nice PDF document.
* dylan was hired as a .NET programmer for a period of a week; he then came to his senses and chose less money for using a proper development environment.
<twobitsprite> dylan: not entirely so... I tried sending my resume as PDF to several employers all of which demanded to see it in word
<dylan> twobitsprite: That is a sign to RUN AWAY. :)
<twobitsprite> dylan: I wish that was an option... one of those jobs offered me twice what any other job in my area for my skills set offered
<dylan> or try latex2rtf and name the rtf with a .doc extension (Word will still open it). It might look like crap, but most word docs do anyway
<bluestorm> hum
<bluestorm> screenshot of the pdf -> word with an image included :-°
<dylan> mogrify -format jpeg foo.pdf would work too
<bluestorm> aptitude show mogrify
<bluestorm> E: Unable to locate package mogrify
<dylan> part of image magick
<bluestorm> ok
<dylan> hmm, windows is like a viral infection. Can't resize the disk as windows is spread out over all 60GB, and a "defrag" doesn't seem to fix this. How can 8GB spread over 60?
mrsolo has joined #ocaml
<flux__> it needs to hide the DRM data around the disk, to guarantee that it is not tampered with.
* dylan idly wonders why debian defaults to ext3 over reiserfs
MisterC has quit [Remote closed the connection]
<ski> what are the pros and cons of them (compared) ?
<dylan> From what I understand, reiserfs is optimized for lots of small files, and ext3 is for lots of large files.
<flux__> ext3 has better recovery tools
<dylan> also, on an algorithmic view, ext3 is O(n) to read the contents of a directory.
<flux__> actually, doesn't ext2/3 nowadays have directory indices?
<dylan> hmm, or perhaps worse than O(n). You'd except O(n) for normal directory content retreivle
<dylan> I am not sure. But I think it still takes n operations to get the nth file of a directory.
<flux__> I guess everyone agrees that reiserfs is faster than ext2/3?
<flux__> I'm not certain you are correct..
<dylan> I dunno. reiserfs I hear is slow for huge files. But I don't have huge files?
<pango> it doesn't have extends, but so does ext2/3
<pango> maybe it's slow for large files compared to, say, xfs
<flux__> xfs is very fast for deleting big files ;)
<ski> and nfs ?
<flux__> gigabytes disappear within fractions of a second..
* ski knows next to naught about file systems
<flux__> (maybe it does it partially asynchronously)
<flux__> ski, apparently it also shows, because nfs isn't really relevant ;)
<pango> dylan: mke2fs -O dir_index ("hashed b-trees", says the man page)
<dylan> pango: Ah. cool.
<flux__> hint: DON'T do it with tune2fs to a live filesystem.. a guy in another channel tried just that ;)
<dylan> I think I'll stick with reiser, as I have thousands of small files.
<ski> (hm, is 'b-tree' a specific data structure, or is it short for 'binary tree' ?)
<flux__> I think it beand b-tree, not binary tree
<flux__> means, even
<flux__> reiser has this feature of packing multiple file ends into one block, which I understand is a great space saver
<ski> so, i assume former, then
<bluestorm> ski, b-tree is a tree with a lot of branch to each node
<flux__> maybe I could've said that with more confidence, because b-tree is a structure often used with filesystems
<bluestorm> ( Cormen roks :-° )
<sieni> Do you mean B-tree?
<dylan> b-tree == balanced tree, I think.
<bluestorm> hum
<flux__> the pack-file-ends-feature doesn't help with performance though, I think it can be disabled too
<bluestorm> dylan, i think it isn't a binary tree
<bluestorm> but a B-tree :D
<pango> indeed
<sieni> "The B-tree's creator, Rudolf Bayer, has not explained what the B stands for. The most common belief is that B stands for balanced, as all the leaf nodes are at the same level in the tree. B may also stand for Bayer, or for Boeing, because he was working for Boeing Scientific Research Labs."
<bluestorm> hum
<pango> banana ?
<ski> i've heard about 'b-trees' in relation to (relational) databases .. i take this is similar/same ?
<bluestorm> actually i thought balanced tree was a binary tree with a uniform height on each leaf
<ski> flux__ : i know nfs can work over network (how many others can ?), and i seem to recall something about not having intermediate states to lessen possible data corruption
<bluestorm> ski, yes
<flux__> ski, nfs can work _only_ over network, it cannot be used over a logical block device
<ski> hmhm ?
<pango> bluestorm: or some bound between longest and shortest path; for example red-black trees are said to be balanced because the longest path is at worse twice as long as the shortest one
<ski> does it use "host" filesystems on the nodes, then ?
<flux__> you always need a real filesystem on the block device when you use nfs
<ski> ok
bluestorm has quit [Remote closed the connection]
mrsolo has quit [Read error: 104 (Connection reset by peer)]
<dylan> Other than acpi thermal sensors telling me my CPU is running at 0 degrees C, this is working quite well.
smimou has joined #ocaml
khaladan has quit [Read error: 110 (Connection timed out)]
Snark has quit ["Leaving"]
Skal has joined #ocaml
ellisonch has joined #ocaml
mellum has joined #ocaml
Submarine has joined #ocaml
ski has quit ["Leaving"]
Schmurtz has joined #ocaml
ski has joined #ocaml
Submarine has quit ["Leaving"]
kryptt has joined #ocaml
smimou has quit ["bli"]
tspier2 has joined #ocaml
<tspier2> Hey Again. I have defining variables and functions, as well as printing text and if/else statements down, but I still can't understand how to get input from the user and store it in a variable. I looked through the manual, and I couldn't find anything to help me in particular.
<mellum> tspier2: tried the Scanf module?
<tspier2> Like in C?
<mellum> somewhat.
<Schmurtz> like C but with better type checking
<tspier2> Could you direct me to a link with an example, or could you quick throw one together for me?
<tspier2> Thanks much.
<Schmurtz> not very easy to read, but there's a simple example at the beginning
kryptt has quit [Read error: 110 (Connection timed out)]
<tspier2> Schmurtz, if I tell you the project I am working on, would you mind giving me an estimate of how long it would take to create it, since I am coming from an imperative programming point-of-view?
<Schmurtz> I'm not sure I can
<tspier2> Oh. Could you advise me on what components of OCaml I should learn first, after being informed about the project?
<Schmurtz> yes
<tspier2> Well, I am creating a simple console-based application for the most part. The user can modify different characteristics of the program, and they are all saved in a config file. The basic program converts two time values in American or Military time to seconds in between, and counts down. Catch is...once the user types a certain command at the console, it will minimize that window, and make it take up the whole screen. Then it w
<tspier2> ill have a background, and list the Hours:Minutes:Seconds until time is up for whatever it is, and then a message is displayed. NOTE: The time, messages, etc. on top of the background will be preset at the console.
<Schmurtz> It seems you need several windows ?
<Schmurtz> or 1 graphic window + the command line window
<Schmurtz> there's an API to open one (and only one) graphic window, and draw what yuo wnat inside (module Graphics)
<tspier2> 1 Graphic Window and 1 Command Line
pauld has quit [Read error: 110 (Connection timed out)]
<tspier2> I think the only things I would really need to learn would be the API, and how to write/load config files through OCaml.
khaladan has joined #ocaml
<Schmurtz> look at open_in open_out input_line scanf...
<Schmurtz> (for file io)
<tspier2> Okay. Thank you so much.
Skal has quit [Remote closed the connection]
<Schmurtz> everything is in the ocaml documentation, but sometime hard to find or with poor explanations :(
<tspier2> Yep
<tspier2> So I take it you are an expert at OCaml? :>