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
todun has quit [Quit: :q]
oriba has quit [Quit: oriba]
iratsu has joined #ocaml
Smerdyakov has quit [Quit: Leaving]
khia0 has joined #ocaml
khia0 has left #ocaml []
lopex has quit []
dnolen_ has quit [Quit: dnolen_]
joewilliams is now known as joewilliams_away
ejackson has quit [Ping timeout: 276 seconds]
ejackson has joined #ocaml
arubin has joined #ocaml
StepanKuzmin has quit [Read error: Connection reset by peer]
todun has joined #ocaml
mlh has quit [Ping timeout: 250 seconds]
dnolen_ has joined #ocaml
bobry has quit [Ping timeout: 264 seconds]
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
ulfdoz has joined #ocaml
dnolen_ has quit [Quit: dnolen_]
nimred has quit [Ping timeout: 276 seconds]
todun has quit [Quit: todun]
ankit9 has joined #ocaml
ulfdoz has quit [Ping timeout: 258 seconds]
arubin has quit [Quit: arubin]
ankit9 has quit [Quit: Leaving]
cadabra has joined #ocaml
cadabra has quit [Remote host closed the connection]
Ptival has quit [Quit: Quat]
edwin has joined #ocaml
larhat has joined #ocaml
ogd has joined #ocaml
othiym23 has quit [Read error: Connection reset by peer]
ogd has quit [Client Quit]
Cyanure has joined #ocaml
munga has joined #ocaml
rgrinberg_ has quit [Ping timeout: 250 seconds]
ankit9 has joined #ocaml
eikke has joined #ocaml
Amorphous has quit [Read error: Operation timed out]
Amorphous has joined #ocaml
avsm has quit [Quit: Leaving.]
thomasga has joined #ocaml
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
thomasga has quit [Ping timeout: 258 seconds]
thomasga has joined #ocaml
todun has joined #ocaml
Amorphous has quit [Ping timeout: 255 seconds]
ikaros has joined #ocaml
Amorphous has joined #ocaml
betta_y_omega has quit [Ping timeout: 246 seconds]
betta_y_omega has joined #ocaml
munga has quit [Quit: Ex-Chat]
ftrvxmtrx has joined #ocaml
betta_y_omega has quit [Ping timeout: 260 seconds]
betta_y_omega has joined #ocaml
edwin has quit [Remote host closed the connection]
betta_y_omega has quit [Ping timeout: 250 seconds]
edwin has joined #ocaml
betta_y_omega has joined #ocaml
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 276 seconds]
betta_y_omega has quit [Read error: Operation timed out]
alfa_y_omega has joined #ocaml
alfa_y_omega has quit [Read error: Operation timed out]
alfa_y_omega has joined #ocaml
edwin has quit [Remote host closed the connection]
lopex has joined #ocaml
edwin has joined #ocaml
lamawithonel_ has quit [Read error: Connection reset by peer]
spearalot has joined #ocaml
dnolen_ has joined #ocaml
mlh has joined #ocaml
_andre has joined #ocaml
chrissbx has quit [Ping timeout: 260 seconds]
ztfw has joined #ocaml
Ptival has joined #ocaml
<Ptival> http://hpaste.org/49582 < is this the proper way to do what I want in OCaml?
<Ptival> maybe there is an 'a option -> 'a function that already exists :\
<adrien> if you're going to raise an exception on None, you might as well "let Some i = PTree.get n c in ...", this will give you a warning however
<flux> it is proper, although alternatively the pattern match could be lifted lated where other conditions are to be evaluated as well
<flux> it depends on the situation if one wants to stop option types as early as possible, or as late as possible :)
<flux> ptival, batteries (and extlib) come with an Option module that contain such a function
<Ptival> flux: ok, I'm not using these though...
Znudzon has joined #ocaml
<Ptival> actually I know that it should never miss, it's just to please the compiler :)
<flux> ptival, well you should not use option types in the first place, if it's always Some x ;-)
drunK has joined #ocaml
<Ptival> flux: well, I'm using a data structure on which the operation can fail ; however, in this particular case, it won't
<Ptival> I was just worried because emacs didn't indent the "|" under the beginning of match
bobry1 has quit [Ping timeout: 255 seconds]
<Ptival> and also because of my use of "i"
zsparks has joined #ocaml
zsporks has quit [Quit: leaving]
bobry has joined #ocaml
ztfw` has joined #ocaml
ztfw` has quit [Client Quit]
ztfw has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Poet_ has joined #ocaml
Znudzon has quit [Ping timeout: 260 seconds]
todun has quit [Remote host closed the connection]
todun has joined #ocaml
todun_ has joined #ocaml
todun has quit [Ping timeout: 252 seconds]
todun_ is now known as todun
dnolen_ has quit [Quit: dnolen_]
todun has quit [Quit: :q]
ztfw has joined #ocaml
<Ptival> http://hpaste.org/49586 < l11: None is an 'a option, expected a 'b list, see why?
<flux> ptival, what should be the return type of the function?
<Ptival> I'd like 'a list option
<flux> ptival, well, you're currently returning 'a list
<flux> so maybe yous hould put Some (add_reachable..) in the 'try'
<Ptival> oh I seem to be misunderstanding how this try works
spearalot has quit [Quit: Get MacIrssi - http://www.sysctl.co.uk/projects/macirssi/]
<flux> in expression (try a with ... -> b) a and b must be of the same type
ankit9 has quit [Quit: Leaving]
bobry has quit [Ping timeout: 255 seconds]
<Ptival> thanks flux
chrissbx has joined #ocaml
<zsparks> I downloaded a package, compiled it, and put it in /usr/local/lib/ocaml (which is where all the libraries I have seem to live), but ocaml isn't recognizing its existence. What else do I have to do to get to use it?
<zsparks> (the package came with virtually no support -- even the 'make install' target didn't work for some strange reason, and I had to copy it over manually)
lopex has quit []
<f[x]> zsparks, start with naming the package and showing make install error message
<f[x]> and what do you mean by "ocaml isn't recognizing its existence"
bobry has joined #ocaml
<zsparks> f[x]: the package is Contfrac
<zsparks> the error message is "make: `install' is up to date."
<zsparks> and by not recognizing, I mean it says:
<zsparks> # include Contfrac ;;
<zsparks> Error: Reference to undefined global `Contfrac'
<f[x]> add `.PHONY: install` to Makefile
<f[x]> does it have META file in distribution?
<thelema> f[x]: nope
<zsparks> f[x]: add it anywhere in the file?
<thelema> it's a single .ml,mli file package
<thelema> zsparks: the top works fine.
<zsparks> thelema: ?
<f[x]> zsparks, at the beginning
<zsparks> ah
<thelema> zsparks: you can add 'phony' at the top
<thelema> I think it'll work anywhere before the install target itself
<f[x]> ok, without META you will need to specify path to installed files manually
<thelema> zsparks: if I were you, I'd just copy the contfrac.ml* files into your project.
<thelema> but I'm lazy like that sometimes
<zsparks> f[x]: so, I run ocaml -I <the specified directory>
<f[x]> #directory "/usr/local/lib/ocaml/contfrac";; for toplevel
<zsparks> and I still get the same error
<f[x]> what is in that folder?
<f[x]> did it install cmi files?
<zsparks> yeah
Ptival has quit [Quit: Leaving]
<zsparks> after I do the #directory thing it still has the same error
<zsparks> oh, would it help to say that I'm on a mac?
<zsparks> thelema: yeah, I am considering doing that
<f[x]> ouch, it is from 2004?
<zsparks> but it would be nice to know how to get this to work in the general case without resorting to hax
<zsparks> f[x]: possibly?
<zsparks> yeah, looks like.
<zsparks> really, what I want is a mathematica-style precision package
<thelema> zsparks: the right thing is for the packager to use findlib for install.
<zsparks> but I haven't been able to find anything like that.
<thelema> zsparks: have you looked at Ratio in the stdlib?
<zsparks> thelema: yeah, and I'm currently using Num, which seems to be based on that
<thelema> yes, num builds on ratio
<f[x]> argh
<f[x]> zsparks, #load "contfrac.cma" first
<zsparks> Error: Reference to undefined global `Big_int'
<zsparks> which is, uh
<zsparks> unexpected.
<f[x]> #require "num" of course
<f[x]> here is a META for it -> http://paste.in.ua/2815/
<thelema> f[x]: exists_if?
ulfdoz has joined #ocaml
<f[x]> and diff for Makefile -> http://paste.in.ua/2816/
<f[x]> after that #require "contfrac" is all you need
<thelema> f[x]: wow, that would come in really handy for packaging lablgtk
<f[x]> thelema, yes, exists_if is not needed here
* thelema just found the -optional argument on ocamlfind install
ankit9 has joined #ocaml
larhat has quit [Quit: Leaving.]
lopex has joined #ocaml
todun has joined #ocaml
todun_ has joined #ocaml
todun has quit [Ping timeout: 252 seconds]
todun_ is now known as todun
eb4890 has joined #ocaml
todun has quit [Quit: :s]
joewilliams_away is now known as joewilliams
todun has joined #ocaml
Poet_ has quit [Ping timeout: 260 seconds]
othiym23 has joined #ocaml
ulfdoz_ has joined #ocaml
iratsu has quit [Ping timeout: 255 seconds]
ulfdoz has quit [Ping timeout: 264 seconds]
ulfdoz_ is now known as ulfdoz
eikke has quit [Ping timeout: 260 seconds]
rgrinberg_ has joined #ocaml
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
Cyanure has quit [Remote host closed the connection]
todun has quit [Quit: :s]
todun has joined #ocaml
nimred has joined #ocaml
eikke has joined #ocaml
iratsu has joined #ocaml
NaCl has quit [Quit: brb]
bobry1 has joined #ocaml
todun has quit [Quit: :q]
eikke has quit [Ping timeout: 276 seconds]
othiym23 has quit [Ping timeout: 255 seconds]
eikke has joined #ocaml
othiym23 has joined #ocaml
<zsparks> f[x]: I'm getting "unknown directive require" ...
<zsparks> should I be running it with ocamlfind somehow? And if so, how? I don't see any options for doing so interactively.
todun has joined #ocaml
<zsparks> ah, there we go, nevermind.
<adrien> zsparks: #load "topfind";; first
sepp2k has joined #ocaml
ftrvxmtrx has joined #ocaml
<zsparks> Where does Ratio live in the stdlib? I can't seem to get to it.
<zsparks> (that is, include Ratio doesn't work)
<adrien> in Num iirc
<zsparks> oh, heh
<zsparks> Okay, in the makefile I'm using (that I kind of just found online, but it's been okay so far), the target for opt is...possibly broken?
<zsparks> opt : $(EXEC).opt
<zsparks> so when I "make opt"
<zsparks> it complains that there's no target for the executable's name .opt
<adrien> well, what does "all" look like? where is the makefile from? and have you considered using ocamlbuild?
<zsparks> and yeah, I probably should use ocamlbuild, but I didn't find out about it until this was already underway
<adrien> well, you're supposed to set EXEC, there's a line for that :P
<adrien> and it's not too late to switch to ocamlbuild :P
<zsparks> I did
<zsparks> but there's no target for $(EXEC).opt
<adrien> and in cases you really really want makefiles, try OCamlMakefile
<adrien> it's pretty huge but it works (it has a few issues but I don't think anyone will fix a 5k lines makefileà
<zsparks> it's not too late, but I do need to get some results in by tomorrow, so I can't take the time to switch 'til after that
<adrien> )
<adrien> there's "$(EXEC)-opt", maybe a typo, I don't know all the makefile syntax
<adrien> well, ocamlbuild is _very_ quick to start using: which version of ocaml are you using, which packages/libraries are you using?
eikke has quit [Ping timeout: 276 seconds]
<zsparks> version 3.12.0, and I'm using...uhh, at least Num, and I think this one Constants package, too
<zsparks> ideally I'd be using GMP, but I couldn't get it to install on my mac.
todun has quit [Quit: :s]
<adrien> what is the constants package?
<zsparks> hmm
<zsparks> lemme check
<zsparks> the ocaml mathlib
<zsparks> is where it is from, I think
todun has joined #ocaml
<adrien> oh, hadn't heard of that library
<adrien> for ocamlbuild, create a file named "_tags" with the following line (not perfect, can be improved later on): <*>: package(num), package(mathlib)
<adrien> and run: ocamlbuild -use-ocamlfind ${your_target}.native
<adrien> assuming you are building an executable
<adrien> it'll probably complain about output files in the current directory, check them and maybe clean them with the generated script
eb4890 has quit [Ping timeout: 255 seconds]
malc_ has joined #ocaml
Anarchos has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
oriba has joined #ocaml
oriba has left #ocaml []
ftrvxmtrx has joined #ocaml
eikke has joined #ocaml
_andre has quit [Quit: leaving]
iratsu has quit [Ping timeout: 240 seconds]
edwin has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 258 seconds]
todun has quit [Quit: :s]
ftrvxmtrx has quit [Quit: Leaving]
todun has joined #ocaml
eikke has quit [Ping timeout: 258 seconds]
thomasga has quit [Quit: Leaving.]
todun has quit [Quit: :s]
todun has joined #ocaml
iratsu has joined #ocaml
todun has quit [Remote host closed the connection]
agarwal1975 has joined #ocaml
sepp2k has quit [Quit: Leaving.]
lamawithonel has joined #ocaml
Obfuscate has quit [Ping timeout: 246 seconds]
ejackson has quit [Quit: ejackson]
Obfuscate has joined #ocaml
Anarchos has quit [Read error: Operation timed out]
joewilliams is now known as joewilliams_away
dnolen has joined #ocaml
rgee has joined #ocaml
rgrinberg_ has quit [Ping timeout: 255 seconds]
groovy2shoes has joined #ocaml
groovy2shoes has quit [Changing host]
groovy2shoes has joined #ocaml