[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
removing unused variables?
From: |
Andy Wingo |
Subject: |
removing unused variables? |
Date: |
Mon, 21 Sep 2009 09:40:48 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) |
Hello,
Unused variables are compiled away to only their side effects. Yet
sometimes they are good for documentation. As in this case:
------------------------- module/language/assembly.scm -------------------------
index 683da6c..95f8a2d 100644
@@ -49,7 +49,7 @@
(+ 1 *len-len* (string-length str)))
((load-array ,bv)
(+ 1 *len-len* (bytevector-length bv)))
- ((load-program ,nargs ,nrest ,nlocs ,labels ,len ,meta . ,code)
+ ((load-program _ _ _ _ ,len ,meta . _)
(+ 1 *program-header-len* len (if meta (1- (byte-length meta)) 0)))
((,inst . _) (guard (>= (instruction-length inst) 0))
(+ 1 (instruction-length inst)))
This is a bad change IMO. We should not contort our code to please some
mechanical idea of "good style".
Andy
--
http://wingolog.org/
- removing unused variables?,
Andy Wingo <=