在REBOL 3中复制/部分配对

时间:2015-06-28 14:07:47

标签: rebol rebol3

help copy有以下关于copy

的说法
USAGE:
   COPY value /part length /deep /types kinds

DESCRIPTION:
   Copies a series, object, or other value.
   COPY is an action value.

ARGUMENTS:
   value -- At position (series! port! map! object! bitset! any-function!)

REFINEMENTS:
   /part -- Limits to a given length or position
       length (number! series! pair!)
   /deep -- Also copies series values within the block
   /types -- What datatypes to copy
       kinds (typeset! datatype!)

/part细化可以采用number!series!pair!。我无法让pair!工作。 (我还没有尝试series!。)这是不是已经实现了?如果是,它是如何工作的?

1 个答案:

答案 0 :(得分:2)

/ part pair!细化适用于图片。该对与x / y坐标相关,如

>> img: load %image.png 
== make image! [519x391 #{
1D2F9F1D2F9F1C2E9E1C2E9E1B2D9D1B2D9D1B2D9D1B2D9D1D2F9F1C2E9E
1A2C9C192B9B192B9B1A2C9C1B2D9D1C2E9E1D2EA01...
>> copy/part img 2x2
== make image! [2x2 #{
1D2F9F1D2F9F1D2F9F1D2F9F
}]

REBOL/View Image Datatype

这里有一个例子 / part series!是如何工作的

>> s: [a b c d e f g]
== [a b c d e f g]
>> ser: skip s 3
== [d e f g]
>> copy/part s ser
== [a b c]