在版图设计中,由于是一个二位的笛卡尔坐标,所以对于list操作经常用到,它是一个2维的lit,常用的表示方法为:
(1)用 :表示一个坐标的list,其结果和list命令一样, 用xCoord和yCoord命令可以分别访问x和y坐标。
xValue = 300
yValue = 400
aCoordinate = xValue:yValue => ( 300 400 )
xCoord( aCoordinate ) => 300
yCoord( aCoordinate ) => 400
(2)用list命令或者符号 ' 来表示一个bBox
注意二者区别:list命令先计算变量或者表达式,然后赋给list,而操作符' 表示的list和字面的一样,不会计算变量或者表达式的值。
bBox = list( 300:400 500:450 ) ;含有 : 的bBox
如果把两个点的坐标组合起来做bBox的话:
含有变量时要用list()函数:
lowerLeft = 300:400
upperRight = 500:450
bBox = list( lowerLeft upperRight )
' 表示的list严格按字面意思,适合不含有变量的情况
bBox = '(( 300 400 ) ( 500 450 ))
对于已有的bBox,我们可以用car和cdr函数配合使用来得到bBox内的每个元素。
list的相关操作还有很多,可以参考User Guide里的Advanced list Operations。