Subject: Re: Comments in LISP (was Re: Which one, Lisp or Scheme?)
From: Erik Naggum <erik@naggum.no>
Date: 1997/02/04
Newsgroups: comp.lang.lisp,comp.lang.scheme
Message-ID: <3064008491602501@naggum.no>


* Erik Naggum
| I find the issue of comments to be simple.  if you need them, you bind
| the semicolon and the sharp vertical bar to reader macro functions that
| return an object of the appropriate comment type, which also prints as a
| comment in the usual syntax.  your codewalkers then need to learn to skip
| such objects.  shouldn't be too hard.

* Barry Margolin
| If the comments aren't removed by the reader, how do you ensure that all
| user-written and third-party macros don't see them?  Common Lisp (and most
| Lisp-family languages) doesn't have a standard interface to the code
| walker, so you can't depend on that to remove them.

I think macroexpansion sees the code qua code, so if you submit something
for macroexpansion, you must remove the comments.  I also need to clarify
what I meant by "codewalker".  I assume that in an editing setting, a
different kind of code walker is needed than in a compilation setting, and
that never the twain shall meet.  in essence, I see editing and compiling
code as very different tasks.  e.g., during editing whitespace means a lot,
during compiling it means nothing.  in fact, during editing, a whole lot of
issues come up that don't in compiling.  another example is the #+ and #-
reader macros.  they must be retained in an edited function.  I think
comments are just a special case of the many differing needs, and that we
delude ourselves if we think that executing directly from an editable form
of the code is going to be much simpler than reading forms from a file.

#\Erik
-- 
1,3,7-trimethylxanthine -- a basic ingredient in quality software.