Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is DOES too overloaded?

 
Post new topic   Reply to topic    Bay Six Software Forum Index -> ViviFire language
View previous topic :: View next topic  
Author Message
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 728

PostPosted: Aug 2nd, 2015, 4:59pm    Post subject: Is DOES too overloaded? Reply with quote

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
View user's profile Send private message Send e-mail
STPendl
Full Member


Joined: 20 Aug 2007
Posts: 161
Location: Austria

PostPosted: Aug 4th, 2015, 9:07pm    Post subject: Re: Is DOES too overloaded? Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Bay Six Software Forum Index -> ViviFire language All times are GMT
Page 1 of 1
Jump to:  
Quick Reply
Username:
Message:
   Shortcut keys: Alt+Q to activate, Alt+P to preview, Alt+S to submit
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



Lo-Fi Version
Powered by phpBB © 2001, 2005 phpBB Group