Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
Kinners has joined #ocaml
mattam has quit ["zZz"]
docelic has left #ocaml []
steele has joined #ocaml
<steele> hi
rox is now known as rox|verdamte
Kinners has left #ocaml []
provid has joined #ocaml
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
steele_ has joined #ocaml
steele has quit [Read error: 104 (Connection reset by peer)]
provid has quit ["Client exiting"]
steele_ has quit [Remote closed the connection]
lyn has joined #ocaml
skylan has quit [Killed (NickServ (Ghost: skylan_!sjh@207.164.213.47))]
skylan has joined #ocaml
mattam has joined #ocaml
smkl has quit [Read error: 104 (Connection reset by peer)]
smklsmkl has joined #ocaml
xmkl has joined #ocaml
smklsmkl has quit [Read error: 54 (Connection reset by peer)]
rox|verdamte is now known as rox
Torquemada has quit [Remote closed the connection]
xmkl is now known as smkl
rox is now known as rox|peaceprotest
steele has joined #ocaml
<steele> hi
esabb has joined #ocaml
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
<mrvn> moin. Anyone awake?
* steele is
<mrvn> Well, when you guys wake up could yu try the following:
<mrvn> mrvn@dual:~% cat foo.ml
<mrvn> let _ = Unix.sleep 10 (* sleep 10 seconds *)
<mrvn> let _ = Graphics.open_graph " 100x100" (* open window *)
<mrvn> let _ = Unix.sleep 600 (* should sleep 10 minutes but doesn't *)
<mrvn> mrvn@dual:~% ocamlc -o foo unix.cma graphics.cma foo.ml
<mrvn> mrvn@dual:~% ./foo
<mrvn> 64 bytes from 192.168.0.5: icmp_seq=0 ttl=64 time=1.2 ms
<mrvn> 64 bytes from 192.168.0.5: icmp_seq=1 ttl=64 time=0.9 ms
<mrvn> 64 bytes from 192.168.0.5: icmp_seq=2 ttl=64 time=0.9 ms
<mrvn> ups
<karryall> hum
<mrvn> Ahh, someone awake.
<mrvn> Does the second sleep work for you?
<karryall> it doesn't
<steele> mrvn: returns immediately
<karryall> same thing with ocamlopt
<karryall> hum I see on the sleep(3) manpage:
<karryall> sleep() may be implemented using SIGALRM; mixing calls to alarm() and sleep() is a bad idea.
<karryall> maybe that's the problem
<mrvn> Or the graphics generates signals and the sleep doesn't go back to sleep after a graphics signal.
<karryall> yeah
<mrvn> Time to report a bug.
<karryall> if think it has already been reported
<karryall> indeed, Unix.select also fails with a "Interrupted system call"
<karryall> Xavier posted once a solution about this:
<mrvn> Args. can't he write english?
<mrvn> Doesn't select return the number of seconds passed since sleeping somewhere?
<karryall> hum, no it just returns with an error (raises Unix_error)
<mrvn> The C sleep returns the number of seconds still to be slept but ocaml doesn't.
<karryall> I think that's not standard
<karryall> ie linux-specific
<mrvn> CONFORMING TO
<mrvn> POSIX.1
<mrvn> In C some people write "unsigned int t = 60; while((t = sleep(t)) != 0);
<karryall> On Linux, the function select modifies timeout to reflect
<karryall> the amount of time not slept; most other implementations
<karryall> do not do this.
<karryall> Consider timeout to be undefined after select
<karryall> returns.
<karryall> (from select manpage)
<mrvn> Yes, select is tricky there.
<karryall> ar, you were speaking of sleep
<karryall> not select
<mrvn> yep.
<karryall> indeed Unix.sleep could return that
<mrvn> Should be two sleeps. One that returns int and gets interrupted and one that returns unit and handles signals internally.
<mrvn> sleep and deep_sleep or something
sproctor has joined #ocaml
<sproctor> hello
<karryall> Xavier said there would be a Unix.really_sleep
<mrvn> not yet it seems but my ocaml is a few weeks old
Dalroth has joined #ocaml
sproctor has left #ocaml []
<karryall> mrvn: I have a quick fix for this Unix.sleep/select and Graphics problem
<mrvn> You check the time with gettimeofday and sleep again?
<karryall> no, in the source of Graphics there's another mecanism, not using signals but async IO
<karryall> it works on BSD
<karryall> it should work on linux too, the autoconfiguration test fails
<karryall> (it shouldn't)
<karryall> so you just have to add a line in config/s.h
<karryall> #define HAS_ASYNC_IO
<karryall> and recompile the graphics library
<karryall> then Graphics won't mess with the signals anymore !
<mrvn> Is there a way to get a signal when the size of the window changes?
<karryall> I don't think so
<mrvn> Was ich auch immer komisch finde ist wieviele files bei 99.9% nochmal haengenbleiben.
<mrvn> ups
<mrvn> What does the test for async io look like?
<karryall> it's a C program
<karryall> but it tests the async io on a pipe and this fails on linux
<mrvn> if test -z `grep "OTHERLIBRARIES.*labltk" config/Makefile`; then\
<mrvn> echo "Error, labltk library was not built"; \
<mrvn> echo "Check your tcl/tk development packages"; \
<mrvn> echo "Aborting."; \
<mrvn> exit 1; \
<mrvn> fi
<mrvn> /bin/sh: line 1: test: too many arguments
<mrvn> Did you get that during configure/compile?
<karryall> hum, no are you using CVS ? I used ocaml-3.06
<mrvn> No, debian sources
<mrvn> What should the async_io test actually do?
<mrvn> It writes something to the pipe and the father should get a signal then?
<karryall> yes
<karryall> but linux doesn't support async io on pipes seeminlgy
<karryall> it works fine if you use a socketpair instead of a pipe
<karryall> and X11 uses sockets for communication anyway
lindril has quit ["Client Exiting"]
<mrvn> Doesn't just setting async_io break some io calls when using pipes if that doesn#t work under linux?
<karryall> HAS_ASYNC_IO is only used here (in Graphics) I think
<mrvn> Urgs, ocaml generates lots of warnings during compile. ugly.
<mrvn> Is there something like break or continue in C for ocaml (for for loops)?
<whee> doubt it, they probably want you to use exceptions
mattam_ is now known as mattam
budweiserbg has joined #ocaml
<karryall> Pervasives defines an Exit exception that I use for this
budweiserbg has left #ocaml []
karryall has quit ["Vacances !"]
asqui has quit [K-lined]
systems has joined #ocaml
systems has left #ocaml []
asqui has joined #ocaml
polin8 has quit [Read error: 104 (Connection reset by peer)]
polin8 has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
lament has joined #ocaml
skylan has joined #ocaml
rox|peaceprotest has quit ["Client Exiting"]
polin8_ has joined #ocaml
polin8_ has quit [Client Quit]
<mrvn> How do I make a reference to self in a class?
<mrvn> class root = object(self) val r = ref self end;;
<mrvn> The instance variable self
<mrvn> cannot be accessed from the definition of another instance variable
<mrvn> Segora: udp und tcp?
Dalroth has quit []
esabb has quit [Remote closed the connection]
intero has joined #ocaml
<intero> hi people
<intero> if you guys should spend 200 hours on a project about linux, what would it be?
<steele> kernel or userland?
<intero> well i am not a kernel hacker if i think i can do it...
<intero> try telling
<intero> both choices :P
<steele> i don't have any idea (yet) =)
<intero> lol
<intero> you are not the first who suggest that option :P
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
systems has joined #ocaml
<mrvn> intero: You coul write some essential services for linux in ocaml
<intero> mrvn: like?
<mrvn> Like a dns proxy/server, ftp client/server/proxy, http proxy
<intero> my ocaml teacher would love me
<mrvn> dns would be most welcome.
<intero> anything ai related? i dont like nets much
<mrvn> You near linux does it have to be? Could you implement a MUD in ocaml under linux?
* steele wonders what class that is
<intero> near linux just coz i'd like it to be useful for something after, but it's not a must
<intero> mrvn: what is a mud? ;)
<mrvn> Multi User Dungeon
<intero> steele: something you have to do here in italy to get first level bachelor (?). like a thesis, but it's a 200 hrs project
<mrvn> You have a server and people log on to it and sove small puzzles or games.
<intero> real-time text-based internet role playing game
<mrvn> with computer driven characters that interact with the players as well.
<intero> mrvn: you know me, i suck in ocaml, are you sure i could do that?
<mrvn> In ocaml its pretty easy to do because you have continuations.
<mrvn> and Objects
<intero> continuations?
<intero> is it really easy?
<intero> i mean i know the basics of c/c++ and nothing else. a few ocaml but the hardest thing i did is a search in a graph
<intero> lol
<mrvn> Maybe a IPv4/IPv6 translator library that makes it possible to use a programm supporting one of them on the other.
<mrvn> That would be down to earth C but quite some network stuff.
<intero> steele: thanks, of course i didnt know :P
<mrvn> Or a Peer2Peer system for small communities (your 5-100 friends) with RSA authentication and Forward Error Correction for transmissions.
<mrvn> With electronic cash and such.
<intero> mrvn: anything not net related?
<mrvn> I would love to have a electronic cash system where every user can print money, users can exchange money, users can barter money (one users money for another users money) and check the credibility of money.
<mrvn> That would be a bit nt and a lot of cryptographie.
<mrvn> s/nt/net/
<intero> btw is the continuation always a function or theres no restriction?
<mrvn> intero: Sincevalues can't be computed but are just thereit must be a function.
<mrvn> If a continuation would be a plain value it would have already been computed so it has nothing to continue.
<intero> yes
<intero> i got it
<intero> cool :)
<intero> ocaml really seems to kick ass
<mrvn> But of cause you can have a continuation function () -> 17
<mrvn> intero: With continuations you can realy easy simulate multitasking without all the kernel overhead.
<mrvn> Or do callbacks.
<intero> you see mrvn
<intero> university here
<intero> is so teorical
<nkoza> ocaml has continuations?
<intero> i really know nothing about it all
<intero> it sucks :(
<mrvn> nkoza: let cont = function () -> print_string "it coninues here"; something_else ()
<mrvn> nkoza: cont can be considered a continuation.
systems has quit [Read error: 110 (Connection timed out)]
<intero> night guys
<intero> thanks for the hints
<intero> i'll let you know
<intero> bye for now
intero has left #ocaml []
gene9 has joined #ocaml
gene9 has quit [Client Quit]
asqui has quit ["Now I am gone..."]
asqui has joined #ocaml
asqui has quit [Read error: 104 (Connection reset by peer)]
mrvn_ has joined #ocaml
lindril has joined #ocaml
mrvn has quit [Read error: 60 (Operation timed out)]