Post

Higher-order functions take other functions as arguments. The fun part: you must not inline the call unless the target is constant - otherwise you break semantics (and your VM). #kotlin

A first order function takes parameters, a second order function takes a function as a parameter, a third order function takes a function that takes a function as a parameter, and so on

I think it's useless to try and evaluate the order of a function where the parameter doesn't have a strict static type, because whatever order of function you have, you can always make it have an order one higher. So basically,

Essentially, functions in Python are just one big "function" type, and because the order of a function depends on its parameters, and parameter types can change in Python, it's impossible to know. For example, what would the order of this function be?

def f(g): pass f(lambda: print("hi")) f(lambda x: print(x))

0 reposts0 likes