Section 1

Preview this deck

Statically Dispatched

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (6)

Section 1

(6 cards)

Statically Dispatched

Front

When a function is known at compile time; the compiler can inline the function (replace the function with the code that it would execute) or discard/simplify code that wouldn't actually run at compile time, for optimization.

Back

What is dynamically dispatched?

Front

https://medium.com/@PavloShadov/https-medium-com-pavloshadov-swift-protocols-magic-of-dynamic-static-methods-dispatches-dfe0e0c85509

Back

How is Swift Polymorphic?

Front

https://www.cosmiclearn.com/swift/polymorphism.php

Back

What is statically dispatched?

Front

- variables in Existential Container - methods added via extension

Back

Dynamically Dispatched

Front

The compiler doesn't necessarily know, during compilation, if the function will run. Rather, during runtime, the system will consult a dispatch table ('witness table' in Swift) for the specific method implementation at runtime.

Back

Existential Container

Front

Variables declared without type but conforming to a protocol are placed in the Existential Container; it represents protocol-typed values.

Back