[racket] Code Reuse, Object Oriented vs Functional

From: Ray Racine (ray.racine at gmail.com)
Date: Fri Jun 21 11:23:24 EDT 2013

The Internet is rife with stuff regarding the Expression problem.  Pretty
much any major language has some posting, paper or article on how it is
addressed to some degree by the language in question.

http://en.wikipedia.org/wiki/Expression_problem

It's a can I have my cake and eat it too issue.

"add new cases to the datatype and new functions over the datatype, without
recompiling existing code, and while retaining static type safety"

You sorta get one and not the other respectively in Functional vs OO.  The
trick is we all want both damn it.

FWIW, Scala with its "Type Class" and implicit conversions gets fairly
close, but its a bit heavy handed.


On Fri, Jun 21, 2013 at 9:55 AM, Hendrik Boom <hendrik at topoi.pooq.com>wrote:

> On Fri, Jun 21, 2013 at 09:39:12AM -0400, Ray Racine wrote:
> ...
> >
> > 4) The Expression Problem
> >    For whatever reason one can code in OO without ever noting the
> > expression problem.   After a bit of functional programming you note it,
> > even if you don't know what it's been called or the dual nature of the
> > issue in OO land.  Once you know of it you'll start noting its dual side
> in
> > OO.
> ...
>
> Care to describe the Expression Problem  and its dual?  I'm  not
> familiar with the term.
>
> -- hendrik
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130621/76a91d14/attachment.html>

Posted on the users mailing list.