πŸ”Quiz

Question 1

Is the following code valid?

namespace A

let a = 1

A. Yes

B. No

Answer

A. Yes ❌

B. No βœ…

β†’ A namespace cannot contain values!


Question 2

Is the following code valid?

namespace A

module B

let a = 1

A. Yes

B. No

Answer

A. Yes ❌

B. No βœ…

β†’ module B is declared as top-level β†’ forbidden after a namespace

Valid equivalent code:

  • Option 1: top-level module

  • Option 2: namespace + local module


Question 3

Give the fully-qualified name for add?

A. add

B. IntHelper.add

C. Utilities.IntHelper.add

D. Common.Utilities.IntHelper.add

Answer

A. add ❌

B. IntHelper.add ❌

C. Utilities.IntHelper.add ❌

D. Common.Utilities.IntHelper.add βœ…

β†’ IntHelper for the parent module β†’ Common.Utilities for the root namespace

Last updated

Was this helpful?