Macaulay2 / Macaulay2/M2

Creating ring variables from strings

Open
#2,025 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Here is a strange behavior when creating rings from strings. The first attempt gives an error, but the second one succeeds:
```macaulay2
i1 : QQ["x_1"]
stdio:1:1:(3): error: baseName: no base name available

i2 : QQ["x_1"]

o2 = QQ[x_1]

o2 : PolynomialRing
```

This only happens when my string has an underscore in it. In a new session, the following works on the first try
```macaulay2
i1 : QQ["x"]

o1 = QQ[x]

o1 : PolynomialRing
```

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

Reproduce the two QQ["x_1"] attempts in a fresh Macaulay2 session, then trace the ring-creation and string-variable handling entry points involved. Add a regression test showing that an underscored variable name succeeds on its first attempt, and verify that the existing QQ["x"] behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.