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/
GreyLensman has joined #ocaml
vezenchio has quit ["I thought what I'd do was, I'd pretend to be one of those deaf-mutes"]
Oejet has joined #ocaml
Oejet has left #ocaml []
Placain has joined #ocaml
jameson has joined #ocaml
<jameson> Hi! Is it possible to have mually recursive 'type' and 'class' definition? (type foo = bar list and class bar = object val x:foo end;;)
<Smerdyakov> It's unnecessary.
<Smerdyakov> That's like asking "is it possible to have mutually recursive type and function definitions?".
<Smerdyakov> Object typing is purely structural in OCaml.
<Smerdyakov> Class definitions don't generate new types.
<jameson> OK... but "type foo = bar and type bar = class quux = object val x:foo end;;" doesn't seem to work either...
<jameson> (so 'class c = object...' only defines 'c' as the class constructor, then?)
<Smerdyakov> type foo = bar and type bar = < x : foo >
<Smerdyakov> Though that makes x a method, not a val.
<jameson> I think I'm on the wrong track. You mentioned that class typing is purely structural, so I guess the correct type I should use would be something like < quux : 'a; ... >, where 'quux' is th emember function I use...
<Smerdyakov> All val's are private.
<jameson> Yes, but that's practically what I need. OK, that clarifies the issue. Thank you!
mrsolo_ has joined #ocaml
Placain has left #ocaml []
monochrom has joined #ocaml
GreyLensman has quit ["Leaving"]
monochrom has quit ["Don't talk to those who talk to themselves."]
Banana has quit [Remote closed the connection]
tewk__ has joined #ocaml
<tewk__> So I'm compiling a ocaml app and I'm missing a symbol called failwith, any help ?
<kinners> that's in the standard library (Pervasives module), so something must be going wrong
<kinners> what system do you have and how did you install ocaml?
cjohnson has quit ["Leaving"]
<tewk__> Running debian unstable trying to compile poy a phylogenetic app
<kinners> what is the exact error you get?
<tewk__> + gcc -Wl,-E -o 'oi' -I'/usr/lib/ocaml/3.08' /tmp/camlprim1d33e3.c '-Lbytecode' '-L/usr/lib/ocaml/3.08' '-lstr' '-lnums' '-lunix' '-lbigarray' 'pvmcdumm.o' 'treeplotc.o' 'cnw.o' 'safememory.o' 'matrices.o' '-lunix' '-lnums' -lcamlrun-lm -ldl -lcurses -lpthread
<tewk__> safememory.o(.text+0x30): In function `safe_malloc':
<tewk__> : undefined reference to `failwith'
<tewk__> is there a .h file that contains a definition for failwith ?
<kinners> ah, ok
<kinners> all the caml symbols are prefixed with caml_ now since ocaml 3.08 (caml_failwith)
<tewk__> so just prefix failwith with caml_
<tewk__> cool thanks
<kinners> yes, or have compatibility.h included
<tewk__> thats what I get for running debian unstable, but I sure learn a lot
<tewk__> You've been very helpfull
<kinners> np
<kinners> I use godi under debian testing
<kinners> but I would have got the same problem anyway :)
Nutssh has joined #ocaml
mrsolo_ has quit [Read error: 104 (Connection reset by peer)]
mrsolo_ has joined #ocaml
<tewk__> So how does godi work ?
<kinners> It's based on netbsd's package system I think. It downloads and compiles ocaml + ocaml packages and installs them into the godi tree (I use ~/godi)
Nutssh has quit [sendak.freenode.net irc.freenode.net]
<tewk__> cool
Nutssh has joined #ocaml
kinners has quit [Read error: 238 (Connection timed out)]
pango has joined #ocaml
buggs has quit [sendak.freenode.net irc.freenode.net]
gzl has quit [sendak.freenode.net irc.freenode.net]
mattam has quit [sendak.freenode.net irc.freenode.net]
rhw has quit [sendak.freenode.net irc.freenode.net]
Hipo has quit [sendak.freenode.net irc.freenode.net]
avn has quit [sendak.freenode.net irc.freenode.net]
skylan has quit [sendak.freenode.net irc.freenode.net]
Excedrin has quit [sendak.freenode.net irc.freenode.net]
rhw has joined #ocaml
skylan has joined #ocaml
mattam has joined #ocaml
Excedrin has joined #ocaml
Hipo has joined #ocaml
avn has joined #ocaml
det_ has joined #ocaml
gzl has joined #ocaml
det has quit [Connection reset by peer]
buggs has joined #ocaml
Lemmih__ is now known as Lemmih
_fab has joined #ocaml
Banana has joined #ocaml
Herrchen has joined #ocaml
pango has quit ["brb"]
pango has joined #ocaml
srv_ has quit [Read error: 232 (Connection reset by peer)]
kuribas has joined #ocaml
srv has joined #ocaml
maihem has joined #ocaml
det_ is now known as det
cjohnson has joined #ocaml
Lemmih_ has joined #ocaml
<dan2> whats ~foo: "blah" arguments to functions used for
kuribas has quit ["Leaving"]
pango has quit ["Client exiting"]
pango has joined #ocaml
<pango> dan2: that's called "labels" (named arguments)
<dan2> pango: thanks
<dan2> pango: in what case would you use one?
<pango> dan2: when your functions have a lot of parameters... there's also a possibility to make some arguments optional, and to have default values that way
<dan2> pango: oh I see
<dan2> pango: thats pretty cool
cjohnson has quit [Read error: 60 (Operation timed out)]
vezenchio has joined #ocaml
cjohnson has joined #ocaml
monochrom has joined #ocaml
mpc has joined #ocaml
<dan2> how do I make an argument require anything of type
<dan2> 'a -> char String.t
<dan2> bah,
<dan2> 'a -> char Stream.t
<dan2> nevermind I got it
mpc has quit []
<dan2> how do I make a charachter list
<Smerdyakov> Now what kind of question is that? Here's one: []
<dan2> nevermind
<dan2> Smerdyakov: I forgot '' for char "" for string
<dan2> mm function type signature machine
<dan2> matching
<dan2> :)
mpc has joined #ocaml
<dan2> Smerdyakov: how come this doesn't work
<dan2> let evalgram ?streamfun:(streamfun : 'a -> char Stream.t = Stream.of_string) g (s : 'a) = Grammar.Entry.parse g (streamfun s);;
<dan2> Smerdyakov: I wanted a default value of Stream.of_string, but then it seems s is always string when I switch the function
<Smerdyakov> I don't know about this subject.
<dan2> hmm
<dan2> hmm, might have to make s a named argument
<dan2> that doesn't work either
<dan2> this works
<dan2> # let evalgram ~streamfun:(streamfun : 'a -> char Stream.t) g ( s : 'a) = Grammar.Entry.parse g (streamfun s);;
<dan2> val evalgram :
<dan2> streamfun:('a -> char Stream.t) -> 'b Grammar.Entry.e -> 'a -> 'b = <fun>
pango has quit ["Leaving"]
GreyLensman has joined #ocaml
pango has joined #ocaml
WhiteRecluse has joined #ocaml
WhiteRecluse has left #ocaml []
mpc has quit []
lmbdwar has quit [Read error: 110 (Connection timed out)]
kuribas has joined #ocaml
mpc has joined #ocaml
mpc_ has joined #ocaml
monochrom has quit ["Don't talk to those who talk to themselves."]
gim has joined #ocaml
mpc has quit [Read error: 60 (Operation timed out)]
Herrchen has quit ["bye"]
mpc_ has quit []
GreyLensman has quit ["Leaving"]
monochrom has joined #ocaml
buggs has quit [Connection timed out]
gim has quit [Read error: 110 (Connection timed out)]
mpc has joined #ocaml
gim has joined #ocaml
kuribas has quit ["Leaving"]
gim has quit [Read error: 110 (Connection timed out)]
Gliptic has joined #ocaml
gpciceri has joined #ocaml
<gpciceri> hi, does anyone want to help me with ocamldbi installation ?
segphault has joined #ocaml
<segphault> I'm trying to figure out how to do reflection in ocaml. Is there any way to extract the type of a value programatically?
<monochrom> not easily.
monochrom has quit ["Don't talk to those who talk to themselves."]
<Nutssh> segphault: Not really. It would/could break typing.
vezenchio has quit ["I thought what I'd do was, I'd pretend to be one of those deaf-mutes"]
malc_ has joined #ocaml
mrsolo_ has quit ["Leaving"]
mrsolo has joined #ocaml
gpciceri has quit [Read error: 110 (Connection timed out)]
segphault has left #ocaml []
maihem has quit ["Read error: 54 (Connection reset by chocolate)"]
avlondono has quit ["brb (I hope so)"]
htp123 has joined #ocaml
dxlvi has joined #ocaml
<dxlvi> hi
<dxlvi> i can do | 'a' .. 'z' ->
<dxlvi> howeverm i cannot do 1 .. 10 ->
<dxlvi> what is the closest equivalent? | (x >= 1) && (x <= 10) -> is quite unreadable...
<dxlvi> is there .. for integers? :)
<malc_> no
<dxlvi> oh... so | (x >= 1) && (x <= 10) -> is the best way then?
<malc_> let in_range l h i = (i >= l) && (i <= h)
<malc_> match m with j when in_range low up j -> ..
<dxlvi> hm yea
<dxlvi> i see thanks :)
dxlvi has quit ["."]
Gliptic has quit [Remote closed the connection]