axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Conditional for inner functions in a package.


From: Francois Maltey
Subject: [Axiom-developer] Conditional for inner functions in a package.
Date: 02 Jan 2007 16:44:11 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

First, H-A-P-P-Y new YEAR 2007 for everybody !

A *.spad file can cantain conditionals as 
...
 if R is Integer then
   aFunction x == a definition for integer
 else 
   aFunction x == an other definition
...

But the function << aFunction >> must be an exported function.
If aFunction is a local function in the package the test is always false.

So some packages export a lot of local functions, by example elemntry.spad.

[axiom] )sh EF

all the ixxx functions might be inner functions because 
they are defined after a conditional.
The file elmentry.spad explains :
          -- the following should be local, but are conditional

I can't find any advice about it in the 30-year book. 

Where is the problem ? What can aldor do ?
Export too much functions complicate the use of axiom.

You can test this very short package for expression 
-------------------------------------------------------------------
)abbrev package TRYCOND TryConditions

TryConditions (R, F): Exports == Implementation where
  R : Join (OrderedSet, GcdDomain)
  F : Join (FunctionSpace R, TranscendentalFunctionCategory)

  Exports ==> with
    result    : F -> F
    expResult : F -> F

  Implementation ==> add
    iResult : F -> F
    iResult x == cos x
    expResult x == cos x 
    if R is Integer then
      iResult x == sin x
      expResult x == sin x 
    result x == iResult x
----------------------------------------------------------------------
test 
result (sin x)                     -- sin : right
result (sin %i)                    -- sin, I wait a cos 
expResult (sin x)                  -- sin : right
expResult (sin %i)                 -- cos : right
   




reply via email to

[Prev in Thread] Current Thread [Next in Thread]