On Tue, 19 Apr 2011 19:47:57 -0400, Vladimir Panteleev <vladi...@thecybershadow.net> wrote:

On Wed, 20 Apr 2011 02:43:50 +0300, bearophile <bearophileh...@lycos.com> wrote:

I agree. In my opinion the problem is not you using in your module a language feature designed for that very purpose. What's in question is the syntax of that language feature. I don't mind lazy arguments, but it can be argued that's better for them to require a "lazy" prefix at the calling point too. This little syntax problem that was already raised during the D2 design phase.

I would like to clarify my point:

Inarguably (IMO), the original intention of lazy parameters was to allow passing expressions to functions that were evaluated only when required.

David's library evaluates these expressions *in different threads*!

Generally, I would count that any usage of "lazy" counts as abuse except for evaluating the argument, at most once, during the function's execution.


Lazy is also good at abstracting error handling. For example, I use lazy to perform smart C error code checking, which allows me to handle certain common errors and then re-try the function.

Reply via email to