Content deleted Content added
Citation bot (talk | contribs) Add: website, pages, issue, volume, s2cid. Formatted dashes. | Use this bot. Report bugs. | Suggested by Abductive | #UCB_toolbar |
m →Supported languages: The Corinna OOP project for Perl is making traits native to the language. |
||
Line 59:
* [[Lasso (programming language)|Lasso]]<ref>{{cite web | url=http://lassoguide.com/language/traits.html | title=Traits | website=Lasso Language Guide | publisher=LassoSoft | date=January 6, 2014 | access-date=January 23, 2016}}</ref>
* [[OCaml]]: Traits can be implemented using a variety of language features: module and module type inclusion, functors and functor types, class and class type inheritance, et cetera.
* [[Perl]]: Called ''roles'', they are implemented in Perl libraries such as [[Moose (Perl)|Moose]], Role::Tiny and Role::Basic. Roles are part of the sister language [[Raku (programming language)|Raku]]. <ref>{{cite web | url=http://www.modernperlbooks.com/mt/2009/04/the-why-of-perl-roles.html | title=The Why of Perl Roles | author=chromatic | date=April 30, 2009 | access-date=January 23, 2016}}</ref> With the acceptance of the ''Corinna OOP Proposal''<ref>{{cite web | url=https://github.com/Ovid/Cor/blob/master/rfc/mvp.md | title=Corinna OOP Proposal | website=Corinna RFC | author=Curtis "Ovid" Poe | access-date=September 30, 2022}}</ref> Perl will have roles native to the language as part of a modern OOP system.
* [[PHP]]: Since version 5.4,<ref>{{cite web | url=http://www.php.net/manual/en/language.oop5.traits.php | title=Traits | website=PHP Documentation | publisher=The PHP Group | access-date=January 23, 2016}}</ref><ref name="php:rfc:horizontalreuse">{{cite web | last=Marr | first=Stefan | title=Request for Comments: Horizontal Reuse for PHP | url=https://wiki.php.net/rfc/horizontalreuse | website=PHP.net wiki | publisher=The PHP Group | date=January 9, 2011 | access-date=January 31, 2011}}</ref> PHP allows users to specify templates that provide the ability to "inherit" from more than one (trait-)class, as a pseudo [[multiple inheritance]].
* [[Python (programming language)|Python]]: Via a third-party library,<ref>{{cite web | url=http://py3traits.readthedocs.org/ | title=py3traits Documentation | first=Teppo | last=Perä | access-date=January 23, 2016}}</ref><ref>{{cite web | url=https://github.com/Debith/py2traits | title=py2traits | first=Teppo | last=Perä | website=[[GitHub]] | access-date=January 23, 2016| date=2015-03-25 }}</ref> or via higher-order mixin classes<ref>{{cite web | url=http://stupid-python-tricks.blogspot.com/2015/04/computed-properties-and-higher-order.html | title = Higher Order Mixin Classes | archive-date = 2016-10-09 | archive-url = https://web.archive.org/web/20161009062141/http://stupid-python-tricks.blogspot.com/2015/04/computed-properties-and-higher-order.html }}</ref>
|