factor/library/test/lists/namespaces.factor

18 lines
560 B
Factor
Raw Normal View History

2004-08-04 03:12:55 -04:00
IN: scratchpad
USE: lists
USE: namespaces
USE: test
[ [ 1 2 3 4 ] ] [ [ 3 4 ] [ 1 2 ] ] [ "x" set "x" append@ "x" get ] test-word
[ [ 1 2 3 4 ] ] [ 4 [ 1 2 3 ] ] [ "x" set "x" add@ "x" get ] test-word
[ [ 1 ] ] [ 1 f ] [ "x" set "x" cons@ "x" get ] test-word
[ [ 1 | 2 ] ] [ 1 2 ] [ "x" set "x" cons@ "x" get ] test-word
[ [ 1 2 ] ] [ 1 [ 2 ] ] [ "x" set "x" cons@ "x" get ] test-word
2004-09-28 00:24:36 -04:00
[ [ [ 2 | 3 ] [ 1 | 2 ] ] ] [
"x" off 2 1 "x" acons@ 3 2 "x" acons@ "x" get
] unit-test
[ [ 2 | 3 ] ] [ "x" uncons@ ] unit-test
[ [ 1 | 2 ] ] [ "x" uncons@ ] unit-test