flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
<palomer> (which, I think, is a shame)
ulfdoz_ has joined #ocaml
<palomer> http://pastebin.com/m54f23827 <-- here's your ansnwer
<palomer> answer
alexyk has joined #ocaml
<palomer> String.concat "" (List.map (function None -> bar | Some y -> y) (foo bar x)) = x <---anyone know of any easy way of writing a function foo that satisfies this predicat?
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
alexyk has quit []
alexyk has joined #ocaml
monadic_kid has quit ["Leaving"]
ulfdoz_ has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
ched_ has joined #ocaml
Ched has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
alexyk has joined #ocaml
hto has quit [Read error: 110 (Connection timed out)]
seafood has joined #ocaml
jeddhaberstro has quit []
ulfdoz_ has joined #ocaml
sgnb has quit [Read error: 104 (Connection reset by peer)]
sgnb has joined #ocaml
ulfdoz__ has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz__ is now known as ulfdoz
hto has joined #ocaml
ulfdoz_ has quit [Read error: 110 (Connection timed out)]
Proteus has joined #ocaml
<Proteus> I saw the announcement for camlspike but I can't find a download link. anyone know where to look?
<Proteus> any help would be greatly appreciated
alexyk has quit []
alexyk has joined #ocaml
alexyk_ has joined #ocaml
<Proteus> I saw the announcement for camlspike but I can't find a download link. anyone know where to look?
<Proteus> any help would be greatly appreciated
Associat0r has quit []
* palomer has never heard of camlspike
<palomer> new kind of shoe?
alexyk has quit [Connection timed out]
<Proteus> it's a library for working with spiking neura networks
<Proteus> neural, even
<Proteus> "Library for the (possibly distributed) simulation of networks of spiking neurons, with an emphasis on the quick and easy implementation of one's own neuron or synapse model."
<m3ga> Proteus: it was mention on planet ocamlcore : http://planet.ocamlcore.org/
<Proteus> yeah, but following the links, I can't find any released files
<m3ga> svn checkout svn://svn.forge.ocamlcore.org/svnroot/camlspikes
<m3ga> Proteus: svn what you're looking for?
<Proteus> or the package or whatever
<m3ga> did you have a look at whats in svn? i think its what you're looking for
sporkmonger has quit []
<alexyk_> hey guys, we're talking in #scala on whether you can partially apply a seocnd argument, i.e. not left-to-right, in ocaml??
<alexyk_> there's a fascinating discussion on reddit and http://enfranchisedmind.com/blog/posts/scala-not-functional/
<m3ga> alexyk_: let f a b = a + b ;; let a b = fun x -> f x b ;;
<m3ga> is that what you're after?
<m3ga> sorry : let f a b = a + b ;; let g b = fun x -> f x b ;;
<alexyk_> m3ga: sort of
<alexyk_> scala can do f(_,b)
<m3ga> so can nemerle
<alexyk_> so there's teh whole "conciseness" debate
<m3ga> hmm, debate, .... i think i'll go and cut some code :-)
<alexyk_> m3ga: my sentiment exactly, I use it to learn both languages better form examples :)
vithos has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
alexyk_ has quit []
cloudhead has quit []
Proteus_ has joined #ocaml
<tsuyoshi> you can partially apply a second argument using labels
<tsuyoshi> let foo ~bar ~baz = bar + baz in foo ~baz
<tsuyoshi> let foo ~bar ~baz = bar + baz in foo ~baz:1
Proteus has quit [Read error: 113 (No route to host)]
Camarade_Tux has quit ["Leaving"]
ulfdoz_ has joined #ocaml
Associat0r has joined #ocaml
<kaustuv> That debate about Scala is utter junk. I wish people would stop using "functional" or "object oriented" to qualify languages instead of programming patterns.
angerman has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
seafood has quit []
ulfdoz_ has joined #ocaml
<tsuyoshi> well.. "functional" is a nebulous description
<mrvn> functional is an attribute of the language. object orientated is a programming style. mostly.
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
<tsuyoshi> ok but determining whether a language is functional is a matter of opinion
<mrvn> I would look if the language allows currying
<tsuyoshi> so scheme isn't functional?
<mrvn> scheme has lambda
<tsuyoshi> so then you're just saying.. anything with closures allows currying
<mrvn> All functional languages I know have partial application
<mrvn> Lanugages like C or C++ have to manualy write data types to simulate that,
<mrvn> For me the difference is between function pointers like C has and functions as values like ocaml has.
ulfdoz_ has joined #ocaml
<mrvn> Or in other words wether you can do partial application on a function with indetermined number of arguments.
<tsuyoshi> what I think is.. python has closures, so maybe it's a functional language
<tsuyoshi> but the way it works is annoying and python annoys the hell out of me
<mrvn> That is the next step. What comes natural in the language? What does the standard lib use? In python closures are more an add on than the normal usage pattern.
<mrvn> So python has functional elements but is not naturally functional.
<mrvn> But there you go into opinion land and not hard facts.
vithos has joined #ocaml
<tsuyoshi> it is a hard fact that I hate python though
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
ikaros has joined #ocaml
_zack has joined #ocaml
ulfdoz_ has joined #ocaml
s4tan has joined #ocaml
komar_ has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
Yoric[DT] has joined #ocaml
Alpounet has joined #ocaml
naufraghi has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
ulfdoz_ has joined #ocaml
ulfdoz__ has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz__ is now known as ulfdoz
<Associat0r> if it ain't broke it's functional
ulfdoz_ has quit [Read error: 110 (Connection timed out)]
ulfdoz_ has joined #ocaml
ulfdoz__ has joined #ocaml
Proteus has joined #ocaml
Proteus has quit [Client Quit]
ulfdoz has quit [Read error: 101 (Network is unreachable)]
ulfdoz__ is now known as ulfdoz
ulfdoz_ has quit [Read error: 110 (Connection timed out)]
jknick has quit ["Lost terminal"]
Proteus_ has quit [Read error: 110 (Connection timed out)]
s4tan has quit [Read error: 110 (Connection timed out)]
hkBst has joined #ocaml
ulfdoz has quit ["deprecated"]
rumbleca has quit [Read error: 110 (Connection timed out)]
nwardez has quit [anthony.freenode.net irc.freenode.net]
<flux> ocaml 3.10.2, ubuntu 8.10, Unix.getlogin throws an exception. Same with ocaml 3.11.1 (from godi) and ubuntu 8.04.
<flux> does it work for someone?-)
<flux> I'm pretty sure it used to work for me, because I've used it in a program of mine..
<flux> ocaml 3.11.0 from godi with ubuntu 9.04, same thing
nwardez has joined #ocaml
<Yoric[DT]> Same with 3.10.2 and Ubuntu 9.04
<Yoric[DT]> .with 3.10.2 and Ubuntu 9.04
<Yoric[DT]> Same here, that is.
<Yoric[DT]> And with 3.11.1 from GODI and 9.04.
<bacam> It works for me with 3.10.1 and 3.11 on SL5.
<Yoric[DT]> Maybe it's a problem with AppArmor?
rjack has joined #ocaml
<flux> AppArmor?
<Yoric[DT]> Works in C, though.
nwardez has quit [anthony.freenode.net irc.freenode.net]
<Yoric[DT]> flux: the new security manager used pervasively in Ubuntu.
<Yoric[DT]> (similar to SELinux, just as annoying)
<flux> oh, it hasn't annoyed me yet :)
<Yoric[DT]> Well, truth be told, it hasn't annoyed me yet either.
<Yoric[DT]> Still :)
nwardez has joined #ocaml
ambient has joined #ocaml
sbok has quit [anthony.freenode.net irc.freenode.net]
prigaux has quit [anthony.freenode.net irc.freenode.net]
mfp has quit [anthony.freenode.net irc.freenode.net]
LeCamarade has joined #ocaml
mfp has joined #ocaml
sbok has joined #ocaml
prigaux has joined #ocaml
jamii has joined #ocaml
Demonii has joined #ocaml
Demonii has left #ocaml []
Alpounet has quit ["Ex-Chat"]
seafood has joined #ocaml
barismetin has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
sporkmonger has joined #ocaml
seafood has joined #ocaml
verte has joined #ocaml
thelema has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
wmealing_ has joined #ocaml
pants2 has joined #ocaml
lutter has joined #ocaml
<wmealing_> few questions, very novice.. Can you run ocaml on the jvm ?
<wmealing_> next one, Has anyone written an android application in ocaml ?
<thelema> 1) kinda - see ocamljava: http://ocamljava.x9c.fr/
<thelema> 2) not that I know of
<wmealing_> ok.
pants1 has quit [Read error: 110 (Connection timed out)]
<wmealing_> the 1 and 2 are the main attractions towards scala at the moment, i'm not trolling.. just wanted to do something other than java.
<wmealing_> specifically a compiled language, but yeah.
<Yoric[DT]> Scala is nice, too.
* wmealing_ nods
<wmealing_> just trying to decide right now
<Yoric[DT]> Try both :)
<Yoric[DT]> I personally prefer OCaml.
<Yoric[DT]> But it's partly because of usage.
<Yoric[DT]> s/usage/habit/
deadc0de has joined #ocaml
vithos has quit [Connection timed out]
ikaros has joined #ocaml
deadc0de has left #ocaml []
<kaustuv> I stopped bothering with Scala because (1) I despise the JVM, and (2) the Scala type system is a horrid mess
<kaustuv> Oh, and (3) open recursion is one of the most questionable design patterns ever invented
verte has quit ["~~~ Crash in JIT!"]
AxleLonghorn has joined #ocaml
verte has joined #ocaml
verte has quit [Client Quit]
<hcarty> wmealing_: Someone mentioned Yeti yesterday, and it looks rather interesting - http://mth.github.com/yeti/
<hcarty> Apparently still quite young though
<Yoric[DT]> kaustuv: what's wrong with open recursion?
alexyk has joined #ocaml
<Yoric[DT]> Anyway, OPA will be better than anything :)
<Yoric[DT]> (or, well, everything)
<Yoric[DT]> :)
<Yoric[DT]> (the language upon which I'm currently working)
<Yoric[DT]> (actually, I'm currently debugging the type system)
<hcarty> Yoric[DT]: Ah, that sounds much more interesting
<Yoric[DT]> (implicit overloading is tricky)
<Yoric[DT]> More exactly, type inference in presence of overloading is tricky.
<hcarty> OCaml has certainly spoiled me when it comes to type inference
<Yoric[DT]> Well, we're trying to go further.
<hcarty> Yoric[DT]: Are the implications of "further" something one who is not formally trained in CS would reasonably understand?
ched_ has quit [Remote closed the connection]
<Yoric[DT]> Well, essentially, we also have overloading and structural types.
komar__ has joined #ocaml
<Yoric[DT]> It's more along the lines of "spoiling further" than on those of "further type inference" :)
<hcarty> Further spoiling is quite welcome
<hcarty> Is the intent to deliver these without needing the user to intervene? I can't think of the proper term right now...drat.
th5 has joined #ocaml
<hcarty> "let f (x : int) = x + 1" for example
<Yoric[DT]> Sorry, atm, I need to concentrate "further" to get that debugging right.
<hcarty> Not a problem, concentrate away :-)
<th5> How can I load a camlp5 module in the "plain" toplevel (without using ocaml -I +camlp5 camlp5o.cma first)? I tried #load "camlp5o.cma";; first (which works) but when I try to load the actual module it doesn't seem to do anything.
Camarade_Tux has joined #ocaml
<th5> nevermind - it looks like I needed to #load "pa_extend.cmo" first
komar_ has quit [Read error: 110 (Connection timed out)]
Snark has joined #ocaml
<th5> no - wait - that still doesnt work - just lets me #use the .ml file - hmm...
komar__ has quit [Read error: 110 (Connection timed out)]
komar_ has joined #ocaml
komar_ has quit [Remote closed the connection]
komar_ has joined #ocaml
LeCamarade has quit ["Gone."]
barismetin has quit [Remote closed the connection]
seafood has quit []
th5 has quit []
komar__ has joined #ocaml
komar_ has quit [Connection timed out]
ambient has quit []
Snark has quit ["Ex-Chat"]
Yoric[DT] has quit ["Ex-Chat"]
AxleLonghorn has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
Snark has joined #ocaml
AxleLonghorn has joined #ocaml
AxleLonghorn has quit [Client Quit]
AxleLonghorn has joined #ocaml
Maxibolt has joined #ocaml
<Maxibolt> hey
<Maxibolt> is it possible to declare an anonymous recursive function in ocaml ?
<mrvn> Maxibolt: how would you call it?
Camarade_Tux has quit ["Leaving"]
<AxleLonghorn> if you use the y-combinator, yes
<Maxibolt> mrvnthat's precisely the problem
<Maxibolt> in javascript for example, there is a special keyword
rjack has quit ["leaving"]
<mrvn> Best I can think of is to use continuation passing style.
<Maxibolt> you could have for an example "(function 0 -> 1 |n -> n * rec_call (n - 1)", dunno
Maxibolt has quit ["Miranda IM! Smaller, Faster, Easier. http://miranda-im.org"]
Ched has joined #ocaml
itewsh has joined #ocaml
* mrvn wonders what is wrong with (let rec fac = function 0 -> 1 | n -> n * (fac (n - 1)) in fac)
Mr_Awesome has quit ["aunt jemima is the devil!"]
sporkmonger has quit ["You'll never defeat me! http://sporkmonger.mybrute.com/"]
monadic_kid has joined #ocaml
_zack has quit [Read error: 110 (Connection timed out)]
itewsh has quit [Connection timed out]
komar__ has quit []
itewsh has joined #ocaml
komar__ has joined #ocaml
jeff_s_ has joined #ocaml
robocop has joined #ocaml
<robocop> hello.
<robocop> do you know how I can use ocamldoc with ocamlbuild ?
<flux> kaustuv, still, if you were tasked with a project that required the use of JVM, would you prefer something else to Scala?
Ched has quit [Remote closed the connection]
angerman_ has joined #ocaml
angerman has quit [Read error: 104 (Connection reset by peer)]
<robocop> jeff_s_: I try this : http://paste.pocoo.org/show/117459/
<robocop> but I've got a documentation without modules.
rwmjones is now known as rwmjones_afk
<jeff_s_> to help you I'd have to learn ocamlbuild, which I don't want to do right now :
<jeff_s_> :(
<hcarty> robocop: It's not a simple example, but you could look at Batteries
<hcarty> It has a rather significant ocamlbuild + ocamldoc setup from what I've heard
<robocop> hcarty: they use a makefil, no ?
<robocop> *+e
<robocop> http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=batteries/batteries.git;a=blob;f=Makefile.in;h=7cc6a34e63458fa344c3e8a33811dff4ba24965b;hb=d08592a366930f754775e0f24a3e1758eba27d1c
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
<hcarty> robocop: The makefile is just a wrapper around ocamlbuild calls
<AxleLonghorn> in aggregate, which is the most popular build system for libraries? make, ocamlbuild, omake, ... ?
<hcarty> AxleLonghorn: make is likely the most popular since at least a thin Makefile wrapper is required by godi
<hcarty> All three seem to be fairly widely used though. make has both OCamlMakefile and autoconf macros to ease its use. ocamlbuild has gained a lot of use since its introduction. And omake's users seem to really like it.
Yoric[DT] has joined #ocaml
Ched has joined #ocaml
slash_ has joined #ocaml
<jli> I've been trying to come up with a simple doubly-linked list implementation but I'm unable to wrap my head around how to work with OCaml's type system. could someone look at this and tell me what's wrong? http://paste.pocoo.org/show/117471/
<jli> it compiles fine, but add and remove don't work correctly, and it just seems like it could be done much more elegantly
Associat0r has quit []
<AxleLonghorn> you want to add to the front of the list, yes?
<jli> that's what I'm attempting, yes
<AxleLonghorn> what doesn't work?
<jli> when I add 2 elements to a list and remove one of them, the list is in an inconsistent state. it's somewhat difficult to debug because attempting to print a list with >1 element causes loops, because of the prev/next links
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
<AxleLonghorn> weird
<AxleLonghorn> how about, instead of using a data type
<AxleLonghorn> make the record type 'a dbl_node = { prev : 'a dbl_node option ref; next : 'a dbl_node option ref; value : 'a ref }
<AxleLonghorn> your add function takes a 'a dbl_list ref, so I'm wondering if
<AxleLonghorn> when you add something to it, you update the reference to point to the new head of the list
<AxleLonghorn> your add function results in a unit type, instead of the head of the list, which might be an easier way of resetting the head of the list
vithos has joined #ocaml
sporkmonger has joined #ocaml
<flux> jli, put a unique ID to each of the nodes in the list and write your own dumping function
<flux> unique ids you can generate with let mk_id = let v = ref 0 in fun () -> incr v; !v
<flux> jli, if you want to get extra trippy, you could dump GraphViz-compatible data and visualize your data structure that way
<AxleLonghorn> hmm, disregard my suggestion to remove the data type
iago has joined #ocaml
lutter has quit [Read error: 110 (Connection timed out)]
sgnb has quit [Remote closed the connection]
sgnb has joined #ocaml
AxleLonghorn has left #ocaml []
ikaros_ has joined #ocaml
<palomer> I can't find mk_expr_lst in the ocaml source
<palomer> anyone know where it's hiding?
<palomer> it's supposedly in the Gen module
<palomer> in camlp4
<palomer> can't find Gen.ide either
sporkmonger has quit []
komar__ has quit [Read error: 104 (Connection reset by peer)]
Snark has quit ["Ex-Chat"]
ikaros has quit [Read error: 110 (Connection timed out)]
<palomer> hrmph
<palomer> I have a string
<Yoric[DT]> good for you :)
<palomer> and I want to turn it into a polymorphic variant label
<palomer> in camlp4
Camarade_Tux has joined #ocaml
<palomer> so it would become an expr
<palomer> trying to get inspired by type-conv, I came across this: {let ide _loc id = <:expr< $lid:id$ >>}
<palomer> err, `$uid:foo$ seems to work
<palomer> though this seems a little undocumented
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
<Camarade_Tux> yeah, ocaml-gir is nearly clean of the references to webkit =)
peddie has quit [Connection timed out]
hkBst has quit [Read error: 104 (Connection reset by peer)]
<Camarade_Tux> only need to set the headers properly and a few other simple things, but then I'll have to debug and check everything in it :)
<Camarade_Tux> haha, there are 34 FIXMEs in my code :)
sporkmonger has joined #ocaml
angerman_ has quit []
Ched has quit [Remote closed the connection]
jli has quit [Read error: 104 (Connection reset by peer)]
jli has joined #ocaml
jeff_s_ has quit []
sporkmonger has quit ["You'll never defeat me! http://sporkmonger.mybrute.com/"]
kaustuv_ has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
tvn has joined #ocaml
<tvn> hi, how do I make change to an element in the list ? for example let l = [1;2;3;4] and I want to change 2 (2nd element) to 22
<Camarade_Tux> tvn, you can't "change" it, you have to create another list (or use an 'int ref list')
seafood has joined #ocaml
<tvn> ic
<tvn> in that case is there a build in function to extract say the first n element of the list ?
<tvn> something like range 2 l would give [1;2] ?
Yoric[DT] has quit ["Ex-Chat"]
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
Camarade_Tux has quit [Read error: 104 (Connection reset by peer)]
Camarade_Tux has joined #ocaml
<Camarade_Tux> don't know if it got through but I don't know a built-in function for that, it should be very quick to write one however
<Camarade_Tux> and /me -> bed
rwmjones_afk has quit ["Leaving"]
iago has quit ["Leaving"]
jeff_s_ has joined #ocaml
Kerris7_ has quit ["Don't even think about saying Candlejack or else you wi"]
jeff_s_ has quit [Client Quit]
jeff_s_ has joined #ocaml
jeff_s_ has quit [Client Quit]
monadic_kid has quit ["Leaving"]
Ariens_Hyperion has joined #ocaml
naufraghi has quit []
<jli> tvn: something like this? http://paste.pocoo.org/show/117501/
maskd has quit [Read error: 60 (Operation timed out)]
Alpounet has joined #ocaml
maskd has joined #ocaml
Ched has joined #ocaml
|jeremiah has quit [Read error: 104 (Connection reset by peer)]
<palomer> tvn, I think it's called "take", check the list module
<jli> patake doesn't exist in the list module
<jli> er, palomer: take*
<palomer> oh, wait, you'll have to use extlib
<palomer> extlib is great
<jli> is there a way to refer to the previously evaled thing at the ocaml toplevel?
<jli> like "*" in Common Lisp or "v(-1) in Erlang?
<jli> "v(-1)"
<palomer> errr, I don't know of any
<palomer> I don't use the toplevel, though
cygnus has joined #ocaml
jeremiah has joined #ocaml
<jli> how do I open the str library at the toplevel? #load "str.cma" doesn't seem to do it
<jli> er, nevermind.
Ariens_Hyperion has left #ocaml []