Skip to content
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

Merged
merged 1 commit into from
Jun 9, 2017
Merged

handle scope correctly for @isdefined #22281

merged 1 commit into from
Jun 9, 2017

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Jun 8, 2017

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)).

@vtjnash vtjnash requested a review from yuyichao June 8, 2017 00:23
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)
@vtjnash vtjnash force-pushed the jn/isdefined-local branch from e2acbaf to ef030bd Compare June 8, 2017 04:14
@@ -357,6 +357,7 @@ static Function *jlboundserrorv_func;
static Function *jlcheckassign_func;
static Function *jldeclareconst_func;
static Function *jlgetbindingorerror_func;
static Function *jlboundp_func;
Copy link
Contributor

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?

Copy link
Member Author

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 😆

Copy link
Contributor

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?

Copy link
Member

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

Copy link
Contributor

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

Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Contributor

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

Copy link
Member

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.

@vtjnash vtjnash merged commit 69f3284 into master Jun 9, 2017
@vtjnash vtjnash deleted the jn/isdefined-local branch June 9, 2017 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants