Skip to content

Instantly share code, notes, and snippets.

@kkismd
Last active August 29, 2015 14:21
Show Gist options
  • Save kkismd/7bcda7a901541d47cf34 to your computer and use it in GitHub Desktop.
Save kkismd/7bcda7a901541d47cf34 to your computer and use it in GitHub Desktop.
import scala.Predef.;
import scala.Serializable;
import scala.collection.immutable.Range.Inclusive;
import scala.runtime.AbstractFunction1;
import scala.runtime.BoxedUnit;
import scala.runtime.RichInt.;
public final class Hello$
{
public static final MODULE$;
static
{
new ();
}
public void main(String[] args)
{
RichInt..MODULE$.to$extension0(Predef..MODULE$.intWrapper(1), 10)
.foreach$mVc$sp(
new AbstractFunction1() {
public static final long serialVersionUID = 0L;
public final void apply(Object x) {
Predef..MODULE$.println(x);
}
}
);
}
private Hello$() { MODULE$ = this; }
}
mport scala.reflect.ScalaSignature;
@ScalaSignature(bytes="\006\001\025:Q!\001\002\t\002\025\tQ\001S3mY>T\021aA\001\by\025l\007\017^=?\007\001\001\"AB\004\016\003\t1Q\001\003\002\t\002%\021Q\001S3mY>\034\"a\002\006\021\005-qQ\"\001\007\013\0035\tQa]2bY\006L!a\004\007\003\r\005s\027PU3g\021\025\tr\001\"\001\023\003\031a\024N\\5u}Q\tQ\001C\003\025\017\021\005Q#\001\003nC&tGC\001\f\032!\tYq#\003\002\031\031\t!QK\\5u\021\025Q2\0031\001\034\003\021\t'oZ:\021\007-ab$\003\002\036\031\t)\021I\035:bsB\021qD\t\b\003\027\001J!!\t\007\002\rA\023X\rZ3g\023\t\031CE\001\004TiJLgn\032\006\003C1\001")
public final class Hello
{
public static void main(String[] paramArrayOfString)
{
Hello..MODULE$.main(paramArrayOfString);
}
}
object Hello {
def main(args: Array[String]): Unit = {
1 to 10 foreach(println)
}
}
class LowPriorityImplicits {
/** We prefer the java.lang.* boxed types to these wrappers in
* any potential conflicts. Conflicts do exist because the wrappers
* need to implement ScalaNumber in order to have a symmetric equals
* method, but that implies implementing java.lang.Number as well.
*
* Note - these are inlined because they are value classes, but
* the call to xxxWrapper is not eliminated even though it does nothing.
* Even inlined, every call site does a no-op retrieval of Predef's MODULE$
* because maybe loading Predef has side effects!
*/
@inline implicit def byteWrapper(x: Byte) = new runtime.RichByte(x)
@inline implicit def shortWrapper(x: Short) = new runtime.RichShort(x)
@inline implicit def intWrapper(x: Int) = new runtime.RichInt(x)
@inline implicit def charWrapper(c: Char) = new runtime.RichChar(c)
@inline implicit def longWrapper(x: Long) = new runtime.RichLong(x)
@inline implicit def floatWrapper(x: Float) = new runtime.RichFloat(x)
@inline implicit def doubleWrapper(x: Double) = new runtime.RichDouble(x)
@inline implicit def booleanWrapper(x: Boolean) = new runtime.RichBoolean(x)
final class RichInt(val self: Int) extends AnyVal with ScalaNumberProxy[Int] with RangedProxy[Int] {
/** like `until`, but includes the last index */
/**
* @param end The final bound of the range to make.
* @return A [[scala.collection.immutable.Range]] from `'''this'''` up to
* and including `end`.
*/
def to(end: Int): Range.Inclusive = Range.inclusive(self, end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment