gpt4 book ai didi

rebol - 在 REBOL 3 中复制/部分成对

转载 作者:行者123 更新时间:2023-12-03 23:33:18 24 4
gpt4 key购买 nike

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!呢。)这不是实现了吗?如果是,它是如何工作的?

最佳答案

/part 对! 优化适用于图像。该对与 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]

关于rebol - 在 REBOL 3 中复制/部分成对,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31100707/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com