Probably the easiest way is to wrap the values in an array. Then you can use a forall
loop to operate on each item.
/map {
6 array astore
{
1 add
} forall
} def
If you want to avoid creating an array, you can use roll
to rearrange the items on the stack.
/map {
6 {
1 add
6 1 roll
} repeat
} def
Also note, in your code you probably don't want that last /x
(it leaves the name on the stack where it will probably get in the way later). And since the top item on the stack is already the top item on the stack, you don't need /x exch def x
. However, you could continue in that style and just make definitions for all 6 values.
/map {
/z exch def
/y exch def
/x exch def
/w exch def
/v exch def
/u exch def
u 1 add
v 1 add
w 1 add
x 1 add
y 1 add
z 1 add
} def
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…