Re: Declarative constraints in practical terms

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 26 Feb 2006 15:55:52 -0800
Message-ID: <1140998152.183131.259260_at_i39g2000cwa.googlegroups.com>


Bob Hairgrove wrote:
> On 26 Feb 2006 13:02:42 -0800, "Marshall Spight"
> <marshall.spight_at_gmail.com> wrote:
>
> >> What do you mean by "first class functions"?
> >
> >This is a pretty good explanation:
> >http://en.wikipedia.org/wiki/First_class_function
>
> Thanks.
>
> They forgot about function objects, though. These can store additional
> state (data) as member variables, unlike function pointers.

Sure. Those are really useful.

(Note that in the classical sense of the word, functions are stateless.)

It's sort of an old language design question: do you want closures, which are stateful functions, or objects, which are also stateful.

Ultimately, statefulness is something to be avoided, except in the central datastore. That's my big gripe with OOP: state is sprinkled throughout your code, like sand in the machinery. :-)

Marshall Received on Mon Feb 27 2006 - 00:55:52 CET

Original text of this message