This is nasty. The argument is strset to a promise that returns letter, but it is not actually evaluated until called through l[[3]](). Therefore, the value at this point is used!
If you change the last part to:
for (letter in letters) AddFn(letter)
letter="foo"
l[[3]]() # Returns "foo"
... you will see it more clearly. ... So, do what @DWin offers, and call first force.
Tommy source
share