oldk1331 wrote:
> 
> (1) -> f x == x::FR POLY INT
>                                                                    Type: Void
> (2) -> factorList f(x^2-1)
>    Compiling function f with type Polynomial(Integer) -> Factored(
>       Polynomial(Integer))
> 
>                                2
>    (2)  [[flg = "sqfr",fctr = x  - 1,xpnt = 1]]
> Type: List(Record(flg: Union("nil","sqfr","irred","prime"),fctr:
> Polynomial(Integer),xpnt: Integer))
> (3) -> factorList ((x^2-1)::FR POLY INT)
> 
>    (3)
>    [[flg = "prime",fctr = x - 1,xpnt = 1],[flg = "prime",fctr = x + 1,xpnt = 
> 1]]
> Type: List(Record(flg: Union("nil","sqfr","irred","prime"),fctr:
> Polynomial(Integer),xpnt: Integer))
> 
> 
> Simply wrap this type conversion into a function causes
> different result, I think this is a bug.
> 
> In "f x == x::FR POLY INT", f seems to call 'coerce:R->%'
> from FR POLY INT.  Is the conversion in interpreter a special
> treatment?

Yes.  Interpreter has table of special coercion including
several coercions to Factored.  In particular most of
those coercions seem to call 'factor'.  I have mixed
feeling about this: I find using 'factor' clearer and
in many cases it will be shorter than coercion.  OTOH
in the past it was sometimes hard to invoke correct
'factor' so it is possible that users preffered
coercion.

-- 
                              Waldek Hebisch

-- 
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