A very first stab at improving HELP on a PORT! value.
To test, this can be used in ReplPad:
>> do https://gist.githubusercontent.com/rgchris/67106926e3005b7308392efaa70025b4/raw
== #[action! [port]]
>> help-port log/info
Kind Console.log Scheme
Ref log::info
Mode Sync
Actor
write action!
append action!
Source:
summarize-port: function [
{Returns a block of information about a port}
return: "Block of short lines (fitting in roughly 80 columns)"
[<opt> block!]
port [port!]
][
return collect [
keep join "Kind " port/spec/title
keep join "Ref " mold any [match [file! url!] :port/spec/ref [...]]
keep join "Mode " pick ["Async" "Sync"] action? :port/awake
switch type-of :port/actor [
object! [
keep "Actor "
keep summarize-obj port/actor
]
handle! [
; internal port
keep " actor handle! "
]
]
]
]