[Issue 2939] lazy evaluation not invoked for lambda function

2016-08-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=2939 ag0ae...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 2939] lazy evaluation not invoked for lambda function

2009-05-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2939 --- Comment #1 from jarrett.billings...@gmail.com 2009-05-05 00:16 --- The foreach loop is actually not important. void f(lazy void dg) { dg(); } void main() { void foo() { Stdout.formatln("o hai"); } f(foo);

[Issue 2939] lazy evaluation not invoked for lambda function

2009-05-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2939 --- Comment #2 from jarrett.billings...@gmail.com 2009-05-05 00:17 --- Also, this happens in D1 as well. I'm never clear on what should be done with the bug versions in these cases.. --

[Issue 2939] lazy evaluation not invoked for lambda function

2009-05-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2939 clugd...@yahoo.com.au changed: What|Removed |Added Version|2.029 |1.042 --- Comment #3 from

[Issue 2939] lazy evaluation not invoked for lambda function

2009-05-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2939 --- Comment #4 from crist...@zerobugs.org 2009-05-05 02:24 --- Here's a proposed fix: in expression.c, at line 693 (using 2.029 as a reference) add a check to see if arg is already a delegate: if (arg->type->ty != Tdelegate) // <

[Issue 2939] lazy evaluation not invoked for lambda function

2009-05-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2939 --- Comment #5 from shro8...@vandals.uidaho.edu 2009-05-05 12:36 --- I think this is working correctly: take this example: import std.stdio; void fn(lazy int i) { writef("%d\n", k); auto j = i(); writef("%d\n", k);

[Issue 2939] lazy evaluation not invoked for lambda function

2009-05-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2939 --- Comment #6 from jarrett.billings...@gmail.com 2009-05-05 14:52 --- (In reply to comment #5) > What is happening in the original cases is that the 'dg();' is evaluating *to > the* lambda rather than *evaluating* the lambda. And th

[Issue 2939] lazy evaluation not invoked for lambda function

2009-05-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2939 --- Comment #7 from shro8...@vandals.uidaho.edu 2009-05-05 15:16 --- (In reply to comment #6) > (In reply to comment #5) > > > What is happening in the original cases is that the 'dg();' is evaluating > > *to the* lambda rather than

[Issue 2939] lazy evaluation not invoked for lambda function

2009-05-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2939 --- Comment #8 from crist...@zerobugs.org 2009-05-05 21:58 --- I was able to test that my fix works: // Convert lazy argument to a delegate if (p->storageClass & STClazy) { if (arg->typ

[Issue 2939] lazy evaluation not invoked for lambda function

2009-05-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2939 --- Comment #9 from shro8...@vandals.uidaho.edu 2009-05-06 16:06 --- (In reply to comment #8) > if (arg->type->ty != Tdelegate) // DO NOT "DELEGATIZE" TWICE Please no! I don't think this is the correct way to fix this as