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
<tamouse__> lastlot ocaml re
<tamouse__> oops
<tamouse__> hi i'm back
<tamouse__> i just installed ocaml on my linux dev box:
<tamouse__> 6168 sudo apt-get install ocaml
<tamouse__> 6169 sudo apt-get install ocaml-doc libgdbm-dev tuareg-mode ocaml-mode
<tamouse__> 6171 sudo apt-get install ocaml-book-en ocaml-libs
<tamouse__> 6172 sudo apt-get install libcalendar-ocaml-doc liblablgtk2-gl-ocaml-dev liblablgtk2-gnome-ocaml-dev ocaml-findlib-wizard
<tamouse__> i typed "ocaml repl" and got the following:
<tamouse__> $ ocaml repl
<tamouse__> Cannot find file repl.
<tamouse__> so, um, what am i missing?
<Lor> If you want an interpreter prompt, just "ocaml" is enough.
<tamouse__> google doesn't seem to be helpful
<tamouse__> ah, ok
<Lor> Or "rlwrap ocaml" for convenience.
<tamouse__> what does the repl do?
<Lor> Do you know what a repl is?
<tamouse__> nope
<Lor> Then why did you type "ocaml repl" in the first place?
<tamouse__> because someone told me to earlier
<tamouse__> $ ocaml repl
<tamouse__> [20120401|1309.32] < thelema_> tamouse__: for a quick intro, try going through chapter 1 of the manual with the toplevel (ocaml repl)
<Lor> That wasn't a sample command-line.
<tamouse__> *sigh*
<Lor> It was just a parenthetical remark that "toplevel" is a name for ocaml's repl.
<tamouse__> are people who say they are completely brand new to something supposed to be able to things like that?
<tamouse__> i still have no idea what a repl is
<Lor> It's a read-eval-print loop, ancient lisp term.
<Lor> Basically any interpreter prompt, like the one you'd get when running python.
<tamouse__> ok
<tamouse__> is there something special about the term "toplevel"?
<Lor> It reads an expression (or statement, or declaration, or whatever), evaluates it, and prints the result, and keeps on doing this in a loop.
<tamouse__> i wonder why it worked on os/x
<Lor> It's just what the interpreter prompt (or repl) is often called in ocaml.
<tamouse__> ok
<Lor> It presents you with the "top-level namespace".
avsm has quit [Quit: Leaving.]
fantasticsid has joined #ocaml
lamawithonel__ has quit []
datkin has quit [Ping timeout: 252 seconds]
zorun has joined #ocaml
jonathandav has quit [Read error: Connection reset by peer]
mcclurmc_ has quit [Read error: Connection reset by peer]
jonathandav has joined #ocaml
jimmyrcom has quit [Ping timeout: 245 seconds]
tufisi has joined #ocaml
Cyanure has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
andreypo_ has quit [Quit: Quit]
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
ASau has quit [Ping timeout: 248 seconds]
ASau has joined #ocaml
ASau has quit [Remote host closed the connection]
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
ASau has joined #ocaml
albacker has quit [Client Quit]
sivoais has quit [Ping timeout: 260 seconds]
<adrien> morning
Cyanure has quit [Ping timeout: 245 seconds]
ftrvxmtrx has joined #ocaml
sivoais has joined #ocaml
Cyanure has joined #ocaml
djcoin has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
mrvn has quit [Read error: Connection reset by peer]
silver has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
cago has joined #ocaml
TaXules has quit [Ping timeout: 252 seconds]
TaXules has joined #ocaml
avsm has joined #ocaml
ASau has quit [Remote host closed the connection]
ASau has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
rixed_ has joined #ocaml
thomasga has joined #ocaml
cdidd has quit [Remote host closed the connection]
Tobu has joined #ocaml
ocp has joined #ocaml
Kakadu has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
iago has joined #ocaml
tamouse__ has left #ocaml []
Tobu has quit [Ping timeout: 272 seconds]
avsm has quit [Quit: Leaving.]
Snark has joined #ocaml
ulfdoz has joined #ocaml
emmanuelux has joined #ocaml
ulfdoz_ has joined #ocaml
Fullma has quit [Ping timeout: 246 seconds]
Tobu has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
ulfdoz_ is now known as ulfdoz
datkin has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
_andre has joined #ocaml
emmanuelux has joined #ocaml
datkin has quit [Ping timeout: 260 seconds]
datkin has joined #ocaml
mart has joined #ocaml
iago has quit [Quit: Leaving]
rixed_ has quit [Quit: leaving]
NaCl has quit [Ping timeout: 246 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
benozol has joined #ocaml
Submarine has quit [Quit: Leaving]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
avsm has joined #ocaml
bzzbzz has joined #ocaml
benozol has quit [Ping timeout: 246 seconds]
iago has joined #ocaml
NaCl has joined #ocaml
NaCl has quit [Changing host]
NaCl has joined #ocaml
Tobu has joined #ocaml
iago has quit [Ping timeout: 260 seconds]
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
thomasga1 has quit [Read error: Connection reset by peer]
thomasga has quit [Read error: Connection reset by peer]
thomasga1 has joined #ocaml
snearch has joined #ocaml
Fullma has joined #ocaml
jimmyrcom has joined #ocaml
datkin has quit [Ping timeout: 244 seconds]
Fullma has quit [Ping timeout: 252 seconds]
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
thomasga1 is now known as thomasga
benozol has joined #ocaml
cdidd has joined #ocaml
mika1 has joined #ocaml
benozol has quit [Ping timeout: 245 seconds]
jamii has joined #ocaml
benozol has joined #ocaml
mcclurmc_ has joined #ocaml
iago has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
smondet has joined #ocaml
benozol has quit [Read error: Connection reset by peer]
benozol has joined #ocaml
asdfhjkl has joined #ocaml
JuzorBNC is now known as Juzor
snearch has quit [Quit: Verlassend]
oriba has joined #ocaml
snearch has joined #ocaml
jamii has quit [Ping timeout: 240 seconds]
thomasga has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
jamii has joined #ocaml
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
Kakadu has quit [Quit: Page closed]
jamii has quit [Read error: Operation timed out]
djcoin has quit [Quit: WeeChat 0.3.2]
<hcarty> If anyone familiar with integrating Lwt with other libraries is available, I would appreciate comments on a small Lwt/0MQ interface : https://gist.github.com/2279558
<hcarty> avsm: Thank you for the Lwt-for-managing-processes-and-other-Unix-things tip. It's been fun learning the library.
<smondet> hcarty: I don't know exactly what ZMQ.Socket.events does, but if it tries to read more than one byte with non-Lwt Unix.recv, then I guess Lwt_unix.wait_read is not enough
<hcarty> smondet: Thanks. As I understand, ZMQ.Socket.events tells you if a complete ZMQ message can be read/written on the given socket without blocking.
<hcarty> ZMQ.Socket.events itself should not block according to the documentation
<hcarty> For what it's worth, this is using the 0MQ bindings here: https://github.com/pdhborges/ocaml-zmq/
ftrvxmtrx has joined #ocaml
<Lor> hcarty, won't that busy-loop once there's some data in the socket, but not enough for a full zmq event?
<Lor> (Assuming this kind of situation is possible, of course)
<hcarty> Lor: Yes, I think that may be able to happen. I'm not sure what the proper Lwt-friendly method of handling this is.
<hcarty> The zmq docs state that the file descriptor may be readable/writeable before a complete message can be read/writtne.
<Lor> The event library doesn't provide any direct way to select for events?
<hcarty> written
diego_diego has joined #ocaml
<Lor> Err, wait, doesn't "ZMQ.Socket.events s.socket" read the socket?
<Lor> It has to read the available input into a buffer.
<smondet> Lor:, hcarty: it calls http://api.zeromq.org/master:zmq-getsockopt
<smondet> with ZMQ_EVENTS
<hcarty> smondet: Yes, it does
benozol has quit [Quit: Konversation terminated!]
<diml> hcarty: i think you should use Lwt_unix.wrap_syscall, pass ~opt:R_no_block to recv, and wrap ZMQ.EGAIN to Lwt_unix.Retry
<Lor> How can the library find out if there's enough data in the socket for a full event without reading it?
ftrvxmtrx has quit [Ping timeout: 252 seconds]
<hcarty> diml: Thank you. Does it matter if the ZMQ.EAGAIN exception is mapped to Lwt_unix.(Retry or Retry_read or Retry_write)?
<diml> hcarty: Lwt_unix.Retry reuse the same io_event, Lwt_unix.Retry_{read,write} force the io_event
<diml> in general you can just use Retry
<hcarty> diml: Thank you
Tobu has quit [Ping timeout: 272 seconds]
tufisi has quit [Ping timeout: 246 seconds]
oriba has quit [Quit: oriba]
tufisi has joined #ocaml
Juzor is now known as JuzorBNC
ftrvxmtrx has joined #ocaml
Tobu has joined #ocaml
<hcarty> diml: I have updated the snippet - does the Lwt_socket_diml version look correct? https://gist.github.com/2279558
<hcarty> It compiles and the types work out, but I'm still new to the world of Lwt.
cago has quit [Quit: Leaving.]
<diml> hcarty: looks fine to me
jamii has joined #ocaml
<hcarty> diml and others: Thank you for your help.
<hcarty> I'll leave it as a paste for now, but if I develop it any further or if anyone else wants to make any additions I will setup a proper project for it.
mika1 has quit [Ping timeout: 246 seconds]
Cyanure has quit [Remote host closed the connection]
greg__ has joined #ocaml
greg__ has quit [Client Quit]
hnrgrgr has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
mcclurmc_ is now known as mcclurmc
Tobu has quit [Ping timeout: 260 seconds]
rks has quit [Quit: {'EXIT', rks, "bye"}]
mcclurmc has quit [Ping timeout: 276 seconds]
Tobu has joined #ocaml
avsm has quit [Quit: Leaving.]
snearch has quit [Quit: Verlassend]
diego_diego has quit [Quit: diego_diego]
thomasga1 has quit [Quit: Leaving.]
ggherdov has joined #ocaml
ocp has quit [Ping timeout: 240 seconds]
silver has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
diego_diego has joined #ocaml
iago has quit [Ping timeout: 244 seconds]
ggherdov has quit [Remote host closed the connection]
eikke has quit [Ping timeout: 265 seconds]
iago has joined #ocaml
hefner has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
<_habnabit> is there a way to make ocamlbuild put an option or flag at the _end_ of some ocamlfind ocamlopt invocation? running into problems with the braindead GNU linker, and reordering arguments is the only solution I've found
<_habnabit> I haven't seen anything in the docs; it seems like ocamlbuild groups the arguments but doesn't let you otherwise specify the order
ftrvxmtrx has quit [Quit: Leaving]
Tobu has joined #ocaml
diego_diego has quit [Quit: diego_diego]
<hcarty> _habnabit: There was some discussion on the bug tracker about this. I don't remember the bug # or if there was a work-around.
<_habnabit> which bug tracker?
err404 has joined #ocaml
<thelema_> _habnabit: probably mantis (caml.inria.fr/mantis)
<hcarty> _habnabit: Yes, OCaml's bug tracker
<_habnabit> okay, checking
<_habnabit> well, I was hoping it would be something I could put in a plugin. I guess not.
<_habnabit> man this is an annoying thing. apple's ld is just fine with the argument order.
albacker has joined #ocaml
<thelema_> from what I've been able to tell, everyone was just being lazy with argument order, and it's finally checked in the gnu linker
<_habnabit> not sure what you mean
<thelema_> the recent change is to only accept link orders that are correct, and not to change the link order from what's given on the command line (to make linking succeed)
<thelema_> actually, I take that back - I think it might just be to allow the linker to prune code more easily...
Tobu has quit [Ping timeout: 260 seconds]
<_habnabit> it does seem awfully silly to depend on a particular argument order
<_habnabit> but I'm stuck with it, anyway
<_habnabit> actually, maybe there's another way to solve this. one sec
<thelema_> ocaml depends on a particular argument order for its linking, although it's the opposite order
ftrvxmtrx has joined #ocaml
<thelema_> note that -ccopt and -cclib insert arguments in different places
<_habnabit> http://paste.pound-python.org/raw/jRd9elGd4c3iE1D7LGCF/ there's the ultimate gcc command
<jonafan> haha
<_habnabit> gsl.a and libpam.a both need symbols from -lgsl
<jonafan> very impressive
<_habnabit> but libpam.a is specified _after_ the -lgsl
<_habnabit> actually I'm not sure why the lib{cdd,pam,pplacercside}.a are all specified after the various -l flags
jderque has joined #ocaml
<_habnabit> they're all ocaml bindings to C things
<thelema_> what's the ocaml command that generates this gcc command?
<_habnabit> the ocamlbuild command?
<_habnabit> or the ocamlopt command?
<thelema_> ocamlopt
<_habnabit> one sec
<_habnabit> ocamlfind ocamlopt -ccopt -static -linkpkg -package batteries -package bigarray -package csv -package gsl -package sqlite3 -package str -package threads -package unix -package xmlm -thread -cclib -lpthread common_src/ppr.cmx common_src/mapsSets.cmx common_src/number.cmx common_sr
<_habnabit> c/algMap.cmx common_src/file_parsing.cmx common_src/linear_utils.cmx common_src/ppatteries.cmx common_src/sql.cmx common_src/uptri.cmx json_src/jsontype.cmx pplacer_src/myxml.cmx pplacer_src/newick_bark.cmx pplacer_src/bark_map.cmx pplacer_src/stree.cmx pplacer_src/gtree.cmx ppla
<_habnabit> cer_src/edge_rdist.cmx pplacer_src/newick_parse_state.cmx pplacer_src/newick_parser.cmx pplacer_src/newick_lexer.cmx pplacer_src/tax_id.cmx pplacer_src/placement.cmx pplacer_src/pquery.cmx pplacer_src/pquery_io.cmx pplacer_src/newick_gtree.cmx pplacer_src/placerun.cmx pplacer_src
<_habnabit> /mass_map.cmx pplacer_src/matrix.cmx pam_src/pam_solver.cmx cdd_src/libcdd.a pam_src/libpam.a pplacer_src/libpplacercside.a -o pam_src/pam_solver.native
<_habnabit> er, sorry
<_habnabit> wrong window
thelema has joined #ocaml
<thelema> maybe there's a bug in the gsl META file
<_habnabit> how so? it's not ocamlgsl that's failing
<thelema> err, n/m, it's the mixture of gsl in ocamlfind and pam not in ocamlfind
<thelema> (I'd bet)
<_habnabit> yeah, that would solve it AFAICT
<thelema> can you ocamlfind-enable pam?
<_habnabit> how would I do that? it's part of the application
<thelema> really? hmm...
<_habnabit> I mean, we have three different lib$x.clib files
<thelema> You're linking in libpam.a - can you use a .cmx[a] instead?
<_habnabit> libpam.a is one of them
<_habnabit> okay, but how would I do that?
thelema_ has quit [Ping timeout: 276 seconds]
<thelema> how are you generating libpam.a?
<_habnabit> there's a libpam.clib file that references some .o files
<_habnabit> and in the myocamlbuild: dep ["c_pam"] ["pam_src/libpam.a"];
<thelema> hmmm...
<_habnabit> is there a better way of indicating ocaml bindings?
<_habnabit> I mean, written in C
<thelema> -lfoo is not the same as adding libfoo.a to the command line
Kakadu has joined #ocaml
<_habnabit> yeah, I know
<thelema> you may have to -Lpam_src and -lpam
<_habnabit> fwiw I don't know what the significance of that `dep` line is; that's what the code was before I got to it
<thelema> it says that anything with tag "c_pam" has a dependency on the libpam.a file
<_habnabit> okay
<_habnabit> but does that also make ocamlbuild add it to the ocamlfind arguments?
<thelema> no, it just forces libpam.a to be built first
<_habnabit> ah, okay
<_habnabit> so I'd still need that?
<thelema> yes
<_habnabit> in that case, how is the .a file being added to ocamlfind at all?
<thelema> pastebin your myocamlfind.ml file
<thelema> there should be a "flag" line that mentions the .a file
<thelema> hmm
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
<_habnabit> but I'll try changing those 'flag' lines so they're just "link"; "c_$x"
<thelema> which flag lines?
<thelema> L232?
<_habnabit> yeah, those
<_habnabit> since you were already suggesting doing that
<thelema> those say how to link the toplevel for c*
<_habnabit> right, but I mean removing the "toplevel" from the flags
<_habnabit> so that it's just when linking C
<thelema> I guess it's possible that absent any other instructions, adding a "dep" also adds the file to the command line for compiling...
<thelema> "dep tags deps Will build deps when all tags will be activated."
<thelema> this doesn't say anything about adding dep to the arguments, but maybe the builtin rules get the arguments from the deps...
<_habnabit> !! that did it
<_habnabit> let's see how the ocamlopt invocation changed
<_habnabit> haha, it's still adding the .a files
<_habnabit> but at least it's compiling now
<thelema> but it's got the -l too, yes?
<_habnabit> yeah
<_habnabit> now let's make sure apple's ld doesn't throw a fit
Snark has quit [Quit: Quitte]
<_habnabit> oh, great. mktop doesn't fail either
<_habnabit> thanks!
<thelema> yes, removing the "toplevel" tag makes the rule apply in more cases
<thelema> not only when the toplevel is being built
<_habnabit> well yeah I get that :P
asdfhjkl has quit [Quit: Leaving]
Tobu has joined #ocaml
avsm has joined #ocaml
Xizor has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
avsm has quit [Quit: Leaving.]
djcoin has joined #ocaml
Tobu has joined #ocaml
julien has joined #ocaml
noamsml_ has joined #ocaml
pippijn_ has joined #ocaml
hto_ has joined #ocaml
malouin_ has joined #ocaml
fabjan_ has joined #ocaml
haelix has joined #ocaml
nimred_ has joined #ocaml
andreypopp has joined #ocaml
jimmyrcom has quit [Ping timeout: 260 seconds]
hto has quit [Ping timeout: 260 seconds]
noamsml has quit [Ping timeout: 260 seconds]
malouin has quit [Ping timeout: 260 seconds]
pippijn has quit [Ping timeout: 260 seconds]
Julien_T has quit [Ping timeout: 260 seconds]
Lor has quit [Ping timeout: 260 seconds]
mart has quit [Ping timeout: 260 seconds]
fabjan has quit [Ping timeout: 260 seconds]
nimred has quit [Ping timeout: 260 seconds]
haelix_ has quit [Ping timeout: 260 seconds]
Lor has joined #ocaml
jimmyrcom has joined #ocaml
jamii has quit [Remote host closed the connection]
pchopin has joined #ocaml
tetsuya has joined #ocaml
<tetsuya> hi all
<tetsuya> i've a question about the lazy expressions
<thelema> just ask
<tetsuya> there is anyway to recompute an already foced lazy expression?
<thelema> you can get the result from it, but you can't force it to evaluate again
<thelema> maybe you want (unit -> 'a) instead of 'a Lazy.t
<tetsuya> thank for the tip
jderque has quit [Remote host closed the connection]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
maurer has joined #ocaml
<maurer> If I have a record defined in module A, how can I get module B to be able to access the fields of that record?
<thelema> value.A.fieldname
maurer has quit [Ping timeout: 244 seconds]
maurer has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
tufisi has quit [Ping timeout: 246 seconds]
_andre has quit [Quit: leaving]
andreypopp has quit [Quit: Computer has gone to sleep.]
Kakadu has quit [Quit: Konversation terminated!]
Tobu has joined #ocaml
albacker has quit [Quit: Leaving]
smondet has quit [Remote host closed the connection]
eikke has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.2]
Submarine has quit [Quit: Leaving]
Tobu has quit [Ping timeout: 272 seconds]
tetsuya has quit [Quit: Leaving]
err404 has quit [Remote host closed the connection]
Tobu has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
sgnb has quit [Read error: Connection reset by peer]
ASau has quit [Remote host closed the connection]
ASau has joined #ocaml
datkin has joined #ocaml
Xizor has quit []
xenocons has joined #ocaml