Annotation of OpenXM/src/kan96xx/Doc/callsm1.sm1, Revision 1.2
1.2 ! takayama 1: %% $OpenXM$
1.1 maekawa 2: %% Library for ox_sm1 to be called from asir cf. xm (callsm1.asir)
3: %% This file is automatically loaded when ox_sm1 is called
4: %% with the name ox_sm1_forAsir. See kxx/oxserver00.c.
1.2 ! takayama 5: /whoami { ( SSkan/lib/callsm1.sm1, 1999/11/9. ) message } def
1.1 maekawa 6:
7: /@@@.Dsymbol (d) def
8: /@@@.esymbol (e0) def
9:
10: /toAsirVar {
11: /arg1 set
12: [/in-toAsirVar /s /i /ans] pushVariables
13: [
14: /s arg1 def
15: s isArray { s {toAsirVar} map /ans set}
16: {
17: s (array) dc /s set
18: s { /i set
19: i 64 gt i 91 lt and %% 64 = @, 90 = Z, 96=`,
20: {
21: i 68 eq { %% 68 = D, 32 = space.
22: i 32 add
23: }
24: { i 32 add i } ifelse
25: }
26: { i } ifelse
27: } map {(string) dc} map cat /ans set
28: } ifelse
29: /arg1 ans def
30: ] pop
31: popVariables
32: arg1
33: } def
34:
35: %%[[(x) (Dx) (E) (T) (Dx0)] toAsirVar ] ::
36: %%(_xy) toAsirVar ::
37:
38: /toAsirForm {
39: /arg1 set
40: [/in-toAsirForm /aa /ans] pushVariables
41: [
42: /aa arg1 def
43: %% (toAsirForm : ) messagen aa message
44: aa isArray {
45: aa {toAsirForm} map /ans set
46: /toAsirForm.LLL goto
47: } { } ifelse
48: aa isPolynomial {
49: aa (0). eq {
50: /ans (0). def
51: } {
52: /ans [(sm1_dp) aa getvNamesCR toAsirVar aa] def
53: } ifelse
54: /toAsirForm.LLL goto
55: } { } ifelse
56: aa isInteger {
57: aa 0 eq {
58: /ans null def %% You cannot send universalNumber 0 to the current
59: %% asir 1999, 6/10. Try sm1(" 0 "); sm1_pop();
60: } {
61: /ans aa (universalNumber) dc def
62: } ifelse
63: /toAsirForm.LLL goto
64: } { } ifelse
65: aa isUniversalNumber {
66: aa (0).. eq {
67: /ans null def %% You cannot send universalNumber 0 to the current
68: %% asir
69: } {
70: /ans aa def
71: } ifelse
72: /toAsirForm.LLL goto
73: } { } ifelse
74:
75:
76: /ans aa def
77:
78: /toAsirForm.LLL
79: /arg1 ans def
80: ] pop
81: popVariables
82: arg1
83: } def
84:
85: /foo {[(x) ring_of_polynomials 0] define_ring
86: (x^2-1). /ff set
87: [(x) ring_of_differential_operators 0] define_ring
88: (x^2-1). /gg set
89: [ff gg 0 1 (123).. [(Hello)]] toAsirForm ::
90: } def
91:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>