Skip to content

std: remove remaining mentions of #425 #16968

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

Closed
wants to merge 1 commit into from
Closed

Conversation

wooster0
Copy link
Contributor

GitHub issue #425 has been closed and this cleans up remaining code that was written when that issue was open.

@mlugg
Copy link
Member

mlugg commented Aug 26, 2023

You can make a function always run at comptime by marking it as inline and wrapping its body in a comptime block. This definitely makes sense to do for versionCheck, and perhaps also for globalOption.

@wooster0
Copy link
Contributor Author

wooster0 commented Aug 26, 2023

I think for now I would rather not do something like that unless necessary. I'm not too sure about it. And builtin.os.isAtLeast which is a similar case that you can find in the diff doesn't do that either. Well, it is inline but it doesn't seem to force comptime within its body. Instead, that's done at each call site which is the way I would do it too.

By the way now that I think about it, wouldn't it make sense for any function where all parameters are comptime to always be evaluated at comptime? Wouldn't it be nice if we just made that a guarantee? Could be that I'm missing some obvious problem with that. Because all input is comptime, it should be able to give a comptime output, though, maybe not if it uses global runtime variables and stuff. Hmm, I guess that doesn't really work if it makes use of anything from outside that's not comptime.

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