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

SCM Repository

[diderot] View of /branches/vis15/src/tests/rtest/tests/foreach2/foreach2.diderot
ViewVC logotype

View of /branches/vis15/src/tests/rtest/tests/foreach2/foreach2.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4497 - (download) (annotate)
Sat Sep 3 14:12:36 2016 UTC (2 years, 8 months ago) by jhr
File size: 367 byte(s)
  working on merge: updating tests with new version 2 syntax
#version 2.0

// like test-foreach1.diderot, except we use a dynamic sequence
//

int[] indices = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

strand Particle (real start)
{
    output real out = start;
    update
    {
        foreach (int i in indices)
        {
            out += real(i);
        }
        stabilize;
    }
}

create_array { Particle(real(n)) | n in 1..10 }

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