Macaulay2 / Macaulay2/M2

User-created keywords

Open
#3,593 3 comments 0 reactions 0 assignees View on GitHub
Interpreter
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

Following #3584, compare
```
i1 : symbol ×

o1 = ×

o1 : Symbol

i2 : symbol ⧢

o2 = ⧢

o2 : Keyword
```
Why the difference? because an arbitrary list of symbols has been declared as a keyword (something that I'd rather call a binary operator, but sadly the word `Binary` is used for something completely different in M2. I digress.), i.e., something that's used like this:
```
i3 : 1 ⧢ 2
stdio:3:2:(3): error: no method for binary operator ⧢ applied to objects:
1 (of class ZZ)
⧢ 2 (of class ZZ)
```
But realistically most users are never going to use `⧢` so why this symbol rather than another?
I think it'd make much more sense for users/packages to be able to define their own Keywords. Then the Core should stick to a minimal set of Keywords.
Incidentally note that `new Keyword from ×` will not produce an error (though currently, it probably should, since the result is not what you would expect).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue's three M2 prompt examples and compare the behavior of ×, ⧢, and `new Keyword from ×`. No files or tests are named; the work is not ready for a first-time contributor until the desired user-defined Keyword semantics and a concrete definition of done are agreed.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.