见: R3 Nesting Functions

其实就是指针的偏移

>> myblock: [the fox jumped over the dogs]
== [the fox jumped over the dogs]
>> head insert back tail insert next myblock [quick brown] [lazy]
== [the quick brown fox jumped over the lazy dogs]
>> head insert back tail insert next myblock [quick brown] [lazy]
== [the quick brown quick brown fox jumped over the lazy lazy dogs]

next myblock 指到 “fox” 前面

insert (next myblock) [quick brown] :变成 the quick brown fox …

tail 跳到 myblock 字符串 末尾

back 跳到 “dogs” 的前面

insert (back (tail (insert (next myblock) [quick brown]))) [lazy] :变成 … the lazy dogs

head 再跳回 myblock 字符串 开头



blog comments powered by Disqus

Published

02 July 2015

Tags