Macaulay2 / M2-emacs

Macaulay2 emacs files
GNU General Public License v3.0
5 stars 3 forks source link

Exclude <-- from comment syntax #49

Open mahrud opened 9 months ago

mahrud commented 9 months ago

I think it might be good to make an exception for <-- when graying out code, for instance here:

i12 : koszul vars R

       1      2      1
o12 = R  <-- R  <-- R

      0      1      2

I think it's very rare for someone to intentionally write < before starting comments. It would have to be something really funky like:

if 0 <-- e.g. QQ or CC
   char R then print "R has positive characteristic"

Perhaps we could even introduce a new symbol <-- and change the interpreter to not take it as comments. This could be used like map(R <-- S, {...}), but maybe that's too much.

The other instance where things are inadvertently commented are lines involving quotients or fractions:

i20 : R = ZZ/101[x,y]

o20 = R

o20 : PolynomialRing

i21 : describe R

       ZZ
o21 = ---[x..y, Degrees => {2:1}, Heft => {1}]
      101

Not sure how to exclude this one from comments, but I think it would be worthwhile.