Simn has quit [Read error: Connection reset by peer]
talzeus has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
weie has joined #ocaml
weie has quit [Quit: Leaving...]
MitoticSpindle has joined #ocaml
<caseyjames>
Does anyone here have experience with ctypes - specifically, how do I integrate into a C app? I'm making an iOS app, and compiling the OCaml with OCamlXARM... How do I tie it together?
ygrek has joined #ocaml
Drup has quit [Quit: Leaving.]
breakds has joined #ocaml
manud has quit [Quit: manud]
moro_home has quit [Ping timeout: 246 seconds]
<caseyjames>
If I declare a struc in a ctype, and then use that struc as an element in another stuc ctype, don't their name definitions interfere? what parts need to match the c structure names exactly?
wagle has quit [Remote host closed the connection]
moro_home has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest32911
breakds has quit [Remote host closed the connection]
Guest32911 has quit [Remote host closed the connection]
erikc has quit [Quit: erikc]
wagle has joined #ocaml
yacks has quit [Quit: Leaving]
malc_ has joined #ocaml
UncleVasya has joined #ocaml
UncleVasya has quit [Remote host closed the connection]
<Kron>
my current tuareg (from marmalade) doesn't extend prog-mode
<companion_cube>
ggole: you'd like pattern views, I guess? Me too ^^
<Kron>
and i figured that would be a simple suggestion to make to anyone who can add code to tuareg itself
<ggole>
Yeah, I guess so
<Kron>
but maybe I'm running an old version or something
<ggole>
I'm looking at this match-heavy code and I have the same identical fragment (occasionally with one bit slightly different, always the same bit) about twenty times
<ggole>
Oh well, sugar rots the teeth.
<Drup>
Kron: what's the purpose of the prog mode ?
<nicoo>
ggole: « Abstraction over patterns » ?
<Kron>
nothing much, just lets me abstract away features across all my programming buffers
<Kron>
for example, this is some code in my .emacs:
<ggole>
prog-mode is a way to say "do this for every programming mode"
<Kron>
prog-mode will inherit into haskell-mode, lisp-mode, c-mode, elisp-mode, etc. etc.
<Kron>
but I keep having to say "... also tuareg"
<Kron>
and it's getting annoying
<Drup>
ok
<Kron>
it seems like a relatively simple fix
<Drup>
I'm afraid you will have to do it yourself :/
<Kron>
that sounds like a real shame
<ggole>
nicoo: basically I'd like a way to name pattern fragments (with arguments) so I don't have to keep typing them again and again.
<nicoo>
ggole: I see.
<Drup>
ggole: I know the feeling, I'm doing manipulation over AST right now
<ggole>
Yes, this is a value numbering pass
<ggole>
With lots of identities :/
<Drup>
ggole: and in haskell, they don't even have the short "Bla b | Bli b -> f b
Kakadu has joined #ocaml
<watermind>
so I have "module type S = sig type a val x:a end" and "module type S'= S with type a = int"... why does this require me to still have the definition of type a "module M : S' = struct type a = int let x = 0 end"
<ggole>
Really? No or patterns in Haskell?
<Kron>
haskell has patterns
<ggole>
That's pretty awful :o
<Kron>
not sure what you're talking about o.o
<Drup>
ggole: no, I'm talking about the "common pattern"
<ggole>
I thought "or patterns" is the term for that.
<Drup>
"Bla b | Bli b -> f b" as opposed to "Bla b -> f b | Bli b -> f b"
<watermind>
shouldn't I be able to just write module M : S' = struct let x = 0 end
<watermind>
why do I need to specify that type a = int?
avsm has quit [Quit: Leaving.]
cesar_ has joined #ocaml
cesar_ is now known as Guest60539
<flux>
well, it doesn't infer module signatures
<flux>
that's why :-)
<flux>
oh, wait, I missed the one line
<flux>
hmm, I cannot say, I haven't used 'with' that way. maybe it doesn't do that kind of replacements :-o
<companion_cube>
watermind: you need to, because it's a type *definition*
<flux>
when you do 'with' to the type it makes a signature that says type a = int
<flux>
that's what you need to have in the module
<flux>
basically everything you have in module type must be found from the module
<watermind>
companion_cube: flux: right... the "with type a = int" looks like a definition too though, not a declaration, so I was expecting for further definitions in the module not to be needed
<flux>
you can do this: module type S = sig type t = int end
<watermind>
but I can see the rationale behind it
<flux>
and then you must have type t = int in the module
<watermind>
oh
rand000 has quit [Ping timeout: 245 seconds]
<watermind>
ok then I see, it is consistent
gnuvince has quit [Ping timeout: 246 seconds]
<companion_cube>
watermind: you could also declare a new type
caseyjames has quit [Quit: Page closed]
Kakadu_ has quit [Ping timeout: 250 seconds]
Guest60539 has quit [Remote host closed the connection]
Kron has quit [Ping timeout: 268 seconds]
<watermind>
companion_cube: not sure if I follow, you mean "with" can be used to introduce new types? is that it?
<companion_cube>
no, I mean that modules that contain a type must declare it in any case
<companion_cube>
because yes, it might just be an alias to some type (int, e.g.), but it might also be the declaration of a new type
<watermind>
right!
<watermind>
didn't think of that
<ggole>
And it could be uninhabited
<ggole>
Signatures deliberately hide all of that information.
mika1 has quit [Quit: Leaving.]
Simn has quit [Read error: Connection reset by peer]
Yoric has quit [Ping timeout: 268 seconds]
nikki93 has joined #ocaml
rand000 has joined #ocaml
skchrko has quit [Quit: Leaving]
ttamttam has quit [Quit: ttamttam]
mort___ has quit [Ping timeout: 272 seconds]
avsm has joined #ocaml
yezariaely has quit [Quit: Leaving.]
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
rand000 has quit [Ping timeout: 272 seconds]
demonimin has quit [Ping timeout: 252 seconds]
avsm has quit [Quit: Leaving.]
nikki93 has quit [Remote host closed the connection]
talzeus has quit [Remote host closed the connection]
demonimin has joined #ocaml
rand000 has joined #ocaml
ygrek has joined #ocaml
malo has joined #ocaml
demonimin has quit [Ping timeout: 246 seconds]
demonimin has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
demonimin has quit [Ping timeout: 246 seconds]
ontologiae_ has quit [Ping timeout: 264 seconds]
hardliner_ has quit [Ping timeout: 268 seconds]
demonimin has joined #ocaml
AltGr has left #ocaml []
rand000 has quit [Ping timeout: 240 seconds]
Neros has joined #ocaml
malo has quit [Quit: Leaving]
Yoric has joined #ocaml
talzeus has joined #ocaml
Kakadu has quit []
Drup has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
yezariaely has joined #ocaml
<watermind>
is integer exponentiation not part of the language? nor provided by some (possibly de facto) standard operator?
<watermind>
version 4.00.1,,, can someone using 4.01 reproduce it?
<yezariaely>
watermind: if you don't care about speed this might be what you are looking for:http://caml.inria.fr/pub/docs/manual-ocaml-4.01/libref/Big_int.html#VALpower_int_positive_int
<mrvn>
watermind: + - * / ^ @ :: are not and . , and ; are in used. What do you want for exp()?
<watermind>
yezariaely: nice
ontologiae_ has joined #ocaml
<yezariaely>
though I am not sure about the speed drawbacks here...
q66 has joined #ocaml
<watermind>
mrvn: I'm ok with a function, but that is for floats not ints
<watermind>
mrvn: was just wondering if there was something int -> int to avoid reinventing the wheel
<ggole>
Bookmark the docs, they have a listing of the standard library
<watermind>
although if it infers different types it's probably different
<rks`>
merlin-reload or refresh
<watermind>
err?
<rks`>
try « M-x merlin-refresh »
<watermind>
same
<rks`>
(I don't think that will change anything, but you never know)
<rks`>
right, you could try restarting merlin, but I don't think that'll be of use either
<watermind>
I tried
<rks`>
well, you can always open an issue
<rks`>
with a small snippet reproducing for you, and the version of merlin you're using
<rks`>
and I'll have a look
<watermind>
sure, thanks rks`
manud has joined #ocaml
<rks`>
you're welcome
steshaw has quit [Ping timeout: 240 seconds]
tobiasBora has joined #ocaml
darkf has joined #ocaml
dsheets has joined #ocaml
_andre has quit [Quit: leaving]
<def-lkb>
watermind: on my computer, merlin tells that printf is not bound
<def-lkb>
so effectively, printf "a" as an unsound type :). Yet with Printf.printf merlin gives the expected result
ocp has joined #ocaml
<watermind>
that confuses me even more... :/
<rks`>
def-lkb: he loaded core.
<rks`>
when it is unbound, he says it's unbound.
<def-lkb>
rks`: when it's unbound, it says it's unbound & the context where the ident is used has an unsound type
<rks`>
right
<watermind>
but in my case it is printf appears to be defined
Xuerian has left #ocaml []
<def-lkb>
strange
<rks`>
(I indeed get the "unsound type" warning when it's unbound, my bad)
<def-lkb>
watermind: you opened Core before ? Did you add core package in merlin after typing the file ?
steshaw has joined #ocaml
<rks`>
once again def-lkb, it should be reported if core isn't loaded
<rks`>
so I guess he would have taken care of that before asking for the warning :'
<def-lkb>
yes, but loading core after did not reset the cache of merlin until very recently
<def-lkb>
so the error would stay if it first happened before loading the package
<watermind>
rks`: ops sorry was away
<watermind>
def-lkb: I didn't add anything to merlin, if I'm supposed to then I guess that may be the problem
ontologiae_ has quit [Ping timeout: 268 seconds]
<watermind>
ops
<watermind>
rks`: I didn't add anything to merlin, if I'm supposed to then I guess that may be the problem
<def-lkb>
watermind: emacs or vim? :)
<watermind>
emacs
<def-lkb>
C-c l core
* adrien
throws holy water at def-lkb
<def-lkb>
:Use core
<adrien>
too late, you've admitted you know emacs
<watermind>
hmm doesn't seem to make a difference
<def-lkb>
you have open Core.Std at the beginning of the file ?
<watermind>
ah!
<watermind>
that worked
<watermind>
I forgot I had to, because top level includes it by default
<def-lkb>
you may be interested in having a ".merlin" file in your directory (to automatically load packages)
<watermind>
right
<watermind>
couldn't merlin get that from .ocamlinit ?
<rks`>
... no.
<watermind>
ok
Anarchos has joined #ocaml
nikki93 has joined #ocaml
steshaw has quit [Ping timeout: 240 seconds]
<jyeo>
hmmmm i'm getting a Option -a cannot be used with .cmxa input files when i try to use ocamlbuild myfile.cmxa. what's going on?
<jyeo>
this is the line that is causing the problems: ocamlfind ocamlopt -a -I +camlp4 camlp4lib.cmxa pp.cmx pa_debug.cmx -o myfile.cmxa
steshaw has joined #ocaml
<watermind>
weird, not sure what I did, now it complains about unbound module core
<watermind>
restaring emacs worked though
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
steshaw has quit [Ping timeout: 248 seconds]
zpe has quit [Read error: Operation timed out]
gargaml has joined #ocaml
<watermind>
still a bit confused on how to work with multiple files
<watermind>
assuming I'm just working with toplevel, and I have files a.ml and b.ml
<watermind>
b.ml depends on a.ml
q66 has joined #ocaml
<watermind>
how do you manage it? in Haskell one simply imports A from with B, and the interpreter deals with it
<watermind>
compiling seems straightforward as ocamlbuild should find the dependencies from what I understand
<watermind>
but in the interpreter I'm a bit lost
q66 has quit [Excess Flood]
<pippijn>
adrien: ping
q66 has joined #ocaml
<def-lkb>
watermind: #load_rec to load compiled bytecode object and its dependencies
<def-lkb>
watermind: if your files are not compiled, #mod_use can typecheck and load a module
<watermind>
def-lkb: hmm let me see
<gargaml>
hi
<watermind>
def-lkb: very confused...
<gargaml>
I'm playing with modules and objects, and I'm unable to put a module as an object field…
<watermind>
def-lkb: first utop doesn't seem to know #mod_use
<gargaml>
but I can create a method which returns a first class module
<gargaml>
is there a way to put a first class module in an object field ?
<def-lkb>
watermind: 4.01
enstrophy has joined #ocaml
<def-lkb>
(utop 1.7 with 4.01)
<watermind>
def-lkb: but more than that, what is the process like...? There's files a.ml and b.ml. I want to use module A defined by a.ml in b.ml. I'm editing and interpreting b.ml... so I run utop... now what :/
<watermind>
def-lkb: oh I'm on 4.00.1
<def-lkb>
compile A.ml
<def-lkb>
then #load "a.cmo"
<watermind>
def-lkb: right
<def-lkb>
watermind: generally, you always have to compile modules outside the toplevel, except for the one you are working on
<watermind>
def-lkb: will merlin automatically pick that up?
<watermind>
def-lkb: I see now, I didn't know that
<def-lkb>
watermind: merlin work completely independently of utop
<def-lkb>
you should specify path in .merlin (just read the doc)