On Wed, Dec 3, 2008 at 7:04 AM, Ralf Hemmecke wrote:
>
> Some words to
>
>> http://axiom-wiki.newsynthesis.org/SandBoxNonZeroInteger
>
> Bill, you have implemented 'retract' and friends, but there is no
> 'RetractableTo(NonZeroInteger)'.
>

Yes. Presumably 'RetractableTo(NonZeroInteger)' would have to be
specified in 'Integer'. This is awkward when domains are defined as
SubDomains and in FriCAS there is no extend.

> Since the interpreter does not seem to find 'retract', my
> question to the people who know the interpreter is, when
> will the interpreter *automatically* apply 'retract'?
>

Yes, that is what I is exactly what I was trying to determine.

> What is it actually the interpreter looks up. Does it look for
> the 'CoercibleTo' category or simply for the existance of an
> appropriate 'coerce' function?
>

You need to look at 'src/interp/i-coerce.boot':

As usual there are very few comments. :-( but while browsing take note
of the comment

   -- retract is new name for *pullback*

coerceOrRetract(T,m) ==
  (t' := coerceInteractive(T,m)) => t'
  t := T
  ans := nil
  repeat
    ans => return ans
    t := retract t   -- retract is new name for pullback
    t = 'failed => return ans
    ans := coerceInteractive(t,m)
  ans

--

See especially the routine 'retractByFunction'. It is apparently
looking for the category 'RetractableTo'.

> As far as I remember, the interpreter never applies 'convert'
> or 'retract' automatically. But how does it find out about a
> possible coercion?

I am still uncertain, however I think that there maybe something
missing in the code that is supposed to treat SubDomain as a special
case.

Regards,
Bill Page.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to