Project

General

Profile

Feature #274

InputForm for output readable as input

Added by Anna Maria Bigatti over 11 years ago. Updated about 10 years ago.

Status:
In Progress
Priority:
Normal
Category:
CoCoA-5 function: new
Target version:
Start date:
20 Jun 2012
Due date:
% Done:

10%

Estimated time:
4.00 h
Spent time:

Description

Compare these

/**/ Record[A := "dsjfhak\"kfdakh"];
Record[A := "dsjfhak\"kfdakh"]

/**/ indent(It);
Record[
  A := "dsjfhak"kfdakh" 
]

John said in Mathematica the function InputForm prints something in a form that could be given as input. In this case printing a string in the definition of indent could be done with such a function.
Apart from strings: would it really be useful?


Related issues

Related to CoCoA-5 - Bug #192: indent prints strings without quotesClosed2012-06-20

Related to CoCoA-5 - Feature #18: Printing matrices: I/O unified style for CoCoA-5?Closed2011-11-02

Related to CoCoA-5 - Design #483: Unique copies of rings in CoCoA-5New2014-03-19

Related to CoCoA-5 - Support #548: Printing rings with IDClosed2014-05-06

History

#1 Updated by Anna Maria Bigatti over 11 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from indent prints strings without quotes to InputForm for output readable as input
  • Category changed from Incomplete function to CoCoA-5 function: new
  • Target version changed from CoCoA-5.0.3 to 10
  • Estimated time changed from 2.00 h to 4.00 h

#2 Updated by Anna Maria Bigatti over 11 years ago

  • % Done changed from 50 to 10

#3 Updated by John Abbott over 11 years ago

We should probably avoid the name InputForm; in the past the people behind Mathematica have not hesitated to sue others (e.g. for using the names Sin, Cos and Tan -- with capital letters).

What should the command/function do? Should it behave much like Print, or should it be function which produces a string?

#4 Updated by Anna Maria Bigatti about 11 years ago

  • Target version changed from 10 to CoCoA-5.0.9

#5 Updated by Anna Maria Bigatti over 10 years ago

  • Target version changed from CoCoA-5.0.9 to CoCoA-5.1.0 Easter14

#6 Updated by John Abbott about 10 years ago

Here are some thoughts about InputForm (or whatever it will be called):
  • it could be a separate command or perhaps a modifier for Print;
  • there is no special need for the output to "look nice" or be easily readable by people;
  • making it "bullet-proof" could be very hard (e.g. see the example in #18 post 3)

Here are some scenarios to consider: the output is valid input...
(A) (in the same CoCoA-5 session) when the current ring is the ring of the object printed
(B) (in the same CoCoA-5 session) regardless of the current ring
(C) in a different CoCoA-5 session regardless of all earlier computations, ring defns, etc
(D) in a brand new CoCoA-5 session

JAA thinks that achieving (C) and/or (D) could be difficult. (A) should be the minimum we offer, while (B) would be nice.

#7 Updated by John Abbott about 10 years ago

  • Target version changed from CoCoA-5.1.0 Easter14 to CoCoA-5.?.?

Also available in: Atom PDF