-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Barney Boisvert wrote:

> It ought to do what it's documented to do, which is replace each
> instance of the first list's items with the corresponding item from
> the second list.  It does that very well.

Which can be interpreted two ways.

One is the intuitive one, which is like a string- rather than
character-based version of tr///, where the input string is scanned for
the span of characters closest to the beginning of the string that
matches one of the elements in the domain list. This span of characters
is replaced with its corresponding entry in the range list. It then
does the same thing with the remainder of the string following the span
that's just been replaced. Wash, rinse, repeat. This is a useful
function.

Then there's the counterintuitive one, which is how ReplaceList() works:

    function ReplaceList(text, rangeList, domainList)
    {
        var i = 0;

        var range  = ListToArray(rangeList);
        var domain = ListToArray(domainList);

        for (i = 1; i lte ArrayLen(range); i = i + 1)
        {
            text = Replace(text, range[i], domain[i], "ALL");
        }

        return text;
    }

Which is, quite frankly, next to useless and violates the Principle of
Least Surprise. That, in itself, is a bug.

> Whether that particular function is useful at all is up for debate
> (I'm on the 'no' side).

Ditto.

K.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCsAY/mSWF0pzlQ04RAq7bAJ9U5KMiBh4XHetuOjPYG/tx8kmY3ACfXkhR
HIqMjKBhjyUB1uKuWCYFBXA=
=dDma
-----END PGP SIGNATURE-----

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209524
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to