| Markus 2007-08-15, 7:11 pm |
|
Joachim Durchholz wrote:
> I'm not sure where the problems come from. The basic While loop is
> really easy to emulate with HOFs, and there isn't much interest in
> more intricate loop constructs in the FPL community. (I do have some
> ideas why that might be, but phrasing this well enough is beyond my
May I make a suggestion? In functional programming the tradiational
while- and other loops are usually replaced by fold() and similar
operations. Since "iterating" over a data structure -- even in the
more general sense of e.g. walking a tree -- can be captured so easily
as HOF-pattern, the need to define ones own control structures is
greatly diminished. IMHO this makes the discussion moot wether this it
is and advantage in FP to define control structures with macros: In FP
it isn't and they aren't required because the natural patterns to
iterate over data can be easily captured in HOFs (see fold and its
ilk).
Regards -- Markus
|