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 musher.fib-num | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic] | |
[musher.numbers])) | |
(defn noo [tag u] | |
(predc u (fn [x] (clojure.core/not= (if (coll? x) (first x) x) tag)))) | |
(defn symbolo [x] (predc x symbol?)) | |
(declare eval-expo) |
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 musher.core | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic] | |
[clojure.pprint])) | |
(defn noo [tag u] | |
(predc u (fn [x] (clojure.core/not= (if (coll? x) (first x) x) tag)))) | |
(defn symbolo [x] (predc x symbol?)) | |
(defn numbero [x] (predc x number?)) |
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
///////////////////////////////////////////////////// | |
// | |
// Moved to repository: | |
// https://github.com/Oregu/_.java | |
// | |
///////////////////////////////////////////////////// | |
import java.util.function.BiFunction; | |
import java.util.function.Function; |
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
Map<String, List<Field>> fieldmap = new HashMap<>(); | |
fieldmap.put("f1", Arrays.asList(new Field("f_str"), new Field("f_abc"))); | |
fieldmap.put("f2", Arrays.asList(new Field("f_int"))); | |
// This is the best I came up with | |
List<String> names = fieldmap.values().stream().collect( | |
ArrayList<String>::new, | |
(l, fs) -> l.addAll(fs.stream().map(Field::getName).collect(toList())), | |
ArrayList<String>::addAll); |