- lambdas
- checked exception suppression
- struct types (scala's
AnyVal
) - proper generics (true variance à la C#, ie.
in
andout
) - hygienic macros (auto getters/setters/builder/...)
- some operator overloading (ie. BigInteger hell)
- extension methods (in addition to default methods)
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 org.heat.dofus.datacenter; | |
import com.google.common.collect.ImmutableSet; | |
import lombok.NonNull; | |
import lombok.Value; | |
import lombok.experimental.Builder; | |
@Value(staticConstructor = "newD2oClass") | |
@Builder(builderClassName = "Builder", builderMethodName = "newBuilder") | |
public class D2oClass { |
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.lang.invoke.MethodHandle; | |
import java.lang.invoke.MethodHandles; | |
import java.lang.invoke.MethodType; | |
import java.lang.reflect.Method; | |
import java.time.Duration; | |
import java.time.temporal.ChronoUnit; | |
public class MethodHandlePerfs { | |
public static interface Task { | |
void run(int N) throws Throwable; |
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
static if (is (T == float)) { | |
alias ResultType = double; | |
} else static if (is (T == double)) { | |
alias ResultType = real; | |
} else { | |
static assert(false, T.stringof ~ " is not supported"); | |
} |
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 org.heat.login.network; | |
import io.netty.handler.logging.LogLevel; | |
import io.netty.handler.logging.LoggingHandler; | |
import net.engio.mbassy.bus.MBassador; | |
import net.engio.mbassy.listener.Listener; | |
import net.engio.mbassy.listener.References; | |
import org.heat.login.network.netty.NettyLoginClient; | |
import org.heat.protocol.MessageReceiver; | |
import org.heat.protocol.messages.HelloConnectMessage; |
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
interface List<T> { | |
Option<T> head(); | |
List<T> tail(); | |
int size(); | |
<A> A bind(Function<T, A> fn, Function2<A, A, A> combine); | |
List<T> join(List<T> list); | |
static List<T> unit() { | |
return new List<T>() { |
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
inputs = %w[ | |
CollectionSelectInput | |
DateTimeInput | |
FileInput | |
GroupedCollectionSelectInput | |
NumericInput | |
PasswordInput | |
RangeInput | |
StringInput | |
TextInput |
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
-module (db). | |
-export ([match/2]). | |
match(_, []) -> []; | |
match(Elem, [{Key, Elem} | Tail]) -> [Key | match(Elem, Tail)]; | |
match(Elem, [{_, _} | Tail]) -> match(Elem, Tail). |
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
-module (demo). | |
-export ([taille/1]). | |
-export ([somme/1]). | |
taille([]) -> 0. | |
taille([_|Tail]) -> 1 + taille(Tail). | |
somme([]) -> 0. | |
somme([Head|Tail]) -> Head + somme(Tail). |