Hi Gregg,
Thursday, May 11, 2006, 12:57:25 AM, Gregg wrote: > I'm not saying the one I posted is "the one", but I'd like some kind > of standard collector func in REBOL. Your 'collect was inspiring back then and so it is still :) I'm actually using a simple 'map quite often. This of course doesn't have the tremendous flexibility (and dialect-ic elegance :) of your 'collect but its sufficient most of the time. > I have a lot of EMIT functions in places too, and I tried a variant > of COLLECT that let you define a function, or used a predefined one > (e.g. EMIT), but then I thought about how REMOVE-EACH and others > work, because you can't guarantee you won't conflict with a word the > user needs. On the other hand, I have loads of 'emit functions in some stuff as well, so the more general approach is _very_ tempting. I'd actually prefer providing a simple "yield" function (name provided by the user) to overriding set-words. COLLECT 'YIELD [repeat i 10 [if (YIELD i) >= 3 [break]]] (uppercase to highlight the important parts, example borrowed from your original post) I find (even if it's lowercased :) that easier on the eye - i.e. I think I'm able to understand more quickly what's going on. -- Best regards, Andreas -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.
