Skip to content

Exercise 053: Require for Macros #33

Description

@zoedsoupe

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions