<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>
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
<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)]
<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