将单词更改为路径

时间:2017-05-29 21:25:26

标签: rebol red

另一个与Change path or refinement

相关的问题

这一次,我想将块内的 a 更改为 a/b

使用change

test: [a]
change test 'a/b

将值拆分为 two

>> test
== [a b]

这不是我想要的,而是作为单一路径 [a/b]

2 个答案:

答案 0 :(得分:2)

解决方案是使用change/only

test: [a]
change/only test 'a/b

给出:

>> test
== [a/b]

答案 1 :(得分:1)

change/only有效,但在这种情况下有一种更简单的方式:

>> test: [a]
== [a]

>> test/1: 'a/b
== a/b

>> test
== [a/b]