[nem-bug] [Nemerle 0000606]: possible problem with loop closures

feedback at nemerle.org feedback at nemerle.org
Sun Jan 29 09:22:41 CET 2006


The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=606> 
======================================================================
Reported By:                malekith
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   606
Category:                   Compiler
Reproducibility:            always
Severity:                   major
Priority:                   high
Status:                     new
======================================================================
Date Submitted:             01-29-2006 09:22 CET
Last Modified:              01-29-2006 09:22 CET
======================================================================
Summary:                    possible problem with loop closures
Description: 
it prints 3 3 3, instead of 1 2 3.

using Nemerle.Collections

def d = Queue ()
foreach (x in [1..3])
  d.Push (fun () { System.Console.WriteLine (x) })
while (!d.IsEmpty)
  d.Take () ()

======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
01-29-06 09:22 malekith       New Issue                                    
======================================================================




More information about the bugs mailing list