inspect应该不是这么用的,不知道你要解决什么问题,如果是要本程序内判断ci的大小,用if-else就可以了。如果ci不是本程序的,需要调用此程序时,可以用inspect,用法如下:7 O2 n2 C- A z" M) ~* C
(number : integer)! k7 g0 q$ D; N1 ^
is & F# j& M0 _3 R; I) c7 i5 ^do ; ~. D6 O4 o1 t9 e# U inspect number ; W9 ]% y: b2 ]5 k when 1 then ' b$ Z$ `# {* j* H, W/ Y
print "not a prime number" 3 L# W9 m' I' Q' O0 ^7 j when 2,5,7,3 then - u! G$ c+ d% i) U5 S
print "prime number" ' k f! N1 P% G+ z6 Q when 9,4 then 9 a; {6 U3 ]& \) g print "square number" ' K4 X, u2 E& h" i3 @9 ^2 c else 9 L% B) M m; c$ f print "no special number";3 W& _" A2 K! P# T. J/ a
print "or number greater than 9";! b: I, z. c) H! L8 Z3 V- M
end;0 N* e& b" r5 X* \; j; k. _
end;