[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[RFC] traits-0.1.0

Ara.T.Howard

5/10/2005 4:15:00 PM

3 Answers

Ilias Lazaridis

5/10/2005 9:06:00 PM

0

Ara.T.Howard wrote:
>
> i'm having quite a time deciding what to do with traits. i first
> released as 'attributes' but some complained that
>
> attribute 'foo'
>
> and
>
> class_attribute 'bar'
>
> were just too long. to remedy that i switched to 'trait' - a synonym
> for attribute. however, as it's been pointed out, that name
> currently has a meaning in cs to some people. my current thoughts
> are
>
> random thoughts for traits/against attributes:
>
> - trait is short

and used within C++

> - traits is a synonym for attribute (attr, attr_accessor, etc)

no need to use a synonym.

[...]

> random thoughts for attributes/against traits
>
> - no confusion with other traits

yes

> - the alias 'has' can make 'attribute' plenty short (the current
> version of traits uses this alias too btw.)

yes

> one other thing, the impl of traits was suprisingly hard. the tricky
[...]

The code fragments (usage) I've saw are not thus attractive.

Code should looks simpler, more 'natural'.

-

This is an important project, but should be setup collaborative.

So, if you setup a ruby-forge project, people can contribute.

call it "attributes" or "attrib" or "has" - but not "traits".

> ps. urls for project:
>
> http://raa.ruby-lang.org/search.rhtml?sea...
> http://codeforpeople.com/lib/r...
>
> -a

.

--
http://laz...

Ara.T.Howard

5/10/2005 9:47:00 PM

0

Ilias Lazaridis

5/12/2005 1:14:00 AM

0

Ara.T.Howard@noaa.gov wrote:
> On Wed, 11 May 2005, Ilias Lazaridis wrote:
>
>>> - trait is short
>>
>> and used within C++
>
> hmm.
>
>>> - traits is a synonym for attribute (attr, attr_accessor, etc)
>>
>> no need to use a synonym.
>
> i mean it's meaning is the similar to 'attr :a == trait :a'.

I mean: no mean to use (and search) a synonym

>> [...]
>>
>>> random thoughts for attributes/against traits
>>>
>>> - no confusion with other traits
>>
>> yes
>
> but are the other traits being used? also these seem to be called roles in
> some langs too... this is a valid concern though.

again: no need to research.

>>> - the alias 'has' can make 'attribute' plenty short (the current
>>> version of traits uses this alias too btw.)
>>
>> yes
>>
>>> one other thing, the impl of traits was suprisingly hard. the tricky
>>
>> [...]
>>
>> The code fragments (usage) I've saw are not thus attractive.
>>
>> Code should looks simpler, more 'natural'.
>
>
> what do you think could be more natural than
>
> class C
> has 'a' => 42
> end

class C
a = 42
end

class C
var a = 42
end

> c = C::new
> p c.a #=> 42
>
> or
>
> class AbstractWidget
[...]

> class SmallishBlueWidget
[...]

I dislike all this, but cannot clarify why.

concept, ruby, flexibility

> it's the best i could manage. come up with something more natural and i'll
> see what i can do to implement.
>
>> This is an important project, but should be setup collaborative.
>
> i'm working 70+ hours per week already - but if someone wants to take
> over and do the initial setup work it's fine with me.

I think you should postpone this project.

>> So, if you setup a ruby-forge project, people can contribute.
>
> this is welcome of course - but see above.
>
>> call it "attributes" or "attrib" or "has" - but not "traits".
>
> +1 for attributes then.

ok

.

--
http://laz...