repo.or.cz
/
eigenmath-fx.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Little fix after the last commit (mostly a git fail)
[eigenmath-fx.git]
/
product.cpp
blob
1d2d605f01b6c306f5f5378e5ba63953708cf6f8
1
// 'product' function
2
3
#include
"stdafx.h"
4
#include
"defs.h"
5
6
#define A p3
7
#define B p4
8
#define I p5
9
#define X p6
10
11
void
12
eval_product
(
void
)
13
{
14
int
i
,
j
,
k
;
15
16
// 1st arg (quoted)
17
18
X
=
cadr
(
p1
);
19
if
(!
issymbol
(
X
))
20
stop
(
"product: 1st arg?"
);
21
22
// 2nd arg
23
24
push
(
caddr
(
p1
));
25
eval
();
26
j
=
pop_integer
();
27
if
(
j
== (
int
)
0x80000000
)
28
stop
(
"product: 2nd arg?"
);
29
30
// 3rd arg
31
32
push
(
cadddr
(
p1
));
33
eval
();
34
k
=
pop_integer
();
35
if
(
k
== (
int
)
0x80000000
)
36
stop
(
"product: 3rd arg?"
);
37
38
// 4th arg
39
40
p1
=
caddddr
(
p1
);
41
42
B
=
get_binding
(
X
);
43
A
=
get_arglist
(
X
);
44
45
push_integer
(
1
);
46
47
for
(
i
=
j
;
i
<=
k
;
i
++) {
48
push_integer
(
i
);
49
I
=
pop
();
50
set_binding
(
X
,
I
);
51
push
(
p1
);
52
eval
();
53
multiply
();
54
}
55
56
set_binding_and_arglist
(
X
,
B
,
A
);
57
}