On this page:
set-interactive-display-handler
set-interactive-write-handler
set-interactive-print-handler

11 Interactive Value Port 🔗

 (require mrlib/interactive-value-port) package: gui-lib

procedure

(set-interactive-display-handler port 
  [#:snip-handler snip-handler]) 
  void?
  port : output-port?
  snip-handler : (or/c #f (-> (is-a?/c snip%) output-port? any))
   = #f
Sets port’s display handler (via port-display-handler) so that when it encounters these values:
  • syntax objects

  • snips

it uses write-special to send snips to the port and uses mrlib/syntax-browser to turn syntax object into snips and then uses write-special with the result to send it to the port. Otherwise, it behaves like the default handler.

If snip-handler is not #f, then set-interactive-display-handler passes any snips to it (not those it creates by mrlib/syntax-browser) instead of calling write-special.

To show values embedded in lists and other compound object, it uses pretty-display.

procedure

(set-interactive-write-handler port 
  [#:snip-handler snip-handler]) 
  void?
  port : output-port?
  snip-handler : (or/c #f (-> (is-a?/c snip%) output-port? any))
   = #f

procedure

(set-interactive-print-handler port 
  [#:snip-handler snip-handler]) 
  void?
  port : output-port?
  snip-handler : (or/c #f (-> (is-a?/c snip%) output-port? any))
   = #f