factor/library/test/lists/namespaces.factor

38 lines
819 B
Factor
Raw Normal View History

2004-08-04 03:12:55 -04:00
IN: scratchpad
USE: lists
USE: namespaces
USE: test
2005-01-28 23:55:22 -05:00
[ [ 1 ] ] [ 1 f "x" set "x" cons@ "x" get ] unit-test
[ [[ 1 2 ]] ] [ 1 2 "x" set "x" cons@ "x" get ] unit-test
[ [ 1 2 ] ] [ 1 [ 2 ] "x" set "x" cons@ "x" get ] unit-test
2004-09-28 00:24:36 -04:00
[ [ [[ 2 3 ]] [[ 1 2 ]] ] ] [
"x" off 2 1 "x" [ acons ] change 3 2 "x" [ acons ] change "x" get
2004-09-28 00:24:36 -04:00
] unit-test
2004-10-03 16:39:32 -04:00
[ [ 5 4 3 1 ] ] [
[ 5 4 3 2 1 ] "x" set
2004-12-10 21:39:27 -05:00
2 "x" [ remove ] change
2004-10-03 16:39:32 -04:00
"x" get
] unit-test
[ [ "hello" f ] ] [
"x" off
f "x" unique@
"hello" "x" unique@
f "x" unique@
5 "x" unique@
f "x" unique@
2004-12-10 21:39:27 -05:00
5 "x" [ remove ] change
2004-10-03 16:39:32 -04:00
"hello" "x" unique@
"x" get
] unit-test
[ [ "xyz" #{ 3 2 }# 1/5 [ { } ] ] ] [
[ "xyz" , "xyz" unique,
#{ 3 2 }# , #{ 3 2 }# unique,
2004-10-03 16:39:32 -04:00
1/5 , 1/5 unique,
[ { } unique, ] make-list , ] make-list
2004-10-03 16:39:32 -04:00
] unit-test