PosScript の型

PosScript の型を調べる命令 type を見つけたので表示させてみます。

GPL Ghostscript 9.06 (2012-08-08)
Copyright (C) 2012 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.

% 1 がスタックに積まれる。
% スタックのトップに対して type が実行されてスタックに詰まれる。
% その要素を == で取り出して表示。
GS>1 type ==
integertype

GS>1.0 type ==
realtype

GS>(hello) type ==   % ()に囲まれたのは文字列です。
stringtype

GS>(\(hello\)) type ==  % () そのものは\でエスケープ
stringtype

GS>1 1 eq ==
true

GS>1 1 eq type ==    % 
booleantype

GS>true type ==
booleantype

GS>false type ==
booleantype

GS>1 1.0 add type ==  % integertype と realtype で計算すると realtype になる。
realtype

GS>null type ==
nulltype

GS>[1 null (hello) 1.2] type ==  % PostScropt の配列は何でも入る
arraytype

GS>[1 [null 3] (hello)] type ==
arraytype

GS>{1 2 add} type ==             % 実行可能配列も配列
arraytype

GS>/verticalPosition type ==
nametype