Clojure Protocols & expression problem

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Apr 28 16:34:44 PDT 2010


On 04/28/2010 06:28 PM, retard wrote:
> Wed, 28 Apr 2010 13:22:53 -0400, bearophile wrote:
>
>> BCS:
>>
>>> Could you elaborate on what exactly the expression problem is?<
>>
>> I am far from being an expert on such matters, I will do what I can to
>> answer. It's not an esoteric problem, if you program with an OO language
>> you have probably faced it sometime.
>
> You failed to mention that the OOP solution is in many cases overly
> complex. When you don't need to subclass the car elements, a functional
> pattern matching happens to win - at least if the declarativeness of code
> matters. The implementation can also use jump tables so it becomes faster
> than double dispatch. Luckily D is never going to get algebraic data
> types so you can all stop reading this post right here.

I'm having trouble picturing the following scenario for a day in life.

* Wake up

* Shave

* Eat

* Drink coffee

* Go to work

* Do cool stuff

* Spend time reading and posting one bitter remark after another on a 
newsgroup dedicated to a language that I hate, I'm not required to use, 
I have no interest to see succeed, and I strongly believe breaks just 
about every single principle of good language design

* Back home

* Fun with girlfriend, wife, kids, TV, pet projects, etc.

* Eat

* Beer

* Sleep

One of these things is unlike the others!


Andrei



More information about the Digitalmars-d mailing list