Closed mahrud closed 2 months ago
It's because QQ[x]
is a PolynomialRing
, which inherits from Type
, and Type ??=
is syntactic sugar for calling installMethod
to install a ??=
method for a given type. So it's yelling at us that ring X
isn't a function.
Your use case definitely seems more important than having that particular syntactic sugar. I'll open a PR soonish removing it (probably in the next few days).
Hmm shouldn't the syntax for installing ??=
methods have a key like ((??=, =), Type, Type)
? What is an example of using this syntactic sugar?
Right now they key is just ??=
. So installMethod(symbol ??=, T, f)
will set it so that x ??= y
(when x
is an instance of T
) will call f(x, y)
.
I don't think the syntactic sugar is currently used anywhere outside of the documentation (see installing augmented assignment methods
I'm not sure if I understand. In the bug above, is Type ??= Type
triggering a syntactic sugar for installing a method on (symbol ??=, Type)
? I can't figure out how to use this syntactic sugar without installMethod
.
It's installing a method on (symbol ??=, QQ[x])
Why is this happening?
cc: @d-torrance