Changes for page WebObjects and Squeryl
Last modified by Ravi Mendis on 2011/04/01 11:14
From version 77.1
edited by Ravi Mendis
on 2011/03/25 05:21
on 2011/03/25 05:21
Change comment:
There is no comment for this version
To version 80.1
edited by Ravi Mendis
on 2011/03/31 23:36
on 2011/03/31 23:36
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -54,6 +54,28 @@ 54 54 55 55 {{code}} 56 56 57 -def activeFiles = files.filter(_.active == 1)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}}