From: Alexander Schofield Date: 2002-02-06T07:41:01+09:00 Subject: Re: Call/CC and Ruby iterators. > On Wed, Feb 06, 2002 at 03:20:46AM +0900, Thaddeus L Olczyk wrote: > > Reading about call/cc in Scheme I get the impression that it is very > > like Ruby's iterators. > > Not being an expert in others I thought I would ask. call/cc is not really used for simple iteration, but more for when you want some kind of concurrent execution (think threads-- except you have to manually construct a system). Lisp and Scheme typically iterate by mapping functions to lists (which may have been filtered). Here's a simple example in CL: CL-USER 8 > l (1 2 3 4 5 6 7 8) CL-USER 9 > (let ((odds (remove-if-not #'oddp l))) (mapcar (lambda (x) (/ x 2)) odds)) (1/2 3/2 5/2 7/2) HTH -- Alexander Schofield