commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Jonker <>
Subject Re: [Jelly] Functional Jelly Redux, was Re: Jelly and X++
Date Wed, 12 Feb 2003 15:44:31 GMT

The functional model means far more than "you call functions a lot".  It
means, in particular, that values do not change state.  The entire OO model
is based on imperative notion that an object "has state" and that that state
tends to change over time.  Anything with a setter-method is imperative and
not functional.  By definition, functional objects cannot change state after
they are constructed.  In Java terms, the only functional classes would be
those in which every member variable is declared "final" so it can't change
after construction.

In a (pure) functional language you have the guarantee that for any function
called twice with the same parameters, the result will be the same.  In
other words, f(x) == y at all times.  This is why Java doesn't call its
methods "functions": the latter term implies something much more specific.

View raw message