【问题标题】:copy/part with pair in REBOL 3在 REBOL 3 中复制/部分与对
【发布时间】:2015-06-28 14:07:46
【问题描述】:

help copycopy 有以下看法:

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

【问题讨论】:

    标签: rebol rebol3


    【解决方案1】:

    /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]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多