<ewcy>
(can u see the question? i can summarize if u can't access it)
<ewcy>
so basically a very simple introductory tasks. Given "N", and then "N" lines of "K S", where K is an integer, S is a string
toolslive has quit [Ping timeout: 248 seconds]
toolslive has joined #ocaml
<ewcy>
for each "K S", output "S" with the K-th letter removed
<ewcy>
pretty silly question. but i kept having compilation error
<ewcy>
and when i removed the entire Scanf thing, with "let (k,s) = (4,"something here for debug purpose")"
<ewcy>
it went through, but then gives me some other compilation error: :line1: error: 'let' does not name a type
<ewcy>
so i hv 2 confusion:
<Kakadu>
current code is compilable on 3.12
<ewcy>
1) I thought Scanf.bscanf is always included with any versions ocaml ? is there any case it is not available? And if there is such case, what should I use to replace that functionality?
<ewcy>
2) And the line1 error about "let" not naming a type, any hint for me what that is about?
<ewcy>
thanks for the heads up kakadu
<Kakadu>
I don't what your testing system worry about. Can u give a screenshot?
<ewcy>
no prob let me get u a screenshot
<ewcy>
but the judge system didn't give ANY output at all, so not particularly useful
<Kakadu>
I want to see text 'let' does not name a type
<Kakadu>
➊ Heh, my IRC client can insert unicode symbols
* Kakadu
happy
<ewcy>
oh i just solved the 'let does not name a type' error - i picked a wrong language
cdidd has joined #ocaml
<ewcy>
btw, is there any good online judge for ocaml that you would recommend?
<thelema>
f[x]: you're right; the linking flags just need to be on the ocamlmklib call
<f[x]>
toolslive, your myocamlbuild.ml is no good
<toolslive>
well, the C_stubs are in there.
<toolslive>
(in my .cma)
mnabil has quit [Ping timeout: 260 seconds]
<toolslive>
ocamlobjinfo _build/camltc.cma
<toolslive>
...
<toolslive>
Primitives declared in this module:
<toolslive>
bdb_key_count
<toolslive>
bdb_defrag
<toolslive>
bdb_optimize
<toolslive>
bdb_prefix_keys
<toolslive>
bdb_range_bytecode
<toolslive>
bdb_tranabort
<toolslive>
bdb_trancommit
<toolslive>
bdb_tranbegin
<toolslive>
...
<thelema>
toolslive: you also need to put "-cclib -ltoktocabinet -cclib -lotc" on the commandline to build your .cm[x]a
<f[x]>
thelema, you always spoil all my pedagogical attempts!
<thelema>
the ocamlbuild example with c stubs link has the changes needed to your myocamlbuild.ml
<toolslive>
just ftr, I have awful experiences with oasis.
<toolslive>
(too)
<thelema>
f[x]: somehow, I don't think that toolslive is looking to be taught, and seems capable of figuring things backwards from a solution to why that works.
<f[x]>
toolslive, what's the problem with oasis?
<f[x]>
I found it rather helpful
<toolslive>
last time I tried it, the binary did not work on our continuous integration environment, and building if from source turned out to be a kitchen sink type of problem
<thelema>
toolslive: yes, building from source was terrible. There's been some improvements in the number of deps
<f[x]>
and there is a bundle iirc
<thelema>
also, opam and odb both build it in an automated manner
<f[x]>
nowadays
<toolslive>
so you think I should be able to persuade oasis to unpack C library, compile it and generate a decent myocamlbuild.ml for this wrapper lib?
<f[x]>
anyway, I stronly recommend oasis, despite all of its shortcomings
<f[x]>
yes, you could copy-paste part of your myocamlbuild.ml that does that I think
<thelema>
unpack C library?
<f[x]>
because writing correct myocamlbuild for C stubs (think byte/native case, windows support) is not trivial
<toolslive>
basically, my ocamlbuild also does the
<toolslive>
tar -zxvf .....tar.gz
<toolslive>
./configure ....
<toolslive>
make
<toolslive>
steps to compile the C sources in the tarball
<toolslive>
I don't care about windows as tokyo cabinet does not work there anyway.
<thelema>
toolslive: ?? embedding the library you're depending on within your package?
<toolslive>
well, if I use it as a shared library, and depend on the system's .so I'm not sure which one I'm getting.
<toolslive>
I force it to create the .a for static linking.
Kakadu has quit [Quit: Konversation terminated!]
<thelema>
ah... well, if you insist...
tane has joined #ocaml
<toolslive>
I don't insist.
<thelema>
I would just change myocamlbuild to use --cclib
<thelema>
flag ["link";](S[A"libotc.a";]);
<thelema>
instead of that, S[A"-cclib"; A"-lotc"]
<thelema>
although I'll note that this rule is probably too generic; you should probably have more tags than just "link"
<thelema>
and is it your style to end lists with ;?
<toolslive>
nope.
<toolslive>
it's an accident from trying different things
<thelema>
ok, it looked consistent...
<thelema>
for multi-line lists, maybe. for single-line...
Break has joined #ocaml
<toolslive>
honestly I don't care about consistency in something like a myocamlbuild.ml it's a place where you tweak until it works, and then forget about it until the next time.
<f[x]>
(* -ldevkit_stubs for ld when installed *)
<f[x]>
- flag ["link"; "ocaml"; "library"] (S[A"-cclib"; A "-ldevkit_stubs";]);
<f[x]>
flag ["link"; "ocaml"; "library"; "byte"] (S[A"-dllib"; A "-ldevkit_stubs";]);
<f[x]>
let stubs_lib = "libdevkit_stubs." ^ !Options.ext_lib in
<f[x]>
let stubs_dll = "dlldevkit_stubs." ^ !Options.ext_dll in
<f[x]>
dep ["link"; "ocaml"; "library"] [stubs_lib; stubs_dll];
<pippijn>
toolslive: I care a lot
<thelema>
fair enough. I'm just making sure there's not a subset of OCaml programmers that have an accent to their code like this.
<pippijn>
well, not a lot
<pippijn>
but I care a little
<toolslive>
btw, is there something that suggests better style like there is for haskell?
<f[x]>
["link"] is going to hurt if you compile binary using library alongside the library
<toolslive>
owkee. the -cclib change gives me less trouble.
<thelema>
toolslive: still some trouble?
<f[x]>
BREAKING NEWS!
<toolslive>
?
tac has joined #ocaml
<toolslive>
flag ["link";](S[A"-cclib";A"-lotc"]);
<toolslive>
that's an improvement, but when I try to do the same for the tokyocabinet part.
<toolslive>
gcc: error: libtokyocabinet.a: No such file or directory
<toolslive>
argh.
<thelema>
f[x]: it suffices to use -cclib and -ccopt correctly
<thelema>
how is that command-line created? Maybe you just need to remove libtokyocabinet
<thelema>
.a
<toolslive>
it produces the -L..../lib/camltc
<toolslive>
it also produces the libtokyocabinet.a
<toolslive>
and that IS in the lib dir where the META is.
<smondet>
Dear Oasis experts, is there a way to tell Oasis to use a given package when compiling a library but not to put it as a requirement in the generated META file? (a syntax extension)
<f[x]>
thelema, yes, but somehow those options are often mixed up and chaos ensues
<thelema>
toolslive: your meta file still has the linkopt=, right?
<toolslive>
ah!
<thelema>
smondet: yes. Now I just need to remember what package I saw that did this
<thelema>
one of the jane street core packages
<toolslive>
weee! thx for the help. it works, both my testcases and my library.
ontologiae has quit [Read error: Connection reset by peer]
answer_42 has quit [Remote host closed the connection]
answer_42 has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
iago has joined #ocaml
ftrvxmtrx has joined #ocaml
avsm has quit [Quit: Leaving.]
GnomeStoleMyBike has quit [Ping timeout: 260 seconds]
pangoafk is now known as pango
Break has quit [Remote host closed the connection]
beckerb has quit [Quit: Konversation terminated!]
tane has joined #ocaml
Snark has joined #ocaml
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 256 seconds]
paolooo has quit [Ping timeout: 245 seconds]
smondet has quit [Read error: Connection reset by peer]
wtetzner has quit [Ping timeout: 244 seconds]
wtetzner has joined #ocaml
cdidd has quit [Remote host closed the connection]
GnomeStoleMyBike has joined #ocaml
chambart has quit [Ping timeout: 246 seconds]
andreypopp has quit [Quit: sleep]
ontologi1e has quit [Ping timeout: 260 seconds]
ewcy has quit [Quit: Page closed]
tane has quit [Quit: Verlassend]
Yoric has joined #ocaml
<thelema>
beginner42: what's the compile command line?
emmanuelux has joined #ocaml
trotro has joined #ocaml
trotro has quit [Client Quit]
_andre has quit [Quit: leaving]
answer_42 has quit [Ping timeout: 276 seconds]
Jeaye has quit [Ping timeout: 276 seconds]
answer_42 has joined #ocaml
Jeaye has joined #ocaml
Progster has quit [Ping timeout: 252 seconds]
<beginner42>
thelema: i just say make
Anarchos has joined #ocaml
smondet has joined #ocaml
dwmw2_gone has quit [Ping timeout: 260 seconds]
dwmw2_gone has joined #ocaml
Progster has joined #ocaml
uselpa has joined #ocaml
answer_42 has quit [Quit: WeeChat 0.3.9]
<adrien>
hmpf, cairo2's installation procedure hardcodes MSVC stuff and C://gtk
<Anarchos>
adrien lol
<orbitz>
Is it evil if I want a functor with multiple parameters?
<_habnabit>
nope
<orbitz>
I'm having trouble finding the correct syntax for .ml and .mli on google, any suggestions?
<_habnabit>
module BetterMap (OM: Map.S) (PBLE: PPRABLE with type t = OM.key) : (M with type key = OM.key) =
<Anarchos>
orbitz you have sampes in the ocaml official manual
uselpa has left #ocaml []
<orbitz>
Anarchos: do I? AbstractSet2?
<orbitz>
_habnabit: Am I doing something wrong if mytwo functor parameters do not depend on each other? In this case I'm bridging two module
<_habnabit>
orbitz, not necessarily
<_habnabit>
orbitz, it does sound a bit odd though
<_habnabit>
orbitz, but it could be that your module parameters already have fixed types so there's an implicit type dependency
<orbitz>
I'm functorizing over something that impleemnts my Application module type and my I/O module type so I can decouple where data comes from and how it's processed
<orbitz>
Why is this wrong? module Make : functor (A : A_TYPE) (B : B_TYPE) -> sig end
<_habnabit>
huh, that doesn't look like any syntax i've ever seen
<orbitz>
the syntax you showed me was for a .ml wasn't it?
<_habnabit>
are you trying to declare a module type, or just indicate the type before your struct..end?
<_habnabit>
it was from a .ml
<orbitz>
What does it translate to for the .mli?
<_habnabit>
hmm, I don't know
<_habnabit>
oh
<_habnabit>
module BetterMap: functor (OM: Map.S) -> functor (PBLE: [snip]) -> sig [snip] end
<_habnabit>
makes sense
<orbitz>
fanstastic
<orbitz>
looks good for me
<orbitz>
thanks _habnabit
<adrien>
of fuck, found a huge hole in ocaml on windows
<adrien>
it looks for some files (libraries) by itself and it misses some paths
Cyanure has quit [Remote host closed the connection]
<adrien>
yurk, it's really awful
<orbitz>
Windows, the bastard child
<adrien>
well, my stuff is properly sorted
<adrien>
gcc finds everything
fusillia has joined #ocaml
<adrien>
ocamlmklib and ocamlfind apparently have their own lookup stuff which is not correct
<wieczyk>
22:28 < adrien> gcc finds everything
<wieczyk>
?
Yoric has quit [Ping timeout: 276 seconds]
Snark has quit [Quit: Quitte]
Progster has quit [Ping timeout: 256 seconds]
<adrien>
wieczyk: I mean: gcc finds all the library files that ocaml* complain about
<adrien>
meaning the file are at the right location
<wieczyk>
but ocaml is complaining about C libraries?
<wieczyk>
or about his bindings to this libraries?
tane has joined #ocaml
yroeht has quit [Ping timeout: 240 seconds]
Kakadu has quit [Read error: Connection reset by peer]
<adrien>
ocaml is unable to find basic system libraries
<wieczyk>
;[
smondet` has joined #ocaml
smondet has quit [Ping timeout: 252 seconds]
jamii has quit [Ping timeout: 255 seconds]
yroeht has joined #ocaml
Progster has joined #ocaml
avsm has joined #ocaml
Yoric has joined #ocaml
tane has quit [Quit: Verlassend]
ftrvxmtrx has quit [Quit: Leaving]
jamii has joined #ocaml
ftrvxmtrx has joined #ocaml
beginner42 has quit [Ping timeout: 252 seconds]
djcoin has quit [Quit: WeeChat 0.3.9]
chambart has joined #ocaml
avsm has quit [Quit: Leaving.]
bender_ has joined #ocaml
fusillia has quit [Ping timeout: 252 seconds]
Yoric has quit [Ping timeout: 260 seconds]
mjonsson has quit [Ping timeout: 246 seconds]
chambart has quit [Ping timeout: 246 seconds]
Anarchos has quit [Quit: night time]
arneis has quit [Ping timeout: 245 seconds]
chambart has joined #ocaml
sepp2k1 has quit [Read error: Connection reset by peer]