systems changed the topic of #ocaml to: Archive of Caml Weekly News http://pauillac.inria.fr/~aschmitt/cwn/ | ICFP Programming Contest 2003 http://www.dtek.chalmers.se/groups/icfpcontest/ | A tutorial http://merjis.com/richj/computers/ocaml/tutorial/ | Good free book http://cristal.inria.fr/~remy/cours/appsem/ | Mailing list (best mailing list ever for any computer language) http://caml.inria.fr/bin/wilma/caml-list
bk_ has quit ["I'll be back"]
systems has joined #ocaml
bk_ has joined #ocaml
systems has quit ["Client Exiting"]
lophty__ has quit ["ChatZilla 0.8.31 [Mozilla rv:1.4/20030624]"]
bk_ has quit ["I'll be back"]
bk_ has joined #ocaml
<ita> has anyone ever compiled cameleon ? i have this error -> File "/tmp/camlppaedb16", line 19, characters 16-33:
<ita> Unbound type constructor Gdk.Tags.modifier
freitag has quit ["plop"]
<bk_> i still have a long way ahead with this language
<ita> bk_: me 2
<bk_> i've never tried cameleon, so i wouldn't know if it builds correctly
<bk_> i'll stick with vim as my 'IDE' for now ;)
<ita> yeah, me too, but i wanted to know what cameleon looked like
<bk_> yes, well there
<bk_> oops
<bk_> there're screenshots, but i guess you want to take a closer look for yourself, so bad luck if it doesn't build
<bk_> Gdk.Tags.modifier hmmm
<ita> i believe it's because i have compiled labgtk 2 and not gtk1 as expected
* bk_ looks which version of lablgtk he has installed
<bk_> 1.2.5
<ita> eek
<bk_> probably it builds fine w/ 1.2.x
<ita> i can't install it, i only have gtk2
<bk_> oh
<bk_> i couldn't work on my toyproject for ~4 days because one of this friggin maxtor harddrives died .. again !
<bk_> i'll never ever buy another maxtor drive
bk_ has quit ["I'll be back"]
ita is now known as ita|Zzz
karryall has quit [leguin.freenode.net irc.freenode.net]
Smerdyakov has quit [leguin.freenode.net irc.freenode.net]
Smerdyakov has joined #ocaml
phubuh has quit ["Client exiting"]
d-bug has joined #ocaml
d-bug has left #ocaml []
polin8 has quit [Read error: 110 (Connection timed out)]
srv has joined #ocaml
buggs|afk is now known as buggs
ita|Zzz is now known as ita
polin8 has joined #ocaml
mattam_ has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
Maddas has quit [Read error: 110 (Connection timed out)]
bk_ has joined #ocaml
systems has joined #ocaml
Maddas has joined #ocaml
systems has left #ocaml []
thomas001 has joined #ocaml
<thomas001> hi...are mlton generated SML programs faster than the corresponding ocaml programs?
<bk_> http://www.bagley.org/~doug/shootout/craps.shtml not according to these figures
<bk_> on the other hand, these are not realworld examples
<whee> thomas001: I doubt you could say either is faster than the other
<whee> they'd be comparable, I suppose
<whee> the deciding factor in that case is the language itself, and I feel sml is a little too verbose for my tastes :)
<ita> under what license is ocamlopt released ?
<thomas001> structures are a bit messed up in ocaml.....
<whee> thomas001: how so?
<whee> ita: I think it's the Q public license
<thomas001> whee: i haven't found a way to have 2 structure types where some element names are the same
<whee> thomas001: are you referring to variants or modules
<Riastradh> I think he means records.
<whee> oh, okay
<thomas001> sry yes records i'm use to C language...
<Riastradh> type person = { name : string; phone_number : int; age : int }
<Riastradh> You can -- just as long as you use qualified names --.
<Riastradh> module People = struct
<Riastradh> type person = ...
<Riastradh> end
<Riastradh> module Gizmotroids = struct
<Riastradh> type gizmotroid = { name : string; ... }
<Riastradh> end
<thomas001> so it's inpossiblte within the same module?
<thomas001> *impossible
<Riastradh> Then use some_person.People.name and some_gizmotroids.Gizmotroid.name to get the different fields.
<thomas001> (why is this neccessary?)
<Riastradh> No, it's possible, but you'll have to use sub-modules.
<thomas001> what's wrong with: type p2={x:int;y:int;};;type p3={x:int;y:int;z:int;};; within the same module?
<Riastradh> Efficiency, I think -- with it this way, the compiler can just compile each field reference to a single memory lookup and not waste time checking what the type is.
<Riastradh> s/single memory lookup/single somethingorother/1
<whee> I like the class solution myself
<whee> although I don't know about the performance of that
<Riastradh> Classes will probably end up twenty times slower than the qualified names.
<whee> for something like a point structure a class seems like overkill
<whee> it'd be tempting to try to come up with a camlp4 solution to it, so the module creation is done behind the scenes
<thomas001> hmm all method calls are virtual in ocaml?
<whee> I believe it calls the most specific method, and coercing to a to a parent class is explicit
<whee> hooray for typos :|
<mrvn> thomas001: type a = { x:int; } type b = { x:int:} let c = { x=1;}
<mrvn> thomas001: Aprt from b shadowing a nothing is wrong with it.
<mrvn> thomas001: and yes, ocaml only has virtual methods.
<thomas001> hmm thanks
<mrvn> and purely virtual.
<mrvn> thomas001: You should put p2 and p3 in different modules or use p2_x and p3_x as labels.
<whee> mrvn: if you go and define type a = {x:int;} and then b = {x:int; y:int;}, you can't use type a
<mrvn> whee: cause you can.
<whee> if they're in the same module?
<mrvn> type a = { x:int;} let make_a x = {x=x;} type b = {x:int; y:int;} let make_b x y = {x=x; y=y;}
<thomas001> in some sml vs ocaml document i read that in sml you do not need to declare a record type and syntax looks very different...are sml records less efficient than ocaml ones?
<whee> well, they aren't defined at the same time there :P
<thomas001> ?
<Riastradh> thomas001, I think the efficiency is probably the same; the downside to the SML version is that you have to explicitly annotate the types.
systems has joined #ocaml
smkl has joined #ocaml
pattern_ has quit ["..."]
systems has quit [Nick collision from services.]
systems has joined #ocaml
systems has quit ["Client Exiting"]
karryall has joined #ocaml
buggs has quit [Nick collision from services.]
pattern_ has joined #ocaml
<bk_> heh
pattern_ has quit ["..."]
brwill has joined #ocaml
Demitar has joined #ocaml
systems has joined #ocaml
pattern_ has joined #ocaml
systems has quit ["Client Exiting"]
demitar_ has joined #ocaml
thomas001 has quit [Read error: 60 (Operation timed out)]
Demitar has quit [Read error: 113 (No route to host)]
demitar_ is now known as Demitar
Demitar has quit ["There are bubbles in the air..."]
Demitar has joined #ocaml
palomer has joined #ocaml
<palomer> hello, im trying to do something using functional programming but I con't find a way of doing it elegantly. im extracting two parts of a string, but I won't know the length of the first part until I extract it. any suggestions?
<Demitar> Doing something like this? let extract_fun s = let split_position = position_fun s in (String.sub s ..., String.sub s ...);;
mrvn_ has joined #ocaml
<palomer> erm?
<Demitar> How do you extract the first part?
<Demitar> Ah now I see what you're asking.
<Demitar> You're wondering how to figure out the length of the string you need to allocate in advance, right? In that case I'd say you should go imperative and use the Buffer module, that's what it's there for.
<palomer> hrm
<palomer> actually, the string has N distinct parts, each part is subvided in
<palomer> 2 subparts, I won't know where the N+1 part starts until I finish
<palomer> extracting the Nth part, and I won't know where the second sub part
<palomer> starts until I finish extracting the first subpart
<Demitar> So, you're essentially building a (temporary?) tree on the fly?
<palomer> not temporary
<palomer> I need those parts
<palomer> but yes, its a tree
<Demitar> What is the main problem you're facing?
<palomer> well, extract-first-part is a function by itself
<palomer> and I don't wish to change it
<Demitar> I assume it returns the starting position for the second part, right?
mrvn has quit [Read error: 110 (Connection timed out)]
<palomer> nope
<palomer> :<
<Demitar> So how do you know where the next part begins?
<Demitar> base + (String.length first_part) ?
<palomer> thats the thing
<palomer> I don't
<palomer> to keep it functional, I was thinking about writing a first_part_length function
<Demitar> Umm, so how does the extract-second-part function work then? Or is that the problem (it doesn't)?
<mrvn_> Use a stream
Smerdyakov has quit [Read error: 110 (Connection timed out)]
Smerdy has joined #ocaml
Smerdy is now known as Smerdyakov
<mrvn_> Or allways return the offset for the next part and build the tree with references ining.
<mrvn_> s/ining/inot the string/
<Demitar> What's hindering you returning both the length and the resulting string? Or is that function used in a lot of other places?
<palomer> actually
<palomer> I think ill do that
<palomer> thx
palomer has left #ocaml []
mattam_ is now known as mattam
Demitar has quit ["There are bubbles in the air..."]
<bk_> hm
<bk_> nonblocking sockets and select are a pain in the ass
<bk_> nonblocking connect in particular
karryall has quit [leguin.freenode.net irc.freenode.net]
srv has quit [leguin.freenode.net irc.freenode.net]
foxster has quit [leguin.freenode.net irc.freenode.net]
karryall has joined #ocaml
srv has joined #ocaml
foxster has joined #ocaml
polin8 has quit [Read error: 104 (Connection reset by peer)]
<teratorn> bk_: how's that?
<bk_> hmm
<bk_> no lemme investigate this a little further before i begin to moan again about something i haven't tried to figure out well enough
<bk_> 1st try didn't quite work as expected :>
<bk_> Fatal error: exception Sys_blocked_io
<bk_> hmmm
<bk_> exception Sys_blocked_io
<bk_> A special case of Sys_error raised when no I/O is possible on a non-blocking I/O channel.
<bk_> oh aha
JPHackworth has joined #ocaml
JPHackworth has quit ["leaving"]
polin8 has joined #ocaml