Skip to content

Commit 36197ba

Browse files
committed
faq for unused variable
1 parent 68e7901 commit 36197ba

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/syntax/read.rkt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,15 @@
113113
(unless (set=? vars used)
114114
(define unused (set-subtract vars used))
115115
(warn 'unused-variable
116+
#:url "faq.html#unused-variable"
116117
"unused ~a ~a" (if (equal? (set-count unused) 1) "variable" "variables")
117118
(string-join (map ~a unused) ", "))))
118119

119120
(define (check-weird-variables vars)
120121
(for* ([var vars] [const (all-constants)])
121122
(when (string-ci=? (symbol->string var) (symbol->string const))
122123
(warn 'strange-variable
124+
#:url "faq.html#strange-variable"
123125
"unusual variable ~a; did you mean ~a?" var const))))
124126

125127
(define (our-read-syntax port name)

www/doc/1.6/faq.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ <h3 id="unsound-rules">Unsound rule application detected</h3>
111111
failed to simplify the output.
112112
</p>
113113

114+
<h3 id="unused-variable">Unused variable <var>var</var></h3>
115+
116+
<p>
117+
The input FPCore contains a variable that is not
118+
used in the body expression.
119+
</p>
120+
121+
<h3 id="strange-variable">Strange variable <var>var</var></h3>
122+
123+
<p>
124+
The input expression contains a variable that is similar in name
125+
to named constants, e.g. <var>e</var> instead of <var>E</var>.
126+
</p>
114127

115128
<h2>Known bugs</h2>
116129

0 commit comments

Comments
 (0)