Arthur Ralfs <art...@mathbrane.ca> 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 ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel