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

Global system bug #336

Merged
merged 4 commits into from
Apr 6, 2016
Merged

Global system bug #336

merged 4 commits into from
Apr 6, 2016

Conversation

sn6uv
Copy link
Member

@sn6uv sn6uv commented Apr 3, 2016

Hit this trying to get the `KnotTheory`` package working in Mathics.

Begin["`System`"]

was returning System, not the fully qualified GlobalSystem. It turns out $Contextwas being set first correctly toGlobal`Systemand reset then toSystem``.

@bnjones does this fix look right to you?

@bnjones
Copy link
Member

bnjones commented Apr 3, 2016

Looks good to me, but what's the effect of not reaching the add_rule on line 258? I can't find anything actually wrong:

In[1]:= $Context = "`test`"
Out[1]= `test`

In[2]:= $Context
Out[2]= Global`test`

In[3]:= Context[`test2]
Out[3]= Global`test`

In[4]:= OwnValues[$Context]
Out[4]= {HoldPattern[$Context] :> Global`test`}

but I don't see where the ownvalues are coming from if we don't add them there?

@bnjones
Copy link
Member

bnjones commented Apr 3, 2016

Oops, I forgot that set_current_context sets an ownvalue as well, so the add_rule is redundant. In that case, for symmetry I think we should also return after calling set_context_path as well.

@sn6uv sn6uv merged commit 053a346 into mathics:master Apr 6, 2016
@sn6uv sn6uv deleted the GlobalSystemBug branch April 6, 2016 12:33
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.

2 participants