reporter
Report
report
label
color
color:  red
color:  blue
7.9

reporter

racket.tw <racket@racket.tw>

 (require reporter) package: reporter

struct

(struct Report ())

The report structure, all fields were private to avoid any hack based on this. report constructs this structure, directly print it would get report to stdout.

procedure

(report #:target target    
  #:message msg    
  #:labels label*    
  [#:error-code err-code    
  #:hint hint])  Report?
  target : srcloc?
  msg : string?
  label* : (listof Label)
  err-code : string? = #f
  hint : string? = #f
constructor of Report.

Usage:
(report #:target loc
        #:message "type mismatched"
        #:labels (list (label expect-type-loc (format "expected ~a" expect-type) #:color (color:blue))
                       (label actual-expr-loc (format "actual ~a" actual-type) #:color (color:red)))
        #:error-code "E0001")

Recommend using (raise Report?) and catch it in any place you want to collect them.

procedure

(label target msg [#:color color])  Label?

  target : srcloc?
  msg : string?
  color : color? = #f
target points out where the hint are going to, msg is the hint message, color is the color of hint message.

struct

(struct color ())

It could be color:red or color:blue

struct

(struct color:red ())

struct

(struct color:blue ())