repo.or.cz
/
boa.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
importing python metacircular evaluator into git
[boa.git]
/
boa2
/
tests
/
test_pair.py
blob
b80eb4466d2401c2a5dabe42c40164c74faad5e8
1
from
boa
.
primitives
import
*
2
3
def
test_pair
():
4
x
=
cons
(
1
,
2
)
5
assert
car
(
x
)
is
1
6
assert
cdr
(
x
)
is
2
7
set_car
(
x
,
4
)
8
assert
car
(
x
)
is
4
9
set_cdr
(
x
,
5
)
10
assert
cdr
(
x
)
is
5
11
12
def
test_set_pair
():
13
x
=
cons
(
1
,
cons
(
2
,
3
))
14
set_car
(
cdr
(
x
),
100
)
15
assert
car
(
cdr
(
x
))
is
100
16