Closure Functions

Posted on Fri 21 May 2021 in Programming • Tagged with first-class functions, python, luajit, javascript • 1 min read

Closure are higher-order functions which return lower-order function (usually first-order function) with its environment. Defining closure functions is possible in languages which has first-class functions like Python, JavaScript, Lua, Scheme, and others.

Example

1
2
3
4
5
6
def divisiblity_check(divisor):
    """Factory for producing functions that check divisiblity with …

Continue reading

First Class Functions

Posted on Thu 20 May 2021 in Programming • Tagged with first-class functions, python, luajit, javascript • 1 min read

In most programming languages, type, object, entity, or value is considered first-class object and hence can be returned from a function, modified or assigned to a variable. If a programming language considers functions as first-class object, then the programming language is said to have first-class functions. Hence, in such programming …


Continue reading