00:14
Xolution has joined #ocaml
00:16
<
Xolution >
Hey, I'm having a problem linking some stuff. I have a module whose signature is in cellauto.mli and whose structure is in cellauto.ml. I build with ocamlc -c cellauto.mli && ocamlc -c cellauto.ml, then make a .cma with ocamlc -a cellauto.cmo -o cellauto.cma, but when I try to build another file (ocamlc -o life life.ml cellauto.cma) I get the error "Unbound value Cellauto.create"
00:16
<
Xolution >
Though I do have the create function specified in both the .ml and .mli files
00:16
<
vincenz >
you have to put the files in the right order
00:17
<
vincenz >
plus you have o pass it the cmi
00:17
<
vincenz >
the cmi contains the interface
00:17
<
vincenz >
oh wait with a lib
00:17
<
vincenz >
and you're making an executable
00:17
<
vincenz >
well linking requires you put the modules in the right order
00:17
<
vincenz >
(aka something to the right can not depend on something to the left)
00:18
<
Xolution >
I get the same error if I reverse the order of cellauto.cma and life.ml
00:18
<
vincenz >
say Put cellauto.ml and .mli on a paste site
00:21
<
vincenz >
don't put module Cellauto
00:22
<
vincenz >
the fact that it's in the file name implies it's in module cellauto
00:22
<
vincenz >
definitions in file xxx.ml become part of module Xxx
00:23
<
Xolution >
cool, works
00:23
<
Xolution >
So, when would you use the 'module Name : sig ....' type stuff?
00:24
<
vincenz >
submodules
00:24
<
vincenz >
or the ocamltop
00:24
<
vincenz >
or before splitting into subfiles
00:34
<
Xolution >
Could I have the signature and the structure in the same file?
00:35
<
Smerdyakov >
They wouldn't be top-level entities.
00:44
m3ga has joined #ocaml
00:46
<
Walnutssh >
Xolution: NO, but you can have have the module implicitly defined by the file contain a signature and a structure.
00:47
<
Walnutssh >
file.ml :: module X1 = struct end ;; module type S1 = sig end ;; creates a module File containing signature File.S1 and structure File.X1
00:59
wam has joined #ocaml
00:59
wam has quit [Read error: 104 (Connection reset by peer)]
00:59
thankyouma`am has joined #ocaml
00:59
thankyouma`am is now known as wam
01:05
jao has quit ["ERC Version 4.0 $Revision: 1.703 $ (IRC client for Emacs)"]
01:13
m3ga has quit ["Client exiting"]
01:34
bwlang has quit [Remote closed the connection]
01:40
wam has quit ["Abandonando"]
01:46
vezenchio has quit ["haibane·renmei"]
01:54
hangman4 has quit [Read error: 110 (Connection timed out)]
01:55
hangman4 has joined #ocaml
02:11
mfurr has joined #ocaml
02:15
CosmicRay has joined #ocaml
02:42
Xolution has left #ocaml []
03:08
CosmicRay has quit ["Client exiting"]
04:16
chipig has joined #ocaml
04:24
monochrom has quit ["hello"]
04:36
mfurr has quit ["Leaving"]
04:37
srv has quit [Read error: 104 (Connection reset by peer)]
04:39
srv has joined #ocaml
04:54
m3ga has joined #ocaml
04:58
creichen has quit [tolkien.freenode.net irc.freenode.net]
04:58
pango has quit [tolkien.freenode.net irc.freenode.net]
04:58
mrvn_ has quit [tolkien.freenode.net irc.freenode.net]
04:58
Smerdyakov has quit [tolkien.freenode.net irc.freenode.net]
04:58
oracle1 has quit [tolkien.freenode.net irc.freenode.net]
04:58
Excedrin has quit [tolkien.freenode.net irc.freenode.net]
04:58
judge has quit [tolkien.freenode.net irc.freenode.net]
04:58
karryall has quit [tolkien.freenode.net irc.freenode.net]
04:58
pacroon has quit [tolkien.freenode.net irc.freenode.net]
04:58
Godeke has quit [tolkien.freenode.net irc.freenode.net]
04:58
_fab has quit [tolkien.freenode.net irc.freenode.net]
04:58
TheDracle has quit [tolkien.freenode.net irc.freenode.net]
04:58
noj has quit [tolkien.freenode.net irc.freenode.net]
04:58
calvin_ has quit [tolkien.freenode.net irc.freenode.net]
04:58
Hipo has quit [tolkien.freenode.net irc.freenode.net]
04:58
avlondono has quit [tolkien.freenode.net irc.freenode.net]
04:58
shawn has quit [tolkien.freenode.net irc.freenode.net]
04:58
rossberg__ has quit [tolkien.freenode.net irc.freenode.net]
04:58
cmeme has quit [tolkien.freenode.net irc.freenode.net]
04:58
Riastradh has quit [tolkien.freenode.net irc.freenode.net]
04:58
mellum has quit [tolkien.freenode.net irc.freenode.net]
04:58
chipig has quit [tolkien.freenode.net irc.freenode.net]
04:58
Shammah has quit [tolkien.freenode.net irc.freenode.net]
04:59
chipig has joined #ocaml
04:59
rossberg__ has joined #ocaml
04:59
karryall has joined #ocaml
04:59
Godeke has joined #ocaml
04:59
cmeme has joined #ocaml
04:59
_fab has joined #ocaml
04:59
pacroon has joined #ocaml
04:59
Riastradh has joined #ocaml
04:59
TheDracle has joined #ocaml
04:59
noj has joined #ocaml
04:59
Shammah has joined #ocaml
04:59
mellum has joined #ocaml
04:59
shawn has joined #ocaml
04:59
avlondono has joined #ocaml
04:59
calvin_ has joined #ocaml
04:59
Hipo has joined #ocaml
04:59
karryall has quit [tolkien.freenode.net irc.freenode.net]
04:59
pacroon has quit [tolkien.freenode.net irc.freenode.net]
04:59
karryall has joined #ocaml
04:59
pacroon has joined #ocaml
05:00
creichen has joined #ocaml
05:00
pango has joined #ocaml
05:00
mrvn_ has joined #ocaml
05:00
Smerdyakov has joined #ocaml
05:00
judge has joined #ocaml
05:00
oracle1 has joined #ocaml
05:00
Excedrin has joined #ocaml
05:03
m3ga has left #ocaml []
05:03
Walnutssh is now known as Nutssh
06:16
ayrnieu has joined #ocaml
06:56
Submarine has joined #ocaml
06:57
zzorn has joined #ocaml
06:58
zzorn is now known as zzorn_away
07:38
mlh has joined #ocaml
08:09
Submarine has quit [Remote closed the connection]
08:28
chipig has left #ocaml []
08:35
srv_ has joined #ocaml
08:35
srv has quit [Read error: 104 (Connection reset by peer)]
08:55
pango has quit ["Client exiting"]
08:58
pango has joined #ocaml
09:15
karryall_ has joined #ocaml
09:19
kinners has joined #ocaml
09:42
Submarine has joined #ocaml
10:37
Submarine has quit ["Leaving"]
10:50
Nephtis has joined #ocaml
11:01
Nephtis has quit ["Chatzilla 0.9.66d [Mozilla rv:1.7.5/20041107]"]
11:07
Shammah has quit [Read error: 113 (No route to host)]
11:07
monochrom has joined #ocaml
11:41
gim has joined #ocaml
11:47
smimou has joined #ocaml
11:48
kinners has quit [Read error: 60 (Operation timed out)]
12:02
mattam has joined #ocaml
12:02
mrvn_ is now known as mrvn
12:10
jao has joined #ocaml
12:27
jao has quit [Read error: 104 (Connection reset by peer)]
12:51
monochrom has quit ["hello"]
13:12
mlh has quit [Client Quit]
13:26
CapNemo has joined #ocaml
13:32
Hanji has quit [Read error: 60 (Operation timed out)]
13:34
<
CapNemo >
anybody alive here ?:)
13:36
<
CapNemo >
oki good :) i search a way to embed a scriptic language in ocaml .. or perhaps ocaml itself ... is it possible ?
13:37
<
karryall_ >
there are implementations of scheme and lua in ocaml
13:37
<
mellum >
Possible certainly. But probably not very simple, since the type system stands in your way a lot
13:38
<
CapNemo >
for example : you create an ocaml program and inside it you put ocaml script to be executed at runtime
13:39
<
mellum >
The interesting question is how much these scripts need to be able to access stuff from the frame program.
13:39
<
CapNemo >
they will need to access a part of it
13:41
<
CapNemo >
perhaps there is an "eval" command in ocaml ?
13:42
<
CapNemo >
oki and lua-ml provide a way to embed lua in ocaml right ?
13:42
<
karryall_ >
lua-ml is a lua interpreter written in ocaml
13:43
<
CapNemo >
oki sounds clear
13:44
<
karryall_ >
and there's a ocaml-lua which is a binding to the lua interpreter (written in C)
13:44
<
karryall_ >
and you schoca, a scheme interpreter written in ocaml
13:44
<
karryall_ >
s/you/you have/
13:48
<
CapNemo >
oki perhaps i will use ocaml and lua then
13:55
Demitar has joined #ocaml
14:03
mrvn_ has joined #ocaml
14:16
mrvn has quit [Read error: 110 (Connection timed out)]
14:19
<
karryall_ >
calvin_: right, I knew there was another one, couldn't remember its name
14:39
Submarine has joined #ocaml
14:42
<
CapNemo >
what is the boolean operator about the difference ?
14:42
<
CapNemo >
like 1 != 0
14:43
<
karryall_ >
CapNemo: <>
14:43
vezenchio has joined #ocaml
14:43
<
Submarine >
!= is the negation of ==
14:44
<
Submarine >
<> is the "logical" difference, almost the negation of =
14:48
<
karryall_ >
Submarine: are you saying that <> isn't the exact negation of = ?
14:48
<
Submarine >
I suspect so, with respect to NaN in floating-point.
14:49
<
Submarine >
That is, (x < y) || (x > y) is
*not* the negation of x=y
14:49
<
Submarine >
I'm unsure whether Caml defines <> as the former or the latter.
14:49
<
karryall_ >
let's try out
14:50
<
mellum >
If I ever invent a programming language, I'll make sure to define
*no equality operator at all* for floating point.
14:53
<
karryall_ >
ok, apparently <> is really the negation of =
14:53
<
karryall_ >
cf byterun/compare.c
14:54
<
CapNemo >
is this code correct please ? -->
14:54
<
CapNemo >
let test_index value1 value2 =
14:54
<
CapNemo >
match value2 with
14:54
<
CapNemo >
Id x -> value2 = value1
14:54
<
CapNemo >
Digit -> value1 <> 0
14:54
<
CapNemo >
Any -> true
14:55
<
CapNemo >
i have a syntax error at Digit !
14:55
<
Submarine >
you need a | to separate cases
14:56
<
CapNemo >
oh god ! of course !
15:13
karryall_ has quit ["."]
15:18
dxlvi has joined #ocaml
16:05
masm has joined #ocaml
16:25
<
mrvn_ >
and I always write let test_index value1 = function \n Id x -> ... | Digit -> ...
16:29
monochrom has joined #ocaml
16:45
CosmicRay has joined #ocaml
17:17
Hipo has left #ocaml []
17:26
masm has quit ["Leaving"]
17:45
CapNemo has quit ["et hop plus la"]
17:51
monochrom has quit [Read error: 110 (Connection timed out)]
18:03
jao has joined #ocaml
18:54
mrvn_ is now known as mrvn
19:04
CosmicRay has quit ["Client exiting"]
19:04
Submarine has quit ["Leaving"]
19:10
tyler has joined #ocaml
19:10
<
tyler >
What's with the funky ?args in lablgtk2? I take it they are optional args of some sort?
19:17
pacroon has left #ocaml []
19:47
pflanze has joined #ocaml
19:52
<
vincenz >
I always found ocaml's label system odd
19:52
<
vincenz >
I mean....
19:52
<
vincenz >
it depends on the variable-NAME in the context
19:53
<
karryall >
er, no the label is attached to the type of the function
19:53
<
karryall >
you can have different names for the label and the parameter
19:54
<
vincenz >
but you can leave out the label if your variable has the same name
19:54
<
mrvn >
Does any lib provide epoll support?
19:54
<
vincenz >
the variable in the calling-context
19:54
<
vincenz >
that's what I find odd
19:54
<
karryall >
that's just syntactic sugar
19:56
<
vincenz >
but I just find the connection variable name in calling context and label name in callee context odd
19:56
<
vincenz >
I mean they're unrelated
19:57
<
mflux >
I've found it useful at times though
19:58
<
pango >
vincenz: several other languages have "named parameters" (Ada ?), it's ok with me
19:58
<
vincenz >
yeah I know, it's just odd
19:58
<
mflux >
and chances are your variable is called the same anyway, as it will propably mean the same thing
19:58
jao has quit ["ERC Version 4.0 $Revision: 1.703 $ (IRC client for Emacs)"]
19:59
<
karryall >
lablgtk2 make heavy use of optional params, some functions have 10 or so
19:59
<
vincenz >
I would assume most gui-libs
19:59
<
mflux >
or atleast gtk-wrappers
20:00
<
karryall >
yeah it's quite handy
20:00
<
mflux >
I haven't given that much of a look to lablgtk2, but atleast gtkmm (the c++ wrapper) also makes use of optional parameters - but as there are no labels it is somehwat more cumbersome..
20:00
<
karryall >
you can create a widget, set most of its properties and store it in a container in one line
20:01
<
vincenz >
widget...
20:01
<
vincenz >
such a small difference yet such a big one
20:02
<
vincenz >
you mean budget?
20:02
<
pango >
huge budget :)
20:02
<
Excedrin >
huge midget
20:03
<
vincenz >
that'd be a bulget
20:04
<
Excedrin >
now that's just bilged
20:04
<
vincenz >
never heard of that word
20:04
<
Excedrin >
(me neither, I looked on dictionary.com)
20:06
<
pflanze >
Do people use the revised syntax offered by camlp4? Should I prefer it to the normal one for learning the language?
20:06
<
Excedrin >
I do, but most people probably don't
20:07
<
karryall >
Excedrin: I find it's more verbose
20:07
<
Excedrin >
it's nice that it's easy to convert a file in one syntax to the other automatically
20:07
<
pflanze >
Is it up-to-date re new features like keyword arguments?
20:08
<
Excedrin >
what's an example of keyword argument usage? or where's the docs on it?
20:09
<
pflanze >
or labelled arguments or whatever it is called in ocaml
20:09
* pflanze
going to look it up
20:09
<
karryall >
it's called labelled arguments
20:10
<
karryall >
in the manual, in the section called "labels"
20:11
<
Excedrin >
yea, that works
20:21
pango has quit ["brb"]
20:26
pango has joined #ocaml
20:28
CosmicRay has joined #ocaml
20:34
Lemmih has joined #ocaml
20:35
Submarine has joined #ocaml
20:46
mattam has quit [Remote closed the connection]
20:47
mattam has joined #ocaml
20:52
CosmicRay has quit ["Client exiting"]
20:53
CosmicRay has joined #ocaml
20:56
tyler has quit ["leaving"]
20:58
mrvn_ has joined #ocaml
21:00
jao has joined #ocaml
21:08
mrvn has quit [Read error: 110 (Connection timed out)]
22:02
mrvn_ is now known as mrvn
22:21
monochrom has joined #ocaml
22:31
smimou has quit ["?"]
22:47
tyler has joined #ocaml
22:47
<
tyler >
Anyone know of a good tutorial for dealing with writing binary files?
22:48
<
tyler >
by that I mean for dealing with stuff written by c's fread, fwrite, and friends
22:49
<
karryall >
it's not even portable in C ...
22:50
<
tyler >
karryall: heh
22:50
<
karryall >
depends on what type of data you have, what platform, what C compiler, etc
22:50
<
tyler >
well, lemme be more precise
22:50
<
tyler >
say I wished to write a 32 bit signed interger to a file
22:51
<
tyler >
I mean, I probably could hack up a routine using chars
22:51
<
tyler >
but i was wondering if there is a better way
22:51
<
karryall >
there is stuff like this in Extlib
22:51
<
karryall >
(I mean routines using chars)
22:52
<
Submarine >
tyler, you'd better use a library using machine-independent formats
22:52
<
Submarine >
tyler, else you expose yourself to Mac/PC problems
22:52
<
tyler >
Submarine: that's basically what I'm looking for
22:52
<
tyler >
but the format in question is speced as far an endianess is concerned
22:52
<
karryall >
Submarine: sometimes you're not the one choosinf the formats
22:52
<
tyler >
might help if I give more info....
22:52
<
tyler >
basically I want to generate some wav files
22:55
wegzz has joined #ocaml
22:55
CosmicRay has quit ["Client exiting"]
22:56
* tyler
emerges extlib
23:01
tyler has quit ["leaving"]
23:04
Submarine has quit ["Leaving"]
23:08
vezenchio has quit [Read error: 110 (Connection timed out)]
23:16
vezenchio has joined #ocaml
23:20
zzorn_away has quit ["........"]
23:34
wegzz has quit [Read error: 110 (Connection timed out)]