[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6502 illegal opcodes questions



mdj wrote:
Paul Schlyter wrote:

<snip>

I dondt think one can talk about namespaces at all regarding macros in
preprocessors.  The preprocessor does not know what a namespace is. It
hardly knows anything about the underlying source language.  Heck, you
can even replace reserved words with macros -- try to do THAT using
the global namespace in a normal way.....


Why? Namespaces are a natural extension present in most modern
languages to avoid collisions that occur frequently in larger programs.
Macro's being redefined by included headers from an unrelated piece of
code is a real problem in C/C++ programs.

Of course, most good programmers utilise some form of poor-mans
namespacing by prefixing their preprocessor names with something that's
likely to be unique. This illustrates the point that the feature would
be useful.

In the "olden days", assemblers frequently had HEAD "x" pseudo ops that
would treat all identifiers encountered from then on as if they had an
"x" prefixed to them, until the next HEAD operation.

This didn't produce any visible change in the labels, but it did serve
to create "local" scopes if the HEAD characters were well chosen.

-michael

Parallel computing for 8-bit Apple II's!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it is seriously underused."