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

Assignment to Assignment operators does not work #1198

Open
mmatera opened this issue Nov 30, 2024 · 0 comments
Open

Assignment to Assignment operators does not work #1198

mmatera opened this issue Nov 30, 2024 · 0 comments

Comments

@mmatera
Copy link
Contributor

mmatera commented Nov 30, 2024

Description

When I try to overload the assignment operator for a certain kind of expression, a warning message is shown.

How to Reproduce

mathics -e '(F[x_] := s_) ^:= Q[x, s]' -e 'F[1]:=2'

Output Given

UpSetDelayed::write: Tag Pattern in F[x_] := s_ is Protected.
None

Q[1,2]

Expected behavior

The warning message should not be there:

None

Q[1,2]

Your Environment

Mathics 7.0.1dev0
on CPython 3.8.12 (heads/pyston_main:759470647d, Apr 1 2022, 15:36:47)
using SymPy 1.13.3, mpmath 1.3.0, numpy 1.21.4, cython 0.29.25

Workarounds

Surround the first assignment with Quiet

Priority

Low: It just produces a warning, but it should not be there, meaning that we are handling something wrong with the assignment code, or with pattern matching.

Additional context

Overload the assignment operator is used in some WL packages, like CellsToTeX. Also, I want to mimic the formatting algorithm in WMA using WL

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

No branches or pull requests

1 participant