-
-
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
handle scope correctly for @isdefined #22281
Conversation
this allows testing whether a variable is defined, and may be especially useful for emitting from a macro (which may want to conditionally initialize a variable)
e2acbaf
to
ef030bd
Compare
@@ -357,6 +357,7 @@ static Function *jlboundserrorv_func; | |||
static Function *jlcheckassign_func; | |||
static Function *jldeclareconst_func; | |||
static Function *jlgetbindingorerror_func; | |||
static Function *jlboundp_func; |
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.
what is "boundp" supposed to mean?
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 don't name the functions, I just use 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.
wow that's old 691b8be and used in a grand total of 3 places before this PR - maybe it should get a new name that says what it does?
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.
boundp
is a common lisp function for testing whether a variable is bound: http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/fun_boundp.html
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.
that explains where the name came from, but doesn't help anyone reading the code who doesn't already know that figure out at a glance what it does
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.
The intent of my comment was to explain where the name came from.
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.
What's the conclusion, do I need to add renaming of this function to the PR, or is this gtg?
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.
not urgent, we should do a naming-cleanup-pass of the exported API before 1.0 and the unexported APIs after
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 think the renaming can be done separately.
This allows testing whether a variable is defined, and may be especially useful for emitting from a macro (which may want to conditionally initialize a variable).
I expect this will also be very useful when the behavior of dispatch is changed is changed to make static parameters conditionally undefined (#21026 (comment)).