root/trunk/ProjectFortress/syntax_abstraction_tests/ForUse.fss

Revision 3799, 1.5 KB (checked in by EricAllen, 6 months ago)

Added more testing of parametric traits. Added more testing of syntactic abstraction. Added more native math operations to libraries. Improved a static error message.

Line 
1(*******************************************************************************
2    Copyright 2009 Sun Microsystems, Inc.,
3    4150 Network Circle, Santa Clara, California 95054, U.S.A.
4    All rights reserved.
5
6    U.S. Government Rights - Commercial software.
7    Government users are subject to the Sun Microsystems, Inc. standard
8    license agreement and applicable provisions of the FAR and its supplements.
9
10    Use is subject to license terms.
11
12    This distribution may include materials developed by third parties.
13
14    Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
15    trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
16 ******************************************************************************)
17
18component ForUse
19import For.{...}
20import List.{...}
21import Set.{...}
22export Executable
23
24run() = do
25    n = <|1,2,3|>
26    b = <|100,101,102|>
27
28    println "With seq"
29    for a <- seq(n) do
30        (println a)
31    end
32
33    println "And without seq"
34    for a <- n, q <- b
35    do
36        (println a " and " q)
37    end
38
39    println "Testing _"
40    for _ <- seq(n)  do
41        (println "Works.")
42    end
43
44    println "Testing filter expressions"
45    for a <- b , even(a) do
46        (println a " is an even number.")
47    end
48
49    println "Testing more doFront"
50    for a <- b at Global do
51        (println "Testing at")
52    end
53    for a <- b do end
54    for a <- b atomic do
55        (println "Testing atomic")
56    end
57
58    println "Ok, im done!"
59end
60
61end
Note: See TracBrowser for help on using the browser.