Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/vis12/bugs/resolved/bug020.diderot
ViewVC logotype

View of /branches/vis12/bugs/resolved/bug020.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2250 - (download) (annotate)
Mon Mar 4 18:23:59 2013 UTC (8 years, 3 months ago) by jhr
File size: 765 byte(s)
  Resolve bug020.
/*
  BUG: if we are saying that you can't assign to globals within a strand,
  then we shouldn't allow assigning to globals within a strand!

  As it is the assignment is allowed, and takes effect for duration of
  one update iteration, but then value is reset (to global initialization)
  prior to next update.

  The assignment should not be allowed.
*/

input real hh = 1.0;

strand foo (int ii) {
    int iter = 0;
    output real foo = 1.0;
    update {
      print("(strand ", ii, " iter ", iter, "): hh = ", hh);
      hh += 1 + ii;               // should not be allowed!
      print(" ===> ", hh, "\n");  // value changes, but not for long ...
      iter += 1;
      if (iter > 3) {
        stabilize;
      }
    }
}

initially [ foo(ii) | ii in 0..2 ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0