[Laszlo-dev] For Review: Change 41430 Summary:Experimental traits implementation for lps-dev

Adam Wolff adam at laszlosystems.com
Thu Apr 13 14:56:04 EDT 2006


I have a strong peference for traits="" extends="" rather than combining 
them. Since traits are mixins, it doesn't seem like they are superclasses 
(even though they are.) Also, the rule that only the last element in the 
list can be a class strikes me as arbitrary.

A

On Apr 13, P T Withington wrote:

> On 2006-04-13, at 12:43 EDT, Jim Grandy wrote:
> 
> >> In my prototype, I just used the superclass parameter to pass  
> >> traits:  if it is a list, all but the last element are traits and  
> >> the last is the superclass.  I liked this because it expresses the  
> >> precedence of the traits/superclass.  Maybe that is a better  
> >> syntax than having a separate traits list?
> >>
> > I'm not sure. I like that it shows the precedence, but having just  
> > a list of terms with the last one a class doesn't expose the traits- 
> > followed-by-class structure very well -- it's tough to read if you  
> > are new to the language. Maybe if the traits were comma-delimited,  
> > but there was a colon between traits and class?
> >
> > <class name="activeview" extends="drawable, clickable, draggable :  
> > view"/>
> >
> > I should point out that this list order is the opposite of what it  
> > is in the current proposal, but it reads well: the traits sit  
> > between the class being declared and its superclass.
> 
> I like the comma separation, not the colon, I think it enough that  
> the class is the final element.  It would be an error to have a a  
> class in other than the final element or a class as other than the  
> final element.
> 
> Anyone else have an opinion?
> _______________________________________________
> Laszlo-dev mailing list
> Laszlo-dev at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
> 


More information about the Laszlo-dev mailing list