Last active
August 29, 2015 13:57
-
-
Save lucaswerkmeister/9873330 to your computer and use it in GitHub Desktop.
Generated code for ceylon/ceylon-compiler#1589
This file contains 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
@noanno Anything myConcatenate({String*}* iterables) => nothing; | |
@noanno [String]|[String,String] oneOrTwo(String element) => nothing; | |
@noanno Anything v = myConcatenate(*[""].map(oneOrTwo)); |
This file contains 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
/* | |
* A heavily formatted version of tmp.java (replace ", " with ",\n", "(" with "(\n", ")" with "\n)", then manually put empty parens on the same line again, and then Ctrl+I). | |
* Hopefully this makes the structure of the giant "value = ..." call clearer. | |
* (I would have preferred the name tmp.java.formatted for this file, but then we wouldn’t get syntax highlighting.) | |
*/ | |
package tmp; | |
final class myConcatenate_ { | |
private myConcatenate_() { | |
} | |
static java.lang.Object myConcatenate() { | |
ceylon.language.Sequential<? extends ceylon.language.Iterable<? extends ceylon.language.String,? extends java.lang.Object>> $ceylontmp$iterables$0 | |
= (ceylon.language.Sequential) ceylon.language.empty_.get_(); | |
return myConcatenate($ceylontmp$iterables$0); | |
} | |
static java.lang.Object myConcatenate( | |
final ceylon.language.Sequential<? extends ceylon.language.Iterable<? extends ceylon.language.String,? extends java.lang.Object>> iterables | |
) { | |
return ceylon.language.nothing_.get_(); | |
} | |
} | |
final class oneOrTwo_ { | |
private oneOrTwo_() { | |
} | |
static java.lang.Object oneOrTwo( | |
final java.lang.String element | |
) { | |
return ceylon.language.nothing_.get_(); | |
} | |
} | |
final class v_ { | |
private v_() { | |
} | |
private static final java.lang.Object[] value; | |
static { | |
value = new java.lang.Object[] { | |
tmp.myConcatenate_.myConcatenate( | |
new ceylon.language.Tuple<ceylon.language.String, | |
ceylon.language.String, | |
ceylon.language.Sequential<? extends ceylon.language.String>>( | |
ceylon.language.String.$TypeDescriptor$, | |
new java.lang.Object[] { ceylon.language.String.instance( | |
"" | |
) } | |
).<java.lang.Object> map( | |
com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.union( | |
com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass( | |
ceylon.language.Tuple.class, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.Empty.$TypeDescriptor$ | |
), | |
com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass( | |
ceylon.language.Tuple.class, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.String.$TypeDescriptor$, | |
com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass( | |
ceylon.language.Tuple.class, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.Empty.$TypeDescriptor$ | |
) | |
) | |
), | |
(ceylon.language.Callable<? extends java.lang.Object>) | |
(ceylon.language.Callable) | |
new com.redhat.ceylon.compiler.java.language.AbstractCallable( | |
com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.union( | |
com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass( | |
ceylon.language.Tuple.class, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.Empty.$TypeDescriptor$ | |
), | |
com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass( | |
ceylon.language.Tuple.class, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.String.$TypeDescriptor$, | |
com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass( | |
ceylon.language.Tuple.class, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.Empty.$TypeDescriptor$ | |
) | |
) | |
), | |
com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass( | |
ceylon.language.Tuple.class, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.String.$TypeDescriptor$, | |
ceylon.language.Empty.$TypeDescriptor$ | |
), | |
"<[String]|[String, String]>(String)", | |
(short) | |
-1 | |
) { | |
@java.lang.Override | |
public java.lang.Object $call$( | |
final java.lang.Object $param$0 | |
) { | |
final java.lang.String $ceylontmp$element = ( | |
( | |
ceylon.language.String | |
) $param$0 | |
).toString(); | |
return tmp.oneOrTwo_.oneOrTwo( | |
$ceylontmp$element | |
); | |
} | |
} | |
).getSequence() | |
) }; | |
} | |
public static java.lang.Object get_() { | |
try { | |
return value[0]; | |
} catch ( | |
java.lang.NullPointerException ex | |
) { | |
throw new ceylon.language.InitializationError( | |
"Cyclic initialization" | |
); | |
} | |
} | |
} |
This file contains 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
/* | |
* hand-corrected version of tmp.javac | |
* that is valid java code. | |
*/ | |
package tmp; | |
final class myConcatenate_ { | |
private myConcatenate_() { | |
} | |
static java.lang.Object myConcatenate() { | |
ceylon.language.Sequential<? extends ceylon.language.Iterable<? extends ceylon.language.String, ? extends java.lang.Object>> $ceylontmp$iterables$0 = (ceylon.language.Sequential)ceylon.language.empty_.get_(); | |
return myConcatenate($ceylontmp$iterables$0); | |
} | |
static java.lang.Object myConcatenate(final ceylon.language.Sequential<? extends ceylon.language.Iterable<? extends ceylon.language.String, ? extends java.lang.Object>> iterables) { | |
return ceylon.language.nothing_.get_(); | |
} | |
} | |
final class oneOrTwo_ { | |
private oneOrTwo_() { | |
} | |
static java.lang.Object oneOrTwo(final java.lang.String element) { | |
return ceylon.language.nothing_.get_(); | |
} | |
} | |
final class v_ { | |
private v_() { | |
} | |
private static final java.lang.Object[] value; | |
static { | |
value = new java.lang.Object[]{tmp.myConcatenate_.myConcatenate(new ceylon.language.Tuple<ceylon.language.String, ceylon.language.String, ceylon.language.Sequential<? extends ceylon.language.String>>(ceylon.language.String.$TypeDescriptor$, new java.lang.Object[]{ceylon.language.String.instance("")}).<java.lang.Object>map(com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.union(com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(ceylon.language.Tuple.class, ceylon.language.String.$TypeDescriptor$, ceylon.language.String.$TypeDescriptor$, ceylon.language.Empty.$TypeDescriptor$), com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(ceylon.language.Tuple.class, ceylon.language.String.$TypeDescriptor$, ceylon.language.String.$TypeDescriptor$, com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(ceylon.language.Tuple.class, ceylon.language.String.$TypeDescriptor$, ceylon.language.String.$TypeDescriptor$, ceylon.language.Empty.$TypeDescriptor$))), (ceylon.language.Callable<? extends java.lang.Object>)(ceylon.language.Callable)new com.redhat.ceylon.compiler.java.language.AbstractCallable(com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.union(com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(ceylon.language.Tuple.class, ceylon.language.String.$TypeDescriptor$, ceylon.language.String.$TypeDescriptor$, ceylon.language.Empty.$TypeDescriptor$), com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(ceylon.language.Tuple.class, ceylon.language.String.$TypeDescriptor$, ceylon.language.String.$TypeDescriptor$, com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(ceylon.language.Tuple.class, ceylon.language.String.$TypeDescriptor$, ceylon.language.String.$TypeDescriptor$, ceylon.language.Empty.$TypeDescriptor$))), com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(ceylon.language.Tuple.class, ceylon.language.String.$TypeDescriptor$, ceylon.language.String.$TypeDescriptor$, ceylon.language.Empty.$TypeDescriptor$), "<[String]|[String, String]>(String)", (short)-1){ | |
@java.lang.Override | |
public java.lang.Object $call$(final java.lang.Object $param$0) { | |
final java.lang.String $ceylontmp$element = ((ceylon.language.String)$param$0).toString(); | |
return tmp.oneOrTwo_.oneOrTwo($ceylontmp$element); | |
} | |
}).getSequence())}; | |
} | |
public static java.lang.Object get_() { | |
try { | |
return value[0]; | |
} catch (java.lang.NullPointerException ex) { | |
throw new ceylon.language.InitializationError("Cyclic initialization"); | |
} | |
} | |
} |
This file contains 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 tmp; | |
final class myConcatenate_ { | |
private myConcatenate_() { | |
} | |
static .java.lang.Object myConcatenate() { | |
return ( | |
let | |
{ | |
.ceylon.language.Sequential<? extends .ceylon.language.Iterable<? extends .ceylon.language.String, ? extends .java.lang.Object>> $ceylontmp$iterables$0 = (.ceylon.language.Sequential).ceylon.language.empty_.get_(); | |
} | |
returning myConcatenate($ceylontmp$iterables$0); | |
); | |
} | |
static .java.lang.Object myConcatenate(final .ceylon.language.Sequential<? extends .ceylon.language.Iterable<? extends .ceylon.language.String, ? extends .java.lang.Object>> iterables) { | |
return .ceylon.language.nothing_.get_(); | |
} | |
} | |
final class oneOrTwo_ { | |
private oneOrTwo_() { | |
} | |
static .java.lang.Object oneOrTwo(final .java.lang.String element) { | |
return .ceylon.language.nothing_.get_(); | |
} | |
} | |
final class v_ { | |
private v_() { | |
} | |
private static final .java.lang.Object[] value; | |
static { | |
value = new .java.lang.Object[]{.tmp.myConcatenate_.myConcatenate(new .ceylon.language.Tuple<.ceylon.language.String, .ceylon.language.String, .ceylon.language.Sequential<? extends .ceylon.language.String>>(.ceylon.language.String.$TypeDescriptor$, new .java.lang.Object[]{.ceylon.language.String.instance("")}).<.java.lang.Object>map(.com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.union(.com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(.ceylon.language.Tuple.class, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.Empty.$TypeDescriptor$), .com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(.ceylon.language.Tuple.class, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.String.$TypeDescriptor$, .com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(.ceylon.language.Tuple.class, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.Empty.$TypeDescriptor$))), (.ceylon.language.Callable<? extends .java.lang.Object>)(.ceylon.language.Callable)new .com.redhat.ceylon.compiler.java.language.AbstractCallable(.com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.union(.com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(.ceylon.language.Tuple.class, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.Empty.$TypeDescriptor$), .com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(.ceylon.language.Tuple.class, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.String.$TypeDescriptor$, .com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(.ceylon.language.Tuple.class, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.Empty.$TypeDescriptor$))), .com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor.klass(.ceylon.language.Tuple.class, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.String.$TypeDescriptor$, .ceylon.language.Empty.$TypeDescriptor$), "<[String]|[String, String]>(String)", (short)-1){ | |
@.java.lang.Override | |
public .java.lang.Object $call$(final .java.lang.Object $param$0) { | |
final .java.lang.String $ceylontmp$element = ((.ceylon.language.String)$param$0).toString(); | |
return .tmp.oneOrTwo_.oneOrTwo($ceylontmp$element); | |
} | |
}).getSequence())}; | |
} | |
public static .java.lang.Object get_() { | |
try { | |
return value[0]; | |
} catch (.java.lang.NullPointerException ex) { | |
throw new .ceylon.language.InitializationError("Cyclic initialization"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hint: You can make the gist much wider in the Firefox inspector (I imagine in the Chrome inpector as well). Remove the
width
andfloat: right
fromdiv.column
, and thewidth
fromdiv.container
. Looks ugly, but you get to see all oftmp.formatted.java
if your screen is wide enough. (The files still get individual scrollbars if they don’t fit.)