你是混淆path!
和file!
系列,他们可以看起来相似,但他们的性质是非常不同的。
A是由斜线符号分隔path!
的值(通常是值)的集合,a是值的集合。系列中的斜线字符只是字符,因此不了解任何子结构。它(主要)具有系列的语义,而具有系列的语义。word!
file!
char!
file!
file!
string!
path!
block!
现在这已被清除,关于test/1/2
结果,系列上的路径符号与 onfile!
具有不同的行为string!
,它将执行智能连接而不是充当访问器。它之所以被称为智能,是因为它可以很好地处理出现在左右部分的额外斜杠字符。例如:
>> file: %/index.html
== %/index.html
>> path: %www/
== %www/
>> path/file
== %www/file
>> path/:file
== %www/index.html
相同的路径符号规则也适用于url!
系列:
>> url: http://red-lang.org
== http://red-lang.org
>> url/index.html
== http://red-lang.org/index.html
>> file: %/index.html
== %/index.html
>> url/:file
== http://red-lang.org/index.html
因此,要更改 , as 的嵌套内容test: [%a/b]
, as 的file!
行为基本上与string!
, 您可以使用任何可用的字符串方法来修改它。例如:
>> test: [%a/b]
== [%a/b]
>> change skip test/1 2 %c
== %""
>> test
== [%a/c]
>> change next find test/1 slash "d"
== %""
>> test
== [%a/d]
>> parse test/1 [thru slash change skip "e"]
== true
>> test
== [%a/e]