4.12.1.3 Function application and 4.12.1.4 Partial function application Flashcards

1
Q

What is a function application?

A

providing the function with its inputs, the process of giving particular inputs to a function
for example add(3,4) represents the application of the function add to integer arguments 3 and 4.

add = lambda x,y: x+y
print (add (3,4))

f: integer x integer→integer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is partial function application?

A

pre-setting some of the arguments and only partially
applying the function

Area = functools.partial(Volume,d=1) 
#running volume function with d = 1
print (Area(2,4)) 
#passing 2 and 4 as h and w in Volume

add: integer→(integer→integer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly