gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
thatch has quit [Remote host closed the connection]
<thelema> any opinions for syntax for Option.default (fun o d -> match o with Some x -> x | None -> d)
<thelema> Some 10 // 3
sepp2k has quit [Quit: Leaving.]
<thelema> None // 3
<thelema> let x = List.Exceptionless.find (fun i -> i > 5) // 5 in ...
<thelema> oops, forgot the list argument
<thelema> let x = List.Exceptionless.find (fun i -> i > 5) lst // 5 in ...
Yoric has quit [Quit: Yoric]
alexyk has joined #ocaml
<alexyk> whe using caml-getopt, how do we get the rest of the args, which are not options?
<thelema> aren't they left in sys.argv?
ulfdoz_ has joined #ocaml
arubin has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
ulfdoz_ is now known as ulfdoz
<alexyk> thelema: but they are not marked there... I found you use a function others for them, so I just push them into an enum
Edward_ has joined #ocaml
thatch has joined #ocaml
surikator has joined #ocaml
thatch has quit [Read error: Connection reset by peer]
thatch has joined #ocaml
Edward_ has quit []
Amorphous has quit [Ping timeout: 272 seconds]
lamawithonel has quit [Remote host closed the connection]
Fullma has quit [Ping timeout: 240 seconds]
surikator has quit [Read error: Connection reset by peer]
surikator has joined #ocaml
Amorphous has joined #ocaml
thatch__ has joined #ocaml
thatch has quit [Read error: Connection reset by peer]
arubin has quit [Quit: arubin]
SodiumChloride is now known as NaCl
thatch has joined #ocaml
thatch__ has quit [Ping timeout: 264 seconds]
alexyk has quit [Quit: alexyk]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
<hcarty> thelema: I use ( |? ) for that
<hcarty> thelema: let x = List.Exceptionless.find (fun i -> i > 5) lst |? 5 in ...
alexyk has quit [Read error: Connection reset by peer]
eye-scuzzy has quit [Ping timeout: 260 seconds]
eye-scuzzy has joined #ocaml
eye-scuzzy has quit [Remote host closed the connection]
eye-scuzzy has joined #ocaml
eye-scuzzy has quit [Ping timeout: 240 seconds]
eye-scuzzy has joined #ocaml
surikator has quit [Quit: surikator]
hcarty has quit [Ping timeout: 276 seconds]
thatch has left #ocaml []
Modius has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
hcarty has joined #ocaml
edwin has joined #ocaml
ygrek has joined #ocaml
ygrek has quit [Remote host closed the connection]
caligula_ has quit [Ping timeout: 265 seconds]
<adrien> don't know if anyone is using sourceforge to host projects but this is worth reading: http://www.h-online.com/open/news/item/SourceForge-disables-servers-after-break-in-1179756.html (url says it all, and passwords have been reset)
ygrek has joined #ocaml
caligula has joined #ocaml
mike_mcclurg has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
ikaros has joined #ocaml
lewis1711 has joined #ocaml
boscop has joined #ocaml
sepp2k has joined #ocaml
jm has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
spearalot has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
Edward_ has joined #ocaml
surikator has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
lewis1711 has left #ocaml []
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
surikator has quit [Quit: surikator]
Associat0r has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
Associat0r has quit [Quit: Associat0r]
eye-scuzzy has joined #ocaml
surikator has joined #ocaml
surikator has quit [Quit: surikator]
Associat0r has joined #ocaml
ygrek has joined #ocaml
thatch has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
spearalot has quit [Ping timeout: 255 seconds]
jm has quit [Ping timeout: 240 seconds]
Associat0r has quit [Quit: Associat0r]
Yoric has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
jm has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
avsm has joined #ocaml
eye-scuzzy has joined #ocaml
eye-scuzzy has quit [Client Quit]
Fullma has joined #ocaml
elehack has joined #ocaml
ymasory has joined #ocaml
mal`` has quit [Quit: Coyote finally caught me]
mal`` has joined #ocaml
mike_mcclurg has quit [Ping timeout: 240 seconds]
kaustuv_ has quit [Read error: Connection reset by peer]
eye-scuzzy has joined #ocaml
yroeht has joined #ocaml
deavid has joined #ocaml
<deavid> hi, i'm looking for resources to start learning ocaml
<rwmjones> other links here
<rwmjones> unfortunately ocaml-tutorial.org is down at the moment
Yoric has quit [Ping timeout: 245 seconds]
<deavid> and some exercises will be useful too
<rwmjones> I think the hickey book above has some
<deavid> :-) ok, so i'll take a look into the pdf
Yoric has joined #ocaml
<deavid> rwmjones: i saw twice somethong about F Sharp and ocaml. F Sharp is a dot NET implementation of Ocaml?
alexyk has joined #ocaml
<rwmjones> deavid: no, f# is a completely different language which was originally based on ocaml
<orbitz> different in kind of crappy ways
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 250 seconds]
ulfdoz_ is now known as ulfdoz
elehack has quit [Ping timeout: 260 seconds]
opla2 has joined #ocaml
elehack has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
<opla2> i have a list... List<SubClass> i wanna concatenate this list to List<BaseClass>.. to form a new List<BaseClass>
<mrvn> then you need to coerce each SubClass before appending it to the list.
<mrvn> or can one coerce the list itself?
<mrvn> base @ (sub :> BaseClass)?
<opla2> i hoped so
<opla2> base @ (sub :> List<BaseClass>)?
<opla2> or base @ (sub :> BaseClass list)?
<mrvn> The later. <> is C++
alexyk has joined #ocaml
<mrvn> val bl : base list = [<obj>]
<mrvn> val sl : sub list = [<obj>]
<mrvn> # bl @ (sl :> base list);;
<mrvn> - : base list = [<obj>; <obj>]
alexyk has quit [Read error: Connection reset by peer]
Edward_ has quit []
ulfdoz has quit [Quit: deprecated]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
Yoric has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
oriba has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
alexyk has joined #ocaml
joewilliams is now known as joewilliams_away
opla2 has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
surikator has joined #ocaml
Yoric has quit [Quit: Yoric]
maurer_ has joined #ocaml
<maurer_> Say I have a record of type "val foo : {bar : int; baz : int; }" and I want to use it to create a new record that is the same in every way, but has a different value for baz
<maurer_> What would the syntax be for that?
<maurer_> (I'm looking for something like Haskell's record update syntax)
<mrvn> type 'a foo = { bar:int; baz:'a; }
<mrvn> or do you mean { foo whit baz=17; }?
<orbitz> with
<orbitz> maurer_: { some_foo with baz=21; }
<maurer_> I think I mean the second one. I'll look up the with keyword
Associat0r has joined #ocaml
ulfdoz has joined #ocaml
oriba has quit [Quit: Verlassend]
mjonsson has joined #ocaml
surikator has quit [Quit: surikator]
Associat0r has quit [Quit: Associat0r]
Yoric has joined #ocaml
arubin has joined #ocaml
Edward_ has joined #ocaml
alexyk has joined #ocaml
alexyk_ has joined #ocaml
ygrek_ has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk_ is now known as alexyk
ygrek has quit [Ping timeout: 240 seconds]
alexyk has quit [Read error: Connection reset by peer]
pantsd has joined #ocaml
<pantsd> How do I go about importing Array.findi ?
alexyk has joined #ocaml
<adrien> "importing"? what do you want to do with it?
<orbitz> pantsd: ocaml doesn't really have tha concept. You can open Array, or you could do let findi = Array.findi, or you could shorten the name with soemthign like let module A = Array in A.findi
alexyk has quit [Read error: Connection reset by peer]
<thelema> pantsd: the stdlib is available to all programs, without extra incantations. just use the full name of the function, or open the module it's in
<pantsd> So if its in ExtLib should include ExtLib just work if I've got it installed correctly?
<thelema> ah, external libraries are another issue.
<thelema> you have to tell the compiler to use modules found in other paths. The easiest way to do this is ocamlfind
<thelema> ocamlfind ocamlc -package extlib foo.ml -o foo
<adrien> and, if it's in ExtLib, you'd access it like "ExtLib.Array.findi", or ("open ExtLib" and "Array.findi"): "open ExtLib" would hide the previously defined "Array" module [ and compile as thelema said ]
<thelema> and "include Module" is usually wrong, "open Module" is usually better
<pantsd> ah shiny
<pantsd> thanks
<adrien> btw, does "include Module" make programs bigger? in other words: does it duplicate the code of the module?
ygrek_ has quit [Ping timeout: 240 seconds]
<thelema> adrien: probably, test to find out
maurer_ has left #ocaml []
elehack has quit [Ping timeout: 240 seconds]
<mrvn> include module makes your module a derivative. you have all the functions and values that module has. Usualy you just want to use the other module without having to use the full path.
<mrvn> So if you want to extend Array with a few extra functions you include Array.
<adrien> yeah, did that with lablgtk, which does not have the smallest modules on earth :P
elehack has joined #ocaml
Yoric has quit [Quit: Yoric]
jm has quit [Remote host closed the connection]
edwin has quit [Remote host closed the connection]
doodo has joined #ocaml
Anarchos has joined #ocaml
<doodo> man this sux. I can barely write basic ocaml functions and i am expected to be able to traverse abstract syntax trees ಠ_ಠ
<arubin> Keep practicing.
<thelema> traversing ASTs is really easy, you just have to say what to do at each level, no?
<adrien> should be easy once you get used to pattern-matching, which should hopefully be really soon(tm)
<doodo> well I am ocaml retarded. If i didn't have moral objections i would just pay someone to do this
<thelema> it'll just click, probably soon. Probably sooner if you complain less
<doodo> I honestly don't seem the point in learning how to write a compiler
<elehack> doodo: because learning well-reasoned, standard methods for parsing and processing data is helpful in many places.
<elehack> lots of programs parse something and turn it in to something else.
<elehack> compiler techniques provide well-understood methods for doing it that can be easily extended when (not if) your requirements change in 3 months.
<doodo> not for me. I am just trying to pass this class to graduate then I am going to do something as far from programming as possible
<thelema> elehack: one could argue that all programs are taking in input, processing it into an internal representation, manipulating that representation, and outputting the result
<elehack> thelema: for batch programs, probably. gets a little fuzzier for interactive programs.
<elehack> but even GUI programs probably need to parse something somewhere, even if it's only their config files.
<thelema> elehack: except usually there's a library (JSON or something) to handle the config file
<elehack> yes, there is.
<thelema> that said, I agree wholehartedly that being able to understand parsing is fundamental to being a good programmer
<adrien> sexplib too =)
<thelema> but apparently doodo doesn't want to be a good programmer
<doodo> I don't want anything to do with programming
<doodo> but i am a semester away from graduating so I am pretty much stuck
<elehack> understandable. doesn't make much sense to try to change majors now, and the existence of a degree is useful for getting a job.
<doodo> Yeah and the jobs I am going to get aren't going to require understanding how to build a compiler or functional programming
<arubin> doodo: What is your major?
<doodo> Computer Science
<arubin> And what kind of work are you hoping to do?
<doodo> anything that doesn't involve programming
<alpounet> like?
<doodo> I don't really have a plan yet. I figure get some entry application dev in c++ or something or go to grad school for music
surikator has joined #ocaml
<doodo> or work retail. I worked for a fortune 500 company's systems RD and I would rather work retail than that. It was the worst experience of my life
<Anarchos> i can't build ocamlbuildlight.byte : i get Exit code 255 while executing this command: ../ocamlcomp.sh (....)
<arubin> How is an entry level C++ position not programming?
<doodo> I mean for like a small company
<doodo> If i can get one ill take it
<arubin> A C++ programmer who cannot figure out basic OCaml functions is a bit scary.
<doodo> I just cant' do ocaml
<hcarty> doodo: For what it's worth - if you go with the class, rather than fighting it the whole way, it will make the next few months much more enjoyable.
alpounet has quit [Ping timeout: 250 seconds]
groovy2shoes has joined #ocaml
<doodo> in any case this assignment is bs for only having a week to learn ocaml
<arubin> A week seems reasonable.
<arubin> You are a semester away from finishing a CS program. You should be able to pick up new languages fairly quickly.
alpounet has joined #ocaml
<doodo> I honestly haven't programmed for like 5 months
<doodo> its all been theory classes and math classes
<thelema> doodo: ocaml does require you to think in different ways, hopefully that'll be useful however you end up.
joewilliams_away is now known as joewilliams
elehack has quit [Ping timeout: 246 seconds]
sav has joined #ocaml
<sav> are .idl files related to ocaml? can I "convert/translate" .idl to .h?
mjonsson has quit [Read error: Operation timed out]
mjonsson has joined #ocaml
elehack has joined #ocaml
<thelema> elehack: you still planning on improving the make release?
elehack has quit [Ping timeout: 276 seconds]
elehack has joined #ocaml
doodo has quit [Quit: Page closed]
<hcarty> sav: Depends on the .idl file. camlidl can be used with specially-crafted .idl files to generate OCaml interfaces for C libraries.
groovy2shoes has quit [Read error: Connection reset by peer]
<sav> oh, I see. thanks.
groovy2shoes has joined #ocaml
RyanRN has joined #ocaml