RichSet + examples

4 views
Skip to first unread message

Michael Cotterell

unread,
Feb 18, 2011, 1:01:45 PM2/18/11
to scalati...@googlegroups.com, j...@cs.uga.edu
Hey guys,

Please check out http://code.google.com/p/scalation/source/browse/branches/devel/src/scalation/collection/RichSet.scala and let me know what you think. At the bottom of the file, I've provided examples of legal scala code that runs and compiles using RichSet.

- Michael

Michael Cotterell

unread,
Feb 18, 2011, 1:06:10 PM2/18/11
to scalati...@googlegroups.com, j...@cs.uga.edu
Forgot to mention that 
import scalation.collection.RichSet._ 
def factorial(n: Int) =(1 to n)
works because I implicitly convert inclusive integer ranges to sets. I still need to write the code for doing to same with exclusive integer ranges. 

Michael Cotterell

unread,
Feb 18, 2011, 1:40:38 PM2/18/11
to scalati...@googlegroups.com, j...@cs.uga.edu
Updated the implicit conversion so that it can handle any subclass of Range (not just inclusive integer ranges). Check it out, in action, at the bottom of  http://code.google.com/p/scalation/source/browse/branches/devel/src/scalation/collection/RichSet.scala

- Michael
Reply all
Reply to author
Forward
0 new messages