Macaulay2 / Macaulay2/M2

extField from RationalPoints2 overtakes symbol "a"

Open
#3,834 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Core
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

The documentation warns:
> **N.B. Any data previously stored in this symbol will be lost!** As is the case for GaloisField.

I think this behavior, which is caused by calling `getSymbol`, should be fixed in GF as well and discouraged in other packages. Here is what can happen:

```m2
i1 : needsPackage "RationalPoints2";

i2 : R = QQ[a,b];

i3 : T = ZZ/2[t];

i4 : extField { t^2+t+1 }

o4 = GF 4

o4 : GaloisField

i5 : a

o5 = a

o5 : GF 4
```
The problem is that a call to `extField` could be happening somewhere deep in an algorithm, and consequently "a" will be taken over without the user knowing where it happened.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing extField and getSymbol in GaloisField and RationalPoints2, reproducing the provided example to identify where symbol "a" is replaced. Done should prevent an unexpected overwrite in GF and establish how similar behavior is discouraged in other packages.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.