On this page:
history-event
make-null-reporter
make-buffering-reporter
make-channel-reporter
make-logging-reporter
make-port-reporter

4 Module behavior/reporter

 (require behavior/reporter) package: behavior

This module provides a set of functions that construct reporter functions used be the models above. Effectively, each of the behavior models will emit history-events that correspond to changes in the execution state.

To this end the make-?-execution functions will take a reporter optional parameter. In general, if no reporter is specified, the null (make-null-reporter) reporter is used.

struct

(struct history-event (time)
    #:transparent)
  time : real?
These events are sent to a reporter function to denote an action taken place within a behavior execution. These structures cannot be created directly, it is intended as the parent of behavior-specific history events.

Creates a reporter that consumes all events and does nothing.

procedure

(make-buffering-reporter selector)

  
(-> list?) (-> history-event? void?)
  selector : (-> history-event? any/c)
This function creates a reporter that buffers all the events sent to it. It returns two values; the first if a function that returns the current buffer as a list, the second is the reporter function itself. The selector function is called to buffer a subset of the passed event, else the entire event is buffered.

Returns two values; the first is a newly created channel and the second is a reporter function that will accept events and write them to this channel.

procedure

(make-logging-reporter [a-logger])  (-> history-event? void?)

  a-logger : logger? = (current-logger)
Returns a reporter function that will accept events and write them to a standard racket logger.

procedure

(make-port-reporter port)  (-> history-event? void?)

  port : output-port?
Returns a reporter function that will accept events and write them to a standard racket output-port?.