• The poor you will always have with you...its the rich SOBs you gotta watch out for.

  • Its a sign of crappy government: [bigboxofpaints.wordpress.com/2017/12/2...](https://bigboxofpaints.wordpress.com/2017/12/23/i-hate-tsa-precheck/)

  • A swift nugget: 

    I had the occasion where I wanted to create a generic collection of things with the initializer taking a comparison operator.  But then I also wanted to have the default behavior be “meh”, and return that the items were always equal.  This is what I came up with:

     

    struct GenericCollection<T> {

        

        var values: [T]

        typealias tComparator = (T?,T?) -> ComparisonResult

        var precendenceFunction: tComparator

        

        static func meh(_:T?, _:T?) -> ComparisonResult {

            return .orderedSame

        }

        

        init(comparator: @escaping tComparator = GenericCollection<T>.meh) {

            precendenceFunction = comparator

            values = []

        }

     }

     

    I went through a number of iterations with something like this:

     

    func meh<U> (_:U?,_:U?) -> ComparisonResult {

        return .orderedSame

    }

     

    struct GenericCollection<T> {

        

        var values: [T]

        typealias tComparator = (T?,T?) -> ComparisonResult

        var precendenceFunction: tComparator

        

        init(comparator: @escaping tComparator = meh<T>) {

            precendenceFunction = comparator

            values = []

        }

     }

     

    but couldn’t avoid a "Cannot explicitly specialize a generic function” error.  Somehow I wish a generic meh<U> strategy would work — if anyone knows how to do that, let me know!

  • “HomePods” is an anagram of “Dope Ohms” #WWDC

  • Minimum wage laws are ‘anti-dumping’ provisions for labor.

  • “It takes courage not to be discouraged.” - Benjamin Ferencz

  • Well this is interesting:  “Modern version of Frontier"

  • Just read the Stephens column in New York Times.  I don’t want to cancel my totally useless subscription, so I’m getting a puppy.

  • Day one of a new era. Feels great!

subscribe via RSS