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