-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Undeprecate {os}_only macros #16658
Undeprecate {os}_only macros #16658
Conversation
Should be put back in the rst docs if we decide to add them back. Now that the work was already done (in Base anyway) I'm in favor of leaving these deprecated since |
Yep, I agree that For readability, I personally find this (in julia 0.4) much clearer than this (after #16219). Re: less obvious: if I'm writing code that needs to be operating system specific, I'll certainly find and use the Anyway, if this is acceptable, it should be merged soon. I'll give it a few days, and if there's no decision made to merge it, I'll put it in a package (and try to figure out how to interact with deprecated macros in |
(Oh, and if this is going to be merged, I'll update the rst docs.) |
You should never really need
you do realize that statement is redundant, right? the |
Wishful thinking aside, currently they often are mutually exclusive, and I think that's clearer when expressed as an if-else. Static could use significantly more descriptive documentation explaining when it is or is not necessary though. |
Yep, I did realize this, and no, I didn't state it very clearly. But what is unclear to me is the difference between top-level and global scope. For example, if I'm defining a function inside a module, I would guess that I'm not at top level scope, and therefore, for all practical reasons, I would need to use static. But I'm not sure enough about this. Either way, that's getting away from the main thrust of this PR, which is whether or not |
there's no difference
everything is in a module |
True. I was confused about "global scope" not extending beyond module boundaries. My bad. Coming back to this PR: after thinking about @tkelman's last response, I guess I can see that using So the |
I preferred the |
The macros are convenient for simple cases, but I also think that the |
I kind of feel that #16219 threw the
os_only
baby out with theos
bathwater, so-to-speak. I think it's great having a macro which statically evaluates items at top scope, but feel that the readability of code using the@{os}_only
macros went down dramatically when they were deprecated. So I'd like to reintroduce them based on the@static
macro, with a few small changes:@osx_only
is now@apple_only
, to match the change in replace osutils macros with@static
#16219@bsd_only
Thoughts/opinions?