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