-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Add Section for @call #55
Conversation
This patch adds a small section regarding the call builtin.
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.
This can be shortened/made more precise.
@@ -741,6 +741,37 @@ test "precision" { | |||
} | |||
``` | |||
|
|||
# Advanced Function Invocation | |||
Zig offers a `@call` builtin function which gives you more flexibility with which how a function is |
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.
you can shorten this to what @call
does and to me its more about controlling what the compiler does. :)
invoked. There are options to enable or disable tail call optimizations, enable or disable inlining, | ||
as well as force compile time generation. | ||
|
||
Example: |
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.
remove Example:
```zig | ||
const assert = @import("std").debug.assert; | ||
|
||
// These functions are effectively the same but are defined and invoked differently. |
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.
Thats vague. Why are they the same and how invoked differently? Explaining them sounds more understandable to me. Then likely the comments below can also reduced to the key differences.
I think this has gone pretty stale and I'm sure there would be a few merge conflicts. I'm going to close it but if anyone else wants to pick this up, feel free. |
This patch adds a small section regarding the
@call
builtin.Closes #7