<thomasga>
(I've tried `ocamlbuild -mods Foo,Bar foo.cmxa` but it doesn't seem to work
<thomasga>
)
hto has joined #ocaml
<adrien_oww>
iirc you can simply do ocamlbuild foo.cmxa
jpdeplaix` is now known as jpdeplaix
Kakadu has joined #ocaml
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
<thomasga>
adrien: but the library foo needs to be define somewhere isn't it ?
<thomasga>
ie. needs to have foo.mllib
mcclurmc has joined #ocaml
<adrien_oww>
I think you can manage without but only if you have a main file for the library and it accesses the other modules
beckerb has joined #ocaml
<adrien_oww>
(but I've really given up on ocamlbuild tbh)
<thomasga>
(I don't have a main file unfortunately)
Icarot has joined #ocaml
<thomasga>
(and yes I've given up as well)
ttamttam has quit [Quit: ttamttam]
Anarchos has joined #ocaml
dwmw2_gone is now known as dwmw2
n25 has joined #ocaml
n25 has left #ocaml []
k0001 has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
clintnewsom has joined #ocaml
yacks has quit [Ping timeout: 272 seconds]
ttamttam has joined #ocaml
ttamttam has left #ocaml []
SuperNoeMan has left #ocaml []
chambart__ has quit [Quit: Quitte]
tane has joined #ocaml
ontologiae has joined #ocaml
yacks has joined #ocaml
adotbrown has quit [Ping timeout: 255 seconds]
k0001 has quit [Ping timeout: 245 seconds]
adotbrown has joined #ocaml
adotbrown has quit [Ping timeout: 252 seconds]
mikurubeam has quit [Ping timeout: 250 seconds]
kaustuv has joined #ocaml
yacks has quit [Ping timeout: 260 seconds]
oriba has joined #ocaml
yacks has joined #ocaml
ttamttam has joined #ocaml
<hcarty>
thomasga: `ocamlbuild -mods a,b a.cma` works here
<hcarty>
thomasga: Sorry, rather - `ocamlbuild -mods a,b a.cmo b.cma` works here
<hcarty>
thomasga: That's with no references between a.ml or b.ml
<hcarty>
thomasga: I can load the resulting b.cma in the toplevel and have access to modules A and B
<hcarty>
thomasga: If b.ml references the module A then I expect you wouldn't need to specific 'a.cmo' as one of the build targets.
<thomasga>
hcarty: thx, I finally manage to generate a tempory .mllib file
<thomasga>
but I'll use that next time
Icarot has quit [Ping timeout: 276 seconds]
<kaustuv>
Will 'opam remove' work on the patched archive or the original archive? (I have a patch that adds some uninstallation stuff that's missing in the upstream package.)
UncleVasya has quit [Ping timeout: 276 seconds]
<thomasga>
kaustuv: original archive unfortunately
<thomasga>
feel free to open a feature request, that indeed sound logical
<kaustuv>
OK will do
mattrepl has joined #ocaml
q66 has joined #ocaml
<companion_cube>
how costly is it to instantiate a local module?
<companion_cube>
like, let module MySet = Set.Make(...) in
<kaustuv>
It creates and initializes a new module every time that function is called.
SanderM has joined #ocaml
<kaustuv>
or rather, every time that line is run
clintnewsom has quit [Quit: clintnewsom]
<companion_cube>
hmm, so not especially cheap, I guess
<companion_cube>
thanks
<kaustuv>
I think non functor applications are free, though. In other words, the Module.(expr) thing has no runtime cost. (But I could be wrong about that.)
<companion_cube>
it sounds logical, since you only have to get a pointer to an already existing module
<companion_cube>
whereas applying a functor may create a truly new module
kaustuv has left #ocaml []
ollehar has quit [Ping timeout: 256 seconds]
ollehar has joined #ocaml
travisbrady has joined #ocaml
ollehar has quit [Ping timeout: 250 seconds]
clintnewsom has joined #ocaml
clintnewsom has left #ocaml []
travisbrady has quit [Quit: travisbrady]
ollehar has joined #ocaml
travisbrady has joined #ocaml
SanderM has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 248 seconds]
osa1 has joined #ocaml
mcsquiggedy has joined #ocaml
kaustuv has joined #ocaml
<kaustuv>
thomasga: thanks for the quick fix to the remove issue
kaustuv has left #ocaml []
mcsquiggedy has left #ocaml []
<thomasga>
does it work ?
<thomasga>
:-)
cago has left #ocaml []
mika1 has quit [Quit: Leaving.]
mikurubeam has joined #ocaml
beckerb has quit [Ping timeout: 245 seconds]
ulfdoz has joined #ocaml
ulfdoz has quit [Client Quit]
thomasga has quit [Quit: Leaving.]
Capprentice has joined #ocaml
ulfdoz has joined #ocaml
Yoric has joined #ocaml
Capprentice has left #ocaml []
yth has joined #ocaml
Anarchos has quit [Ping timeout: 250 seconds]
travisbrady has quit [Quit: travisbrady]
UncleVasya has joined #ocaml
yth has left #ocaml []
travisbrady has joined #ocaml
adahlberg has joined #ocaml
Enjolras is now known as EnjolrasFantome
amaloz has joined #ocaml
Anarchos has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
mikurubeam has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
mikurubeam has joined #ocaml
adahlberg has quit [Remote host closed the connection]
Yoric has quit [Ping timeout: 256 seconds]
Cyanure has joined #ocaml
Yoric has joined #ocaml
k0001 has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
mcclurmc has quit [Ping timeout: 264 seconds]
ulfdoz has quit [Quit: brb]
oriba_ has joined #ocaml
ulfdoz has joined #ocaml
<ollehar>
can't get my cgi-script to flush output before starting Lwt_main.run...
<ollehar>
cgi#out_channel#commit_work doesn't work
oriba has quit [Ping timeout: 248 seconds]
adahlberg has joined #ocaml
Yoric has joined #ocaml
k0001 has quit [Ping timeout: 250 seconds]
k0001 has joined #ocaml
rwmjones has quit [Read error: Operation timed out]
<adahlberg>
Okay, I am new to Ocaml and functional languages... I have a day type: type day = Sun | Mon | Tues | Wed | Thurs | Fri | Sat;; I am looking to create a function like let f n d = where you pass in an integer n and the function returns the day distance n away. I understand If I place d in an array some how I can take n%7 and move that many positions in the array. Anyone have any insight. I keep getting results like return type ex
<adahlberg>
pected day, but given unit.
<adahlberg>
it should be int -> day -> day
<ollehar>
adahlberg: you mean, what day is it n days from now?
<ollehar>
or from day d
<adahlberg>
from d
ottbot has quit [Ping timeout: 264 seconds]
<adahlberg>
like if i passed f Sun 3 it would give Wed
<ollehar>
ok
<adahlberg>
Where Sun is 1st and Saturday is last
<ollehar>
maybe you need a function that maps int -> day, like match n with 0 -> Sun | 1 -> Mon ...
k0001 has quit [Read error: Connection reset by peer]
<ollehar>
f n d = match n%7 + int_of_day d with m -> day_of int m
<ollehar>
match (n%7 + int_of_day d) % 7 with ...
<Kakadu>
(n + int_of_day d) % 7 |> day_of_int
rwmjones has joined #ocaml
<adahlberg>
Thanks for the insight, I will try this and let you know.
adahlberg has quit [Remote host closed the connection]
<ollehar>
Kakadu: nice
<ollehar>
:)
mcclurmc has joined #ocaml
ontologiae has joined #ocaml
adahlberg has joined #ocaml
chambart has quit [Ping timeout: 276 seconds]
path[l] has joined #ocaml
<wmeyer`>
adrien: oh
<adrien>
ho ho ho!
<adrien>
we're closer to easters than christmas however :-)
<wmeyer`>
adrien: lol
<wmeyer`>
well, still closer to eater
<wmeyer`>
anyway, I have to dig into mantis, the deadlines past already ...
<ollehar>
why doesn't lwt_unix wrap unix.setsid?
<path[l]>
hi, I'd like some help with ocamllex. I'm trying to write a rule to match heredocs
<path[l]>
but I dont know how to match the endtoken in my special "heredoc parsing rule"
<wmeyer`>
you pass the word into the rule
<wmeyer`>
and just parse everything
<wmeyer`>
and call heredoce lexbuf unless it's a word
<wmeyer`>
but easier
<path[l]>
ah, you mean write an if statement to check for the endtoken
<wmeyer`>
yes
<adrien>
deadlines are meant to be not respected :-)
<path[l]>
aha thanks
<wmeyer`>
anyway you have to call recursively call it
<wmeyer`>
you have to be a little careful how you recognise though
<wmeyer`>
i'd suggest to do it on character basis
<wmeyer`>
parse one character, and in paraler compare with the delimitier
<wmeyer`>
if they match get next character and go to the next delimiter character
<wmeyer`>
if not reset the to begining of the delimiter
<wmeyer`>
and so on
<wmeyer`>
adrien: I like this approach :-)
<wmeyer`>
path[l]: it's all so difficult purely because you have a dynamic delimiter
<wmeyer`>
and the tables of ocamlex are static
<path[l]>
wmeyer`: yeah, but the approach you suggested seems like it'll work for me
<path[l]>
hehe
<wmeyer`>
path[l]: and of course you don't want to lex the here-doc, so I'd suggest a manual loop
<wmeyer`>
make sure you use Buffer module to concatenate
<path[l]>
sorry I dont follow, but I think I need to lex the here-doc because inside the heredoc variable substitution is allowed
<path[l]>
and arbitrary expressions
<wmeyer`>
path[l]: yes, then you have toO :-) redoing shell?
<path[l]>
haha, php actually
<path[l]>
there's a bunch of people who have already done work on this, but I'm new to ocaml
ttamttam has left #ocaml []
<wmeyer`>
path[l]: pfff <--- never remember how many fs are here
<path[l]>
yeah I was looking at the pfff solution for heredocs, but it does more than I need. Still if I find this too hard maybe I'll just steal that bit from pfff
<adrien>
ocamlfind + oasis + ocamlbuild is a _very_ effective combination for cross-compilation
<adrien>
ounit, no issue; fileutils, no issue
<wmeyer`>
adrien: cool!
<adrien>
not sure how I'm going to handle type-conv
<adrien>
(camlp4)
<wmeyer`>
adrien: but you have to just invoke the native camlp4 at compile time?
<wmeyer`>
hm yes, camlp4 marshals ast
<wmeyer`>
so that might be differetn across the architectures
<adrien>
well I actually need sexplib
<adrien>
and it's going to want to link against type-conv
<wmeyer`>
ah i see and it's dynlinking
<wmeyer`>
the plugin
<wmeyer`>
you have to provide two versions :-)
<wmeyer`>
one native and other one cross compiled
<wmeyer`>
at least package the cross compiled, but your package manager should compile the same thing twice
<adrien>
providing both doesn't seem difficult
<adrien>
but then I'd have to have sexplib use the right one each time
<adrien>
but for now I think I'll skip the camlp4 issue: I don't need the extension in sexplib
<adrien>
I only need the library
<wmeyer`>
for bootstrapping yypkg?
<adrien>
(I've removed use of the extension in yypkg some time ago)
<adrien>
yup
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<adrien>
is there a way to not build and not configure a library with oasi ?
<adrien>
oasis*
<wmeyer`>
to build and not configure you mean?
wmeyer` has quit [Remote host closed the connection]
wmeyer has joined #ocaml
<wmeyer>
I opened an e-mail with commit and emacs did bang
<adrien>
:D
<adrien>
in sexplib, there are two libraries: the support and the syntax extension
<adrien>
I want to skip the syntax extension for configuring to installing
<adrien>
I could hand-edit the setup.ml file but I'd like to avoid that
<wmeyer>
just touch the resulting file, and it will not build
<wmeyer>
but make sure it will be copied
<adrien>
I still need to run -configure for the support library
<wmeyer>
sounds like a hack
<wmeyer>
probably not many people tried that ;-)
<adrien>
well, I'd like --disable-library2
<wmeyer>
there is Build: ${flag}
<wmeyer>
or smthg like this
<wmeyer>
but not everybody uses it
<adrien>
unfortunately I don't have oasis in the build environment so I can't change the _oasis file and regenerate it
<adrien>
I've hacked the setup.ml file: it'll be good for tonight
<adrien>
I think I have an issue with packs
<ollehar>
is there a way to do Lwt_main.run (match Lwt_unix.fork with 0 -> do things ...)
osa1 has quit [Ping timeout: 255 seconds]
yacks has quit [Quit: Leaving]
_andre has quit [Quit: leaving]
<adrien>
well, now I know that "partialld" in the sources of ocaml is used to make packs
djcoin has quit [Quit: WeeChat 0.3.9.2]
metasyntax has quit [Quit: Leaving]
amaloz has left #ocaml []
Kakadu has quit []
Icarot has joined #ocaml
mikurubeam has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<adrien>
src/_build/yypkg/yypkg.native: PE32 executable (console) Intel 80386, for MS Windows
<adrien>
\o/
<adrien>
the ability to redefine the commands used for "ocamlopt" (for instance) in findlib.conf is simply awesome
<adrien>
I've cross-compiled 4 or 5 packages without changing anything except disabling camlp4 and toploop support in sexplib
<adahlberg>
I asked about this earlier, I am a rookie to functional programming and am trying to get down some knowledge of functions with custom user types. Please check this out, any help is welcomed.