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

Convert some useful functions like dump to comptime fns #22864

Open
1 of 2 tasks
StunxFS opened this issue Nov 14, 2024 · 1 comment
Open
1 of 2 tasks

Convert some useful functions like dump to comptime fns #22864

StunxFS opened this issue Nov 14, 2024 · 1 comment
Labels
Feature Request This issue is made to request a feature.

Comments

@StunxFS
Copy link
Contributor

StunxFS commented Nov 14, 2024

Describe the feature

The compiler currently has some keywords that are used as pseudo-functions to get values, my proposal is to remove those keywords and convert them to comptime fns.

The following keywords are used as pseudo-functions:

isreftype
__offsetof
typeof
sizeof

In addition to those keywords, I also include dump. To be consistent with the other comptime fns, such as $res(), $compile_error(), etc., I suggest changing the keywords to comptime fns.

$isreftype
$__offsetof
$typeof
$sizeof
$dump

Use Case

Be consistent with the rest of comptime fns

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

latest

Environment details (OS name and version, etc.)

anywhere

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@StunxFS StunxFS added the Feature Request This issue is made to request a feature. label Nov 14, 2024
@medvednikov
Copy link
Member

I think it's a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request This issue is made to request a feature.
Projects
None yet
Development

No branches or pull requests

2 participants