File: [local] / OpenXM / src / kan96xx / Doc / callsm1.sm1 (download)
Revision 1.1.1.1 (vendor branch), Fri Oct 8 02:12:02 1999 UTC (24 years, 11 months ago) by maekawa
Branch: OpenXM
CVS Tags: ALPHA Changes since 1.1: +0 -0
lines
o import OpenXM sources
|
%% Library for ox_sm1 to be called from asir cf. xm (callsm1.asir)
%% This file is automatically loaded when ox_sm1 is called
%% with the name ox_sm1_forAsir. See kxx/oxserver00.c.
/whoami { ( SSkan/lib/callsm1.sm1, 1999/6/23. ) message } def
/@@@.Dsymbol (d) def
/@@@.esymbol (e0) def
/toAsirVar {
/arg1 set
[/in-toAsirVar /s /i /ans] pushVariables
[
/s arg1 def
s isArray { s {toAsirVar} map /ans set}
{
s (array) dc /s set
s { /i set
i 64 gt i 91 lt and %% 64 = @, 90 = Z, 96=`,
{
i 68 eq { %% 68 = D, 32 = space.
i 32 add
}
{ i 32 add i } ifelse
}
{ i } ifelse
} map {(string) dc} map cat /ans set
} ifelse
/arg1 ans def
] pop
popVariables
arg1
} def
%%[[(x) (Dx) (E) (T) (Dx0)] toAsirVar ] ::
%%(_xy) toAsirVar ::
/toAsirForm {
/arg1 set
[/in-toAsirForm /aa /ans] pushVariables
[
/aa arg1 def
%% (toAsirForm : ) messagen aa message
aa isArray {
aa {toAsirForm} map /ans set
/toAsirForm.LLL goto
} { } ifelse
aa isPolynomial {
aa (0). eq {
/ans (0). def
} {
/ans [(sm1_dp) aa getvNamesCR toAsirVar aa] def
} ifelse
/toAsirForm.LLL goto
} { } ifelse
aa isInteger {
aa 0 eq {
/ans null def %% You cannot send universalNumber 0 to the current
%% asir 1999, 6/10. Try sm1(" 0 "); sm1_pop();
} {
/ans aa (universalNumber) dc def
} ifelse
/toAsirForm.LLL goto
} { } ifelse
aa isUniversalNumber {
aa (0).. eq {
/ans null def %% You cannot send universalNumber 0 to the current
%% asir
} {
/ans aa def
} ifelse
/toAsirForm.LLL goto
} { } ifelse
/ans aa def
/toAsirForm.LLL
/arg1 ans def
] pop
popVariables
arg1
} def
/foo {[(x) ring_of_polynomials 0] define_ring
(x^2-1). /ff set
[(x) ring_of_differential_operators 0] define_ring
(x^2-1). /gg set
[ff gg 0 1 (123).. [(Hello)]] toAsirForm ::
} def