Remember that function arguments are passed by value - that is, they are copied on every call. You can avoid this by assigning a large value to a symbol and passing the symbol itself to the function instead.
Jeff
=====
Old programmers don't die. They just parse on...
perhaps have a look at section 16 of the reference manual, Passing data by reference...
Your iterations were closer than you think:
(define (triple n)
(* 3 (eval n)))
(set 'x 3)
(triple 'x)
; passes symbol x without evaluating it - this should work when you eval x, if it's a number
(triple x)
; evaluates x, then passes the 3 value - this should also work, since, inside triple, (eval 3) returns 3
(triple "x")
; strings evaluate to themselves, not a number, so the multiply will fail
(triple ''x)
; passes 'x to function; (eval n) returns x, but x is not a number (needs another eval)...
But - to return to an earlier reply - I still don't remember why that 0 in the dolist loop increased the speed. Something to do with references returned by push ... ?
cormullion wrote:why that 0 in the dolist loop increased the speed.
As I can see, (push token big-string) operator returns big-string. In my script this string (at the end) is about 300k long, and I call push function about 20k times.
So, function returns (20k * 300k) / 2 = 3'000'000'000 extra characters, and it lags my script by about 0.5 seconds.
But if I put "0" at the end, I receieve from function as a result only 20k zeroes.