Smerdyakov has quit [Read error: 110 (Connection timed out)]
Smerdy is now known as Smerdyakov
Smerdyakov has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
systems has joined #ocaml
mrvn_ has joined #ocaml
mattam_ is now known as mattam
mrvn has quit [Read error: 110 (Connection timed out)]
Kinners has joined #ocaml
Smerdyakov has quit [Read error: 110 (Connection timed out)]
systems has left #ocaml []
Smerdyakov has joined #ocaml
mr_bubbs_ has joined #ocaml
srv has joined #ocaml
blanc-de-poulet has joined #ocaml
<blanc-de-poulet>
vive la France
blanc-de-poulet has left #ocaml []
blanc-de-poulet has joined #ocaml
blanc-de-poulet has left #ocaml []
<srv>
regarding classes inheritance, when B inherits from A how can I say, when I have an object obj who's type is B, "obj, who's type is A"? In another object's method (who takes a B as parameter) I'd like to call another method which takes an A as parameter (the same object). I think I need to do some kind of cast or upcast, but I just don't know how.
<srv>
sorry, I know it's early for this knid of questions... ;)
<Kinners>
you mean whose instead of who's
<srv>
huh yes :)
* srv
still not woken up -> needs more coffee -> making some :)
<Kinners>
np :)
<Kinners>
do a search on the mailing list, that casting business is too complicated for me to remember
<srv>
ok... I'll take a look at the archives
<srv>
The OCaml book didn't tell me much about that...
<Kinners>
the general advice would be to avoid casting where possible :)
<srv>
this is a temporary system. What we really need to do is to write interfaces for each module, but we don't have the time to do this. It's planned before Decembre.
aminorex has joined #ocaml
aminorex has left #ocaml []
<srv>
The answer: "super#endDump (Obj.magic network)" :)
<srv>
Obj.magic lets you do the cast
<srv>
(I make OCaml style sentences ;) )
<Maddas>
heh
<Maddas>
time to learn a bit o'caml again :)
<srv>
:)
<Maddas>
actually, a bit Scheme right now and ocaml later on :)
<Kinners>
srv: the general advice is to avoid Obj.* where possible as well :)
<srv>
ok... I'll try, but this stuff will be rewriten soon, so I don't really matter.
<Kinners>
you may be able to use a coercion, let a_of_b obj = (obj :> a)
<Maddas>
heh, :> is an operator? I like it then :)
<Maddas>
is that like dereferencing >?
* srv
discovers the ":>" operator :)
<srv>
why is it cleaner than Obj.magic? I don't really see the difference for now...
<whee>
Obj.magic isn't type safe
<srv>
which means?
<Kinners>
Maddas: it's not really an operator as such
<whee>
which means you have the possibility of writing a program that gets past the compiler, but does things like converting an integer to a float
<whee>
and you'd get a nice runtime problem I would assume
<srv>
wouhoooo
<srv>
;)
<whee>
a function with a type of 'a -> 'b is generally not safe :)
<srv>
whee: well thanks for the advise :)
* srv
using ":>"
<Maddas>
:>
<srv>
I'll call it "the smiley operator" ;)
<Maddas>
:)
Kinners has left #ocaml []
* Maddas
pokes whee
<whee>
hi$!
<Maddas>
:]
<Maddas>
whee: do you code in erlang, too?
<whee>
yes
<Maddas>
cool :)
<Maddas>
what kind of things would you say ocaml is better at, and what kind of things is erlang better at?
<whee>
erlang's great for any sort of daemon; local or network; or anything that is best done with a lot of concurrency
<whee>
I use ocaml as a general purpose language, I don't have any area I use it more in
<Maddas>
I see
<Maddas>
heh, there are too many languages that I want to learn :)
<whee>
heh
buggs|afk is now known as buggs
polin8 has quit [Remote closed the connection]
<teratorn>
Maddas: it's good to know many languages, or at least be comfortably familiar with.
<srv>
I have a little question...
<srv>
(code incoming)
async has joined #ocaml
<Maddas>
teratorn: it is, but I'm not even going to study CS :)
<teratorn>
oh, good for you!
<Maddas>
yes
<srv>
match channel with
<srv>
stdout -> "stdout"
<srv>
| stderr -> "stderr"
<teratorn>
CS will teach you bad things!
<Maddas>
And I think I won't have enough time to learn more than this properly before I start studying :/
<Maddas>
haha
<Maddas>
teratorn: :)
<srv>
"Warning: this match case is unused." (about the last line, during compilation)
<whee>
srv: stdout is a pattern, matching anything
<srv>
whee: ???
<whee>
you're creating a new binding called "stdout" and matching channel against it
<srv>
So is it possible to write a "string_of_out_channel" function? (that's what I need...)
<whee>
yes, but you might need to use a guard
<whee>
or try specifying Pervasives.stdout
<srv>
good idea
<srv>
Syntax error
<whee>
try using a gurad
<whee>
guard, even :|
<whee>
match channel with stdout when stdout == Pervasives.stdout -> ...
<srv>
ah ok...
<whee>
or maybe just = in this case
<srv>
compiles, but How can I remove this warning? :
<srv>
Warning: Bad style, all clauses in this pattern-matching are guarded.
lam has quit ["leaving"]
<srv>
(it's another question...)
<whee>
add another case to the match that matches anything
<whee>
maybe throw an exception, whatever the correct thing to do would be
<srv>
no I'll return "unknown" (my stuff deals with XML export)
lam has joined #ocaml
bk_ has joined #ocaml
<mrvn_>
do for loops have a break in ocaml?
mrvn_ is now known as mrvn
<srv>
I'd like to make a polymorphic method which dumps a 4-dimensionnal array of 'a. How can I write the type matching? (I forget the basics...)
<srv>
(match array with
<srv>
array when 'a = float -> string_of_float array.(x).(y).(z)
<srv>
| _ -> string_of_int array.(x).(y).(z))
<srv>
does not compile :)
<whee>
you can't use guards on types like that
<whee>
you'd have to use variants if you want to do something like that
<srv>
Y've tried wo guides and it didn't work...
<srv>
variants if??
<whee>
somethint you can match against
<mrvn>
srv: pass a "print" function as argument and use that
<mrvn>
let dump_array string_of_a a_array = ....
<whee>
that sounds like a better solution
<srv>
yep
<srv>
fine for me. Thx guys
<mrvn>
let dump_int_array = dump_array (string_of_int) ....
<bk_>
if you find out about a break for for loops, i'd like to know that, too mrvn
<mrvn>
bk_: break doesn't work. try and raise will.
<bk_>
ah okay, thanks
<mrvn>
Wats a good way to split a string into words?
polin8 has quit [orwell.freenode.net irc.freenode.net]
async has quit [orwell.freenode.net irc.freenode.net]
cm has quit [orwell.freenode.net irc.freenode.net]
skylan has quit [orwell.freenode.net irc.freenode.net]
irchive_5 has quit [orwell.freenode.net irc.freenode.net]
foxster has quit [orwell.freenode.net irc.freenode.net]
mr_bubbs_ has quit [orwell.freenode.net irc.freenode.net]
pattern_ has quit [orwell.freenode.net irc.freenode.net]
systems has quit [orwell.freenode.net irc.freenode.net]
teratorn has quit [orwell.freenode.net irc.freenode.net]
rox has quit [orwell.freenode.net irc.freenode.net]
lam has quit [orwell.freenode.net irc.freenode.net]
Smerdyakov has quit [orwell.freenode.net irc.freenode.net]
mrvn has quit [orwell.freenode.net irc.freenode.net]
bk_ has quit [orwell.freenode.net irc.freenode.net]
whee has quit [orwell.freenode.net irc.freenode.net]
asqui has quit [orwell.freenode.net irc.freenode.net]
themus_ has quit [orwell.freenode.net irc.freenode.net]
brwill|out has quit [orwell.freenode.net irc.freenode.net]
wax has quit [orwell.freenode.net irc.freenode.net]
Maddas has quit [orwell.freenode.net irc.freenode.net]
systems has joined #ocaml
lam has joined #ocaml
Smerdyakov has joined #ocaml
mrvn has joined #ocaml
rox has joined #ocaml
pattern_ has joined #ocaml
teratorn has joined #ocaml
mr_bubbs_ has joined #ocaml
foxster has joined #ocaml
bk_ has joined #ocaml
whee has joined #ocaml
asqui has joined #ocaml
themus_ has joined #ocaml
brwill|out has joined #ocaml
Maddas has joined #ocaml
wax has joined #ocaml
polin8 has joined #ocaml
async has joined #ocaml
cm has joined #ocaml
skylan has joined #ocaml
irchive_5 has joined #ocaml
d-bug has joined #ocaml
Xcalibor has joined #ocaml
<Xcalibor>
hiyas
<d-bug>
hi
<mrvn>
tetrinet?
<systems>
hi
<systems>
mrvn the python guy :)
<mrvn>
I did it in ocaml now. pythong uses 30MB, perl used 12MB and ocaml only 6MB ram.
<Maddas>
cool!
<Maddas>
did what? :)
<mrvn>
debmirror
<Maddas>
What's that?
<mrvn>
mirror a partial debian archive
<Maddas>
Oh, cool.
<Maddas>
Isn't that tedious to do in ocaml? Mind showing me your code? (I'm still very beginner)
<mrvn>
gotta play some tetrinet, later
mattam_ has joined #ocaml
Smerdyakov has quit [Read error: 110 (Connection timed out)]
<Xcalibor>
mmm...
Smerdyakov has joined #ocaml
<Maddas>
heh, tetrinet
<Xcalibor>
what's that??
mattam has quit [Connection timed out]
<Maddas>
a game
<Maddas>
Tetrinet is a multiplayer, networked tetris game for up to 6 players.
buggs|afk has joined #ocaml
srv has joined #ocaml
<Xcalibor>
ah... and how the heck do you play at it?
<Maddas>
no idea
<mrvn>
ftp://mrvn.homeip.net/debmirror-ml/
<mrvn>
Maddas: Its by far not complete though. Config is hardcoded and no cleaning or checking of the mirror.
<Maddas>
ok :)
systems has quit [Connection timed out]
buggs has quit [Connection timed out]
<mrvn>
Maddas: Mirroring debian is quite easy since you only need to parse rfc822 formated files to know what files you should have. No listing of ftp dirs and trying to parse strange ftp output from windows or vax.
<Maddas>
I see
d-bug has left #ocaml []
Smerdyakov has quit [Read error: 110 (Connection timed out)]
ben has joined #ocaml
ben has quit ["ERC Version 4.0 $Revision: 1.517 $ (IRC client for Emacs)"]
bk_ has quit ["Terminated with extreme prejudice - dircproxy 1.0.5"]
bk_ has joined #ocaml
systems has joined #ocaml
hdaume has joined #ocaml
<hdaume>
is there a function for integer exponentiation? i need 2 ^ k for k : int....
<Xcalibor>
ah, if you startt meddling with bits, remember that OCaml are 31 (63) bits Integers
<Xcalibor>
not 32 (64)
Smerdyakov has joined #ocaml
<Xcalibor>
heyas Smerdyakov :)
<Smerdyakov>
OK!
<Xcalibor>
what's up?
<Smerdyakov>
I'm futilely banging on my computer waiting for the Internet connection to become reliable.
<Xcalibor>
oops...
<Xcalibor>
be careful, your computer can get angry at you for banging ;-)
<Xcalibor>
better bang on your ISP's router
<Smerdyakov>
I have Internet access through the building where I live, so there is no "tech support" to yell at.'
<Xcalibor>
i see... it's some kind of hall of residence, or is it a university lab building?
<Xcalibor>
there's always some IT tech you can yell at for a slow Internet connection :-)
<Smerdyakov>
It's an apartment building.
mrvn_ has joined #ocaml
<Xcalibor>
ah... you gotta attach a wireless lan from your place directly to the university lab network... it will surely go must faster
mrvn has quit [Nick collision from services.]
mrvn_ is now known as mrvn
<Xcalibor>
not hard and not expensive...
systems has quit [Read error: 110 (Connection timed out)]
<Xcalibor>
actually it's kinda fun to go to the tube with the laptop and still browsing, or go to the garden and still be chatting... pretty hilarious until you get used to the little miracle
<mrvn>
You have wavelan in your subways?
srv has quit [Remote closed the connection]
<Xcalibor>
mrvn: nope... we barely have cell phone network in the subway
<Xcalibor>
i was talking a home lan with the lab lan, if you live nearby or can set a direct sight it's really easy, otherwise you have to setup relays... it can be doen, a girl did it the other day (it was in slashdot)
<mrvn>
So how do you keep browsing in the tube?
<Xcalibor>
ah... :)
<Xcalibor>
sorry, I meant the bathtube
<Xcalibor>
:)
<mrvn>
it was dawning on me already :)
<Xcalibor>
we will have GPRS and GSM network on the subway (tube) in a year or so in Madrid, it's already working in Barcelona, I've been told
<mrvn>
Is it expensive to use record.member all the time? Should I "let member = record.member in"?
<Xcalibor>
I am not sure it that covers in-wagon, intra-stations travel... that would be neat, able to speak while the train's moving...
<mrvn>
We have that in germany. They have special cars in the train with repeaters where you can pretty much get a (bad) signal all the way.
<Xcalibor>
mrvn: no idea... but I guess it's not more expensive than a function call, so I guess it's okay
<Xcalibor>
mrvn: cool
<Xcalibor>
bad thing is that GPRS is so damn expensive :-/
<mrvn>
The question is if the compiler will optimize it that way or not.
<Xcalibor>
mrvn: dunno, sorry...
<Xcalibor>
Smerdyakov: have you checked on FC++? it's really waaaaaaaay cool :-)
<bk_>
what is FC++ ?
brwill|out is now known as brwill
<Xcalibor>
Functional C++... heavy on templates to provide highly polymorphic à la Haskell functional abilities for ISO C++...