Skip to content

Diagnostics, Error Reporting

frenchy64 edited this page Aug 22, 2011 · 3 revisions

Fail Nodes

Potentially lots of useful information can be given with a fail node.

Comprehensive Pattern Rows

Simple pattern comprehensiveness warnings can be given, for example

(match [x]
       [1] 1)

This pattern matrix can fall through.

Might give warning:

Warning: Non-comprehensive pattern matrix

Done

Reporting on matching-so-far

If a fail node is reached, could report on how the match got to that point.

(let [x 1
      y 2
      z 3]
  (match [x y z]
         [1 3 3] 1))

Could give error:

No match found: No match for {y 3}, successful matches: {x 1, z 3}

Decent messages for Seq patterns that are gensymed will be more challenging.

Diagnostics

Some useful information to report:

  • Number of branches tested at runtime (how many conds executed)
  • Number of SwitchNodes created at compile time
  • Number of LeafNodes created at compile time (?)
  • Execution trace of Matrix->DAG compilation

Pre/post Matrix expansion

It would be useful to show the origin of the expanded occurances in error messages.

This would make following long lists easier, for example.

Something went wrong with that request. Please try again.