Quick actions

cmd+k|ctrl+k

Navigation

Languages

20250508(functional programming)

Snippet info

Language

Python

Visibility

public

Author

legacy-v1-22788

Created

2025-05-08T02:31:52.67318Z

Updated

2025-05-17T16:14:44.041978Z

# Play with address concepts
def a():
    print("I am from function a")
    return b
def b():
    print("I am from function b")
    return a
a()()()()()()
print(a,b) # a is a variable stored address of function a, vice versa.

# Another presentation
def a(x):
    print("I am from function a")
    x()
    return a
def b():
    print("I am from function b")
    return a
a(b)(b) # b is a variable stored address of function b
print(a,b) 

# Another presentation
# t[0](t[0](t[1]))
# t[0](t[0](t[1]))
def a(x):
    print("I am from function a")
    return x()
def b():
    print("I am from function b")
    return a
a(b)(b)
print(a,b)

#Delay function managed by address.
def a():
    print("I am from function a")
    return False
def b():
    print("I am from function b")
    return b 
def c():
    print("something")
d = c if a() else b
d()
INFO