[Nitro] [ANN] Facets 1.8 (RC)

transfire at gmail.com transfire at gmail.com
Mon Jan 29 04:18:49 EST 2007

On Jan 29, 3:44 am, "George Moschovitis" 
<george.moschovi... at gmail.com> wrote:
> > > so it's a little more complex than your traits implementation.
> > :|
> > oh well, was worth a shotyeah, but how about this:
> class Article
>   def read
>   end
>   trait [:read, :title] => 'Read'  === ann :read, :title => Read
>   trait :controller => ArticleController === ann :self, :controller =>
> ArticleController
> end

hmm... I suppose that might suffice. but what about?

  ann :read, :title => 'Read', :author => 'George'

how would that translate?

also, if you're going to do that, might as well take the next step:

   trait[:read, :title] = 'Read'
   trait[:controller] = ArticleController

but how would you get a list (eg. hash) of traits? Would it be:

   trait[:read]  #=> { :title => 'Read' }

but how would that work with:

   trait[:read]  = SomethingForSelf

would you make it so there couldn't be both? then it's also equivalent 

   trait[:read][:title] = 'Read'

well, accept I'm not sure inhertance can be worked in this notation 
( without a #trait! ). it can work the other way though, eg. 
trait[:read,:title]='Read', b/c we can define the writing method 
distinct from reading method (ie. []= vs. [] ).


More information about the Nitro-general mailing list