<technomancy>
I'm still on squeeze, so I don't have 3.12
sebz has joined #ocaml
<thelema_>
oasis doesn't require 3.12.
brooksbp has quit [Quit: Leaving]
<technomancy>
oh? I thought I had tried it before and had trouble with 3.11
<technomancy>
that was like six months ago, so I could be mixed up
<technomancy>
I'll try it again
<thelema_>
one of its deps, odn, depends on a package that has been updated to only work under 3.12
<technomancy>
that may have been the problem
<technomancy>
is there a workaround?
<thelema_>
make sure to use odn 0.0.6
<thelema_>
and look at it readme for the version of type-conv that it needs, and get exactly that version
pilki has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
<technomancy>
I'd like to play around with static HTML generation; is there a good library for taking raw HTML templates and inserting data into them using css-ish selectors?
<technomancy>
hm; oasis claims "libpcre.so.0: cannot open shared object file" even though libpcre3 and libpcre-ocaml are installed
<technomancy>
and odb fails with a syntax error. =\
sebz has quit [Quit: Computer has gone to sleep.]
ankit9 has joined #ocaml
<technomancy>
maybe I should just go back to sticking with the standard library
<everyonemines>
What was your problem with the stdlib originally?
<technomancy>
I was thinking about doing some HTML generation
<technomancy>
plus I need to set some X hints on a window that Graphics doesn't expose
<everyonemines>
ocsigen?
<technomancy>
at this point I'd be happy with anything I could get working =)
<everyonemines>
what did you try?
<technomancy>
so far ocsigen, odb, and oasis; each failed in their own unique way
<everyonemines>
What failed with oscigen?
<technomancy>
the makefile forkbombed me
<everyonemines>
haha
<technomancy>
definitely the most spectacular of the failures =)
<technomancy>
that bug report makes it seem like it only happens when I omit sudo, but it just happened again earlier today before the "make -C install" phase
philtor has quit [Ping timeout: 252 seconds]
everyonemines has left #ocaml []
fridim_ has quit [Ping timeout: 240 seconds]
<hnrgrgr>
technomancy: I can find many ways to fail the ocsigen-bundle but the forkbomb didn't happen to me yet :)
<hnrgrgr>
and I'm unable to reproduce
<hnrgrgr>
the ocsigen-bundle is just a hack waiting for a more general ocaml package manager to emerge.
ankit9 has quit [Ping timeout: 240 seconds]
fridim_ has joined #ocaml
ankit9 has joined #ocaml
Cyanure has joined #ocaml
fridim_ has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
cago has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
Cyanure has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
emmanuelux has joined #ocaml
edwin has joined #ocaml
Snark has joined #ocaml
Cyanure has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
rby has quit [Read error: No route to host]
Kakadu has joined #ocaml
_andre has joined #ocaml
milosn has joined #ocaml
probst has joined #ocaml
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 240 seconds]
iago has joined #ocaml
rby has joined #ocaml
sebz has joined #ocaml
ikaros has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
pilki has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
sebz has quit [Quit: Computer has gone to sleep.]
pilki has joined #ocaml
sebz has joined #ocaml
<thelema_>
technomancy: sadly, odb needs 3.12
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
<hcarty>
thelema_: odb's automatic permissions check is breaking installation of some packages under ocamlbrew
<hcarty>
thelema_: Without the --prefix option, some packages (I don't remember which) were trying to install pieces under /usr/locl/
<hcarty>
s/locl/local/
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ankit9 has quit [Quit: Leaving]
vivanov has joined #ocaml
<vivanov>
to call F.f instead of Foo.f , i have on top of file 'module F = Foo' -- is it safe? can anything go wrong here?
fantasticsid has joined #ocaml
ski has quit [Ping timeout: 255 seconds]
ski has joined #ocaml
ankit9 has joined #ocaml
cago has left #ocaml []
Cyanure has quit [Ping timeout: 260 seconds]
iago has quit [Quit: Leaving]
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
philtor has joined #ocaml
<adrien>
when putting code in the toplevel, I can't get backtraces because my "program has not been linked with -g"; any way around that?
spearalot has joined #ocaml
smondet has joined #ocaml
philtor has quit [Read error: Operation timed out]
ftrvxmtrx has quit [Quit: Leaving]
<sgnb>
adrien: compile with -g
<sgnb>
(the libraries you're using)
<adrien>
sgnb: I'm writing code directly in the toplevel
<adrien>
(rather: writing in vim, and copy-pasting)
<sgnb>
adrien: but your code is using some library, isn't it?
<adrien>
sgnb: nothing besides List and Pervasives I think
<thelema_>
hcarty: ok, I guess I need to break that into two perms
<sgnb>
adrien: try running with OCAMLRUNPARAM=b
<thelema_>
hcarty: one for findlib permission and the other for executable/other permission i.e. --prefix
<thelema_>
hcarty: permission detection disabled in HEAD
<thelema_>
vivanov: yes, this is safe and common.
<adrien>
sgnb: doesn't work; I've also tried using "Printexc.record_backtrace true" but that didn't change anything
<sgnb>
adrien: and you don't have backtrace even if you don't use the stdlib at all?
<adrien>
sgnb: well, "val raise" is from the stdlib; trying "raise Not_found" is currently my test
<hcarty>
thelema_: Thanks, 'ocamlbrew -a' can run properly again.
<thelema_>
hcarty: n/p
kmc has joined #ocaml
sebz has joined #ocaml
ftrvxmtrx has joined #ocaml
_andre has quit [Quit: leaving]
Snark has quit [Quit: Quitte]
pilki has quit [Quit: Leaving]
<hcarty>
thelema_: ocamlbrew has a few new options; -o for OCaml only; -f for OCaml+findlib+odb; -n [path] to specify a custom basename (ex. install OCaml 3.12.1 as $OCAMLBREW_BASE/stable)
<adrien>
ocaml only? it only installs the sources from caml.inria.fr?
<hcarty>
Brewing should be more usable now with Subversion targets
<hcarty>
adrien: "ocamlbrew -o" would, by default, only build the 3.12.1 .tar.gz, yes
<adrien>
ok
<hcarty>
adrien: "ocamlbrew -s version/3.12 -f" would build 3.12.x from Subversion and install findlib along with it
<adrien>
and without -f and without -o?
<hcarty>
adrien: The goal is to be able to, with just a few keystrokes, build and install (almost?) any version of OCaml + some basic tools
<hcarty>
Running it directly would prompt you for options
<hcarty>
And install the latest stable version, which is currently hardcoded as 3.12.1
<adrien>
ok, I see
<adrien>
I would have made it behave like if -f had been given; bit more aggressive =)
<hcarty>
I considered it, but I'm not willing to be that aggressive until it's been tested more :-)
<hcarty>
On the positive side of things, I was successfully able to build three OCaml versions in parallel using ocamlbrew :-P
<hcarty>
3.12.1, 3.12-svn, trunk
<adrien>
hcarty: more tests? so, -f by default next week? =)
<hcarty>
adrien: :-)
<hcarty>
adrien: If you test it heavily over the next week, then maybe so!
<hcarty>
The simplest install option is more aggressive than that - it installs OCaml 3.12.1, findlib, odb, oasis, and Batteries
<adrien>
if I can find time to do some networking stuff when I get my quad-core back, then yes
<adrien>
because my laptop gets a bit noisy
<hcarty>
That's understandable
<adrien>
I think that OCaml is actually the only language I can do happily on my laptop
<adrien>
things like C++ are way too slow to compile
ttamttam has joined #ocaml
<adrien>
(actually, my laptop is not very slow; it's rather quite telling of the compiling speed of some things)
<orbitz>
adrien: still tracking down this memory leak, it's turning into quite the crusade :)
<adrien>
orbitz: arf =/
<adrien>
have you been able to make some kind of reproducer?
Anarchos has joined #ocaml
<ankit9>
I have a function: val gen_ranges : int -> int -> (int * int) list = <fun>
<ankit9>
trying to write the function with type annotations:
<ankit9>
let gen_ranges(max:int, len:int) : (int * int) list =
<ankit9>
what is wrong with this?
<ankit9>
getting this: File "./foo.ml", line 14, characters 22-23:
<ankit9>
Error: Syntax error: ')' expected
<ankit9>
File "./foo.ml", line 14, characters 14-15:
<ankit9>
Error: This '(' might be unmatched
<adrien>
write it like that: let gen_ranges (max, len : int * int) : (int * int) list =
<ankit9>
oh.. is that how functions take parameters? as tuples?
<adrien>
well, no
<adrien>
typically you'd write things like "let f a b c d = ...", with parameters separated by spaces
<ankit9>
right..
<adrien>
a parameter can be a tuple
<zorun>
ankit9: remove the ","
<adrien>
and you can pattern-match the tuple directly in the declaration
<zorun>
like "let gen_ranges (max : int) (len : int) : (int * int) list = …
<adrien>
you could write: let f x = let max, len = x in ...
<zorun>
adrien: which isn't exactly ankit9's issue, is it? :)
<ankit9>
zorun, right, that isn't what i was looking for.
<ankit9>
zorun, (max:int) (len:int) .. works fine! :)
<adrien>
I was answering the second question: "oh.. is that how functions take parameters? as tuples?"
<zorun>
oh well, yeah, sorry
<ankit9>
adrien, I meant, whether the arguments for a function get treated (internally?!) as tuples .. I was trying to figure out why the (max, len: int * int) would work..
<zorun>
it's definitely not the same thing
<ankit9>
Is it generally a good practice to annotate functions?
<ankit9>
zorun, yeah, got that now
<zorun>
it's generally *not* a good practice to use type annotations :)
<ankit9>
ah okay
<zorun>
OCaml should work out the types by itself
<ankit9>
nod
<zorun>
if it doesn't, there's a strong probability that you've done something wrong
<ankit9>
but doesn't it make code slightly easier to read ? Well, quicker atleast, when you are using some api
<zorun>
but in some (very) special cases, the compiler isn't smart enough, and you then need to annotate
<ankit9>
oh okok, didn't know that
<zorun>
if you're using an api, you should read the doc, or at least a .mli file
<zorun>
aka an interface file
<ankit9>
ah, okk, .mli, right!
<ankit9>
makes sense
<ankit9>
zorun, adrien thanks!
<ankit9>
what would be a good source to read idiomatic ocaml code?
<adrien>
you will quite often (for ocaml's definition of "often") need annotation when using objects or when you want stricter or more beautiful types with polymorphic variants
<adrien>
which is also why they're not a good thing for beginners
<ankit9>
adrien, oh okok. right, so, i'll stay away from them for now!
<orbitz>
adrien: yes, still looking into narrowing downw ahtthe RTS is doing thouhg, think i'm making progress
iago has joined #ocaml
ttamttam has left #ocaml []
<vivanov>
thelema_: thx a lot
vivanov has quit [Quit: Lost terminal]
Kakadu has quit [Quit: Konversation terminated!]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
The_third_man has joined #ocaml
iago has quit [Read error: Operation timed out]
pilki has joined #ocaml
fschwidom has joined #ocaml
fschwidom has quit [Remote host closed the connection]
ftrvxmtrx has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
<adrien>
rwmjones: \o/
probst has quit [*.net *.split]
dsheets has quit [*.net *.split]
NaCl has quit [*.net *.split]
adrien has quit [*.net *.split]
diml has quit [*.net *.split]
rbancroft has quit [*.net *.split]
othiym23 has quit [*.net *.split]
othiym23 has joined #ocaml
NaCl has joined #ocaml
NaCl has quit [Changing host]
NaCl has joined #ocaml
probst has joined #ocaml
dsheets has joined #ocaml
diml has joined #ocaml
rbancroft has joined #ocaml
adrien has joined #ocaml
adrien_ has joined #ocaml
spearalot has quit [Quit: Computer has gone to sleep]
adrien_ has quit [Client Quit]
edwin has quit [Remote host closed the connection]
Xizor has quit []
<hcarty>
thelema_: Will some sort of fix for the 3.13 Hashtbl.create signature change go into Batteries 2.0?
<hcarty>
thelema_: It would be nice if that could be done without losing 3.13's added flexibility and security.
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
letrec has joined #ocaml
milosn has quit [Ping timeout: 252 seconds]
<samposm_>
is there a better way than exp(-1.*.pi);; ?
<samposm_>
if pi is a float, -pi does not work
<adrien>
# exp (-. pi);;
<adrien>
- : float = 0.043213918263772258
<samposm_>
thank you
<adrien>
you're welcome
iago has joined #ocaml
<thizanne>
samposm_: if you want to redefine the unary negation, you have to write it let (~-) = (~-.)
<pilki>
samposm_ : in general, every float operator is the int one with a . at the end :)
<pilki>
pretty easy
<thizanne>
(and it will also work when writing -. 1., which is a shortcut for ~-. 1.
<thizanne>
)
sebz has quit [Quit: Computer has gone to sleep.]
Morphous_ has quit [Ping timeout: 252 seconds]
sebz has joined #ocaml
<samposm_>
thizanne: I am happy to just exp(-.lambda), so I don't understand why would I want to redefine things?
<thizanne>
in a code where you use many floats and no ints, for an example
<samposm_>
hmm, yes, that's what my code is like
<thizanne>
i wrote one recently and it's convenient to use operatorts without the point
<thizanne>
(first, because it lightens it and often, thses codes are full of lines of calculus, second because i would have forgotten the point in almost every operator :D)
<samposm_>
hmm, I have just been enduring the -. and *.
<thizanne>
but it's your choice
<thizanne>
if you feel good with -. and *., just keep it
<thizanne>
i personnally prefer the simplicity of - and * rather than the « explicit » side of -. and *.
<samposm_>
so how do you redefine then, exactly?
<thizanne>
(by the way, to redefine them, i think it's better to write eg. let (+.) = Pervasives.(+.) )