gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
KDr2 has quit [Remote host closed the connection]
oriba has quit [Quit: oriba]
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
cdidd has joined #ocaml
asdfhjkl has quit [Quit: Leaving]
letrec has quit [Ping timeout: 255 seconds]
KDr2 has joined #ocaml
iago has joined #ocaml
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
iago has quit [Quit: Leaving]
mnabil has quit [Remote host closed the connection]
yroeht has quit [Ping timeout: 246 seconds]
yroeht has joined #ocaml
fantasticsid has joined #ocaml
Xizor has quit []
datkin has quit [Ping timeout: 272 seconds]
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Tobu has quit [Ping timeout: 260 seconds]
fantasticsid has joined #ocaml
fantasticsid has quit [Client Quit]
fantasticsid has joined #ocaml
Tobu has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
jimmyrcom has quit [Ping timeout: 276 seconds]
yrlnry has quit [Ping timeout: 272 seconds]
philtor has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
ulfdoz has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
Tobu has quit [Ping timeout: 260 seconds]
philtor has quit [Ping timeout: 246 seconds]
Tobu has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
pango is now known as pangoafk
silver has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
Cyanure has joined #ocaml
ocp has joined #ocaml
<adrien> hi
ftrvxmtrx has joined #ocaml
cago has joined #ocaml
Hobbestigrou has joined #ocaml
<Hobbestigrou> hi
<Hobbestigrou> ocaml is very cool :)
<Hobbestigrou> i subscribe to caml mailing-list
djcoin has joined #ocaml
Hobbestigrou has left #ocaml []
Cyanure has quit [Remote host closed the connection]
gnuvince has quit [Ping timeout: 252 seconds]
thomasga has joined #ocaml
gnuvince has joined #ocaml
Kakadu has joined #ocaml
Cyanure has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
yrlnry has joined #ocaml
avsm has joined #ocaml
KDr2 has quit [Remote host closed the connection]
avsm has quit [Ping timeout: 244 seconds]
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
avsm has joined #ocaml
datkin has joined #ocaml
Drup has joined #ocaml
_andre has joined #ocaml
benozol has joined #ocaml
<mfp> !! New tool: ocamloptp, the equivalent of ocamlcp for the native-code compiler.
<mfp> seems to me it should be possible to profile allocation once you have code instrumentation in place...
<f[x]> mfp, what do you mean by profiling allocation?
<f[x]> the places that allocate most?
avsm has quit [Quit: Leaving.]
<mfp> f[x]: exactly
<mfp> right, used it a couple times, but the x86_64 stacktraces full of garbage were indeed a problem (and patching ocamlopt and recompiling every single lib is a PITA)
<mfp> but 4.00 already fixes the stack trace issue?
<f[x]> mfp, true, but the patch is already upstream
<f[x]> yes
<mfp> that's great
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
KDr2 has joined #ocaml
avsm has joined #ocaml
f[x] has quit [Ping timeout: 244 seconds]
emmanuelux has joined #ocaml
f[x] has joined #ocaml
letrec has joined #ocaml
Drup has quit [Quit: Leaving.]
letrec has quit [Remote host closed the connection]
krktz has quit [Remote host closed the connection]
krktz has joined #ocaml
gnuvince has quit [Ping timeout: 244 seconds]
Kakadu has quit [Ping timeout: 245 seconds]
diml has quit [Ping timeout: 240 seconds]
hyperboreean has quit [Ping timeout: 244 seconds]
hyperboreean has joined #ocaml
diml has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Ping timeout: 260 seconds]
gnuvince has joined #ocaml
<_andre> does anyone have an example of providing a custom install command in oasis?
<adrien> to do what?
<adrien> for libraries, I don't think you can change how it installs
<_andre> install cmo files
yrlnry has quit [Ping timeout: 260 seconds]
<adrien> hmm, why install them?
<adrien> or is it because you don't have/want a .cma?
<_andre> i'm writing a custom toplevel and i'm using Topdirs.dir_load on initialization to load some cmo files
jimmyrcom has joined #ocaml
<_andre> managed to do it with 'InstallType: Custom'
oriba has joined #ocaml
snearch has joined #ocaml
Zedrikov has joined #ocaml
gnuvince has quit [Read error: Connection reset by peer]
oriba has quit [Quit: oriba]
KDr2 has quit [Remote host closed the connection]
<Drakken> In a camlp4 syntax extension, does anyone know how to splice a list of nodes into the middle of a surrounding list? It would be equivalent to the @(...) syntax in Lisp macros.
<Drakken> The camlp4 manual shows how to make a list: http://caml.inria.fr/pub/docs/manual-camlp4/manual010.html#a:q_ast
<Drakken> (A.4 Important remark about lists)
<Drakken> But it doesn't say how to splice the list into a list that's currently being generated, e.g. a list of str_item nodes in a struct expression.
skchrko has joined #ocaml
ulfdoz has joined #ocaml
silver has quit [Remote host closed the connection]
<Drakken> In other news, the module-type "with" operation doesn't work with records (or variant types) anyway, so our discussion of module re-use was moot.
<thelema_> Drakken: for list splicing: let pre, post = List.split_at n in_list in pre @ insert_me @ post
silver_ has joined #ocaml
<Drakken> thelema_ okay, so my macro can just return a list, but where do I get the surrounding list, and when do I splice it?
<thelema_> ?? I odn't know what @() does in lisp
<thelema_> for me, splicing a list takes as input lists [a] and [b] and an offset in a [n]
<thelema_> and returns [a_pre] @ [b] @ [a_post]
<Drakken> Most macros return a single form, but sometimes you want a single macro to expand to several forms that get spliced into the surrounding form.
<thelema_> one list, with b inserted into a at position n
<Drakken> right, but this is inside a parser. I would need access to the full list of str_item nodes in the struct expression (or the entire implementation file), and I would also need some kind of str_item node that can hold a list.
<Drakken> I guess there are top-level expressions, so maybe that's possible.
<Drakken> I mean the cons node.
<thelema_> just have your patent list be able to have elements that are lists themselves
<thelema_> *parent
<Drakken> then I need to redefine the struct...end parser.
<Drakken> That pattern could apply to any ast node that contains a list.
<thelema_> oh, you're writing camlp4 to... splice lists?
<Drakken> So it would be _very_ convenient to have some kind of generic syntax for inserting node sublists.
<thelema_> i.e list literal with a @(foo) in it to say insert the elements from list here?
<Drakken> No, I just want a top-level macro to expand to several top-level nodes.
ocp has quit [Read error: Operation timed out]
<Drakken> In the middle of an ordinary struct expression or at the top level of a .ml file.
benozol has quit [Quit: Konversation terminated!]
<thelema_> I don't get it, but I gotta go; maybe write an example that clarifies things, and I can see what ideas I have when I get back in a couple hours
<Drakken> If (m x y z) expands to '((foo x) (foo y) (foo z)), then
<Drakken> oops
djcoin has quit [Quit: WeeChat 0.3.2]
<Drakken> then '(a b @(m x y z) c d) expands to (a b (foo x) (foo y) (foo z) c d)
<thelema_> ocaml is not lisp
<Drakken> camlp4 is a macro system.
<thelema_> an ocaml example, please
<Drakken> I want to declare several values.
<Drakken> DECLARE foo bar gak urp END;
<Drakken> value foo = M.declare "foo"; value bar = M.declare "bar"; value gak = M.declare "gak"; value urp = M.declare "urp";
<Drakken> That's the expansion.
lorill has joined #ocaml
<Drakken> Actually, M.declare should be M.make. "value = " is the declaration.
cago has quit [Quit: Leaving.]
<hcarty> Drakken: I haven't done anything with camlp4 in a while, but it seems like that should be fairly straightforward.
asdfhjkl has joined #ocaml
avsm has quit [Quit: Leaving.]
andreypopp has quit [Quit: Computer has gone to sleep.]
rjohnson has quit [Ping timeout: 240 seconds]
rjohnson has joined #ocaml
iago has joined #ocaml
cdidd has quit [Remote host closed the connection]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
Cyanure has quit [Ping timeout: 246 seconds]
<Drakken> hcarty I hope you're right, but I haven't figured it out yet. I checked out the expansion of EXTEND, but that's all expr nodes, inside a "do" expression. No str_item nodes, and no splicing.
NihilistDandy has joined #ocaml
snearch has quit [Quit: Verlassend]
Submarine has quit [Quit: Leaving]
<Drakken> So far, it looks like I'll have to hack both implem and str_item, and ideally also str_items. I guess that's better than nothing.
ftrvxmtrx has quit [Quit: Leaving]
<NihilistDandy> I'm making a function as part of a small RPN calculator that uses a list to represent the stack. The current version I have is (fun x -> stack := x::!stack; !stack); But I don't really know how to use refs effectively, yet, so this is obviously not very good
<NihilistDandy> Any pointers, or good explanations of basic ref usage? The manual jumped around a bit for my tastes
<_habnabit> NihilistDandy, you could just not use refs at all! functional code owns
<NihilistDandy> I know
<NihilistDandy> It's homework, though :/
<NihilistDandy> I'd do it functionally, myself. But we have to use the provided code
<_habnabit> gross
<NihilistDandy> I imagine if I just get how to enter a number into the list, everything else will more or less be obvious
<NihilistDandy> It's getting that first step that I'm having trouble with
Snark has joined #ocaml
<_habnabit> what's the code you have to work with
<NihilistDandy> Hang on, I'll paste
<NihilistDandy> http://hpaste.org/65623
<_habnabit> haha, what silly code
<NihilistDandy> Right?
<_habnabit> I love academia !
<NihilistDandy> Yeah, I realize it's just an exercise to get us used to refs, I just don't know why anyone would write code like this
<_habnabit> maybe it'll make sense if I show you how to implement, say, `add`
<_habnabit> sec
<NihilistDandy> Okay. Thanks a lot. I really just need to get the idea of it, and I'm so unused to carrying around refs :D
<_habnabit> haha, _waht_
<_habnabit> this isn't an RPN calculator at all really
Cyanure has joined #ocaml
<_habnabit> why do these operations not push back onto the stack
<_habnabit> oh, it does... as well as returning the value ??
<_habnabit> welp okay
<NihilistDandy> Yeah
<NihilistDandy> It's very weird
pangoafk is now known as pango
<NihilistDandy> See, that's what I thought. A case expression was my first idea
<NihilistDandy> I just had no idea how to make refs play nice :D
<NihilistDandy> Thanks a lot, _habnabit. With any luck, I'll be able to figure out the stack manipulation functions from there :)
<NihilistDandy> _habnabit: Awesome! I got it
<_habnabit> hooray
<NihilistDandy> Thanks again for the help. You definitely helped make refs make a little more sense.
thomasga has quit [Quit: Leaving.]
NihilistDandy has quit [Quit: Back later]
snearch has joined #ocaml
snearch has quit [Quit: Verlassend]
fraggle_ has quit [Ping timeout: 260 seconds]
fraggle_ has joined #ocaml
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
Kakadu has joined #ocaml
<Kakadu> hi!
<Kakadu> I'm a little bit confused about such compilation error
<Kakadu> http://paste.in.ua/4033/ errors are at the end of file
<Kakadu> line numbers are saved
Xizor has joined #ocaml
_andre has quit [Quit: leaving]
<mrvn> I only see warnings there so why does it fail?
sepp2k has joined #ocaml
<Kakadu> mrvn: I've set option that warnings are errors
Zedrikov has quit [Quit: Bye all, see you next time!]
<mrvn> then what are confused about?
<Kakadu> why this warnings present?
<mrvn> because _ will match anything, even constuctors you might add in the future and don't want to match
iago has quit [Ping timeout: 276 seconds]
avsm has joined #ocaml
lorill has quit [Quit: Ex-Chat]
iago has joined #ocaml
ftrvxmtrx has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
Kakadu has quit [Quit: Konversation terminated!]
Snark has quit [Quit: Quitte]
Submarine has joined #ocaml
mmajchrzak has joined #ocaml
yezariaely has joined #ocaml
<yezariaely> in ocamltop I cannot use arrow keys and such. Only terminal escape sequences occur. (Both ubuntu and MacOs X with ocaml 3.12.0) any ideas how I can get this working?
<_habnabit> yezariaely, rlwrap
<adrien> or ledit
<_habnabit> AFAIK you can't get the toplevel to use readline
<adrien> (or utop)
<xenocons> +1 rlwrap
<yezariaely> you guys made my day! thanks, I have been looking for that for so long!
skchrko has quit [Quit: ChatZilla 0.9.88.1 [Firefox 11.0/20120314111819]]
<xenocons> rlwrap works well with moscow ml repl too
<xenocons> and fsharps fsi
albacker has quit [Ping timeout: 246 seconds]
Cyanure has quit [Remote host closed the connection]
Submarine has quit [Ping timeout: 260 seconds]
Xizor has quit []
xenocons has quit [Ping timeout: 264 seconds]
xenocons has joined #ocaml
sepp2k has quit [Quit: Leaving.]
silver_ has quit [Remote host closed the connection]
srcerer has quit [Ping timeout: 245 seconds]
smondet has quit [Remote host closed the connection]
mmajchrzak has quit [Ping timeout: 246 seconds]