emmanuelux has quit [Remote host closed the connection]
boscop_ has joined #ocaml
shachaf has quit [Remote host closed the connection]
ismarc_netbook has joined #ocaml
joewilliams is now known as joewilliams_away
<ismarc_netbook>
Anyone here use piqi?
joewilliams_away is now known as joewilliams
philtor has joined #ocaml
shachaf has joined #ocaml
BiDOrD has joined #ocaml
vivanov has joined #ocaml
zpop has joined #ocaml
ulfdoz has joined #ocaml
boscop_ has quit [Ping timeout: 255 seconds]
vivanov has quit [Ping timeout: 255 seconds]
bzzbzz has quit [Quit: leaving]
vivanov has joined #ocaml
dnolen has quit [Quit: dnolen]
Tobu has joined #ocaml
axiles has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
mcclurmc_home has joined #ocaml
sepp2k has joined #ocaml
philtor has quit [Ping timeout: 268 seconds]
Tobu has quit [Quit: No Ping reply in 180 seconds.]
Tobu has joined #ocaml
ikaros has joined #ocaml
ygrek has joined #ocaml
Associat0r has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
axiles has quit [Remote host closed the connection]
joewilliams is now known as joewilliams_away
Yoric has joined #ocaml
Tobu has joined #ocaml
Associat0r has quit [Quit: Associat0r]
ygrek has quit [Ping timeout: 250 seconds]
boscop has joined #ocaml
ygrek has joined #ocaml
Yoric has quit [Quit: Leaving.]
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
ikaros has quit [Quit: Ex-Chat]
alexis_ has joined #ocaml
edwin has joined #ocaml
likebike has joined #ocaml
munga has joined #ocaml
ankit9 has quit [Quit: Leaving]
Yoric has joined #ocaml
eikke has joined #ocaml
ftrvxmtrx has joined #ocaml
G10h4ck has joined #ocaml
<G10h4ck>
hey all!
<G10h4ck>
in my book there is a function called take
<G10h4ck>
that take firts n element from a list
<G10h4ck>
for example
<G10h4ck>
take 2 [3;4;5;6]
<flux>
ocaml doesn't come with that function, if that is your question.
<G10h4ck>
return [3;4]
<G10h4ck>
exactly it say unbound value
<G10h4ck>
there is an alternative function ? and why that function is not present in ocmel ?
<flux>
there is no alternative function. there are many functions not in ocaml standard library :)
<rixed>
You have this function in Batteries.
<pou>
but you'll find this function in alternatives non-standard libraries like Batteries
<flux>
you could take a look into some alternative ocaml standard library projects, such as what rixed said
<pou>
...too late.
<G10h4ck>
mmm
<flux>
or write it yourself, it's good practice :)
<rproust>
let take n l = let rec aux n acc = function | [] -> acc | x::xs -> if n <= 0 then acc else aux (pred n) (x::acc) xs in List.rev (aux n [] l)
<rproust>
(haven't tried it, there might be errors)
G10h4ck has quit [Quit: KVIrc KVIrc Equilibrium 4.1.1, revision: 5727, sources date: 20110306, built on: 2011-04-28 17:57:39 UTC 5727 http://www.kvirc.net/]
<flux>
that's the advanced version. the basic version would be quite simpler..
<pou>
btw, is it possible, when you need such a function, to distribute Batteries sources with your project, so that you don't have to write a specific "prelude" file ?
G10h4ck has joined #ocaml
<G10h4ck>
it works very thanks!
<rixed>
What's a prelude file?
<pou>
like in Haskell
ygrek has quit [Ping timeout: 250 seconds]
rby has quit [Quit: Lost terminal]
<rixed>
pou: can't figure out what's a prelude file after 5min of haskell tutorial, sory :-/
rby has joined #ocaml
<pou>
many OCaml projects have to write their own combinators, which are not in the stdlib
ankit9 has joined #ocaml
<pou>
I wanted to know if the licensing of Batteries gives you the possibility to join only a small part of the sources to your project
<rixed>
pou: ah ok! This is LGPL, so you can use only a part of it (suposing you respect the other requirements of the LGPL, which are few)
<pou>
(Haskell's Prelude file contains all the usual functions & combinators, such as take, or functions composition...)
<rixed>
pou: Ok, it was my understanding that Prelude was like Pervasive.
<pou>
and the LGPL doesn't require your project to be free, am I right ?
<rixed>
pou: It does not require your project to be LGPL.
<pou>
ok
<pou>
thanks
<rixed>
pou: although, after re-reading the lgpl terms, it seams to require that the modified library stays a library :-/?
<rixed>
pou: so copy pasting some code from it onto your program code may not be permited. I suggest you ask to a gnu channel.
vivanov has quit [Ping timeout: 255 seconds]
<G10h4ck>
mm that exercise therethically should work
<G10h4ck>
Error: This expression has type 'a list -> 'a list
<G10h4ck>
but an expression was expected of type 'a list -> 'b -> 'b
<G10h4ck>
mmm
<G10h4ck>
nevermind
mlh has quit [Ping timeout: 250 seconds]
<likebike>
Hi guys, I'm sorry to ask such a basic question, but I can't find an answer anywhere. I'm trying to learn OCaml, and I would like to print out values from a script, just like the REPL does (something like "- : int = 1"). This is easy for simple things (like ints) but when I get into functions and more complex things, I don't know how to print them anymore. Can I somehow use that same print function that the REPL uses?
<flux>
likebike, REPL has information it builds when compiling the fragments you enter. your programs won't be able to print out custom values, that is, there is no function val print : 'a -> unit
<flux>
likebike, there are ways to cheat, though
<flux>
for example ExtLib (and Batteries) has Std.dump, which can do something, but it's useful mostly for debugging
<flux>
and then there is pa_deriving and other similar syntax extensions, that can generate code for printing out your values
<likebike>
ok. I will research those keywords. Thank you.
<likebike>
flux, Do you recommend ExtLib or Batteries?
<likebike>
(I'm assuming i need to choose one or the other)
<flux>
Batteries is more actively developed
<flux>
well, ExtLib isn't developed at all
ismarc_netbook has quit [Ping timeout: 268 seconds]
ismarc_netbook has joined #ocaml
oriba has joined #ocaml
* Yoric
is absolutely 100% honest and unbiaised and recommends Batteries.
* Yoric
hides behind an angelic smile.
oriba has left #ocaml []
<Yoric>
Anway, Batteries contains a version of ExtLib that is more up-to-date than ExtLib.
<likebike>
:) Thanks Yoric and flux. I'll use Batteries.
vivanov has joined #ocaml
ismarc_netbook has quit [Ping timeout: 276 seconds]
ismarc_netbook has joined #ocaml
G10h4ck has quit [Quit: KVIrc KVIrc Equilibrium 4.1.1, revision: 5727, sources date: 20110306, built on: 2011-04-28 17:57:39 UTC 5727 http://www.kvirc.net/]
alexis_ has quit [Remote host closed the connection]
<likebike>
While trying to install Batteries, I'm getting this error: Unknown build of camomile detected ( 0.8.3 ), cannot auto-config batcamomile
<likebike>
...does that mean I need to use an older version of Camomile?
<likebike>
...or should I try the latest git version of Batteries?
<likebike>
With some digging, I have found that I must downgrade Camomile to 0.8.2.
ismarc_netbook has quit [Read error: Connection timed out]
ismarc_netbook has joined #ocaml
ygrek has joined #ocaml
nannto_ has quit [Quit: Leaving...]
mcclurmc_home has quit [Ping timeout: 250 seconds]
mlh has joined #ocaml
Modius has quit [Read error: Connection reset by peer]
Modius has joined #ocaml
avsm has joined #ocaml
_andre has joined #ocaml
Anarchos has joined #ocaml
ismarc_netbook has quit [Read error: Connection timed out]
ismarc_netbook has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
lopex has joined #ocaml
munga has quit [Ping timeout: 276 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ismarc_netbook has quit [Ping timeout: 268 seconds]
ismarc_netbook has joined #ocaml
vivanov has quit [Ping timeout: 276 seconds]
_zack has joined #ocaml
<_zack>
am I missing something or there is no function in the ocaml stdlib to create a temporary dir in an atomic way?
lopex has quit [Ping timeout: 244 seconds]
lopex has joined #ocaml
iris1 has quit [Quit: iris1]
mjonsson has joined #ocaml
<f[x]>
_zack, no
<f[x]>
there is mkdtemp in janest-core
<_zack>
f[x]: ack, for now I've solved with Unix.open_process_in "mktemp -d", but thanks for the pointer
<_zack>
f[x]: do you have any idea if there is a feature request about that?
<f[x]>
haven't seen
Yoric has quit [Read error: Connection reset by peer]
Yoric1 has joined #ocaml
<f[x]>
and since 1 minute ago it is also in extunix :)
vivanov has joined #ocaml
Yoric1 has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
ismarc_netbook has quit [Read error: Connection timed out]
Snark has quit [Ping timeout: 255 seconds]
Snark has joined #ocaml
axiles has joined #ocaml
Yoric has quit [Quit: Leaving.]
Yoric has joined #ocaml
Yoric has quit [Remote host closed the connection]
<thelema>
likebike: sorry about the camomile 0.8.3 problem - it's an issue with the version detection in the makefile.
<thelema>
it would be sufficient to copy src/batCamomile-0.8.2.ml to src/batCamomile.ml, and everything would work fine
Yoric has joined #ocaml
dnolen has joined #ocaml
<hcarty>
adrien: http://0ok.org/cgit/cgit.cgi/xstrp4/ to track development until something more formal happens. There is now basic support for custom xstrp4 expansions.
chambart has quit [Ping timeout: 244 seconds]
chambart has joined #ocaml
lopex has quit [Ping timeout: 244 seconds]
_zack has left #ocaml []
lopex has joined #ocaml
ankit9 has quit [Quit: Leaving]
dnolen has quit [Quit: dnolen]
ikaros has joined #ocaml
lopex has quit []
joewilliams_away is now known as joewilliams
impy has quit [Ping timeout: 240 seconds]
impy has joined #ocaml
bzzbzz has joined #ocaml
ankit9 has joined #ocaml
Associat0r has joined #ocaml
mfp has quit [Ping timeout: 258 seconds]
Yoric1 has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
philtor has joined #ocaml
eikke has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
mfp has joined #ocaml
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
ulfdoz has quit [Ping timeout: 260 seconds]
Yoric1 has quit [Quit: Leaving.]
ulfdoz has joined #ocaml
eikke has joined #ocaml
ztfw has joined #ocaml
avsm has quit [Quit: Leaving.]
alexyk has joined #ocaml
<likebike>
Hey guys, Is there a webpage anywhere that lists projects that use Batteries? I am trying to figure out how to use Batteries, but a good example would really be useful!
<thelema>
likebike: there's some examples in examples/ of batteries source folder