Some builtins are unnecessarily special (fix #521)

This commit is contained in:
Nicolas Williams committed 2014-08-01 00:20:30 -05:00
1 parent a7878a8d1a
commit a2f99d43c3
2 files changed
+59 -11

No files matched your search

+45
View File
@@ -246,6 +246,51 @@ null
10
[0,9,0,5,"nth doesn't support negative indices"]
#
# Check that various builtins evalute all arguments where appropriate,
# doing cartesian products where appropriate.
#
# Check that limit does work for each value produced by n!
[limit(5,7; range(9))]
null
[0,1,2,3,4,0,1,2,3,4,5,6]
# Same check for nth
[nth(5,7; range(9;0;-1))]
null
[4,2]
# Same check for range/3
[range(0,1,2;4,3,2;2,3)]
null
[0,2,0,3,0,2,0,0,0,1,3,1,1,1,1,1,2,2,2,2]
# Same check for range/1
[range(3,5)]
null
[0,1,2,0,1,2,3,4]
# Same check for index/1, rindex/1, indices/1
[(index(",","|"), rindex(",","|")), indices(",","|")]
"a,b|c,d,e||f,g,h,|,|,i,j"
[1,3,22,19,[1,5,7,12,14,16,18,20,22],[3,9,10,17,19]]
# Same check for join/1
join(",","/")
["a","b","c","d"]
"a,b,c,d"
"a/b/c/d"
# Same check for flatten/1
flatten(-1,3,2,1)
[0, [1], [[2]], [[[3]]]]
[0,[1],[[2]],[[[3]]]]
[0,1,2,3]
[0,1,2,[3]]
[0,1,[2],[[3]]]
#
# Slices
#