animal

Another dream where I am running on all fours

Had another dream this morning that I was running on all fours. Rather than ask myself, “Why in the world am I doing this?”, I now just accept that I’m a dog (or a cat, or some other animal) in the dream. That helps me go along with whatever is happening in the dream, rather than fight it and wake up.

(Notes from a dream on June 28, 2016)

Running on all fours in a dream

Wow, how embarrassing. It has taken me *years* to realize that when I run on all fours in a dream that I’m actually a dog (or maybe some other four-legged animal).

I finally realized it this morning when I was running like that and came up to a group of human friends, and one said something like, “Hey, look over there, it’s your new friend.”

When I looked in the direction he was pointing I saw a group of people who didn’t look familiar, and a black dog. Just then the dog came running at me. When it got to me it started licking and biting me and I thought, “This dog is crazy, why doesn’t someone get it off of me,” when everything suddenly made sense.

A Scala “Null Object” example

A Null Object is an object that extends a base type with a null or neutral behavior. Here’s the Scala version of the Java example Wikipedia uses to demonstrate this:

trait Animal {
  def makeSound()
}

class Dog extends Animal {
  def makeSound() { println("woof") }
}

class NullAnimal extends Animal {
  def makeSound() {}
}

As you can imagine, later in your application you might have some code like this: