Replies: 3 comments 1 reply
-
|
Just because I already asked about this...
|
Beta Was this translation helpful? Give feedback.
-
|
In case this discussion is not yet closed...
Just for a laugh: with v 0.11.2 the doc for |
Beta Was this translation helpful? Give feedback.
-
|
The Julia manual (PDF, page 208) make the following recommendation:
Does Oscar have 3-way booleans? Might be useful for saying "definitely is 1", "definitely is not 1", or "don't know" |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Short version: We offer an alias
is_oneforBase.isone, and several similar ones. Questions:isonebe instead methods and docstrings foris_one?Long version with more details:
We currently are setting up aliases for a bunch of Julia functions (from
Base,LinearAlgebra, possibly more) for consistency with our new naming convention where we writeis_FOOinstead ofisFOO. In particular, we have these (not necessarily complete):For each of these aliases, we have set up a docstring:
Now, there are some subtleties around this, and I think we need to make a few decisions and then enhance the naming convention documentation and possibly the code:
in each package, the aliases are set up at the very end. This is for the sake of the backwards compatibility aliases, which set up aliases like
istrivialforis_trivial, and which thus must come afteris_trivialis declared, so the safest place to do that is at the end. However, for the aliases going in the other direction, we really would want them as soon as possible, at least if we want subsequent code to use them.inside the code of functions, should the OSCAR style guide suggest for new code...
isone(because it's the Julia way)is_one(because it's the Oscar way)For method declaration with docstrings, things are bit more complex: if you write
function is_one(...)with a docstring, then that docstring gets attached tois_one. Now suddenly, some of ourisone/is_onemethods are documented under one name, and some under the other name. Not good. In particular, the docstring which saysis_one is an alias for isonemay now be overlooked among the other docstrings. Some options for how to proceed:function isone(and the first line of the docstring should referenceisone)?is_oneremains at a single entry, the user can see all docstrings at once via?isonefunction is_one(and again the first line of the docstring should referenceis_one)some thoughts related to the previous point
is_oneorisone? (right now it isisonewhich is of course consistent with all our docstrings attached toisone, notis_one, so this goes hand in hand with the previous pointisoneall saying essentially the same is useless anyway. So perhaps we can reduce this to a handful, even a single one. I mention this because it kinda affects the previous point: if we had only a single docstring for it, we might as well attach it tois_one, or even to both...Beta Was this translation helpful? Give feedback.
All reactions