Skip to content

Provide macros for compile-time control - #48

Merged
jessestimpson merged 2 commits into
feature/scrape-formattingfrom
feature/macro
Oct 26, 2026
Merged

jessestimpson merged 2 commits into
feature/scrape-formattingfrom
feature/macro

Conversation

@jessestimpson

Copy link
Copy Markdown
Member

New macros added to give compile-time control to apps.

@jkashimba jkashimba left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment nit. only other thing i noticed is that the return values will change for some of these when disabled. the original stub impl 14d7f61 kept the same shape. probably not a big deal, up to you if you want to do anything about it or not.

also, should have led with "this is awesome, thanks!" =D

Comment thread include/imetrics.hrl Outdated
%% [{d, 'IMETRICS_LEVEL', info}]}]}]}.
%%
%% When compiled out, the call is a no-op. The metric is not recorded, arguments are
%% not evaluated. Avoid depending on the return values of the macro, since when

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when disabled the macros re tick/tock/stats should say that their args are not evaluated except for those passed through to the return value.

@jessestimpson

Copy link
Copy Markdown
Member Author

one comment nit. only other thing i noticed is that the return values will change for some of these when disabled. the original stub impl 14d7f61 kept the same shape. probably not a big deal, up to you if you want to do anything about it or not.

also, should have led with "this is awesome, thanks!" =D

Good find on the return values. I've updated to fit the expected type. Claude assures me that fun() -> V end always compiles to V, so there is no overhead.

@jessestimpson
jessestimpson merged commit 2580693 into master Oct 26, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants