[REBOL] Re: Simple things should be simple to do ?
From: larry:ecotope at: 15-Nov-2000 19:21
Hi Bard
Good work! But there is one small problem with your code. If you execute
your function a second or third time, it will produce incorrect answers. If
you repeat it on the same string, the counts will double each time. You can
fix this by defining count like this:
count: copy []
or
count: make block! 0
The reason is that series literals in a function "remember" all previous
modifications. You can see this by doing
source count-char
after each repetion. There is a short discussion of this issue in the new
Core manual available from RT.
Cheers
-Larry