在Thinking in Postscript(PDF),第5章,练习3(64-65页),要求读者重构这个代码不存储任何字典条目:LOCAL在Postscript中做了什么?
36 750 moveto /Times-Roman 24 selectfont
% works like “show”, leaving current point at proper location
/ushow
% linethickness lineposition (words) ushow -
{ %def
LOCAL begin
/text exch def
/linepos exch def
/linethick exch def
gsave
0 linepos rmoveto
text stringwidth rlineto
linethick setlinewidth stroke
grestore
text show
end
} dup 0 4 dict put def
0.5 -4 (test underlined text) ushow
我的问题是关于LOCAL
。 Ghostscript的运行没有错误的代码,然而LOCAL
是不是:
- 演习
- 在Postcript语言参考中定义的,在PostScript语言教程和食谱
在PostScript中,什么是LOCAL
?
我不知道一个PS程序是否可以修改可执行数组。这真是鬼鬼祟祟。优秀的答案,谢谢! –
嘿,等等。这意味着PostScript就像LISP:_Code只是你执行的数据。如果你愿意,可以操纵。 –
@WayneConrad是 – joojaa