[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

traits question

Its Me

10/3/2006 5:20:00 PM

Why does traits use an instance variable to indicate that a value has been
set? Why not use a sentinel value (e.g. some object private to traits
itself)?

Thanks.


14 Answers

ara.t.howard

10/5/2006 2:29:00 PM

0


itsme213 wrote:
> Why does traits use an instance variable to indicate that a value has been
> set? Why not use a sentinel value (e.g. some object private to traits
> itself)?
>
> Thanks.

the main reason:

module Traits
PER_OBJECT_SENTINELS = Hash.new
...
end

memory_leak = lambda do
obj = Object.new
obj.trait 'setting_would_update_sentinel'
obj.setting_would_update_sentinel = 'we have to be careful when obj
is destroyed...'
end

regards.

btw - this message shows up in google groups, but not via mailing
list... am i the only one who noticed?

-a

Trans

10/5/2006 3:12:00 PM

0


ara.t.howard@gmail.com wrote:
> itsme213 wrote:
> > Why does traits use an instance variable to indicate that a value has been
> > set? Why not use a sentinel value (e.g. some object private to traits
> > itself)?
> >
> > Thanks.
>
> the main reason:
>
> module Traits
> PER_OBJECT_SENTINELS = Hash.new
> ...
> end
>
> memory_leak = lambda do
> obj = Object.new
> obj.trait 'setting_would_update_sentinel'
> obj.setting_would_update_sentinel = 'we have to be careful when obj
> is destroyed...'
> end
>
> regards.
>
> btw - this message shows up in google groups, but not via mailing
> list... am i the only one who noticed?

Hmm... was it posted via comp.lang.ruby or ruby-talk-google?

T.

Ara.T.Howard

10/5/2006 3:21:00 PM

0

Martin Coxall

10/5/2006 3:31:00 PM

0

> On Fri, 6 Oct 2006, Trans wrote:
>
> > Hmm... was it posted via comp.lang.ruby or ruby-talk-google?
>
> dunno. who can decipher this:
>
> http://groups.google.com/group/comp.lang.ruby/msg/83b498dce4c5c64f?dm...

That looks like a UUCP bang path. The message appears to have been
sent from 1978.

Martin

Ara.T.Howard

10/5/2006 3:37:00 PM

0

Martin Coxall

10/5/2006 3:42:00 PM

0

> > That looks like a UUCP bang path. The message appears to have been
> > sent from 1978.
> >
> > Martin
>
> where are you pulling the 1978 bit from?

That was just a joke. 1978 or thereabouts was when usenet first
started shifting from UUCP to NNTP.

I gather by the existence of the bang path that it was sent to the
newsgroup, not the mailing list.

Martin

Ara.T.Howard

10/5/2006 3:58:00 PM

0

ts

10/5/2006 4:03:00 PM

0

>>>>> "a" == ara t howard <ara.t.howard@noaa.gov> writes:

a> k. so this is evidence that the gateway isn't working properly again... ;-(

Well, no for me your post ("traits question") is

[ruby-talk:218159]

and your message "mailing list problems?" is

[ruby-talk:218158]

:-)



Guy Decoux


James Gray

10/5/2006 4:15:00 PM

0


On Oct 5, 2006, at 11:03 AM, ts wrote:

>>>>>> "a" == ara t howard <ara.t.howard@noaa.gov> writes:
>
> a> k. so this is evidence that the gateway isn't working properly
> again... ;-(
>
> Well, no for me your post ("traits question") is
>
> [ruby-talk:218159]

Ara wants to know where the original of this message is.

James Edward Gray II

Ara.T.Howard

10/5/2006 4:18:00 PM

0