Ralf Hemmecke wrote:
> >    toString(x : DoubleFloat) : String ==
> >        unparse(convert(x)@InputForm)
> 
> > Remark: According to Axiom philosophy this function should be
> > called 'coerce' and DoubleFloat should have CoercibleTo(String).
> 
> Yes.
> 
> > But I do not want to try what crazy things interpreter will
> > do with such coercion...
> 
> Very much agreed. But what about "convert"? That should be the standard
> name of such a function that the interpreter should not consider in
> automatic coercions.
>

I am not sure why you think that interpreter should not automaticaly
use "convert".  In 'i-coerce.boot' we have:

coerceOrCroak(triple, t, mapName) ==
  -- this does the coercion and returns the value or dies
  t = $NoValueMode => triple
  t' := coerceOrConvertOrRetract(triple,t)
  t' => objValUnwrap(t')
  mapName = 'noMapName =>
    throwKeyedMsgCannotCoerceWithValue(objVal triple,objMode triple, t)
  sayKeyedMsg("S2IC0005",[mapName])
  throwKeyedMsgCannotCoerceWithValue(objVal triple,objMode triple, t)

as you see the main function is called 'coerceOrConvertOrRetract'
and it tries to use "convert".

"convert" is not used by Spad compiler, but interpreter is different
here.

-- 
                              Waldek Hebisch
[email protected] 

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