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
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
Asmadeus has quit [Read error: 110 (Connection timed out)]
Asmadeus has joined #ocaml
<alexyk> how do you match a digit simpler than |'0'|'1'|...|'9' -> ... ?
<MichaelGG> ..
<MichaelGG> '0'..'9'
<MichaelGG> character range
Gionne has quit ["Leaving"]
<alexyk> MichaelGG: ok... and how does one revert a buffer?
<Smerdyakov> alexyk, what? Is that an OCaml question?
<alexyk> Smerdyakov: assuredly, as Buffer is an optimized fix, I wonder if there's an efficient way to get it reverted
<alexyk> 'cause getting Buffer.contents into a string and then reverting that kinda sucks
<alexyk> OTOH I can scroll backwards with nth ... which is also some work
<alexyk> or am I missing something?
<alexyk> well guess not -- have to write one myself... as usual
threeve_ has quit []
<alexyk> well, can one do it better/shorter than http://codepad.org/I5sPOxrA?
thelema has joined #ocaml
fschwidom has joined #ocaml
fschwidom has quit [Remote closed the connection]
<alexyk> when you read input with input_char, can you terminate by seeing ^D?
<alexyk> (as EOF)?
pumpkin_ has joined #ocaml
<alexyk> hey pumpkin! :)
<pumpkin_> hi alexyk :)
<alexyk> how's ocamlin' compared to haskellin'?
<pumpkin_> haven't had much time for either :(
<pumpkin_> after the end of term I'll start playing around with them
<alexyk> pumpkin: sounds like a good plan... I just saw the book :Real World Haskell" shipped to me from Amazon
<alexyk> was on preorder for months
<pumpkin_> ooh! yeah, it's also available (in part) online, been looking at it every so often
<alexyk> pumpkin: but, the real world is more ocaml-like nevertheless... and I played with F# under Mono and (G-d forbid) Visual Studio, this is all more useful in real life
<MichaelGG> F# in VS is awesome
<alexyk> pumpkin: I mean, if you saw ocamlc or ocamlopt compile 100 files in a few seconds, you don't want to launch ghc again
<MichaelGG> and is gonna get a lot better over the next year
<alexyk> MichaelGG: compiled ocaml kicks F#'s arse
<MichaelGG> yea i know :(
<MichaelGG> im saying the editor experience
<MichaelGG> but hey... im hopeful for the next clr or mono with new GC + new F# compiler...
<alexyk> MichaelGG: I personally envy polymorphic Set<'a>, notation, #light, .NET's BCL, etc...
<alexyk> but, folks here believe (Module.method x) is better than x.method
<MichaelGG> however you want it
<MichaelGG> I use a lot of module.method x
<MichaelGG> in F#
<MichaelGG> but im sorta tied to .net. libraries, interop, etc.
<MichaelGG> so F# really fits the bill
<MichaelGG> I want a macro system.
<alexyk> MichaelGG: well if it's F#, than I use x.method... and the problem with .net is it's proprietary, and macros suck big time IMHO
<alexyk> MichealGG: or you mean camlp4 like?
<MichaelGG> alexyk, i deploy in production on Mono
<MichaelGG> alexyk, yes
<MichaelGG> AST-based macros
<MichaelGG> not textual .. yuck
<alexyk> MichaelGG: you have to provide Mono runtime separately, or can you package it with an app?
<MichaelGG> you cant link it without a license
<MichaelGG> or be GPL
<MichaelGG> in our case we pre install it
<MichaelGG> or we'd tell them to install it
<MichaelGG> we cn distro it and so on
<MichaelGG> just cant link to gpl
<MichaelGG> and thats just the runtime i think
<MichaelGG> some core parts.
<MichaelGG> the libraries are mostly MIT i think
<alexyk> MichaelGG: telling users to install Mono is a non-starter. The question is really if you can have a single installer determine whether they have it and/or provide it; better yet, if an app could have it local to itself...
<MichaelGG> alexyk, i think you need to qualify that with the type of app.
<MichaelGG> for the apps were doing , its a non-issue
<alexyk> MichaelGG: general-purpose, to be downloadable form the web for windows, mac and linux
<MichaelGG> im pretty sure mono can go local
<MichaelGG> i dont see why not
<MichaelGG> alexyk, oh yea in general, probably not
<MichaelGG> i'd have to streamline the installer
<MichaelGG> But A: i dont do cross platform
<MichaelGG> if its a windows app, thats it, and ill use .net
<MichaelGG> so for the server apps, its Linux
<MichaelGG> and installnig mono aint too hard
mfp has quit [Read error: 104 (Connection reset by peer)]
<MichaelGG> and finally, we ship hardware or virtual appliances anyways
<MichaelGG> installing .net isnt hard
<MichaelGG> VS will do it for ya. just streamlines the .net install into your app
<MichaelGG> installer
<alexyk> MichaelGG: ok...
<MichaelGG> anyways, F# gives me a lot of options
<MichaelGG> I can do .net style, F#/oo style, ocaml style
<alexyk> MichaelGG: do you do Gtk at all with F#?
<MichaelGG> no
<MichaelGG> for interfaces i stick to .net/wpf or silverlight
<MichaelGG> i dont write cient apps for mac/linux
<MichaelGG> its mainly voip backend work
<MichaelGG> so
<alexyk> MichaelGG: I'm pondering learning proprietary WPF vs Gtk which installs on Windows fine
<MichaelGG> well WPF kicks the crap out of GTK
<MichaelGG> if you can live with windows only
<MichaelGG> otoh, WPF subset is silverlight, so thats Mac and Windows, and soon Linux too.
<MichaelGG> WPF is a beauty to work with
<MichaelGG> so elegant, easy, slick
<alexyk> is WPF not in Mono?
<MichaelGG> no.
<MichaelGG> a subset is in Moonlight, to do silverlight
<MichaelGG> but WPF is win only otherwise
<MichaelGG> so if you need client linux, yea youre stuck :P
<MichaelGG> i dunno. just like i never would work ona project where I had to use C or VB
<alexyk> can you do forms in C# (sorry everybody) and use them with F#? I tried to drop a GUI in VS which is only in C# now
<MichaelGG> I'd avoid projects where i had to use GTK or WinForms or whatever
<MichaelGG> alexyk, yes
<MichaelGG> until F# gets a designer
<MichaelGG> thats how i do it
<MichaelGG> C# root project with whatever i need from the tool support
<MichaelGG> F# everywhere else.
<MichaelGG> i imagine over the next year we'll see things get slicker.
<alexyk> so how do you process form inputs -- C# GUI becomes what, something calleable as a whole?
<MichaelGG> either handle events directly
<MichaelGG> or handle them in C# and pass data to F#
<MichaelGG> F# can access all the C# stuff
<MichaelGG> so if you have a form, you can just do it like you would in C#
<MichaelGG> read a textbox, handle X event, etc
<MichaelGG> in ASP.NET MVC its even better
<MichaelGG> the MVC views post direct to an F# controller
<alexyk> interesting... OCaml led me to F# which sucked me into .net... would never fathom that a year ago -- now I ordered "Illustrated C# 2008" to understand delegates and properties and such stuff... to make GUIs in C# and call them from F#... horrors
<MichaelGG> haha
<MichaelGG> Ive been on .net since beta 1
<MichaelGG> for the most part it has a good design
<MichaelGG> i dont see how id survive in a real app without access to all the libs
<alexyk> in F# you can't have functors and it sucks, can't port some OCaml I need
<alexyk> 'cause .NET CTS is inferior and not fully FP ready
<MichaelGG> yea
<MichaelGG> theyre lucky to have generics :P
<MichaelGG> that was direct work o the MS Research Cambrige and Don Syme (F#)
<alexyk> surely .net has more libs than ocaml, but they're all M$
mfp has joined #ocaml
<MichaelGG> not really
<MichaelGG> Mono, for one
<MichaelGG> and tons of third party
<alexyk> so it all smells of BillG
<MichaelGG> yea if you have some moral opposition...
<MichaelGG> for me, whatever.
<MichaelGG> works great
<alexyk> well many Linux folks here will hate to put a toe into Windows, so that's why I feel weird doing it :)
<alexyk> MichaelGG: but it works, and IntelliSense is cool, so I like it
<MichaelGG> yea, and i didnt like havint to deal with linux
<MichaelGG> then I said "hey, this is a simple app, I get some nice clustering via OpenVZ, and I save $1600 a deployment"
<MichaelGG> and we decided ot target linux
<MichaelGG> i still scoff when i look at, say, mysql or linux clustering versus MSCS
<purple_> newbi question - I have an open channel created with open_in, how can I read n characters to construct a string of length n
<MichaelGG> its still annoying when mono doesnt have certain libs... but whatever
<alexyk> ok... time to compile
<MichaelGG> oh thats the one thing i hate about F#
<MichaelGG> compared to C#
<MichaelGG> it compiles soooo much slower
<MichaelGG> C# is about instantaneous, even with 50K+ lines
<MichaelGG> ok well i think my propane heater is leaking
<MichaelGG> cause it smells like gas and i have a headache
<MichaelGG> so im gonna sort that out
<MichaelGG> bbl
jknick has joined #ocaml
<mbishop> just don't have a cigarette while you think of what the problem might be :P
<purple_> is the only way to do it effeciently, to read using input_char into a list and then reverse and concat to a string ?
<alexyk> purple_: use Buffer.add_char, then Buffer.contents
<alexyk> if you need to revert the buffer, http://codepad.org/I5sPOxrA
<mbishop> er
<mbishop> what are you doing?
<alexyk> mbishop: you're asking me? :)
<purple_> alexyk - thanks
<mbishop> I was asking purple_, didn't see what he was originally asking for
<alexyk> ok
<mbishop> sounded like he wanted 'really_input'
<purple_> its a binary file i am trying to parse (i have a c++ implementation - so this is learning ocaml for me ) which has some ascii mixed in it which i would like to extract to string type, the positions of the text are fixed offset hense need to read from current pos to fixed offset
rogo has joined #ocaml
alexyk has quit []
struktured_ has quit [Read error: 60 (Operation timed out)]
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
struktured_ has joined #ocaml
threeve has joined #ocaml
threeve has quit [Client Quit]
threeve has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Client Quit]
apples`` has joined #ocaml
palomer has joined #ocaml
rogo has left #ocaml []
struktured_ has quit [Read error: 110 (Connection timed out)]
apples` has quit [Read error: 110 (Connection timed out)]
apples`` is now known as apples`
struktured_ has joined #ocaml
[L]ink has joined #ocaml
jknick has quit ["leaving"]
jeddhaberstro_ has quit []
alexyk has joined #ocaml
threeve has quit []
pumpkin_ has quit []
alexyk has quit []
jeremiah has quit [Read error: 104 (Connection reset by peer)]
apples` has quit ["Leaving"]
jeremiah has joined #ocaml
ulfdoz has joined #ocaml
ygrek has joined #ocaml
asabil has joined #ocaml
middayc_ has joined #ocaml
Axioplase has joined #ocaml
Axioplase has quit [Client Quit]
middayc has quit [Read error: 110 (Connection timed out)]
filp has joined #ocaml
jeremiah has quit [Read error: 110 (Connection timed out)]
_zack has joined #ocaml
Gionne has joined #ocaml
Gionne has quit [Remote closed the connection]
ulfdoz has quit ["deprecated"]
ygrek has quit [Remote closed the connection]
Axioplase has joined #ocaml
Gionne has joined #ocaml
<Gionne> http://pastebin.ca/1268449 line 54 This expression has type Ast.symbol but is here used with type 'a list why?
Gionne has quit ["Leaving"]
__me has joined #ocaml
ygrek has joined #ocaml
tcr has joined #ocaml
<tcr> Is there a standard module which contains functions like identity, compose?
vixey has joined #ocaml
Axioplase has quit ["leaving"]
<mellum> tcr: no. identity is (=), though.
tcr has quit ["Leaving."]
fschwidom has joined #ocaml
<flux> mellum, no it's not
<flux> usually it's let identity a = a
<flux> I guess batteries will have these kind of basic functions available (const, identity, flip; ignore we already have)
<flux> actually we _do_ have %identity, which you could use in defining an efficient identity function..
|Raynes| has joined #ocaml
middayc has joined #ocaml
[L]ink has quit [Nick collision from services.]
middayc_ has quit [Read error: 60 (Operation timed out)]
|Raynes| is now known as [L]ink
struktured_ has quit [Read error: 110 (Connection timed out)]
<mellum> flux: if that is more efficient that let identity a = a, then the compiler is *really* lame...
<flux> mellum, well, it's more efficient if you're using bytecode compiler and identity is defined in another module..
<flux> I'd imagine bytecode doesn't inline across modules
<flux> but as native compiler does, I wonder if it has any effect on that
<mellum> okay, I never use the bytecode interpreter, so I don't really care about that case... but yeah, it's probably not so reasonable to expect it to inline across modules
<flux> mellum, never used the bytecode interpreter? haven't you noticed how much faster it is, especially due to not doing inlining hence requiring smaller dependencies :)
<mellum> flux: well, I do mostly smallish projects...
struktured_ has joined #ocaml
struktured_ has quit [Read error: 110 (Connection timed out)]
glondu has quit [Read error: 104 (Connection reset by peer)]
Snark_ has joined #ocaml
ygrek has quit [Remote closed the connection]
vixey has quit [Remote closed the connection]
halberd has joined #ocaml
hkBst has joined #ocaml
composer_ has left #ocaml []
Snark_ has quit ["Ex-Chat"]
halberd has quit ["This computer has gone to sleep"]
struktured_ has joined #ocaml
Camarade_Tux has joined #ocaml
glondu has joined #ocaml
struktured__ has joined #ocaml
[L]ink has quit [Read error: 110 (Connection timed out)]
tomh- has joined #ocaml
struktured_ has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has joined #ocaml
Camarade_Tux has quit ["Leaving"]
asabil has quit ["Ex-Chat"]
alexyk has joined #ocaml
struktured__ has quit [Read error: 110 (Connection timed out)]
apples` has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
pumpkin_ has joined #ocaml
tomh- has quit ["http://www.mibbit.com ajax IRC Client"]
tomh- has joined #ocaml
<alexyk> when you have a multiple choice with guard, |x|y when guard -> ..., will the guard apply to all or only the last one?
<Smerdyakov> The grammar in the manual tells you.
<alexyk> Smerdyakov: happy Thxgiving! :)
<thelema> alexyk: iirc yes.
<alexyk> thelema: yes what? :)
<thelema> alexyk: yes, the guard applies to the whole set of clauses
<alexyk> thelema: cool, that's what I needed
<alexyk> here's the proof:
<alexyk> # let x = 1 in match x with |1|2 when true -> 1 | _ -> 2;;
<alexyk> - : int = 1
<alexyk> # let x = 2 in match x with |1|2 when true -> 1 | _ -> 2;;
<alexyk> - : int = 1
<thelema> umm, I don't think that proves it.
<thelema> [when true] does nothing.
<thelema> try the same thing with [when false]
<alexyk> thelema: I get 2 in both cases, for 1 and 2
<Smerdyakov> The proof is the grammar in the manual.
<alexyk> no difference for 1 and 2 on both paths... Smerdyakov: the manual is the ideal, we need to check if it's implemented correctly :)
<alexyk> anyone uses toplevel readline from programmer-monk?
<alexyk> (that's a very neat toplevel enhancement...)
__me has left #ocaml []
<Smerdyakov> Largely irrelevant. I always run 'ocaml' from within Emacs or rlwrap.
<alexyk> Smerdyakov: works very nicely from ocaml itself, I just can't find C-r equivalent, although it says it implements GNU readline; arrow keys work fine
<alexyk> I also run from under Emacs, and did a TextMate script for sending to iTerm with ocaml in it
<alexyk> Smerdyakov: cam rlwrap do multi-lines at once?
<Smerdyakov> Beats me.
<alexyk> it's annoying to arrow-up through a whole last function line by line
<Smerdyakov> I never enter function definitions interactively, so I have no such issue.
<thelema> alexyk: getting 2 reveals that the [when false] applies to both 1|2
<alexyk> thelema: yes
alexyk has quit []
Galdo has joined #ocaml
<Galdo> hi, i know that this is an easy function to do, but i can't find the function in the standard ocaml functions : a function that splits a string in several strings (cutting on each char 'c' for instance)
[L]ink has joined #ocaml
<flux> galdo, Str.split
<flux> galdo, or perhaps you want to take a look at the Pcre package for ocaml
<Galdo> # Str.split ;;
<Galdo> Reference to undefined global `Str
<flux> #load "str.cma";;
MichaelGG has quit [Read error: 110 (Connection timed out)]
MichaelGG has joined #ocaml
<Galdo> ok thanks
Snark has joined #ocaml
<Galdo> in the example given in the manual : "For instance, split (regexp [ \t]+ ) s splits s into blank-separated words" ; i think that the quotes are missed
<Galdo> are missing*
<thelema> Galdo: my copy has the quotes
fschwidom has quit [Connection timed out]
Camarade_Tux has joined #ocaml
<Galdo> when i said manual i meant "man Str" in the a terminal
<thelema> you're right.
<thelema> something's wierd there.
<flux> that's some unfortunate markup. a bug in ocamldoc perhaps?
<flux> later in split_delim there are quotes
alexyk has joined #ocaml
<flux> maybe it's a genuine bug, not a feature?-)
<thelema> sometimes...
<thelema> I have [""; abc; ], when I should have [""; abc; ""]
fschwidom has joined #ocaml
love-pingoo has joined #ocaml
Yoric[DT] has joined #ocaml
<thelema> hi Yoric[DT]. Still overworked?
[L]ink has quit [Read error: 110 (Connection timed out)]
<mbishop> impressive
alexyk has quit []
<Yoric[DT]> hi
filp has quit ["Bye"]
slash_ has quit [Client Quit]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
vixey has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Client Quit]
<flux> so that's what the video link in planet caml was about..
Galdo has quit [Remote closed the connection]
_zack has quit [Remote closed the connection]
fschwidom has quit [Remote closed the connection]
_zack has joined #ocaml
<Yoric[DT]> thelema: sorry, I was afk.
<Yoric[DT]> Yes, still overworked.
<Yoric[DT]> I have 6 or 7 patches to commit, though.
<Yoric[DT]> I just can't spare the brainpower to fix conflicts for the moment.
<thelema> well, today's thanksgiving in the US - we're taking time off to remember what we're thankful for.
<thelema> I give you permission to share in our holiday for a little while. :)
<Yoric[DT]> :)
<Yoric[DT]> Actually, I'm much to busy to share in any holiday :)
<Yoric[DT]> s/to/too/
<thelema> a little while.
* Yoric[DT] is currently writing a small spell-checker (in Java) which his students will have to rewrite by themselves on Tuesday.
<pumpkin_> use tries!
<pumpkin_> :D
<_zack> rather, use ocaml :)
pumpkin_ is now known as pumpkin
<Yoric[DT]> Well, OCaml will be next term.
<pumpkin> use tries in ocaml!
<pumpkin> tries + levenshtein automata = epic spellchecker
mfp has quit [Remote closed the connection]
middayc_ has joined #ocaml
_zack has quit [kornbluth.freenode.net irc.freenode.net]
thelema has quit [kornbluth.freenode.net irc.freenode.net]
jonafan has quit [kornbluth.freenode.net irc.freenode.net]
ppsmimou has quit [kornbluth.freenode.net irc.freenode.net]
ppsmimou has joined #ocaml
jonafan has joined #ocaml
thelema has joined #ocaml
_zack has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
Snark has quit ["Ex-Chat"]
purple_ is now known as purple
purple is now known as Guest65408
Guest65408 is now known as purple_
marmotine has joined #ocaml
love-pingoo has quit [Read error: 145 (Connection timed out)]
love-pingoo has joined #ocaml
<Yoric[DT]> pumpkin: what's "tries" exactly?
<Camarade_Tux> patricia trees :)
Camarade_Tux has quit ["Leaving"]
<Yoric[DT]> :)
<thelema> has anyone worked with burstsort? http://en.wikipedia.org/wiki/Burstsort
mtrimpe has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
marmotine has quit ["mv marmotine Laurie"]
fschwidom has joined #ocaml
sporkmonger has joined #ocaml
tomh- has quit ["http://www.mibbit.com ajax IRC Client"]
Yoric[DT] has quit [Read error: 104 (Connection reset by peer)]
mtrimpe has quit [Read error: 104 (Connection reset by peer)]
mtrimpe has joined #ocaml
fschwidom has quit [Remote closed the connection]
mbtrimpe has joined #ocaml
mtrimpe has quit [Read error: 104 (Connection reset by peer)]
tomh- has joined #ocaml
mbtrimpe has quit []
<mbishop> Hmm, neat, Ocaml bindings for llvm
vixey has quit ["There exists an infinite set!"]
_zack has quit ["Leaving."]