-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
introduce @call
and remove other builtin calls
#3856
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
Conversation
closes #3732
Calling with a new stack, with a runtime-known stack pointer (e.g. not a global variable) is regressed with this branch. It is now a compile-error, due to the Runtime Hint system not being smart enough to mix a compile-time modifier field with a runtime stack field. I'm OK with this regression because this feature is flawed (see #3268) and may be deleted from the language.
@@ -111,9 +114,11 @@ fn SipHashStateless(comptime T: type, comptime c_rounds: usize, comptime d_round | |||
const m = mem.readIntSliceLittle(u64, b[0..]); | |||
self.v3 ^= m; | |||
|
|||
// TODO this is a workaround, should be able to supply the value without a separate variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a related issue open for this TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only this one 😉 #363
|
I don't think this is true. Can you give an example? |
Wouldn't e.g. |
Implement
@call
. Closes #3732. This supports more options than were previously available:The order here is interesting:
Zig is allowed to follow the arrows, but going against the arrows is a compile error. For example:
This also fixes anonymous struct/tuple literals that had any fields as runtime values.
@noInlineCall
from the language@inlineCall
from the language@newStackCall
from the language.Calling with a new stack, with a runtime-known stack pointer (e.g. not a global variable) is regressed with this branch. It is now a compile-error, due to the Runtime Hint system not being smart enough to mix a compile-time
modifier
field with a runtimestack
field. I'm OK with this regression because this feature is flawed (see #3268) and may be deleted from the language.@asyncCall
will stay for now, and probably will not get removed because the return value has a different meaning than all the rest of the kinds of calls.This is one of 3 prerequisites until var args can be deleted. The other 2 are:
++
operator for tuples