我想這樣做:如何編寫與Set(編程)一起使用的Rebol代碼塊?
>> SET [a b] reduce [(ask "a: ") (ask "b: ")]
a: 1
b: 2
== ["1" "2"]
>>
編程:
args: [a b]
block: copy []
foreach arg args [
append block to-word "("
append block 'ask
append block rejoin [arg ": "]
append block to-word ")"
]
set args reduce block
但我得到這個錯誤:
>> foreach arg args [
[ append block to-word "("
[ append block 'ask
[ append block rejoin [arg ": "]
[ append block to-word ")"
[ ]
== [(ask "a: ") (ask "b: ")]
>> set args reduce block
** Script Error: (has no value
** Near: (ask "a: ") (
>>
有人嗎?這是太難了:) – 2009-12-17 23:24:41