Maybe 'scoped' instead of 'scope'?
Andrei Khropov
andkhropov at nospam_mtu-net.ru
Fri Jul 28 04:08:52 PDT 2006
<IMHO>
I recently thought about using 'scoped' instead of 'scope'.
Yes, it's one extra letter but improved readability (IMHO):
----------------------------------------------------
scope i = 1; // is read like 'i is a scope'
----------------------------------------------------
scoped i = 1; // is read like 'i is scoped'
----------------------------------------------------
and
----------------------------------------------------
scope class Bar{ ...
----------------------------------------------------
scoped class Bar{ ... // is read like 'Bar is a scoped class'
----------------------------------------------------
and current uses of scope are also replaced (also it's consistent with the form
'synchronized')
:
----------------------------------------------------
scope(exit) Statement
scope(success) Statement
scope(failure) Statement
----------------------------------------------------
changed to
----------------------------------------------------
scoped(exit) Statement // is read like 'this statement is scoped at exit'
scoped(success) Statement
scoped(failure) Statement
----------------------------------------------------
(there's no 'scoped' verb in English AFAIK but it looks very natural and
understandable)
</IMHO>
Does anybody use 'scoped' as identifier?
--
AKhropov
More information about the Digitalmars-d
mailing list