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
| ;;; -*-coding:utf-8-*- | |
| ;; Ensure el-get existence. | |
| (add-to-list 'load-path "~/.emacs.d/el-get/el-get") | |
| (unless (require 'el-get nil 'noerror) | |
| (with-current-buffer | |
| (url-retrieve-synchronously | |
| "https://raw.github.com/dimitri/el-get/master/el-get-install.el") | |
| (goto-char (point-max)) |
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.util.Collections; | |
| import java.util.Comparators; | |
| import java.util.function.Function; | |
| import java.util.stream.Stream; | |
| public class MinimumComparator { | |
| public static void main(String... args){ |
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.util.stream.IntStream; | |
| public class LambdasVirtualFinal { | |
| public static void main(String... args){ | |
| int outer = 0; | |
| // 外部の変数の参照はできる. | |
| IntStream.range(0, 100).forEach(i -> System.out.println(i + outer)); |
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.util.concurrent.Callable; | |
| import java.util.function.Consumer; | |
| import java.util.function.Function; | |
| public class LambdaThis { | |
| public void something(){ | |
| // lambda内のthisは外部環境のthisになる。 | |
| Callable<String> s = () -> this.name; | |
| Runnable r = () -> { Callable<String> lbt = this::sayHello; }; |
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.util.function.Function; | |
| public class LambdaCurrying { | |
| public interface QuadFunction<A, B, C, D, E>{ | |
| default TriFunction<B, C, D, E> partial(A a){ | |
| return (b, c, d) -> this.apply(a, b, c, d); | |
| } | |
| E apply(A a,B b,C c,D d); | |
| } |
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
| public class NastyHelloWorld { | |
| public static void main(String args...){ | |
| ((Consumer<String>) System.out::println).accept("Hello World"); | |
| } | |
| } |
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
| (defproject nrepl-test "0.1.0-SNAPSHOT" | |
| :description "FIXME: write description" | |
| :url "http://example.com/FIXME" | |
| :license {:name "Eclipse Public License" | |
| :url "http://www.eclipse.org/legal/epl-v10.html"} | |
| :dependencies [[org.clojure/clojure "1.5.1"] | |
| [org.clojure/tools.nrepl "0.2.3"]] | |
| :main nrepl-test.core) | |
| ;; referring http://matstani.github.io/blog/2013/05/20/embed-nrepl/ |
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
| /target | |
| /lib | |
| /classes | |
| /checkouts | |
| pom.xml | |
| pom.xml.asc | |
| *.jar | |
| *.class | |
| .lein-deps-sum | |
| .lein-failures |
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
| {:user | |
| ;; To make JVM invoking faster. | |
| ;; For more details, see http://tnoda-clojure.tumblr.com/post/51495039433/jvm-clojure-03 | |
| :jvm-opts ["-XX:+TieredCompilation" "-XX:TieredStopAtLevel=1"] | |
| ;; Enable lein-ritz. | |
| {:plugins [[lein-ritz "0.7.0"]] | |
| :dependencies [[ritz/ritz-nrepl-middleware "0.7.0"]] | |
| :repl-options {:nrepl-middleware | |
| [ritz.nrepl.middleware.javadoc/wrap-javadoc |
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
| {:user { | |
| ;; To make JVM invoking faster. | |
| ;; For more details, see http://tnoda-clojure.tumblr.com/post/51495039433/jvm-clojure-03 | |
| :jvm-opts ["-XX:+TieredCompilation" "-XX:TieredStopAtLevel=1"] | |
| ;; Enable lein-ritz. | |
| :plugins [[lein-ritz "0.7.0"]] | |
| :dependencies [[ritz/ritz-nrepl-middleware "0.7.0"]] | |
| :repl-options {:nrepl-middleware | |
| [ritz.nrepl.middleware.javadoc/wrap-javadoc |