From: Andy Wingo <wingo@pobox.com>
To: guile-devel <guile-devel@gnu.org>
Subject: removing unused variables?
Date: Mon, 21 Sep 2009 09:40:48 -0400 [thread overview]
Message-ID: <m3iqfc1km7.fsf@pobox.com> (raw)
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/
next reply other threads:[~2009-09-21 13:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-21 13:40 Andy Wingo [this message]
2009-09-21 15:08 ` removing unused variables? Ludovic Courtès
2009-09-22 12:25 ` Andy Wingo
2009-09-23 22:12 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3iqfc1km7.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).