Exercise 053: Require for Macros
Topic: Module Organization
Level: 12
Difficulty: 2
Prerequisites
- Exercise 052: Import and Alias
- Basic understanding of compilation
Learning Objectives
Students will learn to:
- Use require for modules with macros
- Understand when require is needed
- Know the difference between require and import
Key Concepts
- require ensures module is compiled first
- Needed for macros
- require + import pattern
Exercise Structure
- Explain require is for macros (compile-time code)
- Show example with Integer.is_odd macro
- Task: Use require to access a macro
- Expected output: Successfully using required macro
Hints
You need require for macros because they run at compile-time
References
Exercise 053: Require for Macros
Topic: Module Organization
Level: 12
Difficulty: 2
Prerequisites
Learning Objectives
Students will learn to:
Key Concepts
Exercise Structure
Hints
You need require for macros because they run at compile-time
References