Shoggoth has quit [Remote host closed the connection]
eldragon has joined #ocaml
<kmkaplan>
hcarty: OK, thank you.
<f[x]>
ttamttam1, you should create import lib for your dll first and then make c code use that import lib and do not put dll on command line for ocamlnklib
oriba has quit [Quit: Verlassend]
sramsay has joined #ocaml
sramsay has quit [Client Quit]
barismetin has joined #ocaml
ttamttam1 has quit [Quit: Leaving.]
ttamttam has joined #ocaml
<ttamttam>
f[x]: Thank you
<ttamttam>
I had it ok directly. But I needed to make some copies of my dll, because of conventions of different tools
<ttamttam>
-lname can mean different concrete files…
<ttamttam>
Generating an import library seems not so easy.
<ttamttam>
If I'm correct, I have to create a .def for that
<ttamttam>
And from memory, I have to manually edit it for each entry (@n)
<ttamttam>
Which I'd like to avoid, if possible…
Yoric has joined #ocaml
ikaros_ has joined #ocaml
ikaros has quit [Read error: Operation timed out]
<f[x]>
no, it is fully automatic - see implib
<f[x]>
and it is a bad style to provide dll without import lib
<f[x]>
implib is for msvc iirc, mingw tool may be named some other way
<ttamttam>
I'll have a look. Thanks.
<f[x]>
ehm, actually I am wrong, looks like mingw doesn't need explicit import library
barismetin has quit [Remote host closed the connection]
waterChip has joined #ocaml
waterChip has left #ocaml []
Yoric_ has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric_ is now known as Yoric
munga has quit [Ping timeout: 240 seconds]
avsm has quit [Ping timeout: 276 seconds]
ygrek has joined #ocaml
f[x] has joined #ocaml
barismetin has joined #ocaml
spearalot has joined #ocaml
Associat0r has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
M| has quit [Ping timeout: 276 seconds]
M| has joined #ocaml
<adrien>
not strictly related to ocaml: I want to make a dot-like graph but I can't get the proper layout: anyone know a way to reuse dot/graphviz but do my own layout (it's really simple: (30*i, 30*j) with i and j in [1;2;3])
<f[x]>
you can specify coordinates explicitely iirc
<flux>
you can tell the locations of your nodes to graphviz and pin them down in certain layout algos it has
<adrien>
can it be done through the command-line interface or only the library api?
Shoggoth has joined #ocaml
fschwidom has joined #ocaml
<flux>
I've only used the dot-files ever
ccasin has joined #ocaml
ccasin has quit [Remote host closed the connection]
ccasin has joined #ocaml
iZZy_ has joined #ocaml
iZZy_ has quit [Client Quit]
ikaros has joined #ocaml
ikaros_ has quit [Ping timeout: 276 seconds]
joewilliams_away has left #ocaml []
joewilliams has joined #ocaml
K-Yo has joined #ocaml
<K-Yo>
hey there
<K-Yo>
I would like to define a global var inside a function, is that possible?
Submarine has joined #ocaml
oc13 has left #ocaml []
oriba has joined #ocaml
<gildor>
K-Yo: you can change the value of a global variable inside a function, but you cannot define it
<mrvn>
K-Yo: Let foo = let x = ref 0 in function y -> incr x; x +y?
<K-Yo>
okay thanks
<K-Yo>
=)
derdon has joined #ocaml
segmond has joined #ocaml
maskd has joined #ocaml
danicampa90 has joined #ocaml
* ttamttam
is trying to compile ocaml from source under mingw…
* adrien
wishes ttamttam good luck
<ttamttam>
And failing whe ocamlbrowser.exe
<ttamttam>
is to be generated…
<ttamttam>
Some problem with tcl/tk dlls…
<ttamttam>
Grrr
<adrien>
that one is easy to fix, only annoying ;-)
<ttamttam>
*should* be easy to fix, you mean ?
<ttamttam>
I do have TK_ROOT=c:/tcl
<ttamttam>
in config/Makefile
<ttamttam>
and /cygdrive/c/Tcl/bin in my PATH
<adrien>
do you want tcl/tk support? if not, disable it
<ttamttam>
I do : ocamlbrowser often help
<ttamttam>
And I don't really have the time to port it to gtk ;-)
<adrien>
ttamttam: you're compiling for windows or for cygwin
danicampa90 has quit [Quit: bye bye!]
<ttamttam>
mingw
<ttamttam>
from cygwin
<ttamttam>
I use a script, to do the job.
travisbrady has joined #ocaml
<ttamttam>
And it works in another computer.
<ttamttam>
I'm just to spot the differences…
<adrien>
do you have nm?
<ttamttam>
Well. nmTAB prints nm.exe
<adrien>
yeah, run it on the dll and check you get these function names (pipe to less or any pager), leading underscore is ok too?
spearalot has quit [Quit: Computer has gone to sleep]
segmond has quit [Ping timeout: 240 seconds]
<ttamttam>
pexports can't load PE image of tk85.dll, and nm found no symbol!
<adrien>
doh, nm doesn't work on dlls ><
<adrien>
hmmm, dunno, and really gotta work now =/
<ttamttam>
Thanks for your time
_unK has joined #ocaml
lxnay|lappie has quit [Changing host]
lxnay|lappie has joined #ocaml
<lxnay|lappie>
what's the reason behind the signature of this function ===> let rec a () = let b () = a () in b ();; [unit -> 'a -> <fun>]
<lxnay|lappie>
i mean, i didn't expect it to return 'a
<lxnay|lappie>
;)
<mrvn>
What should it return?
<adrien>
what would you want it to return?
<lxnay|lappie>
eheh, i expected unit
<mrvn>
Sometimes -> 'a means it doesn't return
<lxnay|lappie>
oh really
<lxnay|lappie>
nice tip ;)
<mrvn>
Things that don't return can't infere the return type.
<adrien>
it never returns so it could return anything
<thelema>
functions start off 'a -> 'b, and are restricted from that by their use (and the use of their arguments)
<thelema>
for yout function, 'a clearly must be (), but there's no restriction on the return type, so it stays polymorphic
<thelema>
*your
<mrvn>
thelema: why should it be ()? Could be int too
<thelema>
because it's matched against () in the function declaration
<mrvn>
ahh, the 'a in 'a -> 'b.
<thelema>
yes, too many 'a's floating about
<thelema>
maybe I should have said 'b -> 'a, and then the 'a's would agree
barismetin has quit [Ping timeout: 265 seconds]
barismetin has joined #ocaml
sepp2k has quit [Remote host closed the connection]
barismetin has quit [Remote host closed the connection]
Yoric has quit [Quit: Yoric]
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
fschwidom has quit [Remote host closed the connection]
krankkatze has quit [Quit: leaving]
oriba has quit [Quit: Verlassend]
krankkatze has joined #ocaml
travisbrady has quit [Quit: travisbrady]
Shoggoth has quit [Read error: Connection reset by peer]
Submarine has quit [Quit: Leaving]
ttamttam has quit [Quit: Leaving.]
lxnay|lappie has quit [Ping timeout: 252 seconds]
travisbrady has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
lxnay|lappie has joined #ocaml
Yoric has joined #ocaml
neorab has joined #ocaml
valross has quit [Remote host closed the connection]
albacker has joined #ocaml
lxnay|lappie has quit [Changing host]
lxnay|lappie has joined #ocaml
ttamttam has joined #ocaml
ygrek has joined #ocaml
Submarine has joined #ocaml
avsm has joined #ocaml
<travisbrady>
How come this "module FMap = Map.Make (Float);;" works in ocamlrun but when I try to compile I get "Error: Unbound module Float"?
danicampa90 has joined #ocaml
avsm has quit [Ping timeout: 272 seconds]
<derdon>
travisbrady: where does Float come from?
<travisbrady>
derdon: Hmm, not sure. Batteries maybe?
<travisbrady>
Oh well, this works: module FloatMap = Map.Make (struct type t = float let compare = compare end);;
<hcarty>
travisbrady: It is likely from Batteries or Core, and whichever library provides it is not being linked in
Smerdyakov has joined #ocaml
Smerdyakov has quit [Remote host closed the connection]
<neorab>
Is there a way to use the -c compiler flag and -o in a way to put the .cmi .cmx and .o into another folder?
fraggle_ has quit [Read error: Connection reset by peer]
<gildor>
neorab: no
<neorab>
is there any way to direct these compile files?
<gildor>
what means to direct ?
<neorab>
sorry, to have them created elsewhere other than just moving them after they are created
<gildor>
neorab: ocamlbuild do it the other way round: move the source file before compiling
<gildor>
neorab: I think this is the only way you can do it
<neorab>
ah, that's clever
<neorab>
thanks
<neorab>
I just don't trust myself to be deleting old files inside my src directory before commits, heh
<hcarty>
neorab: Using OCamlMakefile or ocamlbuild would be very helpful in that case
<gildor>
neorab: take a look at ocamlbuild, it create a single _build at the toplevel of your source directory
<gildor>
neorab: this way you can have a single directory to ignore
<gildor>
very clean
<neorab>
will do, thanks
<gildor>
and you can use OASIS to create your whole build system very simply
_andre has quit [Quit: Lost terminal]
<derdon>
gildor: can I tell OASIS that my project requires 3rd party OCaml projects as dependencies?
<gildor>
derdon: as long as this third parties provide a META file, yes
<gildor>
(i.e. are integrated with findlib)
<gildor>
e.g. BuildDepends: oUnit (>= 1.0.2)
<gildor>
derdon: I leave until tomorrow morning, leave a message here or by mail if you need information about OASIS
kg4qxk has quit [Quit: So long, and thanks for all the fish!]
enthymeme has joined #ocaml
<derdon>
gildor: ok, thanks for your help!
<derdon>
gildor: I hope this behaviour (adding dependencies) is document in the OASIS documentation
<krankkatze>
hi, how do I concatenate a char and a string?
<hcarty>
krankkatze: You would need to create a new string
<krankkatze>
hum
<hcarty>
String.init (String.length s + 1) (fun i -> if i < String.length s then s.[i] else c)
<hcarty>
That's completely untested, but something like that would have to be done
<krankkatze>
something like " ".[0] <- char ?
<hcarty>
Batteries may provide a function to do something like this. Or you could use ropes
<krankkatze>
to make the char be a string, and then use ^
<krankkatze>
would this be ok ?
<krankkatze>
oh no
<krankkatze>
i'm beeing stupid
<krankkatze>
sorry
<hcarty>
You'd want something like (String.make 1 ' ')
<hcarty>
You could use ^ with the resulting value then if you like
<hcarty>
A buffer would be a more efficient way to do this though
<krankkatze>
a buffer?
<hcarty>
See the Buffer module
<hcarty>
It allows you to more efficiently build a string character-by-character
<hcarty>
Though I don't know if that is it's intended purpose..
ttamttam has quit [Quit: Leaving.]
danicampa90 has left #ocaml []
jeddhaberstro has joined #ocaml
oc13 has joined #ocaml
Submarine has quit [Quit: Leaving]
sepp2k has joined #ocaml
Yoric has quit [Quit: Yoric]
ygrek has quit [Ping timeout: 245 seconds]
derdon has quit [Ping timeout: 248 seconds]
ikaros has joined #ocaml
oc13 has quit [Ping timeout: 272 seconds]
joewilliams is now known as joewilliams_away
<travisbrady>
Is there some way to fold over a Map but terminate early provided some condition has been reached?
oriba has joined #ocaml
<hcarty>
travisbrady: You could raise an exception containing the result and catch that
<travisbrady>
hcarty: Ahh, ok. I'd thought of that but it seemed slightly hackish. thanks.
<hcarty>
travisbrady: It is a little hackish, but it should be fairly efficient.
<hcarty>
travisbrady: You could also filter the map to contain only the data you want and then fold over the result
<travisbrady>
Hmmm, my use case is i have a map where I want to take elements so long as a running some of the keys does not exceed some value. So I think a fold w/ exception will do the trick
thieusoai has quit [Quit: Leaving]
Associat0r has quit [Quit: Associat0r]
fraggle_ has joined #ocaml
kg4qxk has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
fraggle_ has joined #ocaml
oriba has quit [Quit: Verlassend]
albacker has quit [Quit: Leaving]
bzzbzz has joined #ocaml
valross has joined #ocaml
K-Yo has quit [Remote host closed the connection]
ikaros has quit [Quit: Leave the magic to Houdini]
<travisbrady>
Anywhere in particular I should look trying to track down a Stack_overflow? I get a segfault when I compile with ocamlopt
<travisbrady>
My program doesn't seem to be using much memory though.
<ntaylor>
travisbrady: stack overflow implies non-terminating recursion rather than memory usage
<ntaylor>
(typically)
<travisbrady>
Is there a debug flag I can set to get a more informative error message?
<travisbrady>
Hmm, trying to use -g and ocamldebug, but not sure it works with what I'm trying to do. My program reads lines on stdin
<travisbrady>
I keep getting "(ocd) Syntax error."
<ntaylor>
how long is your code? Is it pastebinable?