0

我有一个对象,我想查看它的所有属性,但是使用probe打印出我不可能阅读的信息页面和页面,并且使用mold只打印出第一位。

>> mold input
== {make object! [
    type: 'face
    offset: 20x20
    size: 400x150
    span: none
    pane: none
    text: "Text"
    color: 25...
4

2 回答 2

1

我习惯于help在对象上使用

>> help system
SYSTEM is an object of value:
   version         tuple!    2.7.8.3.1
   build           date!     1-Jan-2011/16:39:07-8:00
   product         word!     View
   core            tuple!    2.7.8
   components      block!    length: 60
   words           object!   [unset! error! datatype! context! native! action! ...
   license         string!   {REBOL End User License Agreement IMPORTANT. READ ...
   options         object!   [home script path boot args do-arg link-url server...
   user            object!   [name email home words]
   script          object!   [title header parent path args words]
   console         object!   [history keys prompt result escape busy tab-size b...
   ports           object!   [input output echo system serial wait-list]
   network         object!   [host host-address]
   schemes         object!   [default Finger Whois Daytime SMTP ESMTP POP IMAP ...
   error           object!   [throw note syntax script math access command resv...
   standard        object!   [script port port-flags email face sound error por...
   view            object!   [screen-face focal-face caret highlight-start high...
   stats           native!   System statistics. Default is to return total memo...
   locale          object!   [months days]
   user-license    object!   [name email id message]

而不是first on objects 你现在应该使用words-of

>> help words-of
USAGE:
    WORDS-OF value

DESCRIPTION:
     Returns a copy of the words of a function or object.
     WORDS-OF is a function value.

ARGUMENTS:
     value -- (Type: any)
>> probe words-of system
== [version build product core components words license options user script console ports network schemes error standard view
   stats locale user-license]
于 2014-06-25T09:26:39.003 回答
0

您可以使用 获取对象的所有属性first,它对包括对象在内的大量类型进行操作。当传递一个对象时,它返回一个表示属性的单词列表。

>> ? first
USAGE:
    FIRST series

DESCRIPTION:
     Returns the first value of a series.
     FIRST is an action value.

ARGUMENTS:
     series -- (Type: series pair event money date object port time tuple any-function library struct event)

所以在我的例子中,first input给出了以下内容:

>> probe first input
[self type offset size span pane text color image effect data edge font para feel saved-area rate show? options
parent-face old-offset old-size line-list changes face-flags action state access style alt-action facets related
 words colors texts images file var keycode reset styles init multi blinker pane-size dirty? help user-data flag
s doc]
于 2014-06-25T07:21:42.143 回答