4 ms·
SQL: SELECT Ruby: method_missing JavaScript: function myFunction(){}; myFunction.isAn = 'object' Go: The beautiful simplicity of implementing interfaces, and
by treehau5 10y ago
SQL: SELECT
Ruby: method_missing
JavaScript: function myFunction(){}; myFunction.isAn = 'object'
Go: The beautiful simplicity of implementing interfaces, and multiple return values (besides the concurrency primitives)
interface Thinger {
DoThinger()
}
type Thingy string;
func (t *Thingy) DoThinger() {
// Thingy, which was based of a string, now implements
Thinger. This can get really powerful.
func myFuncCanReturn() (thing1, thing2 Thinger) {};