On 04/14/2017 02:10 PM, oldk1331 wrote:
> There are 8 rational/rational?/rationalIfCan, all
> of them are defined under
>     "if R has IntegerNumberSystem then ..."
> 
> And seems these functions are not used in other places.
> 
> They are basicly wrappers over
>    retractIfCan : % -> Union(Integer, "failed")
> which is from IntegerNumberSystem.
> 
> So I think they are not useful and can be removed.
> Opinions?

Erm, do you think that

  rational: Octonion(R) -> Fraction(Integer)

is not useful?

Maybe it is not used in the library, but I wouldn't call it "not useful".

Same for the meaning of rational in OrderedCompletion(R),
OnePointCompletion(R), Factored(R), QuaternionCategory(R), and
ComplexCategory(R).

Bronstein even introduced

)abbrev package RATRET RationalRetractions
++ Author: Manuel Bronstein
++ Description: rational number testing and retraction functions.
++ Date Created: March 1990
RationalRetractions(S : RetractableTo(Fraction Integer)) : with
    rational     : S -> Fraction Integer
      ++ rational(x) returns x as a rational number;
      ++ error if x is not a rational number;
    rational?    : S -> Boolean
      ++ rational?(x) returns true if x is a rational number,
      ++ false otherwise;
    rationalIfCan : S -> Union(Fraction Integer, "failed")
      ++ rationalIfCan(x) returns x as a rational number,
      ++ "failed" if x is not a rational number;
  == add
    rational s      == retract s
    rational? s     == retractIfCan(s) case Fraction(Integer)
    rationalIfCan s == retractIfCan s

He must have had a good reason to do so. Maybe it's still unused, but I
don't see a good reason to remove it.

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to