[BACK]Return to slib.sm1 CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097

Annotation of OpenXM/src/k097/slib.sm1, Revision 1.4

1.1       maekawa     1: K00_verbose  %% if-condition
                      2:   { %%ifbody
                      3:   ( slib.k (slib.ccc): 8/17,1996, 3/4 -- 3/10,1997 ) message    }%%end if if body
                      4:   { %%if- else part
                      5:   } ifelse
                      6: [   ] /Helplist  set
                      7: /HelpAdd {
                      8:  db.DebugStack setstack $In function : HelpAdd of class PrimitiveObject$  stdstack
                      9:  /Arglist set /Argthis set /FunctionValue [ ] def
                     10:  [/this /s  ] /ArgNames set ArgNames pushVariables [ %%function body
                     11:  [Argthis] Arglist join ArgNames mapset
                     12: this [ %% function args
                     13: Helplist s ] {Append} sendmsg2
                     14: /Helplist  set
                     15: /ExitPoint ]pop popVariables %%pop argValues
                     16:  db.DebugStack setstack pop stdstack
                     17: } def
                     18: %%end of function
                     19:
                     20: /Print {
                     21:  db.DebugStack setstack $In function : Print of class PrimitiveObject$  stdstack
                     22:  /Arglist set /Argthis set /FunctionValue [ ] def
                     23:  [/this /a  ] /ArgNames set ArgNames pushVariables [ %%function body
                     24:  [Argthis] Arglist join ArgNames mapset
                     25:  a   messagen /ExitPoint ]pop popVariables %%pop argValues
                     26:  db.DebugStack setstack pop stdstack
                     27: FunctionValue } def
                     28: %%end of function
                     29:
                     30: /Println {
                     31:  db.DebugStack setstack $In function : Println of class PrimitiveObject$  stdstack
                     32:  /Arglist set /Argthis set /FunctionValue [ ] def
                     33:  [/this /a  ] /ArgNames set ArgNames pushVariables [ %%function body
                     34:  [Argthis] Arglist join ArgNames mapset
                     35:  a   message /ExitPoint ]pop popVariables %%pop argValues
                     36:  db.DebugStack setstack pop stdstack
                     37: FunctionValue } def
                     38: %%end of function
                     39:
                     40: /Ln {
                     41:  db.DebugStack setstack $In function : Ln of class PrimitiveObject$  stdstack
                     42:  /Arglist set /Argthis set /FunctionValue [ ] def
                     43:  [/this  ] /ArgNames set ArgNames pushVariables [ %%function body
                     44:  [Argthis]  ArgNames mapset
                     45:   ( ) message /ExitPoint ]pop popVariables %%pop argValues
                     46:  db.DebugStack setstack pop stdstack
                     47: FunctionValue } def
                     48: %%end of function
                     49:
                     50: /Poly {
                     51:  db.DebugStack setstack $In function : Poly of class PrimitiveObject$  stdstack
                     52:  /Arglist set /Argthis set /FunctionValue [ ] def
                     53:  [/this /f  ] /ArgNames set ArgNames pushVariables [ %%function body
                     54:  [Argthis] Arglist join ArgNames mapset
                     55:  f   (poly) data_conversion /FunctionValue set /ExitPoint ]pop popVariables %%pop argValues
                     56:  db.DebugStack setstack pop stdstack
                     57: FunctionValue } def
                     58: %%end of function
                     59:
                     60: /PolyR {
                     61:  db.DebugStack setstack $In function : PolyR of class PrimitiveObject$  stdstack
                     62:  /Arglist set /Argthis set /FunctionValue [ ] def
                     63:  [/this /f /r  ] /ArgNames set ArgNames pushVariables [ %%function body
                     64:  [Argthis] Arglist join ArgNames mapset
                     65:  f  r   ,, /FunctionValue set /ExitPoint ]pop popVariables %%pop argValues
                     66:  db.DebugStack setstack pop stdstack
                     67: FunctionValue } def
                     68: %%end of function
                     69:
                     70: /Degree {
                     71:  db.DebugStack setstack $In function : Degree of class PrimitiveObject$  stdstack
                     72:  /Arglist set /Argthis set /FunctionValue [ ] def
                     73:  [/this /f /v  ] /ArgNames set ArgNames pushVariables [ %%function body
                     74:  [Argthis] Arglist join ArgNames mapset
                     75:  f  v   degree (universalNumber) dc /FunctionValue set /ExitPoint ]pop popVariables %%pop argValues
                     76:  db.DebugStack setstack pop stdstack
                     77: FunctionValue } def
                     78: %%end of function
                     79:
                     80: /Append {
                     81:  db.DebugStack setstack $In function : Append of class PrimitiveObject$  stdstack
                     82:  /Arglist set /Argthis set /FunctionValue [ ] def
                     83:  [/this /f /g  ] /ArgNames set ArgNames pushVariables [ %%function body
                     84:  [Argthis] Arglist join ArgNames mapset
                     85: this [ %% function args
                     86: f [ g   ] ] {Join} sendmsg2
                     87:  /FunctionValue set  {/ExitPoint goto} exec %%return
                     88: /ExitPoint ]pop popVariables %%pop argValues
                     89:  db.DebugStack setstack pop stdstack
                     90: FunctionValue } def
                     91: %%end of function
                     92:
                     93: /Length {
                     94:  db.DebugStack setstack $In function : Length of class PrimitiveObject$  stdstack
                     95:  /Arglist set /Argthis set /FunctionValue [ ] def
                     96:  [/this /f  ] /ArgNames set ArgNames pushVariables [ %%function body
                     97:  [Argthis] Arglist join ArgNames mapset
                     98:  f   length (universalNumber) dc /FunctionValue set /ExitPoint ]pop popVariables %%pop argValues
                     99:  db.DebugStack setstack pop stdstack
                    100: FunctionValue } def
                    101: %%end of function
                    102:
                    103: /Indexed {
                    104:  db.DebugStack setstack $In function : Indexed of class PrimitiveObject$  stdstack
                    105:  /Arglist set /Argthis set /FunctionValue [ ] def
                    106:  [/this /name /i  ] /ArgNames set ArgNames pushVariables [ %%function body
                    107:  [Argthis] Arglist join ArgNames mapset
                    108:  name  i   s.Indexed /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    109:  db.DebugStack setstack pop stdstack
                    110: FunctionValue } def
                    111: %%end of function
                    112:
                    113: /Indexed2 {
                    114:  db.DebugStack setstack $In function : Indexed2 of class PrimitiveObject$  stdstack
                    115:  /Arglist set /Argthis set /FunctionValue [ ] def
                    116:  [/this /name /i /j  ] /ArgNames set ArgNames pushVariables [ %%function body
                    117:  [Argthis] Arglist join ArgNames mapset
                    118:  name  i  j   s.Indexed2 /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    119:  db.DebugStack setstack pop stdstack
                    120: FunctionValue } def
                    121: %%end of function
                    122:
                    123: /Transpose {
                    124:  db.DebugStack setstack $In function : Transpose of class PrimitiveObject$  stdstack
                    125:  /Arglist set /Argthis set /FunctionValue [ ] def
                    126:  [/this /mat  ] /ArgNames set ArgNames pushVariables [ %%function body
                    127:  [Argthis] Arglist join ArgNames mapset
                    128:  mat   transpose /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    129:  db.DebugStack setstack pop stdstack
                    130: FunctionValue } def
                    131: %%end of function
                    132:
                    133:
                    134: /s.Indexed {
                    135:   (integer) dc /arg2 set
                    136:   /arg1 set
                    137:   arg1 ([) arg2 (dollar) dc (]) 4 cat_n
                    138: } def
                    139:
                    140: /s.Indexed2 {
                    141:   (integer) dc /arg3 set
                    142:   (integer) dc /arg2 set
                    143:   /arg1 set
                    144:   arg1 ([) arg2 (dollar) dc (,) arg3 (dollar) dc (]) 6 cat_n
                    145: } def
                    146:  /Groebner {
                    147:  db.DebugStack setstack $In function : Groebner of class PrimitiveObject$  stdstack
                    148:  /Arglist set /Argthis set /FunctionValue [ ] def
                    149:  [/this /F  ] /ArgNames set ArgNames pushVariables [ %%function body
                    150:  [Argthis] Arglist join ArgNames mapset
                    151:  F   {[[(h). (1).]] replace homogenize} map /arg1 set
                    152:                             [arg1] groebner 0 get
                    153:                             /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    154:  db.DebugStack setstack pop stdstack
                    155: FunctionValue } def
                    156: %%end of function
                    157:
                    158: /GroebnerTime {
                    159:  db.DebugStack setstack $In function : GroebnerTime of class PrimitiveObject$  stdstack
                    160:  /Arglist set /Argthis set /FunctionValue [ ] def
                    161:  [/this /F  ] /ArgNames set ArgNames pushVariables [ %%function body
                    162:  [Argthis] Arglist join ArgNames mapset
                    163:  F   {[[(h). (1).]] replace homogenize} map /arg1 set
                    164:                             { [arg1] groebner 0 get } timer
                    165:                             /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    166:  db.DebugStack setstack pop stdstack
                    167: FunctionValue } def
                    168: %%end of function
                    169:
                    170: /LiftStd {
                    171:  db.DebugStack setstack $In function : LiftStd of class PrimitiveObject$  stdstack
                    172:  /Arglist set /Argthis set /FunctionValue [ ] def
                    173:  [/this /F  ] /ArgNames set ArgNames pushVariables [ %%function body
                    174:  [Argthis] Arglist join ArgNames mapset
                    175:  F   {[[(h). (1).]] replace homogenize} map /arg1 set
                    176:                             [arg1 [(needBack)]] groebner
                    177:                             /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    178:  db.DebugStack setstack pop stdstack
                    179: FunctionValue } def
                    180: %%end of function
                    181:
                    182: /Reduction {
                    183:  db.DebugStack setstack $In function : Reduction of class PrimitiveObject$  stdstack
                    184:  /Arglist set /Argthis set /FunctionValue [ ] def
                    185:  [/this /f /G  ] /ArgNames set ArgNames pushVariables [ %%function body
                    186:  [Argthis] Arglist join ArgNames mapset
                    187:  f  G   reduction /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    188:  db.DebugStack setstack pop stdstack
                    189: FunctionValue } def
                    190: %%end of function
                    191:
                    192: /IntegerToSm1Integer {
                    193:  db.DebugStack setstack $In function : IntegerToSm1Integer of class PrimitiveObject$  stdstack
                    194:  /Arglist set /Argthis set /FunctionValue [ ] def
                    195:  [/this /f  ] /ArgNames set ArgNames pushVariables [ %%function body
                    196:  [Argthis] Arglist join ArgNames mapset
                    197:  f   (integer) dc /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    198:  db.DebugStack setstack pop stdstack
                    199: FunctionValue } def
                    200: %%end of function
                    201:
                    202: /RingD {
                    203:  db.DebugStack setstack $In function : RingD of class PrimitiveObject$  stdstack
                    204:  /Arglist set /Argthis set /FunctionValue [ ] def
                    205:  [/this /vList /weightMatrix /pp  ] /ArgNames set ArgNames pushVariables [ %%function body
                    206:  [Argthis] Arglist join ArgNames mapset
                    207: [ %%start of local variables
                    208: /new0 /tmp /size /n /i /j /newtmp /ringpp /argsize ] pushVariables [ %%local variables
                    209: this [ %% function args
                    210: Arglist ] {Length} sendmsg2
                    211: /argsize  set
                    212: argsize (1)..  eq
                    213:  %% if-condition
                    214:   { %%ifbody
                    215:  [  vList  ring_of_differential_operators ( ) elimination_order 0 ] define_ring
1.4     ! takayama  216:          /tmp set  this [ %% function args
        !           217: ] {SetRingVariables} sendmsg2
        !           218: tmp  /FunctionValue set  {/ExitPoint goto} exec %%return
1.1       maekawa   219:   }%%end if if body
                    220:   { %%if- else part
                    221:   } ifelse
                    222: argsize (2)..  eq
                    223:  %% if-condition
                    224:   { %%ifbody
                    225: (0).. /pp  set
                    226:   }%%end if if body
                    227:   { %%if- else part
                    228:   } ifelse
                    229: this [ %% function args
                    230: pp ] {IntegerToSm1Integer} sendmsg2
                    231: /pp  set
                    232: this [ %% function args
                    233: weightMatrix ] {Length} sendmsg2
                    234: /size  set
                    235: this [ %% function args
                    236: size ] {NewVector} sendmsg2
                    237: /new0  set
                    238:   /@@@.indexMode.flag.save @@@.indexMode.flag def    0 @@@.indexMode  (0).. %%PSfor initvalue.
                    239:  (integer) data_conversion
                    240: size  (1).. sub  (integer) data_conversion  1  2 -1 roll
                    241: { %% for body
                    242:  (universalNumber) data_conversion /i  set
                    243: weightMatrix [i  ]  Get
                    244: /tmp  set
                    245: this [ %% function args
                    246: tmp ] {Length} sendmsg2
                    247: /n  set
                    248: this [ %% function args
                    249: n ] {NewVector} sendmsg2
                    250: /newtmp  set
                    251: (1).. /j  set
                    252: %%for init.
                    253: %%for
                    254: { j n  lt
                    255:  {  } {exit} ifelse
                    256: [ {%%increment
                    257: j (2)..  {add} sendmsg2
                    258: /j  set
                    259: } %%end of increment{A}
                    260: {%%start of B part{B}
                    261: newtmp [j (1)..  {sub} sendmsg2
                    262:  ] tmp [j (1)..  {sub} sendmsg2
                    263:  ]  Get
                    264:  Put
                    265: newtmp [j  ] this [ %% function args
                    266: tmp [j  ]  Get
                    267: ] {IntegerToSm1Integer} sendmsg2
                    268:  Put
                    269: } %% end of B part. {B}
                    270:  2 1 roll] {exec} map pop
                    271: } loop %%end of for
                    272: new0 [i  ] newtmp  Put
                    273:   } for
                    274:  [  vList  ring_of_differential_operators   new0   weight_vector  pp   ] define_ring /ringpp  set
1.4     ! takayama  275: this [ %% function args
        !           276: ] {SetRingVariables} sendmsg2
1.1       maekawa   277:   @@@.indexMode.flag.save @@@.indexMode  ringpp  /FunctionValue set  {/ExitPoint goto} exec %%return
                    278: /ExitPoint ]pop popVariables %%pop the local variables
                    279: /ExitPoint ]pop popVariables %%pop argValues
                    280:  db.DebugStack setstack pop stdstack
                    281: FunctionValue } def
                    282: %%end of function
                    283:
                    284: /getxvar {
                    285:  db.DebugStack setstack $In function : getxvar of class PrimitiveObject$  stdstack
                    286:  /Arglist set /Argthis set /FunctionValue [ ] def
                    287:  [/this /i  ] /ArgNames set ArgNames pushVariables [ %%function body
                    288:  [Argthis] Arglist join ArgNames mapset
                    289:  [(x) (var)   i   ..int ] system_variable /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    290:  db.DebugStack setstack pop stdstack
                    291: FunctionValue } def
                    292: %%end of function
                    293:
                    294: /getdvar {
                    295:  db.DebugStack setstack $In function : getdvar of class PrimitiveObject$  stdstack
                    296:  /Arglist set /Argthis set /FunctionValue [ ] def
                    297:  [/this /i  ] /ArgNames set ArgNames pushVariables [ %%function body
                    298:  [Argthis] Arglist join ArgNames mapset
                    299:  [(D) (var)   i   ..int ] system_variable /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    300:  db.DebugStack setstack pop stdstack
                    301: FunctionValue } def
                    302: %%end of function
                    303:
                    304: /getvarn {
                    305:  db.DebugStack setstack $In function : getvarn of class PrimitiveObject$  stdstack
                    306:  /Arglist set /Argthis set /FunctionValue [ ] def
                    307:  [/this  ] /ArgNames set ArgNames pushVariables [ %%function body
                    308:  [Argthis]  ArgNames mapset
                    309:  [(N)] system_variable (universalNumber) dc /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    310:  db.DebugStack setstack pop stdstack
                    311: FunctionValue } def
                    312: %%end of function
                    313:
1.4     ! takayama  314: false /SetRingVariables_Verbose  set
1.1       maekawa   315: /SetRingVariables {
                    316:  db.DebugStack setstack $In function : SetRingVariables of class PrimitiveObject$  stdstack
                    317:  /Arglist set /Argthis set /FunctionValue [ ] def
                    318:  [/this  ] /ArgNames set ArgNames pushVariables [ %%function body
                    319:  [Argthis]  ArgNames mapset
                    320: SetRingVariables_Verbose  %% if-condition
                    321:   { %%ifbody
                    322: this [ %% function args
                    323: (SetRingVariables() Setting the global variables : ) ] {Print} sendmsg2
                    324:   }%%end if if body
                    325:   { %%if- else part
                    326:   } ifelse
                    327: this [ %% function args
1.4     ! takayama  328: (0)..  [(N)] system_variable (universalNumber) dc  ] {k00setRingVariables} sendmsg2
        !           329:  %% if-condition
        !           330:   { %%ifbody
        !           331:   define_ring_variables    }%%end if if body
        !           332:   { %%if- else part
        !           333:   } ifelse
1.1       maekawa   334: SetRingVariables_Verbose  %% if-condition
                    335:   { %%ifbody
                    336: this [ %% function args
                    337: ] {Ln} sendmsg2
                    338:   }%%end if if body
                    339:   { %%if- else part
                    340:   } ifelse
                    341: /ExitPoint ]pop popVariables %%pop argValues
                    342:  db.DebugStack setstack pop stdstack
                    343: FunctionValue } def
                    344: %%end of function
                    345:
                    346: /k00AreThereLeftBrace {
                    347:  db.DebugStack setstack $In function : k00AreThereLeftBrace of class PrimitiveObject$  stdstack
                    348:  /Arglist set /Argthis set /FunctionValue [ ] def
                    349:  [/this /s  ] /ArgNames set ArgNames pushVariables [ %%function body
                    350:  [Argthis] Arglist join ArgNames mapset
                    351: [ %%start of local variables
                    352: /leftBrace /jj /slist ] pushVariables [ %%local variables
                    353:   $[$ (array) dc 0 get (universalNumber) dc  /leftBrace  set
                    354: this [ %% function args
                    355: this [ %% function args
                    356: s ] {StringToIntegerArray} sendmsg2
                    357: leftBrace ] {Position} sendmsg2
                    358: /jj  set
                    359: jj (1)..  (0)..  2 1 roll {sub} sendmsg
                    360:  eq not
                    361:  %% if-condition
                    362:   { %%ifbody
                    363: true  /FunctionValue set  {/ExitPoint goto} exec %%return
                    364:   }%%end if if body
                    365:   { %%if- else part
                    366: false  /FunctionValue set  {/ExitPoint goto} exec %%return
                    367:   } ifelse
                    368: /ExitPoint ]pop popVariables %%pop the local variables
                    369: /ExitPoint ]pop popVariables %%pop argValues
                    370:  db.DebugStack setstack pop stdstack
                    371: FunctionValue } def
                    372: %%end of function
                    373:
                    374: /k00setRingVariables {
                    375:  db.DebugStack setstack $In function : k00setRingVariables of class PrimitiveObject$  stdstack
                    376:  /Arglist set /Argthis set /FunctionValue [ ] def
1.4     ! takayama  377:  [/this /p /q  ] /ArgNames set ArgNames pushVariables [ %%function body
1.1       maekawa   378:  [Argthis] Arglist join ArgNames mapset
                    379: [ %%start of local variables
1.4     ! takayama  380: /v /i ] pushVariables [ %%local variables
        !           381: p /i  set
        !           382: %%for init.
        !           383: %%for
        !           384: { i q  lt
        !           385:  {  } {exit} ifelse
        !           386: [ {%%increment
        !           387: /i i (1).. {add} sendmsg2 def
        !           388: } %%end of increment{A}
        !           389: {%%start of B part{B}
1.1       maekawa   390: this [ %% function args
1.4     ! takayama  391: i ] {getxvar} sendmsg2
        !           392: /v  set
1.1       maekawa   393: this [ %% function args
1.4     ! takayama  394: v ] {k00AreThereLeftBrace} sendmsg2
1.1       maekawa   395:  %% if-condition
                    396:   { %%ifbody
1.4     ! takayama  397: false  /FunctionValue set  {/ExitPoint goto} exec %%return
1.1       maekawa   398:   }%%end if if body
                    399:   { %%if- else part
                    400:   } ifelse
                    401: this [ %% function args
1.4     ! takayama  402: i ] {getdvar} sendmsg2
        !           403: /v  set
1.1       maekawa   404: this [ %% function args
1.4     ! takayama  405: v ] {k00AreThereLeftBrace} sendmsg2
1.1       maekawa   406:  %% if-condition
                    407:   { %%ifbody
1.4     ! takayama  408: false  /FunctionValue set  {/ExitPoint goto} exec %%return
1.1       maekawa   409:   }%%end if if body
                    410:   { %%if- else part
                    411:   } ifelse
1.4     ! takayama  412: } %% end of B part. {B}
        !           413:  2 1 roll] {exec} map pop
        !           414: } loop %%end of for
        !           415: true  /FunctionValue set  {/ExitPoint goto} exec %%return
1.1       maekawa   416: /ExitPoint ]pop popVariables %%pop the local variables
                    417: /ExitPoint ]pop popVariables %%pop argValues
                    418:  db.DebugStack setstack pop stdstack
1.4     ! takayama  419: FunctionValue } def
1.1       maekawa   420: %%end of function
                    421:
                    422: /AddString {
                    423:  db.DebugStack setstack $In function : AddString of class PrimitiveObject$  stdstack
                    424:  /Arglist set /Argthis set /FunctionValue [ ] def
                    425:  [/this /f  ] /ArgNames set ArgNames pushVariables [ %%function body
                    426:  [Argthis] Arglist join ArgNames mapset
                    427:  f    aload length cat_n /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    428:  db.DebugStack setstack pop stdstack
                    429: FunctionValue } def
                    430: %%end of function
                    431:
                    432: /IntegerToString {
                    433:  db.DebugStack setstack $In function : IntegerToString of class PrimitiveObject$  stdstack
                    434:  /Arglist set /Argthis set /FunctionValue [ ] def
                    435:  [/this /f  ] /ArgNames set ArgNames pushVariables [ %%function body
                    436:  [Argthis] Arglist join ArgNames mapset
                    437:  f   (string) dc /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    438:  db.DebugStack setstack pop stdstack
                    439: FunctionValue } def
                    440: %%end of function
                    441:
                    442: /Replace {
                    443:  db.DebugStack setstack $In function : Replace of class PrimitiveObject$  stdstack
                    444:  /Arglist set /Argthis set /FunctionValue [ ] def
                    445:  [/this /f /rule  ] /ArgNames set ArgNames pushVariables [ %%function body
                    446:  [Argthis] Arglist join ArgNames mapset
                    447:  f  rule   replace /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    448:  db.DebugStack setstack pop stdstack
                    449: FunctionValue } def
                    450: %%end of function
                    451:
                    452: /AsciiToString {
                    453:  db.DebugStack setstack $In function : AsciiToString of class PrimitiveObject$  stdstack
                    454:  /Arglist set /Argthis set /FunctionValue [ ] def
                    455:  [/this /c  ] /ArgNames set ArgNames pushVariables [ %%function body
                    456:  [Argthis] Arglist join ArgNames mapset
                    457:  c   (integer) dc (string) dc /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    458:  db.DebugStack setstack pop stdstack
                    459: FunctionValue } def
                    460: %%end of function
                    461:
                    462: /ToString {
                    463:  db.DebugStack setstack $In function : ToString of class PrimitiveObject$  stdstack
                    464:  /Arglist set /Argthis set /FunctionValue [ ] def
                    465:  [/this /p  ] /ArgNames set ArgNames pushVariables [ %%function body
                    466:  [Argthis] Arglist join ArgNames mapset
                    467: [ %%start of local variables
                    468: /n /ans /i ] pushVariables [ %%local variables
                    469: [   ] /ans  set
                    470: this [ %% function args
                    471: p ] {IsArray} sendmsg2
                    472:  %% if-condition
                    473:   { %%ifbody
                    474: this [ %% function args
                    475: p ] {Length} sendmsg2
                    476: /n  set
                    477: this [ %% function args
                    478: ans ([ ) ] {Append} sendmsg2
                    479: /ans  set
                    480: (0).. /i  set
                    481: %%for init.
                    482: %%for
                    483: { i n  lt
                    484:  {  } {exit} ifelse
                    485: [ {%%increment
                    486: /i i (1).. {add} sendmsg2 def
                    487: } %%end of increment{A}
                    488: {%%start of B part{B}
                    489: this [ %% function args
                    490: ans this [ %% function args
                    491: p [i  ]  Get
                    492: ] {ToString} sendmsg2
                    493: ] {Append} sendmsg2
                    494: /ans  set
                    495: i n (1)..  {sub} sendmsg2
                    496:  eq not
                    497:  %% if-condition
                    498:   { %%ifbody
                    499: this [ %% function args
                    500: ans ( , ) ] {Append} sendmsg2
                    501: /ans  set
                    502:   }%%end if if body
                    503:   { %%if- else part
                    504:   } ifelse
                    505: } %% end of B part. {B}
                    506:  2 1 roll] {exec} map pop
                    507: } loop %%end of for
                    508: this [ %% function args
                    509: ans ( ] ) ] {Append} sendmsg2
                    510: /ans  set
                    511:   }%%end if if body
                    512:   { %%if- else part
                    513: [  p   (dollar) dc    ] /ans  set
                    514:   } ifelse
                    515: this [ %% function args
                    516: ans ] {AddString} sendmsg2
                    517:  /FunctionValue set  {/ExitPoint goto} exec %%return
                    518: /ExitPoint ]pop popVariables %%pop the local variables
                    519: /ExitPoint ]pop popVariables %%pop argValues
                    520:  db.DebugStack setstack pop stdstack
                    521: FunctionValue } def
                    522: %%end of function
                    523:
                    524: /IsArray {
                    525:  db.DebugStack setstack $In function : IsArray of class PrimitiveObject$  stdstack
                    526:  /Arglist set /Argthis set /FunctionValue [ ] def
                    527:  [/this /p  ] /ArgNames set ArgNames pushVariables [ %%function body
                    528:  [Argthis] Arglist join ArgNames mapset
                    529:  p   isArray /FunctionValue set   /ExitPoint ]pop popVariables %%pop argValues
                    530:  db.DebugStack setstack pop stdstack
                    531: FunctionValue } def
                    532: %%end of function
                    533:
                    534: /Denominator {
                    535:  db.DebugStack setstack $In function : Denominator of class PrimitiveObject$  stdstack
                    536:  /Arglist set /Argthis set /FunctionValue [ ] def
                    537:  [/this /f  ] /ArgNames set ArgNames pushVariables [ %%function body
                    538:  [Argthis] Arglist join ArgNames mapset
                    539:  f   (denominator) dc /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    540:  db.DebugStack setstack pop stdstack
                    541: FunctionValue } def
                    542: %%end of function
                    543:
                    544: /Numerator {
                    545:  db.DebugStack setstack $In function : Numerator of class PrimitiveObject$  stdstack
                    546:  /Arglist set /Argthis set /FunctionValue [ ] def
                    547:  [/this /f  ] /ArgNames set ArgNames pushVariables [ %%function body
                    548:  [Argthis] Arglist join ArgNames mapset
                    549:  f   (numerator) dc /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    550:  db.DebugStack setstack pop stdstack
                    551: FunctionValue } def
                    552: %%end of function
                    553:
                    554: /Replace {
                    555:  db.DebugStack setstack $In function : Replace of class PrimitiveObject$  stdstack
                    556:  /Arglist set /Argthis set /FunctionValue [ ] def
                    557:  [/this /f /rule  ] /ArgNames set ArgNames pushVariables [ %%function body
                    558:  [Argthis] Arglist join ArgNames mapset
                    559: [ %%start of local variables
                    560: /ans /n /tmp /i /num /den ] pushVariables [ %%local variables
                    561: this [ %% function args
                    562: f ] {IsArray} sendmsg2
                    563:  %% if-condition
                    564:   { %%ifbody
                    565: this [ %% function args
                    566: f ] {Length} sendmsg2
                    567: /n  set
                    568: [   ] /ans  set
                    569: (0).. /i  set
                    570: %%for init.
                    571: %%for
                    572: { i n  lt
                    573:  {  } {exit} ifelse
                    574: [ {%%increment
                    575: /i i (1).. {add} sendmsg2 def
                    576: } %%end of increment{A}
                    577: {%%start of B part{B}
                    578: this [ %% function args
                    579: ans this [ %% function args
                    580: f [i  ]  Get
                    581: rule ] {Replace} sendmsg2
                    582: ] {Append} sendmsg2
                    583: /ans  set
                    584: } %% end of B part. {B}
                    585:  2 1 roll] {exec} map pop
                    586: } loop %%end of for
                    587: ans  /FunctionValue set  {/ExitPoint goto} exec %%return
                    588:   }%%end if if body
                    589:   { %%if- else part
                    590:   } ifelse
                    591:  f   tag RationalFunctionP eq   %% if-condition
                    592:   { %%ifbody
                    593: this [ %% function args
                    594: f ] {Numerator} sendmsg2
                    595: /num  set
                    596: this [ %% function args
                    597: f ] {Denominator} sendmsg2
                    598: /den  set
                    599:  num  rule   replace  /num  set
                    600:  den  rule   replace  /den  set
                    601: num den  {div} sendmsg2
                    602:  /FunctionValue set  {/ExitPoint goto} exec %%return
                    603:   }%%end if if body
                    604:   { %%if- else part
                    605:   } ifelse
                    606:  f  rule   replace /FunctionValue set  /ExitPoint ]pop popVariables %%pop the local variables
                    607: /ExitPoint ]pop popVariables %%pop argValues
                    608:  db.DebugStack setstack pop stdstack
                    609: FunctionValue } def
                    610: %%end of function
                    611:
                    612: /Map {
                    613:  db.DebugStack setstack $In function : Map of class PrimitiveObject$  stdstack
                    614:  /Arglist set /Argthis set /FunctionValue [ ] def
                    615:  [/this /karg /func  ] /ArgNames set ArgNames pushVariables [ %%function body
                    616:  [Argthis] Arglist join ArgNames mapset
                    617:  karg   { [ 2 -1 roll ] this 2 -1 roll [(parse)   func   ] extension pop } map /FunctionValue set /ExitPoint ]pop popVariables %%pop argValues
                    618:  db.DebugStack setstack pop stdstack
                    619: FunctionValue } def
                    620: %%end of function
                    621:
                    622: this [ %% function args
                    623: [ (Map) [ (Map(karg,func) applies the function <<func>> to the <<karg>>(string func).) ( Ex. Map([82,83,85],"AsciiToString"):)   ]   ] ] {HelpAdd} sendmsg2
                    624: /Position {
                    625:  db.DebugStack setstack $In function : Position of class PrimitiveObject$  stdstack
                    626:  /Arglist set /Argthis set /FunctionValue [ ] def
                    627:  [/this /list /elem  ] /ArgNames set ArgNames pushVariables [ %%function body
                    628:  [Argthis] Arglist join ArgNames mapset
                    629: [ %%start of local variables
                    630: /n /pos /i ] pushVariables [ %%local variables
                    631: this [ %% function args
                    632: list ] {Length} sendmsg2
                    633: /n  set
                    634: (1)..  (0)..  2 1 roll {sub} sendmsg
                    635: /pos  set
                    636: (0).. /i  set
                    637: %%for init.
                    638: %%for
                    639: { i n  lt
                    640:  {  } {exit} ifelse
                    641: [ {%%increment
                    642: /i i (1).. {add} sendmsg2 def
                    643: } %%end of increment{A}
                    644: {%%start of B part{B}
                    645: elem list [i  ]  Get
                    646:  eq
                    647:  %% if-condition
                    648:   { %%ifbody
                    649: i /pos  set
                    650:   /k00.label0 goto    }%%end if if body
                    651:   { %%if- else part
                    652:   } ifelse
                    653: } %% end of B part. {B}
                    654:  2 1 roll] {exec} map pop
                    655: } loop %%end of for
                    656:   /k00.label0  pos  /FunctionValue set  {/ExitPoint goto} exec %%return
                    657: /ExitPoint ]pop popVariables %%pop the local variables
                    658: /ExitPoint ]pop popVariables %%pop argValues
                    659:  db.DebugStack setstack pop stdstack
                    660: FunctionValue } def
                    661: %%end of function
                    662:
                    663: this [ %% function args
                    664: [ (Position) [ (Position(list,elem) returns the position p of the element <<elem>> in) ( the array <<list>>. If <<elem>> is not in <<list>>, it return -1) ( (array list).) (Ex. Position([1,34,2],34): )   ]   ] ] {HelpAdd} sendmsg2
                    665: /StringToIntegerArray {
                    666:  db.DebugStack setstack $In function : StringToIntegerArray of class PrimitiveObject$  stdstack
                    667:  /Arglist set /Argthis set /FunctionValue [ ] def
                    668:  [/this /s  ] /ArgNames set ArgNames pushVariables [ %%function body
                    669:  [Argthis] Arglist join ArgNames mapset
                    670:  s   (array) dc { (universalNumber) dc } map /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    671:  db.DebugStack setstack pop stdstack
                    672: FunctionValue } def
                    673: %%end of function
                    674:
                    675: this [ %% function args
                    676: [ (StringToIntegerArray) [ (StringToIntegerArray(s) decomposes the string <<s>> into an array of) (ascii codes of <<s>>  (string s).) (cf. AsciiToString.)   ]   ] ] {HelpAdd} sendmsg2
                    677: /StringToAsciiArray {
                    678:  db.DebugStack setstack $In function : StringToAsciiArray of class PrimitiveObject$  stdstack
                    679:  /Arglist set /Argthis set /FunctionValue [ ] def
                    680:  [/this /s  ] /ArgNames set ArgNames pushVariables [ %%function body
                    681:  [Argthis] Arglist join ArgNames mapset
                    682: this [ %% function args
                    683: s ] {StringToIntegerArray} sendmsg2
                    684:  /FunctionValue set  {/ExitPoint goto} exec %%return
                    685: /ExitPoint ]pop popVariables %%pop argValues
                    686:  db.DebugStack setstack pop stdstack
                    687: FunctionValue } def
                    688: %%end of function
                    689:
                    690: this [ %% function args
                    691: [ (StringToAsciiArray) [ (StringToAsciiArray(s) is StringToIntegerArray(s).)   ]   ] ] {HelpAdd} sendmsg2
                    692: /NewArray {
                    693:  db.DebugStack setstack $In function : NewArray of class PrimitiveObject$  stdstack
                    694:  /Arglist set /Argthis set /FunctionValue [ ] def
                    695:  [/this /n  ] /ArgNames set ArgNames pushVariables [ %%function body
                    696:  [Argthis] Arglist join ArgNames mapset
                    697: this [ %% function args
                    698: n ] {NewVector} sendmsg2
                    699:  /FunctionValue set  {/ExitPoint goto} exec %%return
                    700: /ExitPoint ]pop popVariables %%pop argValues
                    701:  db.DebugStack setstack pop stdstack
                    702: FunctionValue } def
                    703: %%end of function
                    704:
                    705: this [ %% function args
                    706: [ (NewArray) [ (NewArray(n) returns an array of size n (integer n).)   ]   ] ] {HelpAdd} sendmsg2
1.2       takayama  707: /GetEnv {
                    708:  db.DebugStack setstack $In function : GetEnv of class PrimitiveObject$  stdstack
                    709:  /Arglist set /Argthis set /FunctionValue [ ] def
                    710:  [/this /s  ] /ArgNames set ArgNames pushVariables [ %%function body
                    711:  [Argthis] Arglist join ArgNames mapset
                    712:   [(getenv) s] extension /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    713:  db.DebugStack setstack pop stdstack
                    714: FunctionValue } def
                    715: %%end of function
                    716:
                    717: this [ %% function args
                    718: [ (GetEnv) [ (GetEnv(s) returns the value of the environmental variable s (string s).)   ]   ] ] {HelpAdd} sendmsg2
1.3       takayama  719: /Boundp {
                    720:  db.DebugStack setstack $In function : Boundp of class PrimitiveObject$  stdstack
                    721:  /Arglist set /Argthis set /FunctionValue [ ] def
                    722:  [/this /a  ] /ArgNames set ArgNames pushVariables [ %%function body
                    723:  [Argthis] Arglist join ArgNames mapset
                    724: [ %%start of local variables
                    725: /b ] pushVariables [ %%local variables
                    726:  [(parse) [(/)   a   ( load tag 0 eq
                    727:                           { /FunctionValue 0 def }
                    728:                           { /FunctionValue 1 def } ifelse )] cat ] extension /ExitPoint ]pop popVariables %%pop the local variables
                    729: /ExitPoint ]pop popVariables %%pop argValues
                    730:  db.DebugStack setstack pop stdstack
                    731: FunctionValue } def
                    732: %%end of function
                    733:
                    734: this [ %% function args
                    735: [ (Boundp) [ (Boundp(s) checks if the symbol s is bounded to a value or not (string s).)   ]   ] ] {HelpAdd} sendmsg2
                    736: /Rest {
                    737:  db.DebugStack setstack $In function : Rest of class PrimitiveObject$  stdstack
                    738:  /Arglist set /Argthis set /FunctionValue [ ] def
                    739:  [/this /a  ] /ArgNames set ArgNames pushVariables [ %%function body
                    740:  [Argthis] Arglist join ArgNames mapset
                    741:  a   rest /FunctionValue set  /ExitPoint ]pop popVariables %%pop argValues
                    742:  db.DebugStack setstack pop stdstack
                    743: FunctionValue } def
                    744: %%end of function
                    745:
                    746: this [ %% function args
                    747: [ (Rest) [ (Rest(a) returns the rest (cdr) of  a (list a).)   ]   ] ] {HelpAdd} sendmsg2
                    748: /GetPathName {
                    749:  db.DebugStack setstack $In function : GetPathName of class PrimitiveObject$  stdstack
                    750:  /Arglist set /Argthis set /FunctionValue [ ] def
                    751:  [/this /s  ] /ArgNames set ArgNames pushVariables [ %%function body
                    752:  [Argthis] Arglist join ArgNames mapset
                    753: [ %%start of local variables
                    754: /t /sss ] pushVariables [ %%local variables
                    755: s /sss  set
                    756:   [(stat) s] extension 0 get /t set  this [ %% function args
                    757: t ] {Tag} sendmsg2
                    758: (0)..  eq
                    759:  %% if-condition
                    760:   { %%ifbody
                    761: this [ %% function args
                    762: [ this [ %% function args
                    763: (LOAD_K_PATH) ] {GetEnv} sendmsg2
                    764: (/) s   ] ] {AddString} sendmsg2
                    765: /s  set
                    766:   [(stat) s] extension 0 get /t set  this [ %% function args
                    767: t ] {Tag} sendmsg2
                    768: (0)..  eq
                    769:  %% if-condition
                    770:   { %%ifbody
                    771: null  /FunctionValue set  {/ExitPoint goto} exec %%return
                    772:   }%%end if if body
                    773:   { %%if- else part
                    774: s  /FunctionValue set  {/ExitPoint goto} exec %%return
                    775:   } ifelse
                    776:   }%%end if if body
                    777:   { %%if- else part
                    778: s  /FunctionValue set  {/ExitPoint goto} exec %%return
                    779:   } ifelse
                    780: /ExitPoint ]pop popVariables %%pop the local variables
                    781: /ExitPoint ]pop popVariables %%pop argValues
                    782:  db.DebugStack setstack pop stdstack
                    783: FunctionValue } def
                    784: %%end of function
                    785:
                    786: this [ %% function args
                    787: [ (GetPathName) [ (GetPathName(s) checks if the file s exists in the current directory or) (in LOAD_K_PATH. If there exists, it returns the path name (string s).)   ]   ] ] {HelpAdd} sendmsg2
1.4     ! takayama  788: /Load_sm1 {
        !           789:  db.DebugStack setstack $In function : Load_sm1 of class PrimitiveObject$  stdstack
        !           790:  /Arglist set /Argthis set /FunctionValue [ ] def
        !           791:  [/this /fnames /flag  ] /ArgNames set ArgNames pushVariables [ %%function body
        !           792:  [Argthis] Arglist join ArgNames mapset
        !           793: [ %%start of local variables
        !           794: /ppp /n /i /cmd ] pushVariables [ %%local variables
        !           795: this [ %% function args
        !           796: flag ] {Boundp} sendmsg2
        !           797:  %% if-condition
        !           798:   { %%ifbody
        !           799:   }%%end if if body
        !           800:   { %%if- else part
        !           801: this [ %% function args
        !           802: fnames ] {Length} sendmsg2
        !           803: /n  set
        !           804: (0).. /i  set
        !           805: %%for init.
        !           806: %%for
        !           807: { i n  lt
        !           808:  {  } {exit} ifelse
        !           809: [ {%%increment
        !           810: /i i (1).. {add} sendmsg2 def
        !           811: } %%end of increment{A}
        !           812: {%%start of B part{B}
        !           813: this [ %% function args
        !           814: fnames [i  ]  Get
        !           815: ] {GetPathName} sendmsg2
        !           816: /ppp  set
        !           817: this [ %% function args
        !           818: ppp ] {Tag} sendmsg2
        !           819: (0)..  eq not
        !           820:  %% if-condition
        !           821:   { %%ifbody
        !           822:   [(parse) ppp pushfile ] extension  this [ %% function args
        !           823: [ (/) flag ( 1 def )   ] ] {AddString} sendmsg2
        !           824: /cmd  set
        !           825:   [(parse) cmd ] extension  n /i  set
        !           826:   }%%end if if body
        !           827:   { %%if- else part
        !           828:   } ifelse
        !           829: } %% end of B part. {B}
        !           830:  2 1 roll] {exec} map pop
        !           831: } loop %%end of for
        !           832:   } ifelse
        !           833: /ExitPoint ]pop popVariables %%pop the local variables
        !           834: /ExitPoint ]pop popVariables %%pop argValues
        !           835:  db.DebugStack setstack pop stdstack
        !           836: FunctionValue } def
        !           837: %%end of function
        !           838:
        !           839: this [ %% function args
        !           840: [ (Load_sm1) [ (Load_sm1(s,flag) loads a sm1 program from s[0], s[1], ....) (If loading is succeeded, the already-loaded flag is set to true.) ((list s, string flag).)   ]   ] ] {HelpAdd} sendmsg2

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>