-
Notifications
You must be signed in to change notification settings - Fork 165
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 IsAutoGlobal
for testing whether a variable was declared using DeclareAutoreadableVariables
#3076
Conversation
## <Func Name="IsAutoGlobal" Arg='name'/> | ||
## | ||
## <Description> | ||
## IsAutoGlobal ( <A>name</A> ) returns true if there is a global 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.
I do realize you just copied the style used elsewhere in this file, but this inconsistent with what we do elsewhere. The following three alternatives come to mind (and we sadly use all of them in some place or another; perhaps we ought to come up with some style guidelines for our docs, and try to enforce them globally?)
## IsAutoGlobal ( <A>name</A> ) returns true if there is a global variable | |
## returns true if there is a global variable |
or
## IsAutoGlobal ( <A>name</A> ) returns true if there is a global variable | |
## Returns true if there is a global variable |
or
## IsAutoGlobal ( <A>name</A> ) returns true if there is a global variable | |
## <Ref Func="IsAutoGlobal"/> returns true if there is a global 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.
I'm not opposed to these changes, but I would also prefer if we did try to keep the various *Global
functions consistent with each other, so change them all, or none of them.
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.
OK, then let's do those with another PR someday in the future.
5eaa783
to
86876ba
Compare
Codecov Report
@@ Coverage Diff @@
## master #3076 +/- ##
==========================================
+ Coverage 83.85% 83.85% +<.01%
==========================================
Files 688 688
Lines 343238 343230 -8
==========================================
+ Hits 287818 287822 +4
+ Misses 55420 55408 -12
|
c0da1fe
to
7620653
Compare
I've fixed the bug and added a test for hpcgap (thanks @fingolfin). I'd prefer to not change the docs here, but make larger consistent changes in another PR. |
IsAutoGlobal
for testing whether a variable was declared using DeclareAutoreadableVariables
At the moment there is no way to find if a variable is an "auto" (which means a function will be run when you access it). This is a problem in the (rare) cases where one wants to iterate over every variable in GAP, as just reading the value of an auto variable can cause lots of code to run.
Fixes (hopefully) a bug in the SYNTAX_TREE test