Subject: Re: basic question (probably w/ no good answer)
From: Erik Naggum <>
Date: 2000/04/08
Newsgroups: comp.lang.lisp
Message-ID: <>

* Joe Marshall <>
| The time you might `save' in compilation is negligable, a decent compiler
| would produce similar code in either case, even if the code were
| different, I can't imagine it would be so different as to have a
| noticable impact on performance or code size, and if it *really* made a
| noticable difference, I'd imagine that the compiler would be so piss-poor
| as to be virtually unusable.

  I think "helping the compiler" (not expressed in so many words, but in
  meaning) is a metaphor that relates to the "sufficiently smart compiler",
  and that it is not directly related to any actual assistance.  it's more
  like "would it hamper the smart compiler's ability to be as smart as it
  could be", or, as David put it "do the right thing".  I don't think so,
  but it's a good question, nonetheless.  Rob pointed out that releasing
  the hold on the objects might help (again, metaphorically) the garbage
  collector pick up dead objects earlier, although it is hard for me right
  now to imagine how this could b affected: scope analysis would cause the
  bindings to go out of scope either way, and if these variables were in
  call-frame slots or registers, they wouldn't necessarily be any more
  garbage unless these slots were explicitly set to nil or something
  similarly drastic (because the savings would be so limited compared to
  the cost of doing this all over the place).

| Making a hard-and-fast rule about this would lead to ridiculous coding
| style if taken to the limit.

  I'll trust readers of hard-and-fast rules to exercise their judgment and
  not take things to ridiculous limits.

  I think the question merits thought -- it's one of those small things
  that it's too easy to waste time on because we're _not_ thinking about
  it, and I for one think this question and questions like it would make it
  a lot easier for more experienced programmers to help new programmers get
  a feel for the language in actual use.  this is the "experience" part
  that you get from reading lots of code and spending your working hours
  among other Lisp programmers.  I think it's nice to see this newsgroup
  assume part of that role, too.