Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"!include" vs "!import" vs "include guards" #8

Open
antis81 opened this issue Apr 10, 2021 · 1 comment
Open

"!include" vs "!import" vs "include guards" #8

antis81 opened this issue Apr 10, 2021 · 1 comment

Comments

@antis81
Copy link
Contributor

antis81 commented Apr 10, 2021

The !include meta command does what the name states - so far so good. However it does not check if a file has been included already and multiple !include statements for the same file lead to actual code copies and followup errors in turn.

  • May this actually be useful for some case?
    • What about an additional !import then?
  • Do we need include guards? (kick has #importonce, C++ has #pragma once, etc.)

Personally I prefer !import, but maybe you have something different in mind…

@sasq64
Copy link
Owner

sasq64 commented Apr 11, 2021

I think both, !import to import something once, and an !once at the top of a file to guard it for multiple includes by !include ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants