Search code examples
rebolrebol2

Enumerating the properties of an object


I have an object of which I would like to view all the properties, but using probe prints out pages and pages of information which I cannot possibly read, and using mold prints out only the first bit.

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

Solution

  • I am used to use help on objects as in

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

    And instead of first on objects you should now use 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]