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
(ns infer-arg.test.core | |
(:use [infer-arg.core]) | |
(:use [clojure.test])) | |
(deftest fn-without-arg-list-not-wrapped | |
(is (= 2 ((inference-wrapper (fn [x] (inc x))) 1)))) | |
(deftest fn-with-arg-list-is-wrapped | |
(is (= 2 | |
((inference-wrapper |
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
(ns infer-arg.core | |
(:use [clojure.core.incubator :only [-?>]])) | |
(defn make-wrapper-fn | |
[symbolic-arg-list] | |
(eval | |
`(fn [f# {:keys ~symbolic-arg-list}] | |
(f# ~@symbolic-arg-list)))) | |
(defn inference-wrapper |
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
import java.util.*; | |
public class Main { | |
public static class Map { | |
public static interface Fn<IN, OUT> { | |
public OUT call(final IN in); | |
} |
NewerOlder