REBOL3 tracker
  0.9.12 beta
Ticket #0001811 User: anonymous

Project:



rss
TypeBug Statustested Date31-Dec-2010 00:49
Versionalpha 110 CategoryMezzanine Submitted byBrianH
PlatformAll Severityminor Prioritynormal

Summary FIND-ALL binds its body argument, doesn't need to
Description FIND-ALL has a set of arguments and behavior that matches the FORALL and FORSKIP family, but for some reason binds its body argument when it doesn't have to. As with FORALL, the word that you are using is already assigned the series, and so doesn't need to be localized. The current COPY/deep of the code block is unnecessary overhead, and the unusable words (particularly 'value) don't help either.

The example source below should work better, have less overhead, be able to handle all argument words, and is more FORALL-like. It is still affected by #539 though. This source also fixes #1739.
Example code
find-all: funct [
    "Find all occurances of the value within the series (allows modification)."
    'series [word!] "Variable for block, string, or other series"
    value
    body [block!] "Evaluated for each occurance"
][
    assert [series? orig: get series]
    while [any [set series find get series :value (set series orig false)]] [
        do body
        ++ (series)
    ]
]

Assigned ton/a Fixed inalpha 111 Last Update26-Feb-2011 01:11


Comments
(0003066)
Carl
31-Jan-2011 01:57

Very nice, thanks.

Date User Field Action Change
26-Feb-2011 01:11 BrianH Status Modified built => tested
31-Jan-2011 01:57 carl Comment : 0003066 Added -
31-Jan-2011 01:57 carl Fixedin Modified => alpha 111
31-Jan-2011 01:57 carl Status Modified reviewed => built
17-Jan-2011 04:27 carl Status Modified submitted => reviewed
31-Dec-2010 00:52 BrianH Description Modified -
31-Dec-2010 00:52 BrianH Code Modified -
31-Dec-2010 00:49 BrianH Ticket Added -