From: ianr@cogs.susx.ac.uk (Ian Rogers)
Newsgroups: comp.lang.pop,comp.lang.dylan
Date: 19 Jul 1995 09:19:51 GMT
Scott McKay (swm@com.harlequin) wrote:
> Date: Tue, 18 Jul 1995 01:17:27 -0400
> From: s398960@aix1.uottawa.ca (Patricia Wilson)
> How does one disguish between clutter and a good language design
> proposal? The question applies both to very minor modifications, and
> major ones too.
>
> "Clutter" is stuff that gets added to the language which could have
> been trivially expressed in the language via a very simple macro or a
> very simple function. It's stuff that adds another way to do the same
> thing. Pop-11 is admittedly a cool language -- I've used it, and
> enjoyed using it -- but I don't think that presenting it as a paradigm
> of good modern language design holds much water.
>
> So I stand by my claim. Your proposal just adds stuff of the language
> without enriching it. Your version of 'unless' is exactly 'if ~'; In
> fact, I proposed flushing Dylan's existing version of 'unless' for the
> same reason. Write a macro.
But what is the difference between a macro that everybody uses and a
genuine part of the language?
They have different maintainers? (I wouldn't use this macro, btw,
since I think it would make my code less readable. I also avoid plain
old UNLESS in Lisp because I find it harder to think about than WHEN
NOT, for some reason. Go figure.)
This is a slightly philosophical question, but imagine the following
scenario: Somebody uses the following macros in their programs
#define unless if ~
#define elseunless elseif ~
[or whatever the syntax is in Dylan. I haven't the faintest idea]
and several other people see this as a really good symmetry in the
language and include it in their programs, and so on. The macros spread
until they get placed in a standard utility header file that everybody
uses by default. The macros may even become documented and written into
textbooks.
You now have a language construct that _looks_ like it's a first class
citizen but is really just a yucky hack.
But it won't look like a 1st class citizen, because you'll have to
import it from some module called Yucky-Hacks.
When the compiler throws up
syntax error messages it will think it's just compiled a "if ~ ..." (as
the pre-processor will have stripped out the "unless"). The error message
will mention the "if ~ ...", to provide "helpful" context to the
programmer, but the programmer is likely to get very lost as their program
contains "unless" (and the macro has become so pervasive that no-one
remembers it's a macro).
It's for this last reason that "good" language constructs should be built
into the explicit syntax of the language, even if they can be implemented
using macros.
Well I guess you have a point, but it seems to me what you're really
doing is working around a bad (hypothetical) programming environment,
which has given you no way to debug macros effectively. And even if
you move many common idioms into the language proper you'll still have
the problem you mention with other macros.
I don't know how difficult it is to make a debugger handle macros
gracefully but it seems like this would be the right way to handle the
problem. How hard is this to do? Is it standard technology now, or
not yet?
-Carl
|