Changes for page WebObjects with Scala

Last modified by Ravi Mendis on 2011/05/10 02:10

From version 440.1
edited by Ravi Mendis
on 2010/12/23 06:45
Change comment: There is no comment for this version
To version 443.1
edited by John Huss
on 2010/12/03 16:45
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.rmendis
1 +XWiki.johnthuss
Content
... ... @@ -190,16 +190,10 @@
190 190  
191 191  == How to Use Scala Collections with EOF ==
192 192  
193 -To use the Scala Collections API with an NSArray or NSDictionary you simply need to add an import:
193 +To use the Scala Collections API with an NSArray or NSDictionary you simply need to add an import:import scala.collection.JavaConversions.
194 194  
195 -{{code value="java"}}
195 +Then you can access the typical Scala collection methods directly on NSArray.  This employs a feature of Scala known as implicit conversions to automagically cast a NSArray (a Java Iterable) into a Scala Iterable while leaving the actual object unchanged.  Alternatively, you could generate an actual new scala.List instance by calling myNSArray.toList.
196 196  
197 -import scala.collection.JavaConversions._
198 -
199 -{{/code}}
200 -
201 -After that, you may access the typical Scala collection methods directly on NSArray.  This employs a feature of Scala known as implicit conversions to automagically cast a NSArray (a Java Iterable) into a Scala Iterable while leaving the actual object unchanged.  Alternatively, you could generate an actual new scala.List instance by calling myNSArray.toList.
202 -
203 203  == How to Add Scala to a WO Project ==
204 204  
205 205  {{include value="WOL:Adding Scala Support to a WOLips Project"}}{{/include}}