On Nov 30, 2006, at 4:58 PM, Daniel Stenning wrote:
On 30/11/06 22:03, "Charles Yeomans" <[EMAIL PROTECTED]> wrote:
Concerning extensions, I submitted an FR some time back to allow us
to group
all extension methods for a particular type or class and deal with
them as
one entity. Rather than have lots of extends functions all over the
place,
give RB the ability for us to create a special "extension" module
where one
specifies just ONCE - which type/class is being extended and then
just add
function definitions within the module without having to add the
"extends"
keyword etc to every function individually.
Why?
1) to save time when creating many extension functions for the same
type
2) permit us to group together related extension functions and
then specify
which of those we want to use "en masse". This is somewhat similar to
Objective C "Categories".
So for example we could have such a module extending the String
datatype
which contained many extension methods for spellchecking. It would
then be
able to specify in code or in the project editor that a particular
class or
class instance adopts all methods in the spell-checking extension
module.
To go along with this idea there ought to be be some kind of syntax
in code
( "using" etc ) to allow classes to be instantiated that only adopt
the
extensions from the modules mentioned -
For example:
dim c as myClass extendwith myClassExtensionModule1,
myClassExtensionModule1
Of course for the above to work there would have to be an
"optional" flag
for these new kinds of extension modules, in order to be able to
specify
which modules AUTOMATICALLY extend EVERY class/type of the module
or whether
the extension has to be specifically added in code.
Flags signal complication.
Hardy. Its would just be a simple check box to indicate whether this
"extension" module extends EVERY class/type specified in the module
( string
in the above example ) or extends only when specifically stated in
the code.
Hardly rocket science. And avoids a lot of cases where previously
one would
have had to resort to inheritance.
Sounds to me like the exact reason you'd want to have differing
subclasses
As for a module that contains many related extends methods you can
already do this for yourself quite easily.
If there were no way for you to do this I'd agree. But there is.
Discipline.
I'd like to see REAL add those things that I have NO way to achieve
currently using RB.
That is much more enabling IMHO
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>