Changes for page WebObjects and Squeryl

Last modified by Ravi Mendis on 2011/04/01 11:14

From version 78.1
edited by Ravi Mendis
on 2011/03/31 23:24
Change comment: There is no comment for this version
To version 80.1
edited by Ravi Mendis
on 2011/03/31 23:36
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -57,3 +57,25 @@
57 57  def activeFiles = files.filter(_.active == true)
58 58  
59 59  {{/code}}
60 +
61 +===== 2. Iteration =====
62 +
63 +Functional language iteration that's become increasingly popular can be used:
64 +
65 +{{code}}
66 +
67 +activeFiles.foreach(f => {
68 + ...
69 +})
70 +
71 +{{/code}}
72 +
73 +===== 3. For-Comprehensions =====
74 +
75 +Here's just an example use of sequence comprehension:
76 +
77 +{{code}}
78 +
79 +def activeFiles = for (file <- files if file.active == true) yield f
80 +
81 +{{/code}}