1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27#lang racket/base
(provide
(struct-out problem)
problem<?
problem-loc
current-problem-list)
(struct problem (stx level message)
#:transparent)
(define (problem<? a b)
(define-values (_source-a line-a column-a) (problem-loc a))
(define-values (_source-b line-b column-b) (problem-loc b))
(if (= line-a line-b)
(< column-a column-b)
(< line-a line-b)))
(define (problem-loc p)
(define stx (problem-stx p))
(if (srcloc? stx)
(values (srcloc-source stx) (srcloc-line stx) (srcloc-column stx))
(values (syntax-source stx) (syntax-line stx) (syntax-column stx))))
(define current-problem-list
(make-parameter null))