Ralf Hemmecke <[email protected]> writes:

| (1) -> a:X := 1$Integer
| 
|    (1)  1
|                                                   Type: Integer
| 
| Shouldn't that complain, because X is not defined?
| 
| Also the following I find somehow problematic (although it's not
| dramatic since there is an easy workaround).
| 
| ---rhxBEGIN tst.spad
| )abbrev domain MEX MExpression
| 
| Z ==> Integer
| X ==> Expression Z
| 
| MExpression: with
|     0: () -> %
|     coerce: % -> OutputForm
|   == add
|     Rep := X
| 
|     -- auxiliary functions
|     rep(x: %): Rep == x pretend Rep
|     per(x: Rep): % == x pretend %
| 
|     0: % == per((0$Z)::X)
|     coerce(x: %): OutputForm == coerce(rep x)$X
| ---rhxEND tst.spad
| 
| The addition of "$X" in the last line is superfluous since the input
| type for coerce in (coerce rep x) is Rep and the return time could be
| extracted from the lefthand side. So it should be clear which coerce
| to select. Unfortunately, without the "$X" the code compiles, but then
| asking for
| 
|   0$MEX
| 
| seems to run forever.

This should be an FAQ because we have discussed it several times :-)

The short answer is that, in all flavours of AXIOM, if you assign to Rep
then you are asking for implicit coercions between % and Rep -- and that
can lead to unfunny situations as above.

The proper way is to define Rep as a constant, i.e. Rep == X.

-- Gaby

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