下面这个函数的目的是返回一个在两个星之间插入参数值的字符串.
star-name: func [name /local stars] [
stars: "**"
insert next stars name
stars
]
print star-name "test" ;*test*
print star-name "this" ;*thistest*, but what I really want is *this*
Run Code Online (Sandbox Code Playgroud)
第二次调用函数时,第一次调用的参数仍然是插入的.我知道答案是使用copy "**".我的问题是,每次调用函数时,它是否都不会重新分配stars变量"**"?