|
Bay Six Software Beyond the Basics
|
View previous topic :: View next topic |
Author |
Message |
Brent Site Admin
Joined: 01 Jul 2005 Posts: 800
|
Posted: Aug 2nd, 2015, 4:59pm Post subject: Is DOES too overloaded? |
|
|
I was recently working on the syntax for aliasing of methods that get imported through traits. In case you don't know, traits are blocks of methods that you can pull into a class and they become part of the class as if they were declared by the class itself. A problem can arise if names conflict, so you need a way to resolve the conflict, and renaming a method is the usual route.
Currently, ViviFire uses the Does keyword to specify the traits to import:
Class myClass Does someBehavior
So then I thought that creating an alias would best resemble this construction, and I came up with this:
Method newName Does someBehavior.nameConflict
where nameConflict is defined by someBehavior.
One problem I can see with this is how similar it is to the syntax for an event handler:
Sub myEventHandler Does someEvent ' ... End Sub
So, I'm strongly considering changing this use of Does to something like Handles:
Sub myEventHandler Handles someEvent
But then, these are not all of the uses of Does. There is a list at www.b6sw.com/ViviFire/docs/Keywords.html#Does.
Questions and comments are welcomed. _________________ Brent |
|
Back to top |
|
|
STPendl Full Member
Joined: 20 Aug 2007 Posts: 161 Location: Austria
|
Posted: Aug 4th, 2015, 9:07pm Post subject: Re: Is DOES too overloaded? |
|
|
I think it is good to reduce the overload of the Does keyword. _________________ Stefan
Any code I post can be freely used, just give credit. |
|
Back to top |
|
|
|
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|