[m-dev.] Adding Loops to Mercury

Michael Day mikeday at yeslogic.com
Thu Jan 2 17:50:51 AEDT 2014


Hi Paul,

>> foreach I=std::fromTo(1,1000) do
>>     %...whatever
>> end foreach.
>
> I think that such a feature would be considered "not in the spirit of
> Mercury" by most developers.

Light syntax and efficient compilation for lambdas is enough:

     foreach(1 `..` 100, func(X) = blah)

Michael

-- 
Prince: Print with CSS!
http://www.princexml.com



More information about the developers mailing list