|
Size: 1125
Comment: converted to 1.6 markup
|
← Revision 7 as of 2017-02-02 02:36:16 ⇥
Size: 0
Comment: deleting "AxiomCompiler", archived by mrennekamp
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| ## Please edit system and help pages ONLY in the moinmaster wiki! For more ## information, please see MoinMaster:MoinPagesEditorGroup. ##master-page:SlideTemplate ##master-date:Unknown-Date #format wiki #language en #pragma section-numbers off <<Navigation(slides)>> = Introduction to the Axiom Library compiler for Python Programmers = SPAD is the 1st generation compiler and Aldor (http://wiki.axiom-developer.org/Aldor) is the 2nd generation compiler for the strongly-typed object-oriented high-level language which is used to implement Axiom's library of over 1,300 mathematical domains and categories. The language is similar in many respects to Python which plays the same role in Sage. Example 1: A prime number sieve to count primes <= n. {{{ #pile #include "axiom.as" import from Boolean, Integer, NonNegativeInteger sieve(n: Integer): Integer == isprime: OneDimensionalArray Boolean := new(n::NonNegativeInteger, true) np:Integer := 0 for p in 2..n | isprime p repeat np := np + 1 for i in (p+p)..n by p repeat isprime i := false np }}} ##[[Navigation(siblings)]] |
