[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

[ANN] RubyTraits 0.1

Robert Dober

10/15/2007 9:40:00 AM

Hi list

I have just released ruby-traits v0.1. This are Traits in pure Ruby 1.8.
Have fun.

----------------------------------------------------------------------------------------
Traits for Ruby
==========

Traits are Composable Units of Behavior, well that is the
academic title,

For Rubiests the following would be a good definition:

Mixins with Conflict Resolution and a Flattening Property
allowing to avoid subtle problems like Double Inclusion and
calling method x from Mixin L while we wanted method x from
Mixin N.
There is some (extra/nice?) composition syntax too

For details please refer to:
http://portal.acm.org/ft_gateway.cfm?id=1028771&type=pdf&coll=GUIDE&dl=GUIDE&CFID=7912496&CFTOKE...
which is a PhD thesis defining traits formally.

And yes Traits are implemented in Squeak 3.9.

In practice Traits enable us to:
* get a RuntimeError when we call a method defined by
more than one trait.
These conflicts can be resolved by redefining the method.
* avoid any double inclusion problem.
* compose Traits
* alias methods during Trait Composition
* resolve super dynamically (mentioned for completeness, Ruby modules
can do this too, of course ;)

Examples:
t1 = trait { def a; 40 end }
t2 = Trait::new{ def a; 2 end }
c1 = Class::new {
use t1, t2
}
c1.new.a --> raises TraitsConflict

conflicts can be resolved be redefinition, and aliasing can be used for
access to the overriden methods. All this can be combined
with traits composition.
t = ( t1 + { :a => :t1_a } ) + ( t2 + {:a => :t2_a } )
c2 = Class::new {
use t
def a; t1_a + t2_a end
}
c2.new.a --> 42

5 Answers

Trans

10/15/2007 10:53:00 AM

0



On Oct 15, 5:40 am, "Robert Dober" <robert.do...@gmail.com> wrote:
> Hi list
>
> I have just released ruby-traits v0.1. This are Traits in pure Ruby 1.8.
> Have fun.
>
> ---------------------------------------------------------------------------­-------------
> Traits for Ruby
> ==========
>
> Traits are Composable Units of Behavior, well that is the
> academic title,
>
> For Rubiests the following would be a good definition:
>
> Mixins with Conflict Resolution and a Flattening Property
> allowing to avoid subtle problems like Double Inclusion and
> calling method x from Mixin L while we wanted method x from
> Mixin N.
> There is some (extra/nice?) composition syntax too
>
> For details please refer to:
> http://portal.acm.org/ft_gateway.cfm?id=1028771&type=pdf&coll=G......
> which is a PhD thesis defining traits formally.
>
> And yes Traits are implemented in Squeak 3.9.
>
> In practice Traits enable us to:
> * get a RuntimeError when we call a method defined by
> more than one trait.
> These conflicts can be resolved by redefining the method.
> * avoid any double inclusion problem.
> * compose Traits
> * alias methods during Trait Composition
> * resolve super dynamically (mentioned for completeness, Ruby modules
> can do this too, of course ;)
>
> Examples:
> t1 = trait { def a; 40 end }
> t2 = Trait::new{ def a; 2 end }
> c1 = Class::new {
> use t1, t2
> }
> c1.new.a --> raises TraitsConflict
>
> conflicts can be resolved be redefinition, and aliasing can be used for
> access to the overriden methods. All this can be combined
> with traits composition.
> t = ( t1 + { :a => :t1_a } ) + ( t2 + {:a => :t2_a } )
> c2 = Class::new {
> use t
> def a; t1_a + t2_a end
> }
> c2.new.a --> 42

This is very similar to traits.rb in Facets. But Facets does this with
regular modules, not special Traits class.

So how are you composing these traits? Is it delegation or code
injection?

T.


Robert Dober

10/15/2007 11:28:00 AM

0

On 10/15/07, Trans <transfire@gmail.com> wrote:
>
>
> On Oct 15, 5:40 am, "Robert Dober" <robert.do...@gmail.com> wrote:
> > Hi list
> >
> > I have just released ruby-traits v0.1. This are Traits in pure Ruby 1.8

Student

2/19/2012 2:50:00 PM

0

mirjam wrote:
>
>> Any Jew who tells them the truth about themselves like Kostler is in danger
>> of being murdered by the Zionist cult.
>
> Mr Student
> how does one murder a man who is already dead for 30 years ???
>
>
==================================

THE MYSTERIOUS ARTHUR KOESTLER

http://aangirfan.blogspot.com/2010/02/mysterious-arthur-koe...

[...]

According to Koestler 95% of all Jews in the world are descended from Eurasian Khazar converts to Judaism.

Allegedly, "Arthur Koestler and his wife were killed by Mossad shortly after releasing this book...

"In 1983, the lifeless bodies of Arthur Koestler and his wife were found in their London home.

"Despite significant inconsistencies, the police ruled their death a suicide."

[...]

dsharavi

2/19/2012 5:45:00 PM

0

On Feb 18, 10:47 pm, Student <stud...@yahoo.com> wrote:
> The jury is out - are the Jews or the Palestine are  fakes human beings?

Typical antisemitic nonsensical non-response: don't present facts
supportive of or in opposition to the subject. Just change it
quickly.

> Jews I am convinced are fakes.

"Student", I am convinced, is the product of massive inbreeding
between hyenas and baboons.

dsharavi

2/19/2012 6:23:00 PM

0

On Feb 19, 6:50 am, Student <stud...@yahoo.com>wrote:
>mirjam wrote:
>>>Any Jew who tells them the truth about themselves
>>>like Kostler is in danger of being murdered by the Zionist cult.

>>Mr Student
>>how does one murder a man who is already dead for 30 years ???

Especially one whose death was by suicide.

>==================================
>THE MYSTERIOUS ARTHUR KOESTLER
>http://aangirfan.blogspot.com/2010/02/mysterious-arthur-koe...
>[...]
>According to Koestler 95% of all Jews in the world are descended from Eurasian Khazar converts to Judaism.

According to Koestler, levitation, telepathy, and life after death are
all subjects worthy of massive scientific inquiry.

>Allegedly, "Arthur Koestler and his wife were killed by Mossad
>shortly after releasing this book...

In fact, The Thirteenth Tribe was published in 1971. Koestler was
diagnosed with Parkinson's Disease in 1976; with chronic lymphocytic
leukaemia in 1980, which metasized in 1982. Koestler and his third
wife suicided on 1st March 1983, via massive ODs of booze and
barbituates.

>"In 1983, the lifeless bodies of Arthur Koestler and his wife were found in their London home.
>"Despite significant inconsistencies, the police ruled their death a suicide."
>[...]

WTF "inconsistencies"? Koestler's physical condition had been rapidly
deteriorating; his cancer had begun to metasize; toxicology reports
found lethal levels of alcohol and the then-"recreational drug" Tuinal
[aka "Christmas trees," "rainbows," "beans," "jeebs"], use of which
has been discontinued in the US.

We now return to the regularly scheduled rant:

Question:
Where are all the "indigenous" Fakestinians?

Answers:

Yaqut ibn-'Abdullah, 13thC:
"Mecca is holy? to? Muslims; Jerusalem is holy only to the Jews"

Ibn Khaldun (c 1377) :
"Jewish sovereignty in the Land of Israel (Syria) extended over 1,400?
years."
"It was the? Jews who implanted the culture and customs of the
permanent? settlement".
"In the East, crafts have established themselves since the days of
ancient Persian, Babylonian, Egyptian, Israelite, Greek and Roman
rule".

Excerpts from
"Palaestina? ex monumentis veteribus? illustrata"
a geographical? survey by Adriaan Reland, 1696
published? by Willem Broedelet, Utrecht, 1714:

"Residents? ? are concentrated?? mainly in the cities:
Jerusalem,? Acre, Safed,? Jaffa, Tiberias? and Gaza.
In? most? cities,?? the? majority of? residents? are? Christians,
Jews. and others, very few? Muslims who generally?
are? nomads who come to work in agriculture or
building.?"
Nablus:? 120 Muslims,? 70 Samaritans
Nazareth:? 700? residents, all Christians
Umm al-Fahm: 50 people, 10 families,? all Christian
Gaza: ?? 300 Jews, 250? Christian
(Jews? engage in agriculture? ,Christians deal
with trade and? transport)
Tiberias: ??? 300 residents,? all Jews.
Safed: 200 residents,?? all Jews
Jerusalem?: 5,000 residents, most of? them (3,500) Jews, the rest?
Christian? (1,000) and Muslim? (500)"

British archaeologist Thomas Shaw, c 1750:
"The land in Palestine is lacking in people to till its fertile soil".

Constantine François Volney, c 1750:
"Palestine is a ruined and desolate land".

William Thackeray, 1844:
"Now [from Jaffa to Jerusalem] the district is quite deserted, and you
ride among what seem to be so many petrified waterfalls. We saw no
animals moving among the stony brakes; scarcely even a dozen little
birds in the whole course of the ride."

British Consul James Finn, 1857:
"The country is in a considerable degree empty of inhabitants and
therefore its greatest need is of a body of population".

W.M. Thomson, 1866:
"How melancholy is this utter desolation. Not a house, not a trace of
inhabitants, not even shepherds, to relieve the dull monotony ... Much
of the country through which we have been rambling for a week appears
never to have been inhabited, or even cultivated; and there are other
parts, you say, still more barren."

Samuel Clemens, The Innocents Abroad, 1867:
"There is not a solitary village throughout its whole extent, not for
thirty miles in either direction... One may ride ten miles hereabouts
and not see ten human beings. For the sort of solitude to make one
dreary, come to Galilee... Nazareth is forlorn... Jericho lies a
mouldering ruin... Bethlehem and Bethany, in their poverty and
humiliation... untenanted by any living creature."

Samuel Manning, 1874:
"But where were the inhabitants? This fertile plain, which might
support an immense population, is almost a solitude...Day by day we
were to learn afresh the lesson now forced upon us, that the
denunciations of ancient prophecy have been fulfilled to the very
letter -- 'the land is left void and desolate and without
inhabitants.'"

B.W. Johnson, Young Folks in Bible Lands, 1892:
"There are many proofs, such? as ancient ruins, broken aqueducts, and
remains of old roads, which show that it has not always been so
desolate as it seems now. In the portion of the plain between Mount
Carmel and Jaffa one sees but rarely a village or other sights of
human? life. There some rude mills here which are turned by? the
stream. A? ride of half an hour more brought us to the ruins."

Report of the Royal Commission, 1913:
"The area was under-populated and remained economically stagnant until
the arrival of the first Zionist pioneers in the 1880s, who came to
rebuild the Jewish land. The country had remained "The Holy Land" in
the religious and historic consciousness of mankind, which associated
it with the Bible and the history of the Jewish people. Jewish
development of the country also attracted large numbers of other
immigrants, both Jewish and Arab."