Project

General

Profile

Design #1051

ReadExpr(P, string) and RingElem(P, string)

Added by Anna Maria Bigatti almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Category:
enhancing/improving
Start date:
24 Apr 2017
Due date:
% Done:

100%

Estimated time:
3.00 h
Spent time:

Description

In cocoalib we have ReadExpr(P, string) and RingElem(P, symbol), but in cocoa-5 they both take a string.
I spent some time debugging a function before realising that I wrote RingElem instead of ReadExpr.
... it does not help they look so similar!

What should RingElem(P, "x+y") do in cocoa-5? Now gives error "illegal character" (from cocoalib)
1 - give a better error (detecting +,-,/,..) -- also in cocoalib
2 - catch the error and give helpful message "did you mean \"ReadExpr\"?"
3 - behave like ReadExpr?
4 - else?


Related issues

Related to CoCoA-5 - Bug #878: RingElem applied to a symbol (repr as a string)Closed2016-05-09

Related to CoCoALib - Feature #1052: ReadExpr(P, string) and RingElem(P, string) in CoCoALibClosed2017-04-26

History

#1 Updated by Anna Maria Bigatti almost 7 years ago

  • Assignee set to Anna Maria Bigatti
  • Target version changed from CoCoA-5.2.2 to CoCoA-5.2.0 spring 2017
  • % Done changed from 0 to 30
  • Estimated time set to 3.00 h

Currently implemented 2, meaningful error message.

#2 Updated by John Abbott almost 7 years ago

If we make RingElem(P, str) behave like ReadExpr(P, str) then ReadExpr becomes essentially redundant.

I think when we designed ReadExpr I had thought about making it a variant of RingElem; now I do not recall why we did not do that.

#3 Updated by John Abbott almost 7 years ago

  • Related to Bug #878: RingElem applied to a symbol (repr as a string) added

#4 Updated by Anna Maria Bigatti almost 7 years ago

OK, I'll implement "3".
Should I modify CoCoALib as well?

#5 Updated by Anna Maria Bigatti almost 7 years ago

Done (cocoa5) and checked in.

#6 Updated by Anna Maria Bigatti almost 7 years ago

  • % Done changed from 30 to 70

#7 Updated by Anna Maria Bigatti almost 7 years ago

  • Related to Feature #1052: ReadExpr(P, string) and RingElem(P, string) in CoCoALib added

#8 Updated by John Abbott almost 7 years ago

  • Status changed from New to In Progress

Should we make ReadExpr obsolescent?

#9 Updated by Anna Maria Bigatti almost 7 years ago

John Abbott wrote:

Should we make ReadExpr obsolescent?

Not before deciding if we want to do the same in CoCoALib.

#10 Updated by Anna Maria Bigatti almost 7 years ago

  • Status changed from In Progress to Resolved

Updated the documentation for RingElem.
Now I'm ready to make ReadExpr obsolescent. Should I do it now or postpone it?

#11 Updated by Anna Maria Bigatti almost 7 years ago

I also made a small improvement to RingElem(Ring, RingElem) for the (effectively useless) case when there is ring change.

#12 Updated by Anna Maria Bigatti almost 7 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 70 to 100

I made ReadExpr obsolescent (in CoCoA-5).
Not convinced 100% it is right, but it's not too wrong either.
documented.
tested.
closed

Also available in: Atom PDF