<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 2, 2014 at 5:50 PM, Michael Day <span dir="ltr"><<a href="mailto:mikeday@yeslogic.com" target="_blank">mikeday@yeslogic.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Paul,<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
foreach I=std::fromTo(1,1000) do<br>
%...whatever<br>
end foreach.<br>
</blockquote>
<br>
I think that such a feature would be considered "not in the spirit of<br>
Mercury" by most developers.<br>
</blockquote>
<br></div>
Light syntax and efficient compilation for lambdas is enough:<br>
<br>
foreach(1 `..` 100, func(X) = blah)</blockquote><div><br></div><div>Which is pretty much already supported, e.g.</div><div><br></div><div> map(func(X) = X * 2, 1 `..` 100)<br></div><div><br></div><div>(Use a quantifier like foreach seems like the wrong name to use</div>
<div>for some that is transform the list of integers using a function.)</div><div><br></div><div>Cheers,</div><div>Julien.</div></div></div></div>