Created
December 15, 2012 22:48
-
-
Save pcarrier/4300068 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Trying to be "idiomatic" yet fair. Used JD GUI to show the bytecode in human-readable Java. | |
| Somehow mirah breaks JD GUI, which is probably interesting. | |
| So I went through an intermediate Java file thanks to mirah -j instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovy.transform.CompileStatic | |
| @CompileStatic | |
| class Bottles { | |
| static void main(String... args) { | |
| for (n in 1..100) | |
| println "${n} bottles" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovy.lang.GroovyObject; | |
| import groovy.lang.IntRange; | |
| import groovy.lang.MetaClass; | |
| import groovy.transform.TypeChecked.TypeCheckingInfo; | |
| import java.util.Iterator; | |
| import org.codehaus.groovy.runtime.DefaultGroovyMethods; | |
| import org.codehaus.groovy.runtime.GStringImpl; | |
| import org.codehaus.groovy.runtime.ScriptBytecodeAdapter; | |
| public class Bottles | |
| implements GroovyObject | |
| { | |
| public Bottles() | |
| { | |
| Bottles this; | |
| MetaClass localMetaClass = $getStaticMetaClass(); | |
| this.metaClass = localMetaClass; | |
| } | |
| @TypeChecked.TypeCheckingInfo(inferredType="AAlDbGFzc05vZGUAAAFWAP////8=", version=1) | |
| public static void main(String[] args) | |
| { | |
| Integer n = null; for (Iterator localIterator = ((IntRange)ScriptBytecodeAdapter.createRange(Integer.valueOf(1), Integer.valueOf(100), 1)).iterator(); localIterator.hasNext(); | |
| null) | |
| { | |
| n = (Integer)ScriptBytecodeAdapter.castToType(localIterator.next(), Integer.class); | |
| DefaultGroovyMethods.println(Bottles.class, new GStringImpl(new Object[] { n }, new String[] { "", " bottles" })); | |
| } | |
| } | |
| static | |
| { | |
| __$swapInit(); | |
| long l1 = 0L; | |
| __timeStamp__239_neverHappen1355612245284 = l1; | |
| long l2 = 1355612245284L; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Bottles { | |
| public static final void main(String[] args) { | |
| for (int i = 1; i <= 100; i++) | |
| System.out.println(i + " bottles"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.PrintStream; | |
| class Bottles | |
| { | |
| public static final void main(String[] paramArrayOfString) | |
| { | |
| for (int i = 1; i <= 100; i++) | |
| System.out.println(i + " bottles"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Bottles; | |
| import jet.runtime.typeinfo.JetMethod; | |
| import jet.runtime.typeinfo.JetValueParameter; | |
| public class namespace | |
| { | |
| @JetMethod(flags=16, returnType="V") | |
| public static final void main(@JetValueParameter(name="args", type="[Ljava/lang/String;") String[] args) | |
| { | |
| int i = 1; for (int j = 100; i <= j; | |
| i++) | |
| { | |
| int n = i; | |
| kotlin.io.namespace.println(n + " bottles"); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1.upto 100 do |n| | |
| puts "#{n} bottles" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.PrintStream; | |
| public class Bottles | |
| { | |
| public static void main(String[] paramArrayOfString) | |
| { | |
| int i = 0; | |
| int j = 0; | |
| int k = 0; | |
| i = 1; | |
| j = 100; | |
| while (i <= j) { | |
| k = i; | |
| PrintStream localPrintStream = System.out; | |
| localPrintStream.println("" + k + " bottles"); | |
| i += 1; | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object Bottles { | |
| def main(args: Array[String]) = | |
| for (n <- (1 to 100)) | |
| println(s"$n bottles!") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import scala.LowPriorityImplicits; | |
| import scala.Predef.; | |
| import scala.Serializable; | |
| import scala.StringContext; | |
| import scala.collection.immutable.Range; | |
| import scala.runtime.AbstractFunction1.mcVI.sp; | |
| import scala.runtime.BoxesRunTime; | |
| import scala.runtime.RichInt.; | |
| public final class Bottles$ | |
| { | |
| public static final MODULE$; | |
| static | |
| { | |
| new (); | |
| } | |
| public void main(String[] args) | |
| { | |
| RichInt..MODULE$.to$extension0(Predef..MODULE$.intWrapper(1), 100).foreach$mVc$sp(new AbstractFunction1.mcVI.sp() { public static final long serialVersionUID = 0L; | |
| public final void apply(int n) { apply$mcVI$sp(n); } | |
| public void apply$mcVI$sp(int v1) { Predef..MODULE$.println(new StringContext(Predef..MODULE$.wrapRefArray((Object[])new String[] { "", " bottles!" })).s(Predef..MODULE$.genericWrapArray(new Object[] { BoxesRunTime.boxToInteger(v1) }))); } | |
| }); | |
| } | |
| private Bottles$() | |
| { | |
| MODULE$ = this; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment