aboutsummaryrefslogtreecommitdiff
path: root/src/input/mappkg1.input.pamphlet
blob: 21d98364c5a23809ec7af4631fe50ca4d3bfcfde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input MAPPKG1.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
<<*>>=

-- Input generated from MappingPackageOneXmpPage
)clear all

power(q: FRAC INT, n: INT): FRAC INT == q**n
power(2,3)
rewop := twist power
rewop(3, 2)
square: FRAC INT -> FRAC INT
square:= curryRight(power, 2)
square 4
squirrel:= constantRight(square)$MAPPKG3(FRAC INT,FRAC INT,FRAC INT)
squirrel(1/2, 1/3)
sixteen := curry(square, 4/1)
sixteen()
square2:=square*square
square2  3
sc(x: FRAC INT): FRAC INT == x + 1
incfns := [sc**i for i in 0..10]
[f 4 for f in incfns]
times(n:NNI, i:INT):INT == n*i
r := recur(times)
fact := curryRight(r, 1)
fact 4
mto2ton(m, n) ==
  raiser := square**n
  raiser m
mto2ton(3, 3)
shiftfib(r: List INT) : INT ==
  t := r.1
  r.1 := r.2
  r.2 := r.2 + t
  t
fibinit: List INT := [0, 1]
fibs := curry(shiftfib, fibinit)
[fibs() for i in 0..30]
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}