-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Description
Sometimes you find the exact function you need in the standard library, but it's not public. There should be a way to override that and call the function anyway.
In the zig project I'm working on, it works well to:
- std.net.tcpConnectToHost (blocking)
- std.os.setSockFlags to switch socket to nonblocking
- read/write to socket (nonblocking)
The problem is that std.os.setSockFlags is private. This sucks as a user. You either have to copy-paste the function into your project or edit the standard library file.
Options:
- Change @call to work on private functions as is
- Change @call to work on private functions with a new CallOptions modifier .override_private
This would balance the desire to have private functions with giving users an escape hatch and satisfy zig's commitment to "Communicate intent precisely" while serving users well.
What do you think?
jamiiLemonBoy, daurnimator, ifreund, jedisct1, g-w1 and 5 more
Metadata
Metadata
Assignees
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.