4 ms·
Does the github Java code make use of recursion?
by ProfHewitt 5y ago
Does the github Java code make use of recursion?
- Joker_vD 5y agoAs you can clearly see, it does not. It also doesn't use any forced typecasts to circumvent type checking.
- ProfHewitt 5y agoIs FuncToFunc defined recursively in the excerpt below??? private static interface FuncToTFunc<T> { Func<T> apply(FuncToTFunc<T> x); } BTW, what is "x" in the above? Also is Func defined mutually recursively with FuncToFunc in excerpt below? public static <T> Func<T> Y(final Func<Func<T>> r) { return ((FuncToTFunc<T>) f -> f.apply(f)) .apply( f -> r.apply( x -> f.apply(f).apply(x))); }
- ProfHewitt 5y agoJoker_vD: Looks like you are incorrect because Func and FuncToFunc are defined recursively.
- Joker_vD 5y agoNo, they are not. Do you know what "interface" is in Java, and what is "class"? And what is "method"? Interface Func doesn't refer to FuncToFunc in its declaration, and interface FuncToFunc doesn't refer to Func. The method Y does refer to those two interfaces, but it's declared later than those are, and they don't (and can't, acvtually) refer to it.