This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||
|
Decided to change this page to include more information, more language samples, and hopefully a less ruby vs python feel. Both have features which make them "close" to "proper" UAP, but neither gets it completely right. I think this is, mostly, because Bertrand's idea of "right" is emboddied in the Eiffel programming language, which no one else has stolen enough of (sic) to get UAP completely in another language.
I'll be adding Java and a few other languages that are OO-like to show varying degrees of UAP.
Mattreynolds 18:52, 3 March 2006 (UTC)
I contest that Ruby does not have strict UAP. There is only one way to access properties of an Object: Methods. Even the c2-wiki states this. The attr_reader in the code sample is not even syntactic sugar, just a method generating the accessor method dynamically. The Ruby interpreter itself has no idea of what an attribute is. Access to an instance variable is always hookable. I just glanced over it, but I find nothing in Bertrands column that is not present in Ruby. —Preceding unsigned comment added by 142.162.19.124 ( talk) 04:43, 29 November 2009 (UTC)
First of all people, a language does not 'enforce' UAP. It either implements (follows) it or it doesn't. Its a property of the language, not of code implemented in the language.
That said, it may be beneficial to have a Common Lisp example. As I'm not really familiar with the language, I can't say for sure whether, or to what extent, that it follows the UAP. An example should have a class that has both a method and an attribute. The example should show how the method is invoked, and should show how the attribute is set. If both of these types of access have THE SAME SYNTAX, then the language follows the UAP (original). If not, it may be that this is something like RUBY where attribute access is always through a function that is generally automatically generated, but which can be reimplemented. In which case it would follow the revised UAP.
The important thing here is syntax. The UAP is all about syntax. A comment about something being 'syntactical sugar' in the Ruby section indicated the author didn't really understand the UAP. -- Aflafla1 ( talk) 08:39, 17 October 2013 (UTC)
(setf (weight *egg*) 16.9) ;; using the accessor function
(setf (slot-value *egg* '%weight) 16.9) ;; accessing the slot directly
Just to have an example of a language other than Eiffel that does do UAP fully, the
Self programming language perfectly follows Meyer's notion of UAP if I'm not mistaken :)
--
RProgrammer (
talk) 07:56, 5 September 2016 (UTC)
This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||
|
Decided to change this page to include more information, more language samples, and hopefully a less ruby vs python feel. Both have features which make them "close" to "proper" UAP, but neither gets it completely right. I think this is, mostly, because Bertrand's idea of "right" is emboddied in the Eiffel programming language, which no one else has stolen enough of (sic) to get UAP completely in another language.
I'll be adding Java and a few other languages that are OO-like to show varying degrees of UAP.
Mattreynolds 18:52, 3 March 2006 (UTC)
I contest that Ruby does not have strict UAP. There is only one way to access properties of an Object: Methods. Even the c2-wiki states this. The attr_reader in the code sample is not even syntactic sugar, just a method generating the accessor method dynamically. The Ruby interpreter itself has no idea of what an attribute is. Access to an instance variable is always hookable. I just glanced over it, but I find nothing in Bertrands column that is not present in Ruby. —Preceding unsigned comment added by 142.162.19.124 ( talk) 04:43, 29 November 2009 (UTC)
First of all people, a language does not 'enforce' UAP. It either implements (follows) it or it doesn't. Its a property of the language, not of code implemented in the language.
That said, it may be beneficial to have a Common Lisp example. As I'm not really familiar with the language, I can't say for sure whether, or to what extent, that it follows the UAP. An example should have a class that has both a method and an attribute. The example should show how the method is invoked, and should show how the attribute is set. If both of these types of access have THE SAME SYNTAX, then the language follows the UAP (original). If not, it may be that this is something like RUBY where attribute access is always through a function that is generally automatically generated, but which can be reimplemented. In which case it would follow the revised UAP.
The important thing here is syntax. The UAP is all about syntax. A comment about something being 'syntactical sugar' in the Ruby section indicated the author didn't really understand the UAP. -- Aflafla1 ( talk) 08:39, 17 October 2013 (UTC)
(setf (weight *egg*) 16.9) ;; using the accessor function
(setf (slot-value *egg* '%weight) 16.9) ;; accessing the slot directly
Just to have an example of a language other than Eiffel that does do UAP fully, the
Self programming language perfectly follows Meyer's notion of UAP if I'm not mistaken :)
--
RProgrammer (
talk) 07:56, 5 September 2016 (UTC)