#get-definition

print调用流程

  • %environment/natives.red:
print: make native! [[
        "Outputs a value followed by a newline"
        value   [any-type!]
    ]
    #get-definition NAT_PRINT
]
  • %runtime/natives.reds -> print*
`print*` -> `prin*` -> (actions/form* -1) -> dyn-print/red-print
  • %runtime/actions.reds
form -> get-action-ptr value ACT_FORM -> action-table/(type << 8 + action)
  • %runtime/datatypes/datatype.reds
Eg. %runtime/datatypes/binary.reds -> init -> form
  • %runtime/print.reds
dyn-print/red-print -> red-prints

form调用流程

  • %environment/actions.red
form: make action! [[
        "Returns a user-friendly string representation of a value"
        value     [any-type!]
        /part "Limit the length of the result"
            limit [integer!]
        return:   [string!]
    ]
    #get-definition ACT_FORM
]
  • %runtime/actions.reds -> form*