Subj : Re: Compiler and an interpreter To : comp.programming From : Gerry Quinn Date : Tue Aug 02 2005 01:36 pm In article <42ee584b$0$14656$ed2619ec@ptn-nntp-reader02.plus.net>, usenet@jdh30.plus.com says... > Rob Thorpe wrote: > > It isn't really Lisp written in C++, this would be done differently in > > Lisp. > > I think Gerry is getting at the idea of using functional composition via > templates in C++. I wasn't doing that. I had tried to do it before but, > although the compilers were happy with the code, I found the syntax so > unwieldy that I never got my head around it. Well, I was making a general comment on the style of programming - I said Lisp instead of Occam in order to be less inflammatory! What it was doing I did not try to investigate in detail. > For example, computing the maximum of 5 and each element of a list in OCaml: > > # List.map (max 5) [1;2;3;4;5;6;7;8;9];; > - : int list = [5; 5; 5; 5; 5; 6; 7; 8; 9] And using simple iterative methods in C++ it's just as easy. - Gerry Quinn .