For Programmers: Free Programming Magazines  


Home > Archive > Functional > August 2007 > Re: shootout: implementing an interpreter for a simple procedural









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: shootout: implementing an interpreter for a simple procedural
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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com