smkl changed the topic of #ocaml to: OCaml 3.06 released: http://caml.inria.fr/ocaml/distrib.html | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml
xactive has joined #ocaml
skylan has quit ["Reconnecting"]
skylan has joined #ocaml
xactive has left #ocaml []
bobov has joined #ocaml
<pnou> hi
SYStems has joined #ocaml
<SYStems> hi
SYStems has quit ["-eXtreme- (A)bort, (R)etry, (G)et a beer?"]
TachYon25 has joined #ocaml
mrvn has joined #ocaml
mrvn_ has quit [Read error: 110 (Connection timed out)]
<mrvn> moin
<mrvn> If I have a class foo that inherits class bar and an instance f of foo. How do I call a method that wants a bar?
<pnou> inherit bar as super
<pnou> hum
<pnou> i don't understand you question
<pnou> can you give a short example?
<mrvn> This expression has type
<mrvn> fixed_rate_pipe =
<mrvn> < add_dest : ControlBucket.bucket -> int -> unit;
<mrvn> add_source : ControlBucket.bucket -> int -> unit; flow : unit >
<mrvn> but is here used with type pipe = < flow : unit >
<mrvn> and fixed_rate_pipe inhertits pipe
<pnou> you didn't subtype?
<mrvn> class virtual pipe = object method virtual flow:unit end
<pnou> (foo :> pipe)
<mrvn> class fixed_rate_pipe = object inherit pipe method ... end
<pnou> and you want to pass a fixed_rate_pipe as an argument of flow, that's it?
<mrvn> No, I want to pass a fixed_rate_pipe to a function requireing a pipe.
<mrvn> method (flow :> pipe) =
<mrvn> gives a syntax error
<pnou> no
<pnou> you must subtype your argument
<pnou> object_of_type_pipe#flow (foo_of_typed_fixed_rate_pipe :> pipe)
<mrvn> let fixed_rate_pipe = new fixed_rate_pipe "pipe" 1 1.0
<mrvn> let _ = activate_pipe (fixed_rate_pipe :> pipe)
<mrvn> like that?
<mrvn> thx
<pnou> if activate_pipe is pipe -> something, yes
<mrvn> I have a list of all pipes. Is there a chance to add each pipe to that with "initializer" in call pipe?
<mrvn> I tried to add self to the list but that doesn't work
<mrvn> s/call/class/
eivuokko has joined #ocaml
<pnou> sorry i don't understand :)
<mrvn> let active_pipes = ref ([] : pipe list)
<mrvn> let activate_pipe pipe = active_pipes := pipe :: !active_pipes
<pnou> you want to add the element of the list to what ?
<mrvn> I would like to call activate_pipe in an initializer of pipe
<pnou> your goal is to have a list of all the pipes in each pipe?
<mrvn> No, just one global list of all pipes.
<pnou> ok
<mrvn> I have to call the flow function of all pipes every second.
<pnou> you can put it in intializer yes
<mrvn> How? it allways complains that self may not leave the class.
<pnou> subtype
<mrvn> Self type cannot escape its class
<pnou> and double coertion?
<mrvn> initializer active_pipes := self :: !active_pipes
<mrvn> I used "object (self)"
<pnou> try (self :> pipe)
<mrvn> Thanks, that works. Why do i have to subtype that?
<pnou> no idea
<mrvn> I'm subtyping it to its own type. Doens't look very logial.
<pnou> the object type system is very very complex
<pnou> very few person understand it totaly
<mrvn> I notice that. Everytime I use it I learn something new.
<pnou> even in the cristal team
<pnou> i always subtype self, but i don't really know why
<pnou> sometimes you must use (self : pipe :> pipe)
<mrvn> It will get realy intresting if I need private methods and friends.
<mrvn> Can you have protected methods? Methods that may be used by the class and by classes inheriting but noone else.
<pnou> that what ocaml private method are
<pnou> but you can't have methods which can't be used by classes inheriting
<mrvn> You wouldn't make them methods I guess. Just define them with let between the class and object should work.
<pnou> yes
eivuokko has quit [Read error: 104 (Connection reset by peer)]
TachYon25 has quit [Remote closed the connection]
gl has joined #ocaml
<pnou> da gl
<gl> salut pnou
<gl> alors, ulm ?
<pnou> je suis pris :)
<gl> kewl
<pnou> ouaip :)
<pnou> je quitte jussieu, ça se fête !
eivuokko has joined #ocaml
TachYon25 has joined #ocaml
TachYon76 has joined #ocaml
TachYon76 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
gl has quit [Read error: 113 (No route to host)]
thelema has joined #ocaml
<thelema> ping?
<Dybbuk> Howdy.
<thelema> is there a right way to access a record field from a functored module?
<Dybbuk> I don't know. :)
<thelema> I can give more info than just that terse description if I wasn't clear enough.
<Dybbuk> Well, I am a newbie with OCaml. I'm not even sure what a functored module is.
<thelema> functors are pretty crazy. imagine parameterizing an entire module with another module.
<Dybbuk> Wow. Well, I am going to have to go and read about them now. :) Are they discussed in the O'Reilly book?
<thelema> chapter 14
<thelema> they don't get as much treatment as they deserve, but what can you do...
<Dybbuk> You can always exert your Will over them. :)
<Dybbuk> Are you an OTO guy?
<thelema> another someone who realizes my nick isn't a misspelling of thelma.
<Dybbuk> Well, the head PR guy for the Caliphate OTO is a friend of mine. :)
<Dybbuk> Frater Hrumachis.
<thelema> it's a small world.
smklsmkl has joined #ocaml
eivuokko has quit ["sleep"]
<Dybbuk> thelema: And me, I'm a Freemason.
<thelema> I've heard the masons' recruiting is down
<Dybbuk> Well, we don't recruit. But yes, membership has been falling. I think it was actually artificially high for the last 50 years or so -- for a while there, it was kind of a fad.
<thelema> that's almost certainly true.
<Dybbuk> So I'm happy. :) It's the folks who are Masons for the right reasons who are staying and joining.
<thelema> why have you started to use ocaml?
<Dybbuk> Well, I am a really big fan of Common Lisp, and through that got interested in functional programming.
<thelema> caml is definitely different than lisp...
<Dybbuk> And after seeing the "language shootout" page, I thought I'd take a look at it.
<Dybbuk> The concepts and ease-of-learning impressed me, so I've slowly been learning it.
<Dybbuk> Yes, it's quite different.
<thelema> ocaml is my first functional language, and I really like the mindset one needs to program in it.
<Dybbuk> But also quite similar.
<Dybbuk> Yeah, functional programming is an awesome concept.
<Dybbuk> I'm trying to get familiar enough with OCaml that I can use it for some projects at work.
<thelema> perl was my big programming language before ocaml, so was already comfortable with the idea of mapping over structures.
<Dybbuk> It would be very helpful to me if the native code compiler could produce relocatable objects.
<Dybbuk> Yeah, we do mostly Perl stuff here, but lots of C as well.
* thelema hasn't needed to make ocaml do that yet.
<thelema> I'm mostly having fun being multi-paradigmatic
<Dybbuk> thelema: I want OCaml modules to load into Perl. The only way to do that now is with bytecode.
<thelema> ow, that's going to be tough.
<thelema> what do you plan on interfacing the two for?
<Dybbuk> Our main project relies very heavily on a set of Perl Apache modules.
* thelema had the feeling web development was going to hit soon
<Dybbuk> But we want to move some of the computationally hairy stuff to a faster and more sane language.
<Dybbuk> C takes too long to write, though, and it's really damn ugly. :)
<Dybbuk> Heheh. Web development can be fun if you make it fun.
<thelema> However, neither the ocaml bytecode nor the native code generated by ocamlopt are fully relocatable.
<thelema> http://216.239.51.100/search?q=cache:kkE0bfbwyGgC:pauillac.inria.fr/~xleroy/publi/ocamlp3l-mlws.ps.gz+ocaml+relocatable+object&hl=en&ie=UTF-8
<thelema> I've done my fair share of web development, but it's all been in perl.
<Dybbuk> Mmmm. Yeah, looks like relocatable code is a long way off.
<Dybbuk> The other option is some kind of RPC interface.
<Dybbuk> I haven't given it a whole lot of thought yet, though.
<thelema> well, as long as you don't use XML-RPC or SOAP...
smklsmkl has quit ["..."]
<Dybbuk> thelema: Never! :)
<thelema> good. I'd hate to think you joined the dark side.
<Dybbuk> No, the only darkness that is corrupting my soul is Perl. :)
<thelema> heh.
<thelema> well, nice talking to you. Hopefully we'll meet again.
thelema is now known as thelema|away
<Dybbuk> We will.