axiom-developer
[Top][All Lists]

## [Axiom-developer] Question: local functions

 From: Michael Becker Subject: [Axiom-developer] Question: local functions Date: Wed, 22 Jul 2009 21:30:29 +0200 User-agent: KMail/1.7.1

```
Hi,

are functions local to other functions supported in axiom input files ?

AXIOM Computer Algebra System
Version: Axiom (May 2009)
Timestamp: Sunday June 21, 2009 at 23:34:35
-----------------------------------------------------------------------------
Issue )summary for a summary of useful system commands.
-----------------------------------------------------------------------------

(1) ->
(1) -> )re te3
(1) ->

fallingPower : (Integer,NNI) -> Integer

Type: Void

f :(Integer,INT, NNI,NNI) -> Integer

Type: Void
f(x,r,n,c) == if c = n then r else f(x-1,r*x,n,c+1)

Type: Void

fallingPower (p,n) == f(p,n,1,0)

Type: Void

gpp:(Integer,NNI) -> Integer

Type: Void
gpp (p,n) ==
local g :(Integer,Integer,INT,INT) -> Integer
g(x,r,m,c) == if c = n then r else g(x-1,r*x,m,c+1)
g(p,1,n,0)

Type: Void
(7) -> gpp(13,1)
Compiled code for gpp has been cleared.
Compiling function g with type (Integer,Integer,Integer,Integer) ->
Integer
Compiling function gpp with type (Integer,NonNegativeInteger) ->
Integer
There are no library operations named gpp
Use HyperDoc Browse or issue
)what op gpp
to learn if there is any operation containing " gpp " in its
name.

Cannot find a definition or applicable library operation named gpp
with argument type(s)
Integer
NonNegativeInteger

Perhaps you should use "@" to indicate the required return type,
or "\$" to specify which version of the function you need.
(7) -> )display val g
Definition:
g (x,r,m,c) ==
if c= r
then r
else g(x - 1,r x,m,c + 1)
(7) ->

-- Michael

------------------------------------------------------------------------------------

Diese Nachricht könnte vertrauliche und/oder rechtlich
geschützte Informationen enthalten. Wenn Sie nicht der
Adressat dieser Email sind oder nicht autorisiert sind, diese
für den Adressaten entgegenzunehmen, so ist es untersagt,
diese Nachricht oder in ihr enthaltene Informationen zu nutzen,
zu kopieren, offen zu legen oder anderweitig weiterzuverarbeiten.
Sollten Sie diese Nachricht fälschlicherweise erhalten haben,
verständigen Sie den Absender bitte unverzüglich per Antwort auf
diese Mail und löschen sie diese anschließend.
Vielen Dank für Ihre Kooperation.
------------------------------------------------------------------------------------

This message may contain confidential and/or privileged
information. If you are not the addressee or authorized
disclose or take any action based on this message or any
information herein. If you have received this message in
and delete this message. Thank you for your co-operation.
------------------------------------------------------------------------------------