|
Boost : |
From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2004-02-17 11:01:57
Gabriel Dos Reis wrote:
> What I think is: If we accept the principle that scopes should nest,
> then we should accept its logical consequences; if don't want to
> accept those logical consequences, then we should abandon the idea
> that scopes nest. Which one do you want to pick?
I like the idea of nested scopes, still the question is which scopes
should be nested in which order. You seem to imply a contradiction where
I don't see any. It's not the literal order of characters typed that
*must* define the order of scopes, we have the freedom to think about
this from a user's perspective and differ from the strict literal order.
Inconsistent? Maybe, but if it helps to write code in the *sense* of
nested scopes, I'm fine with it. This - of course - opens the question
what this sense is, and I am certainly not qualified to define it. Maybe
Bjarne could clarify what was originally intended. :)
All I can say - and I seem to be consistent with several other folks -
is, that I would like to see the scope for template-parameters be nested
inside the base-class' scope, not outside. A small change which makes
the code more managable by increasing the locality of names from a human
reader's perspective.
> If you think it is wrong, while being consistent with first principle,
> then propose a a new first principle. The worst thing to do, I
> believe, is to introduce barnacled hacks that comes from nowhere.
> We need general rules on which to decide, we don't need barnacled
> hacks that would appear "intuitive" at a moment when we don't have a
> working definition of "intuitive".
I feel accused of "introducing barnacled hacks that come from nowhere".
I don't think you meant to be insulting, but would you mind to assume
that I'm not just seeing things from such a narrow perspective? I could
also assume you are just "blindly applying rules without looking at the
consequences" - but I think you have better reasons for your POV.
I am actually trying to see where the idea of nested scopes comes from
and what purpose it fulfills. This purpose is IMHO to keep the code
readable with the smallest amount of code involved and the least number
of interactions between the names of different scopes. This keeps the
code readable, maintainable, etc. and leads to fewer surprises. In that
sense, the current order of nesting scopes is consistent with the pure
logic of nested scopes applied, but it's IMHO against the spirit of
nested scopes.
> If the scope of the template-parameters should come after the scope
> of base classes -- that is the way I understand you "is closer" --
> then one would not be able to use template-parameters in base classes.
I don't understand this. The scope of the base classes identifiers is
not the scope where the base classes of a class are enumerated.
Regards, Daniel
-- Daniel Frey aixigo AG - financial solutions & technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk