Document 12969617

advertisement
 A large part of HP PE/SolidDesigner’s user interface is written in
Common Lisp. Common Lisp is also used as a user-accessible extension
language.
": "
(5+ " :@:;,4: *65;(05 (5 ,?;,5C
:065 3(5.<(., )(:,+ 65 ;/, 4(*96 ,?7(5:065 7(9(+0.4 %/,
<:,9: 057<; *644(5+: (5+ +(;( 0: :,7(9(;,+ 05;6 :05.3,
;62,5: ,(*/ 6- >/0*/ +,56;,: ( *644(5+ -<5*;065 =(90C
()3, 4(*96 5(4, 5<4),9 :;905. 67,9(;69 69 6;/,9 :@5;(*C
;0* ,3,4,5; 644(5+: -<5*;065: (5+ (90;/4,;0*(3 ,?79,:C
:065: (9, ,=(3<(;,+ )@ ;/, 3(5.<(., 05;,979,;,9 (*/ 4(*96
5(4, 0: (::6*0(;,+ >0;/ ( 4(*96 +,-050;065 >/0*/ 0: (56;/,9
;62,5 :,8<,5*, ,0;/,9 79,+,-05,+ )@ ;/, :@:;,4 69 +,-05,+
)@ ;/, <:,9 &/,5 ;/, 3(5.<(., 05;,979,;,9 ,5*6<5;,9: (
4(*96 5(4, 0; :<):;0;<;,: ;/, *699,:765+05. ;62,5 :,C
8<,5*, ;/0: 796*,:: 0: *(33,+ ;/, 4(*96 (5+
*65;05<,: >0;/ ;/, -09:; ;62,5 6- ;/, ,?7(5:065
(*96 ,?7(5:065 3(5.<(.,: (9, ,(:@ ;6 0473,4,5; (5+ /(=,
),,5 <:,+ 05 4(5@ (7730*(;065: >/,9, 65, >6<3+ /(9+3@
,?7,*; ;6 -05+ (5 ,4),++,+ 3(5.<(., 69 ,?(473, ;/, %'
;@7,:,;;05. :@:;,4 *65;(05: ( 4(*96 05;,979,;,9
%/, " "
(5+ " 4(*96 3(5.<(., 05*3<+,:
76>,9-<3 *65;963 *65:;9<*;: :<*/ (: IF/THEN/ELSE (5+ LOOP/
EXIT_IF/END_LOOP 36*(3 =(90()3,: (5+ ( 4,*/(50:4 -69
7(::05. 7(9(4,;,9: ;6 ( 4(*96 >/,5 0; 0: ),05. ,?7(5+,+
%/,:, *65:;9<*;: 4(2, 0; 76::0)3, ;6 :63=, .,5,9(3 796.9(4C
405. 796)3,4: ,*(<:, ;/, " "
(5+ "
4(*96 3(5.<(., 0: 05;,979,;,+ 796.9(4: *(5 ), +,=,367,+
05 (5 05;,9(*;0=, -(:/065 (5+ 46+0-0*(;065: *(5 044,+0(;,3@
), ;90,+ 6<; 6>,=,9 ;/, 9,:<3;05. 796.9(4 0: :36>,9 ;/(5 (
796.9(4 >90;;,5 05 ( *64703,+ 3(5.<(., 302, " "
(5+ " 4(*96: *(5 ), *64703,+ ;6 (5 05;,94,+0(;,
-694 >/0*/ ,?,*<;,: -(:;,9 ;/(5 ;/, 7<9, 05;,979,;,+ =,9C
:065 )<; >/0*/ 0: :;033 :36>,9 ;/(5 (5 ,8<0=(3,5; 796.9(4
!5, +0:(+=(5;(., 6- ;/, " "
(5+ " 4(*96
3(5.<(., 0: ;/(; 0; 0: 565:;(5+(9+ 6 6;/,9 (7730*(;065 <:,:
;/, :(4, 3(5.<(., (5+ 796.9(4: >90;;,5 05 0; /(=, ;6 ),
769;,+ >/,5 ;/, <:,9 :>0;*/,: ;6 (56;/,9 :@:;,4
64465 0:7 >(: */6:,5 (: (5 ,?;,5:065 3(5.<(., -69 "
"$630+,:0.5,9 ),*(<:, 0; 0: 565796790,;(9@ (5+ >0+,3@
<:,+
$<9790:05. (: 0; 4(@ ), 0:7 0: ;/, :,*65+ 63+,:; /0./C3,=,3
796.9(4405. 3(5.<(., :;033 05 *64465 <:, %/, 653@ 63+,9
65, 0: !#%# 0:7 0: ;6 9,:,(9*/,9: 05 (9;0-0*0(3 05;,330C
.,5*, >/(; !#%# 0: ;6 :*0,5;0:;: (5+ ,5.05,,9:
0:7 >(: 05=,5;,+ )@ 6/5 *(9;/@ 05 +<905. ;/,
(9;46<;/ $<44,9 #,:,(9*/ "961,*; 65 9;0-0*0(3 5;,330C
.,5*, %/, -09:; *644653@ <:,+ +0(3,*; >(: 0:7 )<;
<5302, !#%# 69 (5@ 6;/,9 047,9(;0=, 3(5.<(., 0:7 0:
:6 ,(:@ ;6 46+0-@ (5+ ,?;,5+ ;/(; 6=,9 ;04, 0; (*8<09,+
*6<5;3,:: +0--,9,5; +0(3,*;: 69 ( 365. ;04, 46:; 0:7 :@:C
;,4: ),365.,+ ;6 65, 6- ;>6 4(169 -(4030,: 5;,930:7 (5+
(*0:7 )<; :;033 +0--,9,+ 05 +,;(03: 5 +0:*<::065:
()6<; ( *64465 0:7 3(5.<(., >,9, ),.<5 %/, .6(3 >(: ;6
+,-05, ( *69, 3(5.<(., ;6 ), <:,+ (: ( )(:, -69 -<;<9, 0:7
:@:;,4: 5 ;/, 9,3,(:, 6- 64465 0:7 %/, (5.<(.,
796=0+,+ ( -09:; 9,-,9,5*, -69 ;/, 5,> 3(5.<(., 5 $
%,*/50*(3 6440;;,, '
),.(5 ;6 >692 65 ( -694(3
:;(5+(9+0A(;065 05 (5+ +,30=,9,+ ( +9(-; :;(5+(9+ -69
64465 0:7 05 7903 %/0: +9(-; :;(5+(9+ 05*3<+,:
6)1,*;C690,5;,+ 796.9(4405. -,(;<9,: ;/, 64465 0:7
!)1,*; $@:;,4 69 !$ 69 ( 469, +,;(03,+ (**6<5; 65 ;/,
,=63<;065 6- 0:7 :,, *(9;/@ (5+ $;,,3, (5+ ()90,3
;/, 0473,4,5;(;065 6- 64465 0:7 <:,+ 05 " "
$630+,:0.5,9 0: +,90=,+ -964 <:;05 @6;6 64465 0:7
0;:,3- +,:*,5+,+ -964 @6;6 64465 0:7 ; *699,:765+:
;6 ;/, =,9:065 6- ;/, 3(5.<(., +,:*90),+ 05 9,-,9,5*, )<;
(39,(+@ 05*69769(;,: :64, 6- ;/, ,?;,5:065: -964 9,-,9,5*,
(5+ ;/, +9(-; :;(5+(9+
++05. ,?;,5:065 3(5.<(.,: ;6 3(9., (7730*(;065 796.9(4:
/(: ),*64, ( :;(5+(9+ 79(*;0*, ; 796=0+,: 4(5@ (+=(5C
;(.,: :64, 6- >/0*/ 4(@ ), 56; (: 6)=06<: (: 6;/,9: 69
;/, 5694(3 <:,9 6- ( :@:;,4 (5 ,4),++,+ 796.9(4405.
3(5.<(., 4(2,: 0; 76::0)3, ;6 (<;64(;, 9,7,;0;0=, 69 ;,+06<:
;(:2: 5 05,?7,90,5*,+ <:,9 *(5 :,; 0; <7 (: ( :0473, 9,C
*69+73(@)(*2 4,*/(50:4 >/03, B76>,9 <:,9: *(5 <:, 0; ;6
*9,(;, (++0;065(3 -<5*;065(30;@ - ;/, ,?;,5:065 3(5.<(., /(:
;0,: ;6 ;/, (7730*(;065: <:,9 05;,9-(*, <:,9C+,-05,+ -<5*;065C
(30;@ *(5 ), 05;,.9(;,+ (: 0- 0; >,9, 7(9; 6- ;/, 690.05(3
(7730*(;065
- ;/, (7730*(;065 796=0+,: (5 " -69 (++05. ,?;,5:065: 65 (
36>,9 3,=,3 ;/, ,?;,5:065 3(5.<(., *(5 0;:,3- ), ,?;,5+,+
%/0: ,5()3,: 4(2,9: 6- =(3<,C(++,+ :6-;>(9, ;6 05;,.9(;,
;/,09 796+<*;: :,(43,::3@ 05;6 ;/, 4(05 (7730*(;065 : (5
,?(473, ;/, " "$/,,;+=0:69 (7730*(;065 /(: ),,5 04C
73,4,5;,+ >0;/05 " " 6--,905. ( <:,9 05;,9-(*,
*65:0:;,5; >0;/ ;/, 9,:; 6- ;/, 796.9(4
!*;6),9 ,>3,;;C"(*2(9+ 6<95(3
6 % *-2%0 67)4 4357-326 3* 7,) %440-'%7-32 '%2 7,)16)09)6 &)
-140)1)27)( -2 7,) )1&)(()( 0%2+8%+) 2 );%140) :380(
&) 7,) 43480%5 # 1%'6 7);7 )(-735 % 0%5+) 4%57 3* :,-',
-6 :5-77)2 -2 -76 )1&)(()( -64 (-%0)'7
0%5+) 4%57 3* !30-()6-+2)5 733 -6 :5-77)2 -2 -76
3:2 );7)26-32 0%2+8%+)?%&387 4)5')27 %7 7,) 7-1) 3*
:5-7-2+ 367 3* 7,-6 4)5')27 -6 -2 !30-()6-+2)56
86)5 -27)5*%')
-+ 6,3:6 7,) 1%.35 '31432)276 3* !30-()6-+2)5
",) -64 68&6<67)1 -6 %7 7,) 9)5< '35) 73+)7,)5 :-7, 7,)
5%1) 34)5%7-2+ 6<67)1 -27)5*%') %2( ! (%7% 6758'785)
1%2%+)5 6)) %57-'0) 4%+) 13(80)6 00 37,)5 '3143>
2)276 -2'08(-2+ 5%1) %2( ! %5) )1&)(()( -273 7,) -64
68&6<67)1 ",-6 -2(-'%7)6 7,%7 )%', '31432)27 4539-()6 %2
-27)5*%') 7,538+, :,-', -76 34)5%7-326 '%2 &) %'')66)( &<
-64 453+5%16
•
•
•
•
",) -2753(8'7-32 3* 2): *82'7-32%0-7< -273 !30-()>
6-+2)5 -6 868%00< (32) -2 7,) *3003:-2+ 67)46
140)1)27 2): (%7% 6758'785)6 %2( 34)5%7-326 -2 (( -64 45-1-7-9)6 *82'7-326 '%00%&0) *531 -64 *35
%'')66-2+ 7,) 2): 34)5%7-326
(( %'7-32 5387-2)6 73 -140)1)27 2): 86)5>9-6-&0)
'311%2(6 86-2+ 7,) -64 -27)5*%') 73 '%55< 387 7,) %'78%0
34)5%7-326
(( 1)286 (-%03+ &3;)6 35 37,)5 +5%4,-'%0 86)5 -27)5*%')
3&.)'76 73 %'')66 7,) 2): '311%2(6
6 032+ %6 7,) -64 -27)5*%')?7,) 45-1-7-9) *82'7-326?-6
%+5))( 73 -2 %(9%2') 7,-6 453')66 '%2 &) 4%5%00)0-=)( 86)5
-27)5*%') 64)'-%0-67 '%2 :35/ 32 7,) %'7-32 5387-2)6 %2(
1)286 '%00-2+ (811< 9)56-326 3* 7,) -27)5*%') *82'7-326
",) %57-'0) 32 4%+) ()6'5-&)6 *531 % 86)5 -27)5*%') ()>
9)034)56 4)564)'7-9) ,3: %'7-32 5387-2)6 %5) :5-77)2 %2(
,3: 1)286 %2( (-%03+6 %5) '5)%7)( ",) 1)',%2-616 86)(
7,)5) %5) 237 4%57 3* 7,) 31132 -64 67%2(%5( &87 %5)
);7)26-326 4539-()( &< 7,) (-%0)'7
'7-32 5387-2)6 -140)1)27 7,) '311%2(6 7,%7 % 86)5 7<4)6
35 -668)6 9-% 86)5 -27)5*%') )0)1)276 73 !30-()6-+2)5
311%2(6 %5) -()27-*-)( &< 7,)-5 2%1)6 :,-', %5) -64
6<1&306 )9%08%7)( -2 % 64)'-%0 1%22)5 6-1-0%5 73 7,) SYMBOL-MACROLET *%'-0-7< -2 7,) 31132 -64 &.)'7 !<67)1
%', %'7-32 5387-2) -6 %'78%00< %2 -27)545)7)5 *35 % 61%00 0%2>
+8%+) 6-1-0%5 -2 6<27%; 73 7,) '311%2( 0%2+8%+) 86)( -2
%2( -/) %2( '311%2(6 %'7-32 5387-2)6 '%2 &) ()6'5-&)( &< 7,)-5 6<27%;
(-%+5%16 -+ '327%-26 7,) 6<27%; (-%+5%1 *35 % 6-140-*-)(
9)56-32 3* !30-()6-+2)56 );-7 '311%2( )03: 7,)
6<27%; (-%+5%1 -6 % 67%7) 75%26-7-32 +5%4, :,-', 6,3:6 ,3:
7,) '311%2( :-00 &) 453')66)(
",) ()*-2-7-32 3* %2 %'7-32 5387-2) '355)6432(6 '036)0< 73 -76
6<27%; (-%+5%1 ",) ()*-2-2+ -64 );45)66-32 :,)2 )9%08>
%7)( +)2)5%7)6 % 2351%0 -64 *82'7-32 7,%7 :-00 75%9)56) 7,)
75%26-7-32 +5%4, 3* 7,) 67%7) 1%',-2) :,)2 7,) %'7-32 538>
7-2) -6 582 35 );%140) 7,) *3003:-2+ -6 %2 %'7-32 5387-2)
'355)6432(-2+ 73 7,) 6<27%; (-%+5%1 3* -+ (defaction simple_exit
(flag)
; local variable
(; state descriptions
(start nil
“Terminate PE/SolidDesigner?”
nil
(:yes (setq flag t) answer-yes end)
(:no
(setq flag nil) answer-no end)
(otherwise (display_error “Enter either :YES or :NO.”) nil start))
User Interface
(end (do-it)
nil
nil))
Links
(IGES, STEP,
...)
K2
(; local functions
Frame
Advanced
Blending
HCL
DSM
PPG
Advanced Local
Operations
!30-()6-+2)5 6<67)1 %5',-7)'785) -6 7,)
31132 -64 68&6<67)1 00 '31432)276 -2'08(-2+ 5%1)
34)5%7-2+ 6<67)1 -27)5*%') %2( ! (%7% 6758'785) 1%2%+)5
,%9) -27)5*%')6 73 -64 -6 7,) 630-( 13()0-2+ /)52)0 -6
7,) 40%2%5 453*-0) +)2)5%735
'73&)5 ):0)77> %'/%5( 3852%0
(do-it ()
(when flag
(quit)))))
6 '%2 &) 6))2 -2 7,-6 );%140) %2 %'7-32 5387-2) '%2 ,%9)
03'%0 9%5-%&0)6 %2( *82'7-326 3'%0 9%5-%&0)6 6)59) 73 '%55<
-2*351%7-32 *531 67%7) 73 67%7) 3'%0 *82'7-326 '%2 5)(8')
7,) %13827 3* '3() 45)6)27 -2 7,) 67%7) ()6'5-47-326
)2,%2'-2+ 5)%(%&-0-7<
$,)2 75%260%7)6 7,-6 %'7-32 5387-2) ()*-2-7-32 -7 453>
(8')6 % -64 *82'7-32 :,-', :,)2 582 75%9)56)6 7,) 67%7)
75%26-7-32 +5%4, 6,3:2 -2 -+ & * % 67%7) ()6'5-47-32 '32>
7%-26 % 453147 675-2+ %6 -2 7,) start 67%7) -2 7,) );%140) 7,)
75%260%735 %8731%7-'%00< %((6 '3() *35 -668-2+ 7,) 453147
%2( 5)%(-2+ 86)5 -2487 **)'7-9)0< 7,) 75%260%735 '329)576
7,) 6-140) 6<27%; (-%+5%1 -273 7,) 135) ()7%-0)( *351
simple_exit
:YES
;; exit from action routine
(return))))))
:NO
(a)
"3#04+5+104 +0 5*' 45#5' /#%*+0' #3' 53#04(13/'& +051 goto
45#5'/'054 8+5*+0 5*' (60%5+104 $1&: "*' %10&+5+10#. %10=
4536%5 cond 3'23'4'054 &'%+4+104 .+-' 5*' 5*3''=8#: $3#0%* +0
45#5' start '(13' '#%* 45#5' 53#04+5+10 5*' %1&' %#0 53+))'3
#0 '95'30#. '7'05 51 '0#$.' )3#2*+%#. (''&$#%- +0 /'064 13
&+#.1)4
:YES
set flag = t
issue prompt
start
wait for
input
end
:NO
set flag = nil
other input
issue error message
"*' #%56#. 53#04.#5+10 +4 41/'8*#5 /13' %1/2.+%#5'& $'=
%#64' '33134 #0& 15*'3 '9%'25+10#. '7'054 /645 $' 5#-'0 +051
#%%1605 "*' 53#04.#513 #.41 #&&4 %1&' 51 4622135 &'$6))+0)
#0& 231(+.+0) 1( #0 #%5+10 3165+0' "*+4 %1&' +4 453+22'& 165
8*'0 $6+.&+0) # 231&6%5+10 7'34+10 1( !1.+&'4+)0'3
(b)
# !+/2.+(+'& 4:05#9 1( 5*' '9+5 %1//#0& $ !5#5'
53#04+5+10 &+#)3#/ (13 5*' '9+5 %1//#0&
5 *#4 1(5'0 $''0 4#+& 5*#5 +42 +4 +0*'3'05.: 4.18 #0& %#0015
$' #22.+'& 51 #22.+%#5+10 231)3#//+0) 10' %1//10 ,1-' +4
5*#5 5*' .#0)6#)'4 0#/' +4 #0 #%310:/ (13 <#3)' #0&
0%3'&+$.: !.18 31)3#/4 "*+4 +4 015 536' 7'0 7'3: '#3.:
7'34+104 1( +42 *#& %1/2+.'34 +42 4:45'/4 *#7' '7'0
$'#5'0 " 3600+0) 10 5*' 4#/' /#%*+0' +0 5'3/4 1(
06/'3+%#. 2'3(13/#0%'
13 5*' '9#/2.' #%5+10 3165+0' 5*' 53#04.#513 231&6%'4 #
+42 (60%5+10 &'(+0+5+10 /6%* .+-' 5*' (1..18+0)
;; Declarations of some external functions, for more efficient calling
(proclaim ’(function get-parameter (t t) t))
(proclaim ’(function match-otherwise (t) t))
(proclaim ’(function trigger-action-state-transition-event (t &optional t)
t))
;; Transformed action routine
(defun simple_exit (&rest argument-list &aux input)
(let (flag)
;; local variable
(labels ((do-it ()
;; local function
(when flag
(quit))))
•
(block nil
(tagbody
•
;; label for state “start”
1
;; prompting in state “start”
(setq input (get-parameter argument-list “Terminate HP PE/
SolidDesigner?”))
;; pattern matching in state “start”
(cond ((equal input :yes)
(setq flag t) ;; action taken
(trigger-action-state-transition-event ’answer-yes)
(go 0))
;; transition to “end” state
((equal input :no)
(setq flag nil) ;; action taken
(trigger-action-state-transition-event ’answer-no)
(go 0))
;; transition to “end” state
((match-otherwise input)
(display_error “Enter either :YES or :NO.”)
(go 1)))
•
;; transition to “start” state
;; label for state ”end”
0
;; initial action for state “end”
(do-it)
•
•
0 5*' +42 %1/2+.'3 5#-'4 # 1//10 +42 231)3#/
#0& 53#04.#5'4 +5 +051 #0 +05'3/'&+#5' 231)3#/ 8*+%* +4
5*'0 %1/2+.'& $: 5*' 4#/' %1/2+.'3 5*#5 +4 64'& 51
53#04.#5' 5*' 010+42 %1/210'054 1( !1.+&'4+)0'3
"*+4 #2231#%* *#4 4'7'3#. #&7#05#)'4
"*' +42 %1/2+.'3 %#0 $' -'25 4/#.. #0& 4+/2.' 10.:
010%1//'05 .+0'4 1( %1&' .'44 5*#0 1( 5*' 515#.
#/1605 1( +42 %1&'
"*' +42 %1/2+.'3 &1'4 015 0''& 51 $' 3'5#3)'5'& 8*'0
2135+0) 51 # &+(('3'05 /#%*+0' #3%*+5'%563'
"*' +42 %1/2+.'3 &1'4 015 0''& 51 (6..: 125+/+;' 5*'
)'0'3#5'& %1&' 5*+4 5#4- %#0 $' .'(5 51 5*' %1/2+.'3
"*' )'0'3#5'& %1&' +4 (6..: %#.. #0& .+0- %1/2#5+$.' 8+5* 5*'
3'45 1( 5*' 4:45'/
"*' )'0'3#5'& %1&' %#0 $' %107'35'& 51 # 4*#3'& .+$3#3:
#0& &:0#/+%#..: .1#&'& +051 # 3600+0) !1.+&'4+)0'3
"*' +42 %1/2+.'3 +4 +54'.( 83+55'0 +0 +42 115453#22+0) #
0'8 %1/2+.'3 7'34+10 +4 '#4: $'%#64' #0 +05'323'5'3 +4
#7#+.#$.'
"*' %#..+0) %107'05+104 (13 %1/2+.'& +42 (60%5+104 #3' 46%*
5*#5 +05'323'5'& #0& %1/2+.'& (60%5+104 %#0 53#042#3'05.:
%#.. '#%* 15*'3 "*+4 #..184 -''2+0) /145 1( 5*' +42 %1&' +0
%1/2+.'& (13/ '7'0 8*'0 64+0) 5*' +05'323'5'3 51 &'7'.12
0'8 231)3#/4
105+06+0) 5*' #$17' '9#/2.' *'3' +4 5*' %1&' 5*#5 5*'
+42 %1/2+.'3 231&6%'4 (13 5*' 4+/2.+(+'& 53#04.#5'& #%5+10
3165+0' 3'(13/#55'& (13 $'55'3 3'#&#$+.+5:
// Header file declaring standard Lisp data structures and functions
// (for example, LOBJP is the type of a generic pointer-to-Lisp-object)
#include <cmpinclude.h>
// Declarations for the compiled code (normally written to a separate file,
// included here for clarity)
static void L1(...);
static void L2(LOBJP*);
// Functions defined in this file
%51$'3 '8.'55=#%-#3& 1630#.
static char *Cstart;
static int Csize;
static LOBJP Cdata;
static LOBJP VV[14];
// Data for communication with the Lisp
// loader
if(!(equal((V2),VV[1]))){
// First clause of COND construct
goto T8;
}
base[1]= Ct
// (SETQ FLAG T)
(void)((*(LnkLI9))(1,VV[2])); // (TRIGGER-...-EVENT ’ANSWER-YES)
goto T4;
// (GO 0)
T8:;
// Second clause of COND construct
if(!(equal((V2),VV[3]))){
goto T14;
}
base[1]= Cnil;
// (SETQ FLAG NIL)
(void)((*(LnkLI9))(1,VV[4]));
// (TRIGGER-...-EVENT ’ANSWER-NO)
goto T4;
// (GO 0)
T14:;
// Third clause of COND construct
if(((*(LnkLI10))((V2)))==Cnil){
goto T4;
}
base[2]= VV[5];
// (DISPLAY-ERROR “...”)
vs_top=(vs_base=base+2)+1;
(void) (*Lnk11)();
vs_top=sup;
goto T3;
// (GO 1)
T4:;
// Label “0” in TAGBODY
vs_base=vs_top;
// Call (DO-IT), passing a pointer to
L2(base);
// the lexical variables of SIMPLE_EXIT
vs_top=sup;
base[2]= Cnil;
// Return from SIMPLE_EXIT
vs_top=(vs_base=base+2)+1;
return;
}
}
// Run-time Lisp objects
static void LnkT13() ;
// Links to external Lisp functions
static void (*Lnk13)() = LnkT13;
// (see below for an explanation)
static void LnkT11() ;
static void (*Lnk11)() = LnkT11;
static LOBJP LnkTLI10(LOBJP ) ;
static LOBJP (*LnkLI10)(LOBJP ) = LnkTLI10;
static LOBJP LnkTLI9(int narg, ...) ;
static LOBJP (*LnkLI9)(int narg, ...) = LnkTLI9;
static LOBJP LnkTLI8(LOBJP , LOBJP ) ;
static LOBJP (*LnkLI8)(LOBJP , LOBJP ) = LnkTLI8;
// Initialization function, called immediately after the file is loaded
void example_initialize(char *start, int size, LOBJP data)
{
// Reserve space on the Lisp stack
register LOBJP* base=vs_top;
register LOBJP* sup=base+0;
vs_top=sup;
vs_check;
// Store data supplied by the loader, including Lisp objects
// that were extracted from the original source code and that
// will be needed at run-time (e.g., strings and symbols).
Cstart=start;
Csize=size;
Cdata=data;
set_VV_data(VV,14,data,start,size);
}
// Compiled local function DO-IT
// Link the compiled function “L1” to the Lisp symbol stored in VV[6],
// which is ”SIMPLE_EXIT”.
MFnew(VV[6],(void(*)())L1,data);//
// Restore Lisp stack
vs_top=vs_base_mod=base;
}
// Compiled function SIMPLE_EXIT
static void L1(...)
{
register LOBJP*base=vs_base;
register LOBJP*sup=base+3;
vs_check;
{ LOBJP V1;
// Reserve space on the Lisp stack
// Fetch ARGUMENT-LIST from the Lisp
// stack
vs_top[0]=Cnil;
{ LOBJP *p=vs_top;
for(;p>vs_base;p--)p[-1]=MMcons(p[-1],p[0]);
}
V1=(base[0]);
vs_top=sup;
{ LOBJP V2;
// Set up variables INPUT and FLAG
V2= Cnil;
base[1]= Cnil;
T3:;
// Label “1” in TAGBODY
V2= (*(LnkLI8))((V1),VV[0]); // (GET-PARAMETER ARGUMENT-LIST “...”)
static void L2(LOBJP*base0)
{
register LOBJP*base=vs_base;
register LOBJP*sup=base+1;
vs_check;
vs_top=sup;
if((base0[1])==Cnil){
goto T26;
}
vs_base=vs_top;
(void) (*Lnk13)();
return;
T26:;
base[0]= Cnil;
vs_top=(vs_base=base+0)+1;
return;
}
// Reserve space on the Lisp stack
// Condition: lexical variable FLAG
// (QUIT)
// Return from DO-IT
// Links to external functions. These functions are called indirectly, via
// C++ function pointers. At the first call, the corresponding compiled
// function is looked up and stored in the function pointer, thus avoid// ing the Lisp calling overhead on subsequent calls.
static void LnkT13 ()
{ // QUIT; called via normal Lisp calling conventions
call_or_link(VV[13],(int *)&Lnk13);
}
static void LnkT11()
{ // DISPLAY-ERROR; called via normal Lisp calling conventions
call_or_link(VV[11],(int *)&Lnk11);
}
static LOBJP LnkTLI10(LOBJP arg0)
{ // MATCH-OTHERWISE; declared to take exactly one parameter, which
// can be passed without using the Lisp stack.
return(LOBJP)call_fproc(VV[10],(int*)&LnkLI10,1,arg0);
}
static LOBJP LnkTLI9(int narg, ...)
{ // TRIGGER-ACTION-STATE-TRANSITION-EVENT; declared to take one
// fixed and one optional parameter, which can be passed without using
// the Lisp stack.
va_list ap;
va_start(ap, narg);
LOBJP result=(LOBJP)call_vproc(VV[9],(int*)&LnkLI9,narg,ap);
va_end(ap);
return result;
}
static LOBJP LnkTLI8(LOBJP arg0, LOBJP arg1)
{ // GET-PARAMETER; declared to take exactly two parameters, which
// can be passed without using the Lisp stack.
return(LOBJP)call_fproc(VV[8],(int*)&LnkLI8,2,arg0,arg1);
}
$-.7 *<&140* .009786&8*7 7*:*6&0 .14368&28 4634*68.*7 3+ (31@
4.0*) .74 (3)* .678 8-* (3)* 78.00 -&7 83 &((*77 .74
)&8& 46*7*28 .2 8-* 36.,.2&0 463,6&1 +36 *<&140* .8 -&7 83
&88&(- & (314.0*) +92(8.32 83 & .74 7=1'30 2&1.2, 8-&8
+92(8.32 #*(32) 4&6&1*8*6 4&77.2, +36 .74 +92(8.327 .7
979&00= )32* :.& & 7*4&6&8* 78&(/ '98 8-* 3:*6-*&) +36 8-.7
(&2 '* &:3.)*) '= )*(0&6.2, *<8*62&0 +92(8.327 2 & 7.1.0&6
;&= 238 7-3;2 -*6* 8-* 3:*6-*&) 3+ 97.2, .74 )&8& 7869(@
896*7 +36 &6.8-1*8.( (&2 '* &:3.)*) '= .2863)9(.2, 8=4* )*(@
0&6&8.327 ;-.(- &6* 238 (31490736= &7 .2 $-.6) 731*
.74 (327869(87 *, 0*<.(&0 2*78.2, 3+ +92(8.32 )*+.2.8.327
-&:* 23 ).6*(8 *59.:&0*28
314.0.2, & .74 463,6&1 (&2 -&:* 59.8* & )6&1&8.( .14&(8
32 .87 4*6+361&2(* ! !#30.)*7.,2*6 8&/*7 &'398 32*
-&0+ 83 8;3 1.298*7 83 78&68 32 &2 ! #*6.*7 ;36/@
78&8.32 + &00 8-* .74 +.0*7 &6* 03&)*) .2 92(314.0*) +361
78&68 8.1* .2(6*&7*7 83 '*8;**2 32* -&0+ &2) 32* -396
0&6,* 4&68 3+ ! !#30.)*7.,2*6 .7 ;6.88*2 .2 31132
.74 $3 8-* )*:*034*67 8-.7 &4463&(- 3++*6*) & :*6= +0*<@
.'0* .28*6&(8.:* 13)* 3+ 463,6&11.2, $-* +.2.7-*) 463@
,6&17 (&2 '* (314.0*) 83 *0.1.2&8* 8-* 74**) 4*2&08= +36
*2) 97*67
31132 .74 .7 &073 97*) &7 & 97*6@&((*77.'0* *<8*27.32
0&2,9&,* +36 ! !#30.)*7.,2*6 8 .7 & 78&2)&6).>*) 34*2
463,6&11.2, 0&2,9&,* 238 & 46346.*8&6= 32* &7 .2 !
!
&2) ! &2) 8-* )*:*034*67 3+ ! !#30.)@
*7.,2*6 '*0.*:* 8-&8 8-.7 ;.00 463:* 83 '* &2 .11*27*
&):&28&,*
#8**0* 6 # &-01&2 "! &'6.*0 332 &2)
%*.26*' Common Lisp: The Language .,.8&0 !6*77 (&68-= ?.7836= 3+ #! .2 " %*<*0'0&8 *) History of
Programming Languages 323,6&4- #*6.*7 (&)*1.( !6*77
.2&0 49'0.7-*) :*67.32 3+ 8-* Proceedings of the ACM SIGĆ
PLAN History of Programming Languages Conference 37 2,*0*7
&0.+362.& 92* #8**0* 6 &2) "! &'6.*0 ?$-* :3098.32 3+ .74 ProceedĆ
ings of the Second ACM SIGPLAN History of Programming Languages
Conference &1'6.),* &77&(-97*887 46.0 44
@
#8**0* 6 # &-01&2 "! &'6.*0 332
%*.26*' 3'63; *.(-.*0 # **2* .(>&0*7
!*6)9* !.81&2 " %&8*67 &2) %-.8* Common Lisp:
The Language, Second Edition .,.8&0 !6*77 (83'*6 *;0*88@!&(/&6) 3962&0
Download