thisCompiler special variable
Stephan Rudlof
sr at evolgo.de
Tue May 23 13:24:37 UTC 2000
Henrik Gedenryd wrote:
>
> Stephen Pair wrote:
>
> > I really think something like this would be very useful, particularly during
> > the development process...and it could also aid users of a framework who
> > want the ability to debug the framework (the author could embed very
> > meaningful debug pragmas into their code without fear of hindering
> > performance). This too is commonly done with C/C++ preprocessors.
> >
> > - Stephen
>
> The performance hit is very minor. A conditional byte code is much less
> expensive than a single message send. So if you just write
>
> Debug ifTrue: [self whatever]
>
> you get all that you need with no dead weight at all. The only problem I see
> is that it clutters the source code, and there asserts are no better.
Idea: It should be possible to introduce a browser mode, which hides
assertions, though, to avoid seeing the cluttering of the source code.
Stephan
>
> > Preprocessors for C/C++ we're an afterthought in that language...and their
> > implementation shows it, but that doesn't say anything about their
> > utility...I can think of few C/C++ programs that don't use preprocessor
> > definitions.
>
> Yes, because you need it there--there's no other way you can do these things
> in C.
>
> I realized in my compiler implementation course that the reason there's a
> preprocessor in C is that it is by far the easiest way to solve a lot of
> compilation problems (for the compiler writer).
>
> Henrik
--
Stephan Rudlof (sr at evolgo.de)
"Genius doesn't work on an assembly line basis.
You can't simply say, 'Today I will be brilliant.'"
-- Kirk, "The Ultimate Computer", stardate 4731.3
More information about the Squeak-dev
mailing list
|