version 1.38, 2004/09/11 01:00:42 |
version 1.42, 2004/09/14 02:13:29 |
|
|
% $OpenXM: OpenXM/src/kan96xx/Kan/dr.sm1,v 1.37 2004/09/10 13:20:23 takayama Exp $ |
% $OpenXM: OpenXM/src/kan96xx/Kan/dr.sm1,v 1.41 2004/09/14 02:02:02 takayama Exp $ |
%% dr.sm1 (Define Ring) 1994/9/25, 26 |
%% dr.sm1 (Define Ring) 1994/9/25, 26 |
%% This file is error clean. |
%% This file is error clean. |
|
|
|
|
0 1 << set0 length 1 sub >> |
0 1 << set0 length 1 sub >> |
{ |
{ |
/i set |
/i set |
<< set0 i get >> a eq |
set0 i get tag , a tag , eq { |
{ |
<< set0 i get >> a eq |
/flag 1 def |
{ |
} |
/flag 1 def exit |
{ } |
} |
ifelse |
{ } |
|
ifelse |
|
} { } ifelse |
} for |
} for |
] pop |
] pop |
/arg1 flag def |
/arg1 flag def |
Line 4252 $ [ff ff] fromVectors :: $ |
|
Line 4254 $ [ff ff] fromVectors :: $ |
|
[(list listToArray a) |
[(list listToArray a) |
]] putUsages |
]] putUsages |
|
|
|
/makeInfix { |
|
[(or_attr) 4 4 -1 roll ] extension |
|
} def |
|
[(makeInfix) |
|
[(literal makeInfix) |
|
(Change literal to an infix operator.) |
|
(Example: /+ { add } def ) |
|
( /+ makeInfix) |
|
( /s 0 def 1 1 100 { /i set s + i /s set } for s message) |
|
( [ 1 2 3 ] { /i set i + 2 } map ::) |
|
]] putUsages |
|
|
/usages { |
/usages { |
/arg1 set |
/arg1 set |
[/name /flag /n /k /slist /m /i /sss] pushVariables |
[/name /flag /n /k /slist /m /i /sss /key /ukeys] pushVariables |
[ |
[ |
/name arg1 def |
/name arg1 def |
/flag true def |
/flag true def |
|
{ % begin loop |
|
|
%BUG: should use regular expression in a future. |
name isArray { |
|
/ukeys @.usages { 0 get } map shell def |
|
name { /key set [(regexec) key ukeys] extension |
|
{ 0 get } map } map /sss set |
|
exit |
|
} { } ifelse |
|
|
name tag 1 eq { |
name tag 1 eq { |
@.usages { 0 get } map shell { (, ) nl } map /sss set |
@.usages { 0 get } map shell { (, ) nl } map /sss set |
|
exit |
} { |
} { |
|
|
/sss [ ] def |
/sss [ ] def |
Line 4289 $ [ff ff] fromVectors :: $ |
|
Line 4310 $ [ff ff] fromVectors :: $ |
|
{name Usage /sss [(Usage of ) name ( could not obtained.) nl ] def} |
{name Usage /sss [(Usage of ) name ( could not obtained.) nl ] def} |
{ } |
{ } |
ifelse |
ifelse |
|
exit |
} ifelse |
} ifelse |
|
|
|
} loop |
/arg1 sss cat def |
/arg1 sss cat def |
] pop |
] pop |
popVariables |
popVariables |
Line 4298 $ [ff ff] fromVectors :: $ |
|
Line 4322 $ [ff ff] fromVectors :: $ |
|
[(usages) |
[(usages) |
[(key usages usages-as-a-string) |
[(key usages usages-as-a-string) |
(num usages list-of-key-words) |
(num usages list-of-key-words) |
|
([key1 key2 ... ] usages list-of-key-words : it accepts regular expressions.) |
|
]] putUsages |
|
|
|
/setMinus { |
|
/arg2 set /arg1 set |
|
[/aa /bb /i ] pushVariables |
|
[ |
|
/aa arg1 def /bb arg2 def |
|
[ |
|
0 1 aa length 1 sub { |
|
/i set |
|
aa i get bb memberQ { |
|
} { aa i get } ifelse |
|
} for |
|
] /arg1 set |
|
] pop |
|
popVariables |
|
arg1 |
|
} def |
|
[(setMinus) |
|
[(a b setMinus c) |
]] putUsages |
]] putUsages |
|
|
; |
; |