Thanks for the correction jwkrahn and ikegami. The above response was obviously a bit too hasty. I intended ikegami's second variant. But it is probably better to use join, since the behavior does not rely on interpolation.
I updated the code to correct the error.