by _old_dude_ · 4y ago · 0 comments
record Cache<T, U>(Function<T, U> function) {
U get(T value) { ... }
}
you can use it that way var cache = new Cache<Integer, Integer>(v -> v + 1);
var result = cache.get(3);
with that settings, how do you specify a lambda which is recursive ? and how can you cache the intermediary steps if you can change the signature of get() ?