You said it was a most basic language feature. I still haven't heard
anything that leads me to believe that statement is correct. What
languages implemented decorators as a most basic language feature?
I was talking about Python, the programming language that is discussed in
this NG.
Python didn't have them for over a decade so it doesn't qualify.
Says who? For further comments, see below.
You said I had to provide a viable alternative. I did that. I haven't
heard of the descriptor protocol.
Where did you do provide that alternative?
One of the problems with "getting" decorators is that they are not in
older books at all and newer books like Beginning Python from Novice
to Professional (c) 2005 Magnus Lie Hetland, that I own, devote almost
nothing to them. Out of 640 pages they are only mentioned
in one paragraph that is in a section titled "Static Methods and Class
Methods",(and followed by a class example with @staticmethod and
@classmethod).
So it seems like Magnus Lie Hetland didn't think they were very
important and he had Professional in his book title.
I consider "core features of a language" the features that are part of the
specification and implementation. Neither do I care if there is anecdotal
evidence of prior usage in other languages, nor who or who not thinks they
are important enough to be dealt with in a book.
And above all, I don't consider the time things have been around _without_
any feature as proof of their irrelevance - or do you consider cars being
not core to western culture because they only have been around about 100
years, whereas horses have been there for thousands of years? Happy riding,
cowboy!
Python 2.4 has been released in 2003, btw - so decorators are around for 4
years now.
So unless you come up with a definition of "core feature of a language" that
someone respectable in the CS-community wrote that features "time being
around" or "random book authors consider worthy" or "persons lacking the
motivation to really dig into do finally get it", I consider your
definition worthless. Agreed?
I'm not against additions on principle.
I certainly wouldn't call them a basic language feature. Java 1.0 came
out in January 1996, Java 1.5 in September 2004. It doesn't appear
that the language designer of Java, James Gosling, is still at the
wheel or BDFL. But yes, Java is showing signs of "complexity creep".
You'll be happy to know that I really dislike the C++ template syntax
and Java has decided to add something similar.
Again, your anecdotal language feature definition is nonsense.
By the way, considering generics and C++-templates as "something similar"
shows the inclined beholder that there are other languages out there you
don't really understand.
Diez