Relative Content

Tag Archive for lambda

Are “normal order” and “call-by-name” the same thing?

I was studying the book Structure and Interpretation of Computer Programs and in section 1.1.5 The Substitution Model for Procedure Application the author explains the concepts of normal order and applicative order, which I believe I have understood well.

Why does a Java lambda need to explicitly mention the method of the functional interface?

import java.util.function.Function; public interface Printable { public String print(String s); public static void main(String[] args) { //Printable p = s -> “prefix “+s; Function<String, String> fn = p -> p +” from lambda”; String result = fn.apply(“test”); System.out.println(result); } } What I mean is, fn.apply(“test”) seems unnecessary, since the only possible method is apply. So […]

Interface at the class or function level?

I have been falling into a pattern lately where I have been defining routines that rely on an interface defined by a function that is specified as a parameter to the routine. (The language is C#, but this can be applied to any language with first-class functions.)

Interface at the class or function level?

I have been falling into a pattern lately where I have been defining routines that rely on an interface defined by a function that is specified as a parameter to the routine. (The language is C#, but this can be applied to any language with first-class functions.)

Interface at the class or function level?

I have been falling into a pattern lately where I have been defining routines that rely on an interface defined by a function that is specified as a parameter to the routine. (The language is C#, but this can be applied to any language with first-class functions.)

Interface at the class or function level?

I have been falling into a pattern lately where I have been defining routines that rely on an interface defined by a function that is specified as a parameter to the routine. (The language is C#, but this can be applied to any language with first-class functions.)