From: Robert Dober Date: 2006-03-25T00:23:40+09:00 Subject: Re: iterator class not working ------=_Part_8714_23766583.1143213803396 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 3/24/06, Ross Bamford wrote: > > On Fri, 2006-03-24 at 23:43 +0900, Robert Dober wrote: > > > > Well I got it! > > Was I missing something or is my solution really better? > > Well, if you're going to cheat and use return ... :) > > Seriously though, I like that one. Shows how it's important to remember > the 'normal' stuff when you're thinking in this high level stuff :) > > And yes, I guess it is better: > > user system total real > Iterator1 4.730000 0.040000 4.770000 ( 4.877037) > Iterator2 2.840000 0.050000 2.890000 ( 2.960747) > Iterator3 2.800000 0.130000 2.930000 ( 2.998121) > Iterator4 2.040000 0.020000 2.060000 ( 2.131763) > > (1 =3D my updated, easy to follow version of Peter's original, 2 =3D same > version with one callcc and one catch, 3 =3D Peter's second > implementation, 4 =3D your callcc/return implementation) > > As you can see, though, they're all pretty slow when it comes right down > to it (this was only over (0...50000).to_a) - some of the > FasterGenerator quiz entries I mentioned achieved quite amazing speeds > over that many iterations and more - you should check them out. > > -- > Ross Bamford - rosco@roscopeco.REMOVE.co.uk > > > I have no merit than ;), no it is true that I have not understood a bit o= f your continuation stuff, when I realized what callcc really does, I realize= d that I was wrong about the coroutines. Ty for the acknowledgement but I learnt it from your code! Cheers -- Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_8714_23766583.1143213803396--