juan_gandhi: (Default)
[personal profile] juan_gandhi
package scalakittens

/**
* A trait that describes a goodness of data or outcome or something
*
* Created by vpatryshev on 10/18/15.
*/
trait Goodness:
def isGood: Boolean
def isBad: Boolean = !isGood

trait PositiveAttitude extends Goodness { def isGood = true }
trait NegativeAttitude extends Goodness { def isGood = false}

Date: 2021-06-16 09:30 pm (UTC)
From: [personal profile] sassa_nf
:)

def isGood: Boolean = !isBad
def isBad: Boolean = !isGood

Date: 2021-06-17 03:08 am (UTC)
lomeo: (Default)
From: [personal profile] lomeo
+1
The only thing that should be mentioned is that, in that case, we gain some convenience by giving up some compiler guarantees. If we'd be able to force one of these methods to be implemented, it'd be way better.

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718 1920 21
22232425262728
2930     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 27th, 2025 05:31 pm
Powered by Dreamwidth Studios