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

Macro arguments #54

Open
HuseyinSimsek7904 opened this issue Mar 30, 2024 · 0 comments
Open

Macro arguments #54

HuseyinSimsek7904 opened this issue Mar 30, 2024 · 0 comments
Assignees
Labels
compiler Anything about the compiler enhancement New feature or request high-priority

Comments

@HuseyinSimsek7904
Copy link
Member

Currently, macros just expand without being able to take arguments like they do in other languages like C or C++. Arguments can be implemented with the following syntax:

macro smart-list64:init list-name starting-size in  // list-name and starting-size will expand to the argument
  memory list-name sizeof ptr in
    starting-size list64:init list-name !64
endmacro

macro smart-list64:_end list-name in   // list-name will expand to the argument
    list-name list64:mfree drop
  end
endmacro
@HuseyinSimsek7904 HuseyinSimsek7904 added enhancement New feature or request high-priority compiler Anything about the compiler labels Mar 30, 2024
@HuseyinSimsek7904 HuseyinSimsek7904 self-assigned this Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Anything about the compiler enhancement New feature or request high-priority
Projects
None yet
Development

No branches or pull requests

1 participant