Arthur Ralfs <[email protected]> writes:

| Hi Martin,
| 
| In your scenegraph code you declare function signatures twice, for 
| instance in SCartesian.spad  the Exports part has (via SPointCategory)
| 
|    spnt:(a:DoubleFloat,b:DoubleFloat) -> %
| 
| while the Implementation part has
| 
| 
|      spnt(a:DF,b:DF):% ==
|        pt := new(n+1,0$DF)$Rep
|        pt.0 := a
|        pt.1 := b
|        pt.n := 1...@df
|        pt
| 
| 
| but you could write
| 
|      spnt(a,b) ==
|        pt := new(n+1,0$DF)$Rep
|        pt.0 := a
|        pt.1 := b
|        pt.n := 1...@df
|        pt

agreed.

| 
| Is this a stylistic preference?  In adapting your code to OpenAxiom I 
| would tend to eliminate the second signature declaration except that, 
| since it's your code, I would consider deferring to your wishes on the 
| matter if you feel strongly about it.

My general guideline is to avoid declaring an export twice, or the
signature of an exported function twice.  (It used to be the case
that the orignal AXIOM may miscompile in certain situations.)   

However, in definitions, it may be necessary to mention the type of
the arguments (and return type) again, but only for overload resolution
purposes -- a primary example of this is situation is when you have a
domain that has both CoercibleTo InputForm and CoercibleTo OutputForm.
And I think the compiler treats those cases correctly.

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