Mirror of
forum.nim-lang.org
index
5021 :: Can Nim tell me about unused imports, lets, const and .high?
[2019-07-16T19:00:45+02:00]
View Orginal
treeform
(orginal)
[2019-07-16T19:00:45+02:00]
view original
Is there a way for nim to tell me when:
I can remove an import (unused imports)
I can convert a proc to a func (for procs that don't have site effects)
I can convert a var to a let (for variables that are only assigned once)
I can convert a let or var to a const (for variables in outer scope that don't change ever)
I can use
.high
instead of
.len - 1
Should this be part of nimpretty?
juancarlospaco
(orginal)
[2019-07-16T20:15:53+02:00]
view original
Theoretically you can remove any imports, using
--import:
on CLI or CFG.