Top "Traits" questions

In computer programming, a trait is a collection of methods, used as a "simple conceptual model for structuring object oriented programs"

What is Scala's Comparable trait?

I am searching for Scala counterpart of C# IComparable, and I found Comparable trait. I mean -- Comparable is mentioned, …

scala comparable traits
Is there any trait that specifies numeric functionality?

I'd like to use a trait to bound a generic type, like this hypothetical HasSQRT: fn some_generic_function<…

rust numeric generic-programming traits
PHP traits - change value of static property in inherited class

So, this is my trait: trait Cacheable { protected static $isCacheEnabled = false; protected static $cacheExpirationTime = null; public static function isCacheEnabled() { return …

php inheritance properties traits redefinition
how to get used traits in php-class?

Is there any function in PHP (5.4) to get used traits as array or similar: class myClass extends movingThings { use bikes, …

php oop traits
Building a Singleton Trait with PHP 5.4

We recently had a discussion if it was possible to build a trait Singleton PHP Traits and we played around …

php traits
Is it possible to access struct fields from within a trait?

Traits are used to group some functions to be implemented from a struct, but is it possible to access struct …

oop rust traits
Why can't a class extend traits with method of the same signature?

Why do I get the error below? How to workaround it? I assumed that since A and B compile to (…

scala overriding traits
Traits in javascript

How can I implement traits in javascript ?

javascript prototype traits
php5.4 autoloading traits

Are traits in php5.4 subject to autoloading? I've not yet got an environment to test in, but I can't see …

php autoload traits
What makes something a "trait object"?

Recent Rust changes have made "trait objects" more prominent to me, but I only have a nebulous grasp of what …

rust traits trait-objects